summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDimitri van Heesch <doxygen@gmail.com>2021-04-29 17:26:11 (GMT)
committerGitHub <noreply@github.com>2021-04-29 17:26:11 (GMT)
commitb8a3ff6c33264c43cdf30c04baa9793e7e8d51a2 (patch)
tree9d60ced4b8fceb00c068b56d699c1ba57540d415
parent4dba9fbdda10889d2285b85b7e9ff6282b34fccf (diff)
parentc6d77227efaf332a5d24bc12d32f4b1fec6b13b9 (diff)
downloadDoxygen-b8a3ff6c33264c43cdf30c04baa9793e7e8d51a2.zip
Doxygen-b8a3ff6c33264c43cdf30c04baa9793e7e8d51a2.tar.gz
Doxygen-b8a3ff6c33264c43cdf30c04baa9793e7e8d51a2.tar.bz2
Merge branch 'master' into feature/bug_305773
-rw-r--r--.github/workflows/build_cmake.yml35
-rw-r--r--.gitignore2
-rw-r--r--CMakeLists.txt4
-rw-r--r--Doxyfile17
-rw-r--r--addon/doxmlparser/CMakeLists.txt24
-rw-r--r--addon/doxmlparser/Doxyfile334
-rw-r--r--addon/doxmlparser/Doxyfile.impl334
-rw-r--r--addon/doxmlparser/LICENSE (renamed from qtools/LICENSE.GPL)52
-rw-r--r--addon/doxmlparser/README.md10
-rw-r--r--addon/doxmlparser/doxmlparser/__init__.py2
-rw-r--r--addon/doxmlparser/doxmlparser/compound.py22358
-rw-r--r--addon/doxmlparser/doxmlparser/index.py1621
-rw-r--r--addon/doxmlparser/examples/CMakeLists.txt2
-rw-r--r--addon/doxmlparser/examples/dump/dump.py31
-rw-r--r--addon/doxmlparser/examples/metrics/CMakeLists.txt18
-rw-r--r--addon/doxmlparser/examples/metrics/main.cpp271
-rw-r--r--addon/doxmlparser/examples/metrics/metrics.py225
-rw-r--r--addon/doxmlparser/include/doxmlintf.h1141
-rw-r--r--addon/doxmlparser/requirements.txt2
-rw-r--r--addon/doxmlparser/setup.py19
-rw-r--r--addon/doxmlparser/src/CMakeLists.txt18
-rw-r--r--addon/doxmlparser/src/basehandler.cpp3
-rw-r--r--addon/doxmlparser/src/basehandler.h325
-rw-r--r--addon/doxmlparser/src/baseiterator.h50
-rw-r--r--addon/doxmlparser/src/compoundhandler.cpp655
-rw-r--r--addon/doxmlparser/src/compoundhandler.h237
-rw-r--r--addon/doxmlparser/src/debug.cpp24
-rw-r--r--addon/doxmlparser/src/debug.h7
-rw-r--r--addon/doxmlparser/src/dochandler.cpp2240
-rw-r--r--addon/doxmlparser/src/dochandler.h1352
-rw-r--r--addon/doxmlparser/src/graphhandler.cpp216
-rw-r--r--addon/doxmlparser/src/graphhandler.h154
-rw-r--r--addon/doxmlparser/src/linkedtexthandler.cpp133
-rw-r--r--addon/doxmlparser/src/linkedtexthandler.h54
-rw-r--r--addon/doxmlparser/src/loamhandler.cpp77
-rw-r--r--addon/doxmlparser/src/loamhandler.h52
-rw-r--r--addon/doxmlparser/src/mainhandler.cpp301
-rw-r--r--addon/doxmlparser/src/mainhandler.h82
-rw-r--r--addon/doxmlparser/src/memberhandler.cpp600
-rw-r--r--addon/doxmlparser/src/memberhandler.h252
-rw-r--r--addon/doxmlparser/src/paramhandler.cpp158
-rw-r--r--addon/doxmlparser/src/paramhandler.h103
-rw-r--r--addon/doxmlparser/src/sectionhandler.cpp170
-rw-r--r--addon/doxmlparser/src/sectionhandler.h102
-rw-r--r--addon/doxmlparser/src/stringimpl.h38
-rw-r--r--addon/doxmlparser/test/CMakeLists.txt18
-rw-r--r--addon/doxmlparser/test/main.cpp776
-rw-r--r--addon/doxyapp/CMakeLists.txt3
-rw-r--r--addon/doxyapp/doxyapp.cpp41
-rw-r--r--addon/doxyparse/CMakeLists.txt3
-rw-r--r--addon/doxyparse/doxyparse.cpp65
-rw-r--r--addon/doxysearch/CMakeLists.txt4
-rw-r--r--addon/doxysearch/doxyindexer.cpp123
-rw-r--r--addon/doxywizard/CMakeLists.txt1
-rwxr-xr-xaddon/doxywizard/doxywizard.cpp4
-rw-r--r--addon/doxywizard/expert.cpp16
-rw-r--r--addon/doxywizard/inputstrlist.cpp6
-rwxr-xr-xcmake/FindJavacc.cmake12
-rw-r--r--cmake/FindgenerateDS.cmake19
-rw-r--r--doc/CMakeLists.txt1
-rw-r--r--doc/changelog.doc10
-rw-r--r--doc/commands.doc14
-rw-r--r--doc/customize.doc144
-rw-r--r--doc/faq.doc18
-rw-r--r--doc/features.doc2
-rw-r--r--doc/install.doc6
-rw-r--r--doc/install_prefix2
-rw-r--r--doc/preprocessing.doc4
-rw-r--r--doc/searching.doc6
-rw-r--r--doc/starting.doc7
-rw-r--r--doc/trouble.doc5
-rw-r--r--doc/xmlcmds.doc2
-rw-r--r--filesystem/filesystem.hpp5868
-rw-r--r--libmd5/md5.c20
-rw-r--r--libmd5/md5.h2
-rw-r--r--libxml/CMakeLists.txt19
-rw-r--r--libxml/xml.h (renamed from src/xml.h)18
-rw-r--r--libxml/xml.l (renamed from src/xml.l)21
-rw-r--r--qtools/CMakeLists.txt48
-rw-r--r--qtools/Doxyfile320
-rw-r--r--qtools/LICENSE.QPL103
-rw-r--r--qtools/Makefile.in31
-rw-r--r--qtools/README4
-rw-r--r--qtools/qarray.doc486
-rw-r--r--qtools/qarray.h110
-rw-r--r--qtools/qasciidict.h107
-rw-r--r--qtools/qbuffer.cpp465
-rw-r--r--qtools/qbuffer.h98
-rw-r--r--qtools/qcollection.cpp182
-rw-r--r--qtools/qcollection.h73
-rw-r--r--qtools/qconfig.h1
-rw-r--r--qtools/qcstringlist.cpp192
-rw-r--r--qtools/qcstringlist.h51
-rw-r--r--qtools/qdatastream.cpp944
-rw-r--r--qtools/qdatastream.h173
-rw-r--r--qtools/qdatetime.cpp1455
-rw-r--r--qtools/qdatetime.h217
-rw-r--r--qtools/qdict.doc492
-rw-r--r--qtools/qdict.h49
-rw-r--r--qtools/qdir.cpp1200
-rw-r--r--qtools/qdir.h235
-rw-r--r--qtools/qdir_unix.cpp290
-rw-r--r--qtools/qdir_win32.cpp485
-rw-r--r--qtools/qfeatures.h978
-rw-r--r--qtools/qfile.cpp550
-rw-r--r--qtools/qfile.h128
-rw-r--r--qtools/qfile_unix.cpp669
-rw-r--r--qtools/qfile_win32.cpp678
-rw-r--r--qtools/qfiledefs_p.h268
-rw-r--r--qtools/qfileinfo.cpp458
-rw-r--r--qtools/qfileinfo.h138
-rw-r--r--qtools/qfileinfo_unix.cpp425
-rw-r--r--qtools/qfileinfo_win32.cpp357
-rw-r--r--qtools/qgarray.cpp747
-rw-r--r--qtools/qgarray.h120
-rw-r--r--qtools/qgdict.cpp1217
-rw-r--r--qtools/qgdict.h222
-rw-r--r--qtools/qgeneric.h43
-rw-r--r--qtools/qglist.cpp1203
-rw-r--r--qtools/qglist.h254
-rw-r--r--qtools/qglobal.cpp685
-rw-r--r--qtools/qglobal.h626
-rw-r--r--qtools/qgstring.cpp258
-rw-r--r--qtools/qgstring.h139
-rw-r--r--qtools/qintdict.doc475
-rw-r--r--qtools/qintdict.h102
-rw-r--r--qtools/qinternallist.h138
-rw-r--r--qtools/qiodevice.cpp638
-rw-r--r--qtools/qiodevice.h155
-rw-r--r--qtools/qlist.doc1035
-rw-r--r--qtools/qlist.h158
-rw-r--r--qtools/qmap.cpp254
-rw-r--r--qtools/qmap.h607
-rw-r--r--qtools/qmodules.h11
-rw-r--r--qtools/qptrdict.doc486
-rw-r--r--qtools/qptrdict.h103
-rw-r--r--qtools/qqueue.h70
-rw-r--r--qtools/qregexp.cpp1093
-rw-r--r--qtools/qregexp.h92
-rw-r--r--qtools/qshared.h57
-rw-r--r--qtools/qsortedlist.doc94
-rw-r--r--qtools/qsortedlist.h59
-rw-r--r--qtools/qstack.doc135
-rw-r--r--qtools/qstack.h71
-rw-r--r--qtools/qstring.cpp15426
-rw-r--r--qtools/qstring.h879
-rw-r--r--qtools/qstringlist.cpp307
-rw-r--r--qtools/qstringlist.h82
-rw-r--r--qtools/qstrlist.doc5
-rw-r--r--qtools/qstrlist.h109
-rw-r--r--qtools/qstrvec.h90
-rw-r--r--qtools/qtextcodec.cpp2071
-rw-r--r--qtools/qtextcodec.h104
-rw-r--r--qtools/qtextstream.cpp2237
-rw-r--r--qtools/qtextstream.h351
-rw-r--r--qtools/qtl.doc249
-rw-r--r--qtools/qtl.h223
-rw-r--r--qtools/qutfcodec.cpp276
-rw-r--r--qtools/qutfcodec.h71
-rw-r--r--qtools/qvaluelist.doc772
-rw-r--r--qtools/qvaluelist.h455
-rw-r--r--qtools/qvaluestack.h64
-rw-r--r--qtools/qxml.cpp6061
-rw-r--r--qtools/qxml.h671
-rw-r--r--src/CMakeLists.txt22
-rw-r--r--src/arguments.h2
-rw-r--r--src/bufstr.h25
-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.cpp37
-rw-r--r--src/clangparser.h6
-rw-r--r--src/classdef.cpp1062
-rw-r--r--src/classdef.h159
-rw-r--r--src/classlist.cpp2
-rw-r--r--src/classlist.h2
-rw-r--r--src/cmdmapper.cpp33
-rw-r--r--src/cmdmapper.h48
-rw-r--r--src/code.h11
-rw-r--r--src/code.l999
-rw-r--r--src/commentcnv.h9
-rw-r--r--src/commentcnv.l206
-rw-r--r--src/commentscan.h12
-rw-r--r--src/commentscan.l551
-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.xml101
-rwxr-xr-xsrc/configgen.py10
-rw-r--r--src/configimpl.h156
-rw-r--r--src/configimpl.l567
-rw-r--r--src/constexp.h13
-rw-r--r--src/constexp.l11
-rw-r--r--src/constexp.y49
-rw-r--r--src/constexp_p.h18
-rw-r--r--src/containers.h1
-rw-r--r--src/context.cpp667
-rw-r--r--src/context.h92
-rw-r--r--src/cppvalue.cpp45
-rw-r--r--src/cppvalue.h31
-rw-r--r--src/debug.cpp16
-rw-r--r--src/debug.h9
-rw-r--r--src/declinfo.h8
-rw-r--r--src/declinfo.l27
-rw-r--r--src/defargs.h2
-rw-r--r--src/defargs.l63
-rw-r--r--src/defgen.cpp347
-rw-r--r--src/define.h2
-rw-r--r--src/definition.cpp255
-rw-r--r--src/definition.h47
-rw-r--r--src/definitionimpl.h72
-rw-r--r--src/dia.cpp28
-rw-r--r--src/dia.h11
-rw-r--r--src/diagram.cpp528
-rw-r--r--src/diagram.h11
-rw-r--r--src/dir.cpp303
-rw-r--r--src/dir.h104
-rw-r--r--src/dirdef.cpp235
-rw-r--r--src/dirdef.h44
-rw-r--r--src/docbookgen.cpp543
-rw-r--r--src/docbookgen.h175
-rw-r--r--src/docbookvisitor.cpp420
-rw-r--r--src/docbookvisitor.h32
-rw-r--r--src/docgroup.cpp32
-rw-r--r--src/docgroup.h17
-rw-r--r--src/docparser.cpp1599
-rw-r--r--src/docparser.h182
-rw-r--r--src/docsets.cpp363
-rw-r--r--src/docsets.h62
-rw-r--r--src/doctokenizer.h12
-rw-r--r--src/doctokenizer.l164
-rw-r--r--src/docvisitor.cpp19
-rw-r--r--src/docvisitor.h8
-rw-r--r--src/dot.cpp69
-rw-r--r--src/dot.h16
-rw-r--r--src/dotcallgraph.cpp75
-rw-r--r--src/dotcallgraph.h14
-rw-r--r--src/dotclassgraph.cpp215
-rw-r--r--src/dotclassgraph.h22
-rw-r--r--src/dotdirdeps.cpp49
-rw-r--r--src/dotdirdeps.h8
-rw-r--r--src/dotfilepatcher.cpp285
-rw-r--r--src/dotfilepatcher.h22
-rw-r--r--src/dotgfxhierarchytable.cpp66
-rw-r--r--src/dotgfxhierarchytable.h10
-rw-r--r--src/dotgraph.cpp142
-rw-r--r--src/dotgraph.h29
-rw-r--r--src/dotgroupcollaboration.cpp146
-rw-r--r--src/dotgroupcollaboration.h23
-rw-r--r--src/dotincldepgraph.cpp173
-rw-r--r--src/dotincldepgraph.h17
-rw-r--r--src/dotlegendgraph.cpp11
-rw-r--r--src/dotlegendgraph.h2
-rw-r--r--src/dotnode.cpp570
-rw-r--r--src/dotnode.h60
-rw-r--r--src/dotrunner.cpp112
-rw-r--r--src/dotrunner.h27
-rw-r--r--src/doxygen.cpp2111
-rw-r--r--src/doxygen.h27
-rw-r--r--src/eclipsehelp.cpp100
-rw-r--r--src/eclipsehelp.h27
-rw-r--r--src/emoji.cpp18
-rw-r--r--src/emoji.h12
-rw-r--r--src/entry.cpp15
-rw-r--r--src/entry.h16
-rw-r--r--src/example.h2
-rw-r--r--src/filedef.cpp687
-rw-r--r--src/filedef.h129
-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.cpp271
-rw-r--r--src/formula.h18
-rw-r--r--src/fortrancode.h4
-rw-r--r--src/fortrancode.l261
-rw-r--r--src/fortranscanner.h4
-rwxr-xr-x[-rw-r--r--]src/fortranscanner.l431
-rw-r--r--src/ftextstream.cpp260
-rw-r--r--src/ftextstream.h77
-rw-r--r--src/ftvhelp.cpp255
-rw-r--r--src/ftvhelp.h36
-rw-r--r--src/groupdef.cpp334
-rw-r--r--src/groupdef.h22
-rw-r--r--src/growbuf.h47
-rw-r--r--src/htags.cpp63
-rw-r--r--src/htmlattrib.h61
-rw-r--r--src/htmldocvisitor.cpp432
-rw-r--r--src/htmldocvisitor.h36
-rw-r--r--src/htmlentity.cpp14
-rw-r--r--src/htmlentity.h10
-rw-r--r--src/htmlgen.cpp1468
-rw-r--r--src/htmlgen.h255
-rw-r--r--src/htmlhelp.cpp137
-rw-r--r--src/htmlhelp.h16
-rw-r--r--src/image.cpp65
-rw-r--r--src/image.h24
-rw-r--r--src/index.cpp1055
-rw-r--r--src/index.h68
-rw-r--r--src/language.cpp6
-rw-r--r--src/language.h8
-rw-r--r--src/latexdocvisitor.cpp299
-rw-r--r--src/latexdocvisitor.h76
-rw-r--r--src/latexgen.cpp1157
-rw-r--r--src/latexgen.h235
-rw-r--r--src/layout.cpp128
-rw-r--r--src/layout.h45
-rw-r--r--src/lexcode.h57
-rw-r--r--src/lexcode.l1267
-rw-r--r--src/lexscanner.h43
-rw-r--r--src/lexscanner.l1016
-rw-r--r--src/linkedmap.h144
-rw-r--r--src/mandocvisitor.cpp373
-rw-r--r--src/mandocvisitor.h40
-rw-r--r--src/mangen.cpp305
-rw-r--r--src/mangen.h138
-rw-r--r--src/markdown.cpp218
-rw-r--r--src/markdown.h10
-rw-r--r--src/memberdef.cpp1272
-rw-r--r--src/memberdef.h99
-rw-r--r--src/membergroup.cpp128
-rw-r--r--src/membergroup.h31
-rw-r--r--src/memberlist.cpp276
-rw-r--r--src/memberlist.h101
-rw-r--r--src/membername.h16
-rw-r--r--src/message.cpp98
-rw-r--r--src/message.h14
-rw-r--r--src/msc.cpp79
-rw-r--r--src/msc.h16
-rw-r--r--src/namespacedef.cpp259
-rw-r--r--src/namespacedef.h20
-rw-r--r--src/outputgen.cpp27
-rw-r--r--src/outputgen.h148
-rw-r--r--src/outputlist.cpp8
-rw-r--r--src/outputlist.h136
-rw-r--r--src/pagedef.cpp38
-rw-r--r--src/pagedef.h8
-rw-r--r--src/parserintf.h42
-rw-r--r--src/perlmodgen.cpp482
-rw-r--r--src/plantuml.cpp174
-rw-r--r--src/plantuml.h50
-rw-r--r--src/portable.cpp205
-rw-r--r--src/portable.h32
-rw-r--r--src/portable_c.c6
-rw-r--r--src/pre.h11
-rw-r--r--src/pre.l815
-rw-r--r--src/printdocvisitor.h155
-rw-r--r--src/pycode.h4
-rw-r--r--src/pycode.l150
-rw-r--r--src/pyscanner.h4
-rw-r--r--src/pyscanner.l292
-rw-r--r--src/qcstring.cpp (renamed from qtools/qcstring.cpp)166
-rw-r--r--src/qcstring.h (renamed from qtools/qcstring.h)270
-rw-r--r--src/qhp.cpp91
-rw-r--r--src/qhp.h20
-rw-r--r--src/qhpxmlwriter.cpp76
-rw-r--r--src/qhpxmlwriter.h47
-rw-r--r--src/reflist.cpp10
-rw-r--r--src/reflist.h19
-rw-r--r--src/regex.cpp757
-rw-r--r--src/regex.h336
-rw-r--r--src/resourcemgr.cpp63
-rw-r--r--src/resourcemgr.h12
-rw-r--r--src/rtfdocvisitor.cpp438
-rw-r--r--src/rtfdocvisitor.h36
-rw-r--r--src/rtfgen.cpp1905
-rw-r--r--src/rtfgen.h162
-rw-r--r--src/rtfstyle.cpp232
-rw-r--r--src/rtfstyle.h23
-rw-r--r--src/scanner.h4
-rw-r--r--src/scanner.l988
-rw-r--r--src/scopedtypevariant.h5
-rw-r--r--src/searchindex.cpp361
-rw-r--r--src/searchindex.h24
-rw-r--r--src/section.h28
-rw-r--r--src/sortdict.h420
-rw-r--r--src/sqlcode.h4
-rw-r--r--src/sqlcode.l20
-rw-r--r--src/sqlite3gen.cpp359
-rw-r--r--src/stlsupport.cpp2
-rw-r--r--src/symbolmap.h16
-rw-r--r--src/symbolresolver.cpp108
-rw-r--r--src/symbolresolver.h5
-rw-r--r--src/tagreader.cpp379
-rwxr-xr-x[-rw-r--r--]src/template.cpp1159
-rw-r--r--src/template.h20
-rw-r--r--src/textdocvisitor.cpp15
-rw-r--r--src/textdocvisitor.h24
-rw-r--r--src/textstream.h251
-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.h26
-rw-r--r--src/utf8.cpp233
-rw-r--r--src/utf8.h72
-rw-r--r--src/util.cpp2302
-rw-r--r--src/util.h209
-rw-r--r--src/vhdlcode.h4
-rw-r--r--src/vhdlcode.l273
-rw-r--r--src/vhdldocgen.cpp1186
-rw-r--r--src/vhdldocgen.h83
-rw-r--r--src/vhdljjparser.cpp136
-rwxr-xr-xsrc/vhdljjparser.h15
-rw-r--r--src/xmlcode.h4
-rw-r--r--src/xmlcode.l18
-rw-r--r--src/xmldocvisitor.cpp202
-rw-r--r--src/xmldocvisitor.h33
-rw-r--r--src/xmlgen.cpp1021
-rw-r--r--src/xmlgen.h42
-rw-r--r--templates/general/layout_default.xml14
-rw-r--r--templates/html/doxygen.css6
-rw-r--r--templates/html/htmllayout.tpl2
-rw-r--r--templates/latex/doxygen.sty12
-rwxr-xr-xtemplates/latex/tabu_doxygen.sty5114
-rw-r--r--templates/xml/compound.xsd16
-rw-r--r--templates/xml/index.xsd1
-rw-r--r--testing/011/interface_integer.xml10
-rw-r--r--testing/014/indexpage.xml2
-rw-r--r--testing/027/struct_car.xml36
-rw-r--r--testing/027/struct_object.xml20
-rw-r--r--testing/027/struct_truck.xml12
-rw-r--r--testing/027/struct_vehicle.xml24
-rw-r--r--vhdlparser/CMakeLists.txt7
-rw-r--r--vhdlparser/VhdlParser.cc217
-rw-r--r--vhdlparser/VhdlParser.h2024
-rw-r--r--vhdlparser/VhdlParserTokenManager.cc4
-rw-r--r--vhdlparser/vhdl_adj.py2
-rwxr-xr-xvhdlparser/vhdlparser.jj236
472 files changed, 64744 insertions, 91840 deletions
diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml
index 555319e..bf207bc 100644
--- a/.github/workflows/build_cmake.yml
+++ b/.github/workflows/build_cmake.yml
@@ -15,28 +15,28 @@ jobs:
os: ubuntu-18.04,
build_type: "Release", cc: "gcc", cxx: "g++",
build_gen: "Unix Makefiles",
- cmake_extra_opts: "-Dbuild_search=YES -Dbuild_app=YES -Dbuild_parse=YES -Dbuild_xmlparser=YES"
+ cmake_extra_opts: "-Dbuild_search=YES -Dbuild_app=YES -Dbuild_parse=YES -Dbuild_xmlparser=YES -Duse_sqlite3=ON"
}
- {
name: "Ubuntu Latest GCC Debug",
os: ubuntu-18.04,
build_type: "Debug", cc: "gcc", cxx: "g++",
build_gen: "Unix Makefiles",
- cmake_extra_opts: "-Dbuild_search=YES -Dbuild_app=YES -Dbuild_parse=YES -Dbuild_xmlparser=YES"
+ cmake_extra_opts: "-Dbuild_search=YES -Dbuild_app=YES -Dbuild_parse=YES -Dbuild_xmlparser=YES -Duse_sqlite3=ON"
}
- {
name: "Ubuntu Latest Clang Release",
os: ubuntu-20.04,
build_type: "Release", cc: "clang", cxx: "clang++",
build_gen: "Unix Makefiles",
- cmake_extra_opts: "-Duse_libclang=YES -Dstatic_libclang=YES -Duse_libc++=NO"
+ cmake_extra_opts: "-Duse_libclang=YES -Dstatic_libclang=YES -Duse_libc++=NO -Duse_sqlite3=ON"
}
- {
name: "Ubuntu Latest Clang Debug",
os: ubuntu-20.04,
build_type: "Debug", cc: "clang", cxx: "clang++",
build_gen: "Unix Makefiles",
- cmake_extra_opts: "-Duse_libclang=YES -Dstatic_libclang=YES -Duse_libc++=NO"
+ cmake_extra_opts: "-Duse_libclang=YES -Dstatic_libclang=YES -Duse_libc++=NO -Duse_sqlite3=ON"
}
- {
name: "macOS Latest Release",
@@ -63,7 +63,8 @@ jobs:
build_gen: "NMake Makefiles"
}
steps:
- - uses: actions/checkout@v1
+ - name: Checkout doxygen
+ uses: actions/checkout@v1
- name: Download MikTex (Windows)
run: |
@@ -73,15 +74,16 @@ jobs:
Do {
$attemptCount++;
Try {
- $wc.DownloadFile("https://ctan.math.illinois.edu/systems/win32/miktex/setup/windows-x64/miktexsetup-4.0-x64.zip","miktexsetup-4.0-x64.zip")
+ $wc.DownloadFile("https://ctan.math.illinois.edu/systems/win32/miktex/setup/windows-x64/miktexsetup-4.1-x64.zip","miktexsetup-4.1-x64.zip")
} Catch [Exception] {
Write-Host $_.Exception | format-list -force
}
- } while (((Test-Path "miktexsetup-x64.zip") -eq $false) -and ($attemptCount -le $maxAttempts))
+ } while (((Test-Path "miktexsetup-4.1-x64.zip") -eq $false) -and ($attemptCount -le $maxAttempts))
shell: pwsh
if: matrix.config.os == 'windows-latest'
- - uses: suisei-cn/actions-download-file@v1
+ - name: Install libiconv (Windows)
+ uses: suisei-cn/actions-download-file@v1
with:
url: "https://github.com/pffang/libiconv-for-Windows/releases/download/v1.16/libiconv-for-Windows_1.16.7z"
target: .
@@ -100,7 +102,8 @@ jobs:
- name: Install libclang (Ubuntu 20.04)
run: |
sudo apt remove llvm-8 clang-8 libclang-common-8-dev clang-format-8 libllvm8
- #sudo apt remove llvm-10 llvm-10-dev llvm-10-tools llvm-10-runtime clang-10 clang-format-10 libclang-common-10-dev libclang-cpp10 libclang1-10 libllvm10
+ sudo apt remove llvm-9 llvm-9-dev llvm-9-tools llvm-9-runtime clang-9 libclang-common-9-dev clang-format-9 libllvm9
+ sudo apt remove llvm-11 llvm-11-dev llvm-11-tools llvm-11-runtime clang-11 clang-format-11 libclang-common-11-dev libclang-cpp11 libclang1-11 libllvm11
sudo apt-get autoremove
sudo apt-get clean
#sudo apt install libclang-9-dev libclang-common-9-dev
@@ -118,13 +121,13 @@ jobs:
- name: Extract MikTex zip (Windows)
shell: bash
run: |
- unzip miktexsetup-4.0-x64.zip
+ unzip miktexsetup-4.1-x64.zip
if: matrix.config.os == 'windows-latest'
- name: Download MikTex packages (Windows)
shell: bash
run: |
- ./miktexsetup --verbose \
+ ./miktexsetup_standalone --verbose \
--local-package-repository=C:/miktex-repository \
--remote-package-repository="https://ctan.math.illinois.edu/systems/win32/miktex/tm/packages/" \
--package-set=essential \
@@ -134,7 +137,7 @@ jobs:
- name: Install MikTex packages (Windows)
shell: bash
run: |
- ./miktexsetup --local-package-repository=C:/miktex-repository \
+ ./miktexsetup_standalone --local-package-repository=C:/miktex-repository \
--package-set=essential \
--shared \
install
@@ -162,10 +165,10 @@ jobs:
- name: Setting Ghostscript paths (Windows)
shell: bash
run: |
- echo "C:/Program Files (x86)/gs/gs9.53.3/bin/" >> $GITHUB_PATH
- echo "C:/Program Files/gs/gs9.53.3/bin/" >> $GITHUB_PATH
- export PATH="/c/Program Files (x86)/gs/gs9.53.3/bin/:$PATH"
- export PATH="/c/Program Files/gs/gs9.53.3/bin/:$PATH"
+ export GSpath=`find /c/Prog*/gs -name gswin\*c.exe | sed -e "s/gswin.*c.exe//"`
+ export PATH="$GSpath:$PATH"
+ export GSpath=`echo "$GSpath" | sed -e "s%/c%C:%"`
+ echo "$GSpath" >> $GITHUB_PATH
if: matrix.config.os == 'windows-latest'
- name: Install xmllint (Linux)
diff --git a/.gitignore b/.gitignore
index b599b7a..987aa13 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,6 +14,8 @@
/doxygen_docs
/doxygen.tag
/build*
+/qtools_docs
+/warnings.log
tags
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 06b9696..251e18b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,7 +17,7 @@ project(doxygen)
option(build_wizard "Build the GUI frontend for doxygen." OFF)
option(build_app "Example showing how to embed doxygen in an application." OFF)
option(build_parse "Parses source code and dumps the dependencies between the code elements." OFF)
-option(build_xmlparser "Example showing how to parse doxygen's XML output." OFF)
+option(build_xmlparser "Automatically update the XML parser modules when updating the schema files." OFF)
option(build_search "Build external search tools (doxysearch and doxyindexer)" OFF)
option(build_doc "Build user manual (HTML and PDF)" OFF)
option(build_doc_chm "Build user manual (CHM)" OFF)
@@ -173,7 +173,7 @@ add_subdirectory(libmd5)
add_subdirectory(liblodepng)
add_subdirectory(libmscgen)
add_subdirectory(libversion)
-add_subdirectory(qtools)
+add_subdirectory(libxml)
add_subdirectory(vhdlparser)
add_subdirectory(src)
diff --git a/Doxyfile b/Doxyfile
index 44eb5b5..09dfe45 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -1,4 +1,3 @@
-# Doxyfile 1.8.16
#---------------------------------------------------------------------------
# Project related configuration options
@@ -12,7 +11,6 @@ OUTPUT_DIRECTORY = doxygen_docs
CREATE_SUBDIRS = YES
ALLOW_UNICODE_NAMES = NO
OUTPUT_LANGUAGE = English
-OUTPUT_TEXT_DIRECTION = None
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF =
@@ -106,10 +104,13 @@ WARN_LOGFILE = warnings.log
# Configuration options related to the input files
#---------------------------------------------------------------------------
INPUT = src \
- vhdlparser
+ vhdlparser \
+ libxml
INPUT_ENCODING = UTF-8
FILE_PATTERNS = *.h \
+ *.hpp \
*.cpp \
+ *.l \
*.md
RECURSIVE = NO
EXCLUDE =
@@ -129,7 +130,7 @@ USE_MDFILE_AS_MAINPAGE =
# Configuration options related to source browsing
#---------------------------------------------------------------------------
SOURCE_BROWSER = YES
-INLINE_SOURCES = NO
+INLINE_SOURCES = YES
STRIP_CODE_COMMENTS = NO
REFERENCED_BY_RELATION = YES
REFERENCES_RELATION = YES
@@ -141,7 +142,6 @@ VERBATIM_HEADERS = YES
# Configuration options related to the alphabetical class index
#---------------------------------------------------------------------------
ALPHABETICAL_INDEX = YES
-COLS_IN_ALPHA_INDEX = 5
IGNORE_PREFIX =
#---------------------------------------------------------------------------
# Configuration options related to the HTML output
@@ -274,8 +274,7 @@ ENABLE_PREPROCESSING = YES
MACRO_EXPANSION = YES
EXPAND_ONLY_PREDEF = YES
SEARCH_INCLUDES = YES
-INCLUDE_PATH = qtools \
- libmd5 \
+INCLUDE_PATH = libmd5 \
liblodepng \
libmscgen
INCLUDE_FILE_PATTERNS =
@@ -285,7 +284,7 @@ SKIP_FUNCTION_MACROS = YES
#---------------------------------------------------------------------------
# Configuration options related to external references
#---------------------------------------------------------------------------
-TAGFILES = qtools_docs/qtools.tag=../../qtools_docs/html
+TAGFILES =
GENERATE_TAGFILE = doxygen.tag
ALLEXTERNALS = NO
EXTERNAL_GROUPS = YES
@@ -328,5 +327,5 @@ DOT_TRANSPARENT = NO
DOT_MULTI_TARGETS = NO
GENERATE_LEGEND = YES
DOT_CLEANUP = NO
-DOT_MAX_FOLD = 17
+DOT_WRAP_THRESHOLD = 17
DOT_UML_DETAILS = NO
diff --git a/addon/doxmlparser/CMakeLists.txt b/addon/doxmlparser/CMakeLists.txt
index 8456d2a..6ef5568 100644
--- a/addon/doxmlparser/CMakeLists.txt
+++ b/addon/doxmlparser/CMakeLists.txt
@@ -1,4 +1,22 @@
+find_package(generateDS)
+if (GENERATEDS_FOUND)
+ add_custom_command(
+ COMMENT "Updating index.py from index.xsd..."
+ COMMAND ${GENERATEDS_EXECUTABLE} --no-dates --no-versions -f -o ${PROJECT_SOURCE_DIR}/addon/doxmlparser/doxmlparser/index.py ${PROJECT_SOURCE_DIR}/templates/xml/index.xsd
+ DEPENDS ${PROJECT_SOURCE_DIR}/templates/xml/index.xsd
+ OUTPUT ${PROJECT_SOURCE_DIR}/addon/doxmlparser/doxmlparser/index.py
+ )
+ add_custom_command(
+ COMMENT "Updating compound.py from compound.xsd..."
+ COMMAND ${GENERATEDS_EXECUTABLE} --no-dates --no-versions -f -o ${PROJECT_SOURCE_DIR}/addon/doxmlparser/doxmlparser/compound.py ${PROJECT_SOURCE_DIR}/templates/xml/compound.xsd
+ DEPENDS ${PROJECT_SOURCE_DIR}/templates/xml/compound.xsd
+ OUTPUT ${PROJECT_SOURCE_DIR}/addon/doxmlparser/doxmlparser/compound.py
+ )
+ add_custom_target(
+ update_doxmlparser_files ALL
+ DEPENDS ${PROJECT_SOURCE_DIR}/addon/doxmlparser/doxmlparser/index.py
+ DEPENDS ${PROJECT_SOURCE_DIR}/addon/doxmlparser/doxmlparser/compound.py
+ COMMENT "Updating doxmlparser module..."
+ )
+endif()
-add_subdirectory(src)
-add_subdirectory(examples)
-add_subdirectory(test)
diff --git a/addon/doxmlparser/Doxyfile b/addon/doxmlparser/Doxyfile
deleted file mode 100644
index 18359a0..0000000
--- a/addon/doxmlparser/Doxyfile
+++ /dev/null
@@ -1,334 +0,0 @@
-# Doxyfile 1.8.17
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-DOXYFILE_ENCODING = UTF-8
-PROJECT_NAME = doxmlparser
-PROJECT_NUMBER =
-PROJECT_BRIEF =
-PROJECT_LOGO =
-OUTPUT_DIRECTORY = doc
-CREATE_SUBDIRS = NO
-ALLOW_UNICODE_NAMES = NO
-OUTPUT_LANGUAGE = English
-OUTPUT_TEXT_DIRECTION = None
-BRIEF_MEMBER_DESC = YES
-REPEAT_BRIEF = YES
-ABBREVIATE_BRIEF = "The $name class" \
- "The $name widget" \
- "The $name file" \
- is \
- provides \
- specifies \
- contains \
- represents \
- a \
- an \
- the
-ALWAYS_DETAILED_SEC = NO
-INLINE_INHERITED_MEMB = NO
-FULL_PATH_NAMES = NO
-STRIP_FROM_PATH =
-STRIP_FROM_INC_PATH =
-SHORT_NAMES = NO
-JAVADOC_AUTOBRIEF = NO
-JAVADOC_BANNER = NO
-QT_AUTOBRIEF = NO
-MULTILINE_CPP_IS_BRIEF = NO
-INHERIT_DOCS = YES
-SEPARATE_MEMBER_PAGES = NO
-TAB_SIZE = 8
-ALIASES =
-OPTIMIZE_OUTPUT_FOR_C = NO
-OPTIMIZE_OUTPUT_JAVA = NO
-OPTIMIZE_FOR_FORTRAN = NO
-OPTIMIZE_OUTPUT_VHDL = NO
-OPTIMIZE_OUTPUT_SLICE = NO
-EXTENSION_MAPPING =
-MARKDOWN_SUPPORT = YES
-TOC_INCLUDE_HEADINGS = 5
-AUTOLINK_SUPPORT = YES
-BUILTIN_STL_SUPPORT = NO
-CPP_CLI_SUPPORT = NO
-SIP_SUPPORT = NO
-IDL_PROPERTY_SUPPORT = YES
-DISTRIBUTE_GROUP_DOC = NO
-GROUP_NESTED_COMPOUNDS = NO
-SUBGROUPING = YES
-INLINE_GROUPED_CLASSES = NO
-INLINE_SIMPLE_STRUCTS = NO
-TYPEDEF_HIDES_STRUCT = NO
-LOOKUP_CACHE_SIZE = 0
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-EXTRACT_ALL = YES
-EXTRACT_PRIVATE = YES
-EXTRACT_PRIV_VIRTUAL = NO
-EXTRACT_PACKAGE = NO
-EXTRACT_STATIC = YES
-EXTRACT_LOCAL_CLASSES = YES
-EXTRACT_LOCAL_METHODS = NO
-EXTRACT_ANON_NSPACES = NO
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = NO
-HIDE_FRIEND_COMPOUNDS = NO
-HIDE_IN_BODY_DOCS = NO
-INTERNAL_DOCS = NO
-CASE_SENSE_NAMES = YES
-HIDE_SCOPE_NAMES = NO
-HIDE_COMPOUND_REFERENCE= NO
-SHOW_INCLUDE_FILES = YES
-SHOW_GROUPED_MEMB_INC = NO
-FORCE_LOCAL_INCLUDES = NO
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = YES
-SORT_BRIEF_DOCS = NO
-SORT_MEMBERS_CTORS_1ST = NO
-SORT_GROUP_NAMES = NO
-SORT_BY_SCOPE_NAME = NO
-STRICT_PROTO_MATCHING = NO
-GENERATE_TODOLIST = YES
-GENERATE_TESTLIST = YES
-GENERATE_BUGLIST = YES
-GENERATE_DEPRECATEDLIST= YES
-ENABLED_SECTIONS =
-MAX_INITIALIZER_LINES = 30
-SHOW_USED_FILES = YES
-SHOW_FILES = YES
-SHOW_NAMESPACES = YES
-FILE_VERSION_FILTER =
-LAYOUT_FILE =
-CITE_BIB_FILES =
-#---------------------------------------------------------------------------
-# Configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET = NO
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = YES
-WARN_IF_DOC_ERROR = YES
-WARN_NO_PARAMDOC = NO
-WARN_AS_ERROR = NO
-WARN_FORMAT =
-WARN_LOGFILE =
-#---------------------------------------------------------------------------
-# Configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = include
-INPUT_ENCODING = UTF-8
-FILE_PATTERNS = *.h
-RECURSIVE = NO
-EXCLUDE =
-EXCLUDE_SYMLINKS = NO
-EXCLUDE_PATTERNS =
-EXCLUDE_SYMBOLS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_PATTERNS =
-FILTER_SOURCE_FILES = NO
-FILTER_SOURCE_PATTERNS =
-USE_MDFILE_AS_MAINPAGE =
-#---------------------------------------------------------------------------
-# Configuration options related to source browsing
-#---------------------------------------------------------------------------
-SOURCE_BROWSER = YES
-INLINE_SOURCES = NO
-STRIP_CODE_COMMENTS = YES
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION = YES
-REFERENCES_LINK_SOURCE = YES
-SOURCE_TOOLTIPS = YES
-USE_HTAGS = NO
-VERBATIM_HEADERS = YES
-#---------------------------------------------------------------------------
-# Configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX = NO
-COLS_IN_ALPHA_INDEX = 5
-IGNORE_PREFIX =
-#---------------------------------------------------------------------------
-# Configuration options related to the HTML output
-#---------------------------------------------------------------------------
-GENERATE_HTML = YES
-HTML_OUTPUT =
-HTML_FILE_EXTENSION = .html
-HTML_HEADER =
-HTML_FOOTER =
-HTML_STYLESHEET =
-HTML_EXTRA_STYLESHEET =
-HTML_EXTRA_FILES =
-HTML_COLORSTYLE_HUE = 220
-HTML_COLORSTYLE_SAT = 100
-HTML_COLORSTYLE_GAMMA = 80
-HTML_TIMESTAMP = NO
-HTML_DYNAMIC_MENUS = YES
-HTML_DYNAMIC_SECTIONS = NO
-HTML_INDEX_NUM_ENTRIES = 100
-GENERATE_DOCSET = NO
-DOCSET_FEEDNAME = "Doxygen generated docs"
-DOCSET_BUNDLE_ID = org.doxygen.Project
-DOCSET_PUBLISHER_ID = org.doxygen.Publisher
-DOCSET_PUBLISHER_NAME = Publisher
-GENERATE_HTMLHELP = NO
-CHM_FILE =
-HHC_LOCATION =
-GENERATE_CHI = NO
-CHM_INDEX_ENCODING =
-BINARY_TOC = NO
-TOC_EXPAND = NO
-GENERATE_QHP = NO
-QCH_FILE =
-QHP_NAMESPACE = org.doxygen.Project
-QHP_VIRTUAL_FOLDER = doc
-QHP_CUST_FILTER_NAME =
-QHP_CUST_FILTER_ATTRS =
-QHP_SECT_FILTER_ATTRS =
-QHG_LOCATION =
-GENERATE_ECLIPSEHELP = NO
-ECLIPSE_DOC_ID = org.doxygen.Project
-DISABLE_INDEX = NO
-GENERATE_TREEVIEW = NO
-ENUM_VALUES_PER_LINE = 4
-TREEVIEW_WIDTH = 250
-EXT_LINKS_IN_WINDOW = NO
-FORMULA_FONTSIZE = 10
-FORMULA_TRANSPARENT = YES
-USE_MATHJAX = NO
-MATHJAX_FORMAT = HTML-CSS
-MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/
-MATHJAX_EXTENSIONS =
-MATHJAX_CODEFILE =
-SEARCHENGINE = NO
-SERVER_BASED_SEARCH = NO
-EXTERNAL_SEARCH = NO
-SEARCHENGINE_URL =
-SEARCHDATA_FILE = searchdata.xml
-EXTERNAL_SEARCH_ID =
-EXTRA_SEARCH_MAPPINGS =
-#---------------------------------------------------------------------------
-# Configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-GENERATE_LATEX = NO
-LATEX_OUTPUT =
-LATEX_CMD_NAME =
-MAKEINDEX_CMD_NAME = makeindex
-LATEX_MAKEINDEX_CMD = makeindex
-COMPACT_LATEX = NO
-PAPER_TYPE = a4wide
-EXTRA_PACKAGES =
-LATEX_HEADER =
-LATEX_FOOTER =
-LATEX_EXTRA_STYLESHEET =
-LATEX_EXTRA_FILES =
-PDF_HYPERLINKS = NO
-USE_PDFLATEX = NO
-LATEX_BATCHMODE = NO
-LATEX_HIDE_INDICES = NO
-LATEX_SOURCE_CODE = NO
-LATEX_BIB_STYLE = plain
-LATEX_TIMESTAMP = NO
-LATEX_EMOJI_DIRECTORY =
-#---------------------------------------------------------------------------
-# Configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF = NO
-RTF_OUTPUT =
-COMPACT_RTF = NO
-RTF_HYPERLINKS = NO
-RTF_STYLESHEET_FILE =
-RTF_EXTENSIONS_FILE =
-RTF_SOURCE_CODE = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the man page output
-#---------------------------------------------------------------------------
-GENERATE_MAN = NO
-MAN_OUTPUT =
-MAN_EXTENSION =
-MAN_SUBDIR =
-MAN_LINKS = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML = YES
-XML_OUTPUT = xml
-XML_PROGRAMLISTING = YES
-XML_NS_MEMB_FILE_SCOPE = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the DOCBOOK output
-#---------------------------------------------------------------------------
-GENERATE_DOCBOOK = NO
-DOCBOOK_OUTPUT = docbook
-DOCBOOK_PROGRAMLISTING = NO
-#---------------------------------------------------------------------------
-# Configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-GENERATE_PERLMOD = NO
-PERLMOD_LATEX = NO
-PERLMOD_PRETTY = YES
-PERLMOD_MAKEVAR_PREFIX =
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = NO
-EXPAND_ONLY_PREDEF = NO
-SEARCH_INCLUDES = YES
-INCLUDE_PATH =
-INCLUDE_FILE_PATTERNS =
-PREDEFINED =
-EXPAND_AS_DEFINED =
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration options related to external references
-#---------------------------------------------------------------------------
-TAGFILES = ../../qtools_docs/qtools.tag=../../../../qtools_docs/html
-GENERATE_TAGFILE =
-ALLEXTERNALS = NO
-EXTERNAL_GROUPS = YES
-EXTERNAL_PAGES = YES
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS = NO
-DIA_PATH =
-HIDE_UNDOC_RELATIONS = YES
-HAVE_DOT = NO
-DOT_NUM_THREADS = 0
-DOT_FONTNAME = Helvetica
-DOT_FONTSIZE = 10
-DOT_FONTPATH =
-CLASS_GRAPH = YES
-COLLABORATION_GRAPH = YES
-GROUP_GRAPHS = YES
-UML_LOOK = NO
-UML_LIMIT_NUM_FIELDS = 10
-TEMPLATE_RELATIONS = YES
-INCLUDE_GRAPH = YES
-INCLUDED_BY_GRAPH = YES
-CALL_GRAPH = NO
-CALLER_GRAPH = NO
-GRAPHICAL_HIERARCHY = YES
-DIRECTORY_GRAPH = YES
-DOT_IMAGE_FORMAT = png
-INTERACTIVE_SVG = NO
-DOT_PATH =
-DOTFILE_DIRS =
-MSCFILE_DIRS =
-DIAFILE_DIRS =
-PLANTUML_JAR_PATH =
-PLANTUML_CFG_FILE =
-PLANTUML_INCLUDE_PATH =
-DOT_GRAPH_MAX_NODES = 50
-MAX_DOT_GRAPH_DEPTH = 0
-DOT_TRANSPARENT = NO
-DOT_MULTI_TARGETS = NO
-GENERATE_LEGEND = YES
-DOT_CLEANUP = YES
diff --git a/addon/doxmlparser/Doxyfile.impl b/addon/doxmlparser/Doxyfile.impl
deleted file mode 100644
index 9bfc85e..0000000
--- a/addon/doxmlparser/Doxyfile.impl
+++ /dev/null
@@ -1,334 +0,0 @@
-# Doxyfile 1.8.17
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-DOXYFILE_ENCODING = UTF-8
-PROJECT_NAME = doxmlparser
-PROJECT_NUMBER =
-PROJECT_BRIEF =
-PROJECT_LOGO =
-OUTPUT_DIRECTORY = doc_impl
-CREATE_SUBDIRS = NO
-ALLOW_UNICODE_NAMES = NO
-OUTPUT_LANGUAGE = English
-OUTPUT_TEXT_DIRECTION = None
-BRIEF_MEMBER_DESC = YES
-REPEAT_BRIEF = YES
-ABBREVIATE_BRIEF = "The $name class" \
- "The $name widget" \
- "The $name file" \
- is \
- provides \
- specifies \
- contains \
- represents \
- a \
- an \
- the
-ALWAYS_DETAILED_SEC = NO
-INLINE_INHERITED_MEMB = NO
-FULL_PATH_NAMES = NO
-STRIP_FROM_PATH =
-STRIP_FROM_INC_PATH =
-SHORT_NAMES = NO
-JAVADOC_AUTOBRIEF = NO
-JAVADOC_BANNER = NO
-QT_AUTOBRIEF = NO
-MULTILINE_CPP_IS_BRIEF = NO
-INHERIT_DOCS = YES
-SEPARATE_MEMBER_PAGES = NO
-TAB_SIZE = 8
-ALIASES =
-OPTIMIZE_OUTPUT_FOR_C = NO
-OPTIMIZE_OUTPUT_JAVA = NO
-OPTIMIZE_FOR_FORTRAN = NO
-OPTIMIZE_OUTPUT_VHDL = NO
-OPTIMIZE_OUTPUT_SLICE = NO
-EXTENSION_MAPPING =
-MARKDOWN_SUPPORT = YES
-TOC_INCLUDE_HEADINGS = 5
-AUTOLINK_SUPPORT = YES
-BUILTIN_STL_SUPPORT = NO
-CPP_CLI_SUPPORT = NO
-SIP_SUPPORT = NO
-IDL_PROPERTY_SUPPORT = YES
-DISTRIBUTE_GROUP_DOC = NO
-GROUP_NESTED_COMPOUNDS = NO
-SUBGROUPING = YES
-INLINE_GROUPED_CLASSES = NO
-INLINE_SIMPLE_STRUCTS = NO
-TYPEDEF_HIDES_STRUCT = NO
-LOOKUP_CACHE_SIZE = 0
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-EXTRACT_ALL = YES
-EXTRACT_PRIVATE = YES
-EXTRACT_PRIV_VIRTUAL = NO
-EXTRACT_PACKAGE = NO
-EXTRACT_STATIC = YES
-EXTRACT_LOCAL_CLASSES = YES
-EXTRACT_LOCAL_METHODS = NO
-EXTRACT_ANON_NSPACES = NO
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = NO
-HIDE_FRIEND_COMPOUNDS = NO
-HIDE_IN_BODY_DOCS = NO
-INTERNAL_DOCS = NO
-CASE_SENSE_NAMES = YES
-HIDE_SCOPE_NAMES = NO
-HIDE_COMPOUND_REFERENCE= NO
-SHOW_INCLUDE_FILES = YES
-SHOW_GROUPED_MEMB_INC = NO
-FORCE_LOCAL_INCLUDES = NO
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = YES
-SORT_BRIEF_DOCS = NO
-SORT_MEMBERS_CTORS_1ST = NO
-SORT_GROUP_NAMES = NO
-SORT_BY_SCOPE_NAME = NO
-STRICT_PROTO_MATCHING = NO
-GENERATE_TODOLIST = YES
-GENERATE_TESTLIST = YES
-GENERATE_BUGLIST = YES
-GENERATE_DEPRECATEDLIST= YES
-ENABLED_SECTIONS =
-MAX_INITIALIZER_LINES = 30
-SHOW_USED_FILES = YES
-SHOW_FILES = YES
-SHOW_NAMESPACES = YES
-FILE_VERSION_FILTER =
-LAYOUT_FILE =
-CITE_BIB_FILES =
-#---------------------------------------------------------------------------
-# Configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET = NO
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = YES
-WARN_IF_DOC_ERROR = YES
-WARN_NO_PARAMDOC = NO
-WARN_AS_ERROR = NO
-WARN_FORMAT =
-WARN_LOGFILE =
-#---------------------------------------------------------------------------
-# Configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = src
-INPUT_ENCODING = UTF-8
-FILE_PATTERNS =
-RECURSIVE = NO
-EXCLUDE =
-EXCLUDE_SYMLINKS = NO
-EXCLUDE_PATTERNS =
-EXCLUDE_SYMBOLS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_PATTERNS =
-FILTER_SOURCE_FILES = NO
-FILTER_SOURCE_PATTERNS =
-USE_MDFILE_AS_MAINPAGE =
-#---------------------------------------------------------------------------
-# Configuration options related to source browsing
-#---------------------------------------------------------------------------
-SOURCE_BROWSER = NO
-INLINE_SOURCES = NO
-STRIP_CODE_COMMENTS = YES
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION = YES
-REFERENCES_LINK_SOURCE = YES
-SOURCE_TOOLTIPS = YES
-USE_HTAGS = NO
-VERBATIM_HEADERS = YES
-#---------------------------------------------------------------------------
-# Configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX = NO
-COLS_IN_ALPHA_INDEX = 5
-IGNORE_PREFIX =
-#---------------------------------------------------------------------------
-# Configuration options related to the HTML output
-#---------------------------------------------------------------------------
-GENERATE_HTML = YES
-HTML_OUTPUT =
-HTML_FILE_EXTENSION = .html
-HTML_HEADER =
-HTML_FOOTER =
-HTML_STYLESHEET =
-HTML_EXTRA_STYLESHEET =
-HTML_EXTRA_FILES =
-HTML_COLORSTYLE_HUE = 220
-HTML_COLORSTYLE_SAT = 100
-HTML_COLORSTYLE_GAMMA = 80
-HTML_TIMESTAMP = NO
-HTML_DYNAMIC_MENUS = YES
-HTML_DYNAMIC_SECTIONS = NO
-HTML_INDEX_NUM_ENTRIES = 100
-GENERATE_DOCSET = NO
-DOCSET_FEEDNAME = "Doxygen generated docs"
-DOCSET_BUNDLE_ID = org.doxygen.Project
-DOCSET_PUBLISHER_ID = org.doxygen.Publisher
-DOCSET_PUBLISHER_NAME = Publisher
-GENERATE_HTMLHELP = NO
-CHM_FILE =
-HHC_LOCATION =
-GENERATE_CHI = NO
-CHM_INDEX_ENCODING =
-BINARY_TOC = NO
-TOC_EXPAND = NO
-GENERATE_QHP = NO
-QCH_FILE =
-QHP_NAMESPACE = org.doxygen.Project
-QHP_VIRTUAL_FOLDER = doc
-QHP_CUST_FILTER_NAME =
-QHP_CUST_FILTER_ATTRS =
-QHP_SECT_FILTER_ATTRS =
-QHG_LOCATION =
-GENERATE_ECLIPSEHELP = NO
-ECLIPSE_DOC_ID = org.doxygen.Project
-DISABLE_INDEX = NO
-GENERATE_TREEVIEW = NO
-ENUM_VALUES_PER_LINE = 4
-TREEVIEW_WIDTH = 250
-EXT_LINKS_IN_WINDOW = NO
-FORMULA_FONTSIZE = 10
-FORMULA_TRANSPARENT = YES
-USE_MATHJAX = NO
-MATHJAX_FORMAT = HTML-CSS
-MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/
-MATHJAX_EXTENSIONS =
-MATHJAX_CODEFILE =
-SEARCHENGINE = NO
-SERVER_BASED_SEARCH = NO
-EXTERNAL_SEARCH = NO
-SEARCHENGINE_URL =
-SEARCHDATA_FILE = searchdata.xml
-EXTERNAL_SEARCH_ID =
-EXTRA_SEARCH_MAPPINGS =
-#---------------------------------------------------------------------------
-# Configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-GENERATE_LATEX = NO
-LATEX_OUTPUT =
-LATEX_CMD_NAME =
-MAKEINDEX_CMD_NAME = makeindex
-LATEX_MAKEINDEX_CMD = makeindex
-COMPACT_LATEX = NO
-PAPER_TYPE = a4wide
-EXTRA_PACKAGES =
-LATEX_HEADER =
-LATEX_FOOTER =
-LATEX_EXTRA_STYLESHEET =
-LATEX_EXTRA_FILES =
-PDF_HYPERLINKS = NO
-USE_PDFLATEX = NO
-LATEX_BATCHMODE = NO
-LATEX_HIDE_INDICES = NO
-LATEX_SOURCE_CODE = NO
-LATEX_BIB_STYLE = plain
-LATEX_TIMESTAMP = NO
-LATEX_EMOJI_DIRECTORY =
-#---------------------------------------------------------------------------
-# Configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF = NO
-RTF_OUTPUT =
-COMPACT_RTF = NO
-RTF_HYPERLINKS = NO
-RTF_STYLESHEET_FILE =
-RTF_EXTENSIONS_FILE =
-RTF_SOURCE_CODE = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the man page output
-#---------------------------------------------------------------------------
-GENERATE_MAN = NO
-MAN_OUTPUT =
-MAN_EXTENSION =
-MAN_SUBDIR =
-MAN_LINKS = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML = YES
-XML_OUTPUT = xml
-XML_PROGRAMLISTING = YES
-XML_NS_MEMB_FILE_SCOPE = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the DOCBOOK output
-#---------------------------------------------------------------------------
-GENERATE_DOCBOOK = NO
-DOCBOOK_OUTPUT = docbook
-DOCBOOK_PROGRAMLISTING = NO
-#---------------------------------------------------------------------------
-# Configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-GENERATE_PERLMOD = NO
-PERLMOD_LATEX = NO
-PERLMOD_PRETTY = YES
-PERLMOD_MAKEVAR_PREFIX =
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = YES
-EXPAND_ONLY_PREDEF = YES
-SEARCH_INCLUDES = YES
-INCLUDE_PATH =
-INCLUDE_FILE_PATTERNS =
-PREDEFINED =
-EXPAND_AS_DEFINED = DEFINE_CLS_IMPL
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration options related to external references
-#---------------------------------------------------------------------------
-TAGFILES = ../../qtools_docs/qtools.tag=../../../../qtools_docs/html
-GENERATE_TAGFILE =
-ALLEXTERNALS = NO
-EXTERNAL_GROUPS = YES
-EXTERNAL_PAGES = YES
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS = NO
-DIA_PATH =
-HIDE_UNDOC_RELATIONS = YES
-HAVE_DOT = YES
-DOT_NUM_THREADS = 0
-DOT_FONTNAME = Helvetica
-DOT_FONTSIZE = 10
-DOT_FONTPATH =
-CLASS_GRAPH = YES
-COLLABORATION_GRAPH = YES
-GROUP_GRAPHS = YES
-UML_LOOK = NO
-UML_LIMIT_NUM_FIELDS = 10
-TEMPLATE_RELATIONS = YES
-INCLUDE_GRAPH = YES
-INCLUDED_BY_GRAPH = YES
-CALL_GRAPH = NO
-CALLER_GRAPH = NO
-GRAPHICAL_HIERARCHY = YES
-DIRECTORY_GRAPH = YES
-DOT_IMAGE_FORMAT = png
-INTERACTIVE_SVG = NO
-DOT_PATH =
-DOTFILE_DIRS =
-MSCFILE_DIRS =
-DIAFILE_DIRS =
-PLANTUML_JAR_PATH =
-PLANTUML_CFG_FILE =
-PLANTUML_INCLUDE_PATH =
-DOT_GRAPH_MAX_NODES = 50
-MAX_DOT_GRAPH_DEPTH = 0
-DOT_TRANSPARENT = NO
-DOT_MULTI_TARGETS = NO
-GENERATE_LEGEND = YES
-DOT_CLEANUP = YES
diff --git a/qtools/LICENSE.GPL b/addon/doxmlparser/LICENSE
index 935a2a0..d159169 100644
--- a/qtools/LICENSE.GPL
+++ b/addon/doxmlparser/LICENSE
@@ -1,20 +1,12 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
- The Qt GUI Toolkit is Copyright (C) 1994-2000 Trolltech AS.
-
- You may use, distribute and copy the Qt GUI Toolkit under the terms of
- GNU General Public License version 2, which is display below.
-
--------------------------------------------------------------------------
-
- GNU GENERAL PUBLIC LICENSE
- Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 675 Mass Ave, Cambridge, MA 02139, USA
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
- Preamble
+ Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@@ -23,7 +15,7 @@ software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.) You can apply it to
+the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
@@ -63,8 +55,8 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
-
- GNU GENERAL PUBLIC LICENSE
+
+ GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@@ -118,7 +110,7 @@ above, provided that you also meet all of these conditions:
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
-
+
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
@@ -176,7 +168,7 @@ access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
-
+
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
@@ -233,7 +225,7 @@ impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
-
+
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
@@ -263,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
- NO WARRANTY
+ NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@@ -285,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
- END OF TERMS AND CONDITIONS
-
- Appendix: How to Apply These Terms to Your New Programs
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -299,7 +291,7 @@ convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
- Copyright (C) 19yy <name of author>
+ Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -311,16 +303,16 @@ the "copyright" line and a pointer to where the full notice is found.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
- Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
@@ -343,7 +335,5 @@ necessary. Here is a sample; alter the names:
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
-library. If this is what you want to do, use the GNU Library General
+library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.
-
--------------------------------------------------------------------------
diff --git a/addon/doxmlparser/README.md b/addon/doxmlparser/README.md
new file mode 100644
index 0000000..ced4018
--- /dev/null
+++ b/addon/doxmlparser/README.md
@@ -0,0 +1,10 @@
+Doxmlparser
+===========
+
+This is a python package to make it easier to parse the XML output produced by doxygen.
+
+The API is generated from the index.xsd and compound.xsd XML schema files using
+Dave Kuhlman's generateDS https://www.davekuhlman.org/generateDS.html
+
+See the examples directory to get an idea how to use the python module
+
diff --git a/addon/doxmlparser/doxmlparser/__init__.py b/addon/doxmlparser/doxmlparser/__init__.py
new file mode 100644
index 0000000..31a275f
--- /dev/null
+++ b/addon/doxmlparser/doxmlparser/__init__.py
@@ -0,0 +1,2 @@
+from .index import *
+from .compound import *
diff --git a/addon/doxmlparser/doxmlparser/compound.py b/addon/doxmlparser/doxmlparser/compound.py
new file mode 100644
index 0000000..d15e04e
--- /dev/null
+++ b/addon/doxmlparser/doxmlparser/compound.py
@@ -0,0 +1,22358 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+#
+# Generated by generateDS.py.
+# Python 3.9.0 (default, Oct 27 2020, 14:15:17) [Clang 12.0.0 (clang-1200.0.32.21)]
+#
+# Command line options:
+# ('--no-dates', '')
+# ('--no-versions', '')
+# ('-f', '')
+# ('-o', '/Users/dimitri/doxygen.git/addon/doxmlparser/doxmlparser/compound.py')
+#
+# Command line arguments:
+# /Users/dimitri/doxygen.git/templates/xml/compound.xsd
+#
+# Command line:
+# /usr/local/bin/generateDS --no-dates --no-versions -f -o "/Users/dimitri/doxygen.git/addon/doxmlparser/doxmlparser/compound.py" /Users/dimitri/doxygen.git/templates/xml/compound.xsd
+#
+# Current working directory (os.getcwd()):
+# doxmlparser
+#
+
+import sys
+try:
+ ModulenotfoundExp_ = ModuleNotFoundError
+except NameError:
+ ModulenotfoundExp_ = ImportError
+from six.moves import zip_longest
+import os
+import re as re_
+import base64
+import datetime as datetime_
+import decimal as decimal_
+try:
+ from lxml import etree as etree_
+except ModulenotfoundExp_ :
+ from xml.etree import ElementTree as etree_
+
+
+Validate_simpletypes_ = True
+SaveElementTreeNode = True
+if sys.version_info.major == 2:
+ BaseStrType_ = basestring
+else:
+ BaseStrType_ = str
+
+
+def parsexml_(infile, parser=None, **kwargs):
+ if parser is None:
+ # Use the lxml ElementTree compatible parser so that, e.g.,
+ # we ignore comments.
+ try:
+ parser = etree_.ETCompatXMLParser()
+ except AttributeError:
+ # fallback to xml.etree
+ parser = etree_.XMLParser()
+ try:
+ if isinstance(infile, os.PathLike):
+ infile = os.path.join(infile)
+ except AttributeError:
+ pass
+ doc = etree_.parse(infile, parser=parser, **kwargs)
+ return doc
+
+def parsexmlstring_(instring, parser=None, **kwargs):
+ if parser is None:
+ # Use the lxml ElementTree compatible parser so that, e.g.,
+ # we ignore comments.
+ try:
+ parser = etree_.ETCompatXMLParser()
+ except AttributeError:
+ # fallback to xml.etree
+ parser = etree_.XMLParser()
+ element = etree_.fromstring(instring, parser=parser, **kwargs)
+ return element
+
+#
+# Namespace prefix definition table (and other attributes, too)
+#
+# The module generatedsnamespaces, if it is importable, must contain
+# a dictionary named GeneratedsNamespaceDefs. This Python dictionary
+# should map element type names (strings) to XML schema namespace prefix
+# definitions. The export method for any class for which there is
+# a namespace prefix definition, will export that definition in the
+# XML representation of that element. See the export method of
+# any generated element type class for an example of the use of this
+# table.
+# A sample table is:
+#
+# # File: generatedsnamespaces.py
+#
+# GenerateDSNamespaceDefs = {
+# "ElementtypeA": "http://www.xxx.com/namespaceA",
+# "ElementtypeB": "http://www.xxx.com/namespaceB",
+# }
+#
+# Additionally, the generatedsnamespaces module can contain a python
+# dictionary named GenerateDSNamespaceTypePrefixes that associates element
+# types with the namespace prefixes that are to be added to the
+# "xsi:type" attribute value. See the exportAttributes method of
+# any generated element type and the generation of "xsi:type" for an
+# example of the use of this table.
+# An example table:
+#
+# # File: generatedsnamespaces.py
+#
+# GenerateDSNamespaceTypePrefixes = {
+# "ElementtypeC": "aaa:",
+# "ElementtypeD": "bbb:",
+# }
+#
+
+try:
+ from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_
+except ModulenotfoundExp_ :
+ GenerateDSNamespaceDefs_ = {}
+try:
+ from generatedsnamespaces import GenerateDSNamespaceTypePrefixes as GenerateDSNamespaceTypePrefixes_
+except ModulenotfoundExp_ :
+ GenerateDSNamespaceTypePrefixes_ = {}
+
+#
+# You can replace the following class definition by defining an
+# importable module named "generatedscollector" containing a class
+# named "GdsCollector". See the default class definition below for
+# clues about the possible content of that class.
+#
+try:
+ from generatedscollector import GdsCollector as GdsCollector_
+except ModulenotfoundExp_ :
+
+ class GdsCollector_(object):
+
+ def __init__(self, messages=None):
+ if messages is None:
+ self.messages = []
+ else:
+ self.messages = messages
+
+ def add_message(self, msg):
+ self.messages.append(msg)
+
+ def get_messages(self):
+ return self.messages
+
+ def clear_messages(self):
+ self.messages = []
+
+ def print_messages(self):
+ for msg in self.messages:
+ print("Warning: {}".format(msg))
+
+ def write_messages(self, outstream):
+ for msg in self.messages:
+ outstream.write("Warning: {}\n".format(msg))
+
+
+#
+# The super-class for enum types
+#
+
+try:
+ from enum import Enum
+except ModulenotfoundExp_ :
+ Enum = object
+
+#
+# The root super-class for element type classes
+#
+# Calls to the methods in these classes are generated by generateDS.py.
+# You can replace these methods by re-implementing the following class
+# in a module named generatedssuper.py.
+
+try:
+ from generatedssuper import GeneratedsSuper
+except ModulenotfoundExp_ as exp:
+
+ class GeneratedsSuper(object):
+ __hash__ = object.__hash__
+ tzoff_pattern = re_.compile(r'(\+|-)((0\d|1[0-3]):[0-5]\d|14:00)$')
+ class _FixedOffsetTZ(datetime_.tzinfo):
+ def __init__(self, offset, name):
+ self.__offset = datetime_.timedelta(minutes=offset)
+ self.__name = name
+ def utcoffset(self, dt):
+ return self.__offset
+ def tzname(self, dt):
+ return self.__name
+ def dst(self, dt):
+ return None
+ def gds_format_string(self, input_data, input_name=''):
+ return input_data
+ def gds_parse_string(self, input_data, node=None, input_name=''):
+ return input_data
+ def gds_validate_string(self, input_data, node=None, input_name=''):
+ if not input_data:
+ return ''
+ else:
+ return input_data
+ def gds_format_base64(self, input_data, input_name=''):
+ return base64.b64encode(input_data)
+ def gds_validate_base64(self, input_data, node=None, input_name=''):
+ return input_data
+ def gds_format_integer(self, input_data, input_name=''):
+ return '%d' % input_data
+ def gds_parse_integer(self, input_data, node=None, input_name=''):
+ try:
+ ival = int(input_data)
+ except (TypeError, ValueError) as exp:
+ raise_parse_error(node, 'Requires integer value: %s' % exp)
+ return ival
+ def gds_validate_integer(self, input_data, node=None, input_name=''):
+ try:
+ value = int(input_data)
+ except (TypeError, ValueError):
+ raise_parse_error(node, 'Requires integer value')
+ return value
+ def gds_format_integer_list(self, input_data, input_name=''):
+ if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):
+ input_data = [str(s) for s in input_data]
+ return '%s' % ' '.join(input_data)
+ def gds_validate_integer_list(
+ self, input_data, node=None, input_name=''):
+ values = input_data.split()
+ for value in values:
+ try:
+ int(value)
+ except (TypeError, ValueError):
+ raise_parse_error(node, 'Requires sequence of integer values')
+ return values
+ def gds_format_float(self, input_data, input_name=''):
+ return ('%.15f' % input_data).rstrip('0')
+ def gds_parse_float(self, input_data, node=None, input_name=''):
+ try:
+ fval_ = float(input_data)
+ except (TypeError, ValueError) as exp:
+ raise_parse_error(node, 'Requires float or double value: %s' % exp)
+ return fval_
+ def gds_validate_float(self, input_data, node=None, input_name=''):
+ try:
+ value = float(input_data)
+ except (TypeError, ValueError):
+ raise_parse_error(node, 'Requires float value')
+ return value
+ def gds_format_float_list(self, input_data, input_name=''):
+ if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):
+ input_data = [str(s) for s in input_data]
+ return '%s' % ' '.join(input_data)
+ def gds_validate_float_list(
+ self, input_data, node=None, input_name=''):
+ values = input_data.split()
+ for value in values:
+ try:
+ float(value)
+ except (TypeError, ValueError):
+ raise_parse_error(node, 'Requires sequence of float values')
+ return values
+ def gds_format_decimal(self, input_data, input_name=''):
+ return_value = '%s' % input_data
+ if '.' in return_value:
+ return_value = return_value.rstrip('0')
+ if return_value.endswith('.'):
+ return_value = return_value.rstrip('.')
+ return return_value
+ def gds_parse_decimal(self, input_data, node=None, input_name=''):
+ try:
+ decimal_value = decimal_.Decimal(input_data)
+ except (TypeError, ValueError):
+ raise_parse_error(node, 'Requires decimal value')
+ return decimal_value
+ def gds_validate_decimal(self, input_data, node=None, input_name=''):
+ try:
+ value = decimal_.Decimal(input_data)
+ except (TypeError, ValueError):
+ raise_parse_error(node, 'Requires decimal value')
+ return value
+ def gds_format_decimal_list(self, input_data, input_name=''):
+ if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):
+ input_data = [str(s) for s in input_data]
+ return ' '.join([self.gds_format_decimal(item) for item in input_data])
+ def gds_validate_decimal_list(
+ self, input_data, node=None, input_name=''):
+ values = input_data.split()
+ for value in values:
+ try:
+ decimal_.Decimal(value)
+ except (TypeError, ValueError):
+ raise_parse_error(node, 'Requires sequence of decimal values')
+ return values
+ def gds_format_double(self, input_data, input_name=''):
+ return '%s' % input_data
+ def gds_parse_double(self, input_data, node=None, input_name=''):
+ try:
+ fval_ = float(input_data)
+ except (TypeError, ValueError) as exp:
+ raise_parse_error(node, 'Requires double or float value: %s' % exp)
+ return fval_
+ def gds_validate_double(self, input_data, node=None, input_name=''):
+ try:
+ value = float(input_data)
+ except (TypeError, ValueError):
+ raise_parse_error(node, 'Requires double or float value')
+ return value
+ def gds_format_double_list(self, input_data, input_name=''):
+ if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):
+ input_data = [str(s) for s in input_data]
+ return '%s' % ' '.join(input_data)
+ def gds_validate_double_list(
+ self, input_data, node=None, input_name=''):
+ values = input_data.split()
+ for value in values:
+ try:
+ float(value)
+ except (TypeError, ValueError):
+ raise_parse_error(
+ node, 'Requires sequence of double or float values')
+ return values
+ def gds_format_boolean(self, input_data, input_name=''):
+ return ('%s' % input_data).lower()
+ def gds_parse_boolean(self, input_data, node=None, input_name=''):
+ if input_data in ('true', '1'):
+ bval = True
+ elif input_data in ('false', '0'):
+ bval = False
+ else:
+ raise_parse_error(node, 'Requires boolean value')
+ return bval
+ def gds_validate_boolean(self, input_data, node=None, input_name=''):
+ if input_data not in (True, 1, False, 0, ):
+ raise_parse_error(
+ node,
+ 'Requires boolean value '
+ '(one of True, 1, False, 0)')
+ return input_data
+ def gds_format_boolean_list(self, input_data, input_name=''):
+ if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):
+ input_data = [str(s) for s in input_data]
+ return '%s' % ' '.join(input_data)
+ def gds_validate_boolean_list(
+ self, input_data, node=None, input_name=''):
+ values = input_data.split()
+ for value in values:
+ if value not in (True, 1, False, 0, ):
+ raise_parse_error(
+ node,
+ 'Requires sequence of boolean values '
+ '(one of True, 1, False, 0)')
+ return values
+ def gds_validate_datetime(self, input_data, node=None, input_name=''):
+ return input_data
+ def gds_format_datetime(self, input_data, input_name=''):
+ if input_data.microsecond == 0:
+ _svalue = '%04d-%02d-%02dT%02d:%02d:%02d' % (
+ input_data.year,
+ input_data.month,
+ input_data.day,
+ input_data.hour,
+ input_data.minute,
+ input_data.second,
+ )
+ else:
+ _svalue = '%04d-%02d-%02dT%02d:%02d:%02d.%s' % (
+ input_data.year,
+ input_data.month,
+ input_data.day,
+ input_data.hour,
+ input_data.minute,
+ input_data.second,
+ ('%f' % (float(input_data.microsecond) / 1000000))[2:],
+ )
+ if input_data.tzinfo is not None:
+ tzoff = input_data.tzinfo.utcoffset(input_data)
+ if tzoff is not None:
+ total_seconds = tzoff.seconds + (86400 * tzoff.days)
+ if total_seconds == 0:
+ _svalue += 'Z'
+ else:
+ if total_seconds < 0:
+ _svalue += '-'
+ total_seconds *= -1
+ else:
+ _svalue += '+'
+ hours = total_seconds // 3600
+ minutes = (total_seconds - (hours * 3600)) // 60
+ _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)
+ return _svalue
+ @classmethod
+ def gds_parse_datetime(cls, input_data):
+ tz = None
+ if input_data[-1] == 'Z':
+ tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
+ input_data = input_data[:-1]
+ else:
+ results = GeneratedsSuper.tzoff_pattern.search(input_data)
+ if results is not None:
+ tzoff_parts = results.group(2).split(':')
+ tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
+ if results.group(1) == '-':
+ tzoff *= -1
+ tz = GeneratedsSuper._FixedOffsetTZ(
+ tzoff, results.group(0))
+ input_data = input_data[:-6]
+ time_parts = input_data.split('.')
+ if len(time_parts) > 1:
+ micro_seconds = int(float('0.' + time_parts[1]) * 1000000)
+ input_data = '%s.%s' % (
+ time_parts[0], "{}".format(micro_seconds).rjust(6, "0"), )
+ dt = datetime_.datetime.strptime(
+ input_data, '%Y-%m-%dT%H:%M:%S.%f')
+ else:
+ dt = datetime_.datetime.strptime(
+ input_data, '%Y-%m-%dT%H:%M:%S')
+ dt = dt.replace(tzinfo=tz)
+ return dt
+ def gds_validate_date(self, input_data, node=None, input_name=''):
+ return input_data
+ def gds_format_date(self, input_data, input_name=''):
+ _svalue = '%04d-%02d-%02d' % (
+ input_data.year,
+ input_data.month,
+ input_data.day,
+ )
+ try:
+ if input_data.tzinfo is not None:
+ tzoff = input_data.tzinfo.utcoffset(input_data)
+ if tzoff is not None:
+ total_seconds = tzoff.seconds + (86400 * tzoff.days)
+ if total_seconds == 0:
+ _svalue += 'Z'
+ else:
+ if total_seconds < 0:
+ _svalue += '-'
+ total_seconds *= -1
+ else:
+ _svalue += '+'
+ hours = total_seconds // 3600
+ minutes = (total_seconds - (hours * 3600)) // 60
+ _svalue += '{0:02d}:{1:02d}'.format(
+ hours, minutes)
+ except AttributeError:
+ pass
+ return _svalue
+ @classmethod
+ def gds_parse_date(cls, input_data):
+ tz = None
+ if input_data[-1] == 'Z':
+ tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
+ input_data = input_data[:-1]
+ else:
+ results = GeneratedsSuper.tzoff_pattern.search(input_data)
+ if results is not None:
+ tzoff_parts = results.group(2).split(':')
+ tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
+ if results.group(1) == '-':
+ tzoff *= -1
+ tz = GeneratedsSuper._FixedOffsetTZ(
+ tzoff, results.group(0))
+ input_data = input_data[:-6]
+ dt = datetime_.datetime.strptime(input_data, '%Y-%m-%d')
+ dt = dt.replace(tzinfo=tz)
+ return dt.date()
+ def gds_validate_time(self, input_data, node=None, input_name=''):
+ return input_data
+ def gds_format_time(self, input_data, input_name=''):
+ if input_data.microsecond == 0:
+ _svalue = '%02d:%02d:%02d' % (
+ input_data.hour,
+ input_data.minute,
+ input_data.second,
+ )
+ else:
+ _svalue = '%02d:%02d:%02d.%s' % (
+ input_data.hour,
+ input_data.minute,
+ input_data.second,
+ ('%f' % (float(input_data.microsecond) / 1000000))[2:],
+ )
+ if input_data.tzinfo is not None:
+ tzoff = input_data.tzinfo.utcoffset(input_data)
+ if tzoff is not None:
+ total_seconds = tzoff.seconds + (86400 * tzoff.days)
+ if total_seconds == 0:
+ _svalue += 'Z'
+ else:
+ if total_seconds < 0:
+ _svalue += '-'
+ total_seconds *= -1
+ else:
+ _svalue += '+'
+ hours = total_seconds // 3600
+ minutes = (total_seconds - (hours * 3600)) // 60
+ _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)
+ return _svalue
+ def gds_validate_simple_patterns(self, patterns, target):
+ # pat is a list of lists of strings/patterns.
+ # The target value must match at least one of the patterns
+ # in order for the test to succeed.
+ found1 = True
+ for patterns1 in patterns:
+ found2 = False
+ for patterns2 in patterns1:
+ mo = re_.search(patterns2, target)
+ if mo is not None and len(mo.group(0)) == len(target):
+ found2 = True
+ break
+ if not found2:
+ found1 = False
+ break
+ return found1
+ @classmethod
+ def gds_parse_time(cls, input_data):
+ tz = None
+ if input_data[-1] == 'Z':
+ tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
+ input_data = input_data[:-1]
+ else:
+ results = GeneratedsSuper.tzoff_pattern.search(input_data)
+ if results is not None:
+ tzoff_parts = results.group(2).split(':')
+ tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
+ if results.group(1) == '-':
+ tzoff *= -1
+ tz = GeneratedsSuper._FixedOffsetTZ(
+ tzoff, results.group(0))
+ input_data = input_data[:-6]
+ if len(input_data.split('.')) > 1:
+ dt = datetime_.datetime.strptime(input_data, '%H:%M:%S.%f')
+ else:
+ dt = datetime_.datetime.strptime(input_data, '%H:%M:%S')
+ dt = dt.replace(tzinfo=tz)
+ return dt.time()
+ def gds_check_cardinality_(
+ self, value, input_name,
+ min_occurs=0, max_occurs=1, required=None):
+ if value is None:
+ length = 0
+ elif isinstance(value, list):
+ length = len(value)
+ else:
+ length = 1
+ if required is not None :
+ if required and length < 1:
+ self.gds_collector_.add_message(
+ "Required value {}{} is missing".format(
+ input_name, self.gds_get_node_lineno_()))
+ if length < min_occurs:
+ self.gds_collector_.add_message(
+ "Number of values for {}{} is below "
+ "the minimum allowed, "
+ "expected at least {}, found {}".format(
+ input_name, self.gds_get_node_lineno_(),
+ min_occurs, length))
+ elif length > max_occurs:
+ self.gds_collector_.add_message(
+ "Number of values for {}{} is above "
+ "the maximum allowed, "
+ "expected at most {}, found {}".format(
+ input_name, self.gds_get_node_lineno_(),
+ max_occurs, length))
+ def gds_validate_builtin_ST_(
+ self, validator, value, input_name,
+ min_occurs=None, max_occurs=None, required=None):
+ if value is not None:
+ try:
+ validator(value, input_name=input_name)
+ except GDSParseError as parse_error:
+ self.gds_collector_.add_message(str(parse_error))
+ def gds_validate_defined_ST_(
+ self, validator, value, input_name,
+ min_occurs=None, max_occurs=None, required=None):
+ if value is not None:
+ try:
+ validator(value)
+ except GDSParseError as parse_error:
+ self.gds_collector_.add_message(str(parse_error))
+ def gds_str_lower(self, instring):
+ return instring.lower()
+ def get_path_(self, node):
+ path_list = []
+ self.get_path_list_(node, path_list)
+ path_list.reverse()
+ path = '/'.join(path_list)
+ return path
+ Tag_strip_pattern_ = re_.compile(r'\{.*\}')
+ def get_path_list_(self, node, path_list):
+ if node is None:
+ return
+ tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag)
+ if tag:
+ path_list.append(tag)
+ self.get_path_list_(node.getparent(), path_list)
+ def get_class_obj_(self, node, default_class=None):
+ class_obj1 = default_class
+ if 'xsi' in node.nsmap:
+ classname = node.get('{%s}type' % node.nsmap['xsi'])
+ if classname is not None:
+ names = classname.split(':')
+ if len(names) == 2:
+ classname = names[1]
+ class_obj2 = globals().get(classname)
+ if class_obj2 is not None:
+ class_obj1 = class_obj2
+ return class_obj1
+ def gds_build_any(self, node, type_name=None):
+ # provide default value in case option --disable-xml is used.
+ content = ""
+ content = etree_.tostring(node, encoding="unicode")
+ return content
+ @classmethod
+ def gds_reverse_node_mapping(cls, mapping):
+ return dict(((v, k) for k, v in mapping.items()))
+ @staticmethod
+ def gds_encode(instring):
+ if sys.version_info.major == 2:
+ if ExternalEncoding:
+ encoding = ExternalEncoding
+ else:
+ encoding = 'utf-8'
+ return instring.encode(encoding)
+ else:
+ return instring
+ @staticmethod
+ def convert_unicode(instring):
+ if isinstance(instring, str):
+ result = quote_xml(instring)
+ elif sys.version_info.major == 2 and isinstance(instring, unicode):
+ result = quote_xml(instring).encode('utf8')
+ else:
+ result = GeneratedsSuper.gds_encode(str(instring))
+ return result
+ def __eq__(self, other):
+ def excl_select_objs_(obj):
+ return (obj[0] != 'parent_object_' and
+ obj[0] != 'gds_collector_')
+ if type(self) != type(other):
+ return False
+ return all(x == y for x, y in zip_longest(
+ filter(excl_select_objs_, self.__dict__.items()),
+ filter(excl_select_objs_, other.__dict__.items())))
+ def __ne__(self, other):
+ return not self.__eq__(other)
+ # Django ETL transform hooks.
+ def gds_djo_etl_transform(self):
+ pass
+ def gds_djo_etl_transform_db_obj(self, dbobj):
+ pass
+ # SQLAlchemy ETL transform hooks.
+ def gds_sqa_etl_transform(self):
+ return 0, None
+ def gds_sqa_etl_transform_db_obj(self, dbobj):
+ pass
+ def gds_get_node_lineno_(self):
+ if (hasattr(self, "gds_elementtree_node_") and
+ self.gds_elementtree_node_ is not None):
+ return ' near line {}'.format(
+ self.gds_elementtree_node_.sourceline)
+ else:
+ return ""
+
+
+ def getSubclassFromModule_(module, class_):
+ '''Get the subclass of a class from a specific module.'''
+ name = class_.__name__ + 'Sub'
+ if hasattr(module, name):
+ return getattr(module, name)
+ else:
+ return None
+
+
+#
+# If you have installed IPython you can uncomment and use the following.
+# IPython is available from http://ipython.scipy.org/.
+#
+
+## from IPython.Shell import IPShellEmbed
+## args = ''
+## ipshell = IPShellEmbed(args,
+## banner = 'Dropping into IPython',
+## exit_msg = 'Leaving Interpreter, back to program.')
+
+# Then use the following line where and when you want to drop into the
+# IPython shell:
+# ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit')
+
+#
+# Globals
+#
+
+ExternalEncoding = ''
+# Set this to false in order to deactivate during export, the use of
+# name space prefixes captured from the input document.
+UseCapturedNS_ = True
+CapturedNsmap_ = {}
+Tag_pattern_ = re_.compile(r'({.*})?(.*)')
+String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")
+Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)')
+CDATA_pattern_ = re_.compile(r"<!\[CDATA\[.*?\]\]>", re_.DOTALL)
+
+# Change this to redirect the generated superclass module to use a
+# specific subclass module.
+CurrentSubclassModule_ = None
+
+#
+# Support/utility functions.
+#
+
+
+def showIndent(outfile, level, pretty_print=True):
+ if pretty_print:
+ for idx in range(level):
+ outfile.write(' ')
+
+
+def quote_xml(inStr):
+ "Escape markup chars, but do not modify CDATA sections."
+ if not inStr:
+ return ''
+ s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)
+ s2 = ''
+ pos = 0
+ matchobjects = CDATA_pattern_.finditer(s1)
+ for mo in matchobjects:
+ s3 = s1[pos:mo.start()]
+ s2 += quote_xml_aux(s3)
+ s2 += s1[mo.start():mo.end()]
+ pos = mo.end()
+ s3 = s1[pos:]
+ s2 += quote_xml_aux(s3)
+ return s2
+
+
+def quote_xml_aux(inStr):
+ s1 = inStr.replace('&', '&amp;')
+ s1 = s1.replace('<', '&lt;')
+ s1 = s1.replace('>', '&gt;')
+ return s1
+
+
+def quote_attrib(inStr):
+ s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)
+ s1 = s1.replace('&', '&amp;')
+ s1 = s1.replace('<', '&lt;')
+ s1 = s1.replace('>', '&gt;')
+ if '"' in s1:
+ if "'" in s1:
+ s1 = '"%s"' % s1.replace('"', "&quot;")
+ else:
+ s1 = "'%s'" % s1
+ else:
+ s1 = '"%s"' % s1
+ return s1
+
+
+def quote_python(inStr):
+ s1 = inStr
+ if s1.find("'") == -1:
+ if s1.find('\n') == -1:
+ return "'%s'" % s1
+ else:
+ return "'''%s'''" % s1
+ else:
+ if s1.find('"') != -1:
+ s1 = s1.replace('"', '\\"')
+ if s1.find('\n') == -1:
+ return '"%s"' % s1
+ else:
+ return '"""%s"""' % s1
+
+
+def get_all_text_(node):
+ if node.text is not None:
+ text = node.text
+ else:
+ text = ''
+ for child in node:
+ if child.tail is not None:
+ text += child.tail
+ return text
+
+
+def find_attr_value_(attr_name, node):
+ attrs = node.attrib
+ attr_parts = attr_name.split(':')
+ value = None
+ if len(attr_parts) == 1:
+ value = attrs.get(attr_name)
+ elif len(attr_parts) == 2:
+ prefix, name = attr_parts
+ if prefix == 'xml':
+ namespace = 'http://www.w3.org/XML/1998/namespace'
+ else:
+ namespace = node.nsmap.get(prefix)
+ if namespace is not None:
+ value = attrs.get('{%s}%s' % (namespace, name, ))
+ return value
+
+
+def encode_str_2_3(instr):
+ return instr
+
+
+class GDSParseError(Exception):
+ pass
+
+
+def raise_parse_error(node, msg):
+ if node is not None:
+ msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, )
+ raise GDSParseError(msg)
+
+
+class MixedContainer:
+ # Constants for category:
+ CategoryNone = 0
+ CategoryText = 1
+ CategorySimple = 2
+ CategoryComplex = 3
+ # Constants for content_type:
+ TypeNone = 0
+ TypeText = 1
+ TypeString = 2
+ TypeInteger = 3
+ TypeFloat = 4
+ TypeDecimal = 5
+ TypeDouble = 6
+ TypeBoolean = 7
+ TypeBase64 = 8
+ def __init__(self, category, content_type, name, value):
+ self.category = category
+ self.content_type = content_type
+ self.name = name
+ self.value = value
+ def getCategory(self):
+ return self.category
+ def getContenttype(self, content_type):
+ return self.content_type
+ def getValue(self):
+ return self.value
+ def getName(self):
+ return self.name
+ def export(self, outfile, level, name, namespace,
+ pretty_print=True):
+ if self.category == MixedContainer.CategoryText:
+ # Prevent exporting empty content as empty lines.
+ if self.value.strip():
+ outfile.write(self.value)
+ elif self.category == MixedContainer.CategorySimple:
+ self.exportSimple(outfile, level, name)
+ else: # category == MixedContainer.CategoryComplex
+ self.value.export(
+ outfile, level, namespace, name_=name,
+ pretty_print=pretty_print)
+ def exportSimple(self, outfile, level, name):
+ if self.content_type == MixedContainer.TypeString:
+ outfile.write('<%s>%s</%s>' % (
+ self.name, self.value, self.name))
+ elif self.content_type == MixedContainer.TypeInteger or \
+ self.content_type == MixedContainer.TypeBoolean:
+ outfile.write('<%s>%d</%s>' % (
+ self.name, self.value, self.name))
+ elif self.content_type == MixedContainer.TypeFloat or \
+ self.content_type == MixedContainer.TypeDecimal:
+ outfile.write('<%s>%f</%s>' % (
+ self.name, self.value, self.name))
+ elif self.content_type == MixedContainer.TypeDouble:
+ outfile.write('<%s>%g</%s>' % (
+ self.name, self.value, self.name))
+ elif self.content_type == MixedContainer.TypeBase64:
+ outfile.write('<%s>%s</%s>' % (
+ self.name,
+ base64.b64encode(self.value),
+ self.name))
+ def to_etree(self, element, mapping_=None, nsmap_=None):
+ if self.category == MixedContainer.CategoryText:
+ # Prevent exporting empty content as empty lines.
+ if self.value.strip():
+ if len(element) > 0:
+ if element[-1].tail is None:
+ element[-1].tail = self.value
+ else:
+ element[-1].tail += self.value
+ else:
+ if element.text is None:
+ element.text = self.value
+ else:
+ element.text += self.value
+ elif self.category == MixedContainer.CategorySimple:
+ subelement = etree_.SubElement(
+ element, '%s' % self.name)
+ subelement.text = self.to_etree_simple()
+ else: # category == MixedContainer.CategoryComplex
+ self.value.to_etree(element)
+ def to_etree_simple(self, mapping_=None, nsmap_=None):
+ if self.content_type == MixedContainer.TypeString:
+ text = self.value
+ elif (self.content_type == MixedContainer.TypeInteger or
+ self.content_type == MixedContainer.TypeBoolean):
+ text = '%d' % self.value
+ elif (self.content_type == MixedContainer.TypeFloat or
+ self.content_type == MixedContainer.TypeDecimal):
+ text = '%f' % self.value
+ elif self.content_type == MixedContainer.TypeDouble:
+ text = '%g' % self.value
+ elif self.content_type == MixedContainer.TypeBase64:
+ text = '%s' % base64.b64encode(self.value)
+ return text
+ def exportLiteral(self, outfile, level, name):
+ if self.category == MixedContainer.CategoryText:
+ showIndent(outfile, level)
+ outfile.write(
+ 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (
+ self.category, self.content_type,
+ self.name, self.value))
+ elif self.category == MixedContainer.CategorySimple:
+ showIndent(outfile, level)
+ outfile.write(
+ 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (
+ self.category, self.content_type,
+ self.name, self.value))
+ else: # category == MixedContainer.CategoryComplex
+ showIndent(outfile, level)
+ outfile.write(
+ 'model_.MixedContainer(%d, %d, "%s",\n' % (
+ self.category, self.content_type, self.name,))
+ self.value.exportLiteral(outfile, level + 1)
+ showIndent(outfile, level)
+ outfile.write(')\n')
+
+
+class MemberSpec_(object):
+ def __init__(self, name='', data_type='', container=0,
+ optional=0, child_attrs=None, choice=None):
+ self.name = name
+ self.data_type = data_type
+ self.container = container
+ self.child_attrs = child_attrs
+ self.choice = choice
+ self.optional = optional
+ def set_name(self, name): self.name = name
+ def get_name(self): return self.name
+ def set_data_type(self, data_type): self.data_type = data_type
+ def get_data_type_chain(self): return self.data_type
+ def get_data_type(self):
+ if isinstance(self.data_type, list):
+ if len(self.data_type) > 0:
+ return self.data_type[-1]
+ else:
+ return 'xs:string'
+ else:
+ return self.data_type
+ def set_container(self, container): self.container = container
+ def get_container(self): return self.container
+ def set_child_attrs(self, child_attrs): self.child_attrs = child_attrs
+ def get_child_attrs(self): return self.child_attrs
+ def set_choice(self, choice): self.choice = choice
+ def get_choice(self): return self.choice
+ def set_optional(self, optional): self.optional = optional
+ def get_optional(self): return self.optional
+
+
+def _cast(typ, value):
+ if typ is None or value is None:
+ return value
+ return typ(value)
+
+#
+# Data representation classes.
+#
+
+
+class DoxAccessor(str, Enum):
+ RETAIN='retain'
+ COPY='copy'
+ ASSIGN='assign'
+ WEAK='weak'
+ STRONG='strong'
+ UNRETAINED='unretained'
+
+
+class DoxAlign(str, Enum):
+ LEFT='left'
+ RIGHT='right'
+ CENTER='center'
+
+
+class DoxBool(str, Enum):
+ YES='yes'
+ NO='no'
+
+
+class DoxCompoundKind(str, Enum):
+ CLASS='class'
+ STRUCT='struct'
+ UNION='union'
+ INTERFACE='interface'
+ PROTOCOL='protocol'
+ CATEGORY='category'
+ EXCEPTION='exception'
+ SERVICE='service'
+ SINGLETON='singleton'
+ MODULE='module'
+ TYPE='type'
+ FILE='file'
+ NAMESPACE='namespace'
+ GROUP='group'
+ PAGE='page'
+ EXAMPLE='example'
+ DIR='dir'
+
+
+class DoxGraphRelation(str, Enum):
+ INCLUDE='include'
+ USAGE='usage'
+ TEMPLATEINSTANCE='template-instance'
+ PUBLICINHERITANCE='public-inheritance'
+ PROTECTEDINHERITANCE='protected-inheritance'
+ PRIVATEINHERITANCE='private-inheritance'
+ TYPECONSTRAINT='type-constraint'
+
+
+class DoxHighlightClass(str, Enum):
+ COMMENT='comment'
+ NORMAL='normal'
+ PREPROCESSOR='preprocessor'
+ KEYWORD='keyword'
+ KEYWORDTYPE='keywordtype'
+ KEYWORDFLOW='keywordflow'
+ STRINGLITERAL='stringliteral'
+ CHARLITERAL='charliteral'
+ VHDLKEYWORD='vhdlkeyword'
+ VHDLLOGIC='vhdllogic'
+ VHDLCHAR='vhdlchar'
+ VHDLDIGIT='vhdldigit'
+
+
+class DoxImageKind(str, Enum):
+ HTML='html'
+ LATEX='latex'
+ DOCBOOK='docbook'
+ RTF='rtf'
+
+
+class DoxLanguage(str, Enum):
+ UNKNOWN='Unknown'
+ IDL='IDL'
+ JAVA='Java'
+ C='C#'
+ D='D'
+ PHP='PHP'
+ OBJECTIVEC='Objective-C'
+ C_1='C++'
+ JAVA_SCRIPT='JavaScript'
+ PYTHON='Python'
+ FORTRAN='Fortran'
+ VHDL='VHDL'
+ XML='XML'
+ SQL='SQL'
+ MARKDOWN='Markdown'
+
+
+class DoxMemberKind(str, Enum):
+ DEFINE='define'
+ PROPERTY='property'
+ EVENT='event'
+ VARIABLE='variable'
+ TYPEDEF='typedef'
+ ENUM='enum'
+ FUNCTION='function'
+ SIGNAL='signal'
+ PROTOTYPE='prototype'
+ FRIEND='friend'
+ DCOP='dcop'
+ SLOT='slot'
+ INTERFACE='interface'
+ SERVICE='service'
+
+
+class DoxParamDir(str, Enum):
+ IN='in'
+ OUT='out'
+ INOUT='inout'
+
+
+class DoxParamListKind(str, Enum):
+ PARAM='param'
+ RETVAL='retval'
+ EXCEPTION='exception'
+ TEMPLATEPARAM='templateparam'
+
+
+class DoxProtectionKind(str, Enum):
+ PUBLIC='public'
+ PROTECTED='protected'
+ PRIVATE='private'
+ PACKAGE='package'
+
+
+class DoxRefKind(str, Enum):
+ COMPOUND='compound'
+ MEMBER='member'
+
+
+class DoxRefQualifierKind(str, Enum):
+ LVALUE='lvalue'
+ RVALUE='rvalue'
+
+
+class DoxSectionKind(str, Enum):
+ USERDEFINED='user-defined'
+ PUBLICTYPE='public-type'
+ PUBLICFUNC='public-func'
+ PUBLICATTRIB='public-attrib'
+ PUBLICSLOT='public-slot'
+ SIGNAL='signal'
+ DCOPFUNC='dcop-func'
+ PROPERTY='property'
+ EVENT='event'
+ PUBLICSTATICFUNC='public-static-func'
+ PUBLICSTATICATTRIB='public-static-attrib'
+ PROTECTEDTYPE='protected-type'
+ PROTECTEDFUNC='protected-func'
+ PROTECTEDATTRIB='protected-attrib'
+ PROTECTEDSLOT='protected-slot'
+ PROTECTEDSTATICFUNC='protected-static-func'
+ PROTECTEDSTATICATTRIB='protected-static-attrib'
+ PACKAGETYPE='package-type'
+ PACKAGEFUNC='package-func'
+ PACKAGEATTRIB='package-attrib'
+ PACKAGESTATICFUNC='package-static-func'
+ PACKAGESTATICATTRIB='package-static-attrib'
+ PRIVATETYPE='private-type'
+ PRIVATEFUNC='private-func'
+ PRIVATEATTRIB='private-attrib'
+ PRIVATESLOT='private-slot'
+ PRIVATESTATICFUNC='private-static-func'
+ PRIVATESTATICATTRIB='private-static-attrib'
+ FRIEND='friend'
+ RELATED='related'
+ DEFINE='define'
+ PROTOTYPE='prototype'
+ TYPEDEF='typedef'
+ ENUM='enum'
+ FUNC='func'
+ VAR='var'
+
+
+class DoxSimpleSectKind(str, Enum):
+ SEE='see'
+ RETURN='return'
+ AUTHOR='author'
+ AUTHORS='authors'
+ VERSION='version'
+ SINCE='since'
+ DATE='date'
+ NOTE='note'
+ WARNING='warning'
+ PRE='pre'
+ POST='post'
+ COPYRIGHT='copyright'
+ INVARIANT='invariant'
+ REMARK='remark'
+ ATTENTION='attention'
+ PAR='par'
+ RCS='rcs'
+
+
+class DoxVerticalAlign(str, Enum):
+ BOTTOM='bottom'
+ TOP='top'
+ MIDDLE='middle'
+
+
+class DoxVirtualKind(str, Enum):
+ NONVIRTUAL='non-virtual'
+ VIRTUAL='virtual'
+ PUREVIRTUAL='pure-virtual'
+
+
+class DoxygenType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, version=None, lang=None, compounddef=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.version = _cast(None, version)
+ self.version_nsprefix_ = None
+ self.lang = _cast(None, lang)
+ self.lang_nsprefix_ = None
+ if compounddef is None:
+ self.compounddef = []
+ else:
+ self.compounddef = compounddef
+ self.compounddef_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, DoxygenType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if DoxygenType.subclass:
+ return DoxygenType.subclass(*args_, **kwargs_)
+ else:
+ return DoxygenType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_compounddef(self):
+ return self.compounddef
+ def set_compounddef(self, compounddef):
+ self.compounddef = compounddef
+ def add_compounddef(self, value):
+ self.compounddef.append(value)
+ def insert_compounddef_at(self, index, value):
+ self.compounddef.insert(index, value)
+ def replace_compounddef_at(self, index, value):
+ self.compounddef[index] = value
+ def get_version(self):
+ return self.version
+ def set_version(self, version):
+ self.version = version
+ def get_lang(self):
+ return self.lang
+ def set_lang(self, lang):
+ self.lang = lang
+ def validate_DoxVersionNumber(self, value):
+ # Validate type DoxVersionNumber, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ if not self.gds_validate_simple_patterns(
+ self.validate_DoxVersionNumber_patterns_, value):
+ self.gds_collector_.add_message('Value "%s" does not match xsd pattern restrictions: %s' % (encode_str_2_3(value), self.validate_DoxVersionNumber_patterns_, ))
+ validate_DoxVersionNumber_patterns_ = [['^(\\d+\\.\\d+.*)$']]
+ def hasContent_(self):
+ if (
+ self.compounddef
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='DoxygenType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('DoxygenType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'DoxygenType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='DoxygenType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='DoxygenType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='DoxygenType'):
+ if self.version is not None and 'version' not in already_processed:
+ already_processed.add('version')
+ outfile.write(' version=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.version), input_name='version')), ))
+ if self.lang is not None and 'lang' not in already_processed:
+ already_processed.add('lang')
+ outfile.write(' xml:lang=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.lang), input_name='lang')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='DoxygenType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for compounddef_ in self.compounddef:
+ namespaceprefix_ = self.compounddef_nsprefix_ + ':' if (UseCapturedNS_ and self.compounddef_nsprefix_) else ''
+ compounddef_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='compounddef', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('version', node)
+ if value is not None and 'version' not in already_processed:
+ already_processed.add('version')
+ self.version = value
+ self.validate_DoxVersionNumber(self.version) # validate type DoxVersionNumber
+ value = find_attr_value_('lang', node)
+ if value is not None and 'lang' not in already_processed:
+ already_processed.add('lang')
+ self.lang = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'compounddef':
+ obj_ = compounddefType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.compounddef.append(obj_)
+ obj_.original_tagname_ = 'compounddef'
+# end class DoxygenType
+
+
+class compounddefType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, id=None, kind=None, language=None, prot=None, final=None, inline=None, sealed=None, abstract=None, compoundname=None, title=None, basecompoundref=None, derivedcompoundref=None, includes=None, includedby=None, incdepgraph=None, invincdepgraph=None, innerdir=None, innerfile=None, innerclass=None, innernamespace=None, innerpage=None, innergroup=None, templateparamlist=None, sectiondef=None, tableofcontents=None, briefdescription=None, detaileddescription=None, inheritancegraph=None, collaborationgraph=None, programlisting=None, location=None, listofallmembers=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.id = _cast(None, id)
+ self.id_nsprefix_ = None
+ self.kind = _cast(None, kind)
+ self.kind_nsprefix_ = None
+ self.language = _cast(None, language)
+ self.language_nsprefix_ = None
+ self.prot = _cast(None, prot)
+ self.prot_nsprefix_ = None
+ self.final = _cast(None, final)
+ self.final_nsprefix_ = None
+ self.inline = _cast(None, inline)
+ self.inline_nsprefix_ = None
+ self.sealed = _cast(None, sealed)
+ self.sealed_nsprefix_ = None
+ self.abstract = _cast(None, abstract)
+ self.abstract_nsprefix_ = None
+ self.compoundname = compoundname
+ self.compoundname_nsprefix_ = None
+ self.title = title
+ self.title_nsprefix_ = None
+ if basecompoundref is None:
+ self.basecompoundref = []
+ else:
+ self.basecompoundref = basecompoundref
+ self.basecompoundref_nsprefix_ = None
+ if derivedcompoundref is None:
+ self.derivedcompoundref = []
+ else:
+ self.derivedcompoundref = derivedcompoundref
+ self.derivedcompoundref_nsprefix_ = None
+ if includes is None:
+ self.includes = []
+ else:
+ self.includes = includes
+ self.includes_nsprefix_ = None
+ if includedby is None:
+ self.includedby = []
+ else:
+ self.includedby = includedby
+ self.includedby_nsprefix_ = None
+ self.incdepgraph = incdepgraph
+ self.incdepgraph_nsprefix_ = None
+ self.invincdepgraph = invincdepgraph
+ self.invincdepgraph_nsprefix_ = None
+ if innerdir is None:
+ self.innerdir = []
+ else:
+ self.innerdir = innerdir
+ self.innerdir_nsprefix_ = None
+ if innerfile is None:
+ self.innerfile = []
+ else:
+ self.innerfile = innerfile
+ self.innerfile_nsprefix_ = None
+ if innerclass is None:
+ self.innerclass = []
+ else:
+ self.innerclass = innerclass
+ self.innerclass_nsprefix_ = None
+ if innernamespace is None:
+ self.innernamespace = []
+ else:
+ self.innernamespace = innernamespace
+ self.innernamespace_nsprefix_ = None
+ if innerpage is None:
+ self.innerpage = []
+ else:
+ self.innerpage = innerpage
+ self.innerpage_nsprefix_ = None
+ if innergroup is None:
+ self.innergroup = []
+ else:
+ self.innergroup = innergroup
+ self.innergroup_nsprefix_ = None
+ self.templateparamlist = templateparamlist
+ self.templateparamlist_nsprefix_ = None
+ if sectiondef is None:
+ self.sectiondef = []
+ else:
+ self.sectiondef = sectiondef
+ self.sectiondef_nsprefix_ = None
+ self.tableofcontents = tableofcontents
+ self.tableofcontents_nsprefix_ = None
+ self.briefdescription = briefdescription
+ self.briefdescription_nsprefix_ = None
+ self.detaileddescription = detaileddescription
+ self.detaileddescription_nsprefix_ = None
+ self.inheritancegraph = inheritancegraph
+ self.inheritancegraph_nsprefix_ = None
+ self.collaborationgraph = collaborationgraph
+ self.collaborationgraph_nsprefix_ = None
+ self.programlisting = programlisting
+ self.programlisting_nsprefix_ = None
+ self.location = location
+ self.location_nsprefix_ = None
+ self.listofallmembers = listofallmembers
+ self.listofallmembers_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, compounddefType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if compounddefType.subclass:
+ return compounddefType.subclass(*args_, **kwargs_)
+ else:
+ return compounddefType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_compoundname(self):
+ return self.compoundname
+ def set_compoundname(self, compoundname):
+ self.compoundname = compoundname
+ def get_title(self):
+ return self.title
+ def set_title(self, title):
+ self.title = title
+ def get_basecompoundref(self):
+ return self.basecompoundref
+ def set_basecompoundref(self, basecompoundref):
+ self.basecompoundref = basecompoundref
+ def add_basecompoundref(self, value):
+ self.basecompoundref.append(value)
+ def insert_basecompoundref_at(self, index, value):
+ self.basecompoundref.insert(index, value)
+ def replace_basecompoundref_at(self, index, value):
+ self.basecompoundref[index] = value
+ def get_derivedcompoundref(self):
+ return self.derivedcompoundref
+ def set_derivedcompoundref(self, derivedcompoundref):
+ self.derivedcompoundref = derivedcompoundref
+ def add_derivedcompoundref(self, value):
+ self.derivedcompoundref.append(value)
+ def insert_derivedcompoundref_at(self, index, value):
+ self.derivedcompoundref.insert(index, value)
+ def replace_derivedcompoundref_at(self, index, value):
+ self.derivedcompoundref[index] = value
+ def get_includes(self):
+ return self.includes
+ def set_includes(self, includes):
+ self.includes = includes
+ def add_includes(self, value):
+ self.includes.append(value)
+ def insert_includes_at(self, index, value):
+ self.includes.insert(index, value)
+ def replace_includes_at(self, index, value):
+ self.includes[index] = value
+ def get_includedby(self):
+ return self.includedby
+ def set_includedby(self, includedby):
+ self.includedby = includedby
+ def add_includedby(self, value):
+ self.includedby.append(value)
+ def insert_includedby_at(self, index, value):
+ self.includedby.insert(index, value)
+ def replace_includedby_at(self, index, value):
+ self.includedby[index] = value
+ def get_incdepgraph(self):
+ return self.incdepgraph
+ def set_incdepgraph(self, incdepgraph):
+ self.incdepgraph = incdepgraph
+ def get_invincdepgraph(self):
+ return self.invincdepgraph
+ def set_invincdepgraph(self, invincdepgraph):
+ self.invincdepgraph = invincdepgraph
+ def get_innerdir(self):
+ return self.innerdir
+ def set_innerdir(self, innerdir):
+ self.innerdir = innerdir
+ def add_innerdir(self, value):
+ self.innerdir.append(value)
+ def insert_innerdir_at(self, index, value):
+ self.innerdir.insert(index, value)
+ def replace_innerdir_at(self, index, value):
+ self.innerdir[index] = value
+ def get_innerfile(self):
+ return self.innerfile
+ def set_innerfile(self, innerfile):
+ self.innerfile = innerfile
+ def add_innerfile(self, value):
+ self.innerfile.append(value)
+ def insert_innerfile_at(self, index, value):
+ self.innerfile.insert(index, value)
+ def replace_innerfile_at(self, index, value):
+ self.innerfile[index] = value
+ def get_innerclass(self):
+ return self.innerclass
+ def set_innerclass(self, innerclass):
+ self.innerclass = innerclass
+ def add_innerclass(self, value):
+ self.innerclass.append(value)
+ def insert_innerclass_at(self, index, value):
+ self.innerclass.insert(index, value)
+ def replace_innerclass_at(self, index, value):
+ self.innerclass[index] = value
+ def get_innernamespace(self):
+ return self.innernamespace
+ def set_innernamespace(self, innernamespace):
+ self.innernamespace = innernamespace
+ def add_innernamespace(self, value):
+ self.innernamespace.append(value)
+ def insert_innernamespace_at(self, index, value):
+ self.innernamespace.insert(index, value)
+ def replace_innernamespace_at(self, index, value):
+ self.innernamespace[index] = value
+ def get_innerpage(self):
+ return self.innerpage
+ def set_innerpage(self, innerpage):
+ self.innerpage = innerpage
+ def add_innerpage(self, value):
+ self.innerpage.append(value)
+ def insert_innerpage_at(self, index, value):
+ self.innerpage.insert(index, value)
+ def replace_innerpage_at(self, index, value):
+ self.innerpage[index] = value
+ def get_innergroup(self):
+ return self.innergroup
+ def set_innergroup(self, innergroup):
+ self.innergroup = innergroup
+ def add_innergroup(self, value):
+ self.innergroup.append(value)
+ def insert_innergroup_at(self, index, value):
+ self.innergroup.insert(index, value)
+ def replace_innergroup_at(self, index, value):
+ self.innergroup[index] = value
+ def get_templateparamlist(self):
+ return self.templateparamlist
+ def set_templateparamlist(self, templateparamlist):
+ self.templateparamlist = templateparamlist
+ def get_sectiondef(self):
+ return self.sectiondef
+ def set_sectiondef(self, sectiondef):
+ self.sectiondef = sectiondef
+ def add_sectiondef(self, value):
+ self.sectiondef.append(value)
+ def insert_sectiondef_at(self, index, value):
+ self.sectiondef.insert(index, value)
+ def replace_sectiondef_at(self, index, value):
+ self.sectiondef[index] = value
+ def get_tableofcontents(self):
+ return self.tableofcontents
+ def set_tableofcontents(self, tableofcontents):
+ self.tableofcontents = tableofcontents
+ def get_briefdescription(self):
+ return self.briefdescription
+ def set_briefdescription(self, briefdescription):
+ self.briefdescription = briefdescription
+ def get_detaileddescription(self):
+ return self.detaileddescription
+ def set_detaileddescription(self, detaileddescription):
+ self.detaileddescription = detaileddescription
+ def get_inheritancegraph(self):
+ return self.inheritancegraph
+ def set_inheritancegraph(self, inheritancegraph):
+ self.inheritancegraph = inheritancegraph
+ def get_collaborationgraph(self):
+ return self.collaborationgraph
+ def set_collaborationgraph(self, collaborationgraph):
+ self.collaborationgraph = collaborationgraph
+ def get_programlisting(self):
+ return self.programlisting
+ def set_programlisting(self, programlisting):
+ self.programlisting = programlisting
+ def get_location(self):
+ return self.location
+ def set_location(self, location):
+ self.location = location
+ def get_listofallmembers(self):
+ return self.listofallmembers
+ def set_listofallmembers(self, listofallmembers):
+ self.listofallmembers = listofallmembers
+ def get_id(self):
+ return self.id
+ def set_id(self, id):
+ self.id = id
+ def get_kind(self):
+ return self.kind
+ def set_kind(self, kind):
+ self.kind = kind
+ def get_language(self):
+ return self.language
+ def set_language(self, language):
+ self.language = language
+ def get_prot(self):
+ return self.prot
+ def set_prot(self, prot):
+ self.prot = prot
+ def get_final(self):
+ return self.final
+ def set_final(self, final):
+ self.final = final
+ def get_inline(self):
+ return self.inline
+ def set_inline(self, inline):
+ self.inline = inline
+ def get_sealed(self):
+ return self.sealed
+ def set_sealed(self, sealed):
+ self.sealed = sealed
+ def get_abstract(self):
+ return self.abstract
+ def set_abstract(self, abstract):
+ self.abstract = abstract
+ def validate_DoxCompoundKind(self, value):
+ # Validate type DoxCompoundKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['class', 'struct', 'union', 'interface', 'protocol', 'category', 'exception', 'service', 'singleton', 'module', 'type', 'file', 'namespace', 'group', 'page', 'example', 'dir']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxCompoundKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def validate_DoxLanguage(self, value):
+ # Validate type DoxLanguage, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['Unknown', 'IDL', 'Java', 'C#', 'D', 'PHP', 'Objective-C', 'C++', 'JavaScript', 'Python', 'Fortran', 'VHDL', 'XML', 'SQL', 'Markdown']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxLanguage' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def validate_DoxProtectionKind(self, value):
+ # Validate type DoxProtectionKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['public', 'protected', 'private', 'package']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxProtectionKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def validate_DoxBool(self, value):
+ # Validate type DoxBool, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['yes', 'no']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxBool' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ self.compoundname is not None or
+ self.title is not None or
+ self.basecompoundref or
+ self.derivedcompoundref or
+ self.includes or
+ self.includedby or
+ self.incdepgraph is not None or
+ self.invincdepgraph is not None or
+ self.innerdir or
+ self.innerfile or
+ self.innerclass or
+ self.innernamespace or
+ self.innerpage or
+ self.innergroup or
+ self.templateparamlist is not None or
+ self.sectiondef or
+ self.tableofcontents is not None or
+ self.briefdescription is not None or
+ self.detaileddescription is not None or
+ self.inheritancegraph is not None or
+ self.collaborationgraph is not None or
+ self.programlisting is not None or
+ self.location is not None or
+ self.listofallmembers is not None
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='compounddefType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('compounddefType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'compounddefType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='compounddefType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='compounddefType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='compounddefType'):
+ if self.id is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
+ if self.kind is not None and 'kind' not in already_processed:
+ already_processed.add('kind')
+ outfile.write(' kind=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.kind), input_name='kind')), ))
+ if self.language is not None and 'language' not in already_processed:
+ already_processed.add('language')
+ outfile.write(' language=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.language), input_name='language')), ))
+ if self.prot is not None and 'prot' not in already_processed:
+ already_processed.add('prot')
+ outfile.write(' prot=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.prot), input_name='prot')), ))
+ if self.final is not None and 'final' not in already_processed:
+ already_processed.add('final')
+ outfile.write(' final=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.final), input_name='final')), ))
+ if self.inline is not None and 'inline' not in already_processed:
+ already_processed.add('inline')
+ outfile.write(' inline=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.inline), input_name='inline')), ))
+ if self.sealed is not None and 'sealed' not in already_processed:
+ already_processed.add('sealed')
+ outfile.write(' sealed=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.sealed), input_name='sealed')), ))
+ if self.abstract is not None and 'abstract' not in already_processed:
+ already_processed.add('abstract')
+ outfile.write(' abstract=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.abstract), input_name='abstract')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='compounddefType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.compoundname is not None:
+ namespaceprefix_ = self.compoundname_nsprefix_ + ':' if (UseCapturedNS_ and self.compoundname_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%scompoundname>%s</%scompoundname>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.compoundname), input_name='compoundname')), namespaceprefix_ , eol_))
+ if self.title is not None:
+ namespaceprefix_ = self.title_nsprefix_ + ':' if (UseCapturedNS_ and self.title_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%stitle>%s</%stitle>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.title), input_name='title')), namespaceprefix_ , eol_))
+ for basecompoundref_ in self.basecompoundref:
+ namespaceprefix_ = self.basecompoundref_nsprefix_ + ':' if (UseCapturedNS_ and self.basecompoundref_nsprefix_) else ''
+ basecompoundref_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='basecompoundref', pretty_print=pretty_print)
+ for derivedcompoundref_ in self.derivedcompoundref:
+ namespaceprefix_ = self.derivedcompoundref_nsprefix_ + ':' if (UseCapturedNS_ and self.derivedcompoundref_nsprefix_) else ''
+ derivedcompoundref_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='derivedcompoundref', pretty_print=pretty_print)
+ for includes_ in self.includes:
+ namespaceprefix_ = self.includes_nsprefix_ + ':' if (UseCapturedNS_ and self.includes_nsprefix_) else ''
+ includes_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='includes', pretty_print=pretty_print)
+ for includedby_ in self.includedby:
+ namespaceprefix_ = self.includedby_nsprefix_ + ':' if (UseCapturedNS_ and self.includedby_nsprefix_) else ''
+ includedby_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='includedby', pretty_print=pretty_print)
+ if self.incdepgraph is not None:
+ namespaceprefix_ = self.incdepgraph_nsprefix_ + ':' if (UseCapturedNS_ and self.incdepgraph_nsprefix_) else ''
+ self.incdepgraph.export(outfile, level, namespaceprefix_, namespacedef_='', name_='incdepgraph', pretty_print=pretty_print)
+ if self.invincdepgraph is not None:
+ namespaceprefix_ = self.invincdepgraph_nsprefix_ + ':' if (UseCapturedNS_ and self.invincdepgraph_nsprefix_) else ''
+ self.invincdepgraph.export(outfile, level, namespaceprefix_, namespacedef_='', name_='invincdepgraph', pretty_print=pretty_print)
+ for innerdir_ in self.innerdir:
+ namespaceprefix_ = self.innerdir_nsprefix_ + ':' if (UseCapturedNS_ and self.innerdir_nsprefix_) else ''
+ innerdir_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='innerdir', pretty_print=pretty_print)
+ for innerfile_ in self.innerfile:
+ namespaceprefix_ = self.innerfile_nsprefix_ + ':' if (UseCapturedNS_ and self.innerfile_nsprefix_) else ''
+ innerfile_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='innerfile', pretty_print=pretty_print)
+ for innerclass_ in self.innerclass:
+ namespaceprefix_ = self.innerclass_nsprefix_ + ':' if (UseCapturedNS_ and self.innerclass_nsprefix_) else ''
+ innerclass_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='innerclass', pretty_print=pretty_print)
+ for innernamespace_ in self.innernamespace:
+ namespaceprefix_ = self.innernamespace_nsprefix_ + ':' if (UseCapturedNS_ and self.innernamespace_nsprefix_) else ''
+ innernamespace_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='innernamespace', pretty_print=pretty_print)
+ for innerpage_ in self.innerpage:
+ namespaceprefix_ = self.innerpage_nsprefix_ + ':' if (UseCapturedNS_ and self.innerpage_nsprefix_) else ''
+ innerpage_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='innerpage', pretty_print=pretty_print)
+ for innergroup_ in self.innergroup:
+ namespaceprefix_ = self.innergroup_nsprefix_ + ':' if (UseCapturedNS_ and self.innergroup_nsprefix_) else ''
+ innergroup_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='innergroup', pretty_print=pretty_print)
+ if self.templateparamlist is not None:
+ namespaceprefix_ = self.templateparamlist_nsprefix_ + ':' if (UseCapturedNS_ and self.templateparamlist_nsprefix_) else ''
+ self.templateparamlist.export(outfile, level, namespaceprefix_, namespacedef_='', name_='templateparamlist', pretty_print=pretty_print)
+ for sectiondef_ in self.sectiondef:
+ namespaceprefix_ = self.sectiondef_nsprefix_ + ':' if (UseCapturedNS_ and self.sectiondef_nsprefix_) else ''
+ sectiondef_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='sectiondef', pretty_print=pretty_print)
+ if self.tableofcontents is not None:
+ namespaceprefix_ = self.tableofcontents_nsprefix_ + ':' if (UseCapturedNS_ and self.tableofcontents_nsprefix_) else ''
+ self.tableofcontents.export(outfile, level, namespaceprefix_, namespacedef_='', name_='tableofcontents', pretty_print=pretty_print)
+ if self.briefdescription is not None:
+ namespaceprefix_ = self.briefdescription_nsprefix_ + ':' if (UseCapturedNS_ and self.briefdescription_nsprefix_) else ''
+ self.briefdescription.export(outfile, level, namespaceprefix_, namespacedef_='', name_='briefdescription', pretty_print=pretty_print)
+ if self.detaileddescription is not None:
+ namespaceprefix_ = self.detaileddescription_nsprefix_ + ':' if (UseCapturedNS_ and self.detaileddescription_nsprefix_) else ''
+ self.detaileddescription.export(outfile, level, namespaceprefix_, namespacedef_='', name_='detaileddescription', pretty_print=pretty_print)
+ if self.inheritancegraph is not None:
+ namespaceprefix_ = self.inheritancegraph_nsprefix_ + ':' if (UseCapturedNS_ and self.inheritancegraph_nsprefix_) else ''
+ self.inheritancegraph.export(outfile, level, namespaceprefix_, namespacedef_='', name_='inheritancegraph', pretty_print=pretty_print)
+ if self.collaborationgraph is not None:
+ namespaceprefix_ = self.collaborationgraph_nsprefix_ + ':' if (UseCapturedNS_ and self.collaborationgraph_nsprefix_) else ''
+ self.collaborationgraph.export(outfile, level, namespaceprefix_, namespacedef_='', name_='collaborationgraph', pretty_print=pretty_print)
+ if self.programlisting is not None:
+ namespaceprefix_ = self.programlisting_nsprefix_ + ':' if (UseCapturedNS_ and self.programlisting_nsprefix_) else ''
+ self.programlisting.export(outfile, level, namespaceprefix_, namespacedef_='', name_='programlisting', pretty_print=pretty_print)
+ if self.location is not None:
+ namespaceprefix_ = self.location_nsprefix_ + ':' if (UseCapturedNS_ and self.location_nsprefix_) else ''
+ self.location.export(outfile, level, namespaceprefix_, namespacedef_='', name_='location', pretty_print=pretty_print)
+ if self.listofallmembers is not None:
+ namespaceprefix_ = self.listofallmembers_nsprefix_ + ':' if (UseCapturedNS_ and self.listofallmembers_nsprefix_) else ''
+ self.listofallmembers.export(outfile, level, namespaceprefix_, namespacedef_='', name_='listofallmembers', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('id', node)
+ if value is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ self.id = value
+ value = find_attr_value_('kind', node)
+ if value is not None and 'kind' not in already_processed:
+ already_processed.add('kind')
+ self.kind = value
+ self.validate_DoxCompoundKind(self.kind) # validate type DoxCompoundKind
+ value = find_attr_value_('language', node)
+ if value is not None and 'language' not in already_processed:
+ already_processed.add('language')
+ self.language = value
+ self.validate_DoxLanguage(self.language) # validate type DoxLanguage
+ value = find_attr_value_('prot', node)
+ if value is not None and 'prot' not in already_processed:
+ already_processed.add('prot')
+ self.prot = value
+ self.validate_DoxProtectionKind(self.prot) # validate type DoxProtectionKind
+ value = find_attr_value_('final', node)
+ if value is not None and 'final' not in already_processed:
+ already_processed.add('final')
+ self.final = value
+ self.validate_DoxBool(self.final) # validate type DoxBool
+ value = find_attr_value_('inline', node)
+ if value is not None and 'inline' not in already_processed:
+ already_processed.add('inline')
+ self.inline = value
+ self.validate_DoxBool(self.inline) # validate type DoxBool
+ value = find_attr_value_('sealed', node)
+ if value is not None and 'sealed' not in already_processed:
+ already_processed.add('sealed')
+ self.sealed = value
+ self.validate_DoxBool(self.sealed) # validate type DoxBool
+ value = find_attr_value_('abstract', node)
+ if value is not None and 'abstract' not in already_processed:
+ already_processed.add('abstract')
+ self.abstract = value
+ self.validate_DoxBool(self.abstract) # validate type DoxBool
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'compoundname':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'compoundname')
+ value_ = self.gds_validate_string(value_, node, 'compoundname')
+ self.compoundname = value_
+ self.compoundname_nsprefix_ = child_.prefix
+ elif nodeName_ == 'title':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'title')
+ value_ = self.gds_validate_string(value_, node, 'title')
+ self.title = value_
+ self.title_nsprefix_ = child_.prefix
+ elif nodeName_ == 'basecompoundref':
+ obj_ = compoundRefType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.basecompoundref.append(obj_)
+ obj_.original_tagname_ = 'basecompoundref'
+ elif nodeName_ == 'derivedcompoundref':
+ obj_ = compoundRefType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.derivedcompoundref.append(obj_)
+ obj_.original_tagname_ = 'derivedcompoundref'
+ elif nodeName_ == 'includes':
+ obj_ = incType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.includes.append(obj_)
+ obj_.original_tagname_ = 'includes'
+ elif nodeName_ == 'includedby':
+ obj_ = incType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.includedby.append(obj_)
+ obj_.original_tagname_ = 'includedby'
+ elif nodeName_ == 'incdepgraph':
+ obj_ = graphType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.incdepgraph = obj_
+ obj_.original_tagname_ = 'incdepgraph'
+ elif nodeName_ == 'invincdepgraph':
+ obj_ = graphType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.invincdepgraph = obj_
+ obj_.original_tagname_ = 'invincdepgraph'
+ elif nodeName_ == 'innerdir':
+ obj_ = refType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.innerdir.append(obj_)
+ obj_.original_tagname_ = 'innerdir'
+ elif nodeName_ == 'innerfile':
+ obj_ = refType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.innerfile.append(obj_)
+ obj_.original_tagname_ = 'innerfile'
+ elif nodeName_ == 'innerclass':
+ obj_ = refType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.innerclass.append(obj_)
+ obj_.original_tagname_ = 'innerclass'
+ elif nodeName_ == 'innernamespace':
+ obj_ = refType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.innernamespace.append(obj_)
+ obj_.original_tagname_ = 'innernamespace'
+ elif nodeName_ == 'innerpage':
+ obj_ = refType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.innerpage.append(obj_)
+ obj_.original_tagname_ = 'innerpage'
+ elif nodeName_ == 'innergroup':
+ obj_ = refType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.innergroup.append(obj_)
+ obj_.original_tagname_ = 'innergroup'
+ elif nodeName_ == 'templateparamlist':
+ obj_ = templateparamlistType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.templateparamlist = obj_
+ obj_.original_tagname_ = 'templateparamlist'
+ elif nodeName_ == 'sectiondef':
+ obj_ = sectiondefType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.sectiondef.append(obj_)
+ obj_.original_tagname_ = 'sectiondef'
+ elif nodeName_ == 'tableofcontents':
+ obj_ = tableofcontentsType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.tableofcontents = obj_
+ obj_.original_tagname_ = 'tableofcontents'
+ elif nodeName_ == 'briefdescription':
+ obj_ = descriptionType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.briefdescription = obj_
+ obj_.original_tagname_ = 'briefdescription'
+ elif nodeName_ == 'detaileddescription':
+ obj_ = descriptionType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.detaileddescription = obj_
+ obj_.original_tagname_ = 'detaileddescription'
+ elif nodeName_ == 'inheritancegraph':
+ obj_ = graphType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.inheritancegraph = obj_
+ obj_.original_tagname_ = 'inheritancegraph'
+ elif nodeName_ == 'collaborationgraph':
+ obj_ = graphType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.collaborationgraph = obj_
+ obj_.original_tagname_ = 'collaborationgraph'
+ elif nodeName_ == 'programlisting':
+ obj_ = listingType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.programlisting = obj_
+ obj_.original_tagname_ = 'programlisting'
+ elif nodeName_ == 'location':
+ obj_ = locationType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.location = obj_
+ obj_.original_tagname_ = 'location'
+ elif nodeName_ == 'listofallmembers':
+ obj_ = listofallmembersType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.listofallmembers = obj_
+ obj_.original_tagname_ = 'listofallmembers'
+# end class compounddefType
+
+
+class listofallmembersType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, member=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if member is None:
+ self.member = []
+ else:
+ self.member = member
+ self.member_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, listofallmembersType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if listofallmembersType.subclass:
+ return listofallmembersType.subclass(*args_, **kwargs_)
+ else:
+ return listofallmembersType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_member(self):
+ return self.member
+ def set_member(self, member):
+ self.member = member
+ def add_member(self, value):
+ self.member.append(value)
+ def insert_member_at(self, index, value):
+ self.member.insert(index, value)
+ def replace_member_at(self, index, value):
+ self.member[index] = value
+ def hasContent_(self):
+ if (
+ self.member
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='listofallmembersType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('listofallmembersType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'listofallmembersType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='listofallmembersType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='listofallmembersType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='listofallmembersType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='listofallmembersType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for member_ in self.member:
+ namespaceprefix_ = self.member_nsprefix_ + ':' if (UseCapturedNS_ and self.member_nsprefix_) else ''
+ member_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='member', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'member':
+ obj_ = memberRefType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.member.append(obj_)
+ obj_.original_tagname_ = 'member'
+# end class listofallmembersType
+
+
+class memberRefType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, refid=None, prot=None, virt=None, ambiguityscope=None, scope=None, name=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.refid = _cast(None, refid)
+ self.refid_nsprefix_ = None
+ self.prot = _cast(None, prot)
+ self.prot_nsprefix_ = None
+ self.virt = _cast(None, virt)
+ self.virt_nsprefix_ = None
+ self.ambiguityscope = _cast(None, ambiguityscope)
+ self.ambiguityscope_nsprefix_ = None
+ self.scope = scope
+ self.scope_nsprefix_ = None
+ self.name = name
+ self.name_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, memberRefType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if memberRefType.subclass:
+ return memberRefType.subclass(*args_, **kwargs_)
+ else:
+ return memberRefType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_scope(self):
+ return self.scope
+ def set_scope(self, scope):
+ self.scope = scope
+ def get_name(self):
+ return self.name
+ def set_name(self, name):
+ self.name = name
+ def get_refid(self):
+ return self.refid
+ def set_refid(self, refid):
+ self.refid = refid
+ def get_prot(self):
+ return self.prot
+ def set_prot(self, prot):
+ self.prot = prot
+ def get_virt(self):
+ return self.virt
+ def set_virt(self, virt):
+ self.virt = virt
+ def get_ambiguityscope(self):
+ return self.ambiguityscope
+ def set_ambiguityscope(self, ambiguityscope):
+ self.ambiguityscope = ambiguityscope
+ def validate_DoxProtectionKind(self, value):
+ # Validate type DoxProtectionKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['public', 'protected', 'private', 'package']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxProtectionKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def validate_DoxVirtualKind(self, value):
+ # Validate type DoxVirtualKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['non-virtual', 'virtual', 'pure-virtual']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxVirtualKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ self.scope is not None or
+ self.name is not None
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='memberRefType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('memberRefType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'memberRefType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='memberRefType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='memberRefType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='memberRefType'):
+ if self.refid is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
+ if self.prot is not None and 'prot' not in already_processed:
+ already_processed.add('prot')
+ outfile.write(' prot=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.prot), input_name='prot')), ))
+ if self.virt is not None and 'virt' not in already_processed:
+ already_processed.add('virt')
+ outfile.write(' virt=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.virt), input_name='virt')), ))
+ if self.ambiguityscope is not None and 'ambiguityscope' not in already_processed:
+ already_processed.add('ambiguityscope')
+ outfile.write(' ambiguityscope=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.ambiguityscope), input_name='ambiguityscope')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='memberRefType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.scope is not None:
+ namespaceprefix_ = self.scope_nsprefix_ + ':' if (UseCapturedNS_ and self.scope_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sscope>%s</%sscope>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.scope), input_name='scope')), namespaceprefix_ , eol_))
+ if self.name is not None:
+ namespaceprefix_ = self.name_nsprefix_ + ':' if (UseCapturedNS_ and self.name_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sname>%s</%sname>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.name), input_name='name')), namespaceprefix_ , eol_))
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('refid', node)
+ if value is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ self.refid = value
+ value = find_attr_value_('prot', node)
+ if value is not None and 'prot' not in already_processed:
+ already_processed.add('prot')
+ self.prot = value
+ self.validate_DoxProtectionKind(self.prot) # validate type DoxProtectionKind
+ value = find_attr_value_('virt', node)
+ if value is not None and 'virt' not in already_processed:
+ already_processed.add('virt')
+ self.virt = value
+ self.validate_DoxVirtualKind(self.virt) # validate type DoxVirtualKind
+ value = find_attr_value_('ambiguityscope', node)
+ if value is not None and 'ambiguityscope' not in already_processed:
+ already_processed.add('ambiguityscope')
+ self.ambiguityscope = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'scope':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'scope')
+ value_ = self.gds_validate_string(value_, node, 'scope')
+ self.scope = value_
+ self.scope_nsprefix_ = child_.prefix
+ elif nodeName_ == 'name':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'name')
+ value_ = self.gds_validate_string(value_, node, 'name')
+ self.name = value_
+ self.name_nsprefix_ = child_.prefix
+# end class memberRefType
+
+
+class scope(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, scope)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if scope.subclass:
+ return scope.subclass(*args_, **kwargs_)
+ else:
+ return scope(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def hasContent_(self):
+ if (
+
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='scope', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('scope')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'scope':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='scope')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='scope', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='scope'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='scope', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class scope
+
+
+class name(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, name)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if name.subclass:
+ return name.subclass(*args_, **kwargs_)
+ else:
+ return name(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def hasContent_(self):
+ if (
+
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='name', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('name')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'name':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='name')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='name', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='name'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='name', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class name
+
+
+class docHtmlOnlyType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, block=None, valueOf_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.block = _cast(None, block)
+ self.block_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docHtmlOnlyType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docHtmlOnlyType.subclass:
+ return docHtmlOnlyType.subclass(*args_, **kwargs_)
+ else:
+ return docHtmlOnlyType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_block(self):
+ return self.block
+ def set_block(self, block):
+ self.block = block
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_)
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docHtmlOnlyType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docHtmlOnlyType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docHtmlOnlyType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docHtmlOnlyType')
+ if self.hasContent_():
+ outfile.write('>')
+ outfile.write(self.convert_unicode(self.valueOf_))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docHtmlOnlyType', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docHtmlOnlyType'):
+ if self.block is not None and 'block' not in already_processed:
+ already_processed.add('block')
+ outfile.write(' block=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.block), input_name='block')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docHtmlOnlyType', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('block', node)
+ if value is not None and 'block' not in already_processed:
+ already_processed.add('block')
+ self.block = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class docHtmlOnlyType
+
+
+class compoundRefType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, refid=None, prot=None, virt=None, valueOf_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.refid = _cast(None, refid)
+ self.refid_nsprefix_ = None
+ self.prot = _cast(None, prot)
+ self.prot_nsprefix_ = None
+ self.virt = _cast(None, virt)
+ self.virt_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, compoundRefType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if compoundRefType.subclass:
+ return compoundRefType.subclass(*args_, **kwargs_)
+ else:
+ return compoundRefType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_refid(self):
+ return self.refid
+ def set_refid(self, refid):
+ self.refid = refid
+ def get_prot(self):
+ return self.prot
+ def set_prot(self, prot):
+ self.prot = prot
+ def get_virt(self):
+ return self.virt
+ def set_virt(self, virt):
+ self.virt = virt
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def validate_DoxProtectionKind(self, value):
+ # Validate type DoxProtectionKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['public', 'protected', 'private', 'package']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxProtectionKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def validate_DoxVirtualKind(self, value):
+ # Validate type DoxVirtualKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['non-virtual', 'virtual', 'pure-virtual']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxVirtualKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_)
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='compoundRefType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('compoundRefType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'compoundRefType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='compoundRefType')
+ if self.hasContent_():
+ outfile.write('>')
+ outfile.write(self.convert_unicode(self.valueOf_))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='compoundRefType', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='compoundRefType'):
+ if self.refid is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
+ if self.prot is not None and 'prot' not in already_processed:
+ already_processed.add('prot')
+ outfile.write(' prot=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.prot), input_name='prot')), ))
+ if self.virt is not None and 'virt' not in already_processed:
+ already_processed.add('virt')
+ outfile.write(' virt=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.virt), input_name='virt')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='compoundRefType', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('refid', node)
+ if value is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ self.refid = value
+ value = find_attr_value_('prot', node)
+ if value is not None and 'prot' not in already_processed:
+ already_processed.add('prot')
+ self.prot = value
+ self.validate_DoxProtectionKind(self.prot) # validate type DoxProtectionKind
+ value = find_attr_value_('virt', node)
+ if value is not None and 'virt' not in already_processed:
+ already_processed.add('virt')
+ self.virt = value
+ self.validate_DoxVirtualKind(self.virt) # validate type DoxVirtualKind
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class compoundRefType
+
+
+class reimplementType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, refid=None, valueOf_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.refid = _cast(None, refid)
+ self.refid_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, reimplementType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if reimplementType.subclass:
+ return reimplementType.subclass(*args_, **kwargs_)
+ else:
+ return reimplementType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_refid(self):
+ return self.refid
+ def set_refid(self, refid):
+ self.refid = refid
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_)
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='reimplementType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('reimplementType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'reimplementType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='reimplementType')
+ if self.hasContent_():
+ outfile.write('>')
+ outfile.write(self.convert_unicode(self.valueOf_))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='reimplementType', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='reimplementType'):
+ if self.refid is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='reimplementType', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('refid', node)
+ if value is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ self.refid = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class reimplementType
+
+
+class incType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, refid=None, local=None, valueOf_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.refid = _cast(None, refid)
+ self.refid_nsprefix_ = None
+ self.local = _cast(None, local)
+ self.local_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, incType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if incType.subclass:
+ return incType.subclass(*args_, **kwargs_)
+ else:
+ return incType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_refid(self):
+ return self.refid
+ def set_refid(self, refid):
+ self.refid = refid
+ def get_local(self):
+ return self.local
+ def set_local(self, local):
+ self.local = local
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def validate_DoxBool(self, value):
+ # Validate type DoxBool, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['yes', 'no']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxBool' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_)
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='incType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('incType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'incType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='incType')
+ if self.hasContent_():
+ outfile.write('>')
+ outfile.write(self.convert_unicode(self.valueOf_))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='incType', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='incType'):
+ if self.refid is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
+ if self.local is not None and 'local' not in already_processed:
+ already_processed.add('local')
+ outfile.write(' local=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.local), input_name='local')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='incType', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('refid', node)
+ if value is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ self.refid = value
+ value = find_attr_value_('local', node)
+ if value is not None and 'local' not in already_processed:
+ already_processed.add('local')
+ self.local = value
+ self.validate_DoxBool(self.local) # validate type DoxBool
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class incType
+
+
+class refType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, refid=None, prot=None, inline=None, valueOf_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.refid = _cast(None, refid)
+ self.refid_nsprefix_ = None
+ self.prot = _cast(None, prot)
+ self.prot_nsprefix_ = None
+ self.inline = _cast(None, inline)
+ self.inline_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, refType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if refType.subclass:
+ return refType.subclass(*args_, **kwargs_)
+ else:
+ return refType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_refid(self):
+ return self.refid
+ def set_refid(self, refid):
+ self.refid = refid
+ def get_prot(self):
+ return self.prot
+ def set_prot(self, prot):
+ self.prot = prot
+ def get_inline(self):
+ return self.inline
+ def set_inline(self, inline):
+ self.inline = inline
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def validate_DoxProtectionKind(self, value):
+ # Validate type DoxProtectionKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['public', 'protected', 'private', 'package']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxProtectionKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def validate_DoxBool(self, value):
+ # Validate type DoxBool, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['yes', 'no']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxBool' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_)
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='refType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('refType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'refType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='refType')
+ if self.hasContent_():
+ outfile.write('>')
+ outfile.write(self.convert_unicode(self.valueOf_))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='refType', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='refType'):
+ if self.refid is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
+ if self.prot is not None and 'prot' not in already_processed:
+ already_processed.add('prot')
+ outfile.write(' prot=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.prot), input_name='prot')), ))
+ if self.inline is not None and 'inline' not in already_processed:
+ already_processed.add('inline')
+ outfile.write(' inline=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.inline), input_name='inline')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='refType', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('refid', node)
+ if value is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ self.refid = value
+ value = find_attr_value_('prot', node)
+ if value is not None and 'prot' not in already_processed:
+ already_processed.add('prot')
+ self.prot = value
+ self.validate_DoxProtectionKind(self.prot) # validate type DoxProtectionKind
+ value = find_attr_value_('inline', node)
+ if value is not None and 'inline' not in already_processed:
+ already_processed.add('inline')
+ self.inline = value
+ self.validate_DoxBool(self.inline) # validate type DoxBool
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class refType
+
+
+class refTextType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, refid=None, kindref=None, external=None, tooltip=None, valueOf_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.refid = _cast(None, refid)
+ self.refid_nsprefix_ = None
+ self.kindref = _cast(None, kindref)
+ self.kindref_nsprefix_ = None
+ self.external = _cast(None, external)
+ self.external_nsprefix_ = None
+ self.tooltip = _cast(None, tooltip)
+ self.tooltip_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, refTextType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if refTextType.subclass:
+ return refTextType.subclass(*args_, **kwargs_)
+ else:
+ return refTextType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_refid(self):
+ return self.refid
+ def set_refid(self, refid):
+ self.refid = refid
+ def get_kindref(self):
+ return self.kindref
+ def set_kindref(self, kindref):
+ self.kindref = kindref
+ def get_external(self):
+ return self.external
+ def set_external(self, external):
+ self.external = external
+ def get_tooltip(self):
+ return self.tooltip
+ def set_tooltip(self, tooltip):
+ self.tooltip = tooltip
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def validate_DoxRefKind(self, value):
+ # Validate type DoxRefKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['compound', 'member']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxRefKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_)
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='refTextType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('refTextType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'refTextType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='refTextType')
+ if self.hasContent_():
+ outfile.write('>')
+ outfile.write(self.convert_unicode(self.valueOf_))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='refTextType', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='refTextType'):
+ if self.refid is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
+ if self.kindref is not None and 'kindref' not in already_processed:
+ already_processed.add('kindref')
+ outfile.write(' kindref=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.kindref), input_name='kindref')), ))
+ if self.external is not None and 'external' not in already_processed:
+ already_processed.add('external')
+ outfile.write(' external=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.external), input_name='external')), ))
+ if self.tooltip is not None and 'tooltip' not in already_processed:
+ already_processed.add('tooltip')
+ outfile.write(' tooltip=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.tooltip), input_name='tooltip')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='refTextType', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('refid', node)
+ if value is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ self.refid = value
+ value = find_attr_value_('kindref', node)
+ if value is not None and 'kindref' not in already_processed:
+ already_processed.add('kindref')
+ self.kindref = value
+ self.validate_DoxRefKind(self.kindref) # validate type DoxRefKind
+ value = find_attr_value_('external', node)
+ if value is not None and 'external' not in already_processed:
+ already_processed.add('external')
+ self.external = value
+ value = find_attr_value_('tooltip', node)
+ if value is not None and 'tooltip' not in already_processed:
+ already_processed.add('tooltip')
+ self.tooltip = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class refTextType
+
+
+class sectiondefType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, kind=None, header=None, description=None, memberdef=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.kind = _cast(None, kind)
+ self.kind_nsprefix_ = None
+ self.header = header
+ self.header_nsprefix_ = None
+ self.description = description
+ self.description_nsprefix_ = None
+ if memberdef is None:
+ self.memberdef = []
+ else:
+ self.memberdef = memberdef
+ self.memberdef_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, sectiondefType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if sectiondefType.subclass:
+ return sectiondefType.subclass(*args_, **kwargs_)
+ else:
+ return sectiondefType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_header(self):
+ return self.header
+ def set_header(self, header):
+ self.header = header
+ def get_description(self):
+ return self.description
+ def set_description(self, description):
+ self.description = description
+ def get_memberdef(self):
+ return self.memberdef
+ def set_memberdef(self, memberdef):
+ self.memberdef = memberdef
+ def add_memberdef(self, value):
+ self.memberdef.append(value)
+ def insert_memberdef_at(self, index, value):
+ self.memberdef.insert(index, value)
+ def replace_memberdef_at(self, index, value):
+ self.memberdef[index] = value
+ def get_kind(self):
+ return self.kind
+ def set_kind(self, kind):
+ self.kind = kind
+ def validate_DoxSectionKind(self, value):
+ # Validate type DoxSectionKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['user-defined', 'public-type', 'public-func', 'public-attrib', 'public-slot', 'signal', 'dcop-func', 'property', 'event', 'public-static-func', 'public-static-attrib', 'protected-type', 'protected-func', 'protected-attrib', 'protected-slot', 'protected-static-func', 'protected-static-attrib', 'package-type', 'package-func', 'package-attrib', 'package-static-func', 'package-static-attrib', 'private-type', 'private-func', 'private-attrib', 'private-slot', 'private-static-func', 'private-static-attrib', 'friend', 'related', 'define', 'prototype', 'typedef', 'enum', 'func', 'var']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxSectionKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ self.header is not None or
+ self.description is not None or
+ self.memberdef
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='sectiondefType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('sectiondefType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'sectiondefType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='sectiondefType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='sectiondefType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='sectiondefType'):
+ if self.kind is not None and 'kind' not in already_processed:
+ already_processed.add('kind')
+ outfile.write(' kind=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.kind), input_name='kind')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='sectiondefType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.header is not None:
+ namespaceprefix_ = self.header_nsprefix_ + ':' if (UseCapturedNS_ and self.header_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sheader>%s</%sheader>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.header), input_name='header')), namespaceprefix_ , eol_))
+ if self.description is not None:
+ namespaceprefix_ = self.description_nsprefix_ + ':' if (UseCapturedNS_ and self.description_nsprefix_) else ''
+ self.description.export(outfile, level, namespaceprefix_, namespacedef_='', name_='description', pretty_print=pretty_print)
+ for memberdef_ in self.memberdef:
+ namespaceprefix_ = self.memberdef_nsprefix_ + ':' if (UseCapturedNS_ and self.memberdef_nsprefix_) else ''
+ memberdef_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='memberdef', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('kind', node)
+ if value is not None and 'kind' not in already_processed:
+ already_processed.add('kind')
+ self.kind = value
+ self.validate_DoxSectionKind(self.kind) # validate type DoxSectionKind
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'header':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'header')
+ value_ = self.gds_validate_string(value_, node, 'header')
+ self.header = value_
+ self.header_nsprefix_ = child_.prefix
+ elif nodeName_ == 'description':
+ obj_ = descriptionType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.description = obj_
+ obj_.original_tagname_ = 'description'
+ elif nodeName_ == 'memberdef':
+ obj_ = memberdefType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.memberdef.append(obj_)
+ obj_.original_tagname_ = 'memberdef'
+# end class sectiondefType
+
+
+class memberdefType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, kind=None, id=None, prot=None, static=None, strong=None, const=None, explicit=None, inline=None, refqual=None, virt=None, volatile=None, mutable=None, noexcept=None, constexpr=None, readable=None, writable=None, initonly=None, settable=None, privatesettable=None, protectedsettable=None, gettable=None, privategettable=None, protectedgettable=None, final=None, sealed=None, new=None, add=None, remove=None, raise_=None, optional=None, required=None, accessor=None, attribute=None, property=None, readonly=None, bound=None, removable=None, constrained=None, transient=None, maybevoid=None, maybedefault=None, maybeambiguous=None, templateparamlist=None, type_=None, definition=None, argsstring=None, name=None, read=None, write=None, bitfield=None, reimplements=None, reimplementedby=None, param=None, enumvalue=None, initializer=None, exceptions=None, briefdescription=None, detaileddescription=None, inbodydescription=None, location=None, references=None, referencedby=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.kind = _cast(None, kind)
+ self.kind_nsprefix_ = None
+ self.id = _cast(None, id)
+ self.id_nsprefix_ = None
+ self.prot = _cast(None, prot)
+ self.prot_nsprefix_ = None
+ self.static = _cast(None, static)
+ self.static_nsprefix_ = None
+ self.strong = _cast(None, strong)
+ self.strong_nsprefix_ = None
+ self.const = _cast(None, const)
+ self.const_nsprefix_ = None
+ self.explicit = _cast(None, explicit)
+ self.explicit_nsprefix_ = None
+ self.inline = _cast(None, inline)
+ self.inline_nsprefix_ = None
+ self.refqual = _cast(None, refqual)
+ self.refqual_nsprefix_ = None
+ self.virt = _cast(None, virt)
+ self.virt_nsprefix_ = None
+ self.volatile = _cast(None, volatile)
+ self.volatile_nsprefix_ = None
+ self.mutable = _cast(None, mutable)
+ self.mutable_nsprefix_ = None
+ self.noexcept = _cast(None, noexcept)
+ self.noexcept_nsprefix_ = None
+ self.constexpr = _cast(None, constexpr)
+ self.constexpr_nsprefix_ = None
+ self.readable = _cast(None, readable)
+ self.readable_nsprefix_ = None
+ self.writable = _cast(None, writable)
+ self.writable_nsprefix_ = None
+ self.initonly = _cast(None, initonly)
+ self.initonly_nsprefix_ = None
+ self.settable = _cast(None, settable)
+ self.settable_nsprefix_ = None
+ self.privatesettable = _cast(None, privatesettable)
+ self.privatesettable_nsprefix_ = None
+ self.protectedsettable = _cast(None, protectedsettable)
+ self.protectedsettable_nsprefix_ = None
+ self.gettable = _cast(None, gettable)
+ self.gettable_nsprefix_ = None
+ self.privategettable = _cast(None, privategettable)
+ self.privategettable_nsprefix_ = None
+ self.protectedgettable = _cast(None, protectedgettable)
+ self.protectedgettable_nsprefix_ = None
+ self.final = _cast(None, final)
+ self.final_nsprefix_ = None
+ self.sealed = _cast(None, sealed)
+ self.sealed_nsprefix_ = None
+ self.new = _cast(None, new)
+ self.new_nsprefix_ = None
+ self.add = _cast(None, add)
+ self.add_nsprefix_ = None
+ self.remove = _cast(None, remove)
+ self.remove_nsprefix_ = None
+ self.raise_ = _cast(None, raise_)
+ self.raise__nsprefix_ = None
+ self.optional = _cast(None, optional)
+ self.optional_nsprefix_ = None
+ self.required = _cast(None, required)
+ self.required_nsprefix_ = None
+ self.accessor = _cast(None, accessor)
+ self.accessor_nsprefix_ = None
+ self.attribute = _cast(None, attribute)
+ self.attribute_nsprefix_ = None
+ self.property = _cast(None, property)
+ self.property_nsprefix_ = None
+ self.readonly = _cast(None, readonly)
+ self.readonly_nsprefix_ = None
+ self.bound = _cast(None, bound)
+ self.bound_nsprefix_ = None
+ self.removable = _cast(None, removable)
+ self.removable_nsprefix_ = None
+ self.constrained = _cast(None, constrained)
+ self.constrained_nsprefix_ = None
+ self.transient = _cast(None, transient)
+ self.transient_nsprefix_ = None
+ self.maybevoid = _cast(None, maybevoid)
+ self.maybevoid_nsprefix_ = None
+ self.maybedefault = _cast(None, maybedefault)
+ self.maybedefault_nsprefix_ = None
+ self.maybeambiguous = _cast(None, maybeambiguous)
+ self.maybeambiguous_nsprefix_ = None
+ self.templateparamlist = templateparamlist
+ self.templateparamlist_nsprefix_ = None
+ self.type_ = type_
+ self.type__nsprefix_ = None
+ self.definition = definition
+ self.definition_nsprefix_ = None
+ self.argsstring = argsstring
+ self.argsstring_nsprefix_ = None
+ self.name = name
+ self.name_nsprefix_ = None
+ self.read = read
+ self.read_nsprefix_ = None
+ self.write = write
+ self.write_nsprefix_ = None
+ self.bitfield = bitfield
+ self.bitfield_nsprefix_ = None
+ if reimplements is None:
+ self.reimplements = []
+ else:
+ self.reimplements = reimplements
+ self.reimplements_nsprefix_ = None
+ if reimplementedby is None:
+ self.reimplementedby = []
+ else:
+ self.reimplementedby = reimplementedby
+ self.reimplementedby_nsprefix_ = None
+ if param is None:
+ self.param = []
+ else:
+ self.param = param
+ self.param_nsprefix_ = None
+ if enumvalue is None:
+ self.enumvalue = []
+ else:
+ self.enumvalue = enumvalue
+ self.enumvalue_nsprefix_ = None
+ self.initializer = initializer
+ self.initializer_nsprefix_ = None
+ self.exceptions = exceptions
+ self.exceptions_nsprefix_ = None
+ self.briefdescription = briefdescription
+ self.briefdescription_nsprefix_ = None
+ self.detaileddescription = detaileddescription
+ self.detaileddescription_nsprefix_ = None
+ self.inbodydescription = inbodydescription
+ self.inbodydescription_nsprefix_ = None
+ self.location = location
+ self.location_nsprefix_ = None
+ if references is None:
+ self.references = []
+ else:
+ self.references = references
+ self.references_nsprefix_ = None
+ if referencedby is None:
+ self.referencedby = []
+ else:
+ self.referencedby = referencedby
+ self.referencedby_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, memberdefType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if memberdefType.subclass:
+ return memberdefType.subclass(*args_, **kwargs_)
+ else:
+ return memberdefType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_templateparamlist(self):
+ return self.templateparamlist
+ def set_templateparamlist(self, templateparamlist):
+ self.templateparamlist = templateparamlist
+ def get_type(self):
+ return self.type_
+ def set_type(self, type_):
+ self.type_ = type_
+ def get_definition(self):
+ return self.definition
+ def set_definition(self, definition):
+ self.definition = definition
+ def get_argsstring(self):
+ return self.argsstring
+ def set_argsstring(self, argsstring):
+ self.argsstring = argsstring
+ def get_name(self):
+ return self.name
+ def set_name(self, name):
+ self.name = name
+ def get_read(self):
+ return self.read
+ def set_read(self, read):
+ self.read = read
+ def get_write(self):
+ return self.write
+ def set_write(self, write):
+ self.write = write
+ def get_bitfield(self):
+ return self.bitfield
+ def set_bitfield(self, bitfield):
+ self.bitfield = bitfield
+ def get_reimplements(self):
+ return self.reimplements
+ def set_reimplements(self, reimplements):
+ self.reimplements = reimplements
+ def add_reimplements(self, value):
+ self.reimplements.append(value)
+ def insert_reimplements_at(self, index, value):
+ self.reimplements.insert(index, value)
+ def replace_reimplements_at(self, index, value):
+ self.reimplements[index] = value
+ def get_reimplementedby(self):
+ return self.reimplementedby
+ def set_reimplementedby(self, reimplementedby):
+ self.reimplementedby = reimplementedby
+ def add_reimplementedby(self, value):
+ self.reimplementedby.append(value)
+ def insert_reimplementedby_at(self, index, value):
+ self.reimplementedby.insert(index, value)
+ def replace_reimplementedby_at(self, index, value):
+ self.reimplementedby[index] = value
+ def get_param(self):
+ return self.param
+ def set_param(self, param):
+ self.param = param
+ def add_param(self, value):
+ self.param.append(value)
+ def insert_param_at(self, index, value):
+ self.param.insert(index, value)
+ def replace_param_at(self, index, value):
+ self.param[index] = value
+ def get_enumvalue(self):
+ return self.enumvalue
+ def set_enumvalue(self, enumvalue):
+ self.enumvalue = enumvalue
+ def add_enumvalue(self, value):
+ self.enumvalue.append(value)
+ def insert_enumvalue_at(self, index, value):
+ self.enumvalue.insert(index, value)
+ def replace_enumvalue_at(self, index, value):
+ self.enumvalue[index] = value
+ def get_initializer(self):
+ return self.initializer
+ def set_initializer(self, initializer):
+ self.initializer = initializer
+ def get_exceptions(self):
+ return self.exceptions
+ def set_exceptions(self, exceptions):
+ self.exceptions = exceptions
+ def get_briefdescription(self):
+ return self.briefdescription
+ def set_briefdescription(self, briefdescription):
+ self.briefdescription = briefdescription
+ def get_detaileddescription(self):
+ return self.detaileddescription
+ def set_detaileddescription(self, detaileddescription):
+ self.detaileddescription = detaileddescription
+ def get_inbodydescription(self):
+ return self.inbodydescription
+ def set_inbodydescription(self, inbodydescription):
+ self.inbodydescription = inbodydescription
+ def get_location(self):
+ return self.location
+ def set_location(self, location):
+ self.location = location
+ def get_references(self):
+ return self.references
+ def set_references(self, references):
+ self.references = references
+ def add_references(self, value):
+ self.references.append(value)
+ def insert_references_at(self, index, value):
+ self.references.insert(index, value)
+ def replace_references_at(self, index, value):
+ self.references[index] = value
+ def get_referencedby(self):
+ return self.referencedby
+ def set_referencedby(self, referencedby):
+ self.referencedby = referencedby
+ def add_referencedby(self, value):
+ self.referencedby.append(value)
+ def insert_referencedby_at(self, index, value):
+ self.referencedby.insert(index, value)
+ def replace_referencedby_at(self, index, value):
+ self.referencedby[index] = value
+ def get_kind(self):
+ return self.kind
+ def set_kind(self, kind):
+ self.kind = kind
+ def get_id(self):
+ return self.id
+ def set_id(self, id):
+ self.id = id
+ def get_prot(self):
+ return self.prot
+ def set_prot(self, prot):
+ self.prot = prot
+ def get_static(self):
+ return self.static
+ def set_static(self, static):
+ self.static = static
+ def get_strong(self):
+ return self.strong
+ def set_strong(self, strong):
+ self.strong = strong
+ def get_const(self):
+ return self.const
+ def set_const(self, const):
+ self.const = const
+ def get_explicit(self):
+ return self.explicit
+ def set_explicit(self, explicit):
+ self.explicit = explicit
+ def get_inline(self):
+ return self.inline
+ def set_inline(self, inline):
+ self.inline = inline
+ def get_refqual(self):
+ return self.refqual
+ def set_refqual(self, refqual):
+ self.refqual = refqual
+ def get_virt(self):
+ return self.virt
+ def set_virt(self, virt):
+ self.virt = virt
+ def get_volatile(self):
+ return self.volatile
+ def set_volatile(self, volatile):
+ self.volatile = volatile
+ def get_mutable(self):
+ return self.mutable
+ def set_mutable(self, mutable):
+ self.mutable = mutable
+ def get_noexcept(self):
+ return self.noexcept
+ def set_noexcept(self, noexcept):
+ self.noexcept = noexcept
+ def get_constexpr(self):
+ return self.constexpr
+ def set_constexpr(self, constexpr):
+ self.constexpr = constexpr
+ def get_readable(self):
+ return self.readable
+ def set_readable(self, readable):
+ self.readable = readable
+ def get_writable(self):
+ return self.writable
+ def set_writable(self, writable):
+ self.writable = writable
+ def get_initonly(self):
+ return self.initonly
+ def set_initonly(self, initonly):
+ self.initonly = initonly
+ def get_settable(self):
+ return self.settable
+ def set_settable(self, settable):
+ self.settable = settable
+ def get_privatesettable(self):
+ return self.privatesettable
+ def set_privatesettable(self, privatesettable):
+ self.privatesettable = privatesettable
+ def get_protectedsettable(self):
+ return self.protectedsettable
+ def set_protectedsettable(self, protectedsettable):
+ self.protectedsettable = protectedsettable
+ def get_gettable(self):
+ return self.gettable
+ def set_gettable(self, gettable):
+ self.gettable = gettable
+ def get_privategettable(self):
+ return self.privategettable
+ def set_privategettable(self, privategettable):
+ self.privategettable = privategettable
+ def get_protectedgettable(self):
+ return self.protectedgettable
+ def set_protectedgettable(self, protectedgettable):
+ self.protectedgettable = protectedgettable
+ def get_final(self):
+ return self.final
+ def set_final(self, final):
+ self.final = final
+ def get_sealed(self):
+ return self.sealed
+ def set_sealed(self, sealed):
+ self.sealed = sealed
+ def get_new(self):
+ return self.new
+ def set_new(self, new):
+ self.new = new
+ def get_add(self):
+ return self.add
+ def set_add(self, add):
+ self.add = add
+ def get_remove(self):
+ return self.remove
+ def set_remove(self, remove):
+ self.remove = remove
+ def get_raise(self):
+ return self.raise_
+ def set_raise(self, raise_):
+ self.raise_ = raise_
+ def get_optional(self):
+ return self.optional
+ def set_optional(self, optional):
+ self.optional = optional
+ def get_required(self):
+ return self.required
+ def set_required(self, required):
+ self.required = required
+ def get_accessor(self):
+ return self.accessor
+ def set_accessor(self, accessor):
+ self.accessor = accessor
+ def get_attribute(self):
+ return self.attribute
+ def set_attribute(self, attribute):
+ self.attribute = attribute
+ def get_property(self):
+ return self.property
+ def set_property(self, property):
+ self.property = property
+ def get_readonly(self):
+ return self.readonly
+ def set_readonly(self, readonly):
+ self.readonly = readonly
+ def get_bound(self):
+ return self.bound
+ def set_bound(self, bound):
+ self.bound = bound
+ def get_removable(self):
+ return self.removable
+ def set_removable(self, removable):
+ self.removable = removable
+ def get_constrained(self):
+ return self.constrained
+ def set_constrained(self, constrained):
+ self.constrained = constrained
+ def get_transient(self):
+ return self.transient
+ def set_transient(self, transient):
+ self.transient = transient
+ def get_maybevoid(self):
+ return self.maybevoid
+ def set_maybevoid(self, maybevoid):
+ self.maybevoid = maybevoid
+ def get_maybedefault(self):
+ return self.maybedefault
+ def set_maybedefault(self, maybedefault):
+ self.maybedefault = maybedefault
+ def get_maybeambiguous(self):
+ return self.maybeambiguous
+ def set_maybeambiguous(self, maybeambiguous):
+ self.maybeambiguous = maybeambiguous
+ def validate_DoxMemberKind(self, value):
+ # Validate type DoxMemberKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['define', 'property', 'event', 'variable', 'typedef', 'enum', 'function', 'signal', 'prototype', 'friend', 'dcop', 'slot', 'interface', 'service']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxMemberKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def validate_DoxProtectionKind(self, value):
+ # Validate type DoxProtectionKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['public', 'protected', 'private', 'package']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxProtectionKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def validate_DoxBool(self, value):
+ # Validate type DoxBool, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['yes', 'no']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxBool' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def validate_DoxRefQualifierKind(self, value):
+ # Validate type DoxRefQualifierKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['lvalue', 'rvalue']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxRefQualifierKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def validate_DoxVirtualKind(self, value):
+ # Validate type DoxVirtualKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['non-virtual', 'virtual', 'pure-virtual']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxVirtualKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def validate_DoxAccessor(self, value):
+ # Validate type DoxAccessor, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['retain', 'copy', 'assign', 'weak', 'strong', 'unretained']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxAccessor' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ self.templateparamlist is not None or
+ self.type_ is not None or
+ self.definition is not None or
+ self.argsstring is not None or
+ self.name is not None or
+ self.read is not None or
+ self.write is not None or
+ self.bitfield is not None or
+ self.reimplements or
+ self.reimplementedby or
+ self.param or
+ self.enumvalue or
+ self.initializer is not None or
+ self.exceptions is not None or
+ self.briefdescription is not None or
+ self.detaileddescription is not None or
+ self.inbodydescription is not None or
+ self.location is not None or
+ self.references or
+ self.referencedby
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='memberdefType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('memberdefType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'memberdefType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='memberdefType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='memberdefType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='memberdefType'):
+ if self.kind is not None and 'kind' not in already_processed:
+ already_processed.add('kind')
+ outfile.write(' kind=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.kind), input_name='kind')), ))
+ if self.id is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
+ if self.prot is not None and 'prot' not in already_processed:
+ already_processed.add('prot')
+ outfile.write(' prot=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.prot), input_name='prot')), ))
+ if self.static is not None and 'static' not in already_processed:
+ already_processed.add('static')
+ outfile.write(' static=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.static), input_name='static')), ))
+ if self.strong is not None and 'strong' not in already_processed:
+ already_processed.add('strong')
+ outfile.write(' strong=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.strong), input_name='strong')), ))
+ if self.const is not None and 'const' not in already_processed:
+ already_processed.add('const')
+ outfile.write(' const=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.const), input_name='const')), ))
+ if self.explicit is not None and 'explicit' not in already_processed:
+ already_processed.add('explicit')
+ outfile.write(' explicit=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.explicit), input_name='explicit')), ))
+ if self.inline is not None and 'inline' not in already_processed:
+ already_processed.add('inline')
+ outfile.write(' inline=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.inline), input_name='inline')), ))
+ if self.refqual is not None and 'refqual' not in already_processed:
+ already_processed.add('refqual')
+ outfile.write(' refqual=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refqual), input_name='refqual')), ))
+ if self.virt is not None and 'virt' not in already_processed:
+ already_processed.add('virt')
+ outfile.write(' virt=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.virt), input_name='virt')), ))
+ if self.volatile is not None and 'volatile' not in already_processed:
+ already_processed.add('volatile')
+ outfile.write(' volatile=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.volatile), input_name='volatile')), ))
+ if self.mutable is not None and 'mutable' not in already_processed:
+ already_processed.add('mutable')
+ outfile.write(' mutable=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.mutable), input_name='mutable')), ))
+ if self.noexcept is not None and 'noexcept' not in already_processed:
+ already_processed.add('noexcept')
+ outfile.write(' noexcept=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.noexcept), input_name='noexcept')), ))
+ if self.constexpr is not None and 'constexpr' not in already_processed:
+ already_processed.add('constexpr')
+ outfile.write(' constexpr=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.constexpr), input_name='constexpr')), ))
+ if self.readable is not None and 'readable' not in already_processed:
+ already_processed.add('readable')
+ outfile.write(' readable=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.readable), input_name='readable')), ))
+ if self.writable is not None and 'writable' not in already_processed:
+ already_processed.add('writable')
+ outfile.write(' writable=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.writable), input_name='writable')), ))
+ if self.initonly is not None and 'initonly' not in already_processed:
+ already_processed.add('initonly')
+ outfile.write(' initonly=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.initonly), input_name='initonly')), ))
+ if self.settable is not None and 'settable' not in already_processed:
+ already_processed.add('settable')
+ outfile.write(' settable=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.settable), input_name='settable')), ))
+ if self.privatesettable is not None and 'privatesettable' not in already_processed:
+ already_processed.add('privatesettable')
+ outfile.write(' privatesettable=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.privatesettable), input_name='privatesettable')), ))
+ if self.protectedsettable is not None and 'protectedsettable' not in already_processed:
+ already_processed.add('protectedsettable')
+ outfile.write(' protectedsettable=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.protectedsettable), input_name='protectedsettable')), ))
+ if self.gettable is not None and 'gettable' not in already_processed:
+ already_processed.add('gettable')
+ outfile.write(' gettable=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.gettable), input_name='gettable')), ))
+ if self.privategettable is not None and 'privategettable' not in already_processed:
+ already_processed.add('privategettable')
+ outfile.write(' privategettable=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.privategettable), input_name='privategettable')), ))
+ if self.protectedgettable is not None and 'protectedgettable' not in already_processed:
+ already_processed.add('protectedgettable')
+ outfile.write(' protectedgettable=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.protectedgettable), input_name='protectedgettable')), ))
+ if self.final is not None and 'final' not in already_processed:
+ already_processed.add('final')
+ outfile.write(' final=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.final), input_name='final')), ))
+ if self.sealed is not None and 'sealed' not in already_processed:
+ already_processed.add('sealed')
+ outfile.write(' sealed=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.sealed), input_name='sealed')), ))
+ if self.new is not None and 'new' not in already_processed:
+ already_processed.add('new')
+ outfile.write(' new=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.new), input_name='new')), ))
+ if self.add is not None and 'add' not in already_processed:
+ already_processed.add('add')
+ outfile.write(' add=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.add), input_name='add')), ))
+ if self.remove is not None and 'remove' not in already_processed:
+ already_processed.add('remove')
+ outfile.write(' remove=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.remove), input_name='remove')), ))
+ if self.raise_ is not None and 'raise_' not in already_processed:
+ already_processed.add('raise_')
+ outfile.write(' raise=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.raise_), input_name='raise')), ))
+ if self.optional is not None and 'optional' not in already_processed:
+ already_processed.add('optional')
+ outfile.write(' optional=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.optional), input_name='optional')), ))
+ if self.required is not None and 'required' not in already_processed:
+ already_processed.add('required')
+ outfile.write(' required=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.required), input_name='required')), ))
+ if self.accessor is not None and 'accessor' not in already_processed:
+ already_processed.add('accessor')
+ outfile.write(' accessor=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.accessor), input_name='accessor')), ))
+ if self.attribute is not None and 'attribute' not in already_processed:
+ already_processed.add('attribute')
+ outfile.write(' attribute=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.attribute), input_name='attribute')), ))
+ if self.property is not None and 'property' not in already_processed:
+ already_processed.add('property')
+ outfile.write(' property=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.property), input_name='property')), ))
+ if self.readonly is not None and 'readonly' not in already_processed:
+ already_processed.add('readonly')
+ outfile.write(' readonly=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.readonly), input_name='readonly')), ))
+ if self.bound is not None and 'bound' not in already_processed:
+ already_processed.add('bound')
+ outfile.write(' bound=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.bound), input_name='bound')), ))
+ if self.removable is not None and 'removable' not in already_processed:
+ already_processed.add('removable')
+ outfile.write(' removable=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.removable), input_name='removable')), ))
+ if self.constrained is not None and 'constrained' not in already_processed:
+ already_processed.add('constrained')
+ outfile.write(' constrained=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.constrained), input_name='constrained')), ))
+ if self.transient is not None and 'transient' not in already_processed:
+ already_processed.add('transient')
+ outfile.write(' transient=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.transient), input_name='transient')), ))
+ if self.maybevoid is not None and 'maybevoid' not in already_processed:
+ already_processed.add('maybevoid')
+ outfile.write(' maybevoid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.maybevoid), input_name='maybevoid')), ))
+ if self.maybedefault is not None and 'maybedefault' not in already_processed:
+ already_processed.add('maybedefault')
+ outfile.write(' maybedefault=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.maybedefault), input_name='maybedefault')), ))
+ if self.maybeambiguous is not None and 'maybeambiguous' not in already_processed:
+ already_processed.add('maybeambiguous')
+ outfile.write(' maybeambiguous=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.maybeambiguous), input_name='maybeambiguous')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='memberdefType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.templateparamlist is not None:
+ namespaceprefix_ = self.templateparamlist_nsprefix_ + ':' if (UseCapturedNS_ and self.templateparamlist_nsprefix_) else ''
+ self.templateparamlist.export(outfile, level, namespaceprefix_, namespacedef_='', name_='templateparamlist', pretty_print=pretty_print)
+ if self.type_ is not None:
+ namespaceprefix_ = self.type__nsprefix_ + ':' if (UseCapturedNS_ and self.type__nsprefix_) else ''
+ self.type_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='type', pretty_print=pretty_print)
+ if self.definition is not None:
+ namespaceprefix_ = self.definition_nsprefix_ + ':' if (UseCapturedNS_ and self.definition_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sdefinition>%s</%sdefinition>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.definition), input_name='definition')), namespaceprefix_ , eol_))
+ if self.argsstring is not None:
+ namespaceprefix_ = self.argsstring_nsprefix_ + ':' if (UseCapturedNS_ and self.argsstring_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sargsstring>%s</%sargsstring>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.argsstring), input_name='argsstring')), namespaceprefix_ , eol_))
+ if self.name is not None:
+ namespaceprefix_ = self.name_nsprefix_ + ':' if (UseCapturedNS_ and self.name_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sname>%s</%sname>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.name), input_name='name')), namespaceprefix_ , eol_))
+ if self.read is not None:
+ namespaceprefix_ = self.read_nsprefix_ + ':' if (UseCapturedNS_ and self.read_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sread>%s</%sread>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.read), input_name='read')), namespaceprefix_ , eol_))
+ if self.write is not None:
+ namespaceprefix_ = self.write_nsprefix_ + ':' if (UseCapturedNS_ and self.write_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%swrite>%s</%swrite>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.write), input_name='write')), namespaceprefix_ , eol_))
+ if self.bitfield is not None:
+ namespaceprefix_ = self.bitfield_nsprefix_ + ':' if (UseCapturedNS_ and self.bitfield_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sbitfield>%s</%sbitfield>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.bitfield), input_name='bitfield')), namespaceprefix_ , eol_))
+ for reimplements_ in self.reimplements:
+ namespaceprefix_ = self.reimplements_nsprefix_ + ':' if (UseCapturedNS_ and self.reimplements_nsprefix_) else ''
+ reimplements_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='reimplements', pretty_print=pretty_print)
+ for reimplementedby_ in self.reimplementedby:
+ namespaceprefix_ = self.reimplementedby_nsprefix_ + ':' if (UseCapturedNS_ and self.reimplementedby_nsprefix_) else ''
+ reimplementedby_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='reimplementedby', pretty_print=pretty_print)
+ for param_ in self.param:
+ namespaceprefix_ = self.param_nsprefix_ + ':' if (UseCapturedNS_ and self.param_nsprefix_) else ''
+ param_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='param', pretty_print=pretty_print)
+ for enumvalue_ in self.enumvalue:
+ namespaceprefix_ = self.enumvalue_nsprefix_ + ':' if (UseCapturedNS_ and self.enumvalue_nsprefix_) else ''
+ enumvalue_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='enumvalue', pretty_print=pretty_print)
+ if self.initializer is not None:
+ namespaceprefix_ = self.initializer_nsprefix_ + ':' if (UseCapturedNS_ and self.initializer_nsprefix_) else ''
+ self.initializer.export(outfile, level, namespaceprefix_, namespacedef_='', name_='initializer', pretty_print=pretty_print)
+ if self.exceptions is not None:
+ namespaceprefix_ = self.exceptions_nsprefix_ + ':' if (UseCapturedNS_ and self.exceptions_nsprefix_) else ''
+ self.exceptions.export(outfile, level, namespaceprefix_, namespacedef_='', name_='exceptions', pretty_print=pretty_print)
+ if self.briefdescription is not None:
+ namespaceprefix_ = self.briefdescription_nsprefix_ + ':' if (UseCapturedNS_ and self.briefdescription_nsprefix_) else ''
+ self.briefdescription.export(outfile, level, namespaceprefix_, namespacedef_='', name_='briefdescription', pretty_print=pretty_print)
+ if self.detaileddescription is not None:
+ namespaceprefix_ = self.detaileddescription_nsprefix_ + ':' if (UseCapturedNS_ and self.detaileddescription_nsprefix_) else ''
+ self.detaileddescription.export(outfile, level, namespaceprefix_, namespacedef_='', name_='detaileddescription', pretty_print=pretty_print)
+ if self.inbodydescription is not None:
+ namespaceprefix_ = self.inbodydescription_nsprefix_ + ':' if (UseCapturedNS_ and self.inbodydescription_nsprefix_) else ''
+ self.inbodydescription.export(outfile, level, namespaceprefix_, namespacedef_='', name_='inbodydescription', pretty_print=pretty_print)
+ if self.location is not None:
+ namespaceprefix_ = self.location_nsprefix_ + ':' if (UseCapturedNS_ and self.location_nsprefix_) else ''
+ self.location.export(outfile, level, namespaceprefix_, namespacedef_='', name_='location', pretty_print=pretty_print)
+ for references_ in self.references:
+ namespaceprefix_ = self.references_nsprefix_ + ':' if (UseCapturedNS_ and self.references_nsprefix_) else ''
+ references_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='references', pretty_print=pretty_print)
+ for referencedby_ in self.referencedby:
+ namespaceprefix_ = self.referencedby_nsprefix_ + ':' if (UseCapturedNS_ and self.referencedby_nsprefix_) else ''
+ referencedby_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='referencedby', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('kind', node)
+ if value is not None and 'kind' not in already_processed:
+ already_processed.add('kind')
+ self.kind = value
+ self.validate_DoxMemberKind(self.kind) # validate type DoxMemberKind
+ value = find_attr_value_('id', node)
+ if value is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ self.id = value
+ value = find_attr_value_('prot', node)
+ if value is not None and 'prot' not in already_processed:
+ already_processed.add('prot')
+ self.prot = value
+ self.validate_DoxProtectionKind(self.prot) # validate type DoxProtectionKind
+ value = find_attr_value_('static', node)
+ if value is not None and 'static' not in already_processed:
+ already_processed.add('static')
+ self.static = value
+ self.validate_DoxBool(self.static) # validate type DoxBool
+ value = find_attr_value_('strong', node)
+ if value is not None and 'strong' not in already_processed:
+ already_processed.add('strong')
+ self.strong = value
+ self.validate_DoxBool(self.strong) # validate type DoxBool
+ value = find_attr_value_('const', node)
+ if value is not None and 'const' not in already_processed:
+ already_processed.add('const')
+ self.const = value
+ self.validate_DoxBool(self.const) # validate type DoxBool
+ value = find_attr_value_('explicit', node)
+ if value is not None and 'explicit' not in already_processed:
+ already_processed.add('explicit')
+ self.explicit = value
+ self.validate_DoxBool(self.explicit) # validate type DoxBool
+ value = find_attr_value_('inline', node)
+ if value is not None and 'inline' not in already_processed:
+ already_processed.add('inline')
+ self.inline = value
+ self.validate_DoxBool(self.inline) # validate type DoxBool
+ value = find_attr_value_('refqual', node)
+ if value is not None and 'refqual' not in already_processed:
+ already_processed.add('refqual')
+ self.refqual = value
+ self.validate_DoxRefQualifierKind(self.refqual) # validate type DoxRefQualifierKind
+ value = find_attr_value_('virt', node)
+ if value is not None and 'virt' not in already_processed:
+ already_processed.add('virt')
+ self.virt = value
+ self.validate_DoxVirtualKind(self.virt) # validate type DoxVirtualKind
+ value = find_attr_value_('volatile', node)
+ if value is not None and 'volatile' not in already_processed:
+ already_processed.add('volatile')
+ self.volatile = value
+ self.validate_DoxBool(self.volatile) # validate type DoxBool
+ value = find_attr_value_('mutable', node)
+ if value is not None and 'mutable' not in already_processed:
+ already_processed.add('mutable')
+ self.mutable = value
+ self.validate_DoxBool(self.mutable) # validate type DoxBool
+ value = find_attr_value_('noexcept', node)
+ if value is not None and 'noexcept' not in already_processed:
+ already_processed.add('noexcept')
+ self.noexcept = value
+ self.validate_DoxBool(self.noexcept) # validate type DoxBool
+ value = find_attr_value_('constexpr', node)
+ if value is not None and 'constexpr' not in already_processed:
+ already_processed.add('constexpr')
+ self.constexpr = value
+ self.validate_DoxBool(self.constexpr) # validate type DoxBool
+ value = find_attr_value_('readable', node)
+ if value is not None and 'readable' not in already_processed:
+ already_processed.add('readable')
+ self.readable = value
+ self.validate_DoxBool(self.readable) # validate type DoxBool
+ value = find_attr_value_('writable', node)
+ if value is not None and 'writable' not in already_processed:
+ already_processed.add('writable')
+ self.writable = value
+ self.validate_DoxBool(self.writable) # validate type DoxBool
+ value = find_attr_value_('initonly', node)
+ if value is not None and 'initonly' not in already_processed:
+ already_processed.add('initonly')
+ self.initonly = value
+ self.validate_DoxBool(self.initonly) # validate type DoxBool
+ value = find_attr_value_('settable', node)
+ if value is not None and 'settable' not in already_processed:
+ already_processed.add('settable')
+ self.settable = value
+ self.validate_DoxBool(self.settable) # validate type DoxBool
+ value = find_attr_value_('privatesettable', node)
+ if value is not None and 'privatesettable' not in already_processed:
+ already_processed.add('privatesettable')
+ self.privatesettable = value
+ self.validate_DoxBool(self.privatesettable) # validate type DoxBool
+ value = find_attr_value_('protectedsettable', node)
+ if value is not None and 'protectedsettable' not in already_processed:
+ already_processed.add('protectedsettable')
+ self.protectedsettable = value
+ self.validate_DoxBool(self.protectedsettable) # validate type DoxBool
+ value = find_attr_value_('gettable', node)
+ if value is not None and 'gettable' not in already_processed:
+ already_processed.add('gettable')
+ self.gettable = value
+ self.validate_DoxBool(self.gettable) # validate type DoxBool
+ value = find_attr_value_('privategettable', node)
+ if value is not None and 'privategettable' not in already_processed:
+ already_processed.add('privategettable')
+ self.privategettable = value
+ self.validate_DoxBool(self.privategettable) # validate type DoxBool
+ value = find_attr_value_('protectedgettable', node)
+ if value is not None and 'protectedgettable' not in already_processed:
+ already_processed.add('protectedgettable')
+ self.protectedgettable = value
+ self.validate_DoxBool(self.protectedgettable) # validate type DoxBool
+ value = find_attr_value_('final', node)
+ if value is not None and 'final' not in already_processed:
+ already_processed.add('final')
+ self.final = value
+ self.validate_DoxBool(self.final) # validate type DoxBool
+ value = find_attr_value_('sealed', node)
+ if value is not None and 'sealed' not in already_processed:
+ already_processed.add('sealed')
+ self.sealed = value
+ self.validate_DoxBool(self.sealed) # validate type DoxBool
+ value = find_attr_value_('new', node)
+ if value is not None and 'new' not in already_processed:
+ already_processed.add('new')
+ self.new = value
+ self.validate_DoxBool(self.new) # validate type DoxBool
+ value = find_attr_value_('add', node)
+ if value is not None and 'add' not in already_processed:
+ already_processed.add('add')
+ self.add = value
+ self.validate_DoxBool(self.add) # validate type DoxBool
+ value = find_attr_value_('remove', node)
+ if value is not None and 'remove' not in already_processed:
+ already_processed.add('remove')
+ self.remove = value
+ self.validate_DoxBool(self.remove) # validate type DoxBool
+ value = find_attr_value_('raise', node)
+ if value is not None and 'raise' not in already_processed:
+ already_processed.add('raise')
+ self.raise_ = value
+ self.validate_DoxBool(self.raise_) # validate type DoxBool
+ value = find_attr_value_('optional', node)
+ if value is not None and 'optional' not in already_processed:
+ already_processed.add('optional')
+ self.optional = value
+ self.validate_DoxBool(self.optional) # validate type DoxBool
+ value = find_attr_value_('required', node)
+ if value is not None and 'required' not in already_processed:
+ already_processed.add('required')
+ self.required = value
+ self.validate_DoxBool(self.required) # validate type DoxBool
+ value = find_attr_value_('accessor', node)
+ if value is not None and 'accessor' not in already_processed:
+ already_processed.add('accessor')
+ self.accessor = value
+ self.validate_DoxAccessor(self.accessor) # validate type DoxAccessor
+ value = find_attr_value_('attribute', node)
+ if value is not None and 'attribute' not in already_processed:
+ already_processed.add('attribute')
+ self.attribute = value
+ self.validate_DoxBool(self.attribute) # validate type DoxBool
+ value = find_attr_value_('property', node)
+ if value is not None and 'property' not in already_processed:
+ already_processed.add('property')
+ self.property = value
+ self.validate_DoxBool(self.property) # validate type DoxBool
+ value = find_attr_value_('readonly', node)
+ if value is not None and 'readonly' not in already_processed:
+ already_processed.add('readonly')
+ self.readonly = value
+ self.validate_DoxBool(self.readonly) # validate type DoxBool
+ value = find_attr_value_('bound', node)
+ if value is not None and 'bound' not in already_processed:
+ already_processed.add('bound')
+ self.bound = value
+ self.validate_DoxBool(self.bound) # validate type DoxBool
+ value = find_attr_value_('removable', node)
+ if value is not None and 'removable' not in already_processed:
+ already_processed.add('removable')
+ self.removable = value
+ self.validate_DoxBool(self.removable) # validate type DoxBool
+ value = find_attr_value_('constrained', node)
+ if value is not None and 'constrained' not in already_processed:
+ already_processed.add('constrained')
+ self.constrained = value
+ self.validate_DoxBool(self.constrained) # validate type DoxBool
+ value = find_attr_value_('transient', node)
+ if value is not None and 'transient' not in already_processed:
+ already_processed.add('transient')
+ self.transient = value
+ self.validate_DoxBool(self.transient) # validate type DoxBool
+ value = find_attr_value_('maybevoid', node)
+ if value is not None and 'maybevoid' not in already_processed:
+ already_processed.add('maybevoid')
+ self.maybevoid = value
+ self.validate_DoxBool(self.maybevoid) # validate type DoxBool
+ value = find_attr_value_('maybedefault', node)
+ if value is not None and 'maybedefault' not in already_processed:
+ already_processed.add('maybedefault')
+ self.maybedefault = value
+ self.validate_DoxBool(self.maybedefault) # validate type DoxBool
+ value = find_attr_value_('maybeambiguous', node)
+ if value is not None and 'maybeambiguous' not in already_processed:
+ already_processed.add('maybeambiguous')
+ self.maybeambiguous = value
+ self.validate_DoxBool(self.maybeambiguous) # validate type DoxBool
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'templateparamlist':
+ obj_ = templateparamlistType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.templateparamlist = obj_
+ obj_.original_tagname_ = 'templateparamlist'
+ elif nodeName_ == 'type':
+ obj_ = linkedTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.type_ = obj_
+ obj_.original_tagname_ = 'type'
+ elif nodeName_ == 'definition':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'definition')
+ value_ = self.gds_validate_string(value_, node, 'definition')
+ self.definition = value_
+ self.definition_nsprefix_ = child_.prefix
+ elif nodeName_ == 'argsstring':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'argsstring')
+ value_ = self.gds_validate_string(value_, node, 'argsstring')
+ self.argsstring = value_
+ self.argsstring_nsprefix_ = child_.prefix
+ elif nodeName_ == 'name':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'name')
+ value_ = self.gds_validate_string(value_, node, 'name')
+ self.name = value_
+ self.name_nsprefix_ = child_.prefix
+ elif nodeName_ == 'read':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'read')
+ value_ = self.gds_validate_string(value_, node, 'read')
+ self.read = value_
+ self.read_nsprefix_ = child_.prefix
+ elif nodeName_ == 'write':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'write')
+ value_ = self.gds_validate_string(value_, node, 'write')
+ self.write = value_
+ self.write_nsprefix_ = child_.prefix
+ elif nodeName_ == 'bitfield':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'bitfield')
+ value_ = self.gds_validate_string(value_, node, 'bitfield')
+ self.bitfield = value_
+ self.bitfield_nsprefix_ = child_.prefix
+ elif nodeName_ == 'reimplements':
+ obj_ = reimplementType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.reimplements.append(obj_)
+ obj_.original_tagname_ = 'reimplements'
+ elif nodeName_ == 'reimplementedby':
+ obj_ = reimplementType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.reimplementedby.append(obj_)
+ obj_.original_tagname_ = 'reimplementedby'
+ elif nodeName_ == 'param':
+ obj_ = paramType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.param.append(obj_)
+ obj_.original_tagname_ = 'param'
+ elif nodeName_ == 'enumvalue':
+ obj_ = enumvalueType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.enumvalue.append(obj_)
+ obj_.original_tagname_ = 'enumvalue'
+ elif nodeName_ == 'initializer':
+ obj_ = linkedTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.initializer = obj_
+ obj_.original_tagname_ = 'initializer'
+ elif nodeName_ == 'exceptions':
+ obj_ = linkedTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.exceptions = obj_
+ obj_.original_tagname_ = 'exceptions'
+ elif nodeName_ == 'briefdescription':
+ obj_ = descriptionType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.briefdescription = obj_
+ obj_.original_tagname_ = 'briefdescription'
+ elif nodeName_ == 'detaileddescription':
+ obj_ = descriptionType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.detaileddescription = obj_
+ obj_.original_tagname_ = 'detaileddescription'
+ elif nodeName_ == 'inbodydescription':
+ obj_ = descriptionType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.inbodydescription = obj_
+ obj_.original_tagname_ = 'inbodydescription'
+ elif nodeName_ == 'location':
+ obj_ = locationType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.location = obj_
+ obj_.original_tagname_ = 'location'
+ elif nodeName_ == 'references':
+ obj_ = referenceType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.references.append(obj_)
+ obj_.original_tagname_ = 'references'
+ elif nodeName_ == 'referencedby':
+ obj_ = referenceType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.referencedby.append(obj_)
+ obj_.original_tagname_ = 'referencedby'
+# end class memberdefType
+
+
+class definition(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, definition)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if definition.subclass:
+ return definition.subclass(*args_, **kwargs_)
+ else:
+ return definition(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def hasContent_(self):
+ if (
+
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='definition', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('definition')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'definition':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='definition')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='definition', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='definition'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='definition', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class definition
+
+
+class argsstring(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, argsstring)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if argsstring.subclass:
+ return argsstring.subclass(*args_, **kwargs_)
+ else:
+ return argsstring(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def hasContent_(self):
+ if (
+
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='argsstring', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('argsstring')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'argsstring':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='argsstring')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='argsstring', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='argsstring'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='argsstring', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class argsstring
+
+
+class read(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, read)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if read.subclass:
+ return read.subclass(*args_, **kwargs_)
+ else:
+ return read(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def hasContent_(self):
+ if (
+
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='read', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('read')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'read':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='read')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='read', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='read'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='read', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class read
+
+
+class write(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, write)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if write.subclass:
+ return write.subclass(*args_, **kwargs_)
+ else:
+ return write(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def hasContent_(self):
+ if (
+
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='write', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('write')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'write':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='write')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='write', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='write'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='write', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class write
+
+
+class bitfield(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, bitfield)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if bitfield.subclass:
+ return bitfield.subclass(*args_, **kwargs_)
+ else:
+ return bitfield(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def hasContent_(self):
+ if (
+
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='bitfield', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('bitfield')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'bitfield':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='bitfield')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='bitfield', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='bitfield'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='bitfield', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class bitfield
+
+
+class descriptionType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, title=None, para=None, internal=None, sect1=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.title = title
+ self.title_nsprefix_ = None
+ if para is None:
+ self.para = []
+ else:
+ self.para = para
+ self.para_nsprefix_ = None
+ if internal is None:
+ self.internal = []
+ else:
+ self.internal = internal
+ self.internal_nsprefix_ = None
+ if sect1 is None:
+ self.sect1 = []
+ else:
+ self.sect1 = sect1
+ self.sect1_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, descriptionType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if descriptionType.subclass:
+ return descriptionType.subclass(*args_, **kwargs_)
+ else:
+ return descriptionType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_title(self):
+ return self.title
+ def set_title(self, title):
+ self.title = title
+ def get_para(self):
+ return self.para
+ def set_para(self, para):
+ self.para = para
+ def add_para(self, value):
+ self.para.append(value)
+ def insert_para_at(self, index, value):
+ self.para.insert(index, value)
+ def replace_para_at(self, index, value):
+ self.para[index] = value
+ def get_internal(self):
+ return self.internal
+ def set_internal(self, internal):
+ self.internal = internal
+ def add_internal(self, value):
+ self.internal.append(value)
+ def insert_internal_at(self, index, value):
+ self.internal.insert(index, value)
+ def replace_internal_at(self, index, value):
+ self.internal[index] = value
+ def get_sect1(self):
+ return self.sect1
+ def set_sect1(self, sect1):
+ self.sect1 = sect1
+ def add_sect1(self, value):
+ self.sect1.append(value)
+ def insert_sect1_at(self, index, value):
+ self.sect1.insert(index, value)
+ def replace_sect1_at(self, index, value):
+ self.sect1[index] = value
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.title is not None or
+ self.para or
+ self.internal or
+ self.sect1 or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='descriptionType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('descriptionType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'descriptionType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='descriptionType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='descriptionType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='descriptionType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='descriptionType', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.title is not None:
+ namespaceprefix_ = self.title_nsprefix_ + ':' if (UseCapturedNS_ and self.title_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%stitle>%s</%stitle>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.title), input_name='title')), namespaceprefix_ , eol_))
+ for para_ in self.para:
+ namespaceprefix_ = self.para_nsprefix_ + ':' if (UseCapturedNS_ and self.para_nsprefix_) else ''
+ para_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='para', pretty_print=pretty_print)
+ for internal_ in self.internal:
+ namespaceprefix_ = self.internal_nsprefix_ + ':' if (UseCapturedNS_ and self.internal_nsprefix_) else ''
+ internal_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='internal', pretty_print=pretty_print)
+ for sect1_ in self.sect1:
+ namespaceprefix_ = self.sect1_nsprefix_ + ':' if (UseCapturedNS_ and self.sect1_nsprefix_) else ''
+ sect1_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='sect1', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'title' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'title')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'title')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'title', valuestr_)
+ self.content_.append(obj_)
+ self.title_nsprefix_ = child_.prefix
+ elif nodeName_ == 'para':
+ obj_ = docParaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'para', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_para'):
+ self.add_para(obj_.value)
+ elif hasattr(self, 'set_para'):
+ self.set_para(obj_.value)
+ elif nodeName_ == 'internal':
+ obj_ = docInternalType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'internal', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_internal'):
+ self.add_internal(obj_.value)
+ elif hasattr(self, 'set_internal'):
+ self.set_internal(obj_.value)
+ elif nodeName_ == 'sect1':
+ obj_ = docSect1Type.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'sect1', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_sect1'):
+ self.add_sect1(obj_.value)
+ elif hasattr(self, 'set_sect1'):
+ self.set_sect1(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class descriptionType
+
+
+class enumvalueType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, id=None, prot=None, name=None, initializer=None, briefdescription=None, detaileddescription=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.id = _cast(None, id)
+ self.id_nsprefix_ = None
+ self.prot = _cast(None, prot)
+ self.prot_nsprefix_ = None
+ self.name = name
+ self.name_nsprefix_ = None
+ self.initializer = initializer
+ self.initializer_nsprefix_ = None
+ self.briefdescription = briefdescription
+ self.briefdescription_nsprefix_ = None
+ self.detaileddescription = detaileddescription
+ self.detaileddescription_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, enumvalueType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if enumvalueType.subclass:
+ return enumvalueType.subclass(*args_, **kwargs_)
+ else:
+ return enumvalueType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_name(self):
+ return self.name
+ def set_name(self, name):
+ self.name = name
+ def get_initializer(self):
+ return self.initializer
+ def set_initializer(self, initializer):
+ self.initializer = initializer
+ def get_briefdescription(self):
+ return self.briefdescription
+ def set_briefdescription(self, briefdescription):
+ self.briefdescription = briefdescription
+ def get_detaileddescription(self):
+ return self.detaileddescription
+ def set_detaileddescription(self, detaileddescription):
+ self.detaileddescription = detaileddescription
+ def get_id(self):
+ return self.id
+ def set_id(self, id):
+ self.id = id
+ def get_prot(self):
+ return self.prot
+ def set_prot(self, prot):
+ self.prot = prot
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def validate_DoxProtectionKind(self, value):
+ # Validate type DoxProtectionKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['public', 'protected', 'private', 'package']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxProtectionKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ self.name is not None or
+ self.initializer is not None or
+ self.briefdescription is not None or
+ self.detaileddescription is not None or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='enumvalueType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('enumvalueType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'enumvalueType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='enumvalueType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='enumvalueType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='enumvalueType'):
+ if self.id is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
+ if self.prot is not None and 'prot' not in already_processed:
+ already_processed.add('prot')
+ outfile.write(' prot=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.prot), input_name='prot')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='enumvalueType', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.name is not None:
+ namespaceprefix_ = self.name_nsprefix_ + ':' if (UseCapturedNS_ and self.name_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sname>%s</%sname>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.name), input_name='name')), namespaceprefix_ , eol_))
+ if self.initializer is not None:
+ namespaceprefix_ = self.initializer_nsprefix_ + ':' if (UseCapturedNS_ and self.initializer_nsprefix_) else ''
+ self.initializer.export(outfile, level, namespaceprefix_, namespacedef_='', name_='initializer', pretty_print=pretty_print)
+ if self.briefdescription is not None:
+ namespaceprefix_ = self.briefdescription_nsprefix_ + ':' if (UseCapturedNS_ and self.briefdescription_nsprefix_) else ''
+ self.briefdescription.export(outfile, level, namespaceprefix_, namespacedef_='', name_='briefdescription', pretty_print=pretty_print)
+ if self.detaileddescription is not None:
+ namespaceprefix_ = self.detaileddescription_nsprefix_ + ':' if (UseCapturedNS_ and self.detaileddescription_nsprefix_) else ''
+ self.detaileddescription.export(outfile, level, namespaceprefix_, namespacedef_='', name_='detaileddescription', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('id', node)
+ if value is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ self.id = value
+ value = find_attr_value_('prot', node)
+ if value is not None and 'prot' not in already_processed:
+ already_processed.add('prot')
+ self.prot = value
+ self.validate_DoxProtectionKind(self.prot) # validate type DoxProtectionKind
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'name' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'name')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'name')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'name', valuestr_)
+ self.content_.append(obj_)
+ self.name_nsprefix_ = child_.prefix
+ elif nodeName_ == 'initializer':
+ obj_ = linkedTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'initializer', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_initializer'):
+ self.add_initializer(obj_.value)
+ elif hasattr(self, 'set_initializer'):
+ self.set_initializer(obj_.value)
+ elif nodeName_ == 'briefdescription':
+ obj_ = descriptionType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'briefdescription', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_briefdescription'):
+ self.add_briefdescription(obj_.value)
+ elif hasattr(self, 'set_briefdescription'):
+ self.set_briefdescription(obj_.value)
+ elif nodeName_ == 'detaileddescription':
+ obj_ = descriptionType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'detaileddescription', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_detaileddescription'):
+ self.add_detaileddescription(obj_.value)
+ elif hasattr(self, 'set_detaileddescription'):
+ self.set_detaileddescription(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class enumvalueType
+
+
+class templateparamlistType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, param=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if param is None:
+ self.param = []
+ else:
+ self.param = param
+ self.param_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, templateparamlistType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if templateparamlistType.subclass:
+ return templateparamlistType.subclass(*args_, **kwargs_)
+ else:
+ return templateparamlistType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_param(self):
+ return self.param
+ def set_param(self, param):
+ self.param = param
+ def add_param(self, value):
+ self.param.append(value)
+ def insert_param_at(self, index, value):
+ self.param.insert(index, value)
+ def replace_param_at(self, index, value):
+ self.param[index] = value
+ def hasContent_(self):
+ if (
+ self.param
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='templateparamlistType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('templateparamlistType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'templateparamlistType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='templateparamlistType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='templateparamlistType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='templateparamlistType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='templateparamlistType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for param_ in self.param:
+ namespaceprefix_ = self.param_nsprefix_ + ':' if (UseCapturedNS_ and self.param_nsprefix_) else ''
+ param_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='param', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'param':
+ obj_ = paramType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.param.append(obj_)
+ obj_.original_tagname_ = 'param'
+# end class templateparamlistType
+
+
+class paramType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, attributes=None, type_=None, declname=None, defname=None, array=None, defval=None, typeconstraint=None, briefdescription=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.attributes = attributes
+ self.attributes_nsprefix_ = None
+ self.type_ = type_
+ self.type__nsprefix_ = None
+ self.declname = declname
+ self.declname_nsprefix_ = None
+ self.defname = defname
+ self.defname_nsprefix_ = None
+ self.array = array
+ self.array_nsprefix_ = None
+ self.defval = defval
+ self.defval_nsprefix_ = None
+ self.typeconstraint = typeconstraint
+ self.typeconstraint_nsprefix_ = None
+ self.briefdescription = briefdescription
+ self.briefdescription_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, paramType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if paramType.subclass:
+ return paramType.subclass(*args_, **kwargs_)
+ else:
+ return paramType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_attributes(self):
+ return self.attributes
+ def set_attributes(self, attributes):
+ self.attributes = attributes
+ def get_type(self):
+ return self.type_
+ def set_type(self, type_):
+ self.type_ = type_
+ def get_declname(self):
+ return self.declname
+ def set_declname(self, declname):
+ self.declname = declname
+ def get_defname(self):
+ return self.defname
+ def set_defname(self, defname):
+ self.defname = defname
+ def get_array(self):
+ return self.array
+ def set_array(self, array):
+ self.array = array
+ def get_defval(self):
+ return self.defval
+ def set_defval(self, defval):
+ self.defval = defval
+ def get_typeconstraint(self):
+ return self.typeconstraint
+ def set_typeconstraint(self, typeconstraint):
+ self.typeconstraint = typeconstraint
+ def get_briefdescription(self):
+ return self.briefdescription
+ def set_briefdescription(self, briefdescription):
+ self.briefdescription = briefdescription
+ def hasContent_(self):
+ if (
+ self.attributes is not None or
+ self.type_ is not None or
+ self.declname is not None or
+ self.defname is not None or
+ self.array is not None or
+ self.defval is not None or
+ self.typeconstraint is not None or
+ self.briefdescription is not None
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='paramType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('paramType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'paramType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='paramType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='paramType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='paramType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='paramType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.attributes is not None:
+ namespaceprefix_ = self.attributes_nsprefix_ + ':' if (UseCapturedNS_ and self.attributes_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sattributes>%s</%sattributes>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.attributes), input_name='attributes')), namespaceprefix_ , eol_))
+ if self.type_ is not None:
+ namespaceprefix_ = self.type__nsprefix_ + ':' if (UseCapturedNS_ and self.type__nsprefix_) else ''
+ self.type_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='type', pretty_print=pretty_print)
+ if self.declname is not None:
+ namespaceprefix_ = self.declname_nsprefix_ + ':' if (UseCapturedNS_ and self.declname_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sdeclname>%s</%sdeclname>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.declname), input_name='declname')), namespaceprefix_ , eol_))
+ if self.defname is not None:
+ namespaceprefix_ = self.defname_nsprefix_ + ':' if (UseCapturedNS_ and self.defname_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sdefname>%s</%sdefname>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.defname), input_name='defname')), namespaceprefix_ , eol_))
+ if self.array is not None:
+ namespaceprefix_ = self.array_nsprefix_ + ':' if (UseCapturedNS_ and self.array_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sarray>%s</%sarray>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.array), input_name='array')), namespaceprefix_ , eol_))
+ if self.defval is not None:
+ namespaceprefix_ = self.defval_nsprefix_ + ':' if (UseCapturedNS_ and self.defval_nsprefix_) else ''
+ self.defval.export(outfile, level, namespaceprefix_, namespacedef_='', name_='defval', pretty_print=pretty_print)
+ if self.typeconstraint is not None:
+ namespaceprefix_ = self.typeconstraint_nsprefix_ + ':' if (UseCapturedNS_ and self.typeconstraint_nsprefix_) else ''
+ self.typeconstraint.export(outfile, level, namespaceprefix_, namespacedef_='', name_='typeconstraint', pretty_print=pretty_print)
+ if self.briefdescription is not None:
+ namespaceprefix_ = self.briefdescription_nsprefix_ + ':' if (UseCapturedNS_ and self.briefdescription_nsprefix_) else ''
+ self.briefdescription.export(outfile, level, namespaceprefix_, namespacedef_='', name_='briefdescription', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'attributes':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'attributes')
+ value_ = self.gds_validate_string(value_, node, 'attributes')
+ self.attributes = value_
+ self.attributes_nsprefix_ = child_.prefix
+ elif nodeName_ == 'type':
+ obj_ = linkedTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.type_ = obj_
+ obj_.original_tagname_ = 'type'
+ elif nodeName_ == 'declname':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'declname')
+ value_ = self.gds_validate_string(value_, node, 'declname')
+ self.declname = value_
+ self.declname_nsprefix_ = child_.prefix
+ elif nodeName_ == 'defname':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'defname')
+ value_ = self.gds_validate_string(value_, node, 'defname')
+ self.defname = value_
+ self.defname_nsprefix_ = child_.prefix
+ elif nodeName_ == 'array':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'array')
+ value_ = self.gds_validate_string(value_, node, 'array')
+ self.array = value_
+ self.array_nsprefix_ = child_.prefix
+ elif nodeName_ == 'defval':
+ obj_ = linkedTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.defval = obj_
+ obj_.original_tagname_ = 'defval'
+ elif nodeName_ == 'typeconstraint':
+ obj_ = linkedTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.typeconstraint = obj_
+ obj_.original_tagname_ = 'typeconstraint'
+ elif nodeName_ == 'briefdescription':
+ obj_ = descriptionType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.briefdescription = obj_
+ obj_.original_tagname_ = 'briefdescription'
+# end class paramType
+
+
+class attributes(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, attributes)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if attributes.subclass:
+ return attributes.subclass(*args_, **kwargs_)
+ else:
+ return attributes(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def hasContent_(self):
+ if (
+
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='attributes', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('attributes')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'attributes':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='attributes')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='attributes', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='attributes'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='attributes', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class attributes
+
+
+class declname(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, declname)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if declname.subclass:
+ return declname.subclass(*args_, **kwargs_)
+ else:
+ return declname(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def hasContent_(self):
+ if (
+
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='declname', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('declname')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'declname':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='declname')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='declname', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='declname'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='declname', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class declname
+
+
+class defname(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, defname)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if defname.subclass:
+ return defname.subclass(*args_, **kwargs_)
+ else:
+ return defname(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def hasContent_(self):
+ if (
+
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='defname', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('defname')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'defname':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='defname')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='defname', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='defname'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='defname', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class defname
+
+
+class array(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, array)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if array.subclass:
+ return array.subclass(*args_, **kwargs_)
+ else:
+ return array(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def hasContent_(self):
+ if (
+
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='array', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('array')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'array':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='array')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='array', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='array'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='array', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class array
+
+
+class linkedTextType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, ref=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if ref is None:
+ self.ref = []
+ else:
+ self.ref = ref
+ self.ref_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, linkedTextType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if linkedTextType.subclass:
+ return linkedTextType.subclass(*args_, **kwargs_)
+ else:
+ return linkedTextType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_ref(self):
+ return self.ref
+ def set_ref(self, ref):
+ self.ref = ref
+ def add_ref(self, value):
+ self.ref.append(value)
+ def insert_ref_at(self, index, value):
+ self.ref.insert(index, value)
+ def replace_ref_at(self, index, value):
+ self.ref[index] = value
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.ref or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='linkedTextType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('linkedTextType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'linkedTextType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='linkedTextType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='linkedTextType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='linkedTextType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='linkedTextType', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for ref_ in self.ref:
+ namespaceprefix_ = self.ref_nsprefix_ + ':' if (UseCapturedNS_ and self.ref_nsprefix_) else ''
+ ref_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ref', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'ref':
+ obj_ = refTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ref', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ref'):
+ self.add_ref(obj_.value)
+ elif hasattr(self, 'set_ref'):
+ self.set_ref(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class linkedTextType
+
+
+class graphType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, node=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if node is None:
+ self.node = []
+ else:
+ self.node = node
+ self.node_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, graphType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if graphType.subclass:
+ return graphType.subclass(*args_, **kwargs_)
+ else:
+ return graphType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_node(self):
+ return self.node
+ def set_node(self, node):
+ self.node = node
+ def add_node(self, value):
+ self.node.append(value)
+ def insert_node_at(self, index, value):
+ self.node.insert(index, value)
+ def replace_node_at(self, index, value):
+ self.node[index] = value
+ def hasContent_(self):
+ if (
+ self.node
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='graphType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('graphType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'graphType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='graphType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='graphType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='graphType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='graphType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for node_ in self.node:
+ namespaceprefix_ = self.node_nsprefix_ + ':' if (UseCapturedNS_ and self.node_nsprefix_) else ''
+ node_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='node', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'node':
+ obj_ = nodeType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.node.append(obj_)
+ obj_.original_tagname_ = 'node'
+# end class graphType
+
+
+class nodeType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, id=None, label=None, link=None, childnode=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.id = _cast(None, id)
+ self.id_nsprefix_ = None
+ self.label = label
+ self.label_nsprefix_ = None
+ self.link = link
+ self.link_nsprefix_ = None
+ if childnode is None:
+ self.childnode = []
+ else:
+ self.childnode = childnode
+ self.childnode_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, nodeType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if nodeType.subclass:
+ return nodeType.subclass(*args_, **kwargs_)
+ else:
+ return nodeType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_label(self):
+ return self.label
+ def set_label(self, label):
+ self.label = label
+ def get_link(self):
+ return self.link
+ def set_link(self, link):
+ self.link = link
+ def get_childnode(self):
+ return self.childnode
+ def set_childnode(self, childnode):
+ self.childnode = childnode
+ def add_childnode(self, value):
+ self.childnode.append(value)
+ def insert_childnode_at(self, index, value):
+ self.childnode.insert(index, value)
+ def replace_childnode_at(self, index, value):
+ self.childnode[index] = value
+ def get_id(self):
+ return self.id
+ def set_id(self, id):
+ self.id = id
+ def hasContent_(self):
+ if (
+ self.label is not None or
+ self.link is not None or
+ self.childnode
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='nodeType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('nodeType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'nodeType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='nodeType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='nodeType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='nodeType'):
+ if self.id is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='nodeType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.label is not None:
+ namespaceprefix_ = self.label_nsprefix_ + ':' if (UseCapturedNS_ and self.label_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%slabel>%s</%slabel>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.label), input_name='label')), namespaceprefix_ , eol_))
+ if self.link is not None:
+ namespaceprefix_ = self.link_nsprefix_ + ':' if (UseCapturedNS_ and self.link_nsprefix_) else ''
+ self.link.export(outfile, level, namespaceprefix_, namespacedef_='', name_='link', pretty_print=pretty_print)
+ for childnode_ in self.childnode:
+ namespaceprefix_ = self.childnode_nsprefix_ + ':' if (UseCapturedNS_ and self.childnode_nsprefix_) else ''
+ childnode_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='childnode', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('id', node)
+ if value is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ self.id = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'label':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'label')
+ value_ = self.gds_validate_string(value_, node, 'label')
+ self.label = value_
+ self.label_nsprefix_ = child_.prefix
+ elif nodeName_ == 'link':
+ obj_ = linkType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.link = obj_
+ obj_.original_tagname_ = 'link'
+ elif nodeName_ == 'childnode':
+ obj_ = childnodeType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.childnode.append(obj_)
+ obj_.original_tagname_ = 'childnode'
+# end class nodeType
+
+
+class label(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, label)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if label.subclass:
+ return label.subclass(*args_, **kwargs_)
+ else:
+ return label(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def hasContent_(self):
+ if (
+
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='label', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('label')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'label':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='label')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='label', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='label'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='label', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class label
+
+
+class childnodeType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, refid=None, relation=None, edgelabel=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.refid = _cast(None, refid)
+ self.refid_nsprefix_ = None
+ self.relation = _cast(None, relation)
+ self.relation_nsprefix_ = None
+ if edgelabel is None:
+ self.edgelabel = []
+ else:
+ self.edgelabel = edgelabel
+ self.edgelabel_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, childnodeType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if childnodeType.subclass:
+ return childnodeType.subclass(*args_, **kwargs_)
+ else:
+ return childnodeType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_edgelabel(self):
+ return self.edgelabel
+ def set_edgelabel(self, edgelabel):
+ self.edgelabel = edgelabel
+ def add_edgelabel(self, value):
+ self.edgelabel.append(value)
+ def insert_edgelabel_at(self, index, value):
+ self.edgelabel.insert(index, value)
+ def replace_edgelabel_at(self, index, value):
+ self.edgelabel[index] = value
+ def get_refid(self):
+ return self.refid
+ def set_refid(self, refid):
+ self.refid = refid
+ def get_relation(self):
+ return self.relation
+ def set_relation(self, relation):
+ self.relation = relation
+ def validate_DoxGraphRelation(self, value):
+ # Validate type DoxGraphRelation, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['include', 'usage', 'template-instance', 'public-inheritance', 'protected-inheritance', 'private-inheritance', 'type-constraint']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxGraphRelation' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ self.edgelabel
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='childnodeType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('childnodeType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'childnodeType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='childnodeType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='childnodeType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='childnodeType'):
+ if self.refid is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
+ if self.relation is not None and 'relation' not in already_processed:
+ already_processed.add('relation')
+ outfile.write(' relation=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.relation), input_name='relation')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='childnodeType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for edgelabel_ in self.edgelabel:
+ namespaceprefix_ = self.edgelabel_nsprefix_ + ':' if (UseCapturedNS_ and self.edgelabel_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sedgelabel>%s</%sedgelabel>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(edgelabel_), input_name='edgelabel')), namespaceprefix_ , eol_))
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('refid', node)
+ if value is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ self.refid = value
+ value = find_attr_value_('relation', node)
+ if value is not None and 'relation' not in already_processed:
+ already_processed.add('relation')
+ self.relation = value
+ self.validate_DoxGraphRelation(self.relation) # validate type DoxGraphRelation
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'edgelabel':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'edgelabel')
+ value_ = self.gds_validate_string(value_, node, 'edgelabel')
+ self.edgelabel.append(value_)
+ self.edgelabel_nsprefix_ = child_.prefix
+# end class childnodeType
+
+
+class edgelabel(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, edgelabel)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if edgelabel.subclass:
+ return edgelabel.subclass(*args_, **kwargs_)
+ else:
+ return edgelabel(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def hasContent_(self):
+ if (
+
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='edgelabel', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('edgelabel')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'edgelabel':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='edgelabel')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='edgelabel', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='edgelabel'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='edgelabel', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class edgelabel
+
+
+class linkType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, refid=None, external=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.refid = _cast(None, refid)
+ self.refid_nsprefix_ = None
+ self.external = _cast(None, external)
+ self.external_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, linkType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if linkType.subclass:
+ return linkType.subclass(*args_, **kwargs_)
+ else:
+ return linkType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_refid(self):
+ return self.refid
+ def set_refid(self, refid):
+ self.refid = refid
+ def get_external(self):
+ return self.external
+ def set_external(self, external):
+ self.external = external
+ def hasContent_(self):
+ if (
+
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='linkType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('linkType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'linkType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='linkType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='linkType', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='linkType'):
+ if self.refid is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
+ if self.external is not None and 'external' not in already_processed:
+ already_processed.add('external')
+ outfile.write(' external=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.external), input_name='external')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='linkType', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('refid', node)
+ if value is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ self.refid = value
+ value = find_attr_value_('external', node)
+ if value is not None and 'external' not in already_processed:
+ already_processed.add('external')
+ self.external = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class linkType
+
+
+class listingType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, filename=None, codeline=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.filename = _cast(None, filename)
+ self.filename_nsprefix_ = None
+ if codeline is None:
+ self.codeline = []
+ else:
+ self.codeline = codeline
+ self.codeline_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, listingType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if listingType.subclass:
+ return listingType.subclass(*args_, **kwargs_)
+ else:
+ return listingType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_codeline(self):
+ return self.codeline
+ def set_codeline(self, codeline):
+ self.codeline = codeline
+ def add_codeline(self, value):
+ self.codeline.append(value)
+ def insert_codeline_at(self, index, value):
+ self.codeline.insert(index, value)
+ def replace_codeline_at(self, index, value):
+ self.codeline[index] = value
+ def get_filename(self):
+ return self.filename
+ def set_filename(self, filename):
+ self.filename = filename
+ def hasContent_(self):
+ if (
+ self.codeline
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='listingType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('listingType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'listingType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='listingType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='listingType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='listingType'):
+ if self.filename is not None and 'filename' not in already_processed:
+ already_processed.add('filename')
+ outfile.write(' filename=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.filename), input_name='filename')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='listingType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for codeline_ in self.codeline:
+ namespaceprefix_ = self.codeline_nsprefix_ + ':' if (UseCapturedNS_ and self.codeline_nsprefix_) else ''
+ codeline_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='codeline', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('filename', node)
+ if value is not None and 'filename' not in already_processed:
+ already_processed.add('filename')
+ self.filename = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'codeline':
+ obj_ = codelineType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.codeline.append(obj_)
+ obj_.original_tagname_ = 'codeline'
+# end class listingType
+
+
+class codelineType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, lineno=None, refid=None, refkind=None, external=None, highlight=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.lineno = _cast(int, lineno)
+ self.lineno_nsprefix_ = None
+ self.refid = _cast(None, refid)
+ self.refid_nsprefix_ = None
+ self.refkind = _cast(None, refkind)
+ self.refkind_nsprefix_ = None
+ self.external = _cast(None, external)
+ self.external_nsprefix_ = None
+ if highlight is None:
+ self.highlight = []
+ else:
+ self.highlight = highlight
+ self.highlight_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, codelineType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if codelineType.subclass:
+ return codelineType.subclass(*args_, **kwargs_)
+ else:
+ return codelineType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_highlight(self):
+ return self.highlight
+ def set_highlight(self, highlight):
+ self.highlight = highlight
+ def add_highlight(self, value):
+ self.highlight.append(value)
+ def insert_highlight_at(self, index, value):
+ self.highlight.insert(index, value)
+ def replace_highlight_at(self, index, value):
+ self.highlight[index] = value
+ def get_lineno(self):
+ return self.lineno
+ def set_lineno(self, lineno):
+ self.lineno = lineno
+ def get_refid(self):
+ return self.refid
+ def set_refid(self, refid):
+ self.refid = refid
+ def get_refkind(self):
+ return self.refkind
+ def set_refkind(self, refkind):
+ self.refkind = refkind
+ def get_external(self):
+ return self.external
+ def set_external(self, external):
+ self.external = external
+ def validate_DoxRefKind(self, value):
+ # Validate type DoxRefKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['compound', 'member']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxRefKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def validate_DoxBool(self, value):
+ # Validate type DoxBool, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['yes', 'no']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxBool' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ self.highlight
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='codelineType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('codelineType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'codelineType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='codelineType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='codelineType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='codelineType'):
+ if self.lineno is not None and 'lineno' not in already_processed:
+ already_processed.add('lineno')
+ outfile.write(' lineno="%s"' % self.gds_format_integer(self.lineno, input_name='lineno'))
+ if self.refid is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
+ if self.refkind is not None and 'refkind' not in already_processed:
+ already_processed.add('refkind')
+ outfile.write(' refkind=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refkind), input_name='refkind')), ))
+ if self.external is not None and 'external' not in already_processed:
+ already_processed.add('external')
+ outfile.write(' external=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.external), input_name='external')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='codelineType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for highlight_ in self.highlight:
+ namespaceprefix_ = self.highlight_nsprefix_ + ':' if (UseCapturedNS_ and self.highlight_nsprefix_) else ''
+ highlight_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='highlight', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('lineno', node)
+ if value is not None and 'lineno' not in already_processed:
+ already_processed.add('lineno')
+ self.lineno = self.gds_parse_integer(value, node, 'lineno')
+ value = find_attr_value_('refid', node)
+ if value is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ self.refid = value
+ value = find_attr_value_('refkind', node)
+ if value is not None and 'refkind' not in already_processed:
+ already_processed.add('refkind')
+ self.refkind = value
+ self.validate_DoxRefKind(self.refkind) # validate type DoxRefKind
+ value = find_attr_value_('external', node)
+ if value is not None and 'external' not in already_processed:
+ already_processed.add('external')
+ self.external = value
+ self.validate_DoxBool(self.external) # validate type DoxBool
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'highlight':
+ obj_ = highlightType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.highlight.append(obj_)
+ obj_.original_tagname_ = 'highlight'
+# end class codelineType
+
+
+class highlightType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, class_=None, sp=None, ref=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.class_ = _cast(None, class_)
+ self.class__nsprefix_ = None
+ if sp is None:
+ self.sp = []
+ else:
+ self.sp = sp
+ self.sp_nsprefix_ = None
+ if ref is None:
+ self.ref = []
+ else:
+ self.ref = ref
+ self.ref_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, highlightType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if highlightType.subclass:
+ return highlightType.subclass(*args_, **kwargs_)
+ else:
+ return highlightType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_sp(self):
+ return self.sp
+ def set_sp(self, sp):
+ self.sp = sp
+ def add_sp(self, value):
+ self.sp.append(value)
+ def insert_sp_at(self, index, value):
+ self.sp.insert(index, value)
+ def replace_sp_at(self, index, value):
+ self.sp[index] = value
+ def get_ref(self):
+ return self.ref
+ def set_ref(self, ref):
+ self.ref = ref
+ def add_ref(self, value):
+ self.ref.append(value)
+ def insert_ref_at(self, index, value):
+ self.ref.insert(index, value)
+ def replace_ref_at(self, index, value):
+ self.ref[index] = value
+ def get_class(self):
+ return self.class_
+ def set_class(self, class_):
+ self.class_ = class_
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def validate_DoxHighlightClass(self, value):
+ # Validate type DoxHighlightClass, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['comment', 'normal', 'preprocessor', 'keyword', 'keywordtype', 'keywordflow', 'stringliteral', 'charliteral', 'vhdlkeyword', 'vhdllogic', 'vhdlchar', 'vhdldigit']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxHighlightClass' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ self.sp or
+ self.ref or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='highlightType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('highlightType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'highlightType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='highlightType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='highlightType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='highlightType'):
+ if self.class_ is not None and 'class_' not in already_processed:
+ already_processed.add('class_')
+ outfile.write(' class=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.class_), input_name='class')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='highlightType', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for sp_ in self.sp:
+ namespaceprefix_ = self.sp_nsprefix_ + ':' if (UseCapturedNS_ and self.sp_nsprefix_) else ''
+ sp_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='sp', pretty_print=pretty_print)
+ for ref_ in self.ref:
+ namespaceprefix_ = self.ref_nsprefix_ + ':' if (UseCapturedNS_ and self.ref_nsprefix_) else ''
+ ref_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ref', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('class', node)
+ if value is not None and 'class' not in already_processed:
+ already_processed.add('class')
+ self.class_ = value
+ self.validate_DoxHighlightClass(self.class_) # validate type DoxHighlightClass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'sp':
+ obj_ = spType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'sp', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_sp'):
+ self.add_sp(obj_.value)
+ elif hasattr(self, 'set_sp'):
+ self.set_sp(obj_.value)
+ elif nodeName_ == 'ref':
+ obj_ = refTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ref', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ref'):
+ self.add_ref(obj_.value)
+ elif hasattr(self, 'set_ref'):
+ self.set_ref(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class highlightType
+
+
+class spType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, value=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.value = _cast(int, value)
+ self.value_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, spType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if spType.subclass:
+ return spType.subclass(*args_, **kwargs_)
+ else:
+ return spType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_value(self):
+ return self.value
+ def set_value(self, value):
+ self.value = value
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='spType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('spType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'spType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='spType')
+ outfile.write('>')
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_, pretty_print=pretty_print)
+ outfile.write(self.convert_unicode(self.valueOf_))
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='spType'):
+ if self.value is not None and 'value' not in already_processed:
+ already_processed.add('value')
+ outfile.write(' value="%s"' % self.gds_format_integer(self.value, input_name='value'))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='spType', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('value', node)
+ if value is not None and 'value' not in already_processed:
+ already_processed.add('value')
+ self.value = self.gds_parse_integer(value, node, 'value')
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+ pass
+# end class spType
+
+
+class referenceType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, refid=None, compoundref=None, startline=None, endline=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.refid = _cast(None, refid)
+ self.refid_nsprefix_ = None
+ self.compoundref = _cast(None, compoundref)
+ self.compoundref_nsprefix_ = None
+ self.startline = _cast(int, startline)
+ self.startline_nsprefix_ = None
+ self.endline = _cast(int, endline)
+ self.endline_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, referenceType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if referenceType.subclass:
+ return referenceType.subclass(*args_, **kwargs_)
+ else:
+ return referenceType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_refid(self):
+ return self.refid
+ def set_refid(self, refid):
+ self.refid = refid
+ def get_compoundref(self):
+ return self.compoundref
+ def set_compoundref(self, compoundref):
+ self.compoundref = compoundref
+ def get_startline(self):
+ return self.startline
+ def set_startline(self, startline):
+ self.startline = startline
+ def get_endline(self):
+ return self.endline
+ def set_endline(self, endline):
+ self.endline = endline
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='referenceType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('referenceType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'referenceType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='referenceType')
+ outfile.write('>')
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_, pretty_print=pretty_print)
+ outfile.write(self.convert_unicode(self.valueOf_))
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='referenceType'):
+ if self.refid is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
+ if self.compoundref is not None and 'compoundref' not in already_processed:
+ already_processed.add('compoundref')
+ outfile.write(' compoundref=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.compoundref), input_name='compoundref')), ))
+ if self.startline is not None and 'startline' not in already_processed:
+ already_processed.add('startline')
+ outfile.write(' startline="%s"' % self.gds_format_integer(self.startline, input_name='startline'))
+ if self.endline is not None and 'endline' not in already_processed:
+ already_processed.add('endline')
+ outfile.write(' endline="%s"' % self.gds_format_integer(self.endline, input_name='endline'))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='referenceType', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('refid', node)
+ if value is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ self.refid = value
+ value = find_attr_value_('compoundref', node)
+ if value is not None and 'compoundref' not in already_processed:
+ already_processed.add('compoundref')
+ self.compoundref = value
+ value = find_attr_value_('startline', node)
+ if value is not None and 'startline' not in already_processed:
+ already_processed.add('startline')
+ self.startline = self.gds_parse_integer(value, node, 'startline')
+ value = find_attr_value_('endline', node)
+ if value is not None and 'endline' not in already_processed:
+ already_processed.add('endline')
+ self.endline = self.gds_parse_integer(value, node, 'endline')
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+ pass
+# end class referenceType
+
+
+class locationType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, file=None, line=None, column=None, declfile=None, declline=None, declcolumn=None, bodyfile=None, bodystart=None, bodyend=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.file = _cast(None, file)
+ self.file_nsprefix_ = None
+ self.line = _cast(int, line)
+ self.line_nsprefix_ = None
+ self.column = _cast(int, column)
+ self.column_nsprefix_ = None
+ self.declfile = _cast(None, declfile)
+ self.declfile_nsprefix_ = None
+ self.declline = _cast(int, declline)
+ self.declline_nsprefix_ = None
+ self.declcolumn = _cast(int, declcolumn)
+ self.declcolumn_nsprefix_ = None
+ self.bodyfile = _cast(None, bodyfile)
+ self.bodyfile_nsprefix_ = None
+ self.bodystart = _cast(int, bodystart)
+ self.bodystart_nsprefix_ = None
+ self.bodyend = _cast(int, bodyend)
+ self.bodyend_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, locationType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if locationType.subclass:
+ return locationType.subclass(*args_, **kwargs_)
+ else:
+ return locationType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_file(self):
+ return self.file
+ def set_file(self, file):
+ self.file = file
+ def get_line(self):
+ return self.line
+ def set_line(self, line):
+ self.line = line
+ def get_column(self):
+ return self.column
+ def set_column(self, column):
+ self.column = column
+ def get_declfile(self):
+ return self.declfile
+ def set_declfile(self, declfile):
+ self.declfile = declfile
+ def get_declline(self):
+ return self.declline
+ def set_declline(self, declline):
+ self.declline = declline
+ def get_declcolumn(self):
+ return self.declcolumn
+ def set_declcolumn(self, declcolumn):
+ self.declcolumn = declcolumn
+ def get_bodyfile(self):
+ return self.bodyfile
+ def set_bodyfile(self, bodyfile):
+ self.bodyfile = bodyfile
+ def get_bodystart(self):
+ return self.bodystart
+ def set_bodystart(self, bodystart):
+ self.bodystart = bodystart
+ def get_bodyend(self):
+ return self.bodyend
+ def set_bodyend(self, bodyend):
+ self.bodyend = bodyend
+ def hasContent_(self):
+ if (
+
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='locationType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('locationType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'locationType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='locationType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='locationType', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='locationType'):
+ if self.file is not None and 'file' not in already_processed:
+ already_processed.add('file')
+ outfile.write(' file=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.file), input_name='file')), ))
+ if self.line is not None and 'line' not in already_processed:
+ already_processed.add('line')
+ outfile.write(' line="%s"' % self.gds_format_integer(self.line, input_name='line'))
+ if self.column is not None and 'column' not in already_processed:
+ already_processed.add('column')
+ outfile.write(' column="%s"' % self.gds_format_integer(self.column, input_name='column'))
+ if self.declfile is not None and 'declfile' not in already_processed:
+ already_processed.add('declfile')
+ outfile.write(' declfile=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.declfile), input_name='declfile')), ))
+ if self.declline is not None and 'declline' not in already_processed:
+ already_processed.add('declline')
+ outfile.write(' declline="%s"' % self.gds_format_integer(self.declline, input_name='declline'))
+ if self.declcolumn is not None and 'declcolumn' not in already_processed:
+ already_processed.add('declcolumn')
+ outfile.write(' declcolumn="%s"' % self.gds_format_integer(self.declcolumn, input_name='declcolumn'))
+ if self.bodyfile is not None and 'bodyfile' not in already_processed:
+ already_processed.add('bodyfile')
+ outfile.write(' bodyfile=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.bodyfile), input_name='bodyfile')), ))
+ if self.bodystart is not None and 'bodystart' not in already_processed:
+ already_processed.add('bodystart')
+ outfile.write(' bodystart="%s"' % self.gds_format_integer(self.bodystart, input_name='bodystart'))
+ if self.bodyend is not None and 'bodyend' not in already_processed:
+ already_processed.add('bodyend')
+ outfile.write(' bodyend="%s"' % self.gds_format_integer(self.bodyend, input_name='bodyend'))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='locationType', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('file', node)
+ if value is not None and 'file' not in already_processed:
+ already_processed.add('file')
+ self.file = value
+ value = find_attr_value_('line', node)
+ if value is not None and 'line' not in already_processed:
+ already_processed.add('line')
+ self.line = self.gds_parse_integer(value, node, 'line')
+ value = find_attr_value_('column', node)
+ if value is not None and 'column' not in already_processed:
+ already_processed.add('column')
+ self.column = self.gds_parse_integer(value, node, 'column')
+ value = find_attr_value_('declfile', node)
+ if value is not None and 'declfile' not in already_processed:
+ already_processed.add('declfile')
+ self.declfile = value
+ value = find_attr_value_('declline', node)
+ if value is not None and 'declline' not in already_processed:
+ already_processed.add('declline')
+ self.declline = self.gds_parse_integer(value, node, 'declline')
+ value = find_attr_value_('declcolumn', node)
+ if value is not None and 'declcolumn' not in already_processed:
+ already_processed.add('declcolumn')
+ self.declcolumn = self.gds_parse_integer(value, node, 'declcolumn')
+ value = find_attr_value_('bodyfile', node)
+ if value is not None and 'bodyfile' not in already_processed:
+ already_processed.add('bodyfile')
+ self.bodyfile = value
+ value = find_attr_value_('bodystart', node)
+ if value is not None and 'bodystart' not in already_processed:
+ already_processed.add('bodystart')
+ self.bodystart = self.gds_parse_integer(value, node, 'bodystart')
+ value = find_attr_value_('bodyend', node)
+ if value is not None and 'bodyend' not in already_processed:
+ already_processed.add('bodyend')
+ self.bodyend = self.gds_parse_integer(value, node, 'bodyend')
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class locationType
+
+
+class docSect1Type(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, id=None, title=None, para=None, internal=None, sect2=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.id = _cast(None, id)
+ self.id_nsprefix_ = None
+ self.title = title
+ self.title_nsprefix_ = None
+ if para is None:
+ self.para = []
+ else:
+ self.para = para
+ self.para_nsprefix_ = None
+ if internal is None:
+ self.internal = []
+ else:
+ self.internal = internal
+ self.internal_nsprefix_ = None
+ if sect2 is None:
+ self.sect2 = []
+ else:
+ self.sect2 = sect2
+ self.sect2_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docSect1Type)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docSect1Type.subclass:
+ return docSect1Type.subclass(*args_, **kwargs_)
+ else:
+ return docSect1Type(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_title(self):
+ return self.title
+ def set_title(self, title):
+ self.title = title
+ def get_para(self):
+ return self.para
+ def set_para(self, para):
+ self.para = para
+ def add_para(self, value):
+ self.para.append(value)
+ def insert_para_at(self, index, value):
+ self.para.insert(index, value)
+ def replace_para_at(self, index, value):
+ self.para[index] = value
+ def get_internal(self):
+ return self.internal
+ def set_internal(self, internal):
+ self.internal = internal
+ def add_internal(self, value):
+ self.internal.append(value)
+ def insert_internal_at(self, index, value):
+ self.internal.insert(index, value)
+ def replace_internal_at(self, index, value):
+ self.internal[index] = value
+ def get_sect2(self):
+ return self.sect2
+ def set_sect2(self, sect2):
+ self.sect2 = sect2
+ def add_sect2(self, value):
+ self.sect2.append(value)
+ def insert_sect2_at(self, index, value):
+ self.sect2.insert(index, value)
+ def replace_sect2_at(self, index, value):
+ self.sect2[index] = value
+ def get_id(self):
+ return self.id
+ def set_id(self, id):
+ self.id = id
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.title is not None or
+ self.para or
+ self.internal or
+ self.sect2 or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docSect1Type', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docSect1Type')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docSect1Type':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docSect1Type')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docSect1Type', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docSect1Type'):
+ if self.id is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docSect1Type', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.title is not None:
+ namespaceprefix_ = self.title_nsprefix_ + ':' if (UseCapturedNS_ and self.title_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%stitle>%s</%stitle>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.title), input_name='title')), namespaceprefix_ , eol_))
+ for para_ in self.para:
+ namespaceprefix_ = self.para_nsprefix_ + ':' if (UseCapturedNS_ and self.para_nsprefix_) else ''
+ para_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='para', pretty_print=pretty_print)
+ for internal_ in self.internal:
+ namespaceprefix_ = self.internal_nsprefix_ + ':' if (UseCapturedNS_ and self.internal_nsprefix_) else ''
+ internal_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='internal', pretty_print=pretty_print)
+ for sect2_ in self.sect2:
+ namespaceprefix_ = self.sect2_nsprefix_ + ':' if (UseCapturedNS_ and self.sect2_nsprefix_) else ''
+ sect2_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='sect2', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('id', node)
+ if value is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ self.id = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'title' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'title')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'title')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'title', valuestr_)
+ self.content_.append(obj_)
+ self.title_nsprefix_ = child_.prefix
+ elif nodeName_ == 'para':
+ obj_ = docParaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'para', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_para'):
+ self.add_para(obj_.value)
+ elif hasattr(self, 'set_para'):
+ self.set_para(obj_.value)
+ elif nodeName_ == 'internal':
+ obj_ = docInternalS1Type.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'internal', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_internal'):
+ self.add_internal(obj_.value)
+ elif hasattr(self, 'set_internal'):
+ self.set_internal(obj_.value)
+ elif nodeName_ == 'sect2':
+ obj_ = docSect2Type.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'sect2', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_sect2'):
+ self.add_sect2(obj_.value)
+ elif hasattr(self, 'set_sect2'):
+ self.set_sect2(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docSect1Type
+
+
+class docSect2Type(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, id=None, title=None, para=None, sect3=None, internal=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.id = _cast(None, id)
+ self.id_nsprefix_ = None
+ self.title = title
+ self.title_nsprefix_ = None
+ if para is None:
+ self.para = []
+ else:
+ self.para = para
+ self.para_nsprefix_ = None
+ if sect3 is None:
+ self.sect3 = []
+ else:
+ self.sect3 = sect3
+ self.sect3_nsprefix_ = None
+ if internal is None:
+ self.internal = []
+ else:
+ self.internal = internal
+ self.internal_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docSect2Type)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docSect2Type.subclass:
+ return docSect2Type.subclass(*args_, **kwargs_)
+ else:
+ return docSect2Type(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_title(self):
+ return self.title
+ def set_title(self, title):
+ self.title = title
+ def get_para(self):
+ return self.para
+ def set_para(self, para):
+ self.para = para
+ def add_para(self, value):
+ self.para.append(value)
+ def insert_para_at(self, index, value):
+ self.para.insert(index, value)
+ def replace_para_at(self, index, value):
+ self.para[index] = value
+ def get_sect3(self):
+ return self.sect3
+ def set_sect3(self, sect3):
+ self.sect3 = sect3
+ def add_sect3(self, value):
+ self.sect3.append(value)
+ def insert_sect3_at(self, index, value):
+ self.sect3.insert(index, value)
+ def replace_sect3_at(self, index, value):
+ self.sect3[index] = value
+ def get_internal(self):
+ return self.internal
+ def set_internal(self, internal):
+ self.internal = internal
+ def add_internal(self, value):
+ self.internal.append(value)
+ def insert_internal_at(self, index, value):
+ self.internal.insert(index, value)
+ def replace_internal_at(self, index, value):
+ self.internal[index] = value
+ def get_id(self):
+ return self.id
+ def set_id(self, id):
+ self.id = id
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.title is not None or
+ self.para or
+ self.sect3 or
+ self.internal or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docSect2Type', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docSect2Type')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docSect2Type':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docSect2Type')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docSect2Type', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docSect2Type'):
+ if self.id is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docSect2Type', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.title is not None:
+ namespaceprefix_ = self.title_nsprefix_ + ':' if (UseCapturedNS_ and self.title_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%stitle>%s</%stitle>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.title), input_name='title')), namespaceprefix_ , eol_))
+ for para_ in self.para:
+ namespaceprefix_ = self.para_nsprefix_ + ':' if (UseCapturedNS_ and self.para_nsprefix_) else ''
+ para_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='para', pretty_print=pretty_print)
+ for sect3_ in self.sect3:
+ namespaceprefix_ = self.sect3_nsprefix_ + ':' if (UseCapturedNS_ and self.sect3_nsprefix_) else ''
+ sect3_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='sect3', pretty_print=pretty_print)
+ for internal_ in self.internal:
+ namespaceprefix_ = self.internal_nsprefix_ + ':' if (UseCapturedNS_ and self.internal_nsprefix_) else ''
+ internal_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='internal', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('id', node)
+ if value is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ self.id = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'title' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'title')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'title')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'title', valuestr_)
+ self.content_.append(obj_)
+ self.title_nsprefix_ = child_.prefix
+ elif nodeName_ == 'para':
+ obj_ = docParaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'para', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_para'):
+ self.add_para(obj_.value)
+ elif hasattr(self, 'set_para'):
+ self.set_para(obj_.value)
+ elif nodeName_ == 'sect3':
+ obj_ = docSect3Type.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'sect3', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_sect3'):
+ self.add_sect3(obj_.value)
+ elif hasattr(self, 'set_sect3'):
+ self.set_sect3(obj_.value)
+ elif nodeName_ == 'internal':
+ obj_ = docInternalS2Type.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'internal', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_internal'):
+ self.add_internal(obj_.value)
+ elif hasattr(self, 'set_internal'):
+ self.set_internal(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docSect2Type
+
+
+class docSect3Type(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, id=None, title=None, para=None, sect4=None, internal=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.id = _cast(None, id)
+ self.id_nsprefix_ = None
+ self.title = title
+ self.title_nsprefix_ = None
+ if para is None:
+ self.para = []
+ else:
+ self.para = para
+ self.para_nsprefix_ = None
+ if sect4 is None:
+ self.sect4 = []
+ else:
+ self.sect4 = sect4
+ self.sect4_nsprefix_ = None
+ if internal is None:
+ self.internal = []
+ else:
+ self.internal = internal
+ self.internal_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docSect3Type)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docSect3Type.subclass:
+ return docSect3Type.subclass(*args_, **kwargs_)
+ else:
+ return docSect3Type(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_title(self):
+ return self.title
+ def set_title(self, title):
+ self.title = title
+ def get_para(self):
+ return self.para
+ def set_para(self, para):
+ self.para = para
+ def add_para(self, value):
+ self.para.append(value)
+ def insert_para_at(self, index, value):
+ self.para.insert(index, value)
+ def replace_para_at(self, index, value):
+ self.para[index] = value
+ def get_sect4(self):
+ return self.sect4
+ def set_sect4(self, sect4):
+ self.sect4 = sect4
+ def add_sect4(self, value):
+ self.sect4.append(value)
+ def insert_sect4_at(self, index, value):
+ self.sect4.insert(index, value)
+ def replace_sect4_at(self, index, value):
+ self.sect4[index] = value
+ def get_internal(self):
+ return self.internal
+ def set_internal(self, internal):
+ self.internal = internal
+ def add_internal(self, value):
+ self.internal.append(value)
+ def insert_internal_at(self, index, value):
+ self.internal.insert(index, value)
+ def replace_internal_at(self, index, value):
+ self.internal[index] = value
+ def get_id(self):
+ return self.id
+ def set_id(self, id):
+ self.id = id
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.title is not None or
+ self.para or
+ self.sect4 or
+ self.internal or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docSect3Type', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docSect3Type')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docSect3Type':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docSect3Type')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docSect3Type', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docSect3Type'):
+ if self.id is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docSect3Type', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.title is not None:
+ namespaceprefix_ = self.title_nsprefix_ + ':' if (UseCapturedNS_ and self.title_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%stitle>%s</%stitle>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.title), input_name='title')), namespaceprefix_ , eol_))
+ for para_ in self.para:
+ namespaceprefix_ = self.para_nsprefix_ + ':' if (UseCapturedNS_ and self.para_nsprefix_) else ''
+ para_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='para', pretty_print=pretty_print)
+ for sect4_ in self.sect4:
+ namespaceprefix_ = self.sect4_nsprefix_ + ':' if (UseCapturedNS_ and self.sect4_nsprefix_) else ''
+ sect4_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='sect4', pretty_print=pretty_print)
+ for internal_ in self.internal:
+ namespaceprefix_ = self.internal_nsprefix_ + ':' if (UseCapturedNS_ and self.internal_nsprefix_) else ''
+ internal_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='internal', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('id', node)
+ if value is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ self.id = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'title' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'title')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'title')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'title', valuestr_)
+ self.content_.append(obj_)
+ self.title_nsprefix_ = child_.prefix
+ elif nodeName_ == 'para':
+ obj_ = docParaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'para', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_para'):
+ self.add_para(obj_.value)
+ elif hasattr(self, 'set_para'):
+ self.set_para(obj_.value)
+ elif nodeName_ == 'sect4':
+ obj_ = docSect4Type.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'sect4', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_sect4'):
+ self.add_sect4(obj_.value)
+ elif hasattr(self, 'set_sect4'):
+ self.set_sect4(obj_.value)
+ elif nodeName_ == 'internal':
+ obj_ = docInternalS3Type.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'internal', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_internal'):
+ self.add_internal(obj_.value)
+ elif hasattr(self, 'set_internal'):
+ self.set_internal(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docSect3Type
+
+
+class docSect4Type(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, id=None, title=None, para=None, internal=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.id = _cast(None, id)
+ self.id_nsprefix_ = None
+ self.title = title
+ self.title_nsprefix_ = None
+ if para is None:
+ self.para = []
+ else:
+ self.para = para
+ self.para_nsprefix_ = None
+ if internal is None:
+ self.internal = []
+ else:
+ self.internal = internal
+ self.internal_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docSect4Type)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docSect4Type.subclass:
+ return docSect4Type.subclass(*args_, **kwargs_)
+ else:
+ return docSect4Type(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_title(self):
+ return self.title
+ def set_title(self, title):
+ self.title = title
+ def get_para(self):
+ return self.para
+ def set_para(self, para):
+ self.para = para
+ def add_para(self, value):
+ self.para.append(value)
+ def insert_para_at(self, index, value):
+ self.para.insert(index, value)
+ def replace_para_at(self, index, value):
+ self.para[index] = value
+ def get_internal(self):
+ return self.internal
+ def set_internal(self, internal):
+ self.internal = internal
+ def add_internal(self, value):
+ self.internal.append(value)
+ def insert_internal_at(self, index, value):
+ self.internal.insert(index, value)
+ def replace_internal_at(self, index, value):
+ self.internal[index] = value
+ def get_id(self):
+ return self.id
+ def set_id(self, id):
+ self.id = id
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.title is not None or
+ self.para or
+ self.internal or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docSect4Type', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docSect4Type')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docSect4Type':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docSect4Type')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docSect4Type', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docSect4Type'):
+ if self.id is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docSect4Type', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.title is not None:
+ namespaceprefix_ = self.title_nsprefix_ + ':' if (UseCapturedNS_ and self.title_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%stitle>%s</%stitle>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.title), input_name='title')), namespaceprefix_ , eol_))
+ for para_ in self.para:
+ namespaceprefix_ = self.para_nsprefix_ + ':' if (UseCapturedNS_ and self.para_nsprefix_) else ''
+ para_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='para', pretty_print=pretty_print)
+ for internal_ in self.internal:
+ namespaceprefix_ = self.internal_nsprefix_ + ':' if (UseCapturedNS_ and self.internal_nsprefix_) else ''
+ internal_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='internal', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('id', node)
+ if value is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ self.id = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'title' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'title')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'title')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'title', valuestr_)
+ self.content_.append(obj_)
+ self.title_nsprefix_ = child_.prefix
+ elif nodeName_ == 'para':
+ obj_ = docParaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'para', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_para'):
+ self.add_para(obj_.value)
+ elif hasattr(self, 'set_para'):
+ self.set_para(obj_.value)
+ elif nodeName_ == 'internal':
+ obj_ = docInternalS4Type.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'internal', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_internal'):
+ self.add_internal(obj_.value)
+ elif hasattr(self, 'set_internal'):
+ self.set_internal(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docSect4Type
+
+
+class docInternalType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, para=None, sect1=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if para is None:
+ self.para = []
+ else:
+ self.para = para
+ self.para_nsprefix_ = None
+ if sect1 is None:
+ self.sect1 = []
+ else:
+ self.sect1 = sect1
+ self.sect1_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docInternalType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docInternalType.subclass:
+ return docInternalType.subclass(*args_, **kwargs_)
+ else:
+ return docInternalType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_para(self):
+ return self.para
+ def set_para(self, para):
+ self.para = para
+ def add_para(self, value):
+ self.para.append(value)
+ def insert_para_at(self, index, value):
+ self.para.insert(index, value)
+ def replace_para_at(self, index, value):
+ self.para[index] = value
+ def get_sect1(self):
+ return self.sect1
+ def set_sect1(self, sect1):
+ self.sect1 = sect1
+ def add_sect1(self, value):
+ self.sect1.append(value)
+ def insert_sect1_at(self, index, value):
+ self.sect1.insert(index, value)
+ def replace_sect1_at(self, index, value):
+ self.sect1[index] = value
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.para or
+ self.sect1 or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docInternalType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docInternalType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docInternalType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docInternalType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docInternalType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docInternalType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docInternalType', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for para_ in self.para:
+ namespaceprefix_ = self.para_nsprefix_ + ':' if (UseCapturedNS_ and self.para_nsprefix_) else ''
+ para_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='para', pretty_print=pretty_print)
+ for sect1_ in self.sect1:
+ namespaceprefix_ = self.sect1_nsprefix_ + ':' if (UseCapturedNS_ and self.sect1_nsprefix_) else ''
+ sect1_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='sect1', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'para':
+ obj_ = docParaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'para', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_para'):
+ self.add_para(obj_.value)
+ elif hasattr(self, 'set_para'):
+ self.set_para(obj_.value)
+ elif nodeName_ == 'sect1':
+ obj_ = docSect1Type.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'sect1', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_sect1'):
+ self.add_sect1(obj_.value)
+ elif hasattr(self, 'set_sect1'):
+ self.set_sect1(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docInternalType
+
+
+class docInternalS1Type(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, para=None, sect2=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if para is None:
+ self.para = []
+ else:
+ self.para = para
+ self.para_nsprefix_ = None
+ if sect2 is None:
+ self.sect2 = []
+ else:
+ self.sect2 = sect2
+ self.sect2_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docInternalS1Type)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docInternalS1Type.subclass:
+ return docInternalS1Type.subclass(*args_, **kwargs_)
+ else:
+ return docInternalS1Type(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_para(self):
+ return self.para
+ def set_para(self, para):
+ self.para = para
+ def add_para(self, value):
+ self.para.append(value)
+ def insert_para_at(self, index, value):
+ self.para.insert(index, value)
+ def replace_para_at(self, index, value):
+ self.para[index] = value
+ def get_sect2(self):
+ return self.sect2
+ def set_sect2(self, sect2):
+ self.sect2 = sect2
+ def add_sect2(self, value):
+ self.sect2.append(value)
+ def insert_sect2_at(self, index, value):
+ self.sect2.insert(index, value)
+ def replace_sect2_at(self, index, value):
+ self.sect2[index] = value
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.para or
+ self.sect2 or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docInternalS1Type', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docInternalS1Type')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docInternalS1Type':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docInternalS1Type')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docInternalS1Type', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docInternalS1Type'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docInternalS1Type', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for para_ in self.para:
+ namespaceprefix_ = self.para_nsprefix_ + ':' if (UseCapturedNS_ and self.para_nsprefix_) else ''
+ para_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='para', pretty_print=pretty_print)
+ for sect2_ in self.sect2:
+ namespaceprefix_ = self.sect2_nsprefix_ + ':' if (UseCapturedNS_ and self.sect2_nsprefix_) else ''
+ sect2_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='sect2', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'para':
+ obj_ = docParaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'para', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_para'):
+ self.add_para(obj_.value)
+ elif hasattr(self, 'set_para'):
+ self.set_para(obj_.value)
+ elif nodeName_ == 'sect2':
+ obj_ = docSect2Type.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'sect2', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_sect2'):
+ self.add_sect2(obj_.value)
+ elif hasattr(self, 'set_sect2'):
+ self.set_sect2(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docInternalS1Type
+
+
+class docInternalS2Type(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, para=None, sect3=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if para is None:
+ self.para = []
+ else:
+ self.para = para
+ self.para_nsprefix_ = None
+ if sect3 is None:
+ self.sect3 = []
+ else:
+ self.sect3 = sect3
+ self.sect3_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docInternalS2Type)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docInternalS2Type.subclass:
+ return docInternalS2Type.subclass(*args_, **kwargs_)
+ else:
+ return docInternalS2Type(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_para(self):
+ return self.para
+ def set_para(self, para):
+ self.para = para
+ def add_para(self, value):
+ self.para.append(value)
+ def insert_para_at(self, index, value):
+ self.para.insert(index, value)
+ def replace_para_at(self, index, value):
+ self.para[index] = value
+ def get_sect3(self):
+ return self.sect3
+ def set_sect3(self, sect3):
+ self.sect3 = sect3
+ def add_sect3(self, value):
+ self.sect3.append(value)
+ def insert_sect3_at(self, index, value):
+ self.sect3.insert(index, value)
+ def replace_sect3_at(self, index, value):
+ self.sect3[index] = value
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.para or
+ self.sect3 or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docInternalS2Type', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docInternalS2Type')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docInternalS2Type':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docInternalS2Type')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docInternalS2Type', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docInternalS2Type'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docInternalS2Type', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for para_ in self.para:
+ namespaceprefix_ = self.para_nsprefix_ + ':' if (UseCapturedNS_ and self.para_nsprefix_) else ''
+ para_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='para', pretty_print=pretty_print)
+ for sect3_ in self.sect3:
+ namespaceprefix_ = self.sect3_nsprefix_ + ':' if (UseCapturedNS_ and self.sect3_nsprefix_) else ''
+ sect3_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='sect3', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'para':
+ obj_ = docParaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'para', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_para'):
+ self.add_para(obj_.value)
+ elif hasattr(self, 'set_para'):
+ self.set_para(obj_.value)
+ elif nodeName_ == 'sect3':
+ obj_ = docSect3Type.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'sect3', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_sect3'):
+ self.add_sect3(obj_.value)
+ elif hasattr(self, 'set_sect3'):
+ self.set_sect3(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docInternalS2Type
+
+
+class docInternalS3Type(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, para=None, sect3=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if para is None:
+ self.para = []
+ else:
+ self.para = para
+ self.para_nsprefix_ = None
+ if sect3 is None:
+ self.sect3 = []
+ else:
+ self.sect3 = sect3
+ self.sect3_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docInternalS3Type)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docInternalS3Type.subclass:
+ return docInternalS3Type.subclass(*args_, **kwargs_)
+ else:
+ return docInternalS3Type(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_para(self):
+ return self.para
+ def set_para(self, para):
+ self.para = para
+ def add_para(self, value):
+ self.para.append(value)
+ def insert_para_at(self, index, value):
+ self.para.insert(index, value)
+ def replace_para_at(self, index, value):
+ self.para[index] = value
+ def get_sect3(self):
+ return self.sect3
+ def set_sect3(self, sect3):
+ self.sect3 = sect3
+ def add_sect3(self, value):
+ self.sect3.append(value)
+ def insert_sect3_at(self, index, value):
+ self.sect3.insert(index, value)
+ def replace_sect3_at(self, index, value):
+ self.sect3[index] = value
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.para or
+ self.sect3 or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docInternalS3Type', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docInternalS3Type')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docInternalS3Type':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docInternalS3Type')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docInternalS3Type', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docInternalS3Type'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docInternalS3Type', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for para_ in self.para:
+ namespaceprefix_ = self.para_nsprefix_ + ':' if (UseCapturedNS_ and self.para_nsprefix_) else ''
+ para_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='para', pretty_print=pretty_print)
+ for sect3_ in self.sect3:
+ namespaceprefix_ = self.sect3_nsprefix_ + ':' if (UseCapturedNS_ and self.sect3_nsprefix_) else ''
+ sect3_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='sect3', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'para':
+ obj_ = docParaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'para', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_para'):
+ self.add_para(obj_.value)
+ elif hasattr(self, 'set_para'):
+ self.set_para(obj_.value)
+ elif nodeName_ == 'sect3':
+ obj_ = docSect4Type.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'sect3', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_sect3'):
+ self.add_sect3(obj_.value)
+ elif hasattr(self, 'set_sect3'):
+ self.set_sect3(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docInternalS3Type
+
+
+class docInternalS4Type(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, para=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if para is None:
+ self.para = []
+ else:
+ self.para = para
+ self.para_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docInternalS4Type)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docInternalS4Type.subclass:
+ return docInternalS4Type.subclass(*args_, **kwargs_)
+ else:
+ return docInternalS4Type(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_para(self):
+ return self.para
+ def set_para(self, para):
+ self.para = para
+ def add_para(self, value):
+ self.para.append(value)
+ def insert_para_at(self, index, value):
+ self.para.insert(index, value)
+ def replace_para_at(self, index, value):
+ self.para[index] = value
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.para or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docInternalS4Type', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docInternalS4Type')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docInternalS4Type':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docInternalS4Type')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docInternalS4Type', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docInternalS4Type'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docInternalS4Type', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for para_ in self.para:
+ namespaceprefix_ = self.para_nsprefix_ + ':' if (UseCapturedNS_ and self.para_nsprefix_) else ''
+ para_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='para', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'para':
+ obj_ = docParaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'para', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_para'):
+ self.add_para(obj_.value)
+ elif hasattr(self, 'set_para'):
+ self.set_para(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docInternalS4Type
+
+
+class docTitleType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, ulink=None, bold=None, s=None, strike=None, underline=None, emphasis=None, computeroutput=None, subscript=None, superscript=None, center=None, small=None, del_=None, ins=None, htmlonly=None, manonly=None, xmlonly=None, rtfonly=None, latexonly=None, docbookonly=None, image=None, dot=None, msc=None, plantuml=None, anchor=None, formula=None, ref=None, emoji=None, linebreak=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if ulink is None:
+ self.ulink = []
+ else:
+ self.ulink = ulink
+ self.ulink_nsprefix_ = None
+ if bold is None:
+ self.bold = []
+ else:
+ self.bold = bold
+ self.bold_nsprefix_ = None
+ if s is None:
+ self.s = []
+ else:
+ self.s = s
+ self.s_nsprefix_ = None
+ if strike is None:
+ self.strike = []
+ else:
+ self.strike = strike
+ self.strike_nsprefix_ = None
+ if underline is None:
+ self.underline = []
+ else:
+ self.underline = underline
+ self.underline_nsprefix_ = None
+ if emphasis is None:
+ self.emphasis = []
+ else:
+ self.emphasis = emphasis
+ self.emphasis_nsprefix_ = None
+ if computeroutput is None:
+ self.computeroutput = []
+ else:
+ self.computeroutput = computeroutput
+ self.computeroutput_nsprefix_ = None
+ if subscript is None:
+ self.subscript = []
+ else:
+ self.subscript = subscript
+ self.subscript_nsprefix_ = None
+ if superscript is None:
+ self.superscript = []
+ else:
+ self.superscript = superscript
+ self.superscript_nsprefix_ = None
+ if center is None:
+ self.center = []
+ else:
+ self.center = center
+ self.center_nsprefix_ = None
+ if small is None:
+ self.small = []
+ else:
+ self.small = small
+ self.small_nsprefix_ = None
+ if del_ is None:
+ self.del_ = []
+ else:
+ self.del_ = del_
+ self.del__nsprefix_ = None
+ if ins is None:
+ self.ins = []
+ else:
+ self.ins = ins
+ self.ins_nsprefix_ = None
+ if htmlonly is None:
+ self.htmlonly = []
+ else:
+ self.htmlonly = htmlonly
+ self.htmlonly_nsprefix_ = None
+ if manonly is None:
+ self.manonly = []
+ else:
+ self.manonly = manonly
+ self.manonly_nsprefix_ = None
+ if xmlonly is None:
+ self.xmlonly = []
+ else:
+ self.xmlonly = xmlonly
+ self.xmlonly_nsprefix_ = None
+ if rtfonly is None:
+ self.rtfonly = []
+ else:
+ self.rtfonly = rtfonly
+ self.rtfonly_nsprefix_ = None
+ if latexonly is None:
+ self.latexonly = []
+ else:
+ self.latexonly = latexonly
+ self.latexonly_nsprefix_ = None
+ if docbookonly is None:
+ self.docbookonly = []
+ else:
+ self.docbookonly = docbookonly
+ self.docbookonly_nsprefix_ = None
+ if image is None:
+ self.image = []
+ else:
+ self.image = image
+ self.image_nsprefix_ = None
+ if dot is None:
+ self.dot = []
+ else:
+ self.dot = dot
+ self.dot_nsprefix_ = None
+ if msc is None:
+ self.msc = []
+ else:
+ self.msc = msc
+ self.msc_nsprefix_ = None
+ if plantuml is None:
+ self.plantuml = []
+ else:
+ self.plantuml = plantuml
+ self.plantuml_nsprefix_ = None
+ if anchor is None:
+ self.anchor = []
+ else:
+ self.anchor = anchor
+ self.anchor_nsprefix_ = None
+ if formula is None:
+ self.formula = []
+ else:
+ self.formula = formula
+ self.formula_nsprefix_ = None
+ if ref is None:
+ self.ref = []
+ else:
+ self.ref = ref
+ self.ref_nsprefix_ = None
+ if emoji is None:
+ self.emoji = []
+ else:
+ self.emoji = emoji
+ self.emoji_nsprefix_ = None
+ if linebreak is None:
+ self.linebreak = []
+ else:
+ self.linebreak = linebreak
+ self.linebreak_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docTitleType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docTitleType.subclass:
+ return docTitleType.subclass(*args_, **kwargs_)
+ else:
+ return docTitleType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_ulink(self):
+ return self.ulink
+ def set_ulink(self, ulink):
+ self.ulink = ulink
+ def add_ulink(self, value):
+ self.ulink.append(value)
+ def insert_ulink_at(self, index, value):
+ self.ulink.insert(index, value)
+ def replace_ulink_at(self, index, value):
+ self.ulink[index] = value
+ def get_bold(self):
+ return self.bold
+ def set_bold(self, bold):
+ self.bold = bold
+ def add_bold(self, value):
+ self.bold.append(value)
+ def insert_bold_at(self, index, value):
+ self.bold.insert(index, value)
+ def replace_bold_at(self, index, value):
+ self.bold[index] = value
+ def get_s(self):
+ return self.s
+ def set_s(self, s):
+ self.s = s
+ def add_s(self, value):
+ self.s.append(value)
+ def insert_s_at(self, index, value):
+ self.s.insert(index, value)
+ def replace_s_at(self, index, value):
+ self.s[index] = value
+ def get_strike(self):
+ return self.strike
+ def set_strike(self, strike):
+ self.strike = strike
+ def add_strike(self, value):
+ self.strike.append(value)
+ def insert_strike_at(self, index, value):
+ self.strike.insert(index, value)
+ def replace_strike_at(self, index, value):
+ self.strike[index] = value
+ def get_underline(self):
+ return self.underline
+ def set_underline(self, underline):
+ self.underline = underline
+ def add_underline(self, value):
+ self.underline.append(value)
+ def insert_underline_at(self, index, value):
+ self.underline.insert(index, value)
+ def replace_underline_at(self, index, value):
+ self.underline[index] = value
+ def get_emphasis(self):
+ return self.emphasis
+ def set_emphasis(self, emphasis):
+ self.emphasis = emphasis
+ def add_emphasis(self, value):
+ self.emphasis.append(value)
+ def insert_emphasis_at(self, index, value):
+ self.emphasis.insert(index, value)
+ def replace_emphasis_at(self, index, value):
+ self.emphasis[index] = value
+ def get_computeroutput(self):
+ return self.computeroutput
+ def set_computeroutput(self, computeroutput):
+ self.computeroutput = computeroutput
+ def add_computeroutput(self, value):
+ self.computeroutput.append(value)
+ def insert_computeroutput_at(self, index, value):
+ self.computeroutput.insert(index, value)
+ def replace_computeroutput_at(self, index, value):
+ self.computeroutput[index] = value
+ def get_subscript(self):
+ return self.subscript
+ def set_subscript(self, subscript):
+ self.subscript = subscript
+ def add_subscript(self, value):
+ self.subscript.append(value)
+ def insert_subscript_at(self, index, value):
+ self.subscript.insert(index, value)
+ def replace_subscript_at(self, index, value):
+ self.subscript[index] = value
+ def get_superscript(self):
+ return self.superscript
+ def set_superscript(self, superscript):
+ self.superscript = superscript
+ def add_superscript(self, value):
+ self.superscript.append(value)
+ def insert_superscript_at(self, index, value):
+ self.superscript.insert(index, value)
+ def replace_superscript_at(self, index, value):
+ self.superscript[index] = value
+ def get_center(self):
+ return self.center
+ def set_center(self, center):
+ self.center = center
+ def add_center(self, value):
+ self.center.append(value)
+ def insert_center_at(self, index, value):
+ self.center.insert(index, value)
+ def replace_center_at(self, index, value):
+ self.center[index] = value
+ def get_small(self):
+ return self.small
+ def set_small(self, small):
+ self.small = small
+ def add_small(self, value):
+ self.small.append(value)
+ def insert_small_at(self, index, value):
+ self.small.insert(index, value)
+ def replace_small_at(self, index, value):
+ self.small[index] = value
+ def get_del(self):
+ return self.del_
+ def set_del(self, del_):
+ self.del_ = del_
+ def add_del(self, value):
+ self.del_.append(value)
+ def insert_del_at(self, index, value):
+ self.del_.insert(index, value)
+ def replace_del_at(self, index, value):
+ self.del_[index] = value
+ def get_ins(self):
+ return self.ins
+ def set_ins(self, ins):
+ self.ins = ins
+ def add_ins(self, value):
+ self.ins.append(value)
+ def insert_ins_at(self, index, value):
+ self.ins.insert(index, value)
+ def replace_ins_at(self, index, value):
+ self.ins[index] = value
+ def get_htmlonly(self):
+ return self.htmlonly
+ def set_htmlonly(self, htmlonly):
+ self.htmlonly = htmlonly
+ def add_htmlonly(self, value):
+ self.htmlonly.append(value)
+ def insert_htmlonly_at(self, index, value):
+ self.htmlonly.insert(index, value)
+ def replace_htmlonly_at(self, index, value):
+ self.htmlonly[index] = value
+ def get_manonly(self):
+ return self.manonly
+ def set_manonly(self, manonly):
+ self.manonly = manonly
+ def add_manonly(self, value):
+ self.manonly.append(value)
+ def insert_manonly_at(self, index, value):
+ self.manonly.insert(index, value)
+ def replace_manonly_at(self, index, value):
+ self.manonly[index] = value
+ def get_xmlonly(self):
+ return self.xmlonly
+ def set_xmlonly(self, xmlonly):
+ self.xmlonly = xmlonly
+ def add_xmlonly(self, value):
+ self.xmlonly.append(value)
+ def insert_xmlonly_at(self, index, value):
+ self.xmlonly.insert(index, value)
+ def replace_xmlonly_at(self, index, value):
+ self.xmlonly[index] = value
+ def get_rtfonly(self):
+ return self.rtfonly
+ def set_rtfonly(self, rtfonly):
+ self.rtfonly = rtfonly
+ def add_rtfonly(self, value):
+ self.rtfonly.append(value)
+ def insert_rtfonly_at(self, index, value):
+ self.rtfonly.insert(index, value)
+ def replace_rtfonly_at(self, index, value):
+ self.rtfonly[index] = value
+ def get_latexonly(self):
+ return self.latexonly
+ def set_latexonly(self, latexonly):
+ self.latexonly = latexonly
+ def add_latexonly(self, value):
+ self.latexonly.append(value)
+ def insert_latexonly_at(self, index, value):
+ self.latexonly.insert(index, value)
+ def replace_latexonly_at(self, index, value):
+ self.latexonly[index] = value
+ def get_docbookonly(self):
+ return self.docbookonly
+ def set_docbookonly(self, docbookonly):
+ self.docbookonly = docbookonly
+ def add_docbookonly(self, value):
+ self.docbookonly.append(value)
+ def insert_docbookonly_at(self, index, value):
+ self.docbookonly.insert(index, value)
+ def replace_docbookonly_at(self, index, value):
+ self.docbookonly[index] = value
+ def get_image(self):
+ return self.image
+ def set_image(self, image):
+ self.image = image
+ def add_image(self, value):
+ self.image.append(value)
+ def insert_image_at(self, index, value):
+ self.image.insert(index, value)
+ def replace_image_at(self, index, value):
+ self.image[index] = value
+ def get_dot(self):
+ return self.dot
+ def set_dot(self, dot):
+ self.dot = dot
+ def add_dot(self, value):
+ self.dot.append(value)
+ def insert_dot_at(self, index, value):
+ self.dot.insert(index, value)
+ def replace_dot_at(self, index, value):
+ self.dot[index] = value
+ def get_msc(self):
+ return self.msc
+ def set_msc(self, msc):
+ self.msc = msc
+ def add_msc(self, value):
+ self.msc.append(value)
+ def insert_msc_at(self, index, value):
+ self.msc.insert(index, value)
+ def replace_msc_at(self, index, value):
+ self.msc[index] = value
+ def get_plantuml(self):
+ return self.plantuml
+ def set_plantuml(self, plantuml):
+ self.plantuml = plantuml
+ def add_plantuml(self, value):
+ self.plantuml.append(value)
+ def insert_plantuml_at(self, index, value):
+ self.plantuml.insert(index, value)
+ def replace_plantuml_at(self, index, value):
+ self.plantuml[index] = value
+ def get_anchor(self):
+ return self.anchor
+ def set_anchor(self, anchor):
+ self.anchor = anchor
+ def add_anchor(self, value):
+ self.anchor.append(value)
+ def insert_anchor_at(self, index, value):
+ self.anchor.insert(index, value)
+ def replace_anchor_at(self, index, value):
+ self.anchor[index] = value
+ def get_formula(self):
+ return self.formula
+ def set_formula(self, formula):
+ self.formula = formula
+ def add_formula(self, value):
+ self.formula.append(value)
+ def insert_formula_at(self, index, value):
+ self.formula.insert(index, value)
+ def replace_formula_at(self, index, value):
+ self.formula[index] = value
+ def get_ref(self):
+ return self.ref
+ def set_ref(self, ref):
+ self.ref = ref
+ def add_ref(self, value):
+ self.ref.append(value)
+ def insert_ref_at(self, index, value):
+ self.ref.insert(index, value)
+ def replace_ref_at(self, index, value):
+ self.ref[index] = value
+ def get_emoji(self):
+ return self.emoji
+ def set_emoji(self, emoji):
+ self.emoji = emoji
+ def add_emoji(self, value):
+ self.emoji.append(value)
+ def insert_emoji_at(self, index, value):
+ self.emoji.insert(index, value)
+ def replace_emoji_at(self, index, value):
+ self.emoji[index] = value
+ def get_linebreak(self):
+ return self.linebreak
+ def set_linebreak(self, linebreak):
+ self.linebreak = linebreak
+ def add_linebreak(self, value):
+ self.linebreak.append(value)
+ def insert_linebreak_at(self, index, value):
+ self.linebreak.insert(index, value)
+ def replace_linebreak_at(self, index, value):
+ self.linebreak[index] = value
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.ulink or
+ self.bold or
+ self.s or
+ self.strike or
+ self.underline or
+ self.emphasis or
+ self.computeroutput or
+ self.subscript or
+ self.superscript or
+ self.center or
+ self.small or
+ self.del_ or
+ self.ins or
+ self.htmlonly or
+ self.manonly or
+ self.xmlonly or
+ self.rtfonly or
+ self.latexonly or
+ self.docbookonly or
+ self.image or
+ self.dot or
+ self.msc or
+ self.plantuml or
+ self.anchor or
+ self.formula or
+ self.ref or
+ self.emoji or
+ self.linebreak or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docTitleType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docTitleType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docTitleType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docTitleType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docTitleType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docTitleType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docTitleType', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for ulink_ in self.ulink:
+ namespaceprefix_ = self.ulink_nsprefix_ + ':' if (UseCapturedNS_ and self.ulink_nsprefix_) else ''
+ ulink_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ulink', pretty_print=pretty_print)
+ for bold_ in self.bold:
+ namespaceprefix_ = self.bold_nsprefix_ + ':' if (UseCapturedNS_ and self.bold_nsprefix_) else ''
+ bold_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='bold', pretty_print=pretty_print)
+ for s_ in self.s:
+ namespaceprefix_ = self.s_nsprefix_ + ':' if (UseCapturedNS_ and self.s_nsprefix_) else ''
+ s_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='s', pretty_print=pretty_print)
+ for strike_ in self.strike:
+ namespaceprefix_ = self.strike_nsprefix_ + ':' if (UseCapturedNS_ and self.strike_nsprefix_) else ''
+ strike_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='strike', pretty_print=pretty_print)
+ for underline_ in self.underline:
+ namespaceprefix_ = self.underline_nsprefix_ + ':' if (UseCapturedNS_ and self.underline_nsprefix_) else ''
+ underline_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='underline', pretty_print=pretty_print)
+ for emphasis_ in self.emphasis:
+ namespaceprefix_ = self.emphasis_nsprefix_ + ':' if (UseCapturedNS_ and self.emphasis_nsprefix_) else ''
+ emphasis_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='emphasis', pretty_print=pretty_print)
+ for computeroutput_ in self.computeroutput:
+ namespaceprefix_ = self.computeroutput_nsprefix_ + ':' if (UseCapturedNS_ and self.computeroutput_nsprefix_) else ''
+ computeroutput_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='computeroutput', pretty_print=pretty_print)
+ for subscript_ in self.subscript:
+ namespaceprefix_ = self.subscript_nsprefix_ + ':' if (UseCapturedNS_ and self.subscript_nsprefix_) else ''
+ subscript_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='subscript', pretty_print=pretty_print)
+ for superscript_ in self.superscript:
+ namespaceprefix_ = self.superscript_nsprefix_ + ':' if (UseCapturedNS_ and self.superscript_nsprefix_) else ''
+ superscript_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='superscript', pretty_print=pretty_print)
+ for center_ in self.center:
+ namespaceprefix_ = self.center_nsprefix_ + ':' if (UseCapturedNS_ and self.center_nsprefix_) else ''
+ center_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='center', pretty_print=pretty_print)
+ for small_ in self.small:
+ namespaceprefix_ = self.small_nsprefix_ + ':' if (UseCapturedNS_ and self.small_nsprefix_) else ''
+ small_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='small', pretty_print=pretty_print)
+ for del_ in self.del_:
+ namespaceprefix_ = self.del__nsprefix_ + ':' if (UseCapturedNS_ and self.del__nsprefix_) else ''
+ del_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='del', pretty_print=pretty_print)
+ for ins_ in self.ins:
+ namespaceprefix_ = self.ins_nsprefix_ + ':' if (UseCapturedNS_ and self.ins_nsprefix_) else ''
+ ins_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ins', pretty_print=pretty_print)
+ for htmlonly_ in self.htmlonly:
+ namespaceprefix_ = self.htmlonly_nsprefix_ + ':' if (UseCapturedNS_ and self.htmlonly_nsprefix_) else ''
+ htmlonly_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='htmlonly', pretty_print=pretty_print)
+ for manonly_ in self.manonly:
+ namespaceprefix_ = self.manonly_nsprefix_ + ':' if (UseCapturedNS_ and self.manonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%smanonly>%s</%smanonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(manonly_), input_name='manonly')), namespaceprefix_ , eol_))
+ for xmlonly_ in self.xmlonly:
+ namespaceprefix_ = self.xmlonly_nsprefix_ + ':' if (UseCapturedNS_ and self.xmlonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sxmlonly>%s</%sxmlonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(xmlonly_), input_name='xmlonly')), namespaceprefix_ , eol_))
+ for rtfonly_ in self.rtfonly:
+ namespaceprefix_ = self.rtfonly_nsprefix_ + ':' if (UseCapturedNS_ and self.rtfonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%srtfonly>%s</%srtfonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(rtfonly_), input_name='rtfonly')), namespaceprefix_ , eol_))
+ for latexonly_ in self.latexonly:
+ namespaceprefix_ = self.latexonly_nsprefix_ + ':' if (UseCapturedNS_ and self.latexonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%slatexonly>%s</%slatexonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(latexonly_), input_name='latexonly')), namespaceprefix_ , eol_))
+ for docbookonly_ in self.docbookonly:
+ namespaceprefix_ = self.docbookonly_nsprefix_ + ':' if (UseCapturedNS_ and self.docbookonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sdocbookonly>%s</%sdocbookonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(docbookonly_), input_name='docbookonly')), namespaceprefix_ , eol_))
+ for image_ in self.image:
+ namespaceprefix_ = self.image_nsprefix_ + ':' if (UseCapturedNS_ and self.image_nsprefix_) else ''
+ image_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='image', pretty_print=pretty_print)
+ for dot_ in self.dot:
+ namespaceprefix_ = self.dot_nsprefix_ + ':' if (UseCapturedNS_ and self.dot_nsprefix_) else ''
+ dot_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='dot', pretty_print=pretty_print)
+ for msc_ in self.msc:
+ namespaceprefix_ = self.msc_nsprefix_ + ':' if (UseCapturedNS_ and self.msc_nsprefix_) else ''
+ msc_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='msc', pretty_print=pretty_print)
+ for plantuml_ in self.plantuml:
+ namespaceprefix_ = self.plantuml_nsprefix_ + ':' if (UseCapturedNS_ and self.plantuml_nsprefix_) else ''
+ plantuml_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='plantuml', pretty_print=pretty_print)
+ for anchor_ in self.anchor:
+ namespaceprefix_ = self.anchor_nsprefix_ + ':' if (UseCapturedNS_ and self.anchor_nsprefix_) else ''
+ anchor_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='anchor', pretty_print=pretty_print)
+ for formula_ in self.formula:
+ namespaceprefix_ = self.formula_nsprefix_ + ':' if (UseCapturedNS_ and self.formula_nsprefix_) else ''
+ formula_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='formula', pretty_print=pretty_print)
+ for ref_ in self.ref:
+ namespaceprefix_ = self.ref_nsprefix_ + ':' if (UseCapturedNS_ and self.ref_nsprefix_) else ''
+ ref_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ref', pretty_print=pretty_print)
+ for emoji_ in self.emoji:
+ namespaceprefix_ = self.emoji_nsprefix_ + ':' if (UseCapturedNS_ and self.emoji_nsprefix_) else ''
+ emoji_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='emoji', pretty_print=pretty_print)
+ for linebreak_ in self.linebreak:
+ namespaceprefix_ = self.linebreak_nsprefix_ + ':' if (UseCapturedNS_ and self.linebreak_nsprefix_) else ''
+ linebreak_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='linebreak', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'ulink':
+ obj_ = docURLLink.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ulink', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ulink'):
+ self.add_ulink(obj_.value)
+ elif hasattr(self, 'set_ulink'):
+ self.set_ulink(obj_.value)
+ elif nodeName_ == 'bold':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'bold', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_bold'):
+ self.add_bold(obj_.value)
+ elif hasattr(self, 'set_bold'):
+ self.set_bold(obj_.value)
+ elif nodeName_ == 's':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 's', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_s'):
+ self.add_s(obj_.value)
+ elif hasattr(self, 'set_s'):
+ self.set_s(obj_.value)
+ elif nodeName_ == 'strike':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'strike', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_strike'):
+ self.add_strike(obj_.value)
+ elif hasattr(self, 'set_strike'):
+ self.set_strike(obj_.value)
+ elif nodeName_ == 'underline':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'underline', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_underline'):
+ self.add_underline(obj_.value)
+ elif hasattr(self, 'set_underline'):
+ self.set_underline(obj_.value)
+ elif nodeName_ == 'emphasis':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'emphasis', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_emphasis'):
+ self.add_emphasis(obj_.value)
+ elif hasattr(self, 'set_emphasis'):
+ self.set_emphasis(obj_.value)
+ elif nodeName_ == 'computeroutput':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'computeroutput', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_computeroutput'):
+ self.add_computeroutput(obj_.value)
+ elif hasattr(self, 'set_computeroutput'):
+ self.set_computeroutput(obj_.value)
+ elif nodeName_ == 'subscript':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'subscript', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_subscript'):
+ self.add_subscript(obj_.value)
+ elif hasattr(self, 'set_subscript'):
+ self.set_subscript(obj_.value)
+ elif nodeName_ == 'superscript':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'superscript', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_superscript'):
+ self.add_superscript(obj_.value)
+ elif hasattr(self, 'set_superscript'):
+ self.set_superscript(obj_.value)
+ elif nodeName_ == 'center':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'center', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_center'):
+ self.add_center(obj_.value)
+ elif hasattr(self, 'set_center'):
+ self.set_center(obj_.value)
+ elif nodeName_ == 'small':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'small', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_small'):
+ self.add_small(obj_.value)
+ elif hasattr(self, 'set_small'):
+ self.set_small(obj_.value)
+ elif nodeName_ == 'del':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'del', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_del'):
+ self.add_del(obj_.value)
+ elif hasattr(self, 'set_del'):
+ self.set_del(obj_.value)
+ elif nodeName_ == 'ins':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ins', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ins'):
+ self.add_ins(obj_.value)
+ elif hasattr(self, 'set_ins'):
+ self.set_ins(obj_.value)
+ elif nodeName_ == 'htmlonly':
+ obj_ = docHtmlOnlyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'htmlonly', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_htmlonly'):
+ self.add_htmlonly(obj_.value)
+ elif hasattr(self, 'set_htmlonly'):
+ self.set_htmlonly(obj_.value)
+ elif nodeName_ == 'manonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'manonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'manonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'manonly', valuestr_)
+ self.content_.append(obj_)
+ self.manonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'xmlonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'xmlonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'xmlonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'xmlonly', valuestr_)
+ self.content_.append(obj_)
+ self.xmlonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'rtfonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'rtfonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'rtfonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'rtfonly', valuestr_)
+ self.content_.append(obj_)
+ self.rtfonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'latexonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'latexonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'latexonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'latexonly', valuestr_)
+ self.content_.append(obj_)
+ self.latexonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'docbookonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'docbookonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'docbookonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'docbookonly', valuestr_)
+ self.content_.append(obj_)
+ self.docbookonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'image':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'image', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_image'):
+ self.add_image(obj_.value)
+ elif hasattr(self, 'set_image'):
+ self.set_image(obj_.value)
+ elif nodeName_ == 'dot':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'dot', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_dot'):
+ self.add_dot(obj_.value)
+ elif hasattr(self, 'set_dot'):
+ self.set_dot(obj_.value)
+ elif nodeName_ == 'msc':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'msc', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_msc'):
+ self.add_msc(obj_.value)
+ elif hasattr(self, 'set_msc'):
+ self.set_msc(obj_.value)
+ elif nodeName_ == 'plantuml':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'plantuml', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_plantuml'):
+ self.add_plantuml(obj_.value)
+ elif hasattr(self, 'set_plantuml'):
+ self.set_plantuml(obj_.value)
+ elif nodeName_ == 'anchor':
+ obj_ = docAnchorType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'anchor', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_anchor'):
+ self.add_anchor(obj_.value)
+ elif hasattr(self, 'set_anchor'):
+ self.set_anchor(obj_.value)
+ elif nodeName_ == 'formula':
+ obj_ = docFormulaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'formula', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_formula'):
+ self.add_formula(obj_.value)
+ elif hasattr(self, 'set_formula'):
+ self.set_formula(obj_.value)
+ elif nodeName_ == 'ref':
+ obj_ = docRefTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ref', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ref'):
+ self.add_ref(obj_.value)
+ elif hasattr(self, 'set_ref'):
+ self.set_ref(obj_.value)
+ elif nodeName_ == 'emoji':
+ obj_ = docEmojiType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'emoji', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_emoji'):
+ self.add_emoji(obj_.value)
+ elif hasattr(self, 'set_emoji'):
+ self.set_emoji(obj_.value)
+ elif nodeName_ == 'linebreak':
+ obj_ = docEmptyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'linebreak', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_linebreak'):
+ self.add_linebreak(obj_.value)
+ elif hasattr(self, 'set_linebreak'):
+ self.set_linebreak(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docTitleType
+
+
+class docParaType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, ulink=None, bold=None, s=None, strike=None, underline=None, emphasis=None, computeroutput=None, subscript=None, superscript=None, center=None, small=None, del_=None, ins=None, htmlonly=None, manonly=None, xmlonly=None, rtfonly=None, latexonly=None, docbookonly=None, image=None, dot=None, msc=None, plantuml=None, anchor=None, formula=None, ref=None, emoji=None, linebreak=None, hruler=None, preformatted=None, programlisting=None, verbatim=None, indexentry=None, orderedlist=None, itemizedlist=None, simplesect=None, title=None, variablelist=None, table=None, heading=None, dotfile=None, mscfile=None, diafile=None, toclist=None, language=None, parameterlist=None, xrefsect=None, copydoc=None, blockquote=None, parblock=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if ulink is None:
+ self.ulink = []
+ else:
+ self.ulink = ulink
+ self.ulink_nsprefix_ = None
+ if bold is None:
+ self.bold = []
+ else:
+ self.bold = bold
+ self.bold_nsprefix_ = None
+ if s is None:
+ self.s = []
+ else:
+ self.s = s
+ self.s_nsprefix_ = None
+ if strike is None:
+ self.strike = []
+ else:
+ self.strike = strike
+ self.strike_nsprefix_ = None
+ if underline is None:
+ self.underline = []
+ else:
+ self.underline = underline
+ self.underline_nsprefix_ = None
+ if emphasis is None:
+ self.emphasis = []
+ else:
+ self.emphasis = emphasis
+ self.emphasis_nsprefix_ = None
+ if computeroutput is None:
+ self.computeroutput = []
+ else:
+ self.computeroutput = computeroutput
+ self.computeroutput_nsprefix_ = None
+ if subscript is None:
+ self.subscript = []
+ else:
+ self.subscript = subscript
+ self.subscript_nsprefix_ = None
+ if superscript is None:
+ self.superscript = []
+ else:
+ self.superscript = superscript
+ self.superscript_nsprefix_ = None
+ if center is None:
+ self.center = []
+ else:
+ self.center = center
+ self.center_nsprefix_ = None
+ if small is None:
+ self.small = []
+ else:
+ self.small = small
+ self.small_nsprefix_ = None
+ if del_ is None:
+ self.del_ = []
+ else:
+ self.del_ = del_
+ self.del__nsprefix_ = None
+ if ins is None:
+ self.ins = []
+ else:
+ self.ins = ins
+ self.ins_nsprefix_ = None
+ if htmlonly is None:
+ self.htmlonly = []
+ else:
+ self.htmlonly = htmlonly
+ self.htmlonly_nsprefix_ = None
+ if manonly is None:
+ self.manonly = []
+ else:
+ self.manonly = manonly
+ self.manonly_nsprefix_ = None
+ if xmlonly is None:
+ self.xmlonly = []
+ else:
+ self.xmlonly = xmlonly
+ self.xmlonly_nsprefix_ = None
+ if rtfonly is None:
+ self.rtfonly = []
+ else:
+ self.rtfonly = rtfonly
+ self.rtfonly_nsprefix_ = None
+ if latexonly is None:
+ self.latexonly = []
+ else:
+ self.latexonly = latexonly
+ self.latexonly_nsprefix_ = None
+ if docbookonly is None:
+ self.docbookonly = []
+ else:
+ self.docbookonly = docbookonly
+ self.docbookonly_nsprefix_ = None
+ if image is None:
+ self.image = []
+ else:
+ self.image = image
+ self.image_nsprefix_ = None
+ if dot is None:
+ self.dot = []
+ else:
+ self.dot = dot
+ self.dot_nsprefix_ = None
+ if msc is None:
+ self.msc = []
+ else:
+ self.msc = msc
+ self.msc_nsprefix_ = None
+ if plantuml is None:
+ self.plantuml = []
+ else:
+ self.plantuml = plantuml
+ self.plantuml_nsprefix_ = None
+ if anchor is None:
+ self.anchor = []
+ else:
+ self.anchor = anchor
+ self.anchor_nsprefix_ = None
+ if formula is None:
+ self.formula = []
+ else:
+ self.formula = formula
+ self.formula_nsprefix_ = None
+ if ref is None:
+ self.ref = []
+ else:
+ self.ref = ref
+ self.ref_nsprefix_ = None
+ if emoji is None:
+ self.emoji = []
+ else:
+ self.emoji = emoji
+ self.emoji_nsprefix_ = None
+ if linebreak is None:
+ self.linebreak = []
+ else:
+ self.linebreak = linebreak
+ self.linebreak_nsprefix_ = None
+ if hruler is None:
+ self.hruler = []
+ else:
+ self.hruler = hruler
+ self.hruler_nsprefix_ = None
+ if preformatted is None:
+ self.preformatted = []
+ else:
+ self.preformatted = preformatted
+ self.preformatted_nsprefix_ = None
+ if programlisting is None:
+ self.programlisting = []
+ else:
+ self.programlisting = programlisting
+ self.programlisting_nsprefix_ = None
+ if verbatim is None:
+ self.verbatim = []
+ else:
+ self.verbatim = verbatim
+ self.verbatim_nsprefix_ = None
+ if indexentry is None:
+ self.indexentry = []
+ else:
+ self.indexentry = indexentry
+ self.indexentry_nsprefix_ = None
+ if orderedlist is None:
+ self.orderedlist = []
+ else:
+ self.orderedlist = orderedlist
+ self.orderedlist_nsprefix_ = None
+ if itemizedlist is None:
+ self.itemizedlist = []
+ else:
+ self.itemizedlist = itemizedlist
+ self.itemizedlist_nsprefix_ = None
+ if simplesect is None:
+ self.simplesect = []
+ else:
+ self.simplesect = simplesect
+ self.simplesect_nsprefix_ = None
+ if title is None:
+ self.title = []
+ else:
+ self.title = title
+ self.title_nsprefix_ = None
+ if variablelist is None:
+ self.variablelist = []
+ else:
+ self.variablelist = variablelist
+ self.variablelist_nsprefix_ = None
+ if table is None:
+ self.table = []
+ else:
+ self.table = table
+ self.table_nsprefix_ = None
+ if heading is None:
+ self.heading = []
+ else:
+ self.heading = heading
+ self.heading_nsprefix_ = None
+ if dotfile is None:
+ self.dotfile = []
+ else:
+ self.dotfile = dotfile
+ self.dotfile_nsprefix_ = None
+ if mscfile is None:
+ self.mscfile = []
+ else:
+ self.mscfile = mscfile
+ self.mscfile_nsprefix_ = None
+ if diafile is None:
+ self.diafile = []
+ else:
+ self.diafile = diafile
+ self.diafile_nsprefix_ = None
+ if toclist is None:
+ self.toclist = []
+ else:
+ self.toclist = toclist
+ self.toclist_nsprefix_ = None
+ if language is None:
+ self.language = []
+ else:
+ self.language = language
+ self.language_nsprefix_ = None
+ if parameterlist is None:
+ self.parameterlist = []
+ else:
+ self.parameterlist = parameterlist
+ self.parameterlist_nsprefix_ = None
+ if xrefsect is None:
+ self.xrefsect = []
+ else:
+ self.xrefsect = xrefsect
+ self.xrefsect_nsprefix_ = None
+ if copydoc is None:
+ self.copydoc = []
+ else:
+ self.copydoc = copydoc
+ self.copydoc_nsprefix_ = None
+ if blockquote is None:
+ self.blockquote = []
+ else:
+ self.blockquote = blockquote
+ self.blockquote_nsprefix_ = None
+ if parblock is None:
+ self.parblock = []
+ else:
+ self.parblock = parblock
+ self.parblock_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docParaType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docParaType.subclass:
+ return docParaType.subclass(*args_, **kwargs_)
+ else:
+ return docParaType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_ulink(self):
+ return self.ulink
+ def set_ulink(self, ulink):
+ self.ulink = ulink
+ def add_ulink(self, value):
+ self.ulink.append(value)
+ def insert_ulink_at(self, index, value):
+ self.ulink.insert(index, value)
+ def replace_ulink_at(self, index, value):
+ self.ulink[index] = value
+ def get_bold(self):
+ return self.bold
+ def set_bold(self, bold):
+ self.bold = bold
+ def add_bold(self, value):
+ self.bold.append(value)
+ def insert_bold_at(self, index, value):
+ self.bold.insert(index, value)
+ def replace_bold_at(self, index, value):
+ self.bold[index] = value
+ def get_s(self):
+ return self.s
+ def set_s(self, s):
+ self.s = s
+ def add_s(self, value):
+ self.s.append(value)
+ def insert_s_at(self, index, value):
+ self.s.insert(index, value)
+ def replace_s_at(self, index, value):
+ self.s[index] = value
+ def get_strike(self):
+ return self.strike
+ def set_strike(self, strike):
+ self.strike = strike
+ def add_strike(self, value):
+ self.strike.append(value)
+ def insert_strike_at(self, index, value):
+ self.strike.insert(index, value)
+ def replace_strike_at(self, index, value):
+ self.strike[index] = value
+ def get_underline(self):
+ return self.underline
+ def set_underline(self, underline):
+ self.underline = underline
+ def add_underline(self, value):
+ self.underline.append(value)
+ def insert_underline_at(self, index, value):
+ self.underline.insert(index, value)
+ def replace_underline_at(self, index, value):
+ self.underline[index] = value
+ def get_emphasis(self):
+ return self.emphasis
+ def set_emphasis(self, emphasis):
+ self.emphasis = emphasis
+ def add_emphasis(self, value):
+ self.emphasis.append(value)
+ def insert_emphasis_at(self, index, value):
+ self.emphasis.insert(index, value)
+ def replace_emphasis_at(self, index, value):
+ self.emphasis[index] = value
+ def get_computeroutput(self):
+ return self.computeroutput
+ def set_computeroutput(self, computeroutput):
+ self.computeroutput = computeroutput
+ def add_computeroutput(self, value):
+ self.computeroutput.append(value)
+ def insert_computeroutput_at(self, index, value):
+ self.computeroutput.insert(index, value)
+ def replace_computeroutput_at(self, index, value):
+ self.computeroutput[index] = value
+ def get_subscript(self):
+ return self.subscript
+ def set_subscript(self, subscript):
+ self.subscript = subscript
+ def add_subscript(self, value):
+ self.subscript.append(value)
+ def insert_subscript_at(self, index, value):
+ self.subscript.insert(index, value)
+ def replace_subscript_at(self, index, value):
+ self.subscript[index] = value
+ def get_superscript(self):
+ return self.superscript
+ def set_superscript(self, superscript):
+ self.superscript = superscript
+ def add_superscript(self, value):
+ self.superscript.append(value)
+ def insert_superscript_at(self, index, value):
+ self.superscript.insert(index, value)
+ def replace_superscript_at(self, index, value):
+ self.superscript[index] = value
+ def get_center(self):
+ return self.center
+ def set_center(self, center):
+ self.center = center
+ def add_center(self, value):
+ self.center.append(value)
+ def insert_center_at(self, index, value):
+ self.center.insert(index, value)
+ def replace_center_at(self, index, value):
+ self.center[index] = value
+ def get_small(self):
+ return self.small
+ def set_small(self, small):
+ self.small = small
+ def add_small(self, value):
+ self.small.append(value)
+ def insert_small_at(self, index, value):
+ self.small.insert(index, value)
+ def replace_small_at(self, index, value):
+ self.small[index] = value
+ def get_del(self):
+ return self.del_
+ def set_del(self, del_):
+ self.del_ = del_
+ def add_del(self, value):
+ self.del_.append(value)
+ def insert_del_at(self, index, value):
+ self.del_.insert(index, value)
+ def replace_del_at(self, index, value):
+ self.del_[index] = value
+ def get_ins(self):
+ return self.ins
+ def set_ins(self, ins):
+ self.ins = ins
+ def add_ins(self, value):
+ self.ins.append(value)
+ def insert_ins_at(self, index, value):
+ self.ins.insert(index, value)
+ def replace_ins_at(self, index, value):
+ self.ins[index] = value
+ def get_htmlonly(self):
+ return self.htmlonly
+ def set_htmlonly(self, htmlonly):
+ self.htmlonly = htmlonly
+ def add_htmlonly(self, value):
+ self.htmlonly.append(value)
+ def insert_htmlonly_at(self, index, value):
+ self.htmlonly.insert(index, value)
+ def replace_htmlonly_at(self, index, value):
+ self.htmlonly[index] = value
+ def get_manonly(self):
+ return self.manonly
+ def set_manonly(self, manonly):
+ self.manonly = manonly
+ def add_manonly(self, value):
+ self.manonly.append(value)
+ def insert_manonly_at(self, index, value):
+ self.manonly.insert(index, value)
+ def replace_manonly_at(self, index, value):
+ self.manonly[index] = value
+ def get_xmlonly(self):
+ return self.xmlonly
+ def set_xmlonly(self, xmlonly):
+ self.xmlonly = xmlonly
+ def add_xmlonly(self, value):
+ self.xmlonly.append(value)
+ def insert_xmlonly_at(self, index, value):
+ self.xmlonly.insert(index, value)
+ def replace_xmlonly_at(self, index, value):
+ self.xmlonly[index] = value
+ def get_rtfonly(self):
+ return self.rtfonly
+ def set_rtfonly(self, rtfonly):
+ self.rtfonly = rtfonly
+ def add_rtfonly(self, value):
+ self.rtfonly.append(value)
+ def insert_rtfonly_at(self, index, value):
+ self.rtfonly.insert(index, value)
+ def replace_rtfonly_at(self, index, value):
+ self.rtfonly[index] = value
+ def get_latexonly(self):
+ return self.latexonly
+ def set_latexonly(self, latexonly):
+ self.latexonly = latexonly
+ def add_latexonly(self, value):
+ self.latexonly.append(value)
+ def insert_latexonly_at(self, index, value):
+ self.latexonly.insert(index, value)
+ def replace_latexonly_at(self, index, value):
+ self.latexonly[index] = value
+ def get_docbookonly(self):
+ return self.docbookonly
+ def set_docbookonly(self, docbookonly):
+ self.docbookonly = docbookonly
+ def add_docbookonly(self, value):
+ self.docbookonly.append(value)
+ def insert_docbookonly_at(self, index, value):
+ self.docbookonly.insert(index, value)
+ def replace_docbookonly_at(self, index, value):
+ self.docbookonly[index] = value
+ def get_image(self):
+ return self.image
+ def set_image(self, image):
+ self.image = image
+ def add_image(self, value):
+ self.image.append(value)
+ def insert_image_at(self, index, value):
+ self.image.insert(index, value)
+ def replace_image_at(self, index, value):
+ self.image[index] = value
+ def get_dot(self):
+ return self.dot
+ def set_dot(self, dot):
+ self.dot = dot
+ def add_dot(self, value):
+ self.dot.append(value)
+ def insert_dot_at(self, index, value):
+ self.dot.insert(index, value)
+ def replace_dot_at(self, index, value):
+ self.dot[index] = value
+ def get_msc(self):
+ return self.msc
+ def set_msc(self, msc):
+ self.msc = msc
+ def add_msc(self, value):
+ self.msc.append(value)
+ def insert_msc_at(self, index, value):
+ self.msc.insert(index, value)
+ def replace_msc_at(self, index, value):
+ self.msc[index] = value
+ def get_plantuml(self):
+ return self.plantuml
+ def set_plantuml(self, plantuml):
+ self.plantuml = plantuml
+ def add_plantuml(self, value):
+ self.plantuml.append(value)
+ def insert_plantuml_at(self, index, value):
+ self.plantuml.insert(index, value)
+ def replace_plantuml_at(self, index, value):
+ self.plantuml[index] = value
+ def get_anchor(self):
+ return self.anchor
+ def set_anchor(self, anchor):
+ self.anchor = anchor
+ def add_anchor(self, value):
+ self.anchor.append(value)
+ def insert_anchor_at(self, index, value):
+ self.anchor.insert(index, value)
+ def replace_anchor_at(self, index, value):
+ self.anchor[index] = value
+ def get_formula(self):
+ return self.formula
+ def set_formula(self, formula):
+ self.formula = formula
+ def add_formula(self, value):
+ self.formula.append(value)
+ def insert_formula_at(self, index, value):
+ self.formula.insert(index, value)
+ def replace_formula_at(self, index, value):
+ self.formula[index] = value
+ def get_ref(self):
+ return self.ref
+ def set_ref(self, ref):
+ self.ref = ref
+ def add_ref(self, value):
+ self.ref.append(value)
+ def insert_ref_at(self, index, value):
+ self.ref.insert(index, value)
+ def replace_ref_at(self, index, value):
+ self.ref[index] = value
+ def get_emoji(self):
+ return self.emoji
+ def set_emoji(self, emoji):
+ self.emoji = emoji
+ def add_emoji(self, value):
+ self.emoji.append(value)
+ def insert_emoji_at(self, index, value):
+ self.emoji.insert(index, value)
+ def replace_emoji_at(self, index, value):
+ self.emoji[index] = value
+ def get_linebreak(self):
+ return self.linebreak
+ def set_linebreak(self, linebreak):
+ self.linebreak = linebreak
+ def add_linebreak(self, value):
+ self.linebreak.append(value)
+ def insert_linebreak_at(self, index, value):
+ self.linebreak.insert(index, value)
+ def replace_linebreak_at(self, index, value):
+ self.linebreak[index] = value
+ def get_hruler(self):
+ return self.hruler
+ def set_hruler(self, hruler):
+ self.hruler = hruler
+ def add_hruler(self, value):
+ self.hruler.append(value)
+ def insert_hruler_at(self, index, value):
+ self.hruler.insert(index, value)
+ def replace_hruler_at(self, index, value):
+ self.hruler[index] = value
+ def get_preformatted(self):
+ return self.preformatted
+ def set_preformatted(self, preformatted):
+ self.preformatted = preformatted
+ def add_preformatted(self, value):
+ self.preformatted.append(value)
+ def insert_preformatted_at(self, index, value):
+ self.preformatted.insert(index, value)
+ def replace_preformatted_at(self, index, value):
+ self.preformatted[index] = value
+ def get_programlisting(self):
+ return self.programlisting
+ def set_programlisting(self, programlisting):
+ self.programlisting = programlisting
+ def add_programlisting(self, value):
+ self.programlisting.append(value)
+ def insert_programlisting_at(self, index, value):
+ self.programlisting.insert(index, value)
+ def replace_programlisting_at(self, index, value):
+ self.programlisting[index] = value
+ def get_verbatim(self):
+ return self.verbatim
+ def set_verbatim(self, verbatim):
+ self.verbatim = verbatim
+ def add_verbatim(self, value):
+ self.verbatim.append(value)
+ def insert_verbatim_at(self, index, value):
+ self.verbatim.insert(index, value)
+ def replace_verbatim_at(self, index, value):
+ self.verbatim[index] = value
+ def get_indexentry(self):
+ return self.indexentry
+ def set_indexentry(self, indexentry):
+ self.indexentry = indexentry
+ def add_indexentry(self, value):
+ self.indexentry.append(value)
+ def insert_indexentry_at(self, index, value):
+ self.indexentry.insert(index, value)
+ def replace_indexentry_at(self, index, value):
+ self.indexentry[index] = value
+ def get_orderedlist(self):
+ return self.orderedlist
+ def set_orderedlist(self, orderedlist):
+ self.orderedlist = orderedlist
+ def add_orderedlist(self, value):
+ self.orderedlist.append(value)
+ def insert_orderedlist_at(self, index, value):
+ self.orderedlist.insert(index, value)
+ def replace_orderedlist_at(self, index, value):
+ self.orderedlist[index] = value
+ def get_itemizedlist(self):
+ return self.itemizedlist
+ def set_itemizedlist(self, itemizedlist):
+ self.itemizedlist = itemizedlist
+ def add_itemizedlist(self, value):
+ self.itemizedlist.append(value)
+ def insert_itemizedlist_at(self, index, value):
+ self.itemizedlist.insert(index, value)
+ def replace_itemizedlist_at(self, index, value):
+ self.itemizedlist[index] = value
+ def get_simplesect(self):
+ return self.simplesect
+ def set_simplesect(self, simplesect):
+ self.simplesect = simplesect
+ def add_simplesect(self, value):
+ self.simplesect.append(value)
+ def insert_simplesect_at(self, index, value):
+ self.simplesect.insert(index, value)
+ def replace_simplesect_at(self, index, value):
+ self.simplesect[index] = value
+ def get_title(self):
+ return self.title
+ def set_title(self, title):
+ self.title = title
+ def add_title(self, value):
+ self.title.append(value)
+ def insert_title_at(self, index, value):
+ self.title.insert(index, value)
+ def replace_title_at(self, index, value):
+ self.title[index] = value
+ def get_variablelist(self):
+ return self.variablelist
+ def set_variablelist(self, variablelist):
+ self.variablelist = variablelist
+ def add_variablelist(self, value):
+ self.variablelist.append(value)
+ def insert_variablelist_at(self, index, value):
+ self.variablelist.insert(index, value)
+ def replace_variablelist_at(self, index, value):
+ self.variablelist[index] = value
+ def get_table(self):
+ return self.table
+ def set_table(self, table):
+ self.table = table
+ def add_table(self, value):
+ self.table.append(value)
+ def insert_table_at(self, index, value):
+ self.table.insert(index, value)
+ def replace_table_at(self, index, value):
+ self.table[index] = value
+ def get_heading(self):
+ return self.heading
+ def set_heading(self, heading):
+ self.heading = heading
+ def add_heading(self, value):
+ self.heading.append(value)
+ def insert_heading_at(self, index, value):
+ self.heading.insert(index, value)
+ def replace_heading_at(self, index, value):
+ self.heading[index] = value
+ def get_dotfile(self):
+ return self.dotfile
+ def set_dotfile(self, dotfile):
+ self.dotfile = dotfile
+ def add_dotfile(self, value):
+ self.dotfile.append(value)
+ def insert_dotfile_at(self, index, value):
+ self.dotfile.insert(index, value)
+ def replace_dotfile_at(self, index, value):
+ self.dotfile[index] = value
+ def get_mscfile(self):
+ return self.mscfile
+ def set_mscfile(self, mscfile):
+ self.mscfile = mscfile
+ def add_mscfile(self, value):
+ self.mscfile.append(value)
+ def insert_mscfile_at(self, index, value):
+ self.mscfile.insert(index, value)
+ def replace_mscfile_at(self, index, value):
+ self.mscfile[index] = value
+ def get_diafile(self):
+ return self.diafile
+ def set_diafile(self, diafile):
+ self.diafile = diafile
+ def add_diafile(self, value):
+ self.diafile.append(value)
+ def insert_diafile_at(self, index, value):
+ self.diafile.insert(index, value)
+ def replace_diafile_at(self, index, value):
+ self.diafile[index] = value
+ def get_toclist(self):
+ return self.toclist
+ def set_toclist(self, toclist):
+ self.toclist = toclist
+ def add_toclist(self, value):
+ self.toclist.append(value)
+ def insert_toclist_at(self, index, value):
+ self.toclist.insert(index, value)
+ def replace_toclist_at(self, index, value):
+ self.toclist[index] = value
+ def get_language(self):
+ return self.language
+ def set_language(self, language):
+ self.language = language
+ def add_language(self, value):
+ self.language.append(value)
+ def insert_language_at(self, index, value):
+ self.language.insert(index, value)
+ def replace_language_at(self, index, value):
+ self.language[index] = value
+ def get_parameterlist(self):
+ return self.parameterlist
+ def set_parameterlist(self, parameterlist):
+ self.parameterlist = parameterlist
+ def add_parameterlist(self, value):
+ self.parameterlist.append(value)
+ def insert_parameterlist_at(self, index, value):
+ self.parameterlist.insert(index, value)
+ def replace_parameterlist_at(self, index, value):
+ self.parameterlist[index] = value
+ def get_xrefsect(self):
+ return self.xrefsect
+ def set_xrefsect(self, xrefsect):
+ self.xrefsect = xrefsect
+ def add_xrefsect(self, value):
+ self.xrefsect.append(value)
+ def insert_xrefsect_at(self, index, value):
+ self.xrefsect.insert(index, value)
+ def replace_xrefsect_at(self, index, value):
+ self.xrefsect[index] = value
+ def get_copydoc(self):
+ return self.copydoc
+ def set_copydoc(self, copydoc):
+ self.copydoc = copydoc
+ def add_copydoc(self, value):
+ self.copydoc.append(value)
+ def insert_copydoc_at(self, index, value):
+ self.copydoc.insert(index, value)
+ def replace_copydoc_at(self, index, value):
+ self.copydoc[index] = value
+ def get_blockquote(self):
+ return self.blockquote
+ def set_blockquote(self, blockquote):
+ self.blockquote = blockquote
+ def add_blockquote(self, value):
+ self.blockquote.append(value)
+ def insert_blockquote_at(self, index, value):
+ self.blockquote.insert(index, value)
+ def replace_blockquote_at(self, index, value):
+ self.blockquote[index] = value
+ def get_parblock(self):
+ return self.parblock
+ def set_parblock(self, parblock):
+ self.parblock = parblock
+ def add_parblock(self, value):
+ self.parblock.append(value)
+ def insert_parblock_at(self, index, value):
+ self.parblock.insert(index, value)
+ def replace_parblock_at(self, index, value):
+ self.parblock[index] = value
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.ulink or
+ self.bold or
+ self.s or
+ self.strike or
+ self.underline or
+ self.emphasis or
+ self.computeroutput or
+ self.subscript or
+ self.superscript or
+ self.center or
+ self.small or
+ self.del_ or
+ self.ins or
+ self.htmlonly or
+ self.manonly or
+ self.xmlonly or
+ self.rtfonly or
+ self.latexonly or
+ self.docbookonly or
+ self.image or
+ self.dot or
+ self.msc or
+ self.plantuml or
+ self.anchor or
+ self.formula or
+ self.ref or
+ self.emoji or
+ self.linebreak or
+ self.hruler or
+ self.preformatted or
+ self.programlisting or
+ self.verbatim or
+ self.indexentry or
+ self.orderedlist or
+ self.itemizedlist or
+ self.simplesect or
+ self.title or
+ self.variablelist or
+ self.table or
+ self.heading or
+ self.dotfile or
+ self.mscfile or
+ self.diafile or
+ self.toclist or
+ self.language or
+ self.parameterlist or
+ self.xrefsect or
+ self.copydoc or
+ self.blockquote or
+ self.parblock or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docParaType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docParaType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docParaType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docParaType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docParaType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docParaType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docParaType', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for ulink_ in self.ulink:
+ namespaceprefix_ = self.ulink_nsprefix_ + ':' if (UseCapturedNS_ and self.ulink_nsprefix_) else ''
+ ulink_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ulink', pretty_print=pretty_print)
+ for bold_ in self.bold:
+ namespaceprefix_ = self.bold_nsprefix_ + ':' if (UseCapturedNS_ and self.bold_nsprefix_) else ''
+ bold_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='bold', pretty_print=pretty_print)
+ for s_ in self.s:
+ namespaceprefix_ = self.s_nsprefix_ + ':' if (UseCapturedNS_ and self.s_nsprefix_) else ''
+ s_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='s', pretty_print=pretty_print)
+ for strike_ in self.strike:
+ namespaceprefix_ = self.strike_nsprefix_ + ':' if (UseCapturedNS_ and self.strike_nsprefix_) else ''
+ strike_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='strike', pretty_print=pretty_print)
+ for underline_ in self.underline:
+ namespaceprefix_ = self.underline_nsprefix_ + ':' if (UseCapturedNS_ and self.underline_nsprefix_) else ''
+ underline_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='underline', pretty_print=pretty_print)
+ for emphasis_ in self.emphasis:
+ namespaceprefix_ = self.emphasis_nsprefix_ + ':' if (UseCapturedNS_ and self.emphasis_nsprefix_) else ''
+ emphasis_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='emphasis', pretty_print=pretty_print)
+ for computeroutput_ in self.computeroutput:
+ namespaceprefix_ = self.computeroutput_nsprefix_ + ':' if (UseCapturedNS_ and self.computeroutput_nsprefix_) else ''
+ computeroutput_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='computeroutput', pretty_print=pretty_print)
+ for subscript_ in self.subscript:
+ namespaceprefix_ = self.subscript_nsprefix_ + ':' if (UseCapturedNS_ and self.subscript_nsprefix_) else ''
+ subscript_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='subscript', pretty_print=pretty_print)
+ for superscript_ in self.superscript:
+ namespaceprefix_ = self.superscript_nsprefix_ + ':' if (UseCapturedNS_ and self.superscript_nsprefix_) else ''
+ superscript_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='superscript', pretty_print=pretty_print)
+ for center_ in self.center:
+ namespaceprefix_ = self.center_nsprefix_ + ':' if (UseCapturedNS_ and self.center_nsprefix_) else ''
+ center_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='center', pretty_print=pretty_print)
+ for small_ in self.small:
+ namespaceprefix_ = self.small_nsprefix_ + ':' if (UseCapturedNS_ and self.small_nsprefix_) else ''
+ small_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='small', pretty_print=pretty_print)
+ for del_ in self.del_:
+ namespaceprefix_ = self.del__nsprefix_ + ':' if (UseCapturedNS_ and self.del__nsprefix_) else ''
+ del_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='del', pretty_print=pretty_print)
+ for ins_ in self.ins:
+ namespaceprefix_ = self.ins_nsprefix_ + ':' if (UseCapturedNS_ and self.ins_nsprefix_) else ''
+ ins_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ins', pretty_print=pretty_print)
+ for htmlonly_ in self.htmlonly:
+ namespaceprefix_ = self.htmlonly_nsprefix_ + ':' if (UseCapturedNS_ and self.htmlonly_nsprefix_) else ''
+ htmlonly_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='htmlonly', pretty_print=pretty_print)
+ for manonly_ in self.manonly:
+ namespaceprefix_ = self.manonly_nsprefix_ + ':' if (UseCapturedNS_ and self.manonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%smanonly>%s</%smanonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(manonly_), input_name='manonly')), namespaceprefix_ , eol_))
+ for xmlonly_ in self.xmlonly:
+ namespaceprefix_ = self.xmlonly_nsprefix_ + ':' if (UseCapturedNS_ and self.xmlonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sxmlonly>%s</%sxmlonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(xmlonly_), input_name='xmlonly')), namespaceprefix_ , eol_))
+ for rtfonly_ in self.rtfonly:
+ namespaceprefix_ = self.rtfonly_nsprefix_ + ':' if (UseCapturedNS_ and self.rtfonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%srtfonly>%s</%srtfonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(rtfonly_), input_name='rtfonly')), namespaceprefix_ , eol_))
+ for latexonly_ in self.latexonly:
+ namespaceprefix_ = self.latexonly_nsprefix_ + ':' if (UseCapturedNS_ and self.latexonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%slatexonly>%s</%slatexonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(latexonly_), input_name='latexonly')), namespaceprefix_ , eol_))
+ for docbookonly_ in self.docbookonly:
+ namespaceprefix_ = self.docbookonly_nsprefix_ + ':' if (UseCapturedNS_ and self.docbookonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sdocbookonly>%s</%sdocbookonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(docbookonly_), input_name='docbookonly')), namespaceprefix_ , eol_))
+ for image_ in self.image:
+ namespaceprefix_ = self.image_nsprefix_ + ':' if (UseCapturedNS_ and self.image_nsprefix_) else ''
+ image_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='image', pretty_print=pretty_print)
+ for dot_ in self.dot:
+ namespaceprefix_ = self.dot_nsprefix_ + ':' if (UseCapturedNS_ and self.dot_nsprefix_) else ''
+ dot_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='dot', pretty_print=pretty_print)
+ for msc_ in self.msc:
+ namespaceprefix_ = self.msc_nsprefix_ + ':' if (UseCapturedNS_ and self.msc_nsprefix_) else ''
+ msc_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='msc', pretty_print=pretty_print)
+ for plantuml_ in self.plantuml:
+ namespaceprefix_ = self.plantuml_nsprefix_ + ':' if (UseCapturedNS_ and self.plantuml_nsprefix_) else ''
+ plantuml_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='plantuml', pretty_print=pretty_print)
+ for anchor_ in self.anchor:
+ namespaceprefix_ = self.anchor_nsprefix_ + ':' if (UseCapturedNS_ and self.anchor_nsprefix_) else ''
+ anchor_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='anchor', pretty_print=pretty_print)
+ for formula_ in self.formula:
+ namespaceprefix_ = self.formula_nsprefix_ + ':' if (UseCapturedNS_ and self.formula_nsprefix_) else ''
+ formula_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='formula', pretty_print=pretty_print)
+ for ref_ in self.ref:
+ namespaceprefix_ = self.ref_nsprefix_ + ':' if (UseCapturedNS_ and self.ref_nsprefix_) else ''
+ ref_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ref', pretty_print=pretty_print)
+ for emoji_ in self.emoji:
+ namespaceprefix_ = self.emoji_nsprefix_ + ':' if (UseCapturedNS_ and self.emoji_nsprefix_) else ''
+ emoji_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='emoji', pretty_print=pretty_print)
+ for linebreak_ in self.linebreak:
+ namespaceprefix_ = self.linebreak_nsprefix_ + ':' if (UseCapturedNS_ and self.linebreak_nsprefix_) else ''
+ linebreak_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='linebreak', pretty_print=pretty_print)
+ for hruler_ in self.hruler:
+ namespaceprefix_ = self.hruler_nsprefix_ + ':' if (UseCapturedNS_ and self.hruler_nsprefix_) else ''
+ hruler_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='hruler', pretty_print=pretty_print)
+ for preformatted_ in self.preformatted:
+ namespaceprefix_ = self.preformatted_nsprefix_ + ':' if (UseCapturedNS_ and self.preformatted_nsprefix_) else ''
+ preformatted_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='preformatted', pretty_print=pretty_print)
+ for programlisting_ in self.programlisting:
+ namespaceprefix_ = self.programlisting_nsprefix_ + ':' if (UseCapturedNS_ and self.programlisting_nsprefix_) else ''
+ programlisting_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='programlisting', pretty_print=pretty_print)
+ for verbatim_ in self.verbatim:
+ namespaceprefix_ = self.verbatim_nsprefix_ + ':' if (UseCapturedNS_ and self.verbatim_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sverbatim>%s</%sverbatim>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(verbatim_), input_name='verbatim')), namespaceprefix_ , eol_))
+ for indexentry_ in self.indexentry:
+ namespaceprefix_ = self.indexentry_nsprefix_ + ':' if (UseCapturedNS_ and self.indexentry_nsprefix_) else ''
+ indexentry_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='indexentry', pretty_print=pretty_print)
+ for orderedlist_ in self.orderedlist:
+ namespaceprefix_ = self.orderedlist_nsprefix_ + ':' if (UseCapturedNS_ and self.orderedlist_nsprefix_) else ''
+ orderedlist_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='orderedlist', pretty_print=pretty_print)
+ for itemizedlist_ in self.itemizedlist:
+ namespaceprefix_ = self.itemizedlist_nsprefix_ + ':' if (UseCapturedNS_ and self.itemizedlist_nsprefix_) else ''
+ itemizedlist_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='itemizedlist', pretty_print=pretty_print)
+ for simplesect_ in self.simplesect:
+ namespaceprefix_ = self.simplesect_nsprefix_ + ':' if (UseCapturedNS_ and self.simplesect_nsprefix_) else ''
+ simplesect_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='simplesect', pretty_print=pretty_print)
+ for title_ in self.title:
+ namespaceprefix_ = self.title_nsprefix_ + ':' if (UseCapturedNS_ and self.title_nsprefix_) else ''
+ title_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='title', pretty_print=pretty_print)
+ for variablelist_ in self.variablelist:
+ namespaceprefix_ = self.variablelist_nsprefix_ + ':' if (UseCapturedNS_ and self.variablelist_nsprefix_) else ''
+ variablelist_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='variablelist', pretty_print=pretty_print)
+ for table_ in self.table:
+ namespaceprefix_ = self.table_nsprefix_ + ':' if (UseCapturedNS_ and self.table_nsprefix_) else ''
+ table_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='table', pretty_print=pretty_print)
+ for heading_ in self.heading:
+ namespaceprefix_ = self.heading_nsprefix_ + ':' if (UseCapturedNS_ and self.heading_nsprefix_) else ''
+ heading_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='heading', pretty_print=pretty_print)
+ for dotfile_ in self.dotfile:
+ namespaceprefix_ = self.dotfile_nsprefix_ + ':' if (UseCapturedNS_ and self.dotfile_nsprefix_) else ''
+ dotfile_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='dotfile', pretty_print=pretty_print)
+ for mscfile_ in self.mscfile:
+ namespaceprefix_ = self.mscfile_nsprefix_ + ':' if (UseCapturedNS_ and self.mscfile_nsprefix_) else ''
+ mscfile_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='mscfile', pretty_print=pretty_print)
+ for diafile_ in self.diafile:
+ namespaceprefix_ = self.diafile_nsprefix_ + ':' if (UseCapturedNS_ and self.diafile_nsprefix_) else ''
+ diafile_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='diafile', pretty_print=pretty_print)
+ for toclist_ in self.toclist:
+ namespaceprefix_ = self.toclist_nsprefix_ + ':' if (UseCapturedNS_ and self.toclist_nsprefix_) else ''
+ toclist_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='toclist', pretty_print=pretty_print)
+ for language_ in self.language:
+ namespaceprefix_ = self.language_nsprefix_ + ':' if (UseCapturedNS_ and self.language_nsprefix_) else ''
+ language_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='language', pretty_print=pretty_print)
+ for parameterlist_ in self.parameterlist:
+ namespaceprefix_ = self.parameterlist_nsprefix_ + ':' if (UseCapturedNS_ and self.parameterlist_nsprefix_) else ''
+ parameterlist_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='parameterlist', pretty_print=pretty_print)
+ for xrefsect_ in self.xrefsect:
+ namespaceprefix_ = self.xrefsect_nsprefix_ + ':' if (UseCapturedNS_ and self.xrefsect_nsprefix_) else ''
+ xrefsect_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='xrefsect', pretty_print=pretty_print)
+ for copydoc_ in self.copydoc:
+ namespaceprefix_ = self.copydoc_nsprefix_ + ':' if (UseCapturedNS_ and self.copydoc_nsprefix_) else ''
+ copydoc_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='copydoc', pretty_print=pretty_print)
+ for blockquote_ in self.blockquote:
+ namespaceprefix_ = self.blockquote_nsprefix_ + ':' if (UseCapturedNS_ and self.blockquote_nsprefix_) else ''
+ blockquote_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='blockquote', pretty_print=pretty_print)
+ for parblock_ in self.parblock:
+ namespaceprefix_ = self.parblock_nsprefix_ + ':' if (UseCapturedNS_ and self.parblock_nsprefix_) else ''
+ parblock_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='parblock', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'ulink':
+ obj_ = docURLLink.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ulink', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ulink'):
+ self.add_ulink(obj_.value)
+ elif hasattr(self, 'set_ulink'):
+ self.set_ulink(obj_.value)
+ elif nodeName_ == 'bold':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'bold', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_bold'):
+ self.add_bold(obj_.value)
+ elif hasattr(self, 'set_bold'):
+ self.set_bold(obj_.value)
+ elif nodeName_ == 's':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 's', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_s'):
+ self.add_s(obj_.value)
+ elif hasattr(self, 'set_s'):
+ self.set_s(obj_.value)
+ elif nodeName_ == 'strike':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'strike', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_strike'):
+ self.add_strike(obj_.value)
+ elif hasattr(self, 'set_strike'):
+ self.set_strike(obj_.value)
+ elif nodeName_ == 'underline':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'underline', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_underline'):
+ self.add_underline(obj_.value)
+ elif hasattr(self, 'set_underline'):
+ self.set_underline(obj_.value)
+ elif nodeName_ == 'emphasis':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'emphasis', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_emphasis'):
+ self.add_emphasis(obj_.value)
+ elif hasattr(self, 'set_emphasis'):
+ self.set_emphasis(obj_.value)
+ elif nodeName_ == 'computeroutput':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'computeroutput', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_computeroutput'):
+ self.add_computeroutput(obj_.value)
+ elif hasattr(self, 'set_computeroutput'):
+ self.set_computeroutput(obj_.value)
+ elif nodeName_ == 'subscript':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'subscript', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_subscript'):
+ self.add_subscript(obj_.value)
+ elif hasattr(self, 'set_subscript'):
+ self.set_subscript(obj_.value)
+ elif nodeName_ == 'superscript':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'superscript', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_superscript'):
+ self.add_superscript(obj_.value)
+ elif hasattr(self, 'set_superscript'):
+ self.set_superscript(obj_.value)
+ elif nodeName_ == 'center':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'center', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_center'):
+ self.add_center(obj_.value)
+ elif hasattr(self, 'set_center'):
+ self.set_center(obj_.value)
+ elif nodeName_ == 'small':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'small', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_small'):
+ self.add_small(obj_.value)
+ elif hasattr(self, 'set_small'):
+ self.set_small(obj_.value)
+ elif nodeName_ == 'del':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'del', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_del'):
+ self.add_del(obj_.value)
+ elif hasattr(self, 'set_del'):
+ self.set_del(obj_.value)
+ elif nodeName_ == 'ins':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ins', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ins'):
+ self.add_ins(obj_.value)
+ elif hasattr(self, 'set_ins'):
+ self.set_ins(obj_.value)
+ elif nodeName_ == 'htmlonly':
+ obj_ = docHtmlOnlyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'htmlonly', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_htmlonly'):
+ self.add_htmlonly(obj_.value)
+ elif hasattr(self, 'set_htmlonly'):
+ self.set_htmlonly(obj_.value)
+ elif nodeName_ == 'manonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'manonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'manonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'manonly', valuestr_)
+ self.content_.append(obj_)
+ self.manonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'xmlonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'xmlonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'xmlonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'xmlonly', valuestr_)
+ self.content_.append(obj_)
+ self.xmlonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'rtfonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'rtfonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'rtfonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'rtfonly', valuestr_)
+ self.content_.append(obj_)
+ self.rtfonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'latexonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'latexonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'latexonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'latexonly', valuestr_)
+ self.content_.append(obj_)
+ self.latexonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'docbookonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'docbookonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'docbookonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'docbookonly', valuestr_)
+ self.content_.append(obj_)
+ self.docbookonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'image':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'image', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_image'):
+ self.add_image(obj_.value)
+ elif hasattr(self, 'set_image'):
+ self.set_image(obj_.value)
+ elif nodeName_ == 'dot':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'dot', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_dot'):
+ self.add_dot(obj_.value)
+ elif hasattr(self, 'set_dot'):
+ self.set_dot(obj_.value)
+ elif nodeName_ == 'msc':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'msc', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_msc'):
+ self.add_msc(obj_.value)
+ elif hasattr(self, 'set_msc'):
+ self.set_msc(obj_.value)
+ elif nodeName_ == 'plantuml':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'plantuml', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_plantuml'):
+ self.add_plantuml(obj_.value)
+ elif hasattr(self, 'set_plantuml'):
+ self.set_plantuml(obj_.value)
+ elif nodeName_ == 'anchor':
+ obj_ = docAnchorType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'anchor', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_anchor'):
+ self.add_anchor(obj_.value)
+ elif hasattr(self, 'set_anchor'):
+ self.set_anchor(obj_.value)
+ elif nodeName_ == 'formula':
+ obj_ = docFormulaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'formula', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_formula'):
+ self.add_formula(obj_.value)
+ elif hasattr(self, 'set_formula'):
+ self.set_formula(obj_.value)
+ elif nodeName_ == 'ref':
+ obj_ = docRefTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ref', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ref'):
+ self.add_ref(obj_.value)
+ elif hasattr(self, 'set_ref'):
+ self.set_ref(obj_.value)
+ elif nodeName_ == 'emoji':
+ obj_ = docEmojiType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'emoji', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_emoji'):
+ self.add_emoji(obj_.value)
+ elif hasattr(self, 'set_emoji'):
+ self.set_emoji(obj_.value)
+ elif nodeName_ == 'linebreak':
+ obj_ = docEmptyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'linebreak', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_linebreak'):
+ self.add_linebreak(obj_.value)
+ elif hasattr(self, 'set_linebreak'):
+ self.set_linebreak(obj_.value)
+ elif nodeName_ == 'hruler':
+ obj_ = docEmptyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'hruler', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_hruler'):
+ self.add_hruler(obj_.value)
+ elif hasattr(self, 'set_hruler'):
+ self.set_hruler(obj_.value)
+ elif nodeName_ == 'preformatted':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'preformatted', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_preformatted'):
+ self.add_preformatted(obj_.value)
+ elif hasattr(self, 'set_preformatted'):
+ self.set_preformatted(obj_.value)
+ elif nodeName_ == 'programlisting':
+ obj_ = listingType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'programlisting', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_programlisting'):
+ self.add_programlisting(obj_.value)
+ elif hasattr(self, 'set_programlisting'):
+ self.set_programlisting(obj_.value)
+ elif nodeName_ == 'verbatim' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'verbatim')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'verbatim')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'verbatim', valuestr_)
+ self.content_.append(obj_)
+ self.verbatim_nsprefix_ = child_.prefix
+ elif nodeName_ == 'indexentry':
+ obj_ = docIndexEntryType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'indexentry', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_indexentry'):
+ self.add_indexentry(obj_.value)
+ elif hasattr(self, 'set_indexentry'):
+ self.set_indexentry(obj_.value)
+ elif nodeName_ == 'orderedlist':
+ obj_ = docListType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'orderedlist', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_orderedlist'):
+ self.add_orderedlist(obj_.value)
+ elif hasattr(self, 'set_orderedlist'):
+ self.set_orderedlist(obj_.value)
+ elif nodeName_ == 'itemizedlist':
+ obj_ = docListType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'itemizedlist', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_itemizedlist'):
+ self.add_itemizedlist(obj_.value)
+ elif hasattr(self, 'set_itemizedlist'):
+ self.set_itemizedlist(obj_.value)
+ elif nodeName_ == 'simplesect':
+ obj_ = docSimpleSectType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'simplesect', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_simplesect'):
+ self.add_simplesect(obj_.value)
+ elif hasattr(self, 'set_simplesect'):
+ self.set_simplesect(obj_.value)
+ elif nodeName_ == 'title':
+ obj_ = docTitleType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'title', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_title'):
+ self.add_title(obj_.value)
+ elif hasattr(self, 'set_title'):
+ self.set_title(obj_.value)
+ elif nodeName_ == 'variablelist':
+ obj_ = docVariableListType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'variablelist', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_variablelist'):
+ self.add_variablelist(obj_.value)
+ elif hasattr(self, 'set_variablelist'):
+ self.set_variablelist(obj_.value)
+ elif nodeName_ == 'table':
+ obj_ = docTableType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'table', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_table'):
+ self.add_table(obj_.value)
+ elif hasattr(self, 'set_table'):
+ self.set_table(obj_.value)
+ elif nodeName_ == 'heading':
+ obj_ = docHeadingType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'heading', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_heading'):
+ self.add_heading(obj_.value)
+ elif hasattr(self, 'set_heading'):
+ self.set_heading(obj_.value)
+ elif nodeName_ == 'dotfile':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'dotfile', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_dotfile'):
+ self.add_dotfile(obj_.value)
+ elif hasattr(self, 'set_dotfile'):
+ self.set_dotfile(obj_.value)
+ elif nodeName_ == 'mscfile':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'mscfile', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_mscfile'):
+ self.add_mscfile(obj_.value)
+ elif hasattr(self, 'set_mscfile'):
+ self.set_mscfile(obj_.value)
+ elif nodeName_ == 'diafile':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'diafile', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_diafile'):
+ self.add_diafile(obj_.value)
+ elif hasattr(self, 'set_diafile'):
+ self.set_diafile(obj_.value)
+ elif nodeName_ == 'toclist':
+ obj_ = docTocListType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'toclist', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_toclist'):
+ self.add_toclist(obj_.value)
+ elif hasattr(self, 'set_toclist'):
+ self.set_toclist(obj_.value)
+ elif nodeName_ == 'language':
+ obj_ = docLanguageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'language', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_language'):
+ self.add_language(obj_.value)
+ elif hasattr(self, 'set_language'):
+ self.set_language(obj_.value)
+ elif nodeName_ == 'parameterlist':
+ obj_ = docParamListType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'parameterlist', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_parameterlist'):
+ self.add_parameterlist(obj_.value)
+ elif hasattr(self, 'set_parameterlist'):
+ self.set_parameterlist(obj_.value)
+ elif nodeName_ == 'xrefsect':
+ obj_ = docXRefSectType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'xrefsect', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_xrefsect'):
+ self.add_xrefsect(obj_.value)
+ elif hasattr(self, 'set_xrefsect'):
+ self.set_xrefsect(obj_.value)
+ elif nodeName_ == 'copydoc':
+ obj_ = docCopyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'copydoc', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_copydoc'):
+ self.add_copydoc(obj_.value)
+ elif hasattr(self, 'set_copydoc'):
+ self.set_copydoc(obj_.value)
+ elif nodeName_ == 'blockquote':
+ obj_ = docBlockQuoteType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'blockquote', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_blockquote'):
+ self.add_blockquote(obj_.value)
+ elif hasattr(self, 'set_blockquote'):
+ self.set_blockquote(obj_.value)
+ elif nodeName_ == 'parblock':
+ obj_ = docParBlockType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'parblock', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_parblock'):
+ self.add_parblock(obj_.value)
+ elif hasattr(self, 'set_parblock'):
+ self.set_parblock(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docParaType
+
+
+class docMarkupType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, ulink=None, bold=None, s=None, strike=None, underline=None, emphasis=None, computeroutput=None, subscript=None, superscript=None, center=None, small=None, del_=None, ins=None, htmlonly=None, manonly=None, xmlonly=None, rtfonly=None, latexonly=None, docbookonly=None, image=None, dot=None, msc=None, plantuml=None, anchor=None, formula=None, ref=None, emoji=None, linebreak=None, hruler=None, preformatted=None, programlisting=None, verbatim=None, indexentry=None, orderedlist=None, itemizedlist=None, simplesect=None, title=None, variablelist=None, table=None, heading=None, dotfile=None, mscfile=None, diafile=None, toclist=None, language=None, parameterlist=None, xrefsect=None, copydoc=None, blockquote=None, parblock=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if ulink is None:
+ self.ulink = []
+ else:
+ self.ulink = ulink
+ self.ulink_nsprefix_ = None
+ if bold is None:
+ self.bold = []
+ else:
+ self.bold = bold
+ self.bold_nsprefix_ = None
+ if s is None:
+ self.s = []
+ else:
+ self.s = s
+ self.s_nsprefix_ = None
+ if strike is None:
+ self.strike = []
+ else:
+ self.strike = strike
+ self.strike_nsprefix_ = None
+ if underline is None:
+ self.underline = []
+ else:
+ self.underline = underline
+ self.underline_nsprefix_ = None
+ if emphasis is None:
+ self.emphasis = []
+ else:
+ self.emphasis = emphasis
+ self.emphasis_nsprefix_ = None
+ if computeroutput is None:
+ self.computeroutput = []
+ else:
+ self.computeroutput = computeroutput
+ self.computeroutput_nsprefix_ = None
+ if subscript is None:
+ self.subscript = []
+ else:
+ self.subscript = subscript
+ self.subscript_nsprefix_ = None
+ if superscript is None:
+ self.superscript = []
+ else:
+ self.superscript = superscript
+ self.superscript_nsprefix_ = None
+ if center is None:
+ self.center = []
+ else:
+ self.center = center
+ self.center_nsprefix_ = None
+ if small is None:
+ self.small = []
+ else:
+ self.small = small
+ self.small_nsprefix_ = None
+ if del_ is None:
+ self.del_ = []
+ else:
+ self.del_ = del_
+ self.del__nsprefix_ = None
+ if ins is None:
+ self.ins = []
+ else:
+ self.ins = ins
+ self.ins_nsprefix_ = None
+ if htmlonly is None:
+ self.htmlonly = []
+ else:
+ self.htmlonly = htmlonly
+ self.htmlonly_nsprefix_ = None
+ if manonly is None:
+ self.manonly = []
+ else:
+ self.manonly = manonly
+ self.manonly_nsprefix_ = None
+ if xmlonly is None:
+ self.xmlonly = []
+ else:
+ self.xmlonly = xmlonly
+ self.xmlonly_nsprefix_ = None
+ if rtfonly is None:
+ self.rtfonly = []
+ else:
+ self.rtfonly = rtfonly
+ self.rtfonly_nsprefix_ = None
+ if latexonly is None:
+ self.latexonly = []
+ else:
+ self.latexonly = latexonly
+ self.latexonly_nsprefix_ = None
+ if docbookonly is None:
+ self.docbookonly = []
+ else:
+ self.docbookonly = docbookonly
+ self.docbookonly_nsprefix_ = None
+ if image is None:
+ self.image = []
+ else:
+ self.image = image
+ self.image_nsprefix_ = None
+ if dot is None:
+ self.dot = []
+ else:
+ self.dot = dot
+ self.dot_nsprefix_ = None
+ if msc is None:
+ self.msc = []
+ else:
+ self.msc = msc
+ self.msc_nsprefix_ = None
+ if plantuml is None:
+ self.plantuml = []
+ else:
+ self.plantuml = plantuml
+ self.plantuml_nsprefix_ = None
+ if anchor is None:
+ self.anchor = []
+ else:
+ self.anchor = anchor
+ self.anchor_nsprefix_ = None
+ if formula is None:
+ self.formula = []
+ else:
+ self.formula = formula
+ self.formula_nsprefix_ = None
+ if ref is None:
+ self.ref = []
+ else:
+ self.ref = ref
+ self.ref_nsprefix_ = None
+ if emoji is None:
+ self.emoji = []
+ else:
+ self.emoji = emoji
+ self.emoji_nsprefix_ = None
+ if linebreak is None:
+ self.linebreak = []
+ else:
+ self.linebreak = linebreak
+ self.linebreak_nsprefix_ = None
+ if hruler is None:
+ self.hruler = []
+ else:
+ self.hruler = hruler
+ self.hruler_nsprefix_ = None
+ if preformatted is None:
+ self.preformatted = []
+ else:
+ self.preformatted = preformatted
+ self.preformatted_nsprefix_ = None
+ if programlisting is None:
+ self.programlisting = []
+ else:
+ self.programlisting = programlisting
+ self.programlisting_nsprefix_ = None
+ if verbatim is None:
+ self.verbatim = []
+ else:
+ self.verbatim = verbatim
+ self.verbatim_nsprefix_ = None
+ if indexentry is None:
+ self.indexentry = []
+ else:
+ self.indexentry = indexentry
+ self.indexentry_nsprefix_ = None
+ if orderedlist is None:
+ self.orderedlist = []
+ else:
+ self.orderedlist = orderedlist
+ self.orderedlist_nsprefix_ = None
+ if itemizedlist is None:
+ self.itemizedlist = []
+ else:
+ self.itemizedlist = itemizedlist
+ self.itemizedlist_nsprefix_ = None
+ if simplesect is None:
+ self.simplesect = []
+ else:
+ self.simplesect = simplesect
+ self.simplesect_nsprefix_ = None
+ if title is None:
+ self.title = []
+ else:
+ self.title = title
+ self.title_nsprefix_ = None
+ if variablelist is None:
+ self.variablelist = []
+ else:
+ self.variablelist = variablelist
+ self.variablelist_nsprefix_ = None
+ if table is None:
+ self.table = []
+ else:
+ self.table = table
+ self.table_nsprefix_ = None
+ if heading is None:
+ self.heading = []
+ else:
+ self.heading = heading
+ self.heading_nsprefix_ = None
+ if dotfile is None:
+ self.dotfile = []
+ else:
+ self.dotfile = dotfile
+ self.dotfile_nsprefix_ = None
+ if mscfile is None:
+ self.mscfile = []
+ else:
+ self.mscfile = mscfile
+ self.mscfile_nsprefix_ = None
+ if diafile is None:
+ self.diafile = []
+ else:
+ self.diafile = diafile
+ self.diafile_nsprefix_ = None
+ if toclist is None:
+ self.toclist = []
+ else:
+ self.toclist = toclist
+ self.toclist_nsprefix_ = None
+ if language is None:
+ self.language = []
+ else:
+ self.language = language
+ self.language_nsprefix_ = None
+ if parameterlist is None:
+ self.parameterlist = []
+ else:
+ self.parameterlist = parameterlist
+ self.parameterlist_nsprefix_ = None
+ if xrefsect is None:
+ self.xrefsect = []
+ else:
+ self.xrefsect = xrefsect
+ self.xrefsect_nsprefix_ = None
+ if copydoc is None:
+ self.copydoc = []
+ else:
+ self.copydoc = copydoc
+ self.copydoc_nsprefix_ = None
+ if blockquote is None:
+ self.blockquote = []
+ else:
+ self.blockquote = blockquote
+ self.blockquote_nsprefix_ = None
+ if parblock is None:
+ self.parblock = []
+ else:
+ self.parblock = parblock
+ self.parblock_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docMarkupType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docMarkupType.subclass:
+ return docMarkupType.subclass(*args_, **kwargs_)
+ else:
+ return docMarkupType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_ulink(self):
+ return self.ulink
+ def set_ulink(self, ulink):
+ self.ulink = ulink
+ def add_ulink(self, value):
+ self.ulink.append(value)
+ def insert_ulink_at(self, index, value):
+ self.ulink.insert(index, value)
+ def replace_ulink_at(self, index, value):
+ self.ulink[index] = value
+ def get_bold(self):
+ return self.bold
+ def set_bold(self, bold):
+ self.bold = bold
+ def add_bold(self, value):
+ self.bold.append(value)
+ def insert_bold_at(self, index, value):
+ self.bold.insert(index, value)
+ def replace_bold_at(self, index, value):
+ self.bold[index] = value
+ def get_s(self):
+ return self.s
+ def set_s(self, s):
+ self.s = s
+ def add_s(self, value):
+ self.s.append(value)
+ def insert_s_at(self, index, value):
+ self.s.insert(index, value)
+ def replace_s_at(self, index, value):
+ self.s[index] = value
+ def get_strike(self):
+ return self.strike
+ def set_strike(self, strike):
+ self.strike = strike
+ def add_strike(self, value):
+ self.strike.append(value)
+ def insert_strike_at(self, index, value):
+ self.strike.insert(index, value)
+ def replace_strike_at(self, index, value):
+ self.strike[index] = value
+ def get_underline(self):
+ return self.underline
+ def set_underline(self, underline):
+ self.underline = underline
+ def add_underline(self, value):
+ self.underline.append(value)
+ def insert_underline_at(self, index, value):
+ self.underline.insert(index, value)
+ def replace_underline_at(self, index, value):
+ self.underline[index] = value
+ def get_emphasis(self):
+ return self.emphasis
+ def set_emphasis(self, emphasis):
+ self.emphasis = emphasis
+ def add_emphasis(self, value):
+ self.emphasis.append(value)
+ def insert_emphasis_at(self, index, value):
+ self.emphasis.insert(index, value)
+ def replace_emphasis_at(self, index, value):
+ self.emphasis[index] = value
+ def get_computeroutput(self):
+ return self.computeroutput
+ def set_computeroutput(self, computeroutput):
+ self.computeroutput = computeroutput
+ def add_computeroutput(self, value):
+ self.computeroutput.append(value)
+ def insert_computeroutput_at(self, index, value):
+ self.computeroutput.insert(index, value)
+ def replace_computeroutput_at(self, index, value):
+ self.computeroutput[index] = value
+ def get_subscript(self):
+ return self.subscript
+ def set_subscript(self, subscript):
+ self.subscript = subscript
+ def add_subscript(self, value):
+ self.subscript.append(value)
+ def insert_subscript_at(self, index, value):
+ self.subscript.insert(index, value)
+ def replace_subscript_at(self, index, value):
+ self.subscript[index] = value
+ def get_superscript(self):
+ return self.superscript
+ def set_superscript(self, superscript):
+ self.superscript = superscript
+ def add_superscript(self, value):
+ self.superscript.append(value)
+ def insert_superscript_at(self, index, value):
+ self.superscript.insert(index, value)
+ def replace_superscript_at(self, index, value):
+ self.superscript[index] = value
+ def get_center(self):
+ return self.center
+ def set_center(self, center):
+ self.center = center
+ def add_center(self, value):
+ self.center.append(value)
+ def insert_center_at(self, index, value):
+ self.center.insert(index, value)
+ def replace_center_at(self, index, value):
+ self.center[index] = value
+ def get_small(self):
+ return self.small
+ def set_small(self, small):
+ self.small = small
+ def add_small(self, value):
+ self.small.append(value)
+ def insert_small_at(self, index, value):
+ self.small.insert(index, value)
+ def replace_small_at(self, index, value):
+ self.small[index] = value
+ def get_del(self):
+ return self.del_
+ def set_del(self, del_):
+ self.del_ = del_
+ def add_del(self, value):
+ self.del_.append(value)
+ def insert_del_at(self, index, value):
+ self.del_.insert(index, value)
+ def replace_del_at(self, index, value):
+ self.del_[index] = value
+ def get_ins(self):
+ return self.ins
+ def set_ins(self, ins):
+ self.ins = ins
+ def add_ins(self, value):
+ self.ins.append(value)
+ def insert_ins_at(self, index, value):
+ self.ins.insert(index, value)
+ def replace_ins_at(self, index, value):
+ self.ins[index] = value
+ def get_htmlonly(self):
+ return self.htmlonly
+ def set_htmlonly(self, htmlonly):
+ self.htmlonly = htmlonly
+ def add_htmlonly(self, value):
+ self.htmlonly.append(value)
+ def insert_htmlonly_at(self, index, value):
+ self.htmlonly.insert(index, value)
+ def replace_htmlonly_at(self, index, value):
+ self.htmlonly[index] = value
+ def get_manonly(self):
+ return self.manonly
+ def set_manonly(self, manonly):
+ self.manonly = manonly
+ def add_manonly(self, value):
+ self.manonly.append(value)
+ def insert_manonly_at(self, index, value):
+ self.manonly.insert(index, value)
+ def replace_manonly_at(self, index, value):
+ self.manonly[index] = value
+ def get_xmlonly(self):
+ return self.xmlonly
+ def set_xmlonly(self, xmlonly):
+ self.xmlonly = xmlonly
+ def add_xmlonly(self, value):
+ self.xmlonly.append(value)
+ def insert_xmlonly_at(self, index, value):
+ self.xmlonly.insert(index, value)
+ def replace_xmlonly_at(self, index, value):
+ self.xmlonly[index] = value
+ def get_rtfonly(self):
+ return self.rtfonly
+ def set_rtfonly(self, rtfonly):
+ self.rtfonly = rtfonly
+ def add_rtfonly(self, value):
+ self.rtfonly.append(value)
+ def insert_rtfonly_at(self, index, value):
+ self.rtfonly.insert(index, value)
+ def replace_rtfonly_at(self, index, value):
+ self.rtfonly[index] = value
+ def get_latexonly(self):
+ return self.latexonly
+ def set_latexonly(self, latexonly):
+ self.latexonly = latexonly
+ def add_latexonly(self, value):
+ self.latexonly.append(value)
+ def insert_latexonly_at(self, index, value):
+ self.latexonly.insert(index, value)
+ def replace_latexonly_at(self, index, value):
+ self.latexonly[index] = value
+ def get_docbookonly(self):
+ return self.docbookonly
+ def set_docbookonly(self, docbookonly):
+ self.docbookonly = docbookonly
+ def add_docbookonly(self, value):
+ self.docbookonly.append(value)
+ def insert_docbookonly_at(self, index, value):
+ self.docbookonly.insert(index, value)
+ def replace_docbookonly_at(self, index, value):
+ self.docbookonly[index] = value
+ def get_image(self):
+ return self.image
+ def set_image(self, image):
+ self.image = image
+ def add_image(self, value):
+ self.image.append(value)
+ def insert_image_at(self, index, value):
+ self.image.insert(index, value)
+ def replace_image_at(self, index, value):
+ self.image[index] = value
+ def get_dot(self):
+ return self.dot
+ def set_dot(self, dot):
+ self.dot = dot
+ def add_dot(self, value):
+ self.dot.append(value)
+ def insert_dot_at(self, index, value):
+ self.dot.insert(index, value)
+ def replace_dot_at(self, index, value):
+ self.dot[index] = value
+ def get_msc(self):
+ return self.msc
+ def set_msc(self, msc):
+ self.msc = msc
+ def add_msc(self, value):
+ self.msc.append(value)
+ def insert_msc_at(self, index, value):
+ self.msc.insert(index, value)
+ def replace_msc_at(self, index, value):
+ self.msc[index] = value
+ def get_plantuml(self):
+ return self.plantuml
+ def set_plantuml(self, plantuml):
+ self.plantuml = plantuml
+ def add_plantuml(self, value):
+ self.plantuml.append(value)
+ def insert_plantuml_at(self, index, value):
+ self.plantuml.insert(index, value)
+ def replace_plantuml_at(self, index, value):
+ self.plantuml[index] = value
+ def get_anchor(self):
+ return self.anchor
+ def set_anchor(self, anchor):
+ self.anchor = anchor
+ def add_anchor(self, value):
+ self.anchor.append(value)
+ def insert_anchor_at(self, index, value):
+ self.anchor.insert(index, value)
+ def replace_anchor_at(self, index, value):
+ self.anchor[index] = value
+ def get_formula(self):
+ return self.formula
+ def set_formula(self, formula):
+ self.formula = formula
+ def add_formula(self, value):
+ self.formula.append(value)
+ def insert_formula_at(self, index, value):
+ self.formula.insert(index, value)
+ def replace_formula_at(self, index, value):
+ self.formula[index] = value
+ def get_ref(self):
+ return self.ref
+ def set_ref(self, ref):
+ self.ref = ref
+ def add_ref(self, value):
+ self.ref.append(value)
+ def insert_ref_at(self, index, value):
+ self.ref.insert(index, value)
+ def replace_ref_at(self, index, value):
+ self.ref[index] = value
+ def get_emoji(self):
+ return self.emoji
+ def set_emoji(self, emoji):
+ self.emoji = emoji
+ def add_emoji(self, value):
+ self.emoji.append(value)
+ def insert_emoji_at(self, index, value):
+ self.emoji.insert(index, value)
+ def replace_emoji_at(self, index, value):
+ self.emoji[index] = value
+ def get_linebreak(self):
+ return self.linebreak
+ def set_linebreak(self, linebreak):
+ self.linebreak = linebreak
+ def add_linebreak(self, value):
+ self.linebreak.append(value)
+ def insert_linebreak_at(self, index, value):
+ self.linebreak.insert(index, value)
+ def replace_linebreak_at(self, index, value):
+ self.linebreak[index] = value
+ def get_hruler(self):
+ return self.hruler
+ def set_hruler(self, hruler):
+ self.hruler = hruler
+ def add_hruler(self, value):
+ self.hruler.append(value)
+ def insert_hruler_at(self, index, value):
+ self.hruler.insert(index, value)
+ def replace_hruler_at(self, index, value):
+ self.hruler[index] = value
+ def get_preformatted(self):
+ return self.preformatted
+ def set_preformatted(self, preformatted):
+ self.preformatted = preformatted
+ def add_preformatted(self, value):
+ self.preformatted.append(value)
+ def insert_preformatted_at(self, index, value):
+ self.preformatted.insert(index, value)
+ def replace_preformatted_at(self, index, value):
+ self.preformatted[index] = value
+ def get_programlisting(self):
+ return self.programlisting
+ def set_programlisting(self, programlisting):
+ self.programlisting = programlisting
+ def add_programlisting(self, value):
+ self.programlisting.append(value)
+ def insert_programlisting_at(self, index, value):
+ self.programlisting.insert(index, value)
+ def replace_programlisting_at(self, index, value):
+ self.programlisting[index] = value
+ def get_verbatim(self):
+ return self.verbatim
+ def set_verbatim(self, verbatim):
+ self.verbatim = verbatim
+ def add_verbatim(self, value):
+ self.verbatim.append(value)
+ def insert_verbatim_at(self, index, value):
+ self.verbatim.insert(index, value)
+ def replace_verbatim_at(self, index, value):
+ self.verbatim[index] = value
+ def get_indexentry(self):
+ return self.indexentry
+ def set_indexentry(self, indexentry):
+ self.indexentry = indexentry
+ def add_indexentry(self, value):
+ self.indexentry.append(value)
+ def insert_indexentry_at(self, index, value):
+ self.indexentry.insert(index, value)
+ def replace_indexentry_at(self, index, value):
+ self.indexentry[index] = value
+ def get_orderedlist(self):
+ return self.orderedlist
+ def set_orderedlist(self, orderedlist):
+ self.orderedlist = orderedlist
+ def add_orderedlist(self, value):
+ self.orderedlist.append(value)
+ def insert_orderedlist_at(self, index, value):
+ self.orderedlist.insert(index, value)
+ def replace_orderedlist_at(self, index, value):
+ self.orderedlist[index] = value
+ def get_itemizedlist(self):
+ return self.itemizedlist
+ def set_itemizedlist(self, itemizedlist):
+ self.itemizedlist = itemizedlist
+ def add_itemizedlist(self, value):
+ self.itemizedlist.append(value)
+ def insert_itemizedlist_at(self, index, value):
+ self.itemizedlist.insert(index, value)
+ def replace_itemizedlist_at(self, index, value):
+ self.itemizedlist[index] = value
+ def get_simplesect(self):
+ return self.simplesect
+ def set_simplesect(self, simplesect):
+ self.simplesect = simplesect
+ def add_simplesect(self, value):
+ self.simplesect.append(value)
+ def insert_simplesect_at(self, index, value):
+ self.simplesect.insert(index, value)
+ def replace_simplesect_at(self, index, value):
+ self.simplesect[index] = value
+ def get_title(self):
+ return self.title
+ def set_title(self, title):
+ self.title = title
+ def add_title(self, value):
+ self.title.append(value)
+ def insert_title_at(self, index, value):
+ self.title.insert(index, value)
+ def replace_title_at(self, index, value):
+ self.title[index] = value
+ def get_variablelist(self):
+ return self.variablelist
+ def set_variablelist(self, variablelist):
+ self.variablelist = variablelist
+ def add_variablelist(self, value):
+ self.variablelist.append(value)
+ def insert_variablelist_at(self, index, value):
+ self.variablelist.insert(index, value)
+ def replace_variablelist_at(self, index, value):
+ self.variablelist[index] = value
+ def get_table(self):
+ return self.table
+ def set_table(self, table):
+ self.table = table
+ def add_table(self, value):
+ self.table.append(value)
+ def insert_table_at(self, index, value):
+ self.table.insert(index, value)
+ def replace_table_at(self, index, value):
+ self.table[index] = value
+ def get_heading(self):
+ return self.heading
+ def set_heading(self, heading):
+ self.heading = heading
+ def add_heading(self, value):
+ self.heading.append(value)
+ def insert_heading_at(self, index, value):
+ self.heading.insert(index, value)
+ def replace_heading_at(self, index, value):
+ self.heading[index] = value
+ def get_dotfile(self):
+ return self.dotfile
+ def set_dotfile(self, dotfile):
+ self.dotfile = dotfile
+ def add_dotfile(self, value):
+ self.dotfile.append(value)
+ def insert_dotfile_at(self, index, value):
+ self.dotfile.insert(index, value)
+ def replace_dotfile_at(self, index, value):
+ self.dotfile[index] = value
+ def get_mscfile(self):
+ return self.mscfile
+ def set_mscfile(self, mscfile):
+ self.mscfile = mscfile
+ def add_mscfile(self, value):
+ self.mscfile.append(value)
+ def insert_mscfile_at(self, index, value):
+ self.mscfile.insert(index, value)
+ def replace_mscfile_at(self, index, value):
+ self.mscfile[index] = value
+ def get_diafile(self):
+ return self.diafile
+ def set_diafile(self, diafile):
+ self.diafile = diafile
+ def add_diafile(self, value):
+ self.diafile.append(value)
+ def insert_diafile_at(self, index, value):
+ self.diafile.insert(index, value)
+ def replace_diafile_at(self, index, value):
+ self.diafile[index] = value
+ def get_toclist(self):
+ return self.toclist
+ def set_toclist(self, toclist):
+ self.toclist = toclist
+ def add_toclist(self, value):
+ self.toclist.append(value)
+ def insert_toclist_at(self, index, value):
+ self.toclist.insert(index, value)
+ def replace_toclist_at(self, index, value):
+ self.toclist[index] = value
+ def get_language(self):
+ return self.language
+ def set_language(self, language):
+ self.language = language
+ def add_language(self, value):
+ self.language.append(value)
+ def insert_language_at(self, index, value):
+ self.language.insert(index, value)
+ def replace_language_at(self, index, value):
+ self.language[index] = value
+ def get_parameterlist(self):
+ return self.parameterlist
+ def set_parameterlist(self, parameterlist):
+ self.parameterlist = parameterlist
+ def add_parameterlist(self, value):
+ self.parameterlist.append(value)
+ def insert_parameterlist_at(self, index, value):
+ self.parameterlist.insert(index, value)
+ def replace_parameterlist_at(self, index, value):
+ self.parameterlist[index] = value
+ def get_xrefsect(self):
+ return self.xrefsect
+ def set_xrefsect(self, xrefsect):
+ self.xrefsect = xrefsect
+ def add_xrefsect(self, value):
+ self.xrefsect.append(value)
+ def insert_xrefsect_at(self, index, value):
+ self.xrefsect.insert(index, value)
+ def replace_xrefsect_at(self, index, value):
+ self.xrefsect[index] = value
+ def get_copydoc(self):
+ return self.copydoc
+ def set_copydoc(self, copydoc):
+ self.copydoc = copydoc
+ def add_copydoc(self, value):
+ self.copydoc.append(value)
+ def insert_copydoc_at(self, index, value):
+ self.copydoc.insert(index, value)
+ def replace_copydoc_at(self, index, value):
+ self.copydoc[index] = value
+ def get_blockquote(self):
+ return self.blockquote
+ def set_blockquote(self, blockquote):
+ self.blockquote = blockquote
+ def add_blockquote(self, value):
+ self.blockquote.append(value)
+ def insert_blockquote_at(self, index, value):
+ self.blockquote.insert(index, value)
+ def replace_blockquote_at(self, index, value):
+ self.blockquote[index] = value
+ def get_parblock(self):
+ return self.parblock
+ def set_parblock(self, parblock):
+ self.parblock = parblock
+ def add_parblock(self, value):
+ self.parblock.append(value)
+ def insert_parblock_at(self, index, value):
+ self.parblock.insert(index, value)
+ def replace_parblock_at(self, index, value):
+ self.parblock[index] = value
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.ulink or
+ self.bold or
+ self.s or
+ self.strike or
+ self.underline or
+ self.emphasis or
+ self.computeroutput or
+ self.subscript or
+ self.superscript or
+ self.center or
+ self.small or
+ self.del_ or
+ self.ins or
+ self.htmlonly or
+ self.manonly or
+ self.xmlonly or
+ self.rtfonly or
+ self.latexonly or
+ self.docbookonly or
+ self.image or
+ self.dot or
+ self.msc or
+ self.plantuml or
+ self.anchor or
+ self.formula or
+ self.ref or
+ self.emoji or
+ self.linebreak or
+ self.hruler or
+ self.preformatted or
+ self.programlisting or
+ self.verbatim or
+ self.indexentry or
+ self.orderedlist or
+ self.itemizedlist or
+ self.simplesect or
+ self.title or
+ self.variablelist or
+ self.table or
+ self.heading or
+ self.dotfile or
+ self.mscfile or
+ self.diafile or
+ self.toclist or
+ self.language or
+ self.parameterlist or
+ self.xrefsect or
+ self.copydoc or
+ self.blockquote or
+ self.parblock or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docMarkupType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docMarkupType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docMarkupType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docMarkupType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docMarkupType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docMarkupType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docMarkupType', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for ulink_ in self.ulink:
+ namespaceprefix_ = self.ulink_nsprefix_ + ':' if (UseCapturedNS_ and self.ulink_nsprefix_) else ''
+ ulink_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ulink', pretty_print=pretty_print)
+ for bold_ in self.bold:
+ namespaceprefix_ = self.bold_nsprefix_ + ':' if (UseCapturedNS_ and self.bold_nsprefix_) else ''
+ bold_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='bold', pretty_print=pretty_print)
+ for s_ in self.s:
+ namespaceprefix_ = self.s_nsprefix_ + ':' if (UseCapturedNS_ and self.s_nsprefix_) else ''
+ s_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='s', pretty_print=pretty_print)
+ for strike_ in self.strike:
+ namespaceprefix_ = self.strike_nsprefix_ + ':' if (UseCapturedNS_ and self.strike_nsprefix_) else ''
+ strike_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='strike', pretty_print=pretty_print)
+ for underline_ in self.underline:
+ namespaceprefix_ = self.underline_nsprefix_ + ':' if (UseCapturedNS_ and self.underline_nsprefix_) else ''
+ underline_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='underline', pretty_print=pretty_print)
+ for emphasis_ in self.emphasis:
+ namespaceprefix_ = self.emphasis_nsprefix_ + ':' if (UseCapturedNS_ and self.emphasis_nsprefix_) else ''
+ emphasis_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='emphasis', pretty_print=pretty_print)
+ for computeroutput_ in self.computeroutput:
+ namespaceprefix_ = self.computeroutput_nsprefix_ + ':' if (UseCapturedNS_ and self.computeroutput_nsprefix_) else ''
+ computeroutput_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='computeroutput', pretty_print=pretty_print)
+ for subscript_ in self.subscript:
+ namespaceprefix_ = self.subscript_nsprefix_ + ':' if (UseCapturedNS_ and self.subscript_nsprefix_) else ''
+ subscript_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='subscript', pretty_print=pretty_print)
+ for superscript_ in self.superscript:
+ namespaceprefix_ = self.superscript_nsprefix_ + ':' if (UseCapturedNS_ and self.superscript_nsprefix_) else ''
+ superscript_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='superscript', pretty_print=pretty_print)
+ for center_ in self.center:
+ namespaceprefix_ = self.center_nsprefix_ + ':' if (UseCapturedNS_ and self.center_nsprefix_) else ''
+ center_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='center', pretty_print=pretty_print)
+ for small_ in self.small:
+ namespaceprefix_ = self.small_nsprefix_ + ':' if (UseCapturedNS_ and self.small_nsprefix_) else ''
+ small_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='small', pretty_print=pretty_print)
+ for del_ in self.del_:
+ namespaceprefix_ = self.del__nsprefix_ + ':' if (UseCapturedNS_ and self.del__nsprefix_) else ''
+ del_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='del', pretty_print=pretty_print)
+ for ins_ in self.ins:
+ namespaceprefix_ = self.ins_nsprefix_ + ':' if (UseCapturedNS_ and self.ins_nsprefix_) else ''
+ ins_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ins', pretty_print=pretty_print)
+ for htmlonly_ in self.htmlonly:
+ namespaceprefix_ = self.htmlonly_nsprefix_ + ':' if (UseCapturedNS_ and self.htmlonly_nsprefix_) else ''
+ htmlonly_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='htmlonly', pretty_print=pretty_print)
+ for manonly_ in self.manonly:
+ namespaceprefix_ = self.manonly_nsprefix_ + ':' if (UseCapturedNS_ and self.manonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%smanonly>%s</%smanonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(manonly_), input_name='manonly')), namespaceprefix_ , eol_))
+ for xmlonly_ in self.xmlonly:
+ namespaceprefix_ = self.xmlonly_nsprefix_ + ':' if (UseCapturedNS_ and self.xmlonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sxmlonly>%s</%sxmlonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(xmlonly_), input_name='xmlonly')), namespaceprefix_ , eol_))
+ for rtfonly_ in self.rtfonly:
+ namespaceprefix_ = self.rtfonly_nsprefix_ + ':' if (UseCapturedNS_ and self.rtfonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%srtfonly>%s</%srtfonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(rtfonly_), input_name='rtfonly')), namespaceprefix_ , eol_))
+ for latexonly_ in self.latexonly:
+ namespaceprefix_ = self.latexonly_nsprefix_ + ':' if (UseCapturedNS_ and self.latexonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%slatexonly>%s</%slatexonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(latexonly_), input_name='latexonly')), namespaceprefix_ , eol_))
+ for docbookonly_ in self.docbookonly:
+ namespaceprefix_ = self.docbookonly_nsprefix_ + ':' if (UseCapturedNS_ and self.docbookonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sdocbookonly>%s</%sdocbookonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(docbookonly_), input_name='docbookonly')), namespaceprefix_ , eol_))
+ for image_ in self.image:
+ namespaceprefix_ = self.image_nsprefix_ + ':' if (UseCapturedNS_ and self.image_nsprefix_) else ''
+ image_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='image', pretty_print=pretty_print)
+ for dot_ in self.dot:
+ namespaceprefix_ = self.dot_nsprefix_ + ':' if (UseCapturedNS_ and self.dot_nsprefix_) else ''
+ dot_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='dot', pretty_print=pretty_print)
+ for msc_ in self.msc:
+ namespaceprefix_ = self.msc_nsprefix_ + ':' if (UseCapturedNS_ and self.msc_nsprefix_) else ''
+ msc_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='msc', pretty_print=pretty_print)
+ for plantuml_ in self.plantuml:
+ namespaceprefix_ = self.plantuml_nsprefix_ + ':' if (UseCapturedNS_ and self.plantuml_nsprefix_) else ''
+ plantuml_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='plantuml', pretty_print=pretty_print)
+ for anchor_ in self.anchor:
+ namespaceprefix_ = self.anchor_nsprefix_ + ':' if (UseCapturedNS_ and self.anchor_nsprefix_) else ''
+ anchor_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='anchor', pretty_print=pretty_print)
+ for formula_ in self.formula:
+ namespaceprefix_ = self.formula_nsprefix_ + ':' if (UseCapturedNS_ and self.formula_nsprefix_) else ''
+ formula_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='formula', pretty_print=pretty_print)
+ for ref_ in self.ref:
+ namespaceprefix_ = self.ref_nsprefix_ + ':' if (UseCapturedNS_ and self.ref_nsprefix_) else ''
+ ref_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ref', pretty_print=pretty_print)
+ for emoji_ in self.emoji:
+ namespaceprefix_ = self.emoji_nsprefix_ + ':' if (UseCapturedNS_ and self.emoji_nsprefix_) else ''
+ emoji_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='emoji', pretty_print=pretty_print)
+ for linebreak_ in self.linebreak:
+ namespaceprefix_ = self.linebreak_nsprefix_ + ':' if (UseCapturedNS_ and self.linebreak_nsprefix_) else ''
+ linebreak_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='linebreak', pretty_print=pretty_print)
+ for hruler_ in self.hruler:
+ namespaceprefix_ = self.hruler_nsprefix_ + ':' if (UseCapturedNS_ and self.hruler_nsprefix_) else ''
+ hruler_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='hruler', pretty_print=pretty_print)
+ for preformatted_ in self.preformatted:
+ namespaceprefix_ = self.preformatted_nsprefix_ + ':' if (UseCapturedNS_ and self.preformatted_nsprefix_) else ''
+ preformatted_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='preformatted', pretty_print=pretty_print)
+ for programlisting_ in self.programlisting:
+ namespaceprefix_ = self.programlisting_nsprefix_ + ':' if (UseCapturedNS_ and self.programlisting_nsprefix_) else ''
+ programlisting_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='programlisting', pretty_print=pretty_print)
+ for verbatim_ in self.verbatim:
+ namespaceprefix_ = self.verbatim_nsprefix_ + ':' if (UseCapturedNS_ and self.verbatim_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sverbatim>%s</%sverbatim>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(verbatim_), input_name='verbatim')), namespaceprefix_ , eol_))
+ for indexentry_ in self.indexentry:
+ namespaceprefix_ = self.indexentry_nsprefix_ + ':' if (UseCapturedNS_ and self.indexentry_nsprefix_) else ''
+ indexentry_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='indexentry', pretty_print=pretty_print)
+ for orderedlist_ in self.orderedlist:
+ namespaceprefix_ = self.orderedlist_nsprefix_ + ':' if (UseCapturedNS_ and self.orderedlist_nsprefix_) else ''
+ orderedlist_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='orderedlist', pretty_print=pretty_print)
+ for itemizedlist_ in self.itemizedlist:
+ namespaceprefix_ = self.itemizedlist_nsprefix_ + ':' if (UseCapturedNS_ and self.itemizedlist_nsprefix_) else ''
+ itemizedlist_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='itemizedlist', pretty_print=pretty_print)
+ for simplesect_ in self.simplesect:
+ namespaceprefix_ = self.simplesect_nsprefix_ + ':' if (UseCapturedNS_ and self.simplesect_nsprefix_) else ''
+ simplesect_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='simplesect', pretty_print=pretty_print)
+ for title_ in self.title:
+ namespaceprefix_ = self.title_nsprefix_ + ':' if (UseCapturedNS_ and self.title_nsprefix_) else ''
+ title_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='title', pretty_print=pretty_print)
+ for variablelist_ in self.variablelist:
+ namespaceprefix_ = self.variablelist_nsprefix_ + ':' if (UseCapturedNS_ and self.variablelist_nsprefix_) else ''
+ variablelist_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='variablelist', pretty_print=pretty_print)
+ for table_ in self.table:
+ namespaceprefix_ = self.table_nsprefix_ + ':' if (UseCapturedNS_ and self.table_nsprefix_) else ''
+ table_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='table', pretty_print=pretty_print)
+ for heading_ in self.heading:
+ namespaceprefix_ = self.heading_nsprefix_ + ':' if (UseCapturedNS_ and self.heading_nsprefix_) else ''
+ heading_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='heading', pretty_print=pretty_print)
+ for dotfile_ in self.dotfile:
+ namespaceprefix_ = self.dotfile_nsprefix_ + ':' if (UseCapturedNS_ and self.dotfile_nsprefix_) else ''
+ dotfile_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='dotfile', pretty_print=pretty_print)
+ for mscfile_ in self.mscfile:
+ namespaceprefix_ = self.mscfile_nsprefix_ + ':' if (UseCapturedNS_ and self.mscfile_nsprefix_) else ''
+ mscfile_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='mscfile', pretty_print=pretty_print)
+ for diafile_ in self.diafile:
+ namespaceprefix_ = self.diafile_nsprefix_ + ':' if (UseCapturedNS_ and self.diafile_nsprefix_) else ''
+ diafile_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='diafile', pretty_print=pretty_print)
+ for toclist_ in self.toclist:
+ namespaceprefix_ = self.toclist_nsprefix_ + ':' if (UseCapturedNS_ and self.toclist_nsprefix_) else ''
+ toclist_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='toclist', pretty_print=pretty_print)
+ for language_ in self.language:
+ namespaceprefix_ = self.language_nsprefix_ + ':' if (UseCapturedNS_ and self.language_nsprefix_) else ''
+ language_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='language', pretty_print=pretty_print)
+ for parameterlist_ in self.parameterlist:
+ namespaceprefix_ = self.parameterlist_nsprefix_ + ':' if (UseCapturedNS_ and self.parameterlist_nsprefix_) else ''
+ parameterlist_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='parameterlist', pretty_print=pretty_print)
+ for xrefsect_ in self.xrefsect:
+ namespaceprefix_ = self.xrefsect_nsprefix_ + ':' if (UseCapturedNS_ and self.xrefsect_nsprefix_) else ''
+ xrefsect_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='xrefsect', pretty_print=pretty_print)
+ for copydoc_ in self.copydoc:
+ namespaceprefix_ = self.copydoc_nsprefix_ + ':' if (UseCapturedNS_ and self.copydoc_nsprefix_) else ''
+ copydoc_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='copydoc', pretty_print=pretty_print)
+ for blockquote_ in self.blockquote:
+ namespaceprefix_ = self.blockquote_nsprefix_ + ':' if (UseCapturedNS_ and self.blockquote_nsprefix_) else ''
+ blockquote_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='blockquote', pretty_print=pretty_print)
+ for parblock_ in self.parblock:
+ namespaceprefix_ = self.parblock_nsprefix_ + ':' if (UseCapturedNS_ and self.parblock_nsprefix_) else ''
+ parblock_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='parblock', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'ulink':
+ obj_ = docURLLink.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ulink', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ulink'):
+ self.add_ulink(obj_.value)
+ elif hasattr(self, 'set_ulink'):
+ self.set_ulink(obj_.value)
+ elif nodeName_ == 'bold':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'bold', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_bold'):
+ self.add_bold(obj_.value)
+ elif hasattr(self, 'set_bold'):
+ self.set_bold(obj_.value)
+ elif nodeName_ == 's':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 's', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_s'):
+ self.add_s(obj_.value)
+ elif hasattr(self, 'set_s'):
+ self.set_s(obj_.value)
+ elif nodeName_ == 'strike':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'strike', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_strike'):
+ self.add_strike(obj_.value)
+ elif hasattr(self, 'set_strike'):
+ self.set_strike(obj_.value)
+ elif nodeName_ == 'underline':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'underline', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_underline'):
+ self.add_underline(obj_.value)
+ elif hasattr(self, 'set_underline'):
+ self.set_underline(obj_.value)
+ elif nodeName_ == 'emphasis':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'emphasis', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_emphasis'):
+ self.add_emphasis(obj_.value)
+ elif hasattr(self, 'set_emphasis'):
+ self.set_emphasis(obj_.value)
+ elif nodeName_ == 'computeroutput':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'computeroutput', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_computeroutput'):
+ self.add_computeroutput(obj_.value)
+ elif hasattr(self, 'set_computeroutput'):
+ self.set_computeroutput(obj_.value)
+ elif nodeName_ == 'subscript':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'subscript', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_subscript'):
+ self.add_subscript(obj_.value)
+ elif hasattr(self, 'set_subscript'):
+ self.set_subscript(obj_.value)
+ elif nodeName_ == 'superscript':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'superscript', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_superscript'):
+ self.add_superscript(obj_.value)
+ elif hasattr(self, 'set_superscript'):
+ self.set_superscript(obj_.value)
+ elif nodeName_ == 'center':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'center', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_center'):
+ self.add_center(obj_.value)
+ elif hasattr(self, 'set_center'):
+ self.set_center(obj_.value)
+ elif nodeName_ == 'small':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'small', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_small'):
+ self.add_small(obj_.value)
+ elif hasattr(self, 'set_small'):
+ self.set_small(obj_.value)
+ elif nodeName_ == 'del':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'del', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_del'):
+ self.add_del(obj_.value)
+ elif hasattr(self, 'set_del'):
+ self.set_del(obj_.value)
+ elif nodeName_ == 'ins':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ins', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ins'):
+ self.add_ins(obj_.value)
+ elif hasattr(self, 'set_ins'):
+ self.set_ins(obj_.value)
+ elif nodeName_ == 'htmlonly':
+ obj_ = docHtmlOnlyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'htmlonly', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_htmlonly'):
+ self.add_htmlonly(obj_.value)
+ elif hasattr(self, 'set_htmlonly'):
+ self.set_htmlonly(obj_.value)
+ elif nodeName_ == 'manonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'manonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'manonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'manonly', valuestr_)
+ self.content_.append(obj_)
+ self.manonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'xmlonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'xmlonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'xmlonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'xmlonly', valuestr_)
+ self.content_.append(obj_)
+ self.xmlonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'rtfonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'rtfonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'rtfonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'rtfonly', valuestr_)
+ self.content_.append(obj_)
+ self.rtfonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'latexonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'latexonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'latexonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'latexonly', valuestr_)
+ self.content_.append(obj_)
+ self.latexonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'docbookonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'docbookonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'docbookonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'docbookonly', valuestr_)
+ self.content_.append(obj_)
+ self.docbookonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'image':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'image', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_image'):
+ self.add_image(obj_.value)
+ elif hasattr(self, 'set_image'):
+ self.set_image(obj_.value)
+ elif nodeName_ == 'dot':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'dot', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_dot'):
+ self.add_dot(obj_.value)
+ elif hasattr(self, 'set_dot'):
+ self.set_dot(obj_.value)
+ elif nodeName_ == 'msc':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'msc', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_msc'):
+ self.add_msc(obj_.value)
+ elif hasattr(self, 'set_msc'):
+ self.set_msc(obj_.value)
+ elif nodeName_ == 'plantuml':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'plantuml', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_plantuml'):
+ self.add_plantuml(obj_.value)
+ elif hasattr(self, 'set_plantuml'):
+ self.set_plantuml(obj_.value)
+ elif nodeName_ == 'anchor':
+ obj_ = docAnchorType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'anchor', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_anchor'):
+ self.add_anchor(obj_.value)
+ elif hasattr(self, 'set_anchor'):
+ self.set_anchor(obj_.value)
+ elif nodeName_ == 'formula':
+ obj_ = docFormulaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'formula', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_formula'):
+ self.add_formula(obj_.value)
+ elif hasattr(self, 'set_formula'):
+ self.set_formula(obj_.value)
+ elif nodeName_ == 'ref':
+ obj_ = docRefTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ref', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ref'):
+ self.add_ref(obj_.value)
+ elif hasattr(self, 'set_ref'):
+ self.set_ref(obj_.value)
+ elif nodeName_ == 'emoji':
+ obj_ = docEmojiType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'emoji', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_emoji'):
+ self.add_emoji(obj_.value)
+ elif hasattr(self, 'set_emoji'):
+ self.set_emoji(obj_.value)
+ elif nodeName_ == 'linebreak':
+ obj_ = docEmptyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'linebreak', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_linebreak'):
+ self.add_linebreak(obj_.value)
+ elif hasattr(self, 'set_linebreak'):
+ self.set_linebreak(obj_.value)
+ elif nodeName_ == 'hruler':
+ obj_ = docEmptyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'hruler', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_hruler'):
+ self.add_hruler(obj_.value)
+ elif hasattr(self, 'set_hruler'):
+ self.set_hruler(obj_.value)
+ elif nodeName_ == 'preformatted':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'preformatted', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_preformatted'):
+ self.add_preformatted(obj_.value)
+ elif hasattr(self, 'set_preformatted'):
+ self.set_preformatted(obj_.value)
+ elif nodeName_ == 'programlisting':
+ obj_ = listingType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'programlisting', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_programlisting'):
+ self.add_programlisting(obj_.value)
+ elif hasattr(self, 'set_programlisting'):
+ self.set_programlisting(obj_.value)
+ elif nodeName_ == 'verbatim' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'verbatim')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'verbatim')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'verbatim', valuestr_)
+ self.content_.append(obj_)
+ self.verbatim_nsprefix_ = child_.prefix
+ elif nodeName_ == 'indexentry':
+ obj_ = docIndexEntryType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'indexentry', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_indexentry'):
+ self.add_indexentry(obj_.value)
+ elif hasattr(self, 'set_indexentry'):
+ self.set_indexentry(obj_.value)
+ elif nodeName_ == 'orderedlist':
+ obj_ = docListType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'orderedlist', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_orderedlist'):
+ self.add_orderedlist(obj_.value)
+ elif hasattr(self, 'set_orderedlist'):
+ self.set_orderedlist(obj_.value)
+ elif nodeName_ == 'itemizedlist':
+ obj_ = docListType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'itemizedlist', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_itemizedlist'):
+ self.add_itemizedlist(obj_.value)
+ elif hasattr(self, 'set_itemizedlist'):
+ self.set_itemizedlist(obj_.value)
+ elif nodeName_ == 'simplesect':
+ obj_ = docSimpleSectType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'simplesect', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_simplesect'):
+ self.add_simplesect(obj_.value)
+ elif hasattr(self, 'set_simplesect'):
+ self.set_simplesect(obj_.value)
+ elif nodeName_ == 'title':
+ obj_ = docTitleType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'title', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_title'):
+ self.add_title(obj_.value)
+ elif hasattr(self, 'set_title'):
+ self.set_title(obj_.value)
+ elif nodeName_ == 'variablelist':
+ obj_ = docVariableListType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'variablelist', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_variablelist'):
+ self.add_variablelist(obj_.value)
+ elif hasattr(self, 'set_variablelist'):
+ self.set_variablelist(obj_.value)
+ elif nodeName_ == 'table':
+ obj_ = docTableType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'table', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_table'):
+ self.add_table(obj_.value)
+ elif hasattr(self, 'set_table'):
+ self.set_table(obj_.value)
+ elif nodeName_ == 'heading':
+ obj_ = docHeadingType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'heading', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_heading'):
+ self.add_heading(obj_.value)
+ elif hasattr(self, 'set_heading'):
+ self.set_heading(obj_.value)
+ elif nodeName_ == 'dotfile':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'dotfile', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_dotfile'):
+ self.add_dotfile(obj_.value)
+ elif hasattr(self, 'set_dotfile'):
+ self.set_dotfile(obj_.value)
+ elif nodeName_ == 'mscfile':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'mscfile', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_mscfile'):
+ self.add_mscfile(obj_.value)
+ elif hasattr(self, 'set_mscfile'):
+ self.set_mscfile(obj_.value)
+ elif nodeName_ == 'diafile':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'diafile', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_diafile'):
+ self.add_diafile(obj_.value)
+ elif hasattr(self, 'set_diafile'):
+ self.set_diafile(obj_.value)
+ elif nodeName_ == 'toclist':
+ obj_ = docTocListType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'toclist', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_toclist'):
+ self.add_toclist(obj_.value)
+ elif hasattr(self, 'set_toclist'):
+ self.set_toclist(obj_.value)
+ elif nodeName_ == 'language':
+ obj_ = docLanguageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'language', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_language'):
+ self.add_language(obj_.value)
+ elif hasattr(self, 'set_language'):
+ self.set_language(obj_.value)
+ elif nodeName_ == 'parameterlist':
+ obj_ = docParamListType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'parameterlist', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_parameterlist'):
+ self.add_parameterlist(obj_.value)
+ elif hasattr(self, 'set_parameterlist'):
+ self.set_parameterlist(obj_.value)
+ elif nodeName_ == 'xrefsect':
+ obj_ = docXRefSectType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'xrefsect', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_xrefsect'):
+ self.add_xrefsect(obj_.value)
+ elif hasattr(self, 'set_xrefsect'):
+ self.set_xrefsect(obj_.value)
+ elif nodeName_ == 'copydoc':
+ obj_ = docCopyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'copydoc', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_copydoc'):
+ self.add_copydoc(obj_.value)
+ elif hasattr(self, 'set_copydoc'):
+ self.set_copydoc(obj_.value)
+ elif nodeName_ == 'blockquote':
+ obj_ = docBlockQuoteType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'blockquote', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_blockquote'):
+ self.add_blockquote(obj_.value)
+ elif hasattr(self, 'set_blockquote'):
+ self.set_blockquote(obj_.value)
+ elif nodeName_ == 'parblock':
+ obj_ = docParBlockType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'parblock', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_parblock'):
+ self.add_parblock(obj_.value)
+ elif hasattr(self, 'set_parblock'):
+ self.set_parblock(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docMarkupType
+
+
+class docURLLink(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, url=None, ulink=None, bold=None, s=None, strike=None, underline=None, emphasis=None, computeroutput=None, subscript=None, superscript=None, center=None, small=None, del_=None, ins=None, htmlonly=None, manonly=None, xmlonly=None, rtfonly=None, latexonly=None, docbookonly=None, image=None, dot=None, msc=None, plantuml=None, anchor=None, formula=None, ref=None, emoji=None, linebreak=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.url = _cast(None, url)
+ self.url_nsprefix_ = None
+ if ulink is None:
+ self.ulink = []
+ else:
+ self.ulink = ulink
+ self.ulink_nsprefix_ = None
+ if bold is None:
+ self.bold = []
+ else:
+ self.bold = bold
+ self.bold_nsprefix_ = None
+ if s is None:
+ self.s = []
+ else:
+ self.s = s
+ self.s_nsprefix_ = None
+ if strike is None:
+ self.strike = []
+ else:
+ self.strike = strike
+ self.strike_nsprefix_ = None
+ if underline is None:
+ self.underline = []
+ else:
+ self.underline = underline
+ self.underline_nsprefix_ = None
+ if emphasis is None:
+ self.emphasis = []
+ else:
+ self.emphasis = emphasis
+ self.emphasis_nsprefix_ = None
+ if computeroutput is None:
+ self.computeroutput = []
+ else:
+ self.computeroutput = computeroutput
+ self.computeroutput_nsprefix_ = None
+ if subscript is None:
+ self.subscript = []
+ else:
+ self.subscript = subscript
+ self.subscript_nsprefix_ = None
+ if superscript is None:
+ self.superscript = []
+ else:
+ self.superscript = superscript
+ self.superscript_nsprefix_ = None
+ if center is None:
+ self.center = []
+ else:
+ self.center = center
+ self.center_nsprefix_ = None
+ if small is None:
+ self.small = []
+ else:
+ self.small = small
+ self.small_nsprefix_ = None
+ if del_ is None:
+ self.del_ = []
+ else:
+ self.del_ = del_
+ self.del__nsprefix_ = None
+ if ins is None:
+ self.ins = []
+ else:
+ self.ins = ins
+ self.ins_nsprefix_ = None
+ if htmlonly is None:
+ self.htmlonly = []
+ else:
+ self.htmlonly = htmlonly
+ self.htmlonly_nsprefix_ = None
+ if manonly is None:
+ self.manonly = []
+ else:
+ self.manonly = manonly
+ self.manonly_nsprefix_ = None
+ if xmlonly is None:
+ self.xmlonly = []
+ else:
+ self.xmlonly = xmlonly
+ self.xmlonly_nsprefix_ = None
+ if rtfonly is None:
+ self.rtfonly = []
+ else:
+ self.rtfonly = rtfonly
+ self.rtfonly_nsprefix_ = None
+ if latexonly is None:
+ self.latexonly = []
+ else:
+ self.latexonly = latexonly
+ self.latexonly_nsprefix_ = None
+ if docbookonly is None:
+ self.docbookonly = []
+ else:
+ self.docbookonly = docbookonly
+ self.docbookonly_nsprefix_ = None
+ if image is None:
+ self.image = []
+ else:
+ self.image = image
+ self.image_nsprefix_ = None
+ if dot is None:
+ self.dot = []
+ else:
+ self.dot = dot
+ self.dot_nsprefix_ = None
+ if msc is None:
+ self.msc = []
+ else:
+ self.msc = msc
+ self.msc_nsprefix_ = None
+ if plantuml is None:
+ self.plantuml = []
+ else:
+ self.plantuml = plantuml
+ self.plantuml_nsprefix_ = None
+ if anchor is None:
+ self.anchor = []
+ else:
+ self.anchor = anchor
+ self.anchor_nsprefix_ = None
+ if formula is None:
+ self.formula = []
+ else:
+ self.formula = formula
+ self.formula_nsprefix_ = None
+ if ref is None:
+ self.ref = []
+ else:
+ self.ref = ref
+ self.ref_nsprefix_ = None
+ if emoji is None:
+ self.emoji = []
+ else:
+ self.emoji = emoji
+ self.emoji_nsprefix_ = None
+ if linebreak is None:
+ self.linebreak = []
+ else:
+ self.linebreak = linebreak
+ self.linebreak_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docURLLink)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docURLLink.subclass:
+ return docURLLink.subclass(*args_, **kwargs_)
+ else:
+ return docURLLink(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_ulink(self):
+ return self.ulink
+ def set_ulink(self, ulink):
+ self.ulink = ulink
+ def add_ulink(self, value):
+ self.ulink.append(value)
+ def insert_ulink_at(self, index, value):
+ self.ulink.insert(index, value)
+ def replace_ulink_at(self, index, value):
+ self.ulink[index] = value
+ def get_bold(self):
+ return self.bold
+ def set_bold(self, bold):
+ self.bold = bold
+ def add_bold(self, value):
+ self.bold.append(value)
+ def insert_bold_at(self, index, value):
+ self.bold.insert(index, value)
+ def replace_bold_at(self, index, value):
+ self.bold[index] = value
+ def get_s(self):
+ return self.s
+ def set_s(self, s):
+ self.s = s
+ def add_s(self, value):
+ self.s.append(value)
+ def insert_s_at(self, index, value):
+ self.s.insert(index, value)
+ def replace_s_at(self, index, value):
+ self.s[index] = value
+ def get_strike(self):
+ return self.strike
+ def set_strike(self, strike):
+ self.strike = strike
+ def add_strike(self, value):
+ self.strike.append(value)
+ def insert_strike_at(self, index, value):
+ self.strike.insert(index, value)
+ def replace_strike_at(self, index, value):
+ self.strike[index] = value
+ def get_underline(self):
+ return self.underline
+ def set_underline(self, underline):
+ self.underline = underline
+ def add_underline(self, value):
+ self.underline.append(value)
+ def insert_underline_at(self, index, value):
+ self.underline.insert(index, value)
+ def replace_underline_at(self, index, value):
+ self.underline[index] = value
+ def get_emphasis(self):
+ return self.emphasis
+ def set_emphasis(self, emphasis):
+ self.emphasis = emphasis
+ def add_emphasis(self, value):
+ self.emphasis.append(value)
+ def insert_emphasis_at(self, index, value):
+ self.emphasis.insert(index, value)
+ def replace_emphasis_at(self, index, value):
+ self.emphasis[index] = value
+ def get_computeroutput(self):
+ return self.computeroutput
+ def set_computeroutput(self, computeroutput):
+ self.computeroutput = computeroutput
+ def add_computeroutput(self, value):
+ self.computeroutput.append(value)
+ def insert_computeroutput_at(self, index, value):
+ self.computeroutput.insert(index, value)
+ def replace_computeroutput_at(self, index, value):
+ self.computeroutput[index] = value
+ def get_subscript(self):
+ return self.subscript
+ def set_subscript(self, subscript):
+ self.subscript = subscript
+ def add_subscript(self, value):
+ self.subscript.append(value)
+ def insert_subscript_at(self, index, value):
+ self.subscript.insert(index, value)
+ def replace_subscript_at(self, index, value):
+ self.subscript[index] = value
+ def get_superscript(self):
+ return self.superscript
+ def set_superscript(self, superscript):
+ self.superscript = superscript
+ def add_superscript(self, value):
+ self.superscript.append(value)
+ def insert_superscript_at(self, index, value):
+ self.superscript.insert(index, value)
+ def replace_superscript_at(self, index, value):
+ self.superscript[index] = value
+ def get_center(self):
+ return self.center
+ def set_center(self, center):
+ self.center = center
+ def add_center(self, value):
+ self.center.append(value)
+ def insert_center_at(self, index, value):
+ self.center.insert(index, value)
+ def replace_center_at(self, index, value):
+ self.center[index] = value
+ def get_small(self):
+ return self.small
+ def set_small(self, small):
+ self.small = small
+ def add_small(self, value):
+ self.small.append(value)
+ def insert_small_at(self, index, value):
+ self.small.insert(index, value)
+ def replace_small_at(self, index, value):
+ self.small[index] = value
+ def get_del(self):
+ return self.del_
+ def set_del(self, del_):
+ self.del_ = del_
+ def add_del(self, value):
+ self.del_.append(value)
+ def insert_del_at(self, index, value):
+ self.del_.insert(index, value)
+ def replace_del_at(self, index, value):
+ self.del_[index] = value
+ def get_ins(self):
+ return self.ins
+ def set_ins(self, ins):
+ self.ins = ins
+ def add_ins(self, value):
+ self.ins.append(value)
+ def insert_ins_at(self, index, value):
+ self.ins.insert(index, value)
+ def replace_ins_at(self, index, value):
+ self.ins[index] = value
+ def get_htmlonly(self):
+ return self.htmlonly
+ def set_htmlonly(self, htmlonly):
+ self.htmlonly = htmlonly
+ def add_htmlonly(self, value):
+ self.htmlonly.append(value)
+ def insert_htmlonly_at(self, index, value):
+ self.htmlonly.insert(index, value)
+ def replace_htmlonly_at(self, index, value):
+ self.htmlonly[index] = value
+ def get_manonly(self):
+ return self.manonly
+ def set_manonly(self, manonly):
+ self.manonly = manonly
+ def add_manonly(self, value):
+ self.manonly.append(value)
+ def insert_manonly_at(self, index, value):
+ self.manonly.insert(index, value)
+ def replace_manonly_at(self, index, value):
+ self.manonly[index] = value
+ def get_xmlonly(self):
+ return self.xmlonly
+ def set_xmlonly(self, xmlonly):
+ self.xmlonly = xmlonly
+ def add_xmlonly(self, value):
+ self.xmlonly.append(value)
+ def insert_xmlonly_at(self, index, value):
+ self.xmlonly.insert(index, value)
+ def replace_xmlonly_at(self, index, value):
+ self.xmlonly[index] = value
+ def get_rtfonly(self):
+ return self.rtfonly
+ def set_rtfonly(self, rtfonly):
+ self.rtfonly = rtfonly
+ def add_rtfonly(self, value):
+ self.rtfonly.append(value)
+ def insert_rtfonly_at(self, index, value):
+ self.rtfonly.insert(index, value)
+ def replace_rtfonly_at(self, index, value):
+ self.rtfonly[index] = value
+ def get_latexonly(self):
+ return self.latexonly
+ def set_latexonly(self, latexonly):
+ self.latexonly = latexonly
+ def add_latexonly(self, value):
+ self.latexonly.append(value)
+ def insert_latexonly_at(self, index, value):
+ self.latexonly.insert(index, value)
+ def replace_latexonly_at(self, index, value):
+ self.latexonly[index] = value
+ def get_docbookonly(self):
+ return self.docbookonly
+ def set_docbookonly(self, docbookonly):
+ self.docbookonly = docbookonly
+ def add_docbookonly(self, value):
+ self.docbookonly.append(value)
+ def insert_docbookonly_at(self, index, value):
+ self.docbookonly.insert(index, value)
+ def replace_docbookonly_at(self, index, value):
+ self.docbookonly[index] = value
+ def get_image(self):
+ return self.image
+ def set_image(self, image):
+ self.image = image
+ def add_image(self, value):
+ self.image.append(value)
+ def insert_image_at(self, index, value):
+ self.image.insert(index, value)
+ def replace_image_at(self, index, value):
+ self.image[index] = value
+ def get_dot(self):
+ return self.dot
+ def set_dot(self, dot):
+ self.dot = dot
+ def add_dot(self, value):
+ self.dot.append(value)
+ def insert_dot_at(self, index, value):
+ self.dot.insert(index, value)
+ def replace_dot_at(self, index, value):
+ self.dot[index] = value
+ def get_msc(self):
+ return self.msc
+ def set_msc(self, msc):
+ self.msc = msc
+ def add_msc(self, value):
+ self.msc.append(value)
+ def insert_msc_at(self, index, value):
+ self.msc.insert(index, value)
+ def replace_msc_at(self, index, value):
+ self.msc[index] = value
+ def get_plantuml(self):
+ return self.plantuml
+ def set_plantuml(self, plantuml):
+ self.plantuml = plantuml
+ def add_plantuml(self, value):
+ self.plantuml.append(value)
+ def insert_plantuml_at(self, index, value):
+ self.plantuml.insert(index, value)
+ def replace_plantuml_at(self, index, value):
+ self.plantuml[index] = value
+ def get_anchor(self):
+ return self.anchor
+ def set_anchor(self, anchor):
+ self.anchor = anchor
+ def add_anchor(self, value):
+ self.anchor.append(value)
+ def insert_anchor_at(self, index, value):
+ self.anchor.insert(index, value)
+ def replace_anchor_at(self, index, value):
+ self.anchor[index] = value
+ def get_formula(self):
+ return self.formula
+ def set_formula(self, formula):
+ self.formula = formula
+ def add_formula(self, value):
+ self.formula.append(value)
+ def insert_formula_at(self, index, value):
+ self.formula.insert(index, value)
+ def replace_formula_at(self, index, value):
+ self.formula[index] = value
+ def get_ref(self):
+ return self.ref
+ def set_ref(self, ref):
+ self.ref = ref
+ def add_ref(self, value):
+ self.ref.append(value)
+ def insert_ref_at(self, index, value):
+ self.ref.insert(index, value)
+ def replace_ref_at(self, index, value):
+ self.ref[index] = value
+ def get_emoji(self):
+ return self.emoji
+ def set_emoji(self, emoji):
+ self.emoji = emoji
+ def add_emoji(self, value):
+ self.emoji.append(value)
+ def insert_emoji_at(self, index, value):
+ self.emoji.insert(index, value)
+ def replace_emoji_at(self, index, value):
+ self.emoji[index] = value
+ def get_linebreak(self):
+ return self.linebreak
+ def set_linebreak(self, linebreak):
+ self.linebreak = linebreak
+ def add_linebreak(self, value):
+ self.linebreak.append(value)
+ def insert_linebreak_at(self, index, value):
+ self.linebreak.insert(index, value)
+ def replace_linebreak_at(self, index, value):
+ self.linebreak[index] = value
+ def get_url(self):
+ return self.url
+ def set_url(self, url):
+ self.url = url
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.ulink or
+ self.bold or
+ self.s or
+ self.strike or
+ self.underline or
+ self.emphasis or
+ self.computeroutput or
+ self.subscript or
+ self.superscript or
+ self.center or
+ self.small or
+ self.del_ or
+ self.ins or
+ self.htmlonly or
+ self.manonly or
+ self.xmlonly or
+ self.rtfonly or
+ self.latexonly or
+ self.docbookonly or
+ self.image or
+ self.dot or
+ self.msc or
+ self.plantuml or
+ self.anchor or
+ self.formula or
+ self.ref or
+ self.emoji or
+ self.linebreak or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docURLLink', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docURLLink')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docURLLink':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docURLLink')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docURLLink', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docURLLink'):
+ if self.url is not None and 'url' not in already_processed:
+ already_processed.add('url')
+ outfile.write(' url=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.url), input_name='url')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docURLLink', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for ulink_ in self.ulink:
+ namespaceprefix_ = self.ulink_nsprefix_ + ':' if (UseCapturedNS_ and self.ulink_nsprefix_) else ''
+ ulink_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ulink', pretty_print=pretty_print)
+ for bold_ in self.bold:
+ namespaceprefix_ = self.bold_nsprefix_ + ':' if (UseCapturedNS_ and self.bold_nsprefix_) else ''
+ bold_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='bold', pretty_print=pretty_print)
+ for s_ in self.s:
+ namespaceprefix_ = self.s_nsprefix_ + ':' if (UseCapturedNS_ and self.s_nsprefix_) else ''
+ s_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='s', pretty_print=pretty_print)
+ for strike_ in self.strike:
+ namespaceprefix_ = self.strike_nsprefix_ + ':' if (UseCapturedNS_ and self.strike_nsprefix_) else ''
+ strike_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='strike', pretty_print=pretty_print)
+ for underline_ in self.underline:
+ namespaceprefix_ = self.underline_nsprefix_ + ':' if (UseCapturedNS_ and self.underline_nsprefix_) else ''
+ underline_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='underline', pretty_print=pretty_print)
+ for emphasis_ in self.emphasis:
+ namespaceprefix_ = self.emphasis_nsprefix_ + ':' if (UseCapturedNS_ and self.emphasis_nsprefix_) else ''
+ emphasis_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='emphasis', pretty_print=pretty_print)
+ for computeroutput_ in self.computeroutput:
+ namespaceprefix_ = self.computeroutput_nsprefix_ + ':' if (UseCapturedNS_ and self.computeroutput_nsprefix_) else ''
+ computeroutput_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='computeroutput', pretty_print=pretty_print)
+ for subscript_ in self.subscript:
+ namespaceprefix_ = self.subscript_nsprefix_ + ':' if (UseCapturedNS_ and self.subscript_nsprefix_) else ''
+ subscript_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='subscript', pretty_print=pretty_print)
+ for superscript_ in self.superscript:
+ namespaceprefix_ = self.superscript_nsprefix_ + ':' if (UseCapturedNS_ and self.superscript_nsprefix_) else ''
+ superscript_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='superscript', pretty_print=pretty_print)
+ for center_ in self.center:
+ namespaceprefix_ = self.center_nsprefix_ + ':' if (UseCapturedNS_ and self.center_nsprefix_) else ''
+ center_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='center', pretty_print=pretty_print)
+ for small_ in self.small:
+ namespaceprefix_ = self.small_nsprefix_ + ':' if (UseCapturedNS_ and self.small_nsprefix_) else ''
+ small_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='small', pretty_print=pretty_print)
+ for del_ in self.del_:
+ namespaceprefix_ = self.del__nsprefix_ + ':' if (UseCapturedNS_ and self.del__nsprefix_) else ''
+ del_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='del', pretty_print=pretty_print)
+ for ins_ in self.ins:
+ namespaceprefix_ = self.ins_nsprefix_ + ':' if (UseCapturedNS_ and self.ins_nsprefix_) else ''
+ ins_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ins', pretty_print=pretty_print)
+ for htmlonly_ in self.htmlonly:
+ namespaceprefix_ = self.htmlonly_nsprefix_ + ':' if (UseCapturedNS_ and self.htmlonly_nsprefix_) else ''
+ htmlonly_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='htmlonly', pretty_print=pretty_print)
+ for manonly_ in self.manonly:
+ namespaceprefix_ = self.manonly_nsprefix_ + ':' if (UseCapturedNS_ and self.manonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%smanonly>%s</%smanonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(manonly_), input_name='manonly')), namespaceprefix_ , eol_))
+ for xmlonly_ in self.xmlonly:
+ namespaceprefix_ = self.xmlonly_nsprefix_ + ':' if (UseCapturedNS_ and self.xmlonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sxmlonly>%s</%sxmlonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(xmlonly_), input_name='xmlonly')), namespaceprefix_ , eol_))
+ for rtfonly_ in self.rtfonly:
+ namespaceprefix_ = self.rtfonly_nsprefix_ + ':' if (UseCapturedNS_ and self.rtfonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%srtfonly>%s</%srtfonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(rtfonly_), input_name='rtfonly')), namespaceprefix_ , eol_))
+ for latexonly_ in self.latexonly:
+ namespaceprefix_ = self.latexonly_nsprefix_ + ':' if (UseCapturedNS_ and self.latexonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%slatexonly>%s</%slatexonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(latexonly_), input_name='latexonly')), namespaceprefix_ , eol_))
+ for docbookonly_ in self.docbookonly:
+ namespaceprefix_ = self.docbookonly_nsprefix_ + ':' if (UseCapturedNS_ and self.docbookonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sdocbookonly>%s</%sdocbookonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(docbookonly_), input_name='docbookonly')), namespaceprefix_ , eol_))
+ for image_ in self.image:
+ namespaceprefix_ = self.image_nsprefix_ + ':' if (UseCapturedNS_ and self.image_nsprefix_) else ''
+ image_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='image', pretty_print=pretty_print)
+ for dot_ in self.dot:
+ namespaceprefix_ = self.dot_nsprefix_ + ':' if (UseCapturedNS_ and self.dot_nsprefix_) else ''
+ dot_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='dot', pretty_print=pretty_print)
+ for msc_ in self.msc:
+ namespaceprefix_ = self.msc_nsprefix_ + ':' if (UseCapturedNS_ and self.msc_nsprefix_) else ''
+ msc_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='msc', pretty_print=pretty_print)
+ for plantuml_ in self.plantuml:
+ namespaceprefix_ = self.plantuml_nsprefix_ + ':' if (UseCapturedNS_ and self.plantuml_nsprefix_) else ''
+ plantuml_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='plantuml', pretty_print=pretty_print)
+ for anchor_ in self.anchor:
+ namespaceprefix_ = self.anchor_nsprefix_ + ':' if (UseCapturedNS_ and self.anchor_nsprefix_) else ''
+ anchor_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='anchor', pretty_print=pretty_print)
+ for formula_ in self.formula:
+ namespaceprefix_ = self.formula_nsprefix_ + ':' if (UseCapturedNS_ and self.formula_nsprefix_) else ''
+ formula_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='formula', pretty_print=pretty_print)
+ for ref_ in self.ref:
+ namespaceprefix_ = self.ref_nsprefix_ + ':' if (UseCapturedNS_ and self.ref_nsprefix_) else ''
+ ref_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ref', pretty_print=pretty_print)
+ for emoji_ in self.emoji:
+ namespaceprefix_ = self.emoji_nsprefix_ + ':' if (UseCapturedNS_ and self.emoji_nsprefix_) else ''
+ emoji_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='emoji', pretty_print=pretty_print)
+ for linebreak_ in self.linebreak:
+ namespaceprefix_ = self.linebreak_nsprefix_ + ':' if (UseCapturedNS_ and self.linebreak_nsprefix_) else ''
+ linebreak_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='linebreak', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('url', node)
+ if value is not None and 'url' not in already_processed:
+ already_processed.add('url')
+ self.url = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'ulink':
+ obj_ = docURLLink.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ulink', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ulink'):
+ self.add_ulink(obj_.value)
+ elif hasattr(self, 'set_ulink'):
+ self.set_ulink(obj_.value)
+ elif nodeName_ == 'bold':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'bold', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_bold'):
+ self.add_bold(obj_.value)
+ elif hasattr(self, 'set_bold'):
+ self.set_bold(obj_.value)
+ elif nodeName_ == 's':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 's', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_s'):
+ self.add_s(obj_.value)
+ elif hasattr(self, 'set_s'):
+ self.set_s(obj_.value)
+ elif nodeName_ == 'strike':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'strike', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_strike'):
+ self.add_strike(obj_.value)
+ elif hasattr(self, 'set_strike'):
+ self.set_strike(obj_.value)
+ elif nodeName_ == 'underline':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'underline', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_underline'):
+ self.add_underline(obj_.value)
+ elif hasattr(self, 'set_underline'):
+ self.set_underline(obj_.value)
+ elif nodeName_ == 'emphasis':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'emphasis', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_emphasis'):
+ self.add_emphasis(obj_.value)
+ elif hasattr(self, 'set_emphasis'):
+ self.set_emphasis(obj_.value)
+ elif nodeName_ == 'computeroutput':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'computeroutput', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_computeroutput'):
+ self.add_computeroutput(obj_.value)
+ elif hasattr(self, 'set_computeroutput'):
+ self.set_computeroutput(obj_.value)
+ elif nodeName_ == 'subscript':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'subscript', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_subscript'):
+ self.add_subscript(obj_.value)
+ elif hasattr(self, 'set_subscript'):
+ self.set_subscript(obj_.value)
+ elif nodeName_ == 'superscript':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'superscript', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_superscript'):
+ self.add_superscript(obj_.value)
+ elif hasattr(self, 'set_superscript'):
+ self.set_superscript(obj_.value)
+ elif nodeName_ == 'center':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'center', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_center'):
+ self.add_center(obj_.value)
+ elif hasattr(self, 'set_center'):
+ self.set_center(obj_.value)
+ elif nodeName_ == 'small':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'small', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_small'):
+ self.add_small(obj_.value)
+ elif hasattr(self, 'set_small'):
+ self.set_small(obj_.value)
+ elif nodeName_ == 'del':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'del', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_del'):
+ self.add_del(obj_.value)
+ elif hasattr(self, 'set_del'):
+ self.set_del(obj_.value)
+ elif nodeName_ == 'ins':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ins', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ins'):
+ self.add_ins(obj_.value)
+ elif hasattr(self, 'set_ins'):
+ self.set_ins(obj_.value)
+ elif nodeName_ == 'htmlonly':
+ obj_ = docHtmlOnlyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'htmlonly', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_htmlonly'):
+ self.add_htmlonly(obj_.value)
+ elif hasattr(self, 'set_htmlonly'):
+ self.set_htmlonly(obj_.value)
+ elif nodeName_ == 'manonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'manonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'manonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'manonly', valuestr_)
+ self.content_.append(obj_)
+ self.manonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'xmlonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'xmlonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'xmlonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'xmlonly', valuestr_)
+ self.content_.append(obj_)
+ self.xmlonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'rtfonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'rtfonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'rtfonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'rtfonly', valuestr_)
+ self.content_.append(obj_)
+ self.rtfonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'latexonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'latexonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'latexonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'latexonly', valuestr_)
+ self.content_.append(obj_)
+ self.latexonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'docbookonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'docbookonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'docbookonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'docbookonly', valuestr_)
+ self.content_.append(obj_)
+ self.docbookonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'image':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'image', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_image'):
+ self.add_image(obj_.value)
+ elif hasattr(self, 'set_image'):
+ self.set_image(obj_.value)
+ elif nodeName_ == 'dot':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'dot', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_dot'):
+ self.add_dot(obj_.value)
+ elif hasattr(self, 'set_dot'):
+ self.set_dot(obj_.value)
+ elif nodeName_ == 'msc':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'msc', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_msc'):
+ self.add_msc(obj_.value)
+ elif hasattr(self, 'set_msc'):
+ self.set_msc(obj_.value)
+ elif nodeName_ == 'plantuml':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'plantuml', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_plantuml'):
+ self.add_plantuml(obj_.value)
+ elif hasattr(self, 'set_plantuml'):
+ self.set_plantuml(obj_.value)
+ elif nodeName_ == 'anchor':
+ obj_ = docAnchorType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'anchor', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_anchor'):
+ self.add_anchor(obj_.value)
+ elif hasattr(self, 'set_anchor'):
+ self.set_anchor(obj_.value)
+ elif nodeName_ == 'formula':
+ obj_ = docFormulaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'formula', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_formula'):
+ self.add_formula(obj_.value)
+ elif hasattr(self, 'set_formula'):
+ self.set_formula(obj_.value)
+ elif nodeName_ == 'ref':
+ obj_ = docRefTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ref', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ref'):
+ self.add_ref(obj_.value)
+ elif hasattr(self, 'set_ref'):
+ self.set_ref(obj_.value)
+ elif nodeName_ == 'emoji':
+ obj_ = docEmojiType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'emoji', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_emoji'):
+ self.add_emoji(obj_.value)
+ elif hasattr(self, 'set_emoji'):
+ self.set_emoji(obj_.value)
+ elif nodeName_ == 'linebreak':
+ obj_ = docEmptyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'linebreak', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_linebreak'):
+ self.add_linebreak(obj_.value)
+ elif hasattr(self, 'set_linebreak'):
+ self.set_linebreak(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docURLLink
+
+
+class docAnchorType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, id=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.id = _cast(None, id)
+ self.id_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docAnchorType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docAnchorType.subclass:
+ return docAnchorType.subclass(*args_, **kwargs_)
+ else:
+ return docAnchorType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_id(self):
+ return self.id
+ def set_id(self, id):
+ self.id = id
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docAnchorType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docAnchorType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docAnchorType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docAnchorType')
+ outfile.write('>')
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_, pretty_print=pretty_print)
+ outfile.write(self.convert_unicode(self.valueOf_))
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docAnchorType'):
+ if self.id is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docAnchorType', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('id', node)
+ if value is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ self.id = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+ pass
+# end class docAnchorType
+
+
+class docFormulaType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, id=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.id = _cast(None, id)
+ self.id_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docFormulaType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docFormulaType.subclass:
+ return docFormulaType.subclass(*args_, **kwargs_)
+ else:
+ return docFormulaType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_id(self):
+ return self.id
+ def set_id(self, id):
+ self.id = id
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docFormulaType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docFormulaType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docFormulaType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docFormulaType')
+ outfile.write('>')
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_, pretty_print=pretty_print)
+ outfile.write(self.convert_unicode(self.valueOf_))
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docFormulaType'):
+ if self.id is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docFormulaType', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('id', node)
+ if value is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ self.id = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+ pass
+# end class docFormulaType
+
+
+class docIndexEntryType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, primaryie=None, secondaryie=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.primaryie = primaryie
+ self.primaryie_nsprefix_ = None
+ self.secondaryie = secondaryie
+ self.secondaryie_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docIndexEntryType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docIndexEntryType.subclass:
+ return docIndexEntryType.subclass(*args_, **kwargs_)
+ else:
+ return docIndexEntryType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_primaryie(self):
+ return self.primaryie
+ def set_primaryie(self, primaryie):
+ self.primaryie = primaryie
+ def get_secondaryie(self):
+ return self.secondaryie
+ def set_secondaryie(self, secondaryie):
+ self.secondaryie = secondaryie
+ def hasContent_(self):
+ if (
+ self.primaryie is not None or
+ self.secondaryie is not None
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docIndexEntryType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docIndexEntryType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docIndexEntryType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docIndexEntryType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docIndexEntryType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docIndexEntryType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docIndexEntryType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.primaryie is not None:
+ namespaceprefix_ = self.primaryie_nsprefix_ + ':' if (UseCapturedNS_ and self.primaryie_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sprimaryie>%s</%sprimaryie>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.primaryie), input_name='primaryie')), namespaceprefix_ , eol_))
+ if self.secondaryie is not None:
+ namespaceprefix_ = self.secondaryie_nsprefix_ + ':' if (UseCapturedNS_ and self.secondaryie_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%ssecondaryie>%s</%ssecondaryie>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.secondaryie), input_name='secondaryie')), namespaceprefix_ , eol_))
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'primaryie':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'primaryie')
+ value_ = self.gds_validate_string(value_, node, 'primaryie')
+ self.primaryie = value_
+ self.primaryie_nsprefix_ = child_.prefix
+ elif nodeName_ == 'secondaryie':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'secondaryie')
+ value_ = self.gds_validate_string(value_, node, 'secondaryie')
+ self.secondaryie = value_
+ self.secondaryie_nsprefix_ = child_.prefix
+# end class docIndexEntryType
+
+
+class docListType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, listitem=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if listitem is None:
+ self.listitem = []
+ else:
+ self.listitem = listitem
+ self.listitem_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docListType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docListType.subclass:
+ return docListType.subclass(*args_, **kwargs_)
+ else:
+ return docListType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_listitem(self):
+ return self.listitem
+ def set_listitem(self, listitem):
+ self.listitem = listitem
+ def add_listitem(self, value):
+ self.listitem.append(value)
+ def insert_listitem_at(self, index, value):
+ self.listitem.insert(index, value)
+ def replace_listitem_at(self, index, value):
+ self.listitem[index] = value
+ def hasContent_(self):
+ if (
+ self.listitem
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docListType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docListType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docListType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docListType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docListType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docListType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docListType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for listitem_ in self.listitem:
+ namespaceprefix_ = self.listitem_nsprefix_ + ':' if (UseCapturedNS_ and self.listitem_nsprefix_) else ''
+ listitem_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='listitem', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'listitem':
+ obj_ = docListItemType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.listitem.append(obj_)
+ obj_.original_tagname_ = 'listitem'
+# end class docListType
+
+
+class docListItemType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, para=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if para is None:
+ self.para = []
+ else:
+ self.para = para
+ self.para_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docListItemType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docListItemType.subclass:
+ return docListItemType.subclass(*args_, **kwargs_)
+ else:
+ return docListItemType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_para(self):
+ return self.para
+ def set_para(self, para):
+ self.para = para
+ def add_para(self, value):
+ self.para.append(value)
+ def insert_para_at(self, index, value):
+ self.para.insert(index, value)
+ def replace_para_at(self, index, value):
+ self.para[index] = value
+ def hasContent_(self):
+ if (
+ self.para
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docListItemType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docListItemType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docListItemType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docListItemType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docListItemType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docListItemType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docListItemType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for para_ in self.para:
+ namespaceprefix_ = self.para_nsprefix_ + ':' if (UseCapturedNS_ and self.para_nsprefix_) else ''
+ para_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='para', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'para':
+ obj_ = docParaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.para.append(obj_)
+ obj_.original_tagname_ = 'para'
+# end class docListItemType
+
+
+class docSimpleSectType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, kind=None, title=None, para=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.kind = _cast(None, kind)
+ self.kind_nsprefix_ = None
+ self.title = title
+ self.title_nsprefix_ = None
+ if para is None:
+ self.para = []
+ else:
+ self.para = para
+ self.para_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docSimpleSectType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docSimpleSectType.subclass:
+ return docSimpleSectType.subclass(*args_, **kwargs_)
+ else:
+ return docSimpleSectType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_title(self):
+ return self.title
+ def set_title(self, title):
+ self.title = title
+ def get_para(self):
+ return self.para
+ def set_para(self, para):
+ self.para = para
+ def add_para(self, value):
+ self.para.append(value)
+ def insert_para_at(self, index, value):
+ self.para.insert(index, value)
+ def replace_para_at(self, index, value):
+ self.para[index] = value
+ def get_kind(self):
+ return self.kind
+ def set_kind(self, kind):
+ self.kind = kind
+ def validate_DoxSimpleSectKind(self, value):
+ # Validate type DoxSimpleSectKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['see', 'return', 'author', 'authors', 'version', 'since', 'date', 'note', 'warning', 'pre', 'post', 'copyright', 'invariant', 'remark', 'attention', 'par', 'rcs']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxSimpleSectKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ self.title is not None or
+ self.para
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docSimpleSectType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docSimpleSectType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docSimpleSectType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docSimpleSectType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docSimpleSectType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docSimpleSectType'):
+ if self.kind is not None and 'kind' not in already_processed:
+ already_processed.add('kind')
+ outfile.write(' kind=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.kind), input_name='kind')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docSimpleSectType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.title is not None:
+ namespaceprefix_ = self.title_nsprefix_ + ':' if (UseCapturedNS_ and self.title_nsprefix_) else ''
+ self.title.export(outfile, level, namespaceprefix_, namespacedef_='', name_='title', pretty_print=pretty_print)
+ for para_ in self.para:
+ namespaceprefix_ = self.para_nsprefix_ + ':' if (UseCapturedNS_ and self.para_nsprefix_) else ''
+ para_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='para', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('kind', node)
+ if value is not None and 'kind' not in already_processed:
+ already_processed.add('kind')
+ self.kind = value
+ self.validate_DoxSimpleSectKind(self.kind) # validate type DoxSimpleSectKind
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'title':
+ obj_ = docTitleType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.title = obj_
+ obj_.original_tagname_ = 'title'
+ elif nodeName_ == 'para':
+ obj_ = docParaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.para.append(obj_)
+ obj_.original_tagname_ = 'para'
+# end class docSimpleSectType
+
+
+class docVarListEntryType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, term=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.term = term
+ self.term_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docVarListEntryType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docVarListEntryType.subclass:
+ return docVarListEntryType.subclass(*args_, **kwargs_)
+ else:
+ return docVarListEntryType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_term(self):
+ return self.term
+ def set_term(self, term):
+ self.term = term
+ def hasContent_(self):
+ if (
+ self.term is not None
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docVarListEntryType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docVarListEntryType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docVarListEntryType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docVarListEntryType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docVarListEntryType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docVarListEntryType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docVarListEntryType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.term is not None:
+ namespaceprefix_ = self.term_nsprefix_ + ':' if (UseCapturedNS_ and self.term_nsprefix_) else ''
+ self.term.export(outfile, level, namespaceprefix_, namespacedef_='', name_='term', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'term':
+ obj_ = docTitleType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.term = obj_
+ obj_.original_tagname_ = 'term'
+# end class docVarListEntryType
+
+
+class docVariableListType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, varlistentry=None, listitem=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if varlistentry is None:
+ self.varlistentry = []
+ else:
+ self.varlistentry = varlistentry
+ self.varlistentry_nsprefix_ = None
+ if listitem is None:
+ self.listitem = []
+ else:
+ self.listitem = listitem
+ self.listitem_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docVariableListType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docVariableListType.subclass:
+ return docVariableListType.subclass(*args_, **kwargs_)
+ else:
+ return docVariableListType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_varlistentry(self):
+ return self.varlistentry
+ def set_varlistentry(self, varlistentry):
+ self.varlistentry = varlistentry
+ def add_varlistentry(self, value):
+ self.varlistentry.append(value)
+ def insert_varlistentry_at(self, index, value):
+ self.varlistentry.insert(index, value)
+ def replace_varlistentry_at(self, index, value):
+ self.varlistentry[index] = value
+ def get_listitem(self):
+ return self.listitem
+ def set_listitem(self, listitem):
+ self.listitem = listitem
+ def add_listitem(self, value):
+ self.listitem.append(value)
+ def insert_listitem_at(self, index, value):
+ self.listitem.insert(index, value)
+ def replace_listitem_at(self, index, value):
+ self.listitem[index] = value
+ def hasContent_(self):
+ if (
+ self.varlistentry or
+ self.listitem
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docVariableListType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docVariableListType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docVariableListType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docVariableListType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docVariableListType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docVariableListType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docVariableListType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for varlistentry_ in self.varlistentry:
+ namespaceprefix_ = self.varlistentry_nsprefix_ + ':' if (UseCapturedNS_ and self.varlistentry_nsprefix_) else ''
+ varlistentry_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='varlistentry', pretty_print=pretty_print)
+ for listitem_ in self.listitem:
+ namespaceprefix_ = self.listitem_nsprefix_ + ':' if (UseCapturedNS_ and self.listitem_nsprefix_) else ''
+ listitem_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='listitem', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'varlistentry':
+ obj_ = docVarListEntryType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.varlistentry.append(obj_)
+ obj_.original_tagname_ = 'varlistentry'
+ elif nodeName_ == 'listitem':
+ obj_ = docListItemType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.listitem.append(obj_)
+ obj_.original_tagname_ = 'listitem'
+# end class docVariableListType
+
+
+class docRefTextType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, refid=None, kindref=None, external=None, ulink=None, bold=None, s=None, strike=None, underline=None, emphasis=None, computeroutput=None, subscript=None, superscript=None, center=None, small=None, del_=None, ins=None, htmlonly=None, manonly=None, xmlonly=None, rtfonly=None, latexonly=None, docbookonly=None, image=None, dot=None, msc=None, plantuml=None, anchor=None, formula=None, ref=None, emoji=None, linebreak=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.refid = _cast(None, refid)
+ self.refid_nsprefix_ = None
+ self.kindref = _cast(None, kindref)
+ self.kindref_nsprefix_ = None
+ self.external = _cast(None, external)
+ self.external_nsprefix_ = None
+ if ulink is None:
+ self.ulink = []
+ else:
+ self.ulink = ulink
+ self.ulink_nsprefix_ = None
+ if bold is None:
+ self.bold = []
+ else:
+ self.bold = bold
+ self.bold_nsprefix_ = None
+ if s is None:
+ self.s = []
+ else:
+ self.s = s
+ self.s_nsprefix_ = None
+ if strike is None:
+ self.strike = []
+ else:
+ self.strike = strike
+ self.strike_nsprefix_ = None
+ if underline is None:
+ self.underline = []
+ else:
+ self.underline = underline
+ self.underline_nsprefix_ = None
+ if emphasis is None:
+ self.emphasis = []
+ else:
+ self.emphasis = emphasis
+ self.emphasis_nsprefix_ = None
+ if computeroutput is None:
+ self.computeroutput = []
+ else:
+ self.computeroutput = computeroutput
+ self.computeroutput_nsprefix_ = None
+ if subscript is None:
+ self.subscript = []
+ else:
+ self.subscript = subscript
+ self.subscript_nsprefix_ = None
+ if superscript is None:
+ self.superscript = []
+ else:
+ self.superscript = superscript
+ self.superscript_nsprefix_ = None
+ if center is None:
+ self.center = []
+ else:
+ self.center = center
+ self.center_nsprefix_ = None
+ if small is None:
+ self.small = []
+ else:
+ self.small = small
+ self.small_nsprefix_ = None
+ if del_ is None:
+ self.del_ = []
+ else:
+ self.del_ = del_
+ self.del__nsprefix_ = None
+ if ins is None:
+ self.ins = []
+ else:
+ self.ins = ins
+ self.ins_nsprefix_ = None
+ if htmlonly is None:
+ self.htmlonly = []
+ else:
+ self.htmlonly = htmlonly
+ self.htmlonly_nsprefix_ = None
+ if manonly is None:
+ self.manonly = []
+ else:
+ self.manonly = manonly
+ self.manonly_nsprefix_ = None
+ if xmlonly is None:
+ self.xmlonly = []
+ else:
+ self.xmlonly = xmlonly
+ self.xmlonly_nsprefix_ = None
+ if rtfonly is None:
+ self.rtfonly = []
+ else:
+ self.rtfonly = rtfonly
+ self.rtfonly_nsprefix_ = None
+ if latexonly is None:
+ self.latexonly = []
+ else:
+ self.latexonly = latexonly
+ self.latexonly_nsprefix_ = None
+ if docbookonly is None:
+ self.docbookonly = []
+ else:
+ self.docbookonly = docbookonly
+ self.docbookonly_nsprefix_ = None
+ if image is None:
+ self.image = []
+ else:
+ self.image = image
+ self.image_nsprefix_ = None
+ if dot is None:
+ self.dot = []
+ else:
+ self.dot = dot
+ self.dot_nsprefix_ = None
+ if msc is None:
+ self.msc = []
+ else:
+ self.msc = msc
+ self.msc_nsprefix_ = None
+ if plantuml is None:
+ self.plantuml = []
+ else:
+ self.plantuml = plantuml
+ self.plantuml_nsprefix_ = None
+ if anchor is None:
+ self.anchor = []
+ else:
+ self.anchor = anchor
+ self.anchor_nsprefix_ = None
+ if formula is None:
+ self.formula = []
+ else:
+ self.formula = formula
+ self.formula_nsprefix_ = None
+ if ref is None:
+ self.ref = []
+ else:
+ self.ref = ref
+ self.ref_nsprefix_ = None
+ if emoji is None:
+ self.emoji = []
+ else:
+ self.emoji = emoji
+ self.emoji_nsprefix_ = None
+ if linebreak is None:
+ self.linebreak = []
+ else:
+ self.linebreak = linebreak
+ self.linebreak_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docRefTextType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docRefTextType.subclass:
+ return docRefTextType.subclass(*args_, **kwargs_)
+ else:
+ return docRefTextType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_ulink(self):
+ return self.ulink
+ def set_ulink(self, ulink):
+ self.ulink = ulink
+ def add_ulink(self, value):
+ self.ulink.append(value)
+ def insert_ulink_at(self, index, value):
+ self.ulink.insert(index, value)
+ def replace_ulink_at(self, index, value):
+ self.ulink[index] = value
+ def get_bold(self):
+ return self.bold
+ def set_bold(self, bold):
+ self.bold = bold
+ def add_bold(self, value):
+ self.bold.append(value)
+ def insert_bold_at(self, index, value):
+ self.bold.insert(index, value)
+ def replace_bold_at(self, index, value):
+ self.bold[index] = value
+ def get_s(self):
+ return self.s
+ def set_s(self, s):
+ self.s = s
+ def add_s(self, value):
+ self.s.append(value)
+ def insert_s_at(self, index, value):
+ self.s.insert(index, value)
+ def replace_s_at(self, index, value):
+ self.s[index] = value
+ def get_strike(self):
+ return self.strike
+ def set_strike(self, strike):
+ self.strike = strike
+ def add_strike(self, value):
+ self.strike.append(value)
+ def insert_strike_at(self, index, value):
+ self.strike.insert(index, value)
+ def replace_strike_at(self, index, value):
+ self.strike[index] = value
+ def get_underline(self):
+ return self.underline
+ def set_underline(self, underline):
+ self.underline = underline
+ def add_underline(self, value):
+ self.underline.append(value)
+ def insert_underline_at(self, index, value):
+ self.underline.insert(index, value)
+ def replace_underline_at(self, index, value):
+ self.underline[index] = value
+ def get_emphasis(self):
+ return self.emphasis
+ def set_emphasis(self, emphasis):
+ self.emphasis = emphasis
+ def add_emphasis(self, value):
+ self.emphasis.append(value)
+ def insert_emphasis_at(self, index, value):
+ self.emphasis.insert(index, value)
+ def replace_emphasis_at(self, index, value):
+ self.emphasis[index] = value
+ def get_computeroutput(self):
+ return self.computeroutput
+ def set_computeroutput(self, computeroutput):
+ self.computeroutput = computeroutput
+ def add_computeroutput(self, value):
+ self.computeroutput.append(value)
+ def insert_computeroutput_at(self, index, value):
+ self.computeroutput.insert(index, value)
+ def replace_computeroutput_at(self, index, value):
+ self.computeroutput[index] = value
+ def get_subscript(self):
+ return self.subscript
+ def set_subscript(self, subscript):
+ self.subscript = subscript
+ def add_subscript(self, value):
+ self.subscript.append(value)
+ def insert_subscript_at(self, index, value):
+ self.subscript.insert(index, value)
+ def replace_subscript_at(self, index, value):
+ self.subscript[index] = value
+ def get_superscript(self):
+ return self.superscript
+ def set_superscript(self, superscript):
+ self.superscript = superscript
+ def add_superscript(self, value):
+ self.superscript.append(value)
+ def insert_superscript_at(self, index, value):
+ self.superscript.insert(index, value)
+ def replace_superscript_at(self, index, value):
+ self.superscript[index] = value
+ def get_center(self):
+ return self.center
+ def set_center(self, center):
+ self.center = center
+ def add_center(self, value):
+ self.center.append(value)
+ def insert_center_at(self, index, value):
+ self.center.insert(index, value)
+ def replace_center_at(self, index, value):
+ self.center[index] = value
+ def get_small(self):
+ return self.small
+ def set_small(self, small):
+ self.small = small
+ def add_small(self, value):
+ self.small.append(value)
+ def insert_small_at(self, index, value):
+ self.small.insert(index, value)
+ def replace_small_at(self, index, value):
+ self.small[index] = value
+ def get_del(self):
+ return self.del_
+ def set_del(self, del_):
+ self.del_ = del_
+ def add_del(self, value):
+ self.del_.append(value)
+ def insert_del_at(self, index, value):
+ self.del_.insert(index, value)
+ def replace_del_at(self, index, value):
+ self.del_[index] = value
+ def get_ins(self):
+ return self.ins
+ def set_ins(self, ins):
+ self.ins = ins
+ def add_ins(self, value):
+ self.ins.append(value)
+ def insert_ins_at(self, index, value):
+ self.ins.insert(index, value)
+ def replace_ins_at(self, index, value):
+ self.ins[index] = value
+ def get_htmlonly(self):
+ return self.htmlonly
+ def set_htmlonly(self, htmlonly):
+ self.htmlonly = htmlonly
+ def add_htmlonly(self, value):
+ self.htmlonly.append(value)
+ def insert_htmlonly_at(self, index, value):
+ self.htmlonly.insert(index, value)
+ def replace_htmlonly_at(self, index, value):
+ self.htmlonly[index] = value
+ def get_manonly(self):
+ return self.manonly
+ def set_manonly(self, manonly):
+ self.manonly = manonly
+ def add_manonly(self, value):
+ self.manonly.append(value)
+ def insert_manonly_at(self, index, value):
+ self.manonly.insert(index, value)
+ def replace_manonly_at(self, index, value):
+ self.manonly[index] = value
+ def get_xmlonly(self):
+ return self.xmlonly
+ def set_xmlonly(self, xmlonly):
+ self.xmlonly = xmlonly
+ def add_xmlonly(self, value):
+ self.xmlonly.append(value)
+ def insert_xmlonly_at(self, index, value):
+ self.xmlonly.insert(index, value)
+ def replace_xmlonly_at(self, index, value):
+ self.xmlonly[index] = value
+ def get_rtfonly(self):
+ return self.rtfonly
+ def set_rtfonly(self, rtfonly):
+ self.rtfonly = rtfonly
+ def add_rtfonly(self, value):
+ self.rtfonly.append(value)
+ def insert_rtfonly_at(self, index, value):
+ self.rtfonly.insert(index, value)
+ def replace_rtfonly_at(self, index, value):
+ self.rtfonly[index] = value
+ def get_latexonly(self):
+ return self.latexonly
+ def set_latexonly(self, latexonly):
+ self.latexonly = latexonly
+ def add_latexonly(self, value):
+ self.latexonly.append(value)
+ def insert_latexonly_at(self, index, value):
+ self.latexonly.insert(index, value)
+ def replace_latexonly_at(self, index, value):
+ self.latexonly[index] = value
+ def get_docbookonly(self):
+ return self.docbookonly
+ def set_docbookonly(self, docbookonly):
+ self.docbookonly = docbookonly
+ def add_docbookonly(self, value):
+ self.docbookonly.append(value)
+ def insert_docbookonly_at(self, index, value):
+ self.docbookonly.insert(index, value)
+ def replace_docbookonly_at(self, index, value):
+ self.docbookonly[index] = value
+ def get_image(self):
+ return self.image
+ def set_image(self, image):
+ self.image = image
+ def add_image(self, value):
+ self.image.append(value)
+ def insert_image_at(self, index, value):
+ self.image.insert(index, value)
+ def replace_image_at(self, index, value):
+ self.image[index] = value
+ def get_dot(self):
+ return self.dot
+ def set_dot(self, dot):
+ self.dot = dot
+ def add_dot(self, value):
+ self.dot.append(value)
+ def insert_dot_at(self, index, value):
+ self.dot.insert(index, value)
+ def replace_dot_at(self, index, value):
+ self.dot[index] = value
+ def get_msc(self):
+ return self.msc
+ def set_msc(self, msc):
+ self.msc = msc
+ def add_msc(self, value):
+ self.msc.append(value)
+ def insert_msc_at(self, index, value):
+ self.msc.insert(index, value)
+ def replace_msc_at(self, index, value):
+ self.msc[index] = value
+ def get_plantuml(self):
+ return self.plantuml
+ def set_plantuml(self, plantuml):
+ self.plantuml = plantuml
+ def add_plantuml(self, value):
+ self.plantuml.append(value)
+ def insert_plantuml_at(self, index, value):
+ self.plantuml.insert(index, value)
+ def replace_plantuml_at(self, index, value):
+ self.plantuml[index] = value
+ def get_anchor(self):
+ return self.anchor
+ def set_anchor(self, anchor):
+ self.anchor = anchor
+ def add_anchor(self, value):
+ self.anchor.append(value)
+ def insert_anchor_at(self, index, value):
+ self.anchor.insert(index, value)
+ def replace_anchor_at(self, index, value):
+ self.anchor[index] = value
+ def get_formula(self):
+ return self.formula
+ def set_formula(self, formula):
+ self.formula = formula
+ def add_formula(self, value):
+ self.formula.append(value)
+ def insert_formula_at(self, index, value):
+ self.formula.insert(index, value)
+ def replace_formula_at(self, index, value):
+ self.formula[index] = value
+ def get_ref(self):
+ return self.ref
+ def set_ref(self, ref):
+ self.ref = ref
+ def add_ref(self, value):
+ self.ref.append(value)
+ def insert_ref_at(self, index, value):
+ self.ref.insert(index, value)
+ def replace_ref_at(self, index, value):
+ self.ref[index] = value
+ def get_emoji(self):
+ return self.emoji
+ def set_emoji(self, emoji):
+ self.emoji = emoji
+ def add_emoji(self, value):
+ self.emoji.append(value)
+ def insert_emoji_at(self, index, value):
+ self.emoji.insert(index, value)
+ def replace_emoji_at(self, index, value):
+ self.emoji[index] = value
+ def get_linebreak(self):
+ return self.linebreak
+ def set_linebreak(self, linebreak):
+ self.linebreak = linebreak
+ def add_linebreak(self, value):
+ self.linebreak.append(value)
+ def insert_linebreak_at(self, index, value):
+ self.linebreak.insert(index, value)
+ def replace_linebreak_at(self, index, value):
+ self.linebreak[index] = value
+ def get_refid(self):
+ return self.refid
+ def set_refid(self, refid):
+ self.refid = refid
+ def get_kindref(self):
+ return self.kindref
+ def set_kindref(self, kindref):
+ self.kindref = kindref
+ def get_external(self):
+ return self.external
+ def set_external(self, external):
+ self.external = external
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def validate_DoxRefKind(self, value):
+ # Validate type DoxRefKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['compound', 'member']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxRefKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ self.ulink or
+ self.bold or
+ self.s or
+ self.strike or
+ self.underline or
+ self.emphasis or
+ self.computeroutput or
+ self.subscript or
+ self.superscript or
+ self.center or
+ self.small or
+ self.del_ or
+ self.ins or
+ self.htmlonly or
+ self.manonly or
+ self.xmlonly or
+ self.rtfonly or
+ self.latexonly or
+ self.docbookonly or
+ self.image or
+ self.dot or
+ self.msc or
+ self.plantuml or
+ self.anchor or
+ self.formula or
+ self.ref or
+ self.emoji or
+ self.linebreak or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docRefTextType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docRefTextType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docRefTextType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docRefTextType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docRefTextType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docRefTextType'):
+ if self.refid is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
+ if self.kindref is not None and 'kindref' not in already_processed:
+ already_processed.add('kindref')
+ outfile.write(' kindref=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.kindref), input_name='kindref')), ))
+ if self.external is not None and 'external' not in already_processed:
+ already_processed.add('external')
+ outfile.write(' external=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.external), input_name='external')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docRefTextType', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for ulink_ in self.ulink:
+ namespaceprefix_ = self.ulink_nsprefix_ + ':' if (UseCapturedNS_ and self.ulink_nsprefix_) else ''
+ ulink_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ulink', pretty_print=pretty_print)
+ for bold_ in self.bold:
+ namespaceprefix_ = self.bold_nsprefix_ + ':' if (UseCapturedNS_ and self.bold_nsprefix_) else ''
+ bold_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='bold', pretty_print=pretty_print)
+ for s_ in self.s:
+ namespaceprefix_ = self.s_nsprefix_ + ':' if (UseCapturedNS_ and self.s_nsprefix_) else ''
+ s_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='s', pretty_print=pretty_print)
+ for strike_ in self.strike:
+ namespaceprefix_ = self.strike_nsprefix_ + ':' if (UseCapturedNS_ and self.strike_nsprefix_) else ''
+ strike_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='strike', pretty_print=pretty_print)
+ for underline_ in self.underline:
+ namespaceprefix_ = self.underline_nsprefix_ + ':' if (UseCapturedNS_ and self.underline_nsprefix_) else ''
+ underline_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='underline', pretty_print=pretty_print)
+ for emphasis_ in self.emphasis:
+ namespaceprefix_ = self.emphasis_nsprefix_ + ':' if (UseCapturedNS_ and self.emphasis_nsprefix_) else ''
+ emphasis_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='emphasis', pretty_print=pretty_print)
+ for computeroutput_ in self.computeroutput:
+ namespaceprefix_ = self.computeroutput_nsprefix_ + ':' if (UseCapturedNS_ and self.computeroutput_nsprefix_) else ''
+ computeroutput_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='computeroutput', pretty_print=pretty_print)
+ for subscript_ in self.subscript:
+ namespaceprefix_ = self.subscript_nsprefix_ + ':' if (UseCapturedNS_ and self.subscript_nsprefix_) else ''
+ subscript_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='subscript', pretty_print=pretty_print)
+ for superscript_ in self.superscript:
+ namespaceprefix_ = self.superscript_nsprefix_ + ':' if (UseCapturedNS_ and self.superscript_nsprefix_) else ''
+ superscript_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='superscript', pretty_print=pretty_print)
+ for center_ in self.center:
+ namespaceprefix_ = self.center_nsprefix_ + ':' if (UseCapturedNS_ and self.center_nsprefix_) else ''
+ center_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='center', pretty_print=pretty_print)
+ for small_ in self.small:
+ namespaceprefix_ = self.small_nsprefix_ + ':' if (UseCapturedNS_ and self.small_nsprefix_) else ''
+ small_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='small', pretty_print=pretty_print)
+ for del_ in self.del_:
+ namespaceprefix_ = self.del__nsprefix_ + ':' if (UseCapturedNS_ and self.del__nsprefix_) else ''
+ del_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='del', pretty_print=pretty_print)
+ for ins_ in self.ins:
+ namespaceprefix_ = self.ins_nsprefix_ + ':' if (UseCapturedNS_ and self.ins_nsprefix_) else ''
+ ins_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ins', pretty_print=pretty_print)
+ for htmlonly_ in self.htmlonly:
+ namespaceprefix_ = self.htmlonly_nsprefix_ + ':' if (UseCapturedNS_ and self.htmlonly_nsprefix_) else ''
+ htmlonly_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='htmlonly', pretty_print=pretty_print)
+ for manonly_ in self.manonly:
+ namespaceprefix_ = self.manonly_nsprefix_ + ':' if (UseCapturedNS_ and self.manonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%smanonly>%s</%smanonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(manonly_), input_name='manonly')), namespaceprefix_ , eol_))
+ for xmlonly_ in self.xmlonly:
+ namespaceprefix_ = self.xmlonly_nsprefix_ + ':' if (UseCapturedNS_ and self.xmlonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sxmlonly>%s</%sxmlonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(xmlonly_), input_name='xmlonly')), namespaceprefix_ , eol_))
+ for rtfonly_ in self.rtfonly:
+ namespaceprefix_ = self.rtfonly_nsprefix_ + ':' if (UseCapturedNS_ and self.rtfonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%srtfonly>%s</%srtfonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(rtfonly_), input_name='rtfonly')), namespaceprefix_ , eol_))
+ for latexonly_ in self.latexonly:
+ namespaceprefix_ = self.latexonly_nsprefix_ + ':' if (UseCapturedNS_ and self.latexonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%slatexonly>%s</%slatexonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(latexonly_), input_name='latexonly')), namespaceprefix_ , eol_))
+ for docbookonly_ in self.docbookonly:
+ namespaceprefix_ = self.docbookonly_nsprefix_ + ':' if (UseCapturedNS_ and self.docbookonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sdocbookonly>%s</%sdocbookonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(docbookonly_), input_name='docbookonly')), namespaceprefix_ , eol_))
+ for image_ in self.image:
+ namespaceprefix_ = self.image_nsprefix_ + ':' if (UseCapturedNS_ and self.image_nsprefix_) else ''
+ image_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='image', pretty_print=pretty_print)
+ for dot_ in self.dot:
+ namespaceprefix_ = self.dot_nsprefix_ + ':' if (UseCapturedNS_ and self.dot_nsprefix_) else ''
+ dot_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='dot', pretty_print=pretty_print)
+ for msc_ in self.msc:
+ namespaceprefix_ = self.msc_nsprefix_ + ':' if (UseCapturedNS_ and self.msc_nsprefix_) else ''
+ msc_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='msc', pretty_print=pretty_print)
+ for plantuml_ in self.plantuml:
+ namespaceprefix_ = self.plantuml_nsprefix_ + ':' if (UseCapturedNS_ and self.plantuml_nsprefix_) else ''
+ plantuml_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='plantuml', pretty_print=pretty_print)
+ for anchor_ in self.anchor:
+ namespaceprefix_ = self.anchor_nsprefix_ + ':' if (UseCapturedNS_ and self.anchor_nsprefix_) else ''
+ anchor_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='anchor', pretty_print=pretty_print)
+ for formula_ in self.formula:
+ namespaceprefix_ = self.formula_nsprefix_ + ':' if (UseCapturedNS_ and self.formula_nsprefix_) else ''
+ formula_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='formula', pretty_print=pretty_print)
+ for ref_ in self.ref:
+ namespaceprefix_ = self.ref_nsprefix_ + ':' if (UseCapturedNS_ and self.ref_nsprefix_) else ''
+ ref_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ref', pretty_print=pretty_print)
+ for emoji_ in self.emoji:
+ namespaceprefix_ = self.emoji_nsprefix_ + ':' if (UseCapturedNS_ and self.emoji_nsprefix_) else ''
+ emoji_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='emoji', pretty_print=pretty_print)
+ for linebreak_ in self.linebreak:
+ namespaceprefix_ = self.linebreak_nsprefix_ + ':' if (UseCapturedNS_ and self.linebreak_nsprefix_) else ''
+ linebreak_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='linebreak', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('refid', node)
+ if value is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ self.refid = value
+ value = find_attr_value_('kindref', node)
+ if value is not None and 'kindref' not in already_processed:
+ already_processed.add('kindref')
+ self.kindref = value
+ self.validate_DoxRefKind(self.kindref) # validate type DoxRefKind
+ value = find_attr_value_('external', node)
+ if value is not None and 'external' not in already_processed:
+ already_processed.add('external')
+ self.external = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'ulink':
+ obj_ = docURLLink.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ulink', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ulink'):
+ self.add_ulink(obj_.value)
+ elif hasattr(self, 'set_ulink'):
+ self.set_ulink(obj_.value)
+ elif nodeName_ == 'bold':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'bold', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_bold'):
+ self.add_bold(obj_.value)
+ elif hasattr(self, 'set_bold'):
+ self.set_bold(obj_.value)
+ elif nodeName_ == 's':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 's', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_s'):
+ self.add_s(obj_.value)
+ elif hasattr(self, 'set_s'):
+ self.set_s(obj_.value)
+ elif nodeName_ == 'strike':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'strike', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_strike'):
+ self.add_strike(obj_.value)
+ elif hasattr(self, 'set_strike'):
+ self.set_strike(obj_.value)
+ elif nodeName_ == 'underline':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'underline', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_underline'):
+ self.add_underline(obj_.value)
+ elif hasattr(self, 'set_underline'):
+ self.set_underline(obj_.value)
+ elif nodeName_ == 'emphasis':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'emphasis', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_emphasis'):
+ self.add_emphasis(obj_.value)
+ elif hasattr(self, 'set_emphasis'):
+ self.set_emphasis(obj_.value)
+ elif nodeName_ == 'computeroutput':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'computeroutput', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_computeroutput'):
+ self.add_computeroutput(obj_.value)
+ elif hasattr(self, 'set_computeroutput'):
+ self.set_computeroutput(obj_.value)
+ elif nodeName_ == 'subscript':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'subscript', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_subscript'):
+ self.add_subscript(obj_.value)
+ elif hasattr(self, 'set_subscript'):
+ self.set_subscript(obj_.value)
+ elif nodeName_ == 'superscript':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'superscript', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_superscript'):
+ self.add_superscript(obj_.value)
+ elif hasattr(self, 'set_superscript'):
+ self.set_superscript(obj_.value)
+ elif nodeName_ == 'center':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'center', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_center'):
+ self.add_center(obj_.value)
+ elif hasattr(self, 'set_center'):
+ self.set_center(obj_.value)
+ elif nodeName_ == 'small':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'small', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_small'):
+ self.add_small(obj_.value)
+ elif hasattr(self, 'set_small'):
+ self.set_small(obj_.value)
+ elif nodeName_ == 'del':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'del', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_del'):
+ self.add_del(obj_.value)
+ elif hasattr(self, 'set_del'):
+ self.set_del(obj_.value)
+ elif nodeName_ == 'ins':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ins', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ins'):
+ self.add_ins(obj_.value)
+ elif hasattr(self, 'set_ins'):
+ self.set_ins(obj_.value)
+ elif nodeName_ == 'htmlonly':
+ obj_ = docHtmlOnlyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'htmlonly', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_htmlonly'):
+ self.add_htmlonly(obj_.value)
+ elif hasattr(self, 'set_htmlonly'):
+ self.set_htmlonly(obj_.value)
+ elif nodeName_ == 'manonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'manonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'manonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'manonly', valuestr_)
+ self.content_.append(obj_)
+ self.manonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'xmlonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'xmlonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'xmlonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'xmlonly', valuestr_)
+ self.content_.append(obj_)
+ self.xmlonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'rtfonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'rtfonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'rtfonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'rtfonly', valuestr_)
+ self.content_.append(obj_)
+ self.rtfonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'latexonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'latexonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'latexonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'latexonly', valuestr_)
+ self.content_.append(obj_)
+ self.latexonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'docbookonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'docbookonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'docbookonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'docbookonly', valuestr_)
+ self.content_.append(obj_)
+ self.docbookonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'image':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'image', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_image'):
+ self.add_image(obj_.value)
+ elif hasattr(self, 'set_image'):
+ self.set_image(obj_.value)
+ elif nodeName_ == 'dot':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'dot', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_dot'):
+ self.add_dot(obj_.value)
+ elif hasattr(self, 'set_dot'):
+ self.set_dot(obj_.value)
+ elif nodeName_ == 'msc':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'msc', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_msc'):
+ self.add_msc(obj_.value)
+ elif hasattr(self, 'set_msc'):
+ self.set_msc(obj_.value)
+ elif nodeName_ == 'plantuml':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'plantuml', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_plantuml'):
+ self.add_plantuml(obj_.value)
+ elif hasattr(self, 'set_plantuml'):
+ self.set_plantuml(obj_.value)
+ elif nodeName_ == 'anchor':
+ obj_ = docAnchorType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'anchor', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_anchor'):
+ self.add_anchor(obj_.value)
+ elif hasattr(self, 'set_anchor'):
+ self.set_anchor(obj_.value)
+ elif nodeName_ == 'formula':
+ obj_ = docFormulaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'formula', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_formula'):
+ self.add_formula(obj_.value)
+ elif hasattr(self, 'set_formula'):
+ self.set_formula(obj_.value)
+ elif nodeName_ == 'ref':
+ obj_ = docRefTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ref', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ref'):
+ self.add_ref(obj_.value)
+ elif hasattr(self, 'set_ref'):
+ self.set_ref(obj_.value)
+ elif nodeName_ == 'emoji':
+ obj_ = docEmojiType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'emoji', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_emoji'):
+ self.add_emoji(obj_.value)
+ elif hasattr(self, 'set_emoji'):
+ self.set_emoji(obj_.value)
+ elif nodeName_ == 'linebreak':
+ obj_ = docEmptyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'linebreak', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_linebreak'):
+ self.add_linebreak(obj_.value)
+ elif hasattr(self, 'set_linebreak'):
+ self.set_linebreak(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docRefTextType
+
+
+class docTableType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, rows=None, cols=None, width=None, caption=None, row=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.rows = _cast(int, rows)
+ self.rows_nsprefix_ = None
+ self.cols = _cast(int, cols)
+ self.cols_nsprefix_ = None
+ self.width = _cast(None, width)
+ self.width_nsprefix_ = None
+ self.caption = caption
+ self.caption_nsprefix_ = None
+ if row is None:
+ self.row = []
+ else:
+ self.row = row
+ self.row_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docTableType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docTableType.subclass:
+ return docTableType.subclass(*args_, **kwargs_)
+ else:
+ return docTableType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_caption(self):
+ return self.caption
+ def set_caption(self, caption):
+ self.caption = caption
+ def get_row(self):
+ return self.row
+ def set_row(self, row):
+ self.row = row
+ def add_row(self, value):
+ self.row.append(value)
+ def insert_row_at(self, index, value):
+ self.row.insert(index, value)
+ def replace_row_at(self, index, value):
+ self.row[index] = value
+ def get_rows(self):
+ return self.rows
+ def set_rows(self, rows):
+ self.rows = rows
+ def get_cols(self):
+ return self.cols
+ def set_cols(self, cols):
+ self.cols = cols
+ def get_width(self):
+ return self.width
+ def set_width(self, width):
+ self.width = width
+ def hasContent_(self):
+ if (
+ self.caption is not None or
+ self.row
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docTableType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docTableType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docTableType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docTableType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docTableType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docTableType'):
+ if self.rows is not None and 'rows' not in already_processed:
+ already_processed.add('rows')
+ outfile.write(' rows="%s"' % self.gds_format_integer(self.rows, input_name='rows'))
+ if self.cols is not None and 'cols' not in already_processed:
+ already_processed.add('cols')
+ outfile.write(' cols="%s"' % self.gds_format_integer(self.cols, input_name='cols'))
+ if self.width is not None and 'width' not in already_processed:
+ already_processed.add('width')
+ outfile.write(' width=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.width), input_name='width')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docTableType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.caption is not None:
+ namespaceprefix_ = self.caption_nsprefix_ + ':' if (UseCapturedNS_ and self.caption_nsprefix_) else ''
+ self.caption.export(outfile, level, namespaceprefix_, namespacedef_='', name_='caption', pretty_print=pretty_print)
+ for row_ in self.row:
+ namespaceprefix_ = self.row_nsprefix_ + ':' if (UseCapturedNS_ and self.row_nsprefix_) else ''
+ row_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='row', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('rows', node)
+ if value is not None and 'rows' not in already_processed:
+ already_processed.add('rows')
+ self.rows = self.gds_parse_integer(value, node, 'rows')
+ value = find_attr_value_('cols', node)
+ if value is not None and 'cols' not in already_processed:
+ already_processed.add('cols')
+ self.cols = self.gds_parse_integer(value, node, 'cols')
+ value = find_attr_value_('width', node)
+ if value is not None and 'width' not in already_processed:
+ already_processed.add('width')
+ self.width = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'caption':
+ obj_ = docCaptionType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.caption = obj_
+ obj_.original_tagname_ = 'caption'
+ elif nodeName_ == 'row':
+ obj_ = docRowType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.row.append(obj_)
+ obj_.original_tagname_ = 'row'
+# end class docTableType
+
+
+class docRowType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, entry=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if entry is None:
+ self.entry = []
+ else:
+ self.entry = entry
+ self.entry_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docRowType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docRowType.subclass:
+ return docRowType.subclass(*args_, **kwargs_)
+ else:
+ return docRowType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_entry(self):
+ return self.entry
+ def set_entry(self, entry):
+ self.entry = entry
+ def add_entry(self, value):
+ self.entry.append(value)
+ def insert_entry_at(self, index, value):
+ self.entry.insert(index, value)
+ def replace_entry_at(self, index, value):
+ self.entry[index] = value
+ def hasContent_(self):
+ if (
+ self.entry
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docRowType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docRowType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docRowType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docRowType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docRowType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docRowType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docRowType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for entry_ in self.entry:
+ namespaceprefix_ = self.entry_nsprefix_ + ':' if (UseCapturedNS_ and self.entry_nsprefix_) else ''
+ entry_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='entry', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'entry':
+ obj_ = docEntryType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.entry.append(obj_)
+ obj_.original_tagname_ = 'entry'
+# end class docRowType
+
+
+class docEntryType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, thead=None, colspan=None, rowspan=None, align=None, valign=None, width=None, class_=None, para=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.thead = _cast(None, thead)
+ self.thead_nsprefix_ = None
+ self.colspan = _cast(int, colspan)
+ self.colspan_nsprefix_ = None
+ self.rowspan = _cast(int, rowspan)
+ self.rowspan_nsprefix_ = None
+ self.align = _cast(None, align)
+ self.align_nsprefix_ = None
+ self.valign = _cast(None, valign)
+ self.valign_nsprefix_ = None
+ self.width = _cast(None, width)
+ self.width_nsprefix_ = None
+ self.class_ = _cast(None, class_)
+ self.class__nsprefix_ = None
+ if para is None:
+ self.para = []
+ else:
+ self.para = para
+ self.para_nsprefix_ = None
+ self.anyAttributes_ = {}
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docEntryType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docEntryType.subclass:
+ return docEntryType.subclass(*args_, **kwargs_)
+ else:
+ return docEntryType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_para(self):
+ return self.para
+ def set_para(self, para):
+ self.para = para
+ def add_para(self, value):
+ self.para.append(value)
+ def insert_para_at(self, index, value):
+ self.para.insert(index, value)
+ def replace_para_at(self, index, value):
+ self.para[index] = value
+ def get_thead(self):
+ return self.thead
+ def set_thead(self, thead):
+ self.thead = thead
+ def get_colspan(self):
+ return self.colspan
+ def set_colspan(self, colspan):
+ self.colspan = colspan
+ def get_rowspan(self):
+ return self.rowspan
+ def set_rowspan(self, rowspan):
+ self.rowspan = rowspan
+ def get_align(self):
+ return self.align
+ def set_align(self, align):
+ self.align = align
+ def get_valign(self):
+ return self.valign
+ def set_valign(self, valign):
+ self.valign = valign
+ def get_width(self):
+ return self.width
+ def set_width(self, width):
+ self.width = width
+ def get_class(self):
+ return self.class_
+ def set_class(self, class_):
+ self.class_ = class_
+ def get_anyAttributes_(self): return self.anyAttributes_
+ def set_anyAttributes_(self, anyAttributes_): self.anyAttributes_ = anyAttributes_
+ def validate_DoxBool(self, value):
+ # Validate type DoxBool, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['yes', 'no']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxBool' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def validate_DoxAlign(self, value):
+ # Validate type DoxAlign, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['left', 'right', 'center']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxAlign' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def validate_DoxVerticalAlign(self, value):
+ # Validate type DoxVerticalAlign, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['bottom', 'top', 'middle']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxVerticalAlign' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ self.para
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docEntryType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docEntryType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docEntryType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docEntryType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docEntryType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docEntryType'):
+ unique_counter = 0
+ for name, value in self.anyAttributes_.items():
+ xsinamespaceprefix = 'xsi'
+ xsinamespace1 = 'http://www.w3.org/2001/XMLSchema-instance'
+ xsinamespace2 = '{%s}' % (xsinamespace1, )
+ if name.startswith(xsinamespace2):
+ name1 = name[len(xsinamespace2):]
+ name2 = '%s:%s' % (xsinamespaceprefix, name1, )
+ if name2 not in already_processed:
+ already_processed.add(name2)
+ outfile.write(' %s=%s' % (name2, quote_attrib(value), ))
+ else:
+ mo = re_.match(Namespace_extract_pat_, name)
+ if mo is not None:
+ namespace, name = mo.group(1, 2)
+ if name not in already_processed:
+ already_processed.add(name)
+ if namespace == 'http://www.w3.org/XML/1998/namespace':
+ outfile.write(' %s=%s' % (
+ name, quote_attrib(value), ))
+ else:
+ unique_counter += 1
+ outfile.write(' xmlns:%d="%s"' % (
+ unique_counter, namespace, ))
+ outfile.write(' %d:%s=%s' % (
+ unique_counter, name, quote_attrib(value), ))
+ else:
+ if name not in already_processed:
+ already_processed.add(name)
+ outfile.write(' %s=%s' % (
+ name, quote_attrib(value), ))
+ if self.thead is not None and 'thead' not in already_processed:
+ already_processed.add('thead')
+ outfile.write(' thead=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.thead), input_name='thead')), ))
+ if self.colspan is not None and 'colspan' not in already_processed:
+ already_processed.add('colspan')
+ outfile.write(' colspan="%s"' % self.gds_format_integer(self.colspan, input_name='colspan'))
+ if self.rowspan is not None and 'rowspan' not in already_processed:
+ already_processed.add('rowspan')
+ outfile.write(' rowspan="%s"' % self.gds_format_integer(self.rowspan, input_name='rowspan'))
+ if self.align is not None and 'align' not in already_processed:
+ already_processed.add('align')
+ outfile.write(' align=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.align), input_name='align')), ))
+ if self.valign is not None and 'valign' not in already_processed:
+ already_processed.add('valign')
+ outfile.write(' valign=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.valign), input_name='valign')), ))
+ if self.width is not None and 'width' not in already_processed:
+ already_processed.add('width')
+ outfile.write(' width=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.width), input_name='width')), ))
+ if self.class_ is not None and 'class_' not in already_processed:
+ already_processed.add('class_')
+ outfile.write(' class=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.class_), input_name='class')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docEntryType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for para_ in self.para:
+ namespaceprefix_ = self.para_nsprefix_ + ':' if (UseCapturedNS_ and self.para_nsprefix_) else ''
+ para_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='para', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('thead', node)
+ if value is not None and 'thead' not in already_processed:
+ already_processed.add('thead')
+ self.thead = value
+ self.validate_DoxBool(self.thead) # validate type DoxBool
+ value = find_attr_value_('colspan', node)
+ if value is not None and 'colspan' not in already_processed:
+ already_processed.add('colspan')
+ self.colspan = self.gds_parse_integer(value, node, 'colspan')
+ value = find_attr_value_('rowspan', node)
+ if value is not None and 'rowspan' not in already_processed:
+ already_processed.add('rowspan')
+ self.rowspan = self.gds_parse_integer(value, node, 'rowspan')
+ value = find_attr_value_('align', node)
+ if value is not None and 'align' not in already_processed:
+ already_processed.add('align')
+ self.align = value
+ self.validate_DoxAlign(self.align) # validate type DoxAlign
+ value = find_attr_value_('valign', node)
+ if value is not None and 'valign' not in already_processed:
+ already_processed.add('valign')
+ self.valign = value
+ self.validate_DoxVerticalAlign(self.valign) # validate type DoxVerticalAlign
+ value = find_attr_value_('width', node)
+ if value is not None and 'width' not in already_processed:
+ already_processed.add('width')
+ self.width = value
+ value = find_attr_value_('class', node)
+ if value is not None and 'class' not in already_processed:
+ already_processed.add('class')
+ self.class_ = value
+ self.anyAttributes_ = {}
+ for name, value in attrs.items():
+ if name not in already_processed:
+ self.anyAttributes_[name] = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'para':
+ obj_ = docParaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.para.append(obj_)
+ obj_.original_tagname_ = 'para'
+# end class docEntryType
+
+
+class docCaptionType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, ulink=None, bold=None, s=None, strike=None, underline=None, emphasis=None, computeroutput=None, subscript=None, superscript=None, center=None, small=None, del_=None, ins=None, htmlonly=None, manonly=None, xmlonly=None, rtfonly=None, latexonly=None, docbookonly=None, image=None, dot=None, msc=None, plantuml=None, anchor=None, formula=None, ref=None, emoji=None, linebreak=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if ulink is None:
+ self.ulink = []
+ else:
+ self.ulink = ulink
+ self.ulink_nsprefix_ = None
+ if bold is None:
+ self.bold = []
+ else:
+ self.bold = bold
+ self.bold_nsprefix_ = None
+ if s is None:
+ self.s = []
+ else:
+ self.s = s
+ self.s_nsprefix_ = None
+ if strike is None:
+ self.strike = []
+ else:
+ self.strike = strike
+ self.strike_nsprefix_ = None
+ if underline is None:
+ self.underline = []
+ else:
+ self.underline = underline
+ self.underline_nsprefix_ = None
+ if emphasis is None:
+ self.emphasis = []
+ else:
+ self.emphasis = emphasis
+ self.emphasis_nsprefix_ = None
+ if computeroutput is None:
+ self.computeroutput = []
+ else:
+ self.computeroutput = computeroutput
+ self.computeroutput_nsprefix_ = None
+ if subscript is None:
+ self.subscript = []
+ else:
+ self.subscript = subscript
+ self.subscript_nsprefix_ = None
+ if superscript is None:
+ self.superscript = []
+ else:
+ self.superscript = superscript
+ self.superscript_nsprefix_ = None
+ if center is None:
+ self.center = []
+ else:
+ self.center = center
+ self.center_nsprefix_ = None
+ if small is None:
+ self.small = []
+ else:
+ self.small = small
+ self.small_nsprefix_ = None
+ if del_ is None:
+ self.del_ = []
+ else:
+ self.del_ = del_
+ self.del__nsprefix_ = None
+ if ins is None:
+ self.ins = []
+ else:
+ self.ins = ins
+ self.ins_nsprefix_ = None
+ if htmlonly is None:
+ self.htmlonly = []
+ else:
+ self.htmlonly = htmlonly
+ self.htmlonly_nsprefix_ = None
+ if manonly is None:
+ self.manonly = []
+ else:
+ self.manonly = manonly
+ self.manonly_nsprefix_ = None
+ if xmlonly is None:
+ self.xmlonly = []
+ else:
+ self.xmlonly = xmlonly
+ self.xmlonly_nsprefix_ = None
+ if rtfonly is None:
+ self.rtfonly = []
+ else:
+ self.rtfonly = rtfonly
+ self.rtfonly_nsprefix_ = None
+ if latexonly is None:
+ self.latexonly = []
+ else:
+ self.latexonly = latexonly
+ self.latexonly_nsprefix_ = None
+ if docbookonly is None:
+ self.docbookonly = []
+ else:
+ self.docbookonly = docbookonly
+ self.docbookonly_nsprefix_ = None
+ if image is None:
+ self.image = []
+ else:
+ self.image = image
+ self.image_nsprefix_ = None
+ if dot is None:
+ self.dot = []
+ else:
+ self.dot = dot
+ self.dot_nsprefix_ = None
+ if msc is None:
+ self.msc = []
+ else:
+ self.msc = msc
+ self.msc_nsprefix_ = None
+ if plantuml is None:
+ self.plantuml = []
+ else:
+ self.plantuml = plantuml
+ self.plantuml_nsprefix_ = None
+ if anchor is None:
+ self.anchor = []
+ else:
+ self.anchor = anchor
+ self.anchor_nsprefix_ = None
+ if formula is None:
+ self.formula = []
+ else:
+ self.formula = formula
+ self.formula_nsprefix_ = None
+ if ref is None:
+ self.ref = []
+ else:
+ self.ref = ref
+ self.ref_nsprefix_ = None
+ if emoji is None:
+ self.emoji = []
+ else:
+ self.emoji = emoji
+ self.emoji_nsprefix_ = None
+ if linebreak is None:
+ self.linebreak = []
+ else:
+ self.linebreak = linebreak
+ self.linebreak_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docCaptionType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docCaptionType.subclass:
+ return docCaptionType.subclass(*args_, **kwargs_)
+ else:
+ return docCaptionType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_ulink(self):
+ return self.ulink
+ def set_ulink(self, ulink):
+ self.ulink = ulink
+ def add_ulink(self, value):
+ self.ulink.append(value)
+ def insert_ulink_at(self, index, value):
+ self.ulink.insert(index, value)
+ def replace_ulink_at(self, index, value):
+ self.ulink[index] = value
+ def get_bold(self):
+ return self.bold
+ def set_bold(self, bold):
+ self.bold = bold
+ def add_bold(self, value):
+ self.bold.append(value)
+ def insert_bold_at(self, index, value):
+ self.bold.insert(index, value)
+ def replace_bold_at(self, index, value):
+ self.bold[index] = value
+ def get_s(self):
+ return self.s
+ def set_s(self, s):
+ self.s = s
+ def add_s(self, value):
+ self.s.append(value)
+ def insert_s_at(self, index, value):
+ self.s.insert(index, value)
+ def replace_s_at(self, index, value):
+ self.s[index] = value
+ def get_strike(self):
+ return self.strike
+ def set_strike(self, strike):
+ self.strike = strike
+ def add_strike(self, value):
+ self.strike.append(value)
+ def insert_strike_at(self, index, value):
+ self.strike.insert(index, value)
+ def replace_strike_at(self, index, value):
+ self.strike[index] = value
+ def get_underline(self):
+ return self.underline
+ def set_underline(self, underline):
+ self.underline = underline
+ def add_underline(self, value):
+ self.underline.append(value)
+ def insert_underline_at(self, index, value):
+ self.underline.insert(index, value)
+ def replace_underline_at(self, index, value):
+ self.underline[index] = value
+ def get_emphasis(self):
+ return self.emphasis
+ def set_emphasis(self, emphasis):
+ self.emphasis = emphasis
+ def add_emphasis(self, value):
+ self.emphasis.append(value)
+ def insert_emphasis_at(self, index, value):
+ self.emphasis.insert(index, value)
+ def replace_emphasis_at(self, index, value):
+ self.emphasis[index] = value
+ def get_computeroutput(self):
+ return self.computeroutput
+ def set_computeroutput(self, computeroutput):
+ self.computeroutput = computeroutput
+ def add_computeroutput(self, value):
+ self.computeroutput.append(value)
+ def insert_computeroutput_at(self, index, value):
+ self.computeroutput.insert(index, value)
+ def replace_computeroutput_at(self, index, value):
+ self.computeroutput[index] = value
+ def get_subscript(self):
+ return self.subscript
+ def set_subscript(self, subscript):
+ self.subscript = subscript
+ def add_subscript(self, value):
+ self.subscript.append(value)
+ def insert_subscript_at(self, index, value):
+ self.subscript.insert(index, value)
+ def replace_subscript_at(self, index, value):
+ self.subscript[index] = value
+ def get_superscript(self):
+ return self.superscript
+ def set_superscript(self, superscript):
+ self.superscript = superscript
+ def add_superscript(self, value):
+ self.superscript.append(value)
+ def insert_superscript_at(self, index, value):
+ self.superscript.insert(index, value)
+ def replace_superscript_at(self, index, value):
+ self.superscript[index] = value
+ def get_center(self):
+ return self.center
+ def set_center(self, center):
+ self.center = center
+ def add_center(self, value):
+ self.center.append(value)
+ def insert_center_at(self, index, value):
+ self.center.insert(index, value)
+ def replace_center_at(self, index, value):
+ self.center[index] = value
+ def get_small(self):
+ return self.small
+ def set_small(self, small):
+ self.small = small
+ def add_small(self, value):
+ self.small.append(value)
+ def insert_small_at(self, index, value):
+ self.small.insert(index, value)
+ def replace_small_at(self, index, value):
+ self.small[index] = value
+ def get_del(self):
+ return self.del_
+ def set_del(self, del_):
+ self.del_ = del_
+ def add_del(self, value):
+ self.del_.append(value)
+ def insert_del_at(self, index, value):
+ self.del_.insert(index, value)
+ def replace_del_at(self, index, value):
+ self.del_[index] = value
+ def get_ins(self):
+ return self.ins
+ def set_ins(self, ins):
+ self.ins = ins
+ def add_ins(self, value):
+ self.ins.append(value)
+ def insert_ins_at(self, index, value):
+ self.ins.insert(index, value)
+ def replace_ins_at(self, index, value):
+ self.ins[index] = value
+ def get_htmlonly(self):
+ return self.htmlonly
+ def set_htmlonly(self, htmlonly):
+ self.htmlonly = htmlonly
+ def add_htmlonly(self, value):
+ self.htmlonly.append(value)
+ def insert_htmlonly_at(self, index, value):
+ self.htmlonly.insert(index, value)
+ def replace_htmlonly_at(self, index, value):
+ self.htmlonly[index] = value
+ def get_manonly(self):
+ return self.manonly
+ def set_manonly(self, manonly):
+ self.manonly = manonly
+ def add_manonly(self, value):
+ self.manonly.append(value)
+ def insert_manonly_at(self, index, value):
+ self.manonly.insert(index, value)
+ def replace_manonly_at(self, index, value):
+ self.manonly[index] = value
+ def get_xmlonly(self):
+ return self.xmlonly
+ def set_xmlonly(self, xmlonly):
+ self.xmlonly = xmlonly
+ def add_xmlonly(self, value):
+ self.xmlonly.append(value)
+ def insert_xmlonly_at(self, index, value):
+ self.xmlonly.insert(index, value)
+ def replace_xmlonly_at(self, index, value):
+ self.xmlonly[index] = value
+ def get_rtfonly(self):
+ return self.rtfonly
+ def set_rtfonly(self, rtfonly):
+ self.rtfonly = rtfonly
+ def add_rtfonly(self, value):
+ self.rtfonly.append(value)
+ def insert_rtfonly_at(self, index, value):
+ self.rtfonly.insert(index, value)
+ def replace_rtfonly_at(self, index, value):
+ self.rtfonly[index] = value
+ def get_latexonly(self):
+ return self.latexonly
+ def set_latexonly(self, latexonly):
+ self.latexonly = latexonly
+ def add_latexonly(self, value):
+ self.latexonly.append(value)
+ def insert_latexonly_at(self, index, value):
+ self.latexonly.insert(index, value)
+ def replace_latexonly_at(self, index, value):
+ self.latexonly[index] = value
+ def get_docbookonly(self):
+ return self.docbookonly
+ def set_docbookonly(self, docbookonly):
+ self.docbookonly = docbookonly
+ def add_docbookonly(self, value):
+ self.docbookonly.append(value)
+ def insert_docbookonly_at(self, index, value):
+ self.docbookonly.insert(index, value)
+ def replace_docbookonly_at(self, index, value):
+ self.docbookonly[index] = value
+ def get_image(self):
+ return self.image
+ def set_image(self, image):
+ self.image = image
+ def add_image(self, value):
+ self.image.append(value)
+ def insert_image_at(self, index, value):
+ self.image.insert(index, value)
+ def replace_image_at(self, index, value):
+ self.image[index] = value
+ def get_dot(self):
+ return self.dot
+ def set_dot(self, dot):
+ self.dot = dot
+ def add_dot(self, value):
+ self.dot.append(value)
+ def insert_dot_at(self, index, value):
+ self.dot.insert(index, value)
+ def replace_dot_at(self, index, value):
+ self.dot[index] = value
+ def get_msc(self):
+ return self.msc
+ def set_msc(self, msc):
+ self.msc = msc
+ def add_msc(self, value):
+ self.msc.append(value)
+ def insert_msc_at(self, index, value):
+ self.msc.insert(index, value)
+ def replace_msc_at(self, index, value):
+ self.msc[index] = value
+ def get_plantuml(self):
+ return self.plantuml
+ def set_plantuml(self, plantuml):
+ self.plantuml = plantuml
+ def add_plantuml(self, value):
+ self.plantuml.append(value)
+ def insert_plantuml_at(self, index, value):
+ self.plantuml.insert(index, value)
+ def replace_plantuml_at(self, index, value):
+ self.plantuml[index] = value
+ def get_anchor(self):
+ return self.anchor
+ def set_anchor(self, anchor):
+ self.anchor = anchor
+ def add_anchor(self, value):
+ self.anchor.append(value)
+ def insert_anchor_at(self, index, value):
+ self.anchor.insert(index, value)
+ def replace_anchor_at(self, index, value):
+ self.anchor[index] = value
+ def get_formula(self):
+ return self.formula
+ def set_formula(self, formula):
+ self.formula = formula
+ def add_formula(self, value):
+ self.formula.append(value)
+ def insert_formula_at(self, index, value):
+ self.formula.insert(index, value)
+ def replace_formula_at(self, index, value):
+ self.formula[index] = value
+ def get_ref(self):
+ return self.ref
+ def set_ref(self, ref):
+ self.ref = ref
+ def add_ref(self, value):
+ self.ref.append(value)
+ def insert_ref_at(self, index, value):
+ self.ref.insert(index, value)
+ def replace_ref_at(self, index, value):
+ self.ref[index] = value
+ def get_emoji(self):
+ return self.emoji
+ def set_emoji(self, emoji):
+ self.emoji = emoji
+ def add_emoji(self, value):
+ self.emoji.append(value)
+ def insert_emoji_at(self, index, value):
+ self.emoji.insert(index, value)
+ def replace_emoji_at(self, index, value):
+ self.emoji[index] = value
+ def get_linebreak(self):
+ return self.linebreak
+ def set_linebreak(self, linebreak):
+ self.linebreak = linebreak
+ def add_linebreak(self, value):
+ self.linebreak.append(value)
+ def insert_linebreak_at(self, index, value):
+ self.linebreak.insert(index, value)
+ def replace_linebreak_at(self, index, value):
+ self.linebreak[index] = value
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.ulink or
+ self.bold or
+ self.s or
+ self.strike or
+ self.underline or
+ self.emphasis or
+ self.computeroutput or
+ self.subscript or
+ self.superscript or
+ self.center or
+ self.small or
+ self.del_ or
+ self.ins or
+ self.htmlonly or
+ self.manonly or
+ self.xmlonly or
+ self.rtfonly or
+ self.latexonly or
+ self.docbookonly or
+ self.image or
+ self.dot or
+ self.msc or
+ self.plantuml or
+ self.anchor or
+ self.formula or
+ self.ref or
+ self.emoji or
+ self.linebreak or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docCaptionType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docCaptionType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docCaptionType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docCaptionType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docCaptionType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docCaptionType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docCaptionType', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for ulink_ in self.ulink:
+ namespaceprefix_ = self.ulink_nsprefix_ + ':' if (UseCapturedNS_ and self.ulink_nsprefix_) else ''
+ ulink_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ulink', pretty_print=pretty_print)
+ for bold_ in self.bold:
+ namespaceprefix_ = self.bold_nsprefix_ + ':' if (UseCapturedNS_ and self.bold_nsprefix_) else ''
+ bold_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='bold', pretty_print=pretty_print)
+ for s_ in self.s:
+ namespaceprefix_ = self.s_nsprefix_ + ':' if (UseCapturedNS_ and self.s_nsprefix_) else ''
+ s_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='s', pretty_print=pretty_print)
+ for strike_ in self.strike:
+ namespaceprefix_ = self.strike_nsprefix_ + ':' if (UseCapturedNS_ and self.strike_nsprefix_) else ''
+ strike_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='strike', pretty_print=pretty_print)
+ for underline_ in self.underline:
+ namespaceprefix_ = self.underline_nsprefix_ + ':' if (UseCapturedNS_ and self.underline_nsprefix_) else ''
+ underline_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='underline', pretty_print=pretty_print)
+ for emphasis_ in self.emphasis:
+ namespaceprefix_ = self.emphasis_nsprefix_ + ':' if (UseCapturedNS_ and self.emphasis_nsprefix_) else ''
+ emphasis_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='emphasis', pretty_print=pretty_print)
+ for computeroutput_ in self.computeroutput:
+ namespaceprefix_ = self.computeroutput_nsprefix_ + ':' if (UseCapturedNS_ and self.computeroutput_nsprefix_) else ''
+ computeroutput_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='computeroutput', pretty_print=pretty_print)
+ for subscript_ in self.subscript:
+ namespaceprefix_ = self.subscript_nsprefix_ + ':' if (UseCapturedNS_ and self.subscript_nsprefix_) else ''
+ subscript_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='subscript', pretty_print=pretty_print)
+ for superscript_ in self.superscript:
+ namespaceprefix_ = self.superscript_nsprefix_ + ':' if (UseCapturedNS_ and self.superscript_nsprefix_) else ''
+ superscript_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='superscript', pretty_print=pretty_print)
+ for center_ in self.center:
+ namespaceprefix_ = self.center_nsprefix_ + ':' if (UseCapturedNS_ and self.center_nsprefix_) else ''
+ center_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='center', pretty_print=pretty_print)
+ for small_ in self.small:
+ namespaceprefix_ = self.small_nsprefix_ + ':' if (UseCapturedNS_ and self.small_nsprefix_) else ''
+ small_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='small', pretty_print=pretty_print)
+ for del_ in self.del_:
+ namespaceprefix_ = self.del__nsprefix_ + ':' if (UseCapturedNS_ and self.del__nsprefix_) else ''
+ del_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='del', pretty_print=pretty_print)
+ for ins_ in self.ins:
+ namespaceprefix_ = self.ins_nsprefix_ + ':' if (UseCapturedNS_ and self.ins_nsprefix_) else ''
+ ins_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ins', pretty_print=pretty_print)
+ for htmlonly_ in self.htmlonly:
+ namespaceprefix_ = self.htmlonly_nsprefix_ + ':' if (UseCapturedNS_ and self.htmlonly_nsprefix_) else ''
+ htmlonly_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='htmlonly', pretty_print=pretty_print)
+ for manonly_ in self.manonly:
+ namespaceprefix_ = self.manonly_nsprefix_ + ':' if (UseCapturedNS_ and self.manonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%smanonly>%s</%smanonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(manonly_), input_name='manonly')), namespaceprefix_ , eol_))
+ for xmlonly_ in self.xmlonly:
+ namespaceprefix_ = self.xmlonly_nsprefix_ + ':' if (UseCapturedNS_ and self.xmlonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sxmlonly>%s</%sxmlonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(xmlonly_), input_name='xmlonly')), namespaceprefix_ , eol_))
+ for rtfonly_ in self.rtfonly:
+ namespaceprefix_ = self.rtfonly_nsprefix_ + ':' if (UseCapturedNS_ and self.rtfonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%srtfonly>%s</%srtfonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(rtfonly_), input_name='rtfonly')), namespaceprefix_ , eol_))
+ for latexonly_ in self.latexonly:
+ namespaceprefix_ = self.latexonly_nsprefix_ + ':' if (UseCapturedNS_ and self.latexonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%slatexonly>%s</%slatexonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(latexonly_), input_name='latexonly')), namespaceprefix_ , eol_))
+ for docbookonly_ in self.docbookonly:
+ namespaceprefix_ = self.docbookonly_nsprefix_ + ':' if (UseCapturedNS_ and self.docbookonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sdocbookonly>%s</%sdocbookonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(docbookonly_), input_name='docbookonly')), namespaceprefix_ , eol_))
+ for image_ in self.image:
+ namespaceprefix_ = self.image_nsprefix_ + ':' if (UseCapturedNS_ and self.image_nsprefix_) else ''
+ image_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='image', pretty_print=pretty_print)
+ for dot_ in self.dot:
+ namespaceprefix_ = self.dot_nsprefix_ + ':' if (UseCapturedNS_ and self.dot_nsprefix_) else ''
+ dot_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='dot', pretty_print=pretty_print)
+ for msc_ in self.msc:
+ namespaceprefix_ = self.msc_nsprefix_ + ':' if (UseCapturedNS_ and self.msc_nsprefix_) else ''
+ msc_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='msc', pretty_print=pretty_print)
+ for plantuml_ in self.plantuml:
+ namespaceprefix_ = self.plantuml_nsprefix_ + ':' if (UseCapturedNS_ and self.plantuml_nsprefix_) else ''
+ plantuml_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='plantuml', pretty_print=pretty_print)
+ for anchor_ in self.anchor:
+ namespaceprefix_ = self.anchor_nsprefix_ + ':' if (UseCapturedNS_ and self.anchor_nsprefix_) else ''
+ anchor_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='anchor', pretty_print=pretty_print)
+ for formula_ in self.formula:
+ namespaceprefix_ = self.formula_nsprefix_ + ':' if (UseCapturedNS_ and self.formula_nsprefix_) else ''
+ formula_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='formula', pretty_print=pretty_print)
+ for ref_ in self.ref:
+ namespaceprefix_ = self.ref_nsprefix_ + ':' if (UseCapturedNS_ and self.ref_nsprefix_) else ''
+ ref_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ref', pretty_print=pretty_print)
+ for emoji_ in self.emoji:
+ namespaceprefix_ = self.emoji_nsprefix_ + ':' if (UseCapturedNS_ and self.emoji_nsprefix_) else ''
+ emoji_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='emoji', pretty_print=pretty_print)
+ for linebreak_ in self.linebreak:
+ namespaceprefix_ = self.linebreak_nsprefix_ + ':' if (UseCapturedNS_ and self.linebreak_nsprefix_) else ''
+ linebreak_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='linebreak', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'ulink':
+ obj_ = docURLLink.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ulink', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ulink'):
+ self.add_ulink(obj_.value)
+ elif hasattr(self, 'set_ulink'):
+ self.set_ulink(obj_.value)
+ elif nodeName_ == 'bold':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'bold', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_bold'):
+ self.add_bold(obj_.value)
+ elif hasattr(self, 'set_bold'):
+ self.set_bold(obj_.value)
+ elif nodeName_ == 's':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 's', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_s'):
+ self.add_s(obj_.value)
+ elif hasattr(self, 'set_s'):
+ self.set_s(obj_.value)
+ elif nodeName_ == 'strike':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'strike', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_strike'):
+ self.add_strike(obj_.value)
+ elif hasattr(self, 'set_strike'):
+ self.set_strike(obj_.value)
+ elif nodeName_ == 'underline':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'underline', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_underline'):
+ self.add_underline(obj_.value)
+ elif hasattr(self, 'set_underline'):
+ self.set_underline(obj_.value)
+ elif nodeName_ == 'emphasis':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'emphasis', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_emphasis'):
+ self.add_emphasis(obj_.value)
+ elif hasattr(self, 'set_emphasis'):
+ self.set_emphasis(obj_.value)
+ elif nodeName_ == 'computeroutput':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'computeroutput', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_computeroutput'):
+ self.add_computeroutput(obj_.value)
+ elif hasattr(self, 'set_computeroutput'):
+ self.set_computeroutput(obj_.value)
+ elif nodeName_ == 'subscript':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'subscript', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_subscript'):
+ self.add_subscript(obj_.value)
+ elif hasattr(self, 'set_subscript'):
+ self.set_subscript(obj_.value)
+ elif nodeName_ == 'superscript':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'superscript', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_superscript'):
+ self.add_superscript(obj_.value)
+ elif hasattr(self, 'set_superscript'):
+ self.set_superscript(obj_.value)
+ elif nodeName_ == 'center':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'center', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_center'):
+ self.add_center(obj_.value)
+ elif hasattr(self, 'set_center'):
+ self.set_center(obj_.value)
+ elif nodeName_ == 'small':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'small', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_small'):
+ self.add_small(obj_.value)
+ elif hasattr(self, 'set_small'):
+ self.set_small(obj_.value)
+ elif nodeName_ == 'del':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'del', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_del'):
+ self.add_del(obj_.value)
+ elif hasattr(self, 'set_del'):
+ self.set_del(obj_.value)
+ elif nodeName_ == 'ins':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ins', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ins'):
+ self.add_ins(obj_.value)
+ elif hasattr(self, 'set_ins'):
+ self.set_ins(obj_.value)
+ elif nodeName_ == 'htmlonly':
+ obj_ = docHtmlOnlyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'htmlonly', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_htmlonly'):
+ self.add_htmlonly(obj_.value)
+ elif hasattr(self, 'set_htmlonly'):
+ self.set_htmlonly(obj_.value)
+ elif nodeName_ == 'manonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'manonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'manonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'manonly', valuestr_)
+ self.content_.append(obj_)
+ self.manonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'xmlonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'xmlonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'xmlonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'xmlonly', valuestr_)
+ self.content_.append(obj_)
+ self.xmlonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'rtfonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'rtfonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'rtfonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'rtfonly', valuestr_)
+ self.content_.append(obj_)
+ self.rtfonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'latexonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'latexonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'latexonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'latexonly', valuestr_)
+ self.content_.append(obj_)
+ self.latexonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'docbookonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'docbookonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'docbookonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'docbookonly', valuestr_)
+ self.content_.append(obj_)
+ self.docbookonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'image':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'image', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_image'):
+ self.add_image(obj_.value)
+ elif hasattr(self, 'set_image'):
+ self.set_image(obj_.value)
+ elif nodeName_ == 'dot':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'dot', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_dot'):
+ self.add_dot(obj_.value)
+ elif hasattr(self, 'set_dot'):
+ self.set_dot(obj_.value)
+ elif nodeName_ == 'msc':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'msc', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_msc'):
+ self.add_msc(obj_.value)
+ elif hasattr(self, 'set_msc'):
+ self.set_msc(obj_.value)
+ elif nodeName_ == 'plantuml':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'plantuml', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_plantuml'):
+ self.add_plantuml(obj_.value)
+ elif hasattr(self, 'set_plantuml'):
+ self.set_plantuml(obj_.value)
+ elif nodeName_ == 'anchor':
+ obj_ = docAnchorType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'anchor', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_anchor'):
+ self.add_anchor(obj_.value)
+ elif hasattr(self, 'set_anchor'):
+ self.set_anchor(obj_.value)
+ elif nodeName_ == 'formula':
+ obj_ = docFormulaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'formula', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_formula'):
+ self.add_formula(obj_.value)
+ elif hasattr(self, 'set_formula'):
+ self.set_formula(obj_.value)
+ elif nodeName_ == 'ref':
+ obj_ = docRefTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ref', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ref'):
+ self.add_ref(obj_.value)
+ elif hasattr(self, 'set_ref'):
+ self.set_ref(obj_.value)
+ elif nodeName_ == 'emoji':
+ obj_ = docEmojiType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'emoji', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_emoji'):
+ self.add_emoji(obj_.value)
+ elif hasattr(self, 'set_emoji'):
+ self.set_emoji(obj_.value)
+ elif nodeName_ == 'linebreak':
+ obj_ = docEmptyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'linebreak', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_linebreak'):
+ self.add_linebreak(obj_.value)
+ elif hasattr(self, 'set_linebreak'):
+ self.set_linebreak(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docCaptionType
+
+
+class docHeadingType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, level=None, ulink=None, bold=None, s=None, strike=None, underline=None, emphasis=None, computeroutput=None, subscript=None, superscript=None, center=None, small=None, del_=None, ins=None, htmlonly=None, manonly=None, xmlonly=None, rtfonly=None, latexonly=None, docbookonly=None, image=None, dot=None, msc=None, plantuml=None, anchor=None, formula=None, ref=None, emoji=None, linebreak=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.level = _cast(int, level)
+ self.level_nsprefix_ = None
+ if ulink is None:
+ self.ulink = []
+ else:
+ self.ulink = ulink
+ self.ulink_nsprefix_ = None
+ if bold is None:
+ self.bold = []
+ else:
+ self.bold = bold
+ self.bold_nsprefix_ = None
+ if s is None:
+ self.s = []
+ else:
+ self.s = s
+ self.s_nsprefix_ = None
+ if strike is None:
+ self.strike = []
+ else:
+ self.strike = strike
+ self.strike_nsprefix_ = None
+ if underline is None:
+ self.underline = []
+ else:
+ self.underline = underline
+ self.underline_nsprefix_ = None
+ if emphasis is None:
+ self.emphasis = []
+ else:
+ self.emphasis = emphasis
+ self.emphasis_nsprefix_ = None
+ if computeroutput is None:
+ self.computeroutput = []
+ else:
+ self.computeroutput = computeroutput
+ self.computeroutput_nsprefix_ = None
+ if subscript is None:
+ self.subscript = []
+ else:
+ self.subscript = subscript
+ self.subscript_nsprefix_ = None
+ if superscript is None:
+ self.superscript = []
+ else:
+ self.superscript = superscript
+ self.superscript_nsprefix_ = None
+ if center is None:
+ self.center = []
+ else:
+ self.center = center
+ self.center_nsprefix_ = None
+ if small is None:
+ self.small = []
+ else:
+ self.small = small
+ self.small_nsprefix_ = None
+ if del_ is None:
+ self.del_ = []
+ else:
+ self.del_ = del_
+ self.del__nsprefix_ = None
+ if ins is None:
+ self.ins = []
+ else:
+ self.ins = ins
+ self.ins_nsprefix_ = None
+ if htmlonly is None:
+ self.htmlonly = []
+ else:
+ self.htmlonly = htmlonly
+ self.htmlonly_nsprefix_ = None
+ if manonly is None:
+ self.manonly = []
+ else:
+ self.manonly = manonly
+ self.manonly_nsprefix_ = None
+ if xmlonly is None:
+ self.xmlonly = []
+ else:
+ self.xmlonly = xmlonly
+ self.xmlonly_nsprefix_ = None
+ if rtfonly is None:
+ self.rtfonly = []
+ else:
+ self.rtfonly = rtfonly
+ self.rtfonly_nsprefix_ = None
+ if latexonly is None:
+ self.latexonly = []
+ else:
+ self.latexonly = latexonly
+ self.latexonly_nsprefix_ = None
+ if docbookonly is None:
+ self.docbookonly = []
+ else:
+ self.docbookonly = docbookonly
+ self.docbookonly_nsprefix_ = None
+ if image is None:
+ self.image = []
+ else:
+ self.image = image
+ self.image_nsprefix_ = None
+ if dot is None:
+ self.dot = []
+ else:
+ self.dot = dot
+ self.dot_nsprefix_ = None
+ if msc is None:
+ self.msc = []
+ else:
+ self.msc = msc
+ self.msc_nsprefix_ = None
+ if plantuml is None:
+ self.plantuml = []
+ else:
+ self.plantuml = plantuml
+ self.plantuml_nsprefix_ = None
+ if anchor is None:
+ self.anchor = []
+ else:
+ self.anchor = anchor
+ self.anchor_nsprefix_ = None
+ if formula is None:
+ self.formula = []
+ else:
+ self.formula = formula
+ self.formula_nsprefix_ = None
+ if ref is None:
+ self.ref = []
+ else:
+ self.ref = ref
+ self.ref_nsprefix_ = None
+ if emoji is None:
+ self.emoji = []
+ else:
+ self.emoji = emoji
+ self.emoji_nsprefix_ = None
+ if linebreak is None:
+ self.linebreak = []
+ else:
+ self.linebreak = linebreak
+ self.linebreak_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docHeadingType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docHeadingType.subclass:
+ return docHeadingType.subclass(*args_, **kwargs_)
+ else:
+ return docHeadingType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_ulink(self):
+ return self.ulink
+ def set_ulink(self, ulink):
+ self.ulink = ulink
+ def add_ulink(self, value):
+ self.ulink.append(value)
+ def insert_ulink_at(self, index, value):
+ self.ulink.insert(index, value)
+ def replace_ulink_at(self, index, value):
+ self.ulink[index] = value
+ def get_bold(self):
+ return self.bold
+ def set_bold(self, bold):
+ self.bold = bold
+ def add_bold(self, value):
+ self.bold.append(value)
+ def insert_bold_at(self, index, value):
+ self.bold.insert(index, value)
+ def replace_bold_at(self, index, value):
+ self.bold[index] = value
+ def get_s(self):
+ return self.s
+ def set_s(self, s):
+ self.s = s
+ def add_s(self, value):
+ self.s.append(value)
+ def insert_s_at(self, index, value):
+ self.s.insert(index, value)
+ def replace_s_at(self, index, value):
+ self.s[index] = value
+ def get_strike(self):
+ return self.strike
+ def set_strike(self, strike):
+ self.strike = strike
+ def add_strike(self, value):
+ self.strike.append(value)
+ def insert_strike_at(self, index, value):
+ self.strike.insert(index, value)
+ def replace_strike_at(self, index, value):
+ self.strike[index] = value
+ def get_underline(self):
+ return self.underline
+ def set_underline(self, underline):
+ self.underline = underline
+ def add_underline(self, value):
+ self.underline.append(value)
+ def insert_underline_at(self, index, value):
+ self.underline.insert(index, value)
+ def replace_underline_at(self, index, value):
+ self.underline[index] = value
+ def get_emphasis(self):
+ return self.emphasis
+ def set_emphasis(self, emphasis):
+ self.emphasis = emphasis
+ def add_emphasis(self, value):
+ self.emphasis.append(value)
+ def insert_emphasis_at(self, index, value):
+ self.emphasis.insert(index, value)
+ def replace_emphasis_at(self, index, value):
+ self.emphasis[index] = value
+ def get_computeroutput(self):
+ return self.computeroutput
+ def set_computeroutput(self, computeroutput):
+ self.computeroutput = computeroutput
+ def add_computeroutput(self, value):
+ self.computeroutput.append(value)
+ def insert_computeroutput_at(self, index, value):
+ self.computeroutput.insert(index, value)
+ def replace_computeroutput_at(self, index, value):
+ self.computeroutput[index] = value
+ def get_subscript(self):
+ return self.subscript
+ def set_subscript(self, subscript):
+ self.subscript = subscript
+ def add_subscript(self, value):
+ self.subscript.append(value)
+ def insert_subscript_at(self, index, value):
+ self.subscript.insert(index, value)
+ def replace_subscript_at(self, index, value):
+ self.subscript[index] = value
+ def get_superscript(self):
+ return self.superscript
+ def set_superscript(self, superscript):
+ self.superscript = superscript
+ def add_superscript(self, value):
+ self.superscript.append(value)
+ def insert_superscript_at(self, index, value):
+ self.superscript.insert(index, value)
+ def replace_superscript_at(self, index, value):
+ self.superscript[index] = value
+ def get_center(self):
+ return self.center
+ def set_center(self, center):
+ self.center = center
+ def add_center(self, value):
+ self.center.append(value)
+ def insert_center_at(self, index, value):
+ self.center.insert(index, value)
+ def replace_center_at(self, index, value):
+ self.center[index] = value
+ def get_small(self):
+ return self.small
+ def set_small(self, small):
+ self.small = small
+ def add_small(self, value):
+ self.small.append(value)
+ def insert_small_at(self, index, value):
+ self.small.insert(index, value)
+ def replace_small_at(self, index, value):
+ self.small[index] = value
+ def get_del(self):
+ return self.del_
+ def set_del(self, del_):
+ self.del_ = del_
+ def add_del(self, value):
+ self.del_.append(value)
+ def insert_del_at(self, index, value):
+ self.del_.insert(index, value)
+ def replace_del_at(self, index, value):
+ self.del_[index] = value
+ def get_ins(self):
+ return self.ins
+ def set_ins(self, ins):
+ self.ins = ins
+ def add_ins(self, value):
+ self.ins.append(value)
+ def insert_ins_at(self, index, value):
+ self.ins.insert(index, value)
+ def replace_ins_at(self, index, value):
+ self.ins[index] = value
+ def get_htmlonly(self):
+ return self.htmlonly
+ def set_htmlonly(self, htmlonly):
+ self.htmlonly = htmlonly
+ def add_htmlonly(self, value):
+ self.htmlonly.append(value)
+ def insert_htmlonly_at(self, index, value):
+ self.htmlonly.insert(index, value)
+ def replace_htmlonly_at(self, index, value):
+ self.htmlonly[index] = value
+ def get_manonly(self):
+ return self.manonly
+ def set_manonly(self, manonly):
+ self.manonly = manonly
+ def add_manonly(self, value):
+ self.manonly.append(value)
+ def insert_manonly_at(self, index, value):
+ self.manonly.insert(index, value)
+ def replace_manonly_at(self, index, value):
+ self.manonly[index] = value
+ def get_xmlonly(self):
+ return self.xmlonly
+ def set_xmlonly(self, xmlonly):
+ self.xmlonly = xmlonly
+ def add_xmlonly(self, value):
+ self.xmlonly.append(value)
+ def insert_xmlonly_at(self, index, value):
+ self.xmlonly.insert(index, value)
+ def replace_xmlonly_at(self, index, value):
+ self.xmlonly[index] = value
+ def get_rtfonly(self):
+ return self.rtfonly
+ def set_rtfonly(self, rtfonly):
+ self.rtfonly = rtfonly
+ def add_rtfonly(self, value):
+ self.rtfonly.append(value)
+ def insert_rtfonly_at(self, index, value):
+ self.rtfonly.insert(index, value)
+ def replace_rtfonly_at(self, index, value):
+ self.rtfonly[index] = value
+ def get_latexonly(self):
+ return self.latexonly
+ def set_latexonly(self, latexonly):
+ self.latexonly = latexonly
+ def add_latexonly(self, value):
+ self.latexonly.append(value)
+ def insert_latexonly_at(self, index, value):
+ self.latexonly.insert(index, value)
+ def replace_latexonly_at(self, index, value):
+ self.latexonly[index] = value
+ def get_docbookonly(self):
+ return self.docbookonly
+ def set_docbookonly(self, docbookonly):
+ self.docbookonly = docbookonly
+ def add_docbookonly(self, value):
+ self.docbookonly.append(value)
+ def insert_docbookonly_at(self, index, value):
+ self.docbookonly.insert(index, value)
+ def replace_docbookonly_at(self, index, value):
+ self.docbookonly[index] = value
+ def get_image(self):
+ return self.image
+ def set_image(self, image):
+ self.image = image
+ def add_image(self, value):
+ self.image.append(value)
+ def insert_image_at(self, index, value):
+ self.image.insert(index, value)
+ def replace_image_at(self, index, value):
+ self.image[index] = value
+ def get_dot(self):
+ return self.dot
+ def set_dot(self, dot):
+ self.dot = dot
+ def add_dot(self, value):
+ self.dot.append(value)
+ def insert_dot_at(self, index, value):
+ self.dot.insert(index, value)
+ def replace_dot_at(self, index, value):
+ self.dot[index] = value
+ def get_msc(self):
+ return self.msc
+ def set_msc(self, msc):
+ self.msc = msc
+ def add_msc(self, value):
+ self.msc.append(value)
+ def insert_msc_at(self, index, value):
+ self.msc.insert(index, value)
+ def replace_msc_at(self, index, value):
+ self.msc[index] = value
+ def get_plantuml(self):
+ return self.plantuml
+ def set_plantuml(self, plantuml):
+ self.plantuml = plantuml
+ def add_plantuml(self, value):
+ self.plantuml.append(value)
+ def insert_plantuml_at(self, index, value):
+ self.plantuml.insert(index, value)
+ def replace_plantuml_at(self, index, value):
+ self.plantuml[index] = value
+ def get_anchor(self):
+ return self.anchor
+ def set_anchor(self, anchor):
+ self.anchor = anchor
+ def add_anchor(self, value):
+ self.anchor.append(value)
+ def insert_anchor_at(self, index, value):
+ self.anchor.insert(index, value)
+ def replace_anchor_at(self, index, value):
+ self.anchor[index] = value
+ def get_formula(self):
+ return self.formula
+ def set_formula(self, formula):
+ self.formula = formula
+ def add_formula(self, value):
+ self.formula.append(value)
+ def insert_formula_at(self, index, value):
+ self.formula.insert(index, value)
+ def replace_formula_at(self, index, value):
+ self.formula[index] = value
+ def get_ref(self):
+ return self.ref
+ def set_ref(self, ref):
+ self.ref = ref
+ def add_ref(self, value):
+ self.ref.append(value)
+ def insert_ref_at(self, index, value):
+ self.ref.insert(index, value)
+ def replace_ref_at(self, index, value):
+ self.ref[index] = value
+ def get_emoji(self):
+ return self.emoji
+ def set_emoji(self, emoji):
+ self.emoji = emoji
+ def add_emoji(self, value):
+ self.emoji.append(value)
+ def insert_emoji_at(self, index, value):
+ self.emoji.insert(index, value)
+ def replace_emoji_at(self, index, value):
+ self.emoji[index] = value
+ def get_linebreak(self):
+ return self.linebreak
+ def set_linebreak(self, linebreak):
+ self.linebreak = linebreak
+ def add_linebreak(self, value):
+ self.linebreak.append(value)
+ def insert_linebreak_at(self, index, value):
+ self.linebreak.insert(index, value)
+ def replace_linebreak_at(self, index, value):
+ self.linebreak[index] = value
+ def get_level(self):
+ return self.level
+ def set_level(self, level):
+ self.level = level
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.ulink or
+ self.bold or
+ self.s or
+ self.strike or
+ self.underline or
+ self.emphasis or
+ self.computeroutput or
+ self.subscript or
+ self.superscript or
+ self.center or
+ self.small or
+ self.del_ or
+ self.ins or
+ self.htmlonly or
+ self.manonly or
+ self.xmlonly or
+ self.rtfonly or
+ self.latexonly or
+ self.docbookonly or
+ self.image or
+ self.dot or
+ self.msc or
+ self.plantuml or
+ self.anchor or
+ self.formula or
+ self.ref or
+ self.emoji or
+ self.linebreak or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docHeadingType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docHeadingType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docHeadingType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docHeadingType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docHeadingType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docHeadingType'):
+ if self.level is not None and 'level' not in already_processed:
+ already_processed.add('level')
+ outfile.write(' level="%s"' % self.gds_format_integer(self.level, input_name='level'))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docHeadingType', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for ulink_ in self.ulink:
+ namespaceprefix_ = self.ulink_nsprefix_ + ':' if (UseCapturedNS_ and self.ulink_nsprefix_) else ''
+ ulink_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ulink', pretty_print=pretty_print)
+ for bold_ in self.bold:
+ namespaceprefix_ = self.bold_nsprefix_ + ':' if (UseCapturedNS_ and self.bold_nsprefix_) else ''
+ bold_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='bold', pretty_print=pretty_print)
+ for s_ in self.s:
+ namespaceprefix_ = self.s_nsprefix_ + ':' if (UseCapturedNS_ and self.s_nsprefix_) else ''
+ s_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='s', pretty_print=pretty_print)
+ for strike_ in self.strike:
+ namespaceprefix_ = self.strike_nsprefix_ + ':' if (UseCapturedNS_ and self.strike_nsprefix_) else ''
+ strike_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='strike', pretty_print=pretty_print)
+ for underline_ in self.underline:
+ namespaceprefix_ = self.underline_nsprefix_ + ':' if (UseCapturedNS_ and self.underline_nsprefix_) else ''
+ underline_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='underline', pretty_print=pretty_print)
+ for emphasis_ in self.emphasis:
+ namespaceprefix_ = self.emphasis_nsprefix_ + ':' if (UseCapturedNS_ and self.emphasis_nsprefix_) else ''
+ emphasis_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='emphasis', pretty_print=pretty_print)
+ for computeroutput_ in self.computeroutput:
+ namespaceprefix_ = self.computeroutput_nsprefix_ + ':' if (UseCapturedNS_ and self.computeroutput_nsprefix_) else ''
+ computeroutput_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='computeroutput', pretty_print=pretty_print)
+ for subscript_ in self.subscript:
+ namespaceprefix_ = self.subscript_nsprefix_ + ':' if (UseCapturedNS_ and self.subscript_nsprefix_) else ''
+ subscript_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='subscript', pretty_print=pretty_print)
+ for superscript_ in self.superscript:
+ namespaceprefix_ = self.superscript_nsprefix_ + ':' if (UseCapturedNS_ and self.superscript_nsprefix_) else ''
+ superscript_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='superscript', pretty_print=pretty_print)
+ for center_ in self.center:
+ namespaceprefix_ = self.center_nsprefix_ + ':' if (UseCapturedNS_ and self.center_nsprefix_) else ''
+ center_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='center', pretty_print=pretty_print)
+ for small_ in self.small:
+ namespaceprefix_ = self.small_nsprefix_ + ':' if (UseCapturedNS_ and self.small_nsprefix_) else ''
+ small_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='small', pretty_print=pretty_print)
+ for del_ in self.del_:
+ namespaceprefix_ = self.del__nsprefix_ + ':' if (UseCapturedNS_ and self.del__nsprefix_) else ''
+ del_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='del', pretty_print=pretty_print)
+ for ins_ in self.ins:
+ namespaceprefix_ = self.ins_nsprefix_ + ':' if (UseCapturedNS_ and self.ins_nsprefix_) else ''
+ ins_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ins', pretty_print=pretty_print)
+ for htmlonly_ in self.htmlonly:
+ namespaceprefix_ = self.htmlonly_nsprefix_ + ':' if (UseCapturedNS_ and self.htmlonly_nsprefix_) else ''
+ htmlonly_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='htmlonly', pretty_print=pretty_print)
+ for manonly_ in self.manonly:
+ namespaceprefix_ = self.manonly_nsprefix_ + ':' if (UseCapturedNS_ and self.manonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%smanonly>%s</%smanonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(manonly_), input_name='manonly')), namespaceprefix_ , eol_))
+ for xmlonly_ in self.xmlonly:
+ namespaceprefix_ = self.xmlonly_nsprefix_ + ':' if (UseCapturedNS_ and self.xmlonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sxmlonly>%s</%sxmlonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(xmlonly_), input_name='xmlonly')), namespaceprefix_ , eol_))
+ for rtfonly_ in self.rtfonly:
+ namespaceprefix_ = self.rtfonly_nsprefix_ + ':' if (UseCapturedNS_ and self.rtfonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%srtfonly>%s</%srtfonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(rtfonly_), input_name='rtfonly')), namespaceprefix_ , eol_))
+ for latexonly_ in self.latexonly:
+ namespaceprefix_ = self.latexonly_nsprefix_ + ':' if (UseCapturedNS_ and self.latexonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%slatexonly>%s</%slatexonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(latexonly_), input_name='latexonly')), namespaceprefix_ , eol_))
+ for docbookonly_ in self.docbookonly:
+ namespaceprefix_ = self.docbookonly_nsprefix_ + ':' if (UseCapturedNS_ and self.docbookonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sdocbookonly>%s</%sdocbookonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(docbookonly_), input_name='docbookonly')), namespaceprefix_ , eol_))
+ for image_ in self.image:
+ namespaceprefix_ = self.image_nsprefix_ + ':' if (UseCapturedNS_ and self.image_nsprefix_) else ''
+ image_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='image', pretty_print=pretty_print)
+ for dot_ in self.dot:
+ namespaceprefix_ = self.dot_nsprefix_ + ':' if (UseCapturedNS_ and self.dot_nsprefix_) else ''
+ dot_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='dot', pretty_print=pretty_print)
+ for msc_ in self.msc:
+ namespaceprefix_ = self.msc_nsprefix_ + ':' if (UseCapturedNS_ and self.msc_nsprefix_) else ''
+ msc_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='msc', pretty_print=pretty_print)
+ for plantuml_ in self.plantuml:
+ namespaceprefix_ = self.plantuml_nsprefix_ + ':' if (UseCapturedNS_ and self.plantuml_nsprefix_) else ''
+ plantuml_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='plantuml', pretty_print=pretty_print)
+ for anchor_ in self.anchor:
+ namespaceprefix_ = self.anchor_nsprefix_ + ':' if (UseCapturedNS_ and self.anchor_nsprefix_) else ''
+ anchor_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='anchor', pretty_print=pretty_print)
+ for formula_ in self.formula:
+ namespaceprefix_ = self.formula_nsprefix_ + ':' if (UseCapturedNS_ and self.formula_nsprefix_) else ''
+ formula_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='formula', pretty_print=pretty_print)
+ for ref_ in self.ref:
+ namespaceprefix_ = self.ref_nsprefix_ + ':' if (UseCapturedNS_ and self.ref_nsprefix_) else ''
+ ref_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ref', pretty_print=pretty_print)
+ for emoji_ in self.emoji:
+ namespaceprefix_ = self.emoji_nsprefix_ + ':' if (UseCapturedNS_ and self.emoji_nsprefix_) else ''
+ emoji_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='emoji', pretty_print=pretty_print)
+ for linebreak_ in self.linebreak:
+ namespaceprefix_ = self.linebreak_nsprefix_ + ':' if (UseCapturedNS_ and self.linebreak_nsprefix_) else ''
+ linebreak_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='linebreak', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('level', node)
+ if value is not None and 'level' not in already_processed:
+ already_processed.add('level')
+ self.level = self.gds_parse_integer(value, node, 'level')
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'ulink':
+ obj_ = docURLLink.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ulink', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ulink'):
+ self.add_ulink(obj_.value)
+ elif hasattr(self, 'set_ulink'):
+ self.set_ulink(obj_.value)
+ elif nodeName_ == 'bold':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'bold', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_bold'):
+ self.add_bold(obj_.value)
+ elif hasattr(self, 'set_bold'):
+ self.set_bold(obj_.value)
+ elif nodeName_ == 's':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 's', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_s'):
+ self.add_s(obj_.value)
+ elif hasattr(self, 'set_s'):
+ self.set_s(obj_.value)
+ elif nodeName_ == 'strike':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'strike', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_strike'):
+ self.add_strike(obj_.value)
+ elif hasattr(self, 'set_strike'):
+ self.set_strike(obj_.value)
+ elif nodeName_ == 'underline':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'underline', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_underline'):
+ self.add_underline(obj_.value)
+ elif hasattr(self, 'set_underline'):
+ self.set_underline(obj_.value)
+ elif nodeName_ == 'emphasis':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'emphasis', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_emphasis'):
+ self.add_emphasis(obj_.value)
+ elif hasattr(self, 'set_emphasis'):
+ self.set_emphasis(obj_.value)
+ elif nodeName_ == 'computeroutput':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'computeroutput', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_computeroutput'):
+ self.add_computeroutput(obj_.value)
+ elif hasattr(self, 'set_computeroutput'):
+ self.set_computeroutput(obj_.value)
+ elif nodeName_ == 'subscript':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'subscript', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_subscript'):
+ self.add_subscript(obj_.value)
+ elif hasattr(self, 'set_subscript'):
+ self.set_subscript(obj_.value)
+ elif nodeName_ == 'superscript':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'superscript', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_superscript'):
+ self.add_superscript(obj_.value)
+ elif hasattr(self, 'set_superscript'):
+ self.set_superscript(obj_.value)
+ elif nodeName_ == 'center':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'center', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_center'):
+ self.add_center(obj_.value)
+ elif hasattr(self, 'set_center'):
+ self.set_center(obj_.value)
+ elif nodeName_ == 'small':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'small', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_small'):
+ self.add_small(obj_.value)
+ elif hasattr(self, 'set_small'):
+ self.set_small(obj_.value)
+ elif nodeName_ == 'del':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'del', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_del'):
+ self.add_del(obj_.value)
+ elif hasattr(self, 'set_del'):
+ self.set_del(obj_.value)
+ elif nodeName_ == 'ins':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ins', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ins'):
+ self.add_ins(obj_.value)
+ elif hasattr(self, 'set_ins'):
+ self.set_ins(obj_.value)
+ elif nodeName_ == 'htmlonly':
+ obj_ = docHtmlOnlyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'htmlonly', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_htmlonly'):
+ self.add_htmlonly(obj_.value)
+ elif hasattr(self, 'set_htmlonly'):
+ self.set_htmlonly(obj_.value)
+ elif nodeName_ == 'manonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'manonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'manonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'manonly', valuestr_)
+ self.content_.append(obj_)
+ self.manonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'xmlonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'xmlonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'xmlonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'xmlonly', valuestr_)
+ self.content_.append(obj_)
+ self.xmlonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'rtfonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'rtfonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'rtfonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'rtfonly', valuestr_)
+ self.content_.append(obj_)
+ self.rtfonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'latexonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'latexonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'latexonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'latexonly', valuestr_)
+ self.content_.append(obj_)
+ self.latexonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'docbookonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'docbookonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'docbookonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'docbookonly', valuestr_)
+ self.content_.append(obj_)
+ self.docbookonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'image':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'image', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_image'):
+ self.add_image(obj_.value)
+ elif hasattr(self, 'set_image'):
+ self.set_image(obj_.value)
+ elif nodeName_ == 'dot':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'dot', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_dot'):
+ self.add_dot(obj_.value)
+ elif hasattr(self, 'set_dot'):
+ self.set_dot(obj_.value)
+ elif nodeName_ == 'msc':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'msc', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_msc'):
+ self.add_msc(obj_.value)
+ elif hasattr(self, 'set_msc'):
+ self.set_msc(obj_.value)
+ elif nodeName_ == 'plantuml':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'plantuml', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_plantuml'):
+ self.add_plantuml(obj_.value)
+ elif hasattr(self, 'set_plantuml'):
+ self.set_plantuml(obj_.value)
+ elif nodeName_ == 'anchor':
+ obj_ = docAnchorType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'anchor', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_anchor'):
+ self.add_anchor(obj_.value)
+ elif hasattr(self, 'set_anchor'):
+ self.set_anchor(obj_.value)
+ elif nodeName_ == 'formula':
+ obj_ = docFormulaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'formula', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_formula'):
+ self.add_formula(obj_.value)
+ elif hasattr(self, 'set_formula'):
+ self.set_formula(obj_.value)
+ elif nodeName_ == 'ref':
+ obj_ = docRefTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ref', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ref'):
+ self.add_ref(obj_.value)
+ elif hasattr(self, 'set_ref'):
+ self.set_ref(obj_.value)
+ elif nodeName_ == 'emoji':
+ obj_ = docEmojiType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'emoji', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_emoji'):
+ self.add_emoji(obj_.value)
+ elif hasattr(self, 'set_emoji'):
+ self.set_emoji(obj_.value)
+ elif nodeName_ == 'linebreak':
+ obj_ = docEmptyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'linebreak', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_linebreak'):
+ self.add_linebreak(obj_.value)
+ elif hasattr(self, 'set_linebreak'):
+ self.set_linebreak(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docHeadingType
+
+
+class docImageType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, type_=None, name=None, width=None, height=None, alt=None, inline=None, caption=None, ulink=None, bold=None, s=None, strike=None, underline=None, emphasis=None, computeroutput=None, subscript=None, superscript=None, center=None, small=None, del_=None, ins=None, htmlonly=None, manonly=None, xmlonly=None, rtfonly=None, latexonly=None, docbookonly=None, image=None, dot=None, msc=None, plantuml=None, anchor=None, formula=None, ref=None, emoji=None, linebreak=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.type_ = _cast(None, type_)
+ self.type__nsprefix_ = None
+ self.name = _cast(None, name)
+ self.name_nsprefix_ = None
+ self.width = _cast(None, width)
+ self.width_nsprefix_ = None
+ self.height = _cast(None, height)
+ self.height_nsprefix_ = None
+ self.alt = _cast(None, alt)
+ self.alt_nsprefix_ = None
+ self.inline = _cast(None, inline)
+ self.inline_nsprefix_ = None
+ self.caption = _cast(None, caption)
+ self.caption_nsprefix_ = None
+ if ulink is None:
+ self.ulink = []
+ else:
+ self.ulink = ulink
+ self.ulink_nsprefix_ = None
+ if bold is None:
+ self.bold = []
+ else:
+ self.bold = bold
+ self.bold_nsprefix_ = None
+ if s is None:
+ self.s = []
+ else:
+ self.s = s
+ self.s_nsprefix_ = None
+ if strike is None:
+ self.strike = []
+ else:
+ self.strike = strike
+ self.strike_nsprefix_ = None
+ if underline is None:
+ self.underline = []
+ else:
+ self.underline = underline
+ self.underline_nsprefix_ = None
+ if emphasis is None:
+ self.emphasis = []
+ else:
+ self.emphasis = emphasis
+ self.emphasis_nsprefix_ = None
+ if computeroutput is None:
+ self.computeroutput = []
+ else:
+ self.computeroutput = computeroutput
+ self.computeroutput_nsprefix_ = None
+ if subscript is None:
+ self.subscript = []
+ else:
+ self.subscript = subscript
+ self.subscript_nsprefix_ = None
+ if superscript is None:
+ self.superscript = []
+ else:
+ self.superscript = superscript
+ self.superscript_nsprefix_ = None
+ if center is None:
+ self.center = []
+ else:
+ self.center = center
+ self.center_nsprefix_ = None
+ if small is None:
+ self.small = []
+ else:
+ self.small = small
+ self.small_nsprefix_ = None
+ if del_ is None:
+ self.del_ = []
+ else:
+ self.del_ = del_
+ self.del__nsprefix_ = None
+ if ins is None:
+ self.ins = []
+ else:
+ self.ins = ins
+ self.ins_nsprefix_ = None
+ if htmlonly is None:
+ self.htmlonly = []
+ else:
+ self.htmlonly = htmlonly
+ self.htmlonly_nsprefix_ = None
+ if manonly is None:
+ self.manonly = []
+ else:
+ self.manonly = manonly
+ self.manonly_nsprefix_ = None
+ if xmlonly is None:
+ self.xmlonly = []
+ else:
+ self.xmlonly = xmlonly
+ self.xmlonly_nsprefix_ = None
+ if rtfonly is None:
+ self.rtfonly = []
+ else:
+ self.rtfonly = rtfonly
+ self.rtfonly_nsprefix_ = None
+ if latexonly is None:
+ self.latexonly = []
+ else:
+ self.latexonly = latexonly
+ self.latexonly_nsprefix_ = None
+ if docbookonly is None:
+ self.docbookonly = []
+ else:
+ self.docbookonly = docbookonly
+ self.docbookonly_nsprefix_ = None
+ if image is None:
+ self.image = []
+ else:
+ self.image = image
+ self.image_nsprefix_ = None
+ if dot is None:
+ self.dot = []
+ else:
+ self.dot = dot
+ self.dot_nsprefix_ = None
+ if msc is None:
+ self.msc = []
+ else:
+ self.msc = msc
+ self.msc_nsprefix_ = None
+ if plantuml is None:
+ self.plantuml = []
+ else:
+ self.plantuml = plantuml
+ self.plantuml_nsprefix_ = None
+ if anchor is None:
+ self.anchor = []
+ else:
+ self.anchor = anchor
+ self.anchor_nsprefix_ = None
+ if formula is None:
+ self.formula = []
+ else:
+ self.formula = formula
+ self.formula_nsprefix_ = None
+ if ref is None:
+ self.ref = []
+ else:
+ self.ref = ref
+ self.ref_nsprefix_ = None
+ if emoji is None:
+ self.emoji = []
+ else:
+ self.emoji = emoji
+ self.emoji_nsprefix_ = None
+ if linebreak is None:
+ self.linebreak = []
+ else:
+ self.linebreak = linebreak
+ self.linebreak_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docImageType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docImageType.subclass:
+ return docImageType.subclass(*args_, **kwargs_)
+ else:
+ return docImageType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_ulink(self):
+ return self.ulink
+ def set_ulink(self, ulink):
+ self.ulink = ulink
+ def add_ulink(self, value):
+ self.ulink.append(value)
+ def insert_ulink_at(self, index, value):
+ self.ulink.insert(index, value)
+ def replace_ulink_at(self, index, value):
+ self.ulink[index] = value
+ def get_bold(self):
+ return self.bold
+ def set_bold(self, bold):
+ self.bold = bold
+ def add_bold(self, value):
+ self.bold.append(value)
+ def insert_bold_at(self, index, value):
+ self.bold.insert(index, value)
+ def replace_bold_at(self, index, value):
+ self.bold[index] = value
+ def get_s(self):
+ return self.s
+ def set_s(self, s):
+ self.s = s
+ def add_s(self, value):
+ self.s.append(value)
+ def insert_s_at(self, index, value):
+ self.s.insert(index, value)
+ def replace_s_at(self, index, value):
+ self.s[index] = value
+ def get_strike(self):
+ return self.strike
+ def set_strike(self, strike):
+ self.strike = strike
+ def add_strike(self, value):
+ self.strike.append(value)
+ def insert_strike_at(self, index, value):
+ self.strike.insert(index, value)
+ def replace_strike_at(self, index, value):
+ self.strike[index] = value
+ def get_underline(self):
+ return self.underline
+ def set_underline(self, underline):
+ self.underline = underline
+ def add_underline(self, value):
+ self.underline.append(value)
+ def insert_underline_at(self, index, value):
+ self.underline.insert(index, value)
+ def replace_underline_at(self, index, value):
+ self.underline[index] = value
+ def get_emphasis(self):
+ return self.emphasis
+ def set_emphasis(self, emphasis):
+ self.emphasis = emphasis
+ def add_emphasis(self, value):
+ self.emphasis.append(value)
+ def insert_emphasis_at(self, index, value):
+ self.emphasis.insert(index, value)
+ def replace_emphasis_at(self, index, value):
+ self.emphasis[index] = value
+ def get_computeroutput(self):
+ return self.computeroutput
+ def set_computeroutput(self, computeroutput):
+ self.computeroutput = computeroutput
+ def add_computeroutput(self, value):
+ self.computeroutput.append(value)
+ def insert_computeroutput_at(self, index, value):
+ self.computeroutput.insert(index, value)
+ def replace_computeroutput_at(self, index, value):
+ self.computeroutput[index] = value
+ def get_subscript(self):
+ return self.subscript
+ def set_subscript(self, subscript):
+ self.subscript = subscript
+ def add_subscript(self, value):
+ self.subscript.append(value)
+ def insert_subscript_at(self, index, value):
+ self.subscript.insert(index, value)
+ def replace_subscript_at(self, index, value):
+ self.subscript[index] = value
+ def get_superscript(self):
+ return self.superscript
+ def set_superscript(self, superscript):
+ self.superscript = superscript
+ def add_superscript(self, value):
+ self.superscript.append(value)
+ def insert_superscript_at(self, index, value):
+ self.superscript.insert(index, value)
+ def replace_superscript_at(self, index, value):
+ self.superscript[index] = value
+ def get_center(self):
+ return self.center
+ def set_center(self, center):
+ self.center = center
+ def add_center(self, value):
+ self.center.append(value)
+ def insert_center_at(self, index, value):
+ self.center.insert(index, value)
+ def replace_center_at(self, index, value):
+ self.center[index] = value
+ def get_small(self):
+ return self.small
+ def set_small(self, small):
+ self.small = small
+ def add_small(self, value):
+ self.small.append(value)
+ def insert_small_at(self, index, value):
+ self.small.insert(index, value)
+ def replace_small_at(self, index, value):
+ self.small[index] = value
+ def get_del(self):
+ return self.del_
+ def set_del(self, del_):
+ self.del_ = del_
+ def add_del(self, value):
+ self.del_.append(value)
+ def insert_del_at(self, index, value):
+ self.del_.insert(index, value)
+ def replace_del_at(self, index, value):
+ self.del_[index] = value
+ def get_ins(self):
+ return self.ins
+ def set_ins(self, ins):
+ self.ins = ins
+ def add_ins(self, value):
+ self.ins.append(value)
+ def insert_ins_at(self, index, value):
+ self.ins.insert(index, value)
+ def replace_ins_at(self, index, value):
+ self.ins[index] = value
+ def get_htmlonly(self):
+ return self.htmlonly
+ def set_htmlonly(self, htmlonly):
+ self.htmlonly = htmlonly
+ def add_htmlonly(self, value):
+ self.htmlonly.append(value)
+ def insert_htmlonly_at(self, index, value):
+ self.htmlonly.insert(index, value)
+ def replace_htmlonly_at(self, index, value):
+ self.htmlonly[index] = value
+ def get_manonly(self):
+ return self.manonly
+ def set_manonly(self, manonly):
+ self.manonly = manonly
+ def add_manonly(self, value):
+ self.manonly.append(value)
+ def insert_manonly_at(self, index, value):
+ self.manonly.insert(index, value)
+ def replace_manonly_at(self, index, value):
+ self.manonly[index] = value
+ def get_xmlonly(self):
+ return self.xmlonly
+ def set_xmlonly(self, xmlonly):
+ self.xmlonly = xmlonly
+ def add_xmlonly(self, value):
+ self.xmlonly.append(value)
+ def insert_xmlonly_at(self, index, value):
+ self.xmlonly.insert(index, value)
+ def replace_xmlonly_at(self, index, value):
+ self.xmlonly[index] = value
+ def get_rtfonly(self):
+ return self.rtfonly
+ def set_rtfonly(self, rtfonly):
+ self.rtfonly = rtfonly
+ def add_rtfonly(self, value):
+ self.rtfonly.append(value)
+ def insert_rtfonly_at(self, index, value):
+ self.rtfonly.insert(index, value)
+ def replace_rtfonly_at(self, index, value):
+ self.rtfonly[index] = value
+ def get_latexonly(self):
+ return self.latexonly
+ def set_latexonly(self, latexonly):
+ self.latexonly = latexonly
+ def add_latexonly(self, value):
+ self.latexonly.append(value)
+ def insert_latexonly_at(self, index, value):
+ self.latexonly.insert(index, value)
+ def replace_latexonly_at(self, index, value):
+ self.latexonly[index] = value
+ def get_docbookonly(self):
+ return self.docbookonly
+ def set_docbookonly(self, docbookonly):
+ self.docbookonly = docbookonly
+ def add_docbookonly(self, value):
+ self.docbookonly.append(value)
+ def insert_docbookonly_at(self, index, value):
+ self.docbookonly.insert(index, value)
+ def replace_docbookonly_at(self, index, value):
+ self.docbookonly[index] = value
+ def get_image(self):
+ return self.image
+ def set_image(self, image):
+ self.image = image
+ def add_image(self, value):
+ self.image.append(value)
+ def insert_image_at(self, index, value):
+ self.image.insert(index, value)
+ def replace_image_at(self, index, value):
+ self.image[index] = value
+ def get_dot(self):
+ return self.dot
+ def set_dot(self, dot):
+ self.dot = dot
+ def add_dot(self, value):
+ self.dot.append(value)
+ def insert_dot_at(self, index, value):
+ self.dot.insert(index, value)
+ def replace_dot_at(self, index, value):
+ self.dot[index] = value
+ def get_msc(self):
+ return self.msc
+ def set_msc(self, msc):
+ self.msc = msc
+ def add_msc(self, value):
+ self.msc.append(value)
+ def insert_msc_at(self, index, value):
+ self.msc.insert(index, value)
+ def replace_msc_at(self, index, value):
+ self.msc[index] = value
+ def get_plantuml(self):
+ return self.plantuml
+ def set_plantuml(self, plantuml):
+ self.plantuml = plantuml
+ def add_plantuml(self, value):
+ self.plantuml.append(value)
+ def insert_plantuml_at(self, index, value):
+ self.plantuml.insert(index, value)
+ def replace_plantuml_at(self, index, value):
+ self.plantuml[index] = value
+ def get_anchor(self):
+ return self.anchor
+ def set_anchor(self, anchor):
+ self.anchor = anchor
+ def add_anchor(self, value):
+ self.anchor.append(value)
+ def insert_anchor_at(self, index, value):
+ self.anchor.insert(index, value)
+ def replace_anchor_at(self, index, value):
+ self.anchor[index] = value
+ def get_formula(self):
+ return self.formula
+ def set_formula(self, formula):
+ self.formula = formula
+ def add_formula(self, value):
+ self.formula.append(value)
+ def insert_formula_at(self, index, value):
+ self.formula.insert(index, value)
+ def replace_formula_at(self, index, value):
+ self.formula[index] = value
+ def get_ref(self):
+ return self.ref
+ def set_ref(self, ref):
+ self.ref = ref
+ def add_ref(self, value):
+ self.ref.append(value)
+ def insert_ref_at(self, index, value):
+ self.ref.insert(index, value)
+ def replace_ref_at(self, index, value):
+ self.ref[index] = value
+ def get_emoji(self):
+ return self.emoji
+ def set_emoji(self, emoji):
+ self.emoji = emoji
+ def add_emoji(self, value):
+ self.emoji.append(value)
+ def insert_emoji_at(self, index, value):
+ self.emoji.insert(index, value)
+ def replace_emoji_at(self, index, value):
+ self.emoji[index] = value
+ def get_linebreak(self):
+ return self.linebreak
+ def set_linebreak(self, linebreak):
+ self.linebreak = linebreak
+ def add_linebreak(self, value):
+ self.linebreak.append(value)
+ def insert_linebreak_at(self, index, value):
+ self.linebreak.insert(index, value)
+ def replace_linebreak_at(self, index, value):
+ self.linebreak[index] = value
+ def get_type(self):
+ return self.type_
+ def set_type(self, type_):
+ self.type_ = type_
+ def get_name(self):
+ return self.name
+ def set_name(self, name):
+ self.name = name
+ def get_width(self):
+ return self.width
+ def set_width(self, width):
+ self.width = width
+ def get_height(self):
+ return self.height
+ def set_height(self, height):
+ self.height = height
+ def get_alt(self):
+ return self.alt
+ def set_alt(self, alt):
+ self.alt = alt
+ def get_inline(self):
+ return self.inline
+ def set_inline(self, inline):
+ self.inline = inline
+ def get_caption(self):
+ return self.caption
+ def set_caption(self, caption):
+ self.caption = caption
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def validate_DoxImageKind(self, value):
+ # Validate type DoxImageKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['html', 'latex', 'docbook', 'rtf']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxImageKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def validate_DoxBool(self, value):
+ # Validate type DoxBool, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['yes', 'no']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxBool' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ self.ulink or
+ self.bold or
+ self.s or
+ self.strike or
+ self.underline or
+ self.emphasis or
+ self.computeroutput or
+ self.subscript or
+ self.superscript or
+ self.center or
+ self.small or
+ self.del_ or
+ self.ins or
+ self.htmlonly or
+ self.manonly or
+ self.xmlonly or
+ self.rtfonly or
+ self.latexonly or
+ self.docbookonly or
+ self.image or
+ self.dot or
+ self.msc or
+ self.plantuml or
+ self.anchor or
+ self.formula or
+ self.ref or
+ self.emoji or
+ self.linebreak or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docImageType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docImageType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docImageType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docImageType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docImageType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docImageType'):
+ if self.type_ is not None and 'type_' not in already_processed:
+ already_processed.add('type_')
+ outfile.write(' type=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.type_), input_name='type')), ))
+ if self.name is not None and 'name' not in already_processed:
+ already_processed.add('name')
+ outfile.write(' name=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.name), input_name='name')), ))
+ if self.width is not None and 'width' not in already_processed:
+ already_processed.add('width')
+ outfile.write(' width=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.width), input_name='width')), ))
+ if self.height is not None and 'height' not in already_processed:
+ already_processed.add('height')
+ outfile.write(' height=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.height), input_name='height')), ))
+ if self.alt is not None and 'alt' not in already_processed:
+ already_processed.add('alt')
+ outfile.write(' alt=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.alt), input_name='alt')), ))
+ if self.inline is not None and 'inline' not in already_processed:
+ already_processed.add('inline')
+ outfile.write(' inline=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.inline), input_name='inline')), ))
+ if self.caption is not None and 'caption' not in already_processed:
+ already_processed.add('caption')
+ outfile.write(' caption=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.caption), input_name='caption')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docImageType', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for ulink_ in self.ulink:
+ namespaceprefix_ = self.ulink_nsprefix_ + ':' if (UseCapturedNS_ and self.ulink_nsprefix_) else ''
+ ulink_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ulink', pretty_print=pretty_print)
+ for bold_ in self.bold:
+ namespaceprefix_ = self.bold_nsprefix_ + ':' if (UseCapturedNS_ and self.bold_nsprefix_) else ''
+ bold_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='bold', pretty_print=pretty_print)
+ for s_ in self.s:
+ namespaceprefix_ = self.s_nsprefix_ + ':' if (UseCapturedNS_ and self.s_nsprefix_) else ''
+ s_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='s', pretty_print=pretty_print)
+ for strike_ in self.strike:
+ namespaceprefix_ = self.strike_nsprefix_ + ':' if (UseCapturedNS_ and self.strike_nsprefix_) else ''
+ strike_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='strike', pretty_print=pretty_print)
+ for underline_ in self.underline:
+ namespaceprefix_ = self.underline_nsprefix_ + ':' if (UseCapturedNS_ and self.underline_nsprefix_) else ''
+ underline_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='underline', pretty_print=pretty_print)
+ for emphasis_ in self.emphasis:
+ namespaceprefix_ = self.emphasis_nsprefix_ + ':' if (UseCapturedNS_ and self.emphasis_nsprefix_) else ''
+ emphasis_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='emphasis', pretty_print=pretty_print)
+ for computeroutput_ in self.computeroutput:
+ namespaceprefix_ = self.computeroutput_nsprefix_ + ':' if (UseCapturedNS_ and self.computeroutput_nsprefix_) else ''
+ computeroutput_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='computeroutput', pretty_print=pretty_print)
+ for subscript_ in self.subscript:
+ namespaceprefix_ = self.subscript_nsprefix_ + ':' if (UseCapturedNS_ and self.subscript_nsprefix_) else ''
+ subscript_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='subscript', pretty_print=pretty_print)
+ for superscript_ in self.superscript:
+ namespaceprefix_ = self.superscript_nsprefix_ + ':' if (UseCapturedNS_ and self.superscript_nsprefix_) else ''
+ superscript_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='superscript', pretty_print=pretty_print)
+ for center_ in self.center:
+ namespaceprefix_ = self.center_nsprefix_ + ':' if (UseCapturedNS_ and self.center_nsprefix_) else ''
+ center_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='center', pretty_print=pretty_print)
+ for small_ in self.small:
+ namespaceprefix_ = self.small_nsprefix_ + ':' if (UseCapturedNS_ and self.small_nsprefix_) else ''
+ small_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='small', pretty_print=pretty_print)
+ for del_ in self.del_:
+ namespaceprefix_ = self.del__nsprefix_ + ':' if (UseCapturedNS_ and self.del__nsprefix_) else ''
+ del_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='del', pretty_print=pretty_print)
+ for ins_ in self.ins:
+ namespaceprefix_ = self.ins_nsprefix_ + ':' if (UseCapturedNS_ and self.ins_nsprefix_) else ''
+ ins_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ins', pretty_print=pretty_print)
+ for htmlonly_ in self.htmlonly:
+ namespaceprefix_ = self.htmlonly_nsprefix_ + ':' if (UseCapturedNS_ and self.htmlonly_nsprefix_) else ''
+ htmlonly_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='htmlonly', pretty_print=pretty_print)
+ for manonly_ in self.manonly:
+ namespaceprefix_ = self.manonly_nsprefix_ + ':' if (UseCapturedNS_ and self.manonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%smanonly>%s</%smanonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(manonly_), input_name='manonly')), namespaceprefix_ , eol_))
+ for xmlonly_ in self.xmlonly:
+ namespaceprefix_ = self.xmlonly_nsprefix_ + ':' if (UseCapturedNS_ and self.xmlonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sxmlonly>%s</%sxmlonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(xmlonly_), input_name='xmlonly')), namespaceprefix_ , eol_))
+ for rtfonly_ in self.rtfonly:
+ namespaceprefix_ = self.rtfonly_nsprefix_ + ':' if (UseCapturedNS_ and self.rtfonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%srtfonly>%s</%srtfonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(rtfonly_), input_name='rtfonly')), namespaceprefix_ , eol_))
+ for latexonly_ in self.latexonly:
+ namespaceprefix_ = self.latexonly_nsprefix_ + ':' if (UseCapturedNS_ and self.latexonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%slatexonly>%s</%slatexonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(latexonly_), input_name='latexonly')), namespaceprefix_ , eol_))
+ for docbookonly_ in self.docbookonly:
+ namespaceprefix_ = self.docbookonly_nsprefix_ + ':' if (UseCapturedNS_ and self.docbookonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sdocbookonly>%s</%sdocbookonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(docbookonly_), input_name='docbookonly')), namespaceprefix_ , eol_))
+ for image_ in self.image:
+ namespaceprefix_ = self.image_nsprefix_ + ':' if (UseCapturedNS_ and self.image_nsprefix_) else ''
+ image_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='image', pretty_print=pretty_print)
+ for dot_ in self.dot:
+ namespaceprefix_ = self.dot_nsprefix_ + ':' if (UseCapturedNS_ and self.dot_nsprefix_) else ''
+ dot_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='dot', pretty_print=pretty_print)
+ for msc_ in self.msc:
+ namespaceprefix_ = self.msc_nsprefix_ + ':' if (UseCapturedNS_ and self.msc_nsprefix_) else ''
+ msc_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='msc', pretty_print=pretty_print)
+ for plantuml_ in self.plantuml:
+ namespaceprefix_ = self.plantuml_nsprefix_ + ':' if (UseCapturedNS_ and self.plantuml_nsprefix_) else ''
+ plantuml_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='plantuml', pretty_print=pretty_print)
+ for anchor_ in self.anchor:
+ namespaceprefix_ = self.anchor_nsprefix_ + ':' if (UseCapturedNS_ and self.anchor_nsprefix_) else ''
+ anchor_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='anchor', pretty_print=pretty_print)
+ for formula_ in self.formula:
+ namespaceprefix_ = self.formula_nsprefix_ + ':' if (UseCapturedNS_ and self.formula_nsprefix_) else ''
+ formula_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='formula', pretty_print=pretty_print)
+ for ref_ in self.ref:
+ namespaceprefix_ = self.ref_nsprefix_ + ':' if (UseCapturedNS_ and self.ref_nsprefix_) else ''
+ ref_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ref', pretty_print=pretty_print)
+ for emoji_ in self.emoji:
+ namespaceprefix_ = self.emoji_nsprefix_ + ':' if (UseCapturedNS_ and self.emoji_nsprefix_) else ''
+ emoji_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='emoji', pretty_print=pretty_print)
+ for linebreak_ in self.linebreak:
+ namespaceprefix_ = self.linebreak_nsprefix_ + ':' if (UseCapturedNS_ and self.linebreak_nsprefix_) else ''
+ linebreak_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='linebreak', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('type', node)
+ if value is not None and 'type' not in already_processed:
+ already_processed.add('type')
+ self.type_ = value
+ self.validate_DoxImageKind(self.type_) # validate type DoxImageKind
+ value = find_attr_value_('name', node)
+ if value is not None and 'name' not in already_processed:
+ already_processed.add('name')
+ self.name = value
+ value = find_attr_value_('width', node)
+ if value is not None and 'width' not in already_processed:
+ already_processed.add('width')
+ self.width = value
+ value = find_attr_value_('height', node)
+ if value is not None and 'height' not in already_processed:
+ already_processed.add('height')
+ self.height = value
+ value = find_attr_value_('alt', node)
+ if value is not None and 'alt' not in already_processed:
+ already_processed.add('alt')
+ self.alt = value
+ value = find_attr_value_('inline', node)
+ if value is not None and 'inline' not in already_processed:
+ already_processed.add('inline')
+ self.inline = value
+ self.validate_DoxBool(self.inline) # validate type DoxBool
+ value = find_attr_value_('caption', node)
+ if value is not None and 'caption' not in already_processed:
+ already_processed.add('caption')
+ self.caption = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'ulink':
+ obj_ = docURLLink.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ulink', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ulink'):
+ self.add_ulink(obj_.value)
+ elif hasattr(self, 'set_ulink'):
+ self.set_ulink(obj_.value)
+ elif nodeName_ == 'bold':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'bold', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_bold'):
+ self.add_bold(obj_.value)
+ elif hasattr(self, 'set_bold'):
+ self.set_bold(obj_.value)
+ elif nodeName_ == 's':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 's', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_s'):
+ self.add_s(obj_.value)
+ elif hasattr(self, 'set_s'):
+ self.set_s(obj_.value)
+ elif nodeName_ == 'strike':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'strike', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_strike'):
+ self.add_strike(obj_.value)
+ elif hasattr(self, 'set_strike'):
+ self.set_strike(obj_.value)
+ elif nodeName_ == 'underline':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'underline', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_underline'):
+ self.add_underline(obj_.value)
+ elif hasattr(self, 'set_underline'):
+ self.set_underline(obj_.value)
+ elif nodeName_ == 'emphasis':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'emphasis', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_emphasis'):
+ self.add_emphasis(obj_.value)
+ elif hasattr(self, 'set_emphasis'):
+ self.set_emphasis(obj_.value)
+ elif nodeName_ == 'computeroutput':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'computeroutput', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_computeroutput'):
+ self.add_computeroutput(obj_.value)
+ elif hasattr(self, 'set_computeroutput'):
+ self.set_computeroutput(obj_.value)
+ elif nodeName_ == 'subscript':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'subscript', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_subscript'):
+ self.add_subscript(obj_.value)
+ elif hasattr(self, 'set_subscript'):
+ self.set_subscript(obj_.value)
+ elif nodeName_ == 'superscript':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'superscript', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_superscript'):
+ self.add_superscript(obj_.value)
+ elif hasattr(self, 'set_superscript'):
+ self.set_superscript(obj_.value)
+ elif nodeName_ == 'center':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'center', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_center'):
+ self.add_center(obj_.value)
+ elif hasattr(self, 'set_center'):
+ self.set_center(obj_.value)
+ elif nodeName_ == 'small':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'small', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_small'):
+ self.add_small(obj_.value)
+ elif hasattr(self, 'set_small'):
+ self.set_small(obj_.value)
+ elif nodeName_ == 'del':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'del', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_del'):
+ self.add_del(obj_.value)
+ elif hasattr(self, 'set_del'):
+ self.set_del(obj_.value)
+ elif nodeName_ == 'ins':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ins', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ins'):
+ self.add_ins(obj_.value)
+ elif hasattr(self, 'set_ins'):
+ self.set_ins(obj_.value)
+ elif nodeName_ == 'htmlonly':
+ obj_ = docHtmlOnlyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'htmlonly', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_htmlonly'):
+ self.add_htmlonly(obj_.value)
+ elif hasattr(self, 'set_htmlonly'):
+ self.set_htmlonly(obj_.value)
+ elif nodeName_ == 'manonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'manonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'manonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'manonly', valuestr_)
+ self.content_.append(obj_)
+ self.manonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'xmlonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'xmlonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'xmlonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'xmlonly', valuestr_)
+ self.content_.append(obj_)
+ self.xmlonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'rtfonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'rtfonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'rtfonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'rtfonly', valuestr_)
+ self.content_.append(obj_)
+ self.rtfonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'latexonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'latexonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'latexonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'latexonly', valuestr_)
+ self.content_.append(obj_)
+ self.latexonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'docbookonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'docbookonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'docbookonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'docbookonly', valuestr_)
+ self.content_.append(obj_)
+ self.docbookonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'image':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'image', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_image'):
+ self.add_image(obj_.value)
+ elif hasattr(self, 'set_image'):
+ self.set_image(obj_.value)
+ elif nodeName_ == 'dot':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'dot', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_dot'):
+ self.add_dot(obj_.value)
+ elif hasattr(self, 'set_dot'):
+ self.set_dot(obj_.value)
+ elif nodeName_ == 'msc':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'msc', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_msc'):
+ self.add_msc(obj_.value)
+ elif hasattr(self, 'set_msc'):
+ self.set_msc(obj_.value)
+ elif nodeName_ == 'plantuml':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'plantuml', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_plantuml'):
+ self.add_plantuml(obj_.value)
+ elif hasattr(self, 'set_plantuml'):
+ self.set_plantuml(obj_.value)
+ elif nodeName_ == 'anchor':
+ obj_ = docAnchorType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'anchor', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_anchor'):
+ self.add_anchor(obj_.value)
+ elif hasattr(self, 'set_anchor'):
+ self.set_anchor(obj_.value)
+ elif nodeName_ == 'formula':
+ obj_ = docFormulaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'formula', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_formula'):
+ self.add_formula(obj_.value)
+ elif hasattr(self, 'set_formula'):
+ self.set_formula(obj_.value)
+ elif nodeName_ == 'ref':
+ obj_ = docRefTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ref', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ref'):
+ self.add_ref(obj_.value)
+ elif hasattr(self, 'set_ref'):
+ self.set_ref(obj_.value)
+ elif nodeName_ == 'emoji':
+ obj_ = docEmojiType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'emoji', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_emoji'):
+ self.add_emoji(obj_.value)
+ elif hasattr(self, 'set_emoji'):
+ self.set_emoji(obj_.value)
+ elif nodeName_ == 'linebreak':
+ obj_ = docEmptyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'linebreak', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_linebreak'):
+ self.add_linebreak(obj_.value)
+ elif hasattr(self, 'set_linebreak'):
+ self.set_linebreak(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docImageType
+
+
+class docTocItemType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, id=None, ulink=None, bold=None, s=None, strike=None, underline=None, emphasis=None, computeroutput=None, subscript=None, superscript=None, center=None, small=None, del_=None, ins=None, htmlonly=None, manonly=None, xmlonly=None, rtfonly=None, latexonly=None, docbookonly=None, image=None, dot=None, msc=None, plantuml=None, anchor=None, formula=None, ref=None, emoji=None, linebreak=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.id = _cast(None, id)
+ self.id_nsprefix_ = None
+ if ulink is None:
+ self.ulink = []
+ else:
+ self.ulink = ulink
+ self.ulink_nsprefix_ = None
+ if bold is None:
+ self.bold = []
+ else:
+ self.bold = bold
+ self.bold_nsprefix_ = None
+ if s is None:
+ self.s = []
+ else:
+ self.s = s
+ self.s_nsprefix_ = None
+ if strike is None:
+ self.strike = []
+ else:
+ self.strike = strike
+ self.strike_nsprefix_ = None
+ if underline is None:
+ self.underline = []
+ else:
+ self.underline = underline
+ self.underline_nsprefix_ = None
+ if emphasis is None:
+ self.emphasis = []
+ else:
+ self.emphasis = emphasis
+ self.emphasis_nsprefix_ = None
+ if computeroutput is None:
+ self.computeroutput = []
+ else:
+ self.computeroutput = computeroutput
+ self.computeroutput_nsprefix_ = None
+ if subscript is None:
+ self.subscript = []
+ else:
+ self.subscript = subscript
+ self.subscript_nsprefix_ = None
+ if superscript is None:
+ self.superscript = []
+ else:
+ self.superscript = superscript
+ self.superscript_nsprefix_ = None
+ if center is None:
+ self.center = []
+ else:
+ self.center = center
+ self.center_nsprefix_ = None
+ if small is None:
+ self.small = []
+ else:
+ self.small = small
+ self.small_nsprefix_ = None
+ if del_ is None:
+ self.del_ = []
+ else:
+ self.del_ = del_
+ self.del__nsprefix_ = None
+ if ins is None:
+ self.ins = []
+ else:
+ self.ins = ins
+ self.ins_nsprefix_ = None
+ if htmlonly is None:
+ self.htmlonly = []
+ else:
+ self.htmlonly = htmlonly
+ self.htmlonly_nsprefix_ = None
+ if manonly is None:
+ self.manonly = []
+ else:
+ self.manonly = manonly
+ self.manonly_nsprefix_ = None
+ if xmlonly is None:
+ self.xmlonly = []
+ else:
+ self.xmlonly = xmlonly
+ self.xmlonly_nsprefix_ = None
+ if rtfonly is None:
+ self.rtfonly = []
+ else:
+ self.rtfonly = rtfonly
+ self.rtfonly_nsprefix_ = None
+ if latexonly is None:
+ self.latexonly = []
+ else:
+ self.latexonly = latexonly
+ self.latexonly_nsprefix_ = None
+ if docbookonly is None:
+ self.docbookonly = []
+ else:
+ self.docbookonly = docbookonly
+ self.docbookonly_nsprefix_ = None
+ if image is None:
+ self.image = []
+ else:
+ self.image = image
+ self.image_nsprefix_ = None
+ if dot is None:
+ self.dot = []
+ else:
+ self.dot = dot
+ self.dot_nsprefix_ = None
+ if msc is None:
+ self.msc = []
+ else:
+ self.msc = msc
+ self.msc_nsprefix_ = None
+ if plantuml is None:
+ self.plantuml = []
+ else:
+ self.plantuml = plantuml
+ self.plantuml_nsprefix_ = None
+ if anchor is None:
+ self.anchor = []
+ else:
+ self.anchor = anchor
+ self.anchor_nsprefix_ = None
+ if formula is None:
+ self.formula = []
+ else:
+ self.formula = formula
+ self.formula_nsprefix_ = None
+ if ref is None:
+ self.ref = []
+ else:
+ self.ref = ref
+ self.ref_nsprefix_ = None
+ if emoji is None:
+ self.emoji = []
+ else:
+ self.emoji = emoji
+ self.emoji_nsprefix_ = None
+ if linebreak is None:
+ self.linebreak = []
+ else:
+ self.linebreak = linebreak
+ self.linebreak_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docTocItemType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docTocItemType.subclass:
+ return docTocItemType.subclass(*args_, **kwargs_)
+ else:
+ return docTocItemType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_ulink(self):
+ return self.ulink
+ def set_ulink(self, ulink):
+ self.ulink = ulink
+ def add_ulink(self, value):
+ self.ulink.append(value)
+ def insert_ulink_at(self, index, value):
+ self.ulink.insert(index, value)
+ def replace_ulink_at(self, index, value):
+ self.ulink[index] = value
+ def get_bold(self):
+ return self.bold
+ def set_bold(self, bold):
+ self.bold = bold
+ def add_bold(self, value):
+ self.bold.append(value)
+ def insert_bold_at(self, index, value):
+ self.bold.insert(index, value)
+ def replace_bold_at(self, index, value):
+ self.bold[index] = value
+ def get_s(self):
+ return self.s
+ def set_s(self, s):
+ self.s = s
+ def add_s(self, value):
+ self.s.append(value)
+ def insert_s_at(self, index, value):
+ self.s.insert(index, value)
+ def replace_s_at(self, index, value):
+ self.s[index] = value
+ def get_strike(self):
+ return self.strike
+ def set_strike(self, strike):
+ self.strike = strike
+ def add_strike(self, value):
+ self.strike.append(value)
+ def insert_strike_at(self, index, value):
+ self.strike.insert(index, value)
+ def replace_strike_at(self, index, value):
+ self.strike[index] = value
+ def get_underline(self):
+ return self.underline
+ def set_underline(self, underline):
+ self.underline = underline
+ def add_underline(self, value):
+ self.underline.append(value)
+ def insert_underline_at(self, index, value):
+ self.underline.insert(index, value)
+ def replace_underline_at(self, index, value):
+ self.underline[index] = value
+ def get_emphasis(self):
+ return self.emphasis
+ def set_emphasis(self, emphasis):
+ self.emphasis = emphasis
+ def add_emphasis(self, value):
+ self.emphasis.append(value)
+ def insert_emphasis_at(self, index, value):
+ self.emphasis.insert(index, value)
+ def replace_emphasis_at(self, index, value):
+ self.emphasis[index] = value
+ def get_computeroutput(self):
+ return self.computeroutput
+ def set_computeroutput(self, computeroutput):
+ self.computeroutput = computeroutput
+ def add_computeroutput(self, value):
+ self.computeroutput.append(value)
+ def insert_computeroutput_at(self, index, value):
+ self.computeroutput.insert(index, value)
+ def replace_computeroutput_at(self, index, value):
+ self.computeroutput[index] = value
+ def get_subscript(self):
+ return self.subscript
+ def set_subscript(self, subscript):
+ self.subscript = subscript
+ def add_subscript(self, value):
+ self.subscript.append(value)
+ def insert_subscript_at(self, index, value):
+ self.subscript.insert(index, value)
+ def replace_subscript_at(self, index, value):
+ self.subscript[index] = value
+ def get_superscript(self):
+ return self.superscript
+ def set_superscript(self, superscript):
+ self.superscript = superscript
+ def add_superscript(self, value):
+ self.superscript.append(value)
+ def insert_superscript_at(self, index, value):
+ self.superscript.insert(index, value)
+ def replace_superscript_at(self, index, value):
+ self.superscript[index] = value
+ def get_center(self):
+ return self.center
+ def set_center(self, center):
+ self.center = center
+ def add_center(self, value):
+ self.center.append(value)
+ def insert_center_at(self, index, value):
+ self.center.insert(index, value)
+ def replace_center_at(self, index, value):
+ self.center[index] = value
+ def get_small(self):
+ return self.small
+ def set_small(self, small):
+ self.small = small
+ def add_small(self, value):
+ self.small.append(value)
+ def insert_small_at(self, index, value):
+ self.small.insert(index, value)
+ def replace_small_at(self, index, value):
+ self.small[index] = value
+ def get_del(self):
+ return self.del_
+ def set_del(self, del_):
+ self.del_ = del_
+ def add_del(self, value):
+ self.del_.append(value)
+ def insert_del_at(self, index, value):
+ self.del_.insert(index, value)
+ def replace_del_at(self, index, value):
+ self.del_[index] = value
+ def get_ins(self):
+ return self.ins
+ def set_ins(self, ins):
+ self.ins = ins
+ def add_ins(self, value):
+ self.ins.append(value)
+ def insert_ins_at(self, index, value):
+ self.ins.insert(index, value)
+ def replace_ins_at(self, index, value):
+ self.ins[index] = value
+ def get_htmlonly(self):
+ return self.htmlonly
+ def set_htmlonly(self, htmlonly):
+ self.htmlonly = htmlonly
+ def add_htmlonly(self, value):
+ self.htmlonly.append(value)
+ def insert_htmlonly_at(self, index, value):
+ self.htmlonly.insert(index, value)
+ def replace_htmlonly_at(self, index, value):
+ self.htmlonly[index] = value
+ def get_manonly(self):
+ return self.manonly
+ def set_manonly(self, manonly):
+ self.manonly = manonly
+ def add_manonly(self, value):
+ self.manonly.append(value)
+ def insert_manonly_at(self, index, value):
+ self.manonly.insert(index, value)
+ def replace_manonly_at(self, index, value):
+ self.manonly[index] = value
+ def get_xmlonly(self):
+ return self.xmlonly
+ def set_xmlonly(self, xmlonly):
+ self.xmlonly = xmlonly
+ def add_xmlonly(self, value):
+ self.xmlonly.append(value)
+ def insert_xmlonly_at(self, index, value):
+ self.xmlonly.insert(index, value)
+ def replace_xmlonly_at(self, index, value):
+ self.xmlonly[index] = value
+ def get_rtfonly(self):
+ return self.rtfonly
+ def set_rtfonly(self, rtfonly):
+ self.rtfonly = rtfonly
+ def add_rtfonly(self, value):
+ self.rtfonly.append(value)
+ def insert_rtfonly_at(self, index, value):
+ self.rtfonly.insert(index, value)
+ def replace_rtfonly_at(self, index, value):
+ self.rtfonly[index] = value
+ def get_latexonly(self):
+ return self.latexonly
+ def set_latexonly(self, latexonly):
+ self.latexonly = latexonly
+ def add_latexonly(self, value):
+ self.latexonly.append(value)
+ def insert_latexonly_at(self, index, value):
+ self.latexonly.insert(index, value)
+ def replace_latexonly_at(self, index, value):
+ self.latexonly[index] = value
+ def get_docbookonly(self):
+ return self.docbookonly
+ def set_docbookonly(self, docbookonly):
+ self.docbookonly = docbookonly
+ def add_docbookonly(self, value):
+ self.docbookonly.append(value)
+ def insert_docbookonly_at(self, index, value):
+ self.docbookonly.insert(index, value)
+ def replace_docbookonly_at(self, index, value):
+ self.docbookonly[index] = value
+ def get_image(self):
+ return self.image
+ def set_image(self, image):
+ self.image = image
+ def add_image(self, value):
+ self.image.append(value)
+ def insert_image_at(self, index, value):
+ self.image.insert(index, value)
+ def replace_image_at(self, index, value):
+ self.image[index] = value
+ def get_dot(self):
+ return self.dot
+ def set_dot(self, dot):
+ self.dot = dot
+ def add_dot(self, value):
+ self.dot.append(value)
+ def insert_dot_at(self, index, value):
+ self.dot.insert(index, value)
+ def replace_dot_at(self, index, value):
+ self.dot[index] = value
+ def get_msc(self):
+ return self.msc
+ def set_msc(self, msc):
+ self.msc = msc
+ def add_msc(self, value):
+ self.msc.append(value)
+ def insert_msc_at(self, index, value):
+ self.msc.insert(index, value)
+ def replace_msc_at(self, index, value):
+ self.msc[index] = value
+ def get_plantuml(self):
+ return self.plantuml
+ def set_plantuml(self, plantuml):
+ self.plantuml = plantuml
+ def add_plantuml(self, value):
+ self.plantuml.append(value)
+ def insert_plantuml_at(self, index, value):
+ self.plantuml.insert(index, value)
+ def replace_plantuml_at(self, index, value):
+ self.plantuml[index] = value
+ def get_anchor(self):
+ return self.anchor
+ def set_anchor(self, anchor):
+ self.anchor = anchor
+ def add_anchor(self, value):
+ self.anchor.append(value)
+ def insert_anchor_at(self, index, value):
+ self.anchor.insert(index, value)
+ def replace_anchor_at(self, index, value):
+ self.anchor[index] = value
+ def get_formula(self):
+ return self.formula
+ def set_formula(self, formula):
+ self.formula = formula
+ def add_formula(self, value):
+ self.formula.append(value)
+ def insert_formula_at(self, index, value):
+ self.formula.insert(index, value)
+ def replace_formula_at(self, index, value):
+ self.formula[index] = value
+ def get_ref(self):
+ return self.ref
+ def set_ref(self, ref):
+ self.ref = ref
+ def add_ref(self, value):
+ self.ref.append(value)
+ def insert_ref_at(self, index, value):
+ self.ref.insert(index, value)
+ def replace_ref_at(self, index, value):
+ self.ref[index] = value
+ def get_emoji(self):
+ return self.emoji
+ def set_emoji(self, emoji):
+ self.emoji = emoji
+ def add_emoji(self, value):
+ self.emoji.append(value)
+ def insert_emoji_at(self, index, value):
+ self.emoji.insert(index, value)
+ def replace_emoji_at(self, index, value):
+ self.emoji[index] = value
+ def get_linebreak(self):
+ return self.linebreak
+ def set_linebreak(self, linebreak):
+ self.linebreak = linebreak
+ def add_linebreak(self, value):
+ self.linebreak.append(value)
+ def insert_linebreak_at(self, index, value):
+ self.linebreak.insert(index, value)
+ def replace_linebreak_at(self, index, value):
+ self.linebreak[index] = value
+ def get_id(self):
+ return self.id
+ def set_id(self, id):
+ self.id = id
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.ulink or
+ self.bold or
+ self.s or
+ self.strike or
+ self.underline or
+ self.emphasis or
+ self.computeroutput or
+ self.subscript or
+ self.superscript or
+ self.center or
+ self.small or
+ self.del_ or
+ self.ins or
+ self.htmlonly or
+ self.manonly or
+ self.xmlonly or
+ self.rtfonly or
+ self.latexonly or
+ self.docbookonly or
+ self.image or
+ self.dot or
+ self.msc or
+ self.plantuml or
+ self.anchor or
+ self.formula or
+ self.ref or
+ self.emoji or
+ self.linebreak or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docTocItemType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docTocItemType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docTocItemType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docTocItemType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docTocItemType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docTocItemType'):
+ if self.id is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docTocItemType', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for ulink_ in self.ulink:
+ namespaceprefix_ = self.ulink_nsprefix_ + ':' if (UseCapturedNS_ and self.ulink_nsprefix_) else ''
+ ulink_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ulink', pretty_print=pretty_print)
+ for bold_ in self.bold:
+ namespaceprefix_ = self.bold_nsprefix_ + ':' if (UseCapturedNS_ and self.bold_nsprefix_) else ''
+ bold_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='bold', pretty_print=pretty_print)
+ for s_ in self.s:
+ namespaceprefix_ = self.s_nsprefix_ + ':' if (UseCapturedNS_ and self.s_nsprefix_) else ''
+ s_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='s', pretty_print=pretty_print)
+ for strike_ in self.strike:
+ namespaceprefix_ = self.strike_nsprefix_ + ':' if (UseCapturedNS_ and self.strike_nsprefix_) else ''
+ strike_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='strike', pretty_print=pretty_print)
+ for underline_ in self.underline:
+ namespaceprefix_ = self.underline_nsprefix_ + ':' if (UseCapturedNS_ and self.underline_nsprefix_) else ''
+ underline_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='underline', pretty_print=pretty_print)
+ for emphasis_ in self.emphasis:
+ namespaceprefix_ = self.emphasis_nsprefix_ + ':' if (UseCapturedNS_ and self.emphasis_nsprefix_) else ''
+ emphasis_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='emphasis', pretty_print=pretty_print)
+ for computeroutput_ in self.computeroutput:
+ namespaceprefix_ = self.computeroutput_nsprefix_ + ':' if (UseCapturedNS_ and self.computeroutput_nsprefix_) else ''
+ computeroutput_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='computeroutput', pretty_print=pretty_print)
+ for subscript_ in self.subscript:
+ namespaceprefix_ = self.subscript_nsprefix_ + ':' if (UseCapturedNS_ and self.subscript_nsprefix_) else ''
+ subscript_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='subscript', pretty_print=pretty_print)
+ for superscript_ in self.superscript:
+ namespaceprefix_ = self.superscript_nsprefix_ + ':' if (UseCapturedNS_ and self.superscript_nsprefix_) else ''
+ superscript_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='superscript', pretty_print=pretty_print)
+ for center_ in self.center:
+ namespaceprefix_ = self.center_nsprefix_ + ':' if (UseCapturedNS_ and self.center_nsprefix_) else ''
+ center_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='center', pretty_print=pretty_print)
+ for small_ in self.small:
+ namespaceprefix_ = self.small_nsprefix_ + ':' if (UseCapturedNS_ and self.small_nsprefix_) else ''
+ small_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='small', pretty_print=pretty_print)
+ for del_ in self.del_:
+ namespaceprefix_ = self.del__nsprefix_ + ':' if (UseCapturedNS_ and self.del__nsprefix_) else ''
+ del_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='del', pretty_print=pretty_print)
+ for ins_ in self.ins:
+ namespaceprefix_ = self.ins_nsprefix_ + ':' if (UseCapturedNS_ and self.ins_nsprefix_) else ''
+ ins_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ins', pretty_print=pretty_print)
+ for htmlonly_ in self.htmlonly:
+ namespaceprefix_ = self.htmlonly_nsprefix_ + ':' if (UseCapturedNS_ and self.htmlonly_nsprefix_) else ''
+ htmlonly_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='htmlonly', pretty_print=pretty_print)
+ for manonly_ in self.manonly:
+ namespaceprefix_ = self.manonly_nsprefix_ + ':' if (UseCapturedNS_ and self.manonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%smanonly>%s</%smanonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(manonly_), input_name='manonly')), namespaceprefix_ , eol_))
+ for xmlonly_ in self.xmlonly:
+ namespaceprefix_ = self.xmlonly_nsprefix_ + ':' if (UseCapturedNS_ and self.xmlonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sxmlonly>%s</%sxmlonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(xmlonly_), input_name='xmlonly')), namespaceprefix_ , eol_))
+ for rtfonly_ in self.rtfonly:
+ namespaceprefix_ = self.rtfonly_nsprefix_ + ':' if (UseCapturedNS_ and self.rtfonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%srtfonly>%s</%srtfonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(rtfonly_), input_name='rtfonly')), namespaceprefix_ , eol_))
+ for latexonly_ in self.latexonly:
+ namespaceprefix_ = self.latexonly_nsprefix_ + ':' if (UseCapturedNS_ and self.latexonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%slatexonly>%s</%slatexonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(latexonly_), input_name='latexonly')), namespaceprefix_ , eol_))
+ for docbookonly_ in self.docbookonly:
+ namespaceprefix_ = self.docbookonly_nsprefix_ + ':' if (UseCapturedNS_ and self.docbookonly_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sdocbookonly>%s</%sdocbookonly>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(docbookonly_), input_name='docbookonly')), namespaceprefix_ , eol_))
+ for image_ in self.image:
+ namespaceprefix_ = self.image_nsprefix_ + ':' if (UseCapturedNS_ and self.image_nsprefix_) else ''
+ image_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='image', pretty_print=pretty_print)
+ for dot_ in self.dot:
+ namespaceprefix_ = self.dot_nsprefix_ + ':' if (UseCapturedNS_ and self.dot_nsprefix_) else ''
+ dot_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='dot', pretty_print=pretty_print)
+ for msc_ in self.msc:
+ namespaceprefix_ = self.msc_nsprefix_ + ':' if (UseCapturedNS_ and self.msc_nsprefix_) else ''
+ msc_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='msc', pretty_print=pretty_print)
+ for plantuml_ in self.plantuml:
+ namespaceprefix_ = self.plantuml_nsprefix_ + ':' if (UseCapturedNS_ and self.plantuml_nsprefix_) else ''
+ plantuml_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='plantuml', pretty_print=pretty_print)
+ for anchor_ in self.anchor:
+ namespaceprefix_ = self.anchor_nsprefix_ + ':' if (UseCapturedNS_ and self.anchor_nsprefix_) else ''
+ anchor_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='anchor', pretty_print=pretty_print)
+ for formula_ in self.formula:
+ namespaceprefix_ = self.formula_nsprefix_ + ':' if (UseCapturedNS_ and self.formula_nsprefix_) else ''
+ formula_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='formula', pretty_print=pretty_print)
+ for ref_ in self.ref:
+ namespaceprefix_ = self.ref_nsprefix_ + ':' if (UseCapturedNS_ and self.ref_nsprefix_) else ''
+ ref_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ref', pretty_print=pretty_print)
+ for emoji_ in self.emoji:
+ namespaceprefix_ = self.emoji_nsprefix_ + ':' if (UseCapturedNS_ and self.emoji_nsprefix_) else ''
+ emoji_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='emoji', pretty_print=pretty_print)
+ for linebreak_ in self.linebreak:
+ namespaceprefix_ = self.linebreak_nsprefix_ + ':' if (UseCapturedNS_ and self.linebreak_nsprefix_) else ''
+ linebreak_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='linebreak', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('id', node)
+ if value is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ self.id = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'ulink':
+ obj_ = docURLLink.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ulink', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ulink'):
+ self.add_ulink(obj_.value)
+ elif hasattr(self, 'set_ulink'):
+ self.set_ulink(obj_.value)
+ elif nodeName_ == 'bold':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'bold', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_bold'):
+ self.add_bold(obj_.value)
+ elif hasattr(self, 'set_bold'):
+ self.set_bold(obj_.value)
+ elif nodeName_ == 's':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 's', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_s'):
+ self.add_s(obj_.value)
+ elif hasattr(self, 'set_s'):
+ self.set_s(obj_.value)
+ elif nodeName_ == 'strike':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'strike', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_strike'):
+ self.add_strike(obj_.value)
+ elif hasattr(self, 'set_strike'):
+ self.set_strike(obj_.value)
+ elif nodeName_ == 'underline':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'underline', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_underline'):
+ self.add_underline(obj_.value)
+ elif hasattr(self, 'set_underline'):
+ self.set_underline(obj_.value)
+ elif nodeName_ == 'emphasis':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'emphasis', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_emphasis'):
+ self.add_emphasis(obj_.value)
+ elif hasattr(self, 'set_emphasis'):
+ self.set_emphasis(obj_.value)
+ elif nodeName_ == 'computeroutput':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'computeroutput', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_computeroutput'):
+ self.add_computeroutput(obj_.value)
+ elif hasattr(self, 'set_computeroutput'):
+ self.set_computeroutput(obj_.value)
+ elif nodeName_ == 'subscript':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'subscript', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_subscript'):
+ self.add_subscript(obj_.value)
+ elif hasattr(self, 'set_subscript'):
+ self.set_subscript(obj_.value)
+ elif nodeName_ == 'superscript':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'superscript', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_superscript'):
+ self.add_superscript(obj_.value)
+ elif hasattr(self, 'set_superscript'):
+ self.set_superscript(obj_.value)
+ elif nodeName_ == 'center':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'center', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_center'):
+ self.add_center(obj_.value)
+ elif hasattr(self, 'set_center'):
+ self.set_center(obj_.value)
+ elif nodeName_ == 'small':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'small', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_small'):
+ self.add_small(obj_.value)
+ elif hasattr(self, 'set_small'):
+ self.set_small(obj_.value)
+ elif nodeName_ == 'del':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'del', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_del'):
+ self.add_del(obj_.value)
+ elif hasattr(self, 'set_del'):
+ self.set_del(obj_.value)
+ elif nodeName_ == 'ins':
+ obj_ = docMarkupType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ins', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ins'):
+ self.add_ins(obj_.value)
+ elif hasattr(self, 'set_ins'):
+ self.set_ins(obj_.value)
+ elif nodeName_ == 'htmlonly':
+ obj_ = docHtmlOnlyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'htmlonly', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_htmlonly'):
+ self.add_htmlonly(obj_.value)
+ elif hasattr(self, 'set_htmlonly'):
+ self.set_htmlonly(obj_.value)
+ elif nodeName_ == 'manonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'manonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'manonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'manonly', valuestr_)
+ self.content_.append(obj_)
+ self.manonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'xmlonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'xmlonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'xmlonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'xmlonly', valuestr_)
+ self.content_.append(obj_)
+ self.xmlonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'rtfonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'rtfonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'rtfonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'rtfonly', valuestr_)
+ self.content_.append(obj_)
+ self.rtfonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'latexonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'latexonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'latexonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'latexonly', valuestr_)
+ self.content_.append(obj_)
+ self.latexonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'docbookonly' and child_.text is not None:
+ valuestr_ = child_.text
+ valuestr_ = self.gds_parse_string(valuestr_, node, 'docbookonly')
+ valuestr_ = self.gds_validate_string(valuestr_, node, 'docbookonly')
+ obj_ = self.mixedclass_(MixedContainer.CategorySimple,
+ MixedContainer.TypeString, 'docbookonly', valuestr_)
+ self.content_.append(obj_)
+ self.docbookonly_nsprefix_ = child_.prefix
+ elif nodeName_ == 'image':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'image', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_image'):
+ self.add_image(obj_.value)
+ elif hasattr(self, 'set_image'):
+ self.set_image(obj_.value)
+ elif nodeName_ == 'dot':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'dot', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_dot'):
+ self.add_dot(obj_.value)
+ elif hasattr(self, 'set_dot'):
+ self.set_dot(obj_.value)
+ elif nodeName_ == 'msc':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'msc', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_msc'):
+ self.add_msc(obj_.value)
+ elif hasattr(self, 'set_msc'):
+ self.set_msc(obj_.value)
+ elif nodeName_ == 'plantuml':
+ obj_ = docImageType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'plantuml', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_plantuml'):
+ self.add_plantuml(obj_.value)
+ elif hasattr(self, 'set_plantuml'):
+ self.set_plantuml(obj_.value)
+ elif nodeName_ == 'anchor':
+ obj_ = docAnchorType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'anchor', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_anchor'):
+ self.add_anchor(obj_.value)
+ elif hasattr(self, 'set_anchor'):
+ self.set_anchor(obj_.value)
+ elif nodeName_ == 'formula':
+ obj_ = docFormulaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'formula', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_formula'):
+ self.add_formula(obj_.value)
+ elif hasattr(self, 'set_formula'):
+ self.set_formula(obj_.value)
+ elif nodeName_ == 'ref':
+ obj_ = docRefTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ref', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ref'):
+ self.add_ref(obj_.value)
+ elif hasattr(self, 'set_ref'):
+ self.set_ref(obj_.value)
+ elif nodeName_ == 'emoji':
+ obj_ = docEmojiType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'emoji', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_emoji'):
+ self.add_emoji(obj_.value)
+ elif hasattr(self, 'set_emoji'):
+ self.set_emoji(obj_.value)
+ elif nodeName_ == 'linebreak':
+ obj_ = docEmptyType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'linebreak', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_linebreak'):
+ self.add_linebreak(obj_.value)
+ elif hasattr(self, 'set_linebreak'):
+ self.set_linebreak(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docTocItemType
+
+
+class docTocListType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, tocitem=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if tocitem is None:
+ self.tocitem = []
+ else:
+ self.tocitem = tocitem
+ self.tocitem_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docTocListType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docTocListType.subclass:
+ return docTocListType.subclass(*args_, **kwargs_)
+ else:
+ return docTocListType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_tocitem(self):
+ return self.tocitem
+ def set_tocitem(self, tocitem):
+ self.tocitem = tocitem
+ def add_tocitem(self, value):
+ self.tocitem.append(value)
+ def insert_tocitem_at(self, index, value):
+ self.tocitem.insert(index, value)
+ def replace_tocitem_at(self, index, value):
+ self.tocitem[index] = value
+ def hasContent_(self):
+ if (
+ self.tocitem
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docTocListType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docTocListType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docTocListType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docTocListType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docTocListType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docTocListType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docTocListType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for tocitem_ in self.tocitem:
+ namespaceprefix_ = self.tocitem_nsprefix_ + ':' if (UseCapturedNS_ and self.tocitem_nsprefix_) else ''
+ tocitem_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='tocitem', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'tocitem':
+ obj_ = docTocItemType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.tocitem.append(obj_)
+ obj_.original_tagname_ = 'tocitem'
+# end class docTocListType
+
+
+class docLanguageType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, langid=None, para=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.langid = _cast(None, langid)
+ self.langid_nsprefix_ = None
+ if para is None:
+ self.para = []
+ else:
+ self.para = para
+ self.para_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docLanguageType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docLanguageType.subclass:
+ return docLanguageType.subclass(*args_, **kwargs_)
+ else:
+ return docLanguageType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_para(self):
+ return self.para
+ def set_para(self, para):
+ self.para = para
+ def add_para(self, value):
+ self.para.append(value)
+ def insert_para_at(self, index, value):
+ self.para.insert(index, value)
+ def replace_para_at(self, index, value):
+ self.para[index] = value
+ def get_langid(self):
+ return self.langid
+ def set_langid(self, langid):
+ self.langid = langid
+ def hasContent_(self):
+ if (
+ self.para
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docLanguageType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docLanguageType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docLanguageType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docLanguageType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docLanguageType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docLanguageType'):
+ if self.langid is not None and 'langid' not in already_processed:
+ already_processed.add('langid')
+ outfile.write(' langid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.langid), input_name='langid')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docLanguageType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for para_ in self.para:
+ namespaceprefix_ = self.para_nsprefix_ + ':' if (UseCapturedNS_ and self.para_nsprefix_) else ''
+ para_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='para', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('langid', node)
+ if value is not None and 'langid' not in already_processed:
+ already_processed.add('langid')
+ self.langid = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'para':
+ obj_ = docParaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.para.append(obj_)
+ obj_.original_tagname_ = 'para'
+# end class docLanguageType
+
+
+class docParamListType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, kind=None, parameteritem=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.kind = _cast(None, kind)
+ self.kind_nsprefix_ = None
+ if parameteritem is None:
+ self.parameteritem = []
+ else:
+ self.parameteritem = parameteritem
+ self.parameteritem_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docParamListType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docParamListType.subclass:
+ return docParamListType.subclass(*args_, **kwargs_)
+ else:
+ return docParamListType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_parameteritem(self):
+ return self.parameteritem
+ def set_parameteritem(self, parameteritem):
+ self.parameteritem = parameteritem
+ def add_parameteritem(self, value):
+ self.parameteritem.append(value)
+ def insert_parameteritem_at(self, index, value):
+ self.parameteritem.insert(index, value)
+ def replace_parameteritem_at(self, index, value):
+ self.parameteritem[index] = value
+ def get_kind(self):
+ return self.kind
+ def set_kind(self, kind):
+ self.kind = kind
+ def validate_DoxParamListKind(self, value):
+ # Validate type DoxParamListKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['param', 'retval', 'exception', 'templateparam']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxParamListKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ self.parameteritem
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docParamListType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docParamListType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docParamListType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docParamListType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docParamListType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docParamListType'):
+ if self.kind is not None and 'kind' not in already_processed:
+ already_processed.add('kind')
+ outfile.write(' kind=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.kind), input_name='kind')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docParamListType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for parameteritem_ in self.parameteritem:
+ namespaceprefix_ = self.parameteritem_nsprefix_ + ':' if (UseCapturedNS_ and self.parameteritem_nsprefix_) else ''
+ parameteritem_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='parameteritem', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('kind', node)
+ if value is not None and 'kind' not in already_processed:
+ already_processed.add('kind')
+ self.kind = value
+ self.validate_DoxParamListKind(self.kind) # validate type DoxParamListKind
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'parameteritem':
+ obj_ = docParamListItem.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.parameteritem.append(obj_)
+ obj_.original_tagname_ = 'parameteritem'
+# end class docParamListType
+
+
+class docParamListItem(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, parameternamelist=None, parameterdescription=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if parameternamelist is None:
+ self.parameternamelist = []
+ else:
+ self.parameternamelist = parameternamelist
+ self.parameternamelist_nsprefix_ = None
+ self.parameterdescription = parameterdescription
+ self.parameterdescription_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docParamListItem)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docParamListItem.subclass:
+ return docParamListItem.subclass(*args_, **kwargs_)
+ else:
+ return docParamListItem(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_parameternamelist(self):
+ return self.parameternamelist
+ def set_parameternamelist(self, parameternamelist):
+ self.parameternamelist = parameternamelist
+ def add_parameternamelist(self, value):
+ self.parameternamelist.append(value)
+ def insert_parameternamelist_at(self, index, value):
+ self.parameternamelist.insert(index, value)
+ def replace_parameternamelist_at(self, index, value):
+ self.parameternamelist[index] = value
+ def get_parameterdescription(self):
+ return self.parameterdescription
+ def set_parameterdescription(self, parameterdescription):
+ self.parameterdescription = parameterdescription
+ def hasContent_(self):
+ if (
+ self.parameternamelist or
+ self.parameterdescription is not None
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docParamListItem', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docParamListItem')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docParamListItem':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docParamListItem')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docParamListItem', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docParamListItem'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docParamListItem', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for parameternamelist_ in self.parameternamelist:
+ namespaceprefix_ = self.parameternamelist_nsprefix_ + ':' if (UseCapturedNS_ and self.parameternamelist_nsprefix_) else ''
+ parameternamelist_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='parameternamelist', pretty_print=pretty_print)
+ if self.parameterdescription is not None:
+ namespaceprefix_ = self.parameterdescription_nsprefix_ + ':' if (UseCapturedNS_ and self.parameterdescription_nsprefix_) else ''
+ self.parameterdescription.export(outfile, level, namespaceprefix_, namespacedef_='', name_='parameterdescription', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'parameternamelist':
+ obj_ = docParamNameList.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.parameternamelist.append(obj_)
+ obj_.original_tagname_ = 'parameternamelist'
+ elif nodeName_ == 'parameterdescription':
+ obj_ = descriptionType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.parameterdescription = obj_
+ obj_.original_tagname_ = 'parameterdescription'
+# end class docParamListItem
+
+
+class docParamNameList(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, parametertype=None, parametername=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if parametertype is None:
+ self.parametertype = []
+ else:
+ self.parametertype = parametertype
+ self.parametertype_nsprefix_ = None
+ if parametername is None:
+ self.parametername = []
+ else:
+ self.parametername = parametername
+ self.parametername_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docParamNameList)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docParamNameList.subclass:
+ return docParamNameList.subclass(*args_, **kwargs_)
+ else:
+ return docParamNameList(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_parametertype(self):
+ return self.parametertype
+ def set_parametertype(self, parametertype):
+ self.parametertype = parametertype
+ def add_parametertype(self, value):
+ self.parametertype.append(value)
+ def insert_parametertype_at(self, index, value):
+ self.parametertype.insert(index, value)
+ def replace_parametertype_at(self, index, value):
+ self.parametertype[index] = value
+ def get_parametername(self):
+ return self.parametername
+ def set_parametername(self, parametername):
+ self.parametername = parametername
+ def add_parametername(self, value):
+ self.parametername.append(value)
+ def insert_parametername_at(self, index, value):
+ self.parametername.insert(index, value)
+ def replace_parametername_at(self, index, value):
+ self.parametername[index] = value
+ def hasContent_(self):
+ if (
+ self.parametertype or
+ self.parametername
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docParamNameList', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docParamNameList')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docParamNameList':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docParamNameList')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docParamNameList', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docParamNameList'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docParamNameList', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for parametertype_ in self.parametertype:
+ namespaceprefix_ = self.parametertype_nsprefix_ + ':' if (UseCapturedNS_ and self.parametertype_nsprefix_) else ''
+ parametertype_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='parametertype', pretty_print=pretty_print)
+ for parametername_ in self.parametername:
+ namespaceprefix_ = self.parametername_nsprefix_ + ':' if (UseCapturedNS_ and self.parametername_nsprefix_) else ''
+ parametername_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='parametername', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'parametertype':
+ obj_ = docParamType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.parametertype.append(obj_)
+ obj_.original_tagname_ = 'parametertype'
+ elif nodeName_ == 'parametername':
+ obj_ = docParamName.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.parametername.append(obj_)
+ obj_.original_tagname_ = 'parametername'
+# end class docParamNameList
+
+
+class docParamType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, ref=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.ref = ref
+ self.ref_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docParamType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docParamType.subclass:
+ return docParamType.subclass(*args_, **kwargs_)
+ else:
+ return docParamType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_ref(self):
+ return self.ref
+ def set_ref(self, ref):
+ self.ref = ref
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def hasContent_(self):
+ if (
+ self.ref is not None or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docParamType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docParamType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docParamType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docParamType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docParamType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docParamType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docParamType', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.ref is not None:
+ namespaceprefix_ = self.ref_nsprefix_ + ':' if (UseCapturedNS_ and self.ref_nsprefix_) else ''
+ self.ref.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ref', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'ref':
+ obj_ = refTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ref', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ref'):
+ self.add_ref(obj_.value)
+ elif hasattr(self, 'set_ref'):
+ self.set_ref(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docParamType
+
+
+class docParamName(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, direction=None, ref=None, valueOf_=None, mixedclass_=None, content_=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.direction = _cast(None, direction)
+ self.direction_nsprefix_ = None
+ self.ref = ref
+ self.ref_nsprefix_ = None
+ self.valueOf_ = valueOf_
+ if mixedclass_ is None:
+ self.mixedclass_ = MixedContainer
+ else:
+ self.mixedclass_ = mixedclass_
+ if content_ is None:
+ self.content_ = []
+ else:
+ self.content_ = content_
+ self.valueOf_ = valueOf_
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docParamName)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docParamName.subclass:
+ return docParamName.subclass(*args_, **kwargs_)
+ else:
+ return docParamName(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_ref(self):
+ return self.ref
+ def set_ref(self, ref):
+ self.ref = ref
+ def get_direction(self):
+ return self.direction
+ def set_direction(self, direction):
+ self.direction = direction
+ def get_valueOf_(self): return self.valueOf_
+ def set_valueOf_(self, valueOf_): self.valueOf_ = valueOf_
+ def validate_DoxParamDir(self, value):
+ # Validate type DoxParamDir, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['in', 'out', 'inout']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on DoxParamDir' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ self.ref is not None or
+ (1 if type(self.valueOf_) in [int,float] else self.valueOf_) or
+ self.content_
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docParamName', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docParamName')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docParamName':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docParamName')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docParamName', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docParamName'):
+ if self.direction is not None and 'direction' not in already_processed:
+ already_processed.add('direction')
+ outfile.write(' direction=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.direction), input_name='direction')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docParamName', fromsubclass_=False, pretty_print=True):
+ if not fromsubclass_:
+ for item_ in self.content_:
+ item_.export(outfile, level, item_.name, namespaceprefix_, pretty_print=pretty_print)
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.ref is not None:
+ namespaceprefix_ = self.ref_nsprefix_ + ':' if (UseCapturedNS_ and self.ref_nsprefix_) else ''
+ self.ref.export(outfile, level, namespaceprefix_, namespacedef_='', name_='ref', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ self.valueOf_ = get_all_text_(node)
+ if node.text is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', node.text)
+ self.content_.append(obj_)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('direction', node)
+ if value is not None and 'direction' not in already_processed:
+ already_processed.add('direction')
+ self.direction = value
+ self.validate_DoxParamDir(self.direction) # validate type DoxParamDir
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'ref':
+ obj_ = refTextType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ obj_ = self.mixedclass_(MixedContainer.CategoryComplex,
+ MixedContainer.TypeNone, 'ref', obj_)
+ self.content_.append(obj_)
+ if hasattr(self, 'add_ref'):
+ self.add_ref(obj_.value)
+ elif hasattr(self, 'set_ref'):
+ self.set_ref(obj_.value)
+ if not fromsubclass_ and child_.tail is not None:
+ obj_ = self.mixedclass_(MixedContainer.CategoryText,
+ MixedContainer.TypeNone, '', child_.tail)
+ self.content_.append(obj_)
+# end class docParamName
+
+
+class docXRefSectType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, id=None, xreftitle=None, xrefdescription=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.id = _cast(None, id)
+ self.id_nsprefix_ = None
+ if xreftitle is None:
+ self.xreftitle = []
+ else:
+ self.xreftitle = xreftitle
+ self.xreftitle_nsprefix_ = None
+ self.xrefdescription = xrefdescription
+ self.xrefdescription_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docXRefSectType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docXRefSectType.subclass:
+ return docXRefSectType.subclass(*args_, **kwargs_)
+ else:
+ return docXRefSectType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_xreftitle(self):
+ return self.xreftitle
+ def set_xreftitle(self, xreftitle):
+ self.xreftitle = xreftitle
+ def add_xreftitle(self, value):
+ self.xreftitle.append(value)
+ def insert_xreftitle_at(self, index, value):
+ self.xreftitle.insert(index, value)
+ def replace_xreftitle_at(self, index, value):
+ self.xreftitle[index] = value
+ def get_xrefdescription(self):
+ return self.xrefdescription
+ def set_xrefdescription(self, xrefdescription):
+ self.xrefdescription = xrefdescription
+ def get_id(self):
+ return self.id
+ def set_id(self, id):
+ self.id = id
+ def hasContent_(self):
+ if (
+ self.xreftitle or
+ self.xrefdescription is not None
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docXRefSectType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docXRefSectType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docXRefSectType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docXRefSectType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docXRefSectType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docXRefSectType'):
+ if self.id is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ outfile.write(' id=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.id), input_name='id')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docXRefSectType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for xreftitle_ in self.xreftitle:
+ namespaceprefix_ = self.xreftitle_nsprefix_ + ':' if (UseCapturedNS_ and self.xreftitle_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sxreftitle>%s</%sxreftitle>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(xreftitle_), input_name='xreftitle')), namespaceprefix_ , eol_))
+ if self.xrefdescription is not None:
+ namespaceprefix_ = self.xrefdescription_nsprefix_ + ':' if (UseCapturedNS_ and self.xrefdescription_nsprefix_) else ''
+ self.xrefdescription.export(outfile, level, namespaceprefix_, namespacedef_='', name_='xrefdescription', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('id', node)
+ if value is not None and 'id' not in already_processed:
+ already_processed.add('id')
+ self.id = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'xreftitle':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'xreftitle')
+ value_ = self.gds_validate_string(value_, node, 'xreftitle')
+ self.xreftitle.append(value_)
+ self.xreftitle_nsprefix_ = child_.prefix
+ elif nodeName_ == 'xrefdescription':
+ obj_ = descriptionType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.xrefdescription = obj_
+ obj_.original_tagname_ = 'xrefdescription'
+# end class docXRefSectType
+
+
+class docCopyType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, link=None, para=None, sect1=None, internal=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.link = _cast(None, link)
+ self.link_nsprefix_ = None
+ if para is None:
+ self.para = []
+ else:
+ self.para = para
+ self.para_nsprefix_ = None
+ if sect1 is None:
+ self.sect1 = []
+ else:
+ self.sect1 = sect1
+ self.sect1_nsprefix_ = None
+ self.internal = internal
+ self.internal_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docCopyType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docCopyType.subclass:
+ return docCopyType.subclass(*args_, **kwargs_)
+ else:
+ return docCopyType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_para(self):
+ return self.para
+ def set_para(self, para):
+ self.para = para
+ def add_para(self, value):
+ self.para.append(value)
+ def insert_para_at(self, index, value):
+ self.para.insert(index, value)
+ def replace_para_at(self, index, value):
+ self.para[index] = value
+ def get_sect1(self):
+ return self.sect1
+ def set_sect1(self, sect1):
+ self.sect1 = sect1
+ def add_sect1(self, value):
+ self.sect1.append(value)
+ def insert_sect1_at(self, index, value):
+ self.sect1.insert(index, value)
+ def replace_sect1_at(self, index, value):
+ self.sect1[index] = value
+ def get_internal(self):
+ return self.internal
+ def set_internal(self, internal):
+ self.internal = internal
+ def get_link(self):
+ return self.link
+ def set_link(self, link):
+ self.link = link
+ def hasContent_(self):
+ if (
+ self.para or
+ self.sect1 or
+ self.internal is not None
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docCopyType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docCopyType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docCopyType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docCopyType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docCopyType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docCopyType'):
+ if self.link is not None and 'link' not in already_processed:
+ already_processed.add('link')
+ outfile.write(' link=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.link), input_name='link')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docCopyType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for para_ in self.para:
+ namespaceprefix_ = self.para_nsprefix_ + ':' if (UseCapturedNS_ and self.para_nsprefix_) else ''
+ para_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='para', pretty_print=pretty_print)
+ for sect1_ in self.sect1:
+ namespaceprefix_ = self.sect1_nsprefix_ + ':' if (UseCapturedNS_ and self.sect1_nsprefix_) else ''
+ sect1_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='sect1', pretty_print=pretty_print)
+ if self.internal is not None:
+ namespaceprefix_ = self.internal_nsprefix_ + ':' if (UseCapturedNS_ and self.internal_nsprefix_) else ''
+ self.internal.export(outfile, level, namespaceprefix_, namespacedef_='', name_='internal', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('link', node)
+ if value is not None and 'link' not in already_processed:
+ already_processed.add('link')
+ self.link = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'para':
+ obj_ = docParaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.para.append(obj_)
+ obj_.original_tagname_ = 'para'
+ elif nodeName_ == 'sect1':
+ obj_ = docSect1Type.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.sect1.append(obj_)
+ obj_.original_tagname_ = 'sect1'
+ elif nodeName_ == 'internal':
+ obj_ = docInternalType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.internal = obj_
+ obj_.original_tagname_ = 'internal'
+# end class docCopyType
+
+
+class docBlockQuoteType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, para=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if para is None:
+ self.para = []
+ else:
+ self.para = para
+ self.para_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docBlockQuoteType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docBlockQuoteType.subclass:
+ return docBlockQuoteType.subclass(*args_, **kwargs_)
+ else:
+ return docBlockQuoteType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_para(self):
+ return self.para
+ def set_para(self, para):
+ self.para = para
+ def add_para(self, value):
+ self.para.append(value)
+ def insert_para_at(self, index, value):
+ self.para.insert(index, value)
+ def replace_para_at(self, index, value):
+ self.para[index] = value
+ def hasContent_(self):
+ if (
+ self.para
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docBlockQuoteType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docBlockQuoteType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docBlockQuoteType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docBlockQuoteType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docBlockQuoteType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docBlockQuoteType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docBlockQuoteType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for para_ in self.para:
+ namespaceprefix_ = self.para_nsprefix_ + ':' if (UseCapturedNS_ and self.para_nsprefix_) else ''
+ para_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='para', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'para':
+ obj_ = docParaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.para.append(obj_)
+ obj_.original_tagname_ = 'para'
+# end class docBlockQuoteType
+
+
+class docParBlockType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, para=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if para is None:
+ self.para = []
+ else:
+ self.para = para
+ self.para_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docParBlockType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docParBlockType.subclass:
+ return docParBlockType.subclass(*args_, **kwargs_)
+ else:
+ return docParBlockType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_para(self):
+ return self.para
+ def set_para(self, para):
+ self.para = para
+ def add_para(self, value):
+ self.para.append(value)
+ def insert_para_at(self, index, value):
+ self.para.insert(index, value)
+ def replace_para_at(self, index, value):
+ self.para[index] = value
+ def hasContent_(self):
+ if (
+ self.para
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docParBlockType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docParBlockType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docParBlockType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docParBlockType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docParBlockType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docParBlockType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docParBlockType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for para_ in self.para:
+ namespaceprefix_ = self.para_nsprefix_ + ':' if (UseCapturedNS_ and self.para_nsprefix_) else ''
+ para_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='para', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'para':
+ obj_ = docParaType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.para.append(obj_)
+ obj_.original_tagname_ = 'para'
+# end class docParBlockType
+
+
+class docEmptyType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docEmptyType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docEmptyType.subclass:
+ return docEmptyType.subclass(*args_, **kwargs_)
+ else:
+ return docEmptyType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def hasContent_(self):
+ if (
+
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docEmptyType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docEmptyType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docEmptyType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docEmptyType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docEmptyType', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docEmptyType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docEmptyType', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class docEmptyType
+
+
+class tableofcontentsType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, tocsect=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ if tocsect is None:
+ self.tocsect = []
+ else:
+ self.tocsect = tocsect
+ self.tocsect_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, tableofcontentsType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if tableofcontentsType.subclass:
+ return tableofcontentsType.subclass(*args_, **kwargs_)
+ else:
+ return tableofcontentsType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_tocsect(self):
+ return self.tocsect
+ def set_tocsect(self, tocsect):
+ self.tocsect = tocsect
+ def add_tocsect(self, value):
+ self.tocsect.append(value)
+ def insert_tocsect_at(self, index, value):
+ self.tocsect.insert(index, value)
+ def replace_tocsect_at(self, index, value):
+ self.tocsect[index] = value
+ def hasContent_(self):
+ if (
+ self.tocsect
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='tableofcontentsType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('tableofcontentsType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'tableofcontentsType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='tableofcontentsType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='tableofcontentsType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='tableofcontentsType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='tableofcontentsType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for tocsect_ in self.tocsect:
+ namespaceprefix_ = self.tocsect_nsprefix_ + ':' if (UseCapturedNS_ and self.tocsect_nsprefix_) else ''
+ tocsect_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='tocsect', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'tocsect':
+ obj_ = tableofcontentsKindType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.tocsect.append(obj_)
+ obj_.original_tagname_ = 'tocsect'
+# end class tableofcontentsType
+
+
+class tableofcontentsKindType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, name=None, reference=None, tableofcontents=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.name = name
+ self.name_nsprefix_ = None
+ self.reference = reference
+ self.reference_nsprefix_ = None
+ if tableofcontents is None:
+ self.tableofcontents = []
+ else:
+ self.tableofcontents = tableofcontents
+ self.tableofcontents_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, tableofcontentsKindType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if tableofcontentsKindType.subclass:
+ return tableofcontentsKindType.subclass(*args_, **kwargs_)
+ else:
+ return tableofcontentsKindType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_name(self):
+ return self.name
+ def set_name(self, name):
+ self.name = name
+ def get_reference(self):
+ return self.reference
+ def set_reference(self, reference):
+ self.reference = reference
+ def get_tableofcontents(self):
+ return self.tableofcontents
+ def set_tableofcontents(self, tableofcontents):
+ self.tableofcontents = tableofcontents
+ def add_tableofcontents(self, value):
+ self.tableofcontents.append(value)
+ def insert_tableofcontents_at(self, index, value):
+ self.tableofcontents.insert(index, value)
+ def replace_tableofcontents_at(self, index, value):
+ self.tableofcontents[index] = value
+ def hasContent_(self):
+ if (
+ self.name is not None or
+ self.reference is not None or
+ self.tableofcontents
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='tableofcontentsKindType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('tableofcontentsKindType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'tableofcontentsKindType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='tableofcontentsKindType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='tableofcontentsKindType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='tableofcontentsKindType'):
+ pass
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='tableofcontentsKindType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.name is not None:
+ namespaceprefix_ = self.name_nsprefix_ + ':' if (UseCapturedNS_ and self.name_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sname>%s</%sname>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.name), input_name='name')), namespaceprefix_ , eol_))
+ if self.reference is not None:
+ namespaceprefix_ = self.reference_nsprefix_ + ':' if (UseCapturedNS_ and self.reference_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sreference>%s</%sreference>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.reference), input_name='reference')), namespaceprefix_ , eol_))
+ for tableofcontents_ in self.tableofcontents:
+ namespaceprefix_ = self.tableofcontents_nsprefix_ + ':' if (UseCapturedNS_ and self.tableofcontents_nsprefix_) else ''
+ tableofcontents_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='tableofcontents', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ pass
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'name':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'name')
+ value_ = self.gds_validate_string(value_, node, 'name')
+ self.name = value_
+ self.name_nsprefix_ = child_.prefix
+ elif nodeName_ == 'reference':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'reference')
+ value_ = self.gds_validate_string(value_, node, 'reference')
+ self.reference = value_
+ self.reference_nsprefix_ = child_.prefix
+ elif nodeName_ == 'tableofcontents':
+ obj_ = tableofcontentsType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.tableofcontents.append(obj_)
+ obj_.original_tagname_ = 'tableofcontents'
+# end class tableofcontentsKindType
+
+
+class docEmojiType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, name=None, unicode=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.name = _cast(None, name)
+ self.name_nsprefix_ = None
+ self.unicode = _cast(None, unicode)
+ self.unicode_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, docEmojiType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if docEmojiType.subclass:
+ return docEmojiType.subclass(*args_, **kwargs_)
+ else:
+ return docEmojiType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_name(self):
+ return self.name
+ def set_name(self, name):
+ self.name = name
+ def get_unicode(self):
+ return self.unicode
+ def set_unicode(self, unicode):
+ self.unicode = unicode
+ def hasContent_(self):
+ if (
+
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docEmojiType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('docEmojiType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'docEmojiType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='docEmojiType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='docEmojiType', pretty_print=pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='docEmojiType'):
+ if self.name is not None and 'name' not in already_processed:
+ already_processed.add('name')
+ outfile.write(' name=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.name), input_name='name')), ))
+ if self.unicode is not None and 'unicode' not in already_processed:
+ already_processed.add('unicode')
+ outfile.write(' unicode=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.unicode), input_name='unicode')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='docEmojiType', fromsubclass_=False, pretty_print=True):
+ pass
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('name', node)
+ if value is not None and 'name' not in already_processed:
+ already_processed.add('name')
+ self.name = value
+ value = find_attr_value_('unicode', node)
+ if value is not None and 'unicode' not in already_processed:
+ already_processed.add('unicode')
+ self.unicode = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ pass
+# end class docEmojiType
+
+
+GDSClassesMapping = {
+ 'doxygen': DoxygenType,
+}
+
+
+USAGE_TEXT = """
+Usage: python <Parser>.py [ -s ] <in_xml_file>
+"""
+
+
+def usage():
+ print(USAGE_TEXT)
+ sys.exit(1)
+
+
+def get_root_tag(node):
+ tag = Tag_pattern_.match(node.tag).groups()[-1]
+ rootClass = GDSClassesMapping.get(tag)
+ if rootClass is None:
+ rootClass = globals().get(tag)
+ return tag, rootClass
+
+
+def get_required_ns_prefix_defs(rootNode):
+ '''Get all name space prefix definitions required in this XML doc.
+ Return a dictionary of definitions and a char string of definitions.
+ '''
+ nsmap = {
+ prefix: uri
+ for node in rootNode.iter()
+ for (prefix, uri) in node.nsmap.items()
+ if prefix is not None
+ }
+ namespacedefs = ' '.join([
+ 'xmlns:{}="{}"'.format(prefix, uri)
+ for prefix, uri in nsmap.items()
+ ])
+ return nsmap, namespacedefs
+
+
+def parse(inFileName, silence=False, print_warnings=True):
+ global CapturedNsmap_
+ gds_collector = GdsCollector_()
+ parser = None
+ doc = parsexml_(inFileName, parser)
+ rootNode = doc.getroot()
+ rootTag, rootClass = get_root_tag(rootNode)
+ if rootClass is None:
+ rootTag = 'DoxygenType'
+ rootClass = DoxygenType
+ rootObj = rootClass.factory()
+ rootObj.build(rootNode, gds_collector_=gds_collector)
+ CapturedNsmap_, namespacedefs = get_required_ns_prefix_defs(rootNode)
+ if not SaveElementTreeNode:
+ doc = None
+ rootNode = None
+ if not silence:
+ sys.stdout.write('<?xml version="1.0" ?>\n')
+ rootObj.export(
+ sys.stdout, 0, name_=rootTag,
+ namespacedef_=namespacedefs,
+ pretty_print=True)
+ if print_warnings and len(gds_collector.get_messages()) > 0:
+ separator = ('-' * 50) + '\n'
+ sys.stderr.write(separator)
+ sys.stderr.write('----- Warnings -- count: {} -----\n'.format(
+ len(gds_collector.get_messages()), ))
+ gds_collector.write_messages(sys.stderr)
+ sys.stderr.write(separator)
+ return rootObj
+
+
+def parseEtree(inFileName, silence=False, print_warnings=True,
+ mapping=None, nsmap=None):
+ parser = None
+ doc = parsexml_(inFileName, parser)
+ gds_collector = GdsCollector_()
+ rootNode = doc.getroot()
+ rootTag, rootClass = get_root_tag(rootNode)
+ if rootClass is None:
+ rootTag = 'DoxygenType'
+ rootClass = DoxygenType
+ rootObj = rootClass.factory()
+ rootObj.build(rootNode, gds_collector_=gds_collector)
+ # Enable Python to collect the space used by the DOM.
+ if mapping is None:
+ mapping = {}
+ rootElement = rootObj.to_etree(
+ None, name_=rootTag, mapping_=mapping, nsmap_=nsmap)
+ reverse_mapping = rootObj.gds_reverse_node_mapping(mapping)
+ if not SaveElementTreeNode:
+ doc = None
+ rootNode = None
+ if not silence:
+ content = etree_.tostring(
+ rootElement, pretty_print=True,
+ xml_declaration=True, encoding="utf-8")
+ sys.stdout.write(str(content))
+ sys.stdout.write('\n')
+ if print_warnings and len(gds_collector.get_messages()) > 0:
+ separator = ('-' * 50) + '\n'
+ sys.stderr.write(separator)
+ sys.stderr.write('----- Warnings -- count: {} -----\n'.format(
+ len(gds_collector.get_messages()), ))
+ gds_collector.write_messages(sys.stderr)
+ sys.stderr.write(separator)
+ return rootObj, rootElement, mapping, reverse_mapping
+
+
+def parseString(inString, silence=False, print_warnings=True):
+ '''Parse a string, create the object tree, and export it.
+
+ Arguments:
+ - inString -- A string. This XML fragment should not start
+ with an XML declaration containing an encoding.
+ - silence -- A boolean. If False, export the object.
+ Returns -- The root object in the tree.
+ '''
+ parser = None
+ rootNode= parsexmlstring_(inString, parser)
+ gds_collector = GdsCollector_()
+ rootTag, rootClass = get_root_tag(rootNode)
+ if rootClass is None:
+ rootTag = 'DoxygenType'
+ rootClass = DoxygenType
+ rootObj = rootClass.factory()
+ rootObj.build(rootNode, gds_collector_=gds_collector)
+ if not SaveElementTreeNode:
+ rootNode = None
+ if not silence:
+ sys.stdout.write('<?xml version="1.0" ?>\n')
+ rootObj.export(
+ sys.stdout, 0, name_=rootTag,
+ namespacedef_='')
+ if print_warnings and len(gds_collector.get_messages()) > 0:
+ separator = ('-' * 50) + '\n'
+ sys.stderr.write(separator)
+ sys.stderr.write('----- Warnings -- count: {} -----\n'.format(
+ len(gds_collector.get_messages()), ))
+ gds_collector.write_messages(sys.stderr)
+ sys.stderr.write(separator)
+ return rootObj
+
+
+def parseLiteral(inFileName, silence=False, print_warnings=True):
+ parser = None
+ doc = parsexml_(inFileName, parser)
+ gds_collector = GdsCollector_()
+ rootNode = doc.getroot()
+ rootTag, rootClass = get_root_tag(rootNode)
+ if rootClass is None:
+ rootTag = 'DoxygenType'
+ rootClass = DoxygenType
+ rootObj = rootClass.factory()
+ rootObj.build(rootNode, gds_collector_=gds_collector)
+ # Enable Python to collect the space used by the DOM.
+ if not SaveElementTreeNode:
+ doc = None
+ rootNode = None
+ if not silence:
+ sys.stdout.write('#from compound import *\n\n')
+ sys.stdout.write('import compound as model_\n\n')
+ sys.stdout.write('rootObj = model_.rootClass(\n')
+ rootObj.exportLiteral(sys.stdout, 0, name_=rootTag)
+ sys.stdout.write(')\n')
+ if print_warnings and len(gds_collector.get_messages()) > 0:
+ separator = ('-' * 50) + '\n'
+ sys.stderr.write(separator)
+ sys.stderr.write('----- Warnings -- count: {} -----\n'.format(
+ len(gds_collector.get_messages()), ))
+ gds_collector.write_messages(sys.stderr)
+ sys.stderr.write(separator)
+ return rootObj
+
+
+def main():
+ args = sys.argv[1:]
+ if len(args) == 1:
+ parse(args[0])
+ else:
+ usage()
+
+
+if __name__ == '__main__':
+ #import pdb; pdb.set_trace()
+ main()
+
+RenameMappings_ = {
+}
+
+#
+# Mapping of namespaces to types defined in them
+# and the file in which each is defined.
+# simpleTypes are marked "ST" and complexTypes "CT".
+NamespaceToDefMappings_ = {'http://www.w3.org/XML/1998/namespace': []}
+
+__all__ = [
+ "DoxygenType",
+ "argsstring",
+ "array",
+ "attributes",
+ "bitfield",
+ "childnodeType",
+ "codelineType",
+ "compoundRefType",
+ "compounddefType",
+ "declname",
+ "definition",
+ "defname",
+ "descriptionType",
+ "docAnchorType",
+ "docBlockQuoteType",
+ "docCaptionType",
+ "docCopyType",
+ "docEmojiType",
+ "docEmptyType",
+ "docEntryType",
+ "docFormulaType",
+ "docHeadingType",
+ "docHtmlOnlyType",
+ "docImageType",
+ "docIndexEntryType",
+ "docInternalS1Type",
+ "docInternalS2Type",
+ "docInternalS3Type",
+ "docInternalS4Type",
+ "docInternalType",
+ "docLanguageType",
+ "docListItemType",
+ "docListType",
+ "docMarkupType",
+ "docParBlockType",
+ "docParaType",
+ "docParamListItem",
+ "docParamListType",
+ "docParamName",
+ "docParamNameList",
+ "docParamType",
+ "docRefTextType",
+ "docRowType",
+ "docSect1Type",
+ "docSect2Type",
+ "docSect3Type",
+ "docSect4Type",
+ "docSimpleSectType",
+ "docTableType",
+ "docTitleType",
+ "docTocItemType",
+ "docTocListType",
+ "docURLLink",
+ "docVarListEntryType",
+ "docVariableListType",
+ "docXRefSectType",
+ "edgelabel",
+ "enumvalueType",
+ "graphType",
+ "highlightType",
+ "incType",
+ "label",
+ "linkType",
+ "linkedTextType",
+ "listingType",
+ "listofallmembersType",
+ "locationType",
+ "memberRefType",
+ "memberdefType",
+ "name",
+ "nodeType",
+ "paramType",
+ "read",
+ "refTextType",
+ "refType",
+ "referenceType",
+ "reimplementType",
+ "scope",
+ "sectiondefType",
+ "spType",
+ "tableofcontentsKindType",
+ "tableofcontentsType",
+ "templateparamlistType",
+ "write"
+]
diff --git a/addon/doxmlparser/doxmlparser/index.py b/addon/doxmlparser/doxmlparser/index.py
new file mode 100644
index 0000000..5ef79c8
--- /dev/null
+++ b/addon/doxmlparser/doxmlparser/index.py
@@ -0,0 +1,1621 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+
+#
+# Generated by generateDS.py.
+# Python 3.9.0 (default, Oct 27 2020, 14:15:17) [Clang 12.0.0 (clang-1200.0.32.21)]
+#
+# Command line options:
+# ('--no-dates', '')
+# ('--no-versions', '')
+# ('-f', '')
+# ('-o', '/Users/dimitri/doxygen.git/addon/doxmlparser/doxmlparser/index.py')
+#
+# Command line arguments:
+# /Users/dimitri/doxygen.git/templates/xml/index.xsd
+#
+# Command line:
+# /usr/local/bin/generateDS --no-dates --no-versions -f -o "/Users/dimitri/doxygen.git/addon/doxmlparser/doxmlparser/index.py" /Users/dimitri/doxygen.git/templates/xml/index.xsd
+#
+# Current working directory (os.getcwd()):
+# doxmlparser
+#
+
+import sys
+try:
+ ModulenotfoundExp_ = ModuleNotFoundError
+except NameError:
+ ModulenotfoundExp_ = ImportError
+from six.moves import zip_longest
+import os
+import re as re_
+import base64
+import datetime as datetime_
+import decimal as decimal_
+try:
+ from lxml import etree as etree_
+except ModulenotfoundExp_ :
+ from xml.etree import ElementTree as etree_
+
+
+Validate_simpletypes_ = True
+SaveElementTreeNode = True
+if sys.version_info.major == 2:
+ BaseStrType_ = basestring
+else:
+ BaseStrType_ = str
+
+
+def parsexml_(infile, parser=None, **kwargs):
+ if parser is None:
+ # Use the lxml ElementTree compatible parser so that, e.g.,
+ # we ignore comments.
+ try:
+ parser = etree_.ETCompatXMLParser()
+ except AttributeError:
+ # fallback to xml.etree
+ parser = etree_.XMLParser()
+ try:
+ if isinstance(infile, os.PathLike):
+ infile = os.path.join(infile)
+ except AttributeError:
+ pass
+ doc = etree_.parse(infile, parser=parser, **kwargs)
+ return doc
+
+def parsexmlstring_(instring, parser=None, **kwargs):
+ if parser is None:
+ # Use the lxml ElementTree compatible parser so that, e.g.,
+ # we ignore comments.
+ try:
+ parser = etree_.ETCompatXMLParser()
+ except AttributeError:
+ # fallback to xml.etree
+ parser = etree_.XMLParser()
+ element = etree_.fromstring(instring, parser=parser, **kwargs)
+ return element
+
+#
+# Namespace prefix definition table (and other attributes, too)
+#
+# The module generatedsnamespaces, if it is importable, must contain
+# a dictionary named GeneratedsNamespaceDefs. This Python dictionary
+# should map element type names (strings) to XML schema namespace prefix
+# definitions. The export method for any class for which there is
+# a namespace prefix definition, will export that definition in the
+# XML representation of that element. See the export method of
+# any generated element type class for an example of the use of this
+# table.
+# A sample table is:
+#
+# # File: generatedsnamespaces.py
+#
+# GenerateDSNamespaceDefs = {
+# "ElementtypeA": "http://www.xxx.com/namespaceA",
+# "ElementtypeB": "http://www.xxx.com/namespaceB",
+# }
+#
+# Additionally, the generatedsnamespaces module can contain a python
+# dictionary named GenerateDSNamespaceTypePrefixes that associates element
+# types with the namespace prefixes that are to be added to the
+# "xsi:type" attribute value. See the exportAttributes method of
+# any generated element type and the generation of "xsi:type" for an
+# example of the use of this table.
+# An example table:
+#
+# # File: generatedsnamespaces.py
+#
+# GenerateDSNamespaceTypePrefixes = {
+# "ElementtypeC": "aaa:",
+# "ElementtypeD": "bbb:",
+# }
+#
+
+try:
+ from generatedsnamespaces import GenerateDSNamespaceDefs as GenerateDSNamespaceDefs_
+except ModulenotfoundExp_ :
+ GenerateDSNamespaceDefs_ = {}
+try:
+ from generatedsnamespaces import GenerateDSNamespaceTypePrefixes as GenerateDSNamespaceTypePrefixes_
+except ModulenotfoundExp_ :
+ GenerateDSNamespaceTypePrefixes_ = {}
+
+#
+# You can replace the following class definition by defining an
+# importable module named "generatedscollector" containing a class
+# named "GdsCollector". See the default class definition below for
+# clues about the possible content of that class.
+#
+try:
+ from generatedscollector import GdsCollector as GdsCollector_
+except ModulenotfoundExp_ :
+
+ class GdsCollector_(object):
+
+ def __init__(self, messages=None):
+ if messages is None:
+ self.messages = []
+ else:
+ self.messages = messages
+
+ def add_message(self, msg):
+ self.messages.append(msg)
+
+ def get_messages(self):
+ return self.messages
+
+ def clear_messages(self):
+ self.messages = []
+
+ def print_messages(self):
+ for msg in self.messages:
+ print("Warning: {}".format(msg))
+
+ def write_messages(self, outstream):
+ for msg in self.messages:
+ outstream.write("Warning: {}\n".format(msg))
+
+
+#
+# The super-class for enum types
+#
+
+try:
+ from enum import Enum
+except ModulenotfoundExp_ :
+ Enum = object
+
+#
+# The root super-class for element type classes
+#
+# Calls to the methods in these classes are generated by generateDS.py.
+# You can replace these methods by re-implementing the following class
+# in a module named generatedssuper.py.
+
+try:
+ from generatedssuper import GeneratedsSuper
+except ModulenotfoundExp_ as exp:
+
+ class GeneratedsSuper(object):
+ __hash__ = object.__hash__
+ tzoff_pattern = re_.compile(r'(\+|-)((0\d|1[0-3]):[0-5]\d|14:00)$')
+ class _FixedOffsetTZ(datetime_.tzinfo):
+ def __init__(self, offset, name):
+ self.__offset = datetime_.timedelta(minutes=offset)
+ self.__name = name
+ def utcoffset(self, dt):
+ return self.__offset
+ def tzname(self, dt):
+ return self.__name
+ def dst(self, dt):
+ return None
+ def gds_format_string(self, input_data, input_name=''):
+ return input_data
+ def gds_parse_string(self, input_data, node=None, input_name=''):
+ return input_data
+ def gds_validate_string(self, input_data, node=None, input_name=''):
+ if not input_data:
+ return ''
+ else:
+ return input_data
+ def gds_format_base64(self, input_data, input_name=''):
+ return base64.b64encode(input_data)
+ def gds_validate_base64(self, input_data, node=None, input_name=''):
+ return input_data
+ def gds_format_integer(self, input_data, input_name=''):
+ return '%d' % input_data
+ def gds_parse_integer(self, input_data, node=None, input_name=''):
+ try:
+ ival = int(input_data)
+ except (TypeError, ValueError) as exp:
+ raise_parse_error(node, 'Requires integer value: %s' % exp)
+ return ival
+ def gds_validate_integer(self, input_data, node=None, input_name=''):
+ try:
+ value = int(input_data)
+ except (TypeError, ValueError):
+ raise_parse_error(node, 'Requires integer value')
+ return value
+ def gds_format_integer_list(self, input_data, input_name=''):
+ if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):
+ input_data = [str(s) for s in input_data]
+ return '%s' % ' '.join(input_data)
+ def gds_validate_integer_list(
+ self, input_data, node=None, input_name=''):
+ values = input_data.split()
+ for value in values:
+ try:
+ int(value)
+ except (TypeError, ValueError):
+ raise_parse_error(node, 'Requires sequence of integer values')
+ return values
+ def gds_format_float(self, input_data, input_name=''):
+ return ('%.15f' % input_data).rstrip('0')
+ def gds_parse_float(self, input_data, node=None, input_name=''):
+ try:
+ fval_ = float(input_data)
+ except (TypeError, ValueError) as exp:
+ raise_parse_error(node, 'Requires float or double value: %s' % exp)
+ return fval_
+ def gds_validate_float(self, input_data, node=None, input_name=''):
+ try:
+ value = float(input_data)
+ except (TypeError, ValueError):
+ raise_parse_error(node, 'Requires float value')
+ return value
+ def gds_format_float_list(self, input_data, input_name=''):
+ if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):
+ input_data = [str(s) for s in input_data]
+ return '%s' % ' '.join(input_data)
+ def gds_validate_float_list(
+ self, input_data, node=None, input_name=''):
+ values = input_data.split()
+ for value in values:
+ try:
+ float(value)
+ except (TypeError, ValueError):
+ raise_parse_error(node, 'Requires sequence of float values')
+ return values
+ def gds_format_decimal(self, input_data, input_name=''):
+ return_value = '%s' % input_data
+ if '.' in return_value:
+ return_value = return_value.rstrip('0')
+ if return_value.endswith('.'):
+ return_value = return_value.rstrip('.')
+ return return_value
+ def gds_parse_decimal(self, input_data, node=None, input_name=''):
+ try:
+ decimal_value = decimal_.Decimal(input_data)
+ except (TypeError, ValueError):
+ raise_parse_error(node, 'Requires decimal value')
+ return decimal_value
+ def gds_validate_decimal(self, input_data, node=None, input_name=''):
+ try:
+ value = decimal_.Decimal(input_data)
+ except (TypeError, ValueError):
+ raise_parse_error(node, 'Requires decimal value')
+ return value
+ def gds_format_decimal_list(self, input_data, input_name=''):
+ if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):
+ input_data = [str(s) for s in input_data]
+ return ' '.join([self.gds_format_decimal(item) for item in input_data])
+ def gds_validate_decimal_list(
+ self, input_data, node=None, input_name=''):
+ values = input_data.split()
+ for value in values:
+ try:
+ decimal_.Decimal(value)
+ except (TypeError, ValueError):
+ raise_parse_error(node, 'Requires sequence of decimal values')
+ return values
+ def gds_format_double(self, input_data, input_name=''):
+ return '%s' % input_data
+ def gds_parse_double(self, input_data, node=None, input_name=''):
+ try:
+ fval_ = float(input_data)
+ except (TypeError, ValueError) as exp:
+ raise_parse_error(node, 'Requires double or float value: %s' % exp)
+ return fval_
+ def gds_validate_double(self, input_data, node=None, input_name=''):
+ try:
+ value = float(input_data)
+ except (TypeError, ValueError):
+ raise_parse_error(node, 'Requires double or float value')
+ return value
+ def gds_format_double_list(self, input_data, input_name=''):
+ if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):
+ input_data = [str(s) for s in input_data]
+ return '%s' % ' '.join(input_data)
+ def gds_validate_double_list(
+ self, input_data, node=None, input_name=''):
+ values = input_data.split()
+ for value in values:
+ try:
+ float(value)
+ except (TypeError, ValueError):
+ raise_parse_error(
+ node, 'Requires sequence of double or float values')
+ return values
+ def gds_format_boolean(self, input_data, input_name=''):
+ return ('%s' % input_data).lower()
+ def gds_parse_boolean(self, input_data, node=None, input_name=''):
+ if input_data in ('true', '1'):
+ bval = True
+ elif input_data in ('false', '0'):
+ bval = False
+ else:
+ raise_parse_error(node, 'Requires boolean value')
+ return bval
+ def gds_validate_boolean(self, input_data, node=None, input_name=''):
+ if input_data not in (True, 1, False, 0, ):
+ raise_parse_error(
+ node,
+ 'Requires boolean value '
+ '(one of True, 1, False, 0)')
+ return input_data
+ def gds_format_boolean_list(self, input_data, input_name=''):
+ if len(input_data) > 0 and not isinstance(input_data[0], BaseStrType_):
+ input_data = [str(s) for s in input_data]
+ return '%s' % ' '.join(input_data)
+ def gds_validate_boolean_list(
+ self, input_data, node=None, input_name=''):
+ values = input_data.split()
+ for value in values:
+ if value not in (True, 1, False, 0, ):
+ raise_parse_error(
+ node,
+ 'Requires sequence of boolean values '
+ '(one of True, 1, False, 0)')
+ return values
+ def gds_validate_datetime(self, input_data, node=None, input_name=''):
+ return input_data
+ def gds_format_datetime(self, input_data, input_name=''):
+ if input_data.microsecond == 0:
+ _svalue = '%04d-%02d-%02dT%02d:%02d:%02d' % (
+ input_data.year,
+ input_data.month,
+ input_data.day,
+ input_data.hour,
+ input_data.minute,
+ input_data.second,
+ )
+ else:
+ _svalue = '%04d-%02d-%02dT%02d:%02d:%02d.%s' % (
+ input_data.year,
+ input_data.month,
+ input_data.day,
+ input_data.hour,
+ input_data.minute,
+ input_data.second,
+ ('%f' % (float(input_data.microsecond) / 1000000))[2:],
+ )
+ if input_data.tzinfo is not None:
+ tzoff = input_data.tzinfo.utcoffset(input_data)
+ if tzoff is not None:
+ total_seconds = tzoff.seconds + (86400 * tzoff.days)
+ if total_seconds == 0:
+ _svalue += 'Z'
+ else:
+ if total_seconds < 0:
+ _svalue += '-'
+ total_seconds *= -1
+ else:
+ _svalue += '+'
+ hours = total_seconds // 3600
+ minutes = (total_seconds - (hours * 3600)) // 60
+ _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)
+ return _svalue
+ @classmethod
+ def gds_parse_datetime(cls, input_data):
+ tz = None
+ if input_data[-1] == 'Z':
+ tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
+ input_data = input_data[:-1]
+ else:
+ results = GeneratedsSuper.tzoff_pattern.search(input_data)
+ if results is not None:
+ tzoff_parts = results.group(2).split(':')
+ tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
+ if results.group(1) == '-':
+ tzoff *= -1
+ tz = GeneratedsSuper._FixedOffsetTZ(
+ tzoff, results.group(0))
+ input_data = input_data[:-6]
+ time_parts = input_data.split('.')
+ if len(time_parts) > 1:
+ micro_seconds = int(float('0.' + time_parts[1]) * 1000000)
+ input_data = '%s.%s' % (
+ time_parts[0], "{}".format(micro_seconds).rjust(6, "0"), )
+ dt = datetime_.datetime.strptime(
+ input_data, '%Y-%m-%dT%H:%M:%S.%f')
+ else:
+ dt = datetime_.datetime.strptime(
+ input_data, '%Y-%m-%dT%H:%M:%S')
+ dt = dt.replace(tzinfo=tz)
+ return dt
+ def gds_validate_date(self, input_data, node=None, input_name=''):
+ return input_data
+ def gds_format_date(self, input_data, input_name=''):
+ _svalue = '%04d-%02d-%02d' % (
+ input_data.year,
+ input_data.month,
+ input_data.day,
+ )
+ try:
+ if input_data.tzinfo is not None:
+ tzoff = input_data.tzinfo.utcoffset(input_data)
+ if tzoff is not None:
+ total_seconds = tzoff.seconds + (86400 * tzoff.days)
+ if total_seconds == 0:
+ _svalue += 'Z'
+ else:
+ if total_seconds < 0:
+ _svalue += '-'
+ total_seconds *= -1
+ else:
+ _svalue += '+'
+ hours = total_seconds // 3600
+ minutes = (total_seconds - (hours * 3600)) // 60
+ _svalue += '{0:02d}:{1:02d}'.format(
+ hours, minutes)
+ except AttributeError:
+ pass
+ return _svalue
+ @classmethod
+ def gds_parse_date(cls, input_data):
+ tz = None
+ if input_data[-1] == 'Z':
+ tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
+ input_data = input_data[:-1]
+ else:
+ results = GeneratedsSuper.tzoff_pattern.search(input_data)
+ if results is not None:
+ tzoff_parts = results.group(2).split(':')
+ tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
+ if results.group(1) == '-':
+ tzoff *= -1
+ tz = GeneratedsSuper._FixedOffsetTZ(
+ tzoff, results.group(0))
+ input_data = input_data[:-6]
+ dt = datetime_.datetime.strptime(input_data, '%Y-%m-%d')
+ dt = dt.replace(tzinfo=tz)
+ return dt.date()
+ def gds_validate_time(self, input_data, node=None, input_name=''):
+ return input_data
+ def gds_format_time(self, input_data, input_name=''):
+ if input_data.microsecond == 0:
+ _svalue = '%02d:%02d:%02d' % (
+ input_data.hour,
+ input_data.minute,
+ input_data.second,
+ )
+ else:
+ _svalue = '%02d:%02d:%02d.%s' % (
+ input_data.hour,
+ input_data.minute,
+ input_data.second,
+ ('%f' % (float(input_data.microsecond) / 1000000))[2:],
+ )
+ if input_data.tzinfo is not None:
+ tzoff = input_data.tzinfo.utcoffset(input_data)
+ if tzoff is not None:
+ total_seconds = tzoff.seconds + (86400 * tzoff.days)
+ if total_seconds == 0:
+ _svalue += 'Z'
+ else:
+ if total_seconds < 0:
+ _svalue += '-'
+ total_seconds *= -1
+ else:
+ _svalue += '+'
+ hours = total_seconds // 3600
+ minutes = (total_seconds - (hours * 3600)) // 60
+ _svalue += '{0:02d}:{1:02d}'.format(hours, minutes)
+ return _svalue
+ def gds_validate_simple_patterns(self, patterns, target):
+ # pat is a list of lists of strings/patterns.
+ # The target value must match at least one of the patterns
+ # in order for the test to succeed.
+ found1 = True
+ for patterns1 in patterns:
+ found2 = False
+ for patterns2 in patterns1:
+ mo = re_.search(patterns2, target)
+ if mo is not None and len(mo.group(0)) == len(target):
+ found2 = True
+ break
+ if not found2:
+ found1 = False
+ break
+ return found1
+ @classmethod
+ def gds_parse_time(cls, input_data):
+ tz = None
+ if input_data[-1] == 'Z':
+ tz = GeneratedsSuper._FixedOffsetTZ(0, 'UTC')
+ input_data = input_data[:-1]
+ else:
+ results = GeneratedsSuper.tzoff_pattern.search(input_data)
+ if results is not None:
+ tzoff_parts = results.group(2).split(':')
+ tzoff = int(tzoff_parts[0]) * 60 + int(tzoff_parts[1])
+ if results.group(1) == '-':
+ tzoff *= -1
+ tz = GeneratedsSuper._FixedOffsetTZ(
+ tzoff, results.group(0))
+ input_data = input_data[:-6]
+ if len(input_data.split('.')) > 1:
+ dt = datetime_.datetime.strptime(input_data, '%H:%M:%S.%f')
+ else:
+ dt = datetime_.datetime.strptime(input_data, '%H:%M:%S')
+ dt = dt.replace(tzinfo=tz)
+ return dt.time()
+ def gds_check_cardinality_(
+ self, value, input_name,
+ min_occurs=0, max_occurs=1, required=None):
+ if value is None:
+ length = 0
+ elif isinstance(value, list):
+ length = len(value)
+ else:
+ length = 1
+ if required is not None :
+ if required and length < 1:
+ self.gds_collector_.add_message(
+ "Required value {}{} is missing".format(
+ input_name, self.gds_get_node_lineno_()))
+ if length < min_occurs:
+ self.gds_collector_.add_message(
+ "Number of values for {}{} is below "
+ "the minimum allowed, "
+ "expected at least {}, found {}".format(
+ input_name, self.gds_get_node_lineno_(),
+ min_occurs, length))
+ elif length > max_occurs:
+ self.gds_collector_.add_message(
+ "Number of values for {}{} is above "
+ "the maximum allowed, "
+ "expected at most {}, found {}".format(
+ input_name, self.gds_get_node_lineno_(),
+ max_occurs, length))
+ def gds_validate_builtin_ST_(
+ self, validator, value, input_name,
+ min_occurs=None, max_occurs=None, required=None):
+ if value is not None:
+ try:
+ validator(value, input_name=input_name)
+ except GDSParseError as parse_error:
+ self.gds_collector_.add_message(str(parse_error))
+ def gds_validate_defined_ST_(
+ self, validator, value, input_name,
+ min_occurs=None, max_occurs=None, required=None):
+ if value is not None:
+ try:
+ validator(value)
+ except GDSParseError as parse_error:
+ self.gds_collector_.add_message(str(parse_error))
+ def gds_str_lower(self, instring):
+ return instring.lower()
+ def get_path_(self, node):
+ path_list = []
+ self.get_path_list_(node, path_list)
+ path_list.reverse()
+ path = '/'.join(path_list)
+ return path
+ Tag_strip_pattern_ = re_.compile(r'\{.*\}')
+ def get_path_list_(self, node, path_list):
+ if node is None:
+ return
+ tag = GeneratedsSuper.Tag_strip_pattern_.sub('', node.tag)
+ if tag:
+ path_list.append(tag)
+ self.get_path_list_(node.getparent(), path_list)
+ def get_class_obj_(self, node, default_class=None):
+ class_obj1 = default_class
+ if 'xsi' in node.nsmap:
+ classname = node.get('{%s}type' % node.nsmap['xsi'])
+ if classname is not None:
+ names = classname.split(':')
+ if len(names) == 2:
+ classname = names[1]
+ class_obj2 = globals().get(classname)
+ if class_obj2 is not None:
+ class_obj1 = class_obj2
+ return class_obj1
+ def gds_build_any(self, node, type_name=None):
+ # provide default value in case option --disable-xml is used.
+ content = ""
+ content = etree_.tostring(node, encoding="unicode")
+ return content
+ @classmethod
+ def gds_reverse_node_mapping(cls, mapping):
+ return dict(((v, k) for k, v in mapping.items()))
+ @staticmethod
+ def gds_encode(instring):
+ if sys.version_info.major == 2:
+ if ExternalEncoding:
+ encoding = ExternalEncoding
+ else:
+ encoding = 'utf-8'
+ return instring.encode(encoding)
+ else:
+ return instring
+ @staticmethod
+ def convert_unicode(instring):
+ if isinstance(instring, str):
+ result = quote_xml(instring)
+ elif sys.version_info.major == 2 and isinstance(instring, unicode):
+ result = quote_xml(instring).encode('utf8')
+ else:
+ result = GeneratedsSuper.gds_encode(str(instring))
+ return result
+ def __eq__(self, other):
+ def excl_select_objs_(obj):
+ return (obj[0] != 'parent_object_' and
+ obj[0] != 'gds_collector_')
+ if type(self) != type(other):
+ return False
+ return all(x == y for x, y in zip_longest(
+ filter(excl_select_objs_, self.__dict__.items()),
+ filter(excl_select_objs_, other.__dict__.items())))
+ def __ne__(self, other):
+ return not self.__eq__(other)
+ # Django ETL transform hooks.
+ def gds_djo_etl_transform(self):
+ pass
+ def gds_djo_etl_transform_db_obj(self, dbobj):
+ pass
+ # SQLAlchemy ETL transform hooks.
+ def gds_sqa_etl_transform(self):
+ return 0, None
+ def gds_sqa_etl_transform_db_obj(self, dbobj):
+ pass
+ def gds_get_node_lineno_(self):
+ if (hasattr(self, "gds_elementtree_node_") and
+ self.gds_elementtree_node_ is not None):
+ return ' near line {}'.format(
+ self.gds_elementtree_node_.sourceline)
+ else:
+ return ""
+
+
+ def getSubclassFromModule_(module, class_):
+ '''Get the subclass of a class from a specific module.'''
+ name = class_.__name__ + 'Sub'
+ if hasattr(module, name):
+ return getattr(module, name)
+ else:
+ return None
+
+
+#
+# If you have installed IPython you can uncomment and use the following.
+# IPython is available from http://ipython.scipy.org/.
+#
+
+## from IPython.Shell import IPShellEmbed
+## args = ''
+## ipshell = IPShellEmbed(args,
+## banner = 'Dropping into IPython',
+## exit_msg = 'Leaving Interpreter, back to program.')
+
+# Then use the following line where and when you want to drop into the
+# IPython shell:
+# ipshell('<some message> -- Entering ipshell.\nHit Ctrl-D to exit')
+
+#
+# Globals
+#
+
+ExternalEncoding = ''
+# Set this to false in order to deactivate during export, the use of
+# name space prefixes captured from the input document.
+UseCapturedNS_ = True
+CapturedNsmap_ = {}
+Tag_pattern_ = re_.compile(r'({.*})?(.*)')
+String_cleanup_pat_ = re_.compile(r"[\n\r\s]+")
+Namespace_extract_pat_ = re_.compile(r'{(.*)}(.*)')
+CDATA_pattern_ = re_.compile(r"<!\[CDATA\[.*?\]\]>", re_.DOTALL)
+
+# Change this to redirect the generated superclass module to use a
+# specific subclass module.
+CurrentSubclassModule_ = None
+
+#
+# Support/utility functions.
+#
+
+
+def showIndent(outfile, level, pretty_print=True):
+ if pretty_print:
+ for idx in range(level):
+ outfile.write(' ')
+
+
+def quote_xml(inStr):
+ "Escape markup chars, but do not modify CDATA sections."
+ if not inStr:
+ return ''
+ s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)
+ s2 = ''
+ pos = 0
+ matchobjects = CDATA_pattern_.finditer(s1)
+ for mo in matchobjects:
+ s3 = s1[pos:mo.start()]
+ s2 += quote_xml_aux(s3)
+ s2 += s1[mo.start():mo.end()]
+ pos = mo.end()
+ s3 = s1[pos:]
+ s2 += quote_xml_aux(s3)
+ return s2
+
+
+def quote_xml_aux(inStr):
+ s1 = inStr.replace('&', '&amp;')
+ s1 = s1.replace('<', '&lt;')
+ s1 = s1.replace('>', '&gt;')
+ return s1
+
+
+def quote_attrib(inStr):
+ s1 = (isinstance(inStr, BaseStrType_) and inStr or '%s' % inStr)
+ s1 = s1.replace('&', '&amp;')
+ s1 = s1.replace('<', '&lt;')
+ s1 = s1.replace('>', '&gt;')
+ if '"' in s1:
+ if "'" in s1:
+ s1 = '"%s"' % s1.replace('"', "&quot;")
+ else:
+ s1 = "'%s'" % s1
+ else:
+ s1 = '"%s"' % s1
+ return s1
+
+
+def quote_python(inStr):
+ s1 = inStr
+ if s1.find("'") == -1:
+ if s1.find('\n') == -1:
+ return "'%s'" % s1
+ else:
+ return "'''%s'''" % s1
+ else:
+ if s1.find('"') != -1:
+ s1 = s1.replace('"', '\\"')
+ if s1.find('\n') == -1:
+ return '"%s"' % s1
+ else:
+ return '"""%s"""' % s1
+
+
+def get_all_text_(node):
+ if node.text is not None:
+ text = node.text
+ else:
+ text = ''
+ for child in node:
+ if child.tail is not None:
+ text += child.tail
+ return text
+
+
+def find_attr_value_(attr_name, node):
+ attrs = node.attrib
+ attr_parts = attr_name.split(':')
+ value = None
+ if len(attr_parts) == 1:
+ value = attrs.get(attr_name)
+ elif len(attr_parts) == 2:
+ prefix, name = attr_parts
+ if prefix == 'xml':
+ namespace = 'http://www.w3.org/XML/1998/namespace'
+ else:
+ namespace = node.nsmap.get(prefix)
+ if namespace is not None:
+ value = attrs.get('{%s}%s' % (namespace, name, ))
+ return value
+
+
+def encode_str_2_3(instr):
+ return instr
+
+
+class GDSParseError(Exception):
+ pass
+
+
+def raise_parse_error(node, msg):
+ if node is not None:
+ msg = '%s (element %s/line %d)' % (msg, node.tag, node.sourceline, )
+ raise GDSParseError(msg)
+
+
+class MixedContainer:
+ # Constants for category:
+ CategoryNone = 0
+ CategoryText = 1
+ CategorySimple = 2
+ CategoryComplex = 3
+ # Constants for content_type:
+ TypeNone = 0
+ TypeText = 1
+ TypeString = 2
+ TypeInteger = 3
+ TypeFloat = 4
+ TypeDecimal = 5
+ TypeDouble = 6
+ TypeBoolean = 7
+ TypeBase64 = 8
+ def __init__(self, category, content_type, name, value):
+ self.category = category
+ self.content_type = content_type
+ self.name = name
+ self.value = value
+ def getCategory(self):
+ return self.category
+ def getContenttype(self, content_type):
+ return self.content_type
+ def getValue(self):
+ return self.value
+ def getName(self):
+ return self.name
+ def export(self, outfile, level, name, namespace,
+ pretty_print=True):
+ if self.category == MixedContainer.CategoryText:
+ # Prevent exporting empty content as empty lines.
+ if self.value.strip():
+ outfile.write(self.value)
+ elif self.category == MixedContainer.CategorySimple:
+ self.exportSimple(outfile, level, name)
+ else: # category == MixedContainer.CategoryComplex
+ self.value.export(
+ outfile, level, namespace, name_=name,
+ pretty_print=pretty_print)
+ def exportSimple(self, outfile, level, name):
+ if self.content_type == MixedContainer.TypeString:
+ outfile.write('<%s>%s</%s>' % (
+ self.name, self.value, self.name))
+ elif self.content_type == MixedContainer.TypeInteger or \
+ self.content_type == MixedContainer.TypeBoolean:
+ outfile.write('<%s>%d</%s>' % (
+ self.name, self.value, self.name))
+ elif self.content_type == MixedContainer.TypeFloat or \
+ self.content_type == MixedContainer.TypeDecimal:
+ outfile.write('<%s>%f</%s>' % (
+ self.name, self.value, self.name))
+ elif self.content_type == MixedContainer.TypeDouble:
+ outfile.write('<%s>%g</%s>' % (
+ self.name, self.value, self.name))
+ elif self.content_type == MixedContainer.TypeBase64:
+ outfile.write('<%s>%s</%s>' % (
+ self.name,
+ base64.b64encode(self.value),
+ self.name))
+ def to_etree(self, element, mapping_=None, nsmap_=None):
+ if self.category == MixedContainer.CategoryText:
+ # Prevent exporting empty content as empty lines.
+ if self.value.strip():
+ if len(element) > 0:
+ if element[-1].tail is None:
+ element[-1].tail = self.value
+ else:
+ element[-1].tail += self.value
+ else:
+ if element.text is None:
+ element.text = self.value
+ else:
+ element.text += self.value
+ elif self.category == MixedContainer.CategorySimple:
+ subelement = etree_.SubElement(
+ element, '%s' % self.name)
+ subelement.text = self.to_etree_simple()
+ else: # category == MixedContainer.CategoryComplex
+ self.value.to_etree(element)
+ def to_etree_simple(self, mapping_=None, nsmap_=None):
+ if self.content_type == MixedContainer.TypeString:
+ text = self.value
+ elif (self.content_type == MixedContainer.TypeInteger or
+ self.content_type == MixedContainer.TypeBoolean):
+ text = '%d' % self.value
+ elif (self.content_type == MixedContainer.TypeFloat or
+ self.content_type == MixedContainer.TypeDecimal):
+ text = '%f' % self.value
+ elif self.content_type == MixedContainer.TypeDouble:
+ text = '%g' % self.value
+ elif self.content_type == MixedContainer.TypeBase64:
+ text = '%s' % base64.b64encode(self.value)
+ return text
+ def exportLiteral(self, outfile, level, name):
+ if self.category == MixedContainer.CategoryText:
+ showIndent(outfile, level)
+ outfile.write(
+ 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (
+ self.category, self.content_type,
+ self.name, self.value))
+ elif self.category == MixedContainer.CategorySimple:
+ showIndent(outfile, level)
+ outfile.write(
+ 'model_.MixedContainer(%d, %d, "%s", "%s"),\n' % (
+ self.category, self.content_type,
+ self.name, self.value))
+ else: # category == MixedContainer.CategoryComplex
+ showIndent(outfile, level)
+ outfile.write(
+ 'model_.MixedContainer(%d, %d, "%s",\n' % (
+ self.category, self.content_type, self.name,))
+ self.value.exportLiteral(outfile, level + 1)
+ showIndent(outfile, level)
+ outfile.write(')\n')
+
+
+class MemberSpec_(object):
+ def __init__(self, name='', data_type='', container=0,
+ optional=0, child_attrs=None, choice=None):
+ self.name = name
+ self.data_type = data_type
+ self.container = container
+ self.child_attrs = child_attrs
+ self.choice = choice
+ self.optional = optional
+ def set_name(self, name): self.name = name
+ def get_name(self): return self.name
+ def set_data_type(self, data_type): self.data_type = data_type
+ def get_data_type_chain(self): return self.data_type
+ def get_data_type(self):
+ if isinstance(self.data_type, list):
+ if len(self.data_type) > 0:
+ return self.data_type[-1]
+ else:
+ return 'xs:string'
+ else:
+ return self.data_type
+ def set_container(self, container): self.container = container
+ def get_container(self): return self.container
+ def set_child_attrs(self, child_attrs): self.child_attrs = child_attrs
+ def get_child_attrs(self): return self.child_attrs
+ def set_choice(self, choice): self.choice = choice
+ def get_choice(self): return self.choice
+ def set_optional(self, optional): self.optional = optional
+ def get_optional(self): return self.optional
+
+
+def _cast(typ, value):
+ if typ is None or value is None:
+ return value
+ return typ(value)
+
+#
+# Data representation classes.
+#
+
+
+class CompoundKind(str, Enum):
+ CLASS='class'
+ STRUCT='struct'
+ UNION='union'
+ INTERFACE='interface'
+ PROTOCOL='protocol'
+ CATEGORY='category'
+ EXCEPTION='exception'
+ FILE='file'
+ NAMESPACE='namespace'
+ GROUP='group'
+ PAGE='page'
+ EXAMPLE='example'
+ DIR='dir'
+ TYPE='type'
+
+
+class MemberKind(str, Enum):
+ DEFINE='define'
+ PROPERTY='property'
+ EVENT='event'
+ VARIABLE='variable'
+ TYPEDEF='typedef'
+ ENUM='enum'
+ ENUMVALUE='enumvalue'
+ FUNCTION='function'
+ SIGNAL='signal'
+ PROTOTYPE='prototype'
+ FRIEND='friend'
+ DCOP='dcop'
+ SLOT='slot'
+
+
+class DoxygenType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, version=None, lang=None, compound=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.version = _cast(None, version)
+ self.version_nsprefix_ = None
+ self.lang = _cast(None, lang)
+ self.lang_nsprefix_ = None
+ if compound is None:
+ self.compound = []
+ else:
+ self.compound = compound
+ self.compound_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, DoxygenType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if DoxygenType.subclass:
+ return DoxygenType.subclass(*args_, **kwargs_)
+ else:
+ return DoxygenType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_compound(self):
+ return self.compound
+ def set_compound(self, compound):
+ self.compound = compound
+ def add_compound(self, value):
+ self.compound.append(value)
+ def insert_compound_at(self, index, value):
+ self.compound.insert(index, value)
+ def replace_compound_at(self, index, value):
+ self.compound[index] = value
+ def get_version(self):
+ return self.version
+ def set_version(self, version):
+ self.version = version
+ def get_lang(self):
+ return self.lang
+ def set_lang(self, lang):
+ self.lang = lang
+ def hasContent_(self):
+ if (
+ self.compound
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='DoxygenType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('DoxygenType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'DoxygenType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='DoxygenType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='DoxygenType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='DoxygenType'):
+ if self.version is not None and 'version' not in already_processed:
+ already_processed.add('version')
+ outfile.write(' version=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.version), input_name='version')), ))
+ if self.lang is not None and 'lang' not in already_processed:
+ already_processed.add('lang')
+ outfile.write(' xml:lang=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.lang), input_name='lang')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='DoxygenType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ for compound_ in self.compound:
+ namespaceprefix_ = self.compound_nsprefix_ + ':' if (UseCapturedNS_ and self.compound_nsprefix_) else ''
+ compound_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='compound', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('version', node)
+ if value is not None and 'version' not in already_processed:
+ already_processed.add('version')
+ self.version = value
+ value = find_attr_value_('lang', node)
+ if value is not None and 'lang' not in already_processed:
+ already_processed.add('lang')
+ self.lang = value
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'compound':
+ obj_ = CompoundType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.compound.append(obj_)
+ obj_.original_tagname_ = 'compound'
+# end class DoxygenType
+
+
+class CompoundType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, refid=None, kind=None, name=None, member=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.refid = _cast(None, refid)
+ self.refid_nsprefix_ = None
+ self.kind = _cast(None, kind)
+ self.kind_nsprefix_ = None
+ self.name = name
+ self.name_nsprefix_ = None
+ if member is None:
+ self.member = []
+ else:
+ self.member = member
+ self.member_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, CompoundType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if CompoundType.subclass:
+ return CompoundType.subclass(*args_, **kwargs_)
+ else:
+ return CompoundType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_name(self):
+ return self.name
+ def set_name(self, name):
+ self.name = name
+ def get_member(self):
+ return self.member
+ def set_member(self, member):
+ self.member = member
+ def add_member(self, value):
+ self.member.append(value)
+ def insert_member_at(self, index, value):
+ self.member.insert(index, value)
+ def replace_member_at(self, index, value):
+ self.member[index] = value
+ def get_refid(self):
+ return self.refid
+ def set_refid(self, refid):
+ self.refid = refid
+ def get_kind(self):
+ return self.kind
+ def set_kind(self, kind):
+ self.kind = kind
+ def validate_CompoundKind(self, value):
+ # Validate type CompoundKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['class', 'struct', 'union', 'interface', 'protocol', 'category', 'exception', 'file', 'namespace', 'group', 'page', 'example', 'dir', 'type']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on CompoundKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ self.name is not None or
+ self.member
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='CompoundType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('CompoundType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'CompoundType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='CompoundType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='CompoundType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='CompoundType'):
+ if self.refid is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
+ if self.kind is not None and 'kind' not in already_processed:
+ already_processed.add('kind')
+ outfile.write(' kind=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.kind), input_name='kind')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='CompoundType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.name is not None:
+ namespaceprefix_ = self.name_nsprefix_ + ':' if (UseCapturedNS_ and self.name_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sname>%s</%sname>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.name), input_name='name')), namespaceprefix_ , eol_))
+ for member_ in self.member:
+ namespaceprefix_ = self.member_nsprefix_ + ':' if (UseCapturedNS_ and self.member_nsprefix_) else ''
+ member_.export(outfile, level, namespaceprefix_, namespacedef_='', name_='member', pretty_print=pretty_print)
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('refid', node)
+ if value is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ self.refid = value
+ value = find_attr_value_('kind', node)
+ if value is not None and 'kind' not in already_processed:
+ already_processed.add('kind')
+ self.kind = value
+ self.validate_CompoundKind(self.kind) # validate type CompoundKind
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'name':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'name')
+ value_ = self.gds_validate_string(value_, node, 'name')
+ self.name = value_
+ self.name_nsprefix_ = child_.prefix
+ elif nodeName_ == 'member':
+ obj_ = MemberType.factory(parent_object_=self)
+ obj_.build(child_, gds_collector_=gds_collector_)
+ self.member.append(obj_)
+ obj_.original_tagname_ = 'member'
+# end class CompoundType
+
+
+class MemberType(GeneratedsSuper):
+ __hash__ = GeneratedsSuper.__hash__
+ subclass = None
+ superclass = None
+ def __init__(self, refid=None, kind=None, name=None, gds_collector_=None, **kwargs_):
+ self.gds_collector_ = gds_collector_
+ self.gds_elementtree_node_ = None
+ self.original_tagname_ = None
+ self.parent_object_ = kwargs_.get('parent_object_')
+ self.ns_prefix_ = None
+ self.refid = _cast(None, refid)
+ self.refid_nsprefix_ = None
+ self.kind = _cast(None, kind)
+ self.kind_nsprefix_ = None
+ self.name = name
+ self.name_nsprefix_ = None
+ def factory(*args_, **kwargs_):
+ if CurrentSubclassModule_ is not None:
+ subclass = getSubclassFromModule_(
+ CurrentSubclassModule_, MemberType)
+ if subclass is not None:
+ return subclass(*args_, **kwargs_)
+ if MemberType.subclass:
+ return MemberType.subclass(*args_, **kwargs_)
+ else:
+ return MemberType(*args_, **kwargs_)
+ factory = staticmethod(factory)
+ def get_ns_prefix_(self):
+ return self.ns_prefix_
+ def set_ns_prefix_(self, ns_prefix):
+ self.ns_prefix_ = ns_prefix
+ def get_name(self):
+ return self.name
+ def set_name(self, name):
+ self.name = name
+ def get_refid(self):
+ return self.refid
+ def set_refid(self, refid):
+ self.refid = refid
+ def get_kind(self):
+ return self.kind
+ def set_kind(self, kind):
+ self.kind = kind
+ def validate_MemberKind(self, value):
+ # Validate type MemberKind, a restriction on xsd:string.
+ if value is not None and Validate_simpletypes_ and self.gds_collector_ is not None:
+ if not isinstance(value, str):
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s is not of the correct base simple type (str)' % {"value": value, "lineno": lineno, })
+ return False
+ value = value
+ enumerations = ['define', 'property', 'event', 'variable', 'typedef', 'enum', 'enumvalue', 'function', 'signal', 'prototype', 'friend', 'dcop', 'slot']
+ if value not in enumerations:
+ lineno = self.gds_get_node_lineno_()
+ self.gds_collector_.add_message('Value "%(value)s"%(lineno)s does not match xsd enumeration restriction on MemberKind' % {"value" : encode_str_2_3(value), "lineno": lineno} )
+ result = False
+ def hasContent_(self):
+ if (
+ self.name is not None
+ ):
+ return True
+ else:
+ return False
+ def export(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='MemberType', pretty_print=True):
+ imported_ns_def_ = GenerateDSNamespaceDefs_.get('MemberType')
+ if imported_ns_def_ is not None:
+ namespacedef_ = imported_ns_def_
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.original_tagname_ is not None and name_ == 'MemberType':
+ name_ = self.original_tagname_
+ if UseCapturedNS_ and self.ns_prefix_:
+ namespaceprefix_ = self.ns_prefix_ + ':'
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%s%s%s' % (namespaceprefix_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
+ already_processed = set()
+ self.exportAttributes(outfile, level, already_processed, namespaceprefix_, name_='MemberType')
+ if self.hasContent_():
+ outfile.write('>%s' % (eol_, ))
+ self.exportChildren(outfile, level + 1, namespaceprefix_, namespacedef_, name_='MemberType', pretty_print=pretty_print)
+ showIndent(outfile, level, pretty_print)
+ outfile.write('</%s%s>%s' % (namespaceprefix_, name_, eol_))
+ else:
+ outfile.write('/>%s' % (eol_, ))
+ def exportAttributes(self, outfile, level, already_processed, namespaceprefix_='', name_='MemberType'):
+ if self.refid is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ outfile.write(' refid=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.refid), input_name='refid')), ))
+ if self.kind is not None and 'kind' not in already_processed:
+ already_processed.add('kind')
+ outfile.write(' kind=%s' % (self.gds_encode(self.gds_format_string(quote_attrib(self.kind), input_name='kind')), ))
+ def exportChildren(self, outfile, level, namespaceprefix_='', namespacedef_='', name_='MemberType', fromsubclass_=False, pretty_print=True):
+ if pretty_print:
+ eol_ = '\n'
+ else:
+ eol_ = ''
+ if self.name is not None:
+ namespaceprefix_ = self.name_nsprefix_ + ':' if (UseCapturedNS_ and self.name_nsprefix_) else ''
+ showIndent(outfile, level, pretty_print)
+ outfile.write('<%sname>%s</%sname>%s' % (namespaceprefix_ , self.gds_encode(self.gds_format_string(quote_xml(self.name), input_name='name')), namespaceprefix_ , eol_))
+ def build(self, node, gds_collector_=None):
+ self.gds_collector_ = gds_collector_
+ if SaveElementTreeNode:
+ self.gds_elementtree_node_ = node
+ already_processed = set()
+ self.ns_prefix_ = node.prefix
+ self.buildAttributes(node, node.attrib, already_processed)
+ for child in node:
+ nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
+ self.buildChildren(child, node, nodeName_, gds_collector_=gds_collector_)
+ return self
+ def buildAttributes(self, node, attrs, already_processed):
+ value = find_attr_value_('refid', node)
+ if value is not None and 'refid' not in already_processed:
+ already_processed.add('refid')
+ self.refid = value
+ value = find_attr_value_('kind', node)
+ if value is not None and 'kind' not in already_processed:
+ already_processed.add('kind')
+ self.kind = value
+ self.validate_MemberKind(self.kind) # validate type MemberKind
+ def buildChildren(self, child_, node, nodeName_, fromsubclass_=False, gds_collector_=None):
+ if nodeName_ == 'name':
+ value_ = child_.text
+ value_ = self.gds_parse_string(value_, node, 'name')
+ value_ = self.gds_validate_string(value_, node, 'name')
+ self.name = value_
+ self.name_nsprefix_ = child_.prefix
+# end class MemberType
+
+
+GDSClassesMapping = {
+ 'doxygenindex': DoxygenType,
+}
+
+
+USAGE_TEXT = """
+Usage: python <Parser>.py [ -s ] <in_xml_file>
+"""
+
+
+def usage():
+ print(USAGE_TEXT)
+ sys.exit(1)
+
+
+def get_root_tag(node):
+ tag = Tag_pattern_.match(node.tag).groups()[-1]
+ rootClass = GDSClassesMapping.get(tag)
+ if rootClass is None:
+ rootClass = globals().get(tag)
+ return tag, rootClass
+
+
+def get_required_ns_prefix_defs(rootNode):
+ '''Get all name space prefix definitions required in this XML doc.
+ Return a dictionary of definitions and a char string of definitions.
+ '''
+ nsmap = {
+ prefix: uri
+ for node in rootNode.iter()
+ for (prefix, uri) in node.nsmap.items()
+ if prefix is not None
+ }
+ namespacedefs = ' '.join([
+ 'xmlns:{}="{}"'.format(prefix, uri)
+ for prefix, uri in nsmap.items()
+ ])
+ return nsmap, namespacedefs
+
+
+def parse(inFileName, silence=False, print_warnings=True):
+ global CapturedNsmap_
+ gds_collector = GdsCollector_()
+ parser = None
+ doc = parsexml_(inFileName, parser)
+ rootNode = doc.getroot()
+ rootTag, rootClass = get_root_tag(rootNode)
+ if rootClass is None:
+ rootTag = 'DoxygenType'
+ rootClass = DoxygenType
+ rootObj = rootClass.factory()
+ rootObj.build(rootNode, gds_collector_=gds_collector)
+ CapturedNsmap_, namespacedefs = get_required_ns_prefix_defs(rootNode)
+ if not SaveElementTreeNode:
+ doc = None
+ rootNode = None
+ if not silence:
+ sys.stdout.write('<?xml version="1.0" ?>\n')
+ rootObj.export(
+ sys.stdout, 0, name_=rootTag,
+ namespacedef_=namespacedefs,
+ pretty_print=True)
+ if print_warnings and len(gds_collector.get_messages()) > 0:
+ separator = ('-' * 50) + '\n'
+ sys.stderr.write(separator)
+ sys.stderr.write('----- Warnings -- count: {} -----\n'.format(
+ len(gds_collector.get_messages()), ))
+ gds_collector.write_messages(sys.stderr)
+ sys.stderr.write(separator)
+ return rootObj
+
+
+def parseEtree(inFileName, silence=False, print_warnings=True,
+ mapping=None, nsmap=None):
+ parser = None
+ doc = parsexml_(inFileName, parser)
+ gds_collector = GdsCollector_()
+ rootNode = doc.getroot()
+ rootTag, rootClass = get_root_tag(rootNode)
+ if rootClass is None:
+ rootTag = 'DoxygenType'
+ rootClass = DoxygenType
+ rootObj = rootClass.factory()
+ rootObj.build(rootNode, gds_collector_=gds_collector)
+ # Enable Python to collect the space used by the DOM.
+ if mapping is None:
+ mapping = {}
+ rootElement = rootObj.to_etree(
+ None, name_=rootTag, mapping_=mapping, nsmap_=nsmap)
+ reverse_mapping = rootObj.gds_reverse_node_mapping(mapping)
+ if not SaveElementTreeNode:
+ doc = None
+ rootNode = None
+ if not silence:
+ content = etree_.tostring(
+ rootElement, pretty_print=True,
+ xml_declaration=True, encoding="utf-8")
+ sys.stdout.write(str(content))
+ sys.stdout.write('\n')
+ if print_warnings and len(gds_collector.get_messages()) > 0:
+ separator = ('-' * 50) + '\n'
+ sys.stderr.write(separator)
+ sys.stderr.write('----- Warnings -- count: {} -----\n'.format(
+ len(gds_collector.get_messages()), ))
+ gds_collector.write_messages(sys.stderr)
+ sys.stderr.write(separator)
+ return rootObj, rootElement, mapping, reverse_mapping
+
+
+def parseString(inString, silence=False, print_warnings=True):
+ '''Parse a string, create the object tree, and export it.
+
+ Arguments:
+ - inString -- A string. This XML fragment should not start
+ with an XML declaration containing an encoding.
+ - silence -- A boolean. If False, export the object.
+ Returns -- The root object in the tree.
+ '''
+ parser = None
+ rootNode= parsexmlstring_(inString, parser)
+ gds_collector = GdsCollector_()
+ rootTag, rootClass = get_root_tag(rootNode)
+ if rootClass is None:
+ rootTag = 'DoxygenType'
+ rootClass = DoxygenType
+ rootObj = rootClass.factory()
+ rootObj.build(rootNode, gds_collector_=gds_collector)
+ if not SaveElementTreeNode:
+ rootNode = None
+ if not silence:
+ sys.stdout.write('<?xml version="1.0" ?>\n')
+ rootObj.export(
+ sys.stdout, 0, name_=rootTag,
+ namespacedef_='')
+ if print_warnings and len(gds_collector.get_messages()) > 0:
+ separator = ('-' * 50) + '\n'
+ sys.stderr.write(separator)
+ sys.stderr.write('----- Warnings -- count: {} -----\n'.format(
+ len(gds_collector.get_messages()), ))
+ gds_collector.write_messages(sys.stderr)
+ sys.stderr.write(separator)
+ return rootObj
+
+
+def parseLiteral(inFileName, silence=False, print_warnings=True):
+ parser = None
+ doc = parsexml_(inFileName, parser)
+ gds_collector = GdsCollector_()
+ rootNode = doc.getroot()
+ rootTag, rootClass = get_root_tag(rootNode)
+ if rootClass is None:
+ rootTag = 'DoxygenType'
+ rootClass = DoxygenType
+ rootObj = rootClass.factory()
+ rootObj.build(rootNode, gds_collector_=gds_collector)
+ # Enable Python to collect the space used by the DOM.
+ if not SaveElementTreeNode:
+ doc = None
+ rootNode = None
+ if not silence:
+ sys.stdout.write('#from index import *\n\n')
+ sys.stdout.write('import index as model_\n\n')
+ sys.stdout.write('rootObj = model_.rootClass(\n')
+ rootObj.exportLiteral(sys.stdout, 0, name_=rootTag)
+ sys.stdout.write(')\n')
+ if print_warnings and len(gds_collector.get_messages()) > 0:
+ separator = ('-' * 50) + '\n'
+ sys.stderr.write(separator)
+ sys.stderr.write('----- Warnings -- count: {} -----\n'.format(
+ len(gds_collector.get_messages()), ))
+ gds_collector.write_messages(sys.stderr)
+ sys.stderr.write(separator)
+ return rootObj
+
+
+def main():
+ args = sys.argv[1:]
+ if len(args) == 1:
+ parse(args[0])
+ else:
+ usage()
+
+
+if __name__ == '__main__':
+ #import pdb; pdb.set_trace()
+ main()
+
+RenameMappings_ = {
+}
+
+#
+# Mapping of namespaces to types defined in them
+# and the file in which each is defined.
+# simpleTypes are marked "ST" and complexTypes "CT".
+NamespaceToDefMappings_ = {'http://www.w3.org/XML/1998/namespace': []}
+
+__all__ = [
+ "CompoundType",
+ "DoxygenType",
+ "MemberType"
+]
diff --git a/addon/doxmlparser/examples/CMakeLists.txt b/addon/doxmlparser/examples/CMakeLists.txt
deleted file mode 100644
index 1e08d36..0000000
--- a/addon/doxmlparser/examples/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-
-add_subdirectory(metrics)
diff --git a/addon/doxmlparser/examples/dump/dump.py b/addon/doxmlparser/examples/dump/dump.py
new file mode 100644
index 0000000..240c14a
--- /dev/null
+++ b/addon/doxmlparser/examples/dump/dump.py
@@ -0,0 +1,31 @@
+# An minimal example showing how to use the python doxmlparser module to read
+# the XML output generated by doxygen for a project and dump it to the output again.
+
+import sys
+
+import doxmlparser
+
+# process a compound file and export the results to stdout
+def parse_compound(inDirName,baseName):
+ doxmlparser.compound.parse(inDirName+"/"+baseName+".xml",False)
+
+# process the index file and export the results to stdout
+def parse_index(inDirName):
+ rootObj = doxmlparser.index.parse(inDirName+"/index.xml",False)
+ for compound in rootObj.get_compound(): # for each compound defined in the index
+ parse_compound(inDirName,compound.get_refid())
+
+def usage():
+ print("Usage {0} <xml_output_dir>".format(sys.argv[0]))
+ sys.exit(1)
+
+def main():
+ args = sys.argv[1:]
+ if len(args)==1:
+ parse_index(args[0])
+ else:
+ usage()
+
+if __name__ == '__main__':
+ main()
+
diff --git a/addon/doxmlparser/examples/metrics/CMakeLists.txt b/addon/doxmlparser/examples/metrics/CMakeLists.txt
deleted file mode 100644
index 7e99a08..0000000
--- a/addon/doxmlparser/examples/metrics/CMakeLists.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-
-include_directories(
- ../../include
- ${PROJECT_SOURCE_DIR}/libversion
-)
-
-add_executable(doxmlparser_metrics
-main.cpp
-)
-
-
-target_link_libraries(doxmlparser_metrics
- doxmlparser
- doxygen_version
- qtools
- ${COVERAGE_LINKER_FLAGS}
-)
-
diff --git a/addon/doxmlparser/examples/metrics/main.cpp b/addon/doxmlparser/examples/metrics/main.cpp
deleted file mode 100644
index 9e301b1..0000000
--- a/addon/doxmlparser/examples/metrics/main.cpp
+++ /dev/null
@@ -1,271 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * Copyright (C) 1997-2006 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.
- *
- */
-
-/*! \mainpage Metrics
- * This is a small example that shows how to use doxygen's XML output and
- * the doxmlparser library. The example shows some very basic code metrics.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <doxmlintf.h>
-#include "version.h"
-
-bool isDocumented(IDocRoot *brief,IDocRoot *detailed)
-{
- bool found=false;
- if (brief)
- {
- IDocIterator *docIt = brief->contents();
- if (docIt->current()) // method has brief description
- {
- found=true;
- }
- docIt->release();
- }
- if (detailed && !found)
- {
- IDocIterator *docIt = detailed->contents();
- if (docIt->current())
- {
- found=true;
- }
- docIt->release();
- }
- return found;
-}
-
-int main(int argc,char **argv)
-{
- int locArgc = argc;
-
- if (locArgc == 2)
- {
- if (!strcmp(argv[1],"--help"))
- {
- printf("Usage: %s xml_dir\n",argv[0]);
- exit(0);
- }
- else if (!strcmp(argv[1],"--version"))
- {
- printf("%s version: %s\n",argv[0],getFullVersion());
- exit(0);
- }
- }
-
- if (locArgc!=2)
- {
- printf("Usage: %s xml_dir\n",argv[0]);
- exit(1);
- }
-
- int numClasses=0;
- int numDocClasses=0;
- int numStructs=0;
- int numUnions=0;
- int numInterfaces=0;
- int numExceptions=0;
- int numNamespaces=0;
- int numFiles=0;
- int numGroups=0;
- int numPages=0;
- int numPackages=0;
- int numPubMethods=0;
- int numProMethods=0;
- int numPriMethods=0;
- int numDocPubMethods=0;
- int numDocProMethods=0;
- int numDocPriMethods=0;
- int numFunctions=0;
- int numAttributes=0;
- int numVariables=0;
- int numDocFunctions=0;
- int numDocAttributes=0;
- int numDocVariables=0;
- int numParams=0;
-
- IDoxygen *dox = createObjectModel();
-
- dox->setDebugLevel(0);
-
- if (!dox->readXMLDir(argv[1]))
- {
- printf("Error reading %s/index.xml\n",argv[1]);
- exit(1);
- }
-
- ICompoundIterator *cli = dox->compounds();
- ICompound *comp;
- for (cli->toFirst();(comp=cli->current());cli->toNext())
- {
- printf("Processing %s...\n",comp->name()->latin1());
- bool hasDocs = isDocumented(comp->briefDescription(),comp->detailedDescription());
- switch (comp->kind())
- {
- case ICompound::Class:
- numClasses++;
- if (hasDocs) numDocClasses++;
- break;
- case ICompound::Struct: numStructs++; break;
- case ICompound::Union: numUnions++; break;
- case ICompound::Interface: numInterfaces++; break;
- case ICompound::Exception: numExceptions++; break;
- case ICompound::Namespace: numNamespaces++; break;
- case ICompound::File: numFiles++; break;
- case ICompound::Group: numGroups++; break;
- case ICompound::Page: numPages++; break;
- default: break;
- }
-
- ISectionIterator *sli = comp->sections();
- ISection *sec;
- for (sli->toFirst();(sec=sli->current());sli->toNext())
- {
- IMemberIterator *mli = sec->members();
- IMember *mem;
- for (mli->toFirst();(mem=mli->current());mli->toNext())
- {
- IParamIterator *pli = mem->parameters();
- IParam *par;
- if (comp->kind()==ICompound::Class ||
- comp->kind()==ICompound::Struct ||
- comp->kind()==ICompound::Interface
- )
- {
- if (mem->kind()==IMember::Function ||
- mem->kind()==IMember::Prototype ||
- mem->kind()==IMember::Signal ||
- mem->kind()==IMember::Slot ||
- mem->kind()==IMember::DCOP
- ) // is a "method"
- {
- if (mem->section()->isPublic())
- {
- numPubMethods++;
- if (isDocumented(mem->briefDescription(),mem->detailedDescription()))
- {
- numDocPubMethods++;
- }
- }
- else if (mem->section()->isProtected())
- {
- numProMethods++;
- if (isDocumented(mem->briefDescription(),mem->detailedDescription()))
- {
- numDocProMethods++;
- }
- }
- else if (mem->section()->isPrivate())
- {
- numPriMethods++;
- if (isDocumented(mem->briefDescription(),mem->detailedDescription()))
- {
- numDocPriMethods++;
- }
- }
- }
- else if (mem->kind()==IMember::Variable ||
- mem->kind()==IMember::Property
- ) // is an "attribute"
- {
- numAttributes++;
- if (isDocumented(mem->briefDescription(),mem->detailedDescription()))
- {
- numDocAttributes++;
- }
- }
- }
- else if (comp->kind()==ICompound::File ||
- comp->kind()==ICompound::Namespace
- )
- {
- if (mem->kind()==IMember::Function ||
- mem->kind()==IMember::Prototype ||
- mem->kind()==IMember::Signal ||
- mem->kind()==IMember::Slot ||
- mem->kind()==IMember::DCOP
- ) // is a "method"
- {
- numFunctions++;
- if (isDocumented(mem->briefDescription(),mem->detailedDescription()))
- {
- numDocFunctions++;
- }
- }
- else if (mem->kind()==IMember::Variable ||
- mem->kind()==IMember::Property
- ) // is an "attribute"
- {
- numVariables++;
- if (isDocumented(mem->briefDescription(),mem->detailedDescription()))
- {
- numDocVariables++;
- }
- }
- }
-
- for (pli->toFirst();(par=pli->current());pli->toNext())
- {
- numParams++;
- }
- const char *type = mem->typeString()->latin1();
- if (type && strcmp(type, "void"))
- {
- numParams++; // count non-void return types as well
- }
- pli->release();
- }
- mli->release();
- }
- sli->release();
-
- comp->release();
- }
- cli->release();
-
- dox->release();
-
- int numMethods = numPubMethods+numProMethods+numPriMethods;
- int numDocMethods = numDocPubMethods+numDocProMethods+numDocPriMethods;
-
- printf("Metrics:\n");
- printf("-----------------------------------\n");
- if (numClasses>0) printf("Classes: %10d (%d documented)\n",numClasses,numDocClasses);
- if (numStructs>0) printf("Structs: %10d\n",numStructs);
- if (numUnions>0) printf("Unions: %10d\n",numUnions);
- if (numInterfaces>0) printf("Interfaces: %10d\n",numInterfaces);
- if (numExceptions>0) printf("Exceptions: %10d\n",numExceptions);
- if (numNamespaces>0) printf("Namespaces: %10d\n",numNamespaces);
- if (numFiles>0) printf("Files: %10d\n",numFiles);
- if (numGroups>0) printf("Groups: %10d\n",numGroups);
- if (numPages>0) printf("Pages: %10d\n",numPages);
- if (numPackages>0) printf("Packages: %10d\n",numPackages);
- if (numMethods>0) printf("Methods: %10d (%d documented)\n",numMethods,numDocMethods);
- if (numPubMethods>0) printf(" Public: %10d (%d documented)\n",numPubMethods,numDocPubMethods);
- if (numProMethods>0) printf(" Protected: %10d (%d documented)\n",numProMethods,numDocProMethods);
- if (numPriMethods>0) printf(" Private: %10d (%d documented)\n",numPriMethods,numDocPriMethods);
- if (numFunctions>0) printf("Functions: %10d (%d documented)\n",numFunctions,numDocFunctions);
- if (numAttributes>0) printf("Attributes: %10d (%d documented)\n",numAttributes,numDocAttributes);
- if (numVariables>0) printf("Variables: %10d (%d documented)\n",numVariables,numDocVariables);
- if (numParams>0) printf("Params: %10d\n",numParams);
- printf("-----------------------------------\n");
- if (numClasses>0) printf("Avg. #methods/compound: %10f\n",(double)numMethods/(double)numClasses);
- if (numMethods>0) printf("Avg. #params/method: %10f\n",(double)numParams/(double)numMethods);
- printf("-----------------------------------\n");
-
- return 0;
-}
-
diff --git a/addon/doxmlparser/examples/metrics/metrics.py b/addon/doxmlparser/examples/metrics/metrics.py
new file mode 100644
index 0000000..a83e16f
--- /dev/null
+++ b/addon/doxmlparser/examples/metrics/metrics.py
@@ -0,0 +1,225 @@
+# An example showing how to use the python doxmlparser module to extract some metrics from
+# the XML output generated by doxygen for a project.
+
+import sys
+
+import doxmlparser
+
+from doxmlparser.compound import DoxCompoundKind, DoxMemberKind, DoxSectionKind, MixedContainer
+
+class Metrics:
+ def __init__(self):
+ self.numClasses = 0
+ self.numDocClasses = 0
+ self.numStructs = 0
+ self.numUnions = 0
+ self.numInterfaces = 0
+ self.numExceptions = 0
+ self.numNamespaces = 0
+ self.numFiles = 0
+ self.numDocFiles = 0
+ self.numGroups = 0
+ self.numPages = 0
+ self.numPubMethods = 0
+ self.numDocPubMethods = 0
+ self.numProMethods = 0
+ self.numDocProMethods = 0
+ self.numPriMethods = 0
+ self.numDocPriMethods = 0
+ self.numAttributes = 0
+ self.numDocAttributes = 0
+ self.numFunctions = 0
+ self.numDocFunctions = 0
+ self.numVariables = 0
+ self.numDocVariables = 0
+ self.numParams = 0
+ def print(self):
+ numMethods = self.numPubMethods + self.numProMethods + self.numPriMethods
+ numDocMethods = self.numDocPubMethods + self.numDocProMethods + self.numDocPriMethods
+ print("Metrics:");
+ print("-----------------------------------");
+ if self.numClasses>0:
+ print("Classes: {:=10} ({} documented)".format(self.numClasses,self.numDocClasses))
+ if self.numStructs>0:
+ print("Structs: {:=10}".format(self.numStructs))
+ if self.numUnions>0:
+ print("Unions: {:=10}".format(self.numUnions))
+ if self.numExceptions>0:
+ print("Exceptions: {:=10}".format(self.numExceptions))
+ if self.numNamespaces>0:
+ print("Namespaces: {:=10}".format(self.numNamespaces))
+ if self.numFiles>0:
+ print("Files: {:=10} ({} documented)".format(self.numFiles,self.numDocFiles))
+ if self.numGroups>0:
+ print("Groups: {:=10}".format(self.numGroups))
+ if self.numPages>0:
+ print("Pages: {:=10}".format(self.numPages))
+ if numMethods>0:
+ print("Methods: {:=10} ({} documented)".format(numMethods,numDocMethods))
+ if self.numPubMethods>0:
+ print(" Public: {:=10} ({} documented)".format(self.numPubMethods,self.numDocPubMethods))
+ if self.numProMethods>0:
+ print(" Protected: {:=10} ({} documented)".format(self.numProMethods,self.numDocProMethods))
+ if self.numPriMethods>0:
+ print(" Private: {:=10} ({} documented)".format(self.numPriMethods,self.numDocPriMethods))
+ if self.numFunctions>0:
+ print("Functions: {:=10} ({} documented)".format(self.numFunctions,self.numDocFunctions))
+ if self.numAttributes>0:
+ print("Attributes: {:=10} ({} documented)".format(self.numAttributes,self.numDocAttributes))
+ if self.numVariables>0:
+ print("Variables: {:=10} ({} documented)".format(self.numVariables,self.numDocVariables))
+ if self.numParams>0:
+ print("Params: {:=10}".format(self.numParams))
+ print("-----------------------------------");
+ if self.numClasses>0:
+ print("Avg. #methods/compound: {:=10}".format(float(numMethods)/float(self.numClasses)))
+ if numMethods>0:
+ print("Avg. #params/method: {:=10}".format(float(self.numParams)/float(numMethods)))
+ print("-----------------------------------");
+
+
+def description_is_empty(description):
+ for content in description.content_:
+ if content.getCategory()==MixedContainer.CategoryText:
+ if not content.getValue().isspace():
+ return False # non space-only text
+ elif not content.getCategory()==MixedContainer.CategoryNone:
+ return False # some internal object like a paragraph
+ return True
+
+def is_documented(definition):
+ return not description_is_empty(definition.get_briefdescription()) or \
+ not description_is_empty(definition.get_detaileddescription())
+
+def section_is_protected(sectionkind):
+ return sectionkind in [DoxSectionKind.PROTECTEDTYPE,
+ DoxSectionKind.PROTECTEDFUNC,
+ DoxSectionKind.PROTECTEDATTRIB,
+ DoxSectionKind.PROTECTEDSLOT,
+ DoxSectionKind.PROTECTEDSTATICFUNC,
+ DoxSectionKind.PROTECTEDSTATICATTRIB]
+
+def section_is_private(sectionkind):
+ return sectionkind in [DoxSectionKind.PRIVATETYPE,
+ DoxSectionKind.PRIVATEFUNC,
+ DoxSectionKind.PRIVATEATTRIB,
+ DoxSectionKind.PRIVATESLOT,
+ DoxSectionKind.PRIVATESTATICFUNC,
+ DoxSectionKind.PRIVATESTATICATTRIB]
+
+def section_is_public(sectionkind):
+ return not section_is_protected(sectionkind) and not section_is_private(sectionkind)
+
+def linked_text_to_string(linkedtext):
+ str=''
+ if linkedtext:
+ for text_or_ref in linkedtext.content_:
+ if text_or_ref.getCategory()==MixedContainer.CategoryText:
+ str+=text_or_ref.getValue()
+ else:
+ str+=text_or_ref.getValue().get_valueOf_()
+ return str
+
+def parse_members(compounddef,sectiondef,metrics):
+ functionLikeKind = [DoxMemberKind.FUNCTION,
+ DoxMemberKind.PROTOTYPE,
+ DoxMemberKind.SIGNAL,
+ DoxMemberKind.SLOT,
+ DoxMemberKind.DCOP]
+ variableLikeKind = [DoxMemberKind.VARIABLE, DoxMemberKind.PROPERTY]
+ for memberdef in sectiondef.get_memberdef():
+ if compounddef.get_kind() in [DoxCompoundKind.CLASS, DoxCompoundKind.STRUCT, DoxCompoundKind.INTERFACE]:
+ if memberdef.get_kind() in functionLikeKind:
+ if section_is_public(sectiondef.get_kind()):
+ metrics.numPubMethods+=1
+ if is_documented(memberdef):
+ metrics.numDocPubMethods+=1
+ elif section_is_protected(sectiondef.get_kind()):
+ metrics.numProMethods+=1
+ if is_documented(memberdef):
+ metrics.numDocProMethods+=1
+ elif section_is_private(sectiondef.get_kind()):
+ metrics.numPriMethods+=1
+ if is_documented(memberdef):
+ metrics.numDocPriMethods+=1
+ elif memberdef.get_kind() in variableLikeKind:
+ metrics.numAttributes+=1
+ if is_documented(memberdef):
+ metrics.numDocAttributes+=1
+ elif compounddef.get_kind() in [DoxCompoundKind.FILE, DoxCompoundKind.NAMESPACE]:
+ if memberdef.get_kind() in functionLikeKind:
+ metrics.numFunctions+=1
+ if is_documented(memberdef):
+ metrics.numDocFunctions+=1
+ elif memberdef.get_kind() in variableLikeKind:
+ metrics.numVariables+=1
+ if is_documented(memberdef):
+ metrics.numDocVariables+=1
+ #for param in memberdef.get_param():
+ # name = ''
+ # if param.get_defname():
+ # name = param.get_defname()
+ # if param.get_declname():
+ # name = param.get_declname()
+ # print("param '{}':'{}'".format(linked_text_to_string(param.get_type()),name))
+ metrics.numParams+=len(memberdef.get_param())
+ if memberdef.get_type() and memberdef.get_type()!="void" and linked_text_to_string(memberdef.get_type()):
+ metrics.numParams+=1 # count non-void return types as well
+ #print("returns '{}'".format(linked_text_to_string(memberdef.get_type())))
+
+def parse_sections(compounddef,metrics):
+ for sectiondef in compounddef.get_sectiondef():
+ parse_members(compounddef,sectiondef,metrics)
+
+def parse_compound(inDirName,baseName,metrics):
+ rootObj = doxmlparser.compound.parse(inDirName+"/"+baseName+".xml",True)
+ for compounddef in rootObj.get_compounddef():
+ kind = compounddef.get_kind()
+ if kind==DoxCompoundKind.CLASS:
+ metrics.numClasses+=1
+ if is_documented(compounddef):
+ metrics.numDocClasses+=1
+ elif kind==DoxCompoundKind.STRUCT:
+ metrics.numStructs+=1
+ elif kind==DoxCompoundKind.UNION:
+ metrics.numUnions+=1
+ elif kind==DoxCompoundKind.INTERFACE:
+ metrics.numInterfaces+=1
+ elif kind==DoxCompoundKind.EXCEPTION:
+ metrics.numExceptions+=1
+ elif kind==DoxCompoundKind.NAMESPACE:
+ metrics.numNamespaces+=1
+ elif kind==DoxCompoundKind.FILE:
+ metrics.numFiles+=1
+ if is_documented(compounddef):
+ metrics.numDocFiles+=1
+ elif kind==DoxCompoundKind.GROUP:
+ metrics.numGroups+=1
+ elif kind==DoxCompoundKind.PAGE:
+ metrics.numPages+=1
+ else:
+ continue
+ parse_sections(compounddef,metrics)
+
+def parse_index(inDirName):
+ metrics = Metrics()
+ rootObj = doxmlparser.index.parse(inDirName+"/index.xml",True)
+ for compound in rootObj.get_compound(): # for each compound defined in the index
+ print("Processing {0}...".format(compound.get_name()))
+ parse_compound(inDirName,compound.get_refid(),metrics)
+ metrics.print()
+
+def usage():
+ print("Usage {0} <xml_output_dir>".format(sys.argv[0]))
+ sys.exit(1)
+
+def main():
+ args = sys.argv[1:]
+ if len(args)==1:
+ parse_index(args[0])
+ else:
+ usage()
+
+if __name__ == '__main__':
+ main()
+
diff --git a/addon/doxmlparser/include/doxmlintf.h b/addon/doxmlparser/include/doxmlintf.h
deleted file mode 100644
index cb4a9eb..0000000
--- a/addon/doxmlparser/include/doxmlintf.h
+++ /dev/null
@@ -1,1141 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-
-#ifndef _DOXMLINTF_H
-#define _DOXMLINTF_H
-
-/*! \file
- * \brief The interface to the object model provided by the XML parser
- * library.
- *
- * To start using this library one calls createObjectModel() and then
- * uses the returned IDoxygen interface to read doxygen generated
- * XML output and navigate through the information contained in it.
- *
- * @see createObjectModel()
- */
-
-class IMember;
-class IDocIterator;
-class ICompound;
-class ISection;
-class INode;
-class IDocInternal;
-class IDocRoot;
-
-#define VIRTUAL_DESTRUCTOR(x) virtual ~x() {}
-
-/*! \brief Read only interface to a string.
- */
-class IString
-{
- public:
- VIRTUAL_DESTRUCTOR(IString)
- /*! Returns a latin1 character representation of the string. */
- virtual const char *latin1() const = 0;
- /*! Returns a utf8 character representation of the string. */
- virtual const char *utf8() const = 0;
- /*! Returns a 16-bit unicode character representation of the character at
- * position \a index in the string. The first character is at index 0.
- */
- virtual unsigned short unicodeCharAt(int index) const = 0;
- /*! Returns true if this string is empty or false otherwise */
- virtual bool isEmpty() const = 0;
- /*! Returns the number of characters in the string. */
- virtual int length() const = 0;
-};
-
-/*! \brief Base interface for hyperlinked text
- *
- * Depending on the result of kind() the interface is extended by
- * ILT_Text or ILT_Ref.
- */
-class ILinkedText
-{
- public:
- VIRTUAL_DESTRUCTOR(ILinkedText)
- enum Kind { Kind_Text, Kind_Ref };
- virtual Kind kind() const = 0;
-};
-
-/*! \brief Plain text fragment.
- */
-class ILT_Text : public ILinkedText
-{
- public:
- VIRTUAL_DESTRUCTOR(ILT_Text)
- virtual const IString *text() const = 0;
-};
-
-/*! \brief Reference to an object.
- */
-class ILT_Ref : public ILinkedText
-{
- public:
- VIRTUAL_DESTRUCTOR(ILT_Ref)
- enum TargetKind { Member, Compound };
- virtual const IString *id() const = 0;
- virtual TargetKind targetKind() const = 0;
- virtual const IString *external() const = 0;
- virtual const IString *text() const = 0;
-};
-
-/*! \brief Iterates over a list of ILinkedText fragments.
- */
-class ILinkedTextIterator
-{
- public:
- VIRTUAL_DESTRUCTOR(ILinkedTextIterator)
- virtual ILinkedText *toFirst() = 0;
- virtual ILinkedText *toLast() = 0;
- virtual ILinkedText *toNext() = 0;
- virtual ILinkedText *toPrev() = 0;
- virtual ILinkedText *current() const = 0;
- virtual void release() = 0;
-};
-
-/*! \brief Representation of a parameter of a function. */
-class IParam
-{
- public:
- VIRTUAL_DESTRUCTOR(IParam)
- virtual ILinkedTextIterator *type() const = 0;
- virtual const IString * declarationName() const = 0;
- virtual const IString * definitionName() const = 0;
- virtual const IString * attrib() const = 0;
- virtual const IString * arraySpecifier() const = 0;
- virtual ILinkedTextIterator *defaultValue() const = 0;
- virtual IDocRoot *briefDescription() const = 0;
-};
-
-class IParamIterator
-{
- public:
- VIRTUAL_DESTRUCTOR(IParamIterator)
- virtual IParam *toFirst() = 0;
- virtual IParam *toLast() = 0;
- virtual IParam *toNext() = 0;
- virtual IParam *toPrev() = 0;
- virtual IParam *current() const = 0;
- virtual void release() = 0;
-};
-
-class IMemberReference
-{
- public:
- VIRTUAL_DESTRUCTOR(IMemberReference)
- virtual IMember *member() const = 0;
- virtual const IString * name() const = 0;
- virtual const IString * scope() const = 0;
- virtual const IString * protection() const = 0;
- virtual const IString * virtualness() const = 0;
- virtual const IString * ambiguityScope() const = 0;
-};
-
-class IMemberReferenceIterator
-{
- public:
- VIRTUAL_DESTRUCTOR(IMemberReferenceIterator)
- virtual IMemberReference *toFirst() = 0;
- virtual IMemberReference *toLast() = 0;
- virtual IMemberReference *toNext() = 0;
- virtual IMemberReference *toPrev() = 0;
- virtual IMemberReference *current() const = 0;
- virtual void release() = 0;
-};
-
-class IDoc
-{
- public:
- VIRTUAL_DESTRUCTOR(IDoc)
- enum Kind
- {
- Invalid = 0, // 0
- Para, // 1 -> IDocPara
- Text, // 2 -> IDocText
- MarkupModifier, // 3 -> IDocMarkupModifier
- ItemizedList, // 4 -> IDocItemizedList
- OrderedList, // 5 -> IDocOrderedList
- ListItem, // 6 -> IDocListItem
- ParameterList, // 7 -> IDocParameterList
- Parameter, // 8 -> IDocParameter
- SimpleSect, // 9 -> IDocSimpleSect
- Title, // 10 -> IDocTitle
- Ref, // 11 -> IDocRef
- VariableList, // 12 -> IDocVariableList
- VariableListEntry, // 13 -> IDocVariableListEntry
- HRuler, // 14 -> IDocHRuler
- LineBreak, // 15 -> IDocLineBreak
- ULink, // 16 -> IDocULink
- EMail, // 17 -> IDocEMail
- Link, // 18 -> IDocLink
- ProgramListing, // 19 -> IDocProgramListing
- CodeLine, // 20 -> IDocCodeLine
- Highlight, // 21 -> IDocHighlight
- Formula, // 22 -> IDocFormula
- Image, // 23 -> IDocImage
- DotFile, // 24 -> IDocDotFile
- IndexEntry, // 25 -> IDocIndexEntry
- Table, // 26 -> IDocTable
- Row, // 27 -> IDocRow
- Entry, // 28 -> IDocEntry
- Section, // 29 -> IDocSection
- Verbatim, // 30 -> IDocVerbatim
- Copy, // 31 -> IDocCopy
- TocList, // 32 -> IDocTocList
- TocItem, // 33 -> IDocTocItem
- Anchor, // 34 -> IDocAnchor
- Symbol, // 35 -> IDocSymbol
- Internal, // 36 -> IDocInternal
- Root, // 37 -> IDocRoot
- ParameterItem // 38 -> IDocParameterItem
- };
- virtual Kind kind() const = 0;
-};
-
-class IDocMarkup : public IDoc
-{
- public:
- enum Markup
- {
- Normal = 0x000,
- Bold = 0x001,
- Emphasis = 0x002,
- ComputerOutput = 0x004,
- Subscript = 0x008,
- Superscript = 0x010,
- SmallFont = 0x020,
- Center = 0x040,
- Preformatted = 0x080,
- Heading = 0x100
- };
-};
-
-class IDocPara : public IDoc
-{
- public:
- virtual IDocIterator *contents() const = 0;
-};
-
-class IDocText : public IDocMarkup
-{
- public:
- virtual const IString * text() const = 0;
- virtual int markup() const = 0;
- virtual int headingLevel() const = 0;
-};
-
-class IDocMarkupModifier : public IDoc
-{
- public:
- virtual bool enabled() const = 0;
- virtual int markup() const = 0;
- virtual int headingLevel() const = 0;
-};
-
-class IDocItemizedList : public IDoc
-{
- public:
- virtual IDocIterator *elements() const = 0;
-};
-
-class IDocOrderedList : public IDoc
-{
- public:
- virtual IDocIterator *elements() const = 0;
-};
-
-class IDocListItem : public IDoc
-{
- public:
- virtual IDocIterator *contents() const = 0;
-};
-
-class IDocParameterList : public IDoc
-{
- public:
- enum Types { Param, RetVal, Exception };
- virtual Types sectType() const = 0;
- virtual IDocIterator *params() const = 0;
-};
-
-class IDocParameterItem : public IDoc
-{
- public:
- virtual IDocIterator *paramNames() const = 0;
- virtual IDocPara *description() const = 0;
-};
-
-class IDocParameter : public IDoc
-{
- public:
- virtual const IString * name() const = 0;
-};
-
-class IDocTitle : public IDoc
-{
- public:
- virtual IDocIterator *title() const = 0;
-};
-
-class IDocSimpleSect : public IDoc
-{
- public:
- enum Types { Invalid = 0,
- See, Return, Author, Version,
- Since, Date, Bug, Note,
- Warning, Par, Deprecated, Pre,
- Post, Invar, Remark, Attention,
- Todo, Test, RCS, EnumValues,
- Examples
- };
- virtual Types type() const = 0;
- virtual const IString * typeString() const = 0;
- virtual IDocTitle *title() const = 0;
- virtual IDocPara *description() const = 0;
-};
-
-class IDocRef : public IDoc
-{
- public:
- enum TargetKind { Member, Compound };
- virtual const IString * refId() const = 0;
- virtual TargetKind targetKind() const = 0;
- virtual const IString * external() const = 0;
- virtual const IString * text() const = 0;
-};
-
-class IDocVariableList : public IDoc
-{
- public:
- virtual IDocIterator *entries() const = 0;
-};
-
-class IDocVariableListEntry : public IDoc
-{
- public:
- virtual ILinkedTextIterator * term() const = 0;
- virtual IDocPara *description() const = 0;
-};
-
-class IDocHRuler : public IDoc
-{
-};
-
-class IDocLineBreak : public IDoc
-{
-};
-
-class IDocULink : public IDoc
-{
- public:
- virtual const IString * url() const = 0;
- virtual const IString * text() const = 0;
-};
-
-class IDocEMail : public IDoc
-{
- public:
- virtual const IString * address() const = 0;
-};
-
-class IDocLink : public IDoc
-{
- public:
- virtual const IString * refId() const = 0;
- virtual const IString * text() const = 0;
-};
-
-class IDocProgramListing : public IDoc
-{
- public:
- virtual IDocIterator *codeLines() const = 0;
-};
-
-class IDocCodeLine : public IDoc
-{
- public:
- virtual int lineNumber() const = 0;
- virtual const IString * refId() const = 0;
- virtual IDocIterator *codeElements() const = 0;
-};
-
-class IDocHighlight : public IDoc
-{
- public:
- enum HighlightKind
- { Invalid=0,
- Comment, Keyword,
- KeywordType, KeywordFlow, CharLiteral,
- StringLiteral, Preprocessor
- };
- virtual HighlightKind highlightKind() const = 0;
- virtual IDocIterator *codeElements() const = 0;
-};
-
-class IDocFormula : public IDoc
-{
- public:
- virtual const IString * id() const = 0;
- virtual const IString * text() const = 0;
-};
-
-class IDocImage : public IDoc
-{
- public:
- virtual const IString * name() const = 0;
- virtual const IString * caption() const = 0;
-};
-
-class IDocDotFile : public IDoc
-{
- public:
- virtual const IString * name() const = 0;
- virtual const IString * caption() const = 0;
-};
-
-class IDocIndexEntry : public IDoc
-{
- public:
- virtual const IString * primary() const = 0;
- virtual const IString * secondary() const = 0;
-};
-
-class IDocTable : public IDoc
-{
- public:
- virtual IDocIterator *rows() const = 0;
- virtual int numColumns() const = 0;
- virtual const IString * caption() const = 0;
-};
-
-class IDocRow : public IDoc
-{
- public:
- virtual IDocIterator *entries() const = 0;
-};
-
-class IDocEntry : public IDoc
-{
- public:
- virtual IDocIterator *contents() const = 0;
-};
-
-class IDocSection : public IDoc
-{
- public:
- virtual const IString * id() const = 0;
- virtual int level() const = 0;
- virtual IDocTitle *title() const = 0;
- virtual IDocIterator *paragraphs() const = 0;
- virtual IDocIterator *subSections() const = 0;
- virtual IDocInternal *internal() const = 0;
-};
-
-class IDocInternal : public IDoc
-{
- public:
- virtual IDocIterator *paragraphs() const = 0;
- virtual IDocIterator *subSections() const = 0;
-};
-
-class IDocTocList : public IDoc
-{
- public:
- virtual IDocIterator *elements() const = 0;
-};
-
-class IDocTocItem : public IDoc
-{
- public:
- virtual const IString *id() const = 0;
- virtual const IString *title() const = 0;
-};
-
-class IDocCopy : public IDoc
-{
- public:
- virtual IDocIterator *contents() const = 0;
-};
-
-class IDocVerbatim : public IDoc
-{
- public:
- enum Types { Invalid = 0, HtmlOnly, LatexOnly, Verbatim };
- virtual const IString *text() const = 0;
- virtual Types type() const = 0;
-};
-
-class IDocAnchor : public IDoc
-{
- public:
- virtual const IString *id() const = 0;
-};
-
-class IDocSymbol : public IDoc
-{
- public:
- enum Types
- { Invalid = 0,
- Umlaut, Acute, Grave, Circ, Tilde, Szlig, Cedil, Ring, Nbsp, Copy
- };
- virtual Types type() const = 0;
- virtual const IString * typeString() const = 0;
- virtual char letter() const = 0;
-};
-
-class IDocRoot : public IDoc
-{
- public:
- virtual IDocIterator *contents() const = 0;
- virtual IDocInternal *internal() const = 0;
-};
-
-class IDocIterator
-{
- public:
- VIRTUAL_DESTRUCTOR(IDocIterator)
- virtual IDoc *toFirst() = 0;
- virtual IDoc *toLast() = 0;
- virtual IDoc *toNext() = 0;
- virtual IDoc *toPrev() = 0;
- virtual IDoc *current() const = 0;
- virtual void release() = 0;
-};
-
-class IEdgeLabel
-{
- public:
- VIRTUAL_DESTRUCTOR(IEdgeLabel)
- virtual const IString * label() const = 0;
-};
-
-class IEdgeLabelIterator
-{
- public:
- VIRTUAL_DESTRUCTOR(IEdgeLabelIterator)
- virtual IEdgeLabel *toFirst() = 0;
- virtual IEdgeLabel *toLast() = 0;
- virtual IEdgeLabel *toNext() = 0;
- virtual IEdgeLabel *toPrev() = 0;
- virtual IEdgeLabel *current() const = 0;
- virtual void release() = 0;
-};
-
-class IChildNode
-{
- public:
- VIRTUAL_DESTRUCTOR(IChildNode)
- enum NodeRelation { PublicInheritance, ProtectedInheritance,
- PrivateInheritance, Usage, TemplateInstance
- };
- virtual INode * node() const = 0;
- virtual NodeRelation relation() const = 0;
- virtual const IString * relationString() const = 0;
- virtual IEdgeLabelIterator *edgeLabels() const = 0;
-};
-
-class IChildNodeIterator
-{
- public:
- VIRTUAL_DESTRUCTOR(IChildNodeIterator)
- virtual IChildNode *toFirst() = 0;
- virtual IChildNode *toLast() = 0;
- virtual IChildNode *toNext() = 0;
- virtual IChildNode *toPrev() = 0;
- virtual IChildNode *current() const = 0;
- virtual void release() = 0;
-};
-
-class INode
-{
- public:
- VIRTUAL_DESTRUCTOR(INode)
- virtual const IString * id() const = 0;
- virtual const IString * label() const = 0;
- virtual const IString * linkId() const = 0;
- virtual IChildNodeIterator *children() const = 0;
-};
-
-class INodeIterator
-{
- public:
- VIRTUAL_DESTRUCTOR(INodeIterator)
- virtual INode *toFirst() = 0;
- virtual INode *toLast() = 0;
- virtual INode *toNext() = 0;
- virtual INode *toPrev() = 0;
- virtual INode *current() const = 0;
- virtual void release() = 0;
-};
-
-class IGraph
-{
- public:
- VIRTUAL_DESTRUCTOR(IGraph)
- virtual INodeIterator *nodes() const = 0;
-};
-
-class IMember
-{
- public:
- VIRTUAL_DESTRUCTOR(IMember)
- enum MemberKind { Invalid=0,
- Define, Property, Variable, Typedef, Enum,
- Function, Signal, Prototype, Friend, DCOP, Slot,
- EnumValue
- };
- virtual ICompound *compound() const = 0;
- virtual ISection *section() const = 0;
- virtual MemberKind kind() const = 0;
- virtual const IString * kindString() const = 0;
- virtual const IString * id() const = 0;
- virtual const IString * protection() const = 0;
- virtual const IString * virtualness() const = 0;
- virtual ILinkedTextIterator *type() const = 0;
- virtual const IString * typeString() const = 0;
- virtual const IString * name() const = 0;
- virtual const IString * readAccessor() const = 0;
- virtual const IString * writeAccessor() const = 0;
- virtual const IString * definition() const = 0;
- virtual const IString * argsstring() const = 0;
- virtual bool isConst() const = 0;
- virtual bool isVolatile() const = 0;
- virtual bool isStatic() const = 0;
- virtual bool isExplicit() const = 0;
- virtual bool isInline() const = 0;
- virtual bool isMutable() const = 0;
- virtual bool isReadable() const = 0;
- virtual bool isWritable() const = 0;
- virtual IParamIterator *parameters() const = 0;
- virtual IParamIterator *templateParameters() const = 0;
- virtual ILinkedTextIterator *initializer() const = 0;
- virtual ILinkedTextIterator *exceptions() const = 0;
- virtual IMemberReferenceIterator *references() const = 0;
- virtual IMemberReferenceIterator *referencedBy() const = 0;
- virtual const IString *bodyFile() const = 0;
- virtual int bodyStart() const = 0;
- virtual int bodyEnd() const = 0;
- virtual const IString * definitionFile() const = 0;
- virtual int definitionLine() const = 0;
- virtual IMemberReference *reimplements() const = 0;
- virtual IMemberReferenceIterator *reimplementedBy() const = 0;
- virtual IDocRoot *briefDescription() const = 0;
- virtual IDocRoot *detailedDescription() const = 0;
- virtual IDocRoot *inbodyDescription() const = 0;
-};
-
-class IDefine : public IMember
-{
- public:
-};
-
-class IProperty : public IMember
-{
- public:
-};
-
-class IVariable : public IMember
-{
- public:
-};
-
-class ITypedef : public IMember
-{
- public:
-};
-
-class IFunction : public IMember
-{
- public:
-};
-
-class ISignal : public IMember
-{
- public:
-};
-
-class IPrototype : public IMember
-{
- public:
-};
-
-class IFriend : public IMember
-{
- public:
-};
-
-class IDCOP : public IMember
-{
- public:
-};
-
-class ISlot : public IMember
-{
- public:
-};
-
-class IEnumValue : public IMember
-{
- public:
- virtual const IString * name() const = 0;
-};
-
-/*! \brief Include relation
- */
-class IInclude
-{
- public:
- VIRTUAL_DESTRUCTOR(IInclude)
- virtual const IString * name() const = 0;
- virtual const IString * refId() const = 0;
- virtual bool isLocal() const = 0;
-};
-
-class IIncludeIterator
-{
- public:
- VIRTUAL_DESTRUCTOR(IIncludeIterator)
- virtual IInclude *toFirst() = 0;
- virtual IInclude *toLast() = 0;
- virtual IInclude *toNext() = 0;
- virtual IInclude *toPrev() = 0;
- virtual IInclude *current() const = 0;
- virtual void release() = 0;
-};
-
-class IMemberIterator
-{
- public:
- VIRTUAL_DESTRUCTOR(IMemberIterator)
- virtual IMember *toFirst() = 0;
- virtual IMember *toLast() = 0;
- virtual IMember *toNext() = 0;
- virtual IMember *toPrev() = 0;
- virtual IMember *current() const = 0;
- virtual void release() = 0;
-};
-
-class IEnum : public IMember
-{
- public:
- virtual IMemberIterator *enumValues() const = 0;
-};
-
-/*! \brief The interface to a section in the object model.
- *
- * A compound can have a number of sections, where each
- * section contains a set of members with the properties implied by
- * the section kind. The kind() method returns the kind of the section.
- * The members of the section can be accessed via members(). Apart
- * from using kind(), some of the individual properties of the section can
- * also be inspected via isStatic(), isPublic(), isProtected() and
- * isPrivate().
- */
-class ISection
-{
- public:
- VIRTUAL_DESTRUCTOR(ISection)
- /*! Possible section types */
- enum SectionKind
- { Invalid=0,
- UserDefined, //!< A user defined member group
- PubTypes, //!< Public member typedefs
- PubFuncs, //!< Public member functions
- PubAttribs, //!< Public member attributes
- PubSlots, //!< Public Qt Slots
- Signals, //!< Qt Signals
- DCOPFuncs, //!< KDE-DCOP interface functions
- Properties, //!< IDL properties
- Events, //!< C# events
- PubStatFuncs, //!< Public static member functions
- PubStatAttribs, //!< Public static attributes
- ProTypes, //!< Protected member typedefs
- ProFuncs, //!< Protected member functions
- ProAttribs, //!< Protected member attributes
- ProSlots, //!< Protected slots
- ProStatFuncs, //!< Protected static member functions
- ProStatAttribs, //!< Protected static member attributes
- PacTypes, //!< Package member typedefs
- PacFuncs, //!< Package member functions
- PacAttribs, //!< Package member attributes
- PacStatFuncs, //!< Package static member functions
- PacStatAttribs, //!< Package static member attributes
- PriTypes, //!< Private member typedefs
- PriFuncs, //!< Private member functions
- PriAttribs, //!< Private member attributes
- PriSlots, //!< Private Qt slots
- PriStatFuncs, //!< Private static member functions
- PriStatAttribs, //!< Private static member attributes
- Friend, //!< Friends
- Related, //!< Function marked as related
- Defines, //!< Preprocessor defines
- Prototypes, //!< Global function prototypes
- Typedefs, //!< Global typedefs
- Enums, //!< Enumerations
- Functions, //!< Global functions
- Variables //!< Global variables
- };
-
- /*! Returns a string representation of the value returned by kind() */
- virtual const IString * kindString() const = 0;
-
- /*! Returns what kind of section this is */
- virtual SectionKind kind() const = 0;
-
- /*! Returns the description attached to this section (for user defined
- * sections, also known as member groups).
- */
- virtual IDocRoot *description() const = 0;
-
- /*! Returns an iterator for the members of this section */
- virtual IMemberIterator *members() const = 0;
-
- /*! Returns \c true if this section contains statics */
- virtual bool isStatic() const = 0;
-
- /*! Returns \c true if this section belongs to a
- * public section of a class
- */
- virtual bool isPublic() const = 0;
-
- /*! Returns \c true if this section belongs to a
- * private section of a class
- */
- virtual bool isPrivate() const = 0;
-
- /*! Returns \c true if this section belongs to a
- * protected section of a class
- * */
- virtual bool isProtected() const = 0;
-};
-
-class IUserDefined : public ISection
-{
- public:
- virtual const IString * header() const = 0;
-};
-
-class ISectionIterator
-{
- public:
- VIRTUAL_DESTRUCTOR(ISectionIterator)
- virtual ISection *toFirst() = 0;
- virtual ISection *toLast() = 0;
- virtual ISection *toNext() = 0;
- virtual ISection *toPrev() = 0;
- virtual ISection *current() const = 0;
- virtual void release() = 0;
-};
-
-/*! \brief The interface to a compound in the object model.
- *
- * A compound has a name which can be obtained via the name() method
- * and a unique id, which is return via the id() method.
- * A compound consists zero or more members which are grouped into sections.
- * The sections() method can be used to access the individual sections.
- * Alternatively, members can be obtained by name or id. There are
- * different types of compounds. The kind() method returns what kind of
- * compound this is. Depending on the return value one can dynamically
- * cast an interface pointer to an more specialised interface that provides
- * additional methods.
- * Example:
- * \code
- * ICompound *comp=...;
- * if (comp->kind()==ICompound::Class)
- * {
- * IClass *cls = dynamic_cast<IClass*>(comp);
- * // use methods of IClass
- * }
- * \endcode
- * The documentation that is provided by a compound is available via
- * the briefDescription() and detailedDescription() methods.
- * To avoid excessive memory usage, release() should be called (once) on each
- * compound interface pointer that is no longer needed.
- */
-class ICompound
-{
- public:
- VIRTUAL_DESTRUCTOR(ICompound)
- /*! Represents the kind of compounds recognised by doxygen. */
- enum CompoundKind { Invalid=0,
- Class, Struct, Union, Interface, Protocol, Category,
- Exception, File, Namespace, Group, Page, Example, Dir
- };
-
- /*! Returns the name of this compound */
- virtual const IString * name() const = 0;
-
- /*! Returns the id of this compound. The id is a
- * unique string representing a specific compound object.
- */
- virtual const IString * id() const = 0;
-
- /*! Returns the kind of compound. See #CompoundKind for possible
- * values.
- */
- virtual CompoundKind kind() const = 0;
-
- /*! Returns a string representation of the compound kind.
- * @see kind()
- */
- virtual const IString * kindString() const = 0;
-
- /*! Returns an iterator for the different member sections in this
- * compound.
- */
- virtual ISectionIterator *sections() const = 0;
-
- /*! Returns a tree-structured representation of the brief
- * description that is attached to this compound.
- */
- virtual IDocRoot *briefDescription() const = 0;
-
- /*! Returns a tree-structured representation of the detailed
- * description that is attached to this compound.
- */
- virtual IDocRoot *detailedDescription() const = 0;
-
- /*! Returns an interface to a member given its id.
- * @param id The member id.
- */
- virtual IMember *memberById(const char * id) const = 0;
-
- /*! Returns a list of all members within the compound having a certain
- * name. Member overloading is the reason why there can be more than
- * one member.
- * @param name The name of the member.
- */
- virtual IMemberIterator *memberByName(const char * name) const = 0;
-
- /*! Decreases the reference counter for this compound. If it reaches
- * zero, the memory for the compound will be released.
- */
- virtual void release() = 0;
-};
-
-class ICompoundIterator
-{
- public:
- VIRTUAL_DESTRUCTOR(ICompoundIterator)
- virtual void toFirst() = 0;
- virtual void toLast() = 0;
- virtual void toNext() = 0;
- virtual void toPrev() = 0;
- virtual ICompound *current() const = 0;
- virtual void release() = 0;
-};
-
-class IRelatedCompound
-{
- public:
- VIRTUAL_DESTRUCTOR(IRelatedCompound)
- enum Protection { Public, Protected, Private };
- enum Kind { Normal, Virtual };
- virtual ICompound *compound() const = 0;
- virtual Protection protection() const = 0;
- virtual Kind kind() const = 0;
- virtual const IString *name() const = 0;
-
-};
-
-class IRelatedCompoundIterator
-{
- public:
- VIRTUAL_DESTRUCTOR(IRelatedCompoundIterator)
- virtual IRelatedCompound *toFirst() = 0;
- virtual IRelatedCompound *toLast() = 0;
- virtual IRelatedCompound *toNext() = 0;
- virtual IRelatedCompound *toPrev() = 0;
- virtual IRelatedCompound *current() const = 0;
- virtual void release() = 0;
-};
-
-/*! \brief The interface to a class in the object model.
- */
-class IClass : public ICompound
-{
- public:
- virtual IGraph *inheritanceGraph() const = 0;
- virtual IGraph *collaborationGraph() const = 0;
- virtual IRelatedCompoundIterator *baseCompounds() const = 0;
- virtual IRelatedCompoundIterator *derivedCompounds() const = 0;
- virtual ICompoundIterator *nestedCompounds() const = 0;
- virtual IParamIterator *templateParameters() const = 0;
- virtual const IString *locationFile() const = 0;
- virtual int locationLine() const = 0;
- virtual const IString *locationBodyFile() const = 0;
- virtual int locationBodyStartLine() const = 0;
- virtual int locationBodyEndLine() const = 0;
-
- // TODO:
- // class:
- // listOfAllMembers()
- // protection()
- // isAbstract()
-};
-
-/*! \brief The interface to a struct in the object model.
- */
-class IStruct : public ICompound
-{
- public:
- virtual ICompoundIterator *nestedCompounds() const = 0;
- virtual IRelatedCompoundIterator *baseCompounds() const = 0;
- virtual IRelatedCompoundIterator *derivedCompounds() const = 0;
- virtual const IString *locationFile() const = 0;
- virtual int locationLine() const = 0;
- virtual int locationBodyStartLine() const = 0;
- virtual int locationBodyEndLine() const = 0;
-};
-
-/*! \brief The interface to a union in the object model.
- */
-class IUnion : public ICompound
-{
- public:
- virtual ICompoundIterator *nestedCompounds() const = 0;
-};
-
-/*! \brief The interface to a Java/IDL interface in the object model.
- */
-class IInterface : public ICompound
-{
- public:
- virtual IRelatedCompoundIterator *baseCompounds() const = 0;
- virtual IRelatedCompoundIterator *derivedCompounds() const = 0;
-};
-
-
-/*! \brief The interface to a Java/IDL exception in the object model.
- */
-class IException : public ICompound
-{
-};
-
-/*! \brief The interface to a namespace in the object model.
- */
-class INamespace : public ICompound
-{
- public:
- virtual ICompoundIterator *nestedCompounds() const = 0;
-};
-
-/*! \brief The interface to a file in the object model.
- */
-class IFile : public ICompound
-{
- public:
- virtual IGraph *includeDependencyGraph() const = 0;
- virtual IGraph *includedByDependencyGraph() const = 0;
- virtual IDocProgramListing *source() const = 0;
- virtual ICompoundIterator *nestedCompounds() const = 0;
-
- virtual IIncludeIterator *includes() const = 0;
- virtual IIncludeIterator *includedBy() const = 0;
-
- // ICompound *innerNamespaces()
- // ICompoundIterator *innerClasses()
-};
-
-/*! \brief The interface to a group in the object model.
- */
-class IGroup : public ICompound
-{
- public:
- virtual ICompoundIterator *nestedCompounds() const = 0;
- // group:
- // Title()
- // innerFile()
- // innerPage()
-};
-
-/*! \brief The interface to a page in the object model.
- */
-class IPage : public ICompound
-{
- public:
- virtual const IDocTitle *title() const = 0;
-};
-
-/** \brief Interface to a directory in the object model. */
-class IDir : public ICompound
-{
- public:
- virtual ICompoundIterator *nestedCompounds() const = 0;
-};
-
-/*! Root node of the object model. */
-class IDoxygen
-{
- public:
- VIRTUAL_DESTRUCTOR(IDoxygen)
-
- /*! Returns an iterator that can be used to iterate over the list
- * of compounds found in the project.
- */
- virtual ICompoundIterator *compounds() const = 0;
-
- /*! Returns a compound given its unique \a id. If you have a
- * compound id this function is much more efficient than iterating
- * over the compound list. Returns 0 if the id is not valid.
- */
- virtual ICompound *compoundById(const char * id) const = 0;
-
- /*! Returns a compound given its name (including the scope).
- * Returns 0 if the name is not found in the project.
- */
- virtual ICompound *compoundByName(const char * name) const = 0;
-
- /*! Returns an interface to a compound containing a member given it the
- * member's id. Given the ICompound interface one can use the same id
- * to obtain the IMember interface.
- * @param id The member id.
- */
- virtual ICompound *memberById(const char * id) const = 0;
-
- /*! Returns a list of all compounds containing at least one members
- * with a certain name. Each compound can be asked to return the
- * list of members with that name.
- * @param name The name of the member.
- */
- virtual ICompoundIterator *memberByName(const char * name) const = 0;
-
- /*! Releases the memory for the object hierarchy obtained by
- * createdObjectModel(). First release all iterators before calling
- * this function.
- */
- virtual void release() = 0;
-
- /*! Sets the debug level.
- * - 0 all debugging messages are disabled (the default).
- * - 1 display important messages only
- * - 2 display any messages.
- */
- virtual void setDebugLevel(int level) = 0;
-
- /*! Reads an XML directory produced by doxygen and builds up a data
- * structure representing the contents of the XML files in the directory.
- */
- virtual bool readXMLDir(const char *xmlDirName) = 0;
-};
-
-/*! Factory method that creates an empty object model for a doxygen generated XML file.
- * Use the readXMLDir() method to build the model from an XML output
- * directory containing doxygen output.
- */
-IDoxygen *createObjectModel();
-
-#endif
diff --git a/addon/doxmlparser/requirements.txt b/addon/doxmlparser/requirements.txt
new file mode 100644
index 0000000..d7a63aa
--- /dev/null
+++ b/addon/doxmlparser/requirements.txt
@@ -0,0 +1,2 @@
+lxml>=4.0.0
+six>=1.0.0
diff --git a/addon/doxmlparser/setup.py b/addon/doxmlparser/setup.py
new file mode 100644
index 0000000..02a0496
--- /dev/null
+++ b/addon/doxmlparser/setup.py
@@ -0,0 +1,19 @@
+from setuptools import setup, find_packages
+
+with open('README.md') as f:
+ readme = f.read()
+
+with open('LICENSE') as f:
+ license = f.read()
+
+setup(
+ name='doxmlparser',
+ version='0.1',
+ description='Python API to access doxygen generated XML output',
+ long_description=readme,
+ author='Dimitri van Heesch',
+ author_email='doxygen@gmail.com',
+ url='https://github.com/doxygen/doxygen/addon/doxmlparser',
+ license=license,
+ packages=find_packages(exclude=('tests', 'docs'))
+)
diff --git a/addon/doxmlparser/src/CMakeLists.txt b/addon/doxmlparser/src/CMakeLists.txt
deleted file mode 100644
index cbd5811..0000000
--- a/addon/doxmlparser/src/CMakeLists.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-include_directories(
- .
- ../include
- ${PROJECT_SOURCE_DIR}/qtools
-)
-add_library(doxmlparser STATIC
- basehandler.cpp
- compoundhandler.cpp
- debug.cpp
- dochandler.cpp
- graphhandler.cpp
- linkedtexthandler.cpp
- loamhandler.cpp
- mainhandler.cpp
- memberhandler.cpp
- paramhandler.cpp
- sectionhandler.cpp
-)
diff --git a/addon/doxmlparser/src/basehandler.cpp b/addon/doxmlparser/src/basehandler.cpp
deleted file mode 100644
index 02d98c2..0000000
--- a/addon/doxmlparser/src/basehandler.cpp
+++ /dev/null
@@ -1,3 +0,0 @@
-#include "basehandler.h"
-
-QXmlLocator * LocatorContainer::s_theLocator=0;
diff --git a/addon/doxmlparser/src/basehandler.h b/addon/doxmlparser/src/basehandler.h
deleted file mode 100644
index 1772d8a..0000000
--- a/addon/doxmlparser/src/basehandler.h
+++ /dev/null
@@ -1,325 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-
-#ifndef _BASEHANDLER_H
-#define _BASEHANDLER_H
-
-#include <qxml.h>
-#include <qdict.h>
-#include <qstring.h>
-
-#include "debug.h"
-
-//-----------------------------------------------------------------------------
-
-class IBaseHandler
-{
- public:
- virtual void setDelegate(QXmlDefaultHandler *delegate) = 0;
- virtual QXmlDefaultHandler *delegate() const = 0;
- virtual ~IBaseHandler() {}
-};
-
-//-----------------------------------------------------------------------------
-
-class IFallBackHandler
-{
- public:
- virtual bool handleStartElement(const QString & name,
- const QXmlAttributes & attrib) = 0;
- virtual bool handleEndElement(const QString &name) = 0;
- virtual ~IFallBackHandler() {}
-};
-
-//-----------------------------------------------------------------------------
-
-template<class T> class ElementMapper
-{
- class StartElementHandler
- {
- typedef void (T::*Handler)(const QXmlAttributes &attrib);
- public:
- StartElementHandler() : m_parent(0) {}
- StartElementHandler(T *parent, Handler h)
- : m_parent(parent), m_handler(h) {}
- void operator()(const QXmlAttributes &attrib)
- { if (m_parent) (m_parent->*m_handler)(attrib); }
- private:
- T *m_parent = 0;
- Handler m_handler;
- };
-
- class EndElementHandler
- {
- typedef void (T::*Handler)();
- public:
- EndElementHandler() : m_parent(0) {}
- EndElementHandler(T *parent, Handler h)
- : m_parent(parent), m_handler(h) {}
- void operator()()
- { if (m_parent) (m_parent->*m_handler)(); }
- private:
- T *m_parent = 0;
- Handler m_handler;
- };
-
- public:
- typedef StartElementHandler StartElementHandlerT;
- typedef EndElementHandler EndElementHandlerT;
-
- ElementMapper() : m_startHandlers(67), m_endHandlers(67)
- {
- m_startHandlers.setAutoDelete(TRUE);
- m_endHandlers.setAutoDelete(TRUE);
- }
- virtual ~ElementMapper()
- {
- }
-
- void addStartHandler(const char *key)
- {
- m_startHandlers.insert(key,new StartElementHandlerT);
- }
-
- void addStartHandler(const char *key, T *obj, void (T::*handler)(const QXmlAttributes &))
- {
- m_startHandlers.insert(key,new StartElementHandlerT(obj,handler));
- }
-
- void addEndHandler(const char *key)
- {
- m_endHandlers.insert(key,new EndElementHandlerT);
- }
-
- void addEndHandler(const char *key, T *obj, void (T::*handler)())
- {
- m_endHandlers.insert(key,new EndElementHandlerT(obj,handler));
- }
-
-
- protected:
- QDict<StartElementHandlerT> m_startHandlers;
- QDict<EndElementHandlerT> m_endHandlers;
-};
-
-//-----------------------------------------------------------------------------
-
-struct LocatorContainer
-{
- static QXmlLocator *s_theLocator;
-};
-
-//-----------------------------------------------------------------------------
-
-template<class T> class BaseHandler : public QXmlDefaultHandler,
- public ElementMapper<T>,
- public LocatorContainer,
- public IBaseHandler
-{
- public:
- typedef typename ElementMapper<T>::StartElementHandlerT StartElementHandlerT;
- typedef typename ElementMapper<T>::EndElementHandlerT EndElementHandlerT;
-
- BaseHandler() : m_skipCount(0), m_delegateHandler(0), m_fallBackHandler(0)
- {
- }
-
- virtual ~BaseHandler()
- {
- ASSERT(m_delegateHandler==0);
- }
-
- virtual bool startDocument()
- {
- return TRUE;
- }
-
- virtual bool startElement( const QString & namespaceURI,
- const QString & localName,
- const QString & name,
- const QXmlAttributes & attrib
- )
- {
- if (m_delegateHandler)
- {
- return m_delegateHandler->startElement(namespaceURI,localName,name,attrib);
- }
- if (!m_skipUntil.isEmpty()) // skip mode
- {
- if (m_skipUntil==name) m_skipCount++;
- debug(1,"line %d, col %d: skipping start tag %s count=%d\n",
- s_theLocator->lineNumber(),s_theLocator->columnNumber(),
- name.data(),m_skipCount);
- return TRUE;
- }
-
- StartElementHandlerT *handler = ElementMapper<T>::m_startHandlers[name.utf8()];
- if (handler)
- {
- (*handler)(attrib);
- //printf("found start tag %s\n",name.data());
- }
- else if (!m_fallBackHandler ||
- !m_fallBackHandler->handleStartElement(name,attrib)
- )
- {
- debug(1,"line %d, col %d: found unexpected tag '%s', skipping until matching end tag\n",
- s_theLocator->lineNumber(),s_theLocator->columnNumber(),
- name.data());
- m_skipUntil = name;
- m_skipCount=1;
- }
- return TRUE;
- }
-
- virtual bool endElement( const QString& namespaceURI, const QString& localName, const QString& name )
- {
- if (m_delegateHandler)
- {
- return m_delegateHandler->endElement(namespaceURI,localName,name);
- }
-
- if (name==m_skipUntil)
- {
- m_skipCount--;
- debug(1,"line %d, col %d: skipping end tag %s count=%d\n",
- s_theLocator->lineNumber(),s_theLocator->columnNumber(),
- name.data(),m_skipCount);
- if (m_skipCount==0)
- {
- m_skipUntil="";
- }
- //printf("found end tag %s\n",name.data());
- }
- else if (m_skipUntil.isEmpty())
- {
- EndElementHandlerT *handler = ElementMapper<T>::m_endHandlers[name.utf8()];
- if (handler)
- {
- (*handler)();
- //printf("found end tag %s\n",name.data());
- }
- else if (m_fallBackHandler)
- {
- m_fallBackHandler->handleEndElement(name);
- }
- }
- m_curString="";
- return TRUE;
- }
-
- bool skippedEntity ( const QString &s )
- {
- if (m_delegateHandler)
- {
- return m_delegateHandler->skippedEntity(s);
- }
-
- debug(1,"line %d, col %d: Skipped unhandled entity %s\n",
- s_theLocator->lineNumber(),s_theLocator->columnNumber(),
- s.data());
- return TRUE;
- }
-
- /*! called when a number of characters are received by the parser.
- * \param ch the characters.
- */
- virtual bool characters ( const QString & ch )
- {
- if (m_delegateHandler)
- {
- return m_delegateHandler->characters(ch);
- }
-
- //printf("Found characters \"%s\"\n",ch.data());
- m_curString+=ch;
- return TRUE;
- }
-
- void setDelegate(QXmlDefaultHandler *delegate)
- {
- m_delegateHandler = delegate;
- }
-
- QXmlDefaultHandler *delegate() const
- {
- return m_delegateHandler;
- }
-
- void setFallBackHandler(IFallBackHandler *h)
- {
- m_fallBackHandler = h;
- }
-
- IFallBackHandler *fallBackHandler() const
- {
- return m_fallBackHandler;
- }
-
- void setDocumentLocator( QXmlLocator * locator )
- {
- debug(2,"setDocumentLocator(%p)\n",locator);
- s_theLocator = locator;
- }
-
- protected:
- QString m_curString;
- QString m_skipUntil;
- int m_skipCount = 0;
- QXmlDefaultHandler *m_delegateHandler = 0;
- IFallBackHandler *m_fallBackHandler = 0;
-};
-
-//-----------------------------------------------------------------------------
-
-template<class T> class BaseFallBackHandler : public ElementMapper<T>,
- public IFallBackHandler
-{
- public:
- typedef typename ElementMapper<T>::StartElementHandlerT StartElementHandlerT;
- typedef typename ElementMapper<T>::EndElementHandlerT EndElementHandlerT;
-
- BaseFallBackHandler()
- {
- }
- virtual ~BaseFallBackHandler()
- {
- }
-
- bool handleStartElement(const QString & name,
- const QXmlAttributes & attrib)
- {
- StartElementHandlerT *handler = ElementMapper<T>::m_startHandlers[name.utf8()];
- if (handler)
- {
- (*handler)(attrib);
- return TRUE;
- }
- return FALSE;
- }
- bool handleEndElement(const QString &name)
- {
- EndElementHandlerT *handler = ElementMapper<T>::m_endHandlers[name.utf8()];
- if (handler)
- {
- (*handler)();
- return TRUE;
- }
- return FALSE;
- }
-};
-
-
-#endif
diff --git a/addon/doxmlparser/src/baseiterator.h b/addon/doxmlparser/src/baseiterator.h
deleted file mode 100644
index 3325f54..0000000
--- a/addon/doxmlparser/src/baseiterator.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-#ifndef BASEITERATOR_H
-#define BASEITERATOR_H
-
-#include <qlist.h>
-#include <doxmlintf.h>
-
-template<class Intf,class ElemIntf,class ElemImpl> class BaseIterator :
- public Intf, public QListIterator<ElemImpl>
-{
- public:
- BaseIterator(const QList<ElemImpl> &list) : QListIterator<ElemImpl>(list) {}
- virtual ~BaseIterator() {}
- virtual ElemIntf *toFirst() { return QListIterator<ElemImpl>::toFirst(); }
- virtual ElemIntf *toLast() { return QListIterator<ElemImpl>::toLast(); }
- virtual ElemIntf *toNext() { return QListIterator<ElemImpl>::operator++(); }
- virtual ElemIntf *toPrev() { return QListIterator<ElemImpl>::operator--(); }
- virtual ElemIntf *current() const { return QListIterator<ElemImpl>::current(); }
- virtual void release() { delete this; }
-};
-
-template<class Intf,class ElemIntf,class ElemImpl,class Intermediate>
- class BaseIteratorVia :
- public Intf, public QListIterator<ElemImpl>
-{
- public:
- BaseIteratorVia(const QList<ElemImpl> &list) : QListIterator<ElemImpl>(list) {}
- virtual ~BaseIteratorVia() {}
- virtual ElemIntf *toFirst() { return static_cast<Intermediate *>(QListIterator<ElemImpl>::toFirst()); }
- virtual ElemIntf *toLast() { return static_cast<Intermediate *>(QListIterator<ElemImpl>::toLast()); }
- virtual ElemIntf *toNext() { return static_cast<Intermediate *>(QListIterator<ElemImpl>::operator++()); }
- virtual ElemIntf *toPrev() { return static_cast<Intermediate *>(QListIterator<ElemImpl>::operator--()); }
- virtual ElemIntf *current() const { return static_cast<Intermediate *>(QListIterator<ElemImpl>::current()); }
- virtual void release() { delete this; }
-};
-
-#endif
diff --git a/addon/doxmlparser/src/compoundhandler.cpp b/addon/doxmlparser/src/compoundhandler.cpp
deleted file mode 100644
index 69fb70c..0000000
--- a/addon/doxmlparser/src/compoundhandler.cpp
+++ /dev/null
@@ -1,655 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-
-#include "mainhandler.h"
-#include "compoundhandler.h"
-#include "dochandler.h"
-#include "debug.h"
-#include "graphhandler.h"
-#include "sectionhandler.h"
-#include "paramhandler.h"
-#include "loamhandler.h"
-#include "memberhandler.h"
-#include "linkedtexthandler.h"
-
-//----------------------------------------------------------------------------
-
-IncludeHandler::IncludeHandler(IBaseHandler *parent,const char *endtag) :
- m_parent(parent)
-{
- addEndHandler(endtag,this,&IncludeHandler::endInclude);
-}
-
-IncludeHandler::~IncludeHandler()
-{
-}
-
-void IncludeHandler::startInclude(const QXmlAttributes &attrib)
-{
- m_curString = "";
- m_refId = attrib.value("refid");
- m_isLocal = attrib.value("local")=="yes";
- m_parent->setDelegate(this);
-}
-
-void IncludeHandler::endInclude()
-{
- m_name = m_curString;
- m_parent->setDelegate(0);
- debug(2,"Found include %s\n",m_name.data());
-}
-
-//----------------------------------------------------------------------------
-
-class CompoundIdIterator : public ICompoundIterator,
- public QListIterator<QString>
-{
- public:
- CompoundIdIterator(const MainHandler *m,const QList<QString> &list) :
- QListIterator<QString>(list), m_mainHandler(m) {}
- virtual ~CompoundIdIterator() {}
-
- virtual void toFirst()
- {
- QListIterator<QString>::toFirst();
- }
- virtual void toLast()
- {
- QListIterator<QString>::toLast();
- }
- virtual void toNext()
- {
- QListIterator<QString>::operator++();
- }
- virtual void toPrev()
- {
- QListIterator<QString>::operator--();
- }
- virtual ICompound *current() const
- {
- QString *id = QListIterator<QString>::current();
- return id ? m_mainHandler->compoundById(id->utf8()) : 0;
- }
- virtual void release()
- { delete this; }
-
- private:
- const MainHandler *m_mainHandler = 0;
-};
-
-//----------------------------------------------------------------------------
-
-ICompound *RelatedCompound::compound() const
-{
- return m_parent->m_mainHandler->compoundById(m_id.utf8());
-}
-
-//----------------------------------------------------------------------------
-
-class CompoundErrorHandler : public QXmlErrorHandler
-{
- public:
- virtual ~CompoundErrorHandler() {}
- bool warning( const QXmlParseException & )
- {
- return FALSE;
- }
- bool error( const QXmlParseException & )
- {
- return FALSE;
- }
- bool fatalError( const QXmlParseException &exception )
- {
- debug(1,"Fatal error at line %d column %d: %s\n",
- exception.lineNumber(),exception.columnNumber(),
- exception.message().data());
- return FALSE;
- }
- QString errorString() { return ""; }
-
- private:
- QString errorMsg;
-};
-
-//----------------------------------------------------------------------------
-
-class CompoundTypeMap
-{
- public:
- CompoundTypeMap()
- {
- m_map.setAutoDelete(TRUE);
- m_map.insert("class", new int(ICompound::Class));
- m_map.insert("struct", new int(ICompound::Struct));
- m_map.insert("union", new int(ICompound::Union));
- m_map.insert("interface",new int(ICompound::Interface));
- m_map.insert("protocol", new int(ICompound::Protocol));
- m_map.insert("category", new int(ICompound::Category));
- m_map.insert("exception",new int(ICompound::Exception));
- m_map.insert("file", new int(ICompound::File));
- m_map.insert("namespace",new int(ICompound::Namespace));
- m_map.insert("group", new int(ICompound::Group));
- m_map.insert("page", new int(ICompound::Page));
- m_map.insert("example", new int(ICompound::Example));
- m_map.insert("dir", new int(ICompound::Dir));
- }
- virtual ~CompoundTypeMap()
- {
- }
- ICompound::CompoundKind map(const QString &s)
- {
- int *val = m_map.find(s.utf8());
- if (val==0)
- {
- debug(1,"Warning: '%s' is an invalid compound type\n",s.data());
- return ICompound::Invalid;
- }
- else return (ICompound::CompoundKind)*val;
- }
- private:
- QDict<int> m_map;
-};
-
-static CompoundTypeMap *s_typeMap;
-
-void compoundhandler_init()
-{
- s_typeMap = new CompoundTypeMap;
-}
-
-void compoundhandler_exit()
-{
- delete s_typeMap;
-}
-
-//----------------------------------------------------------------------------
-
-CompoundHandler::CompoundHandler(const QString &xmlDir)
- : m_titleHandler(0),
- m_includeDependencyGraph(0),
- m_includedByDependencyGraph(0),
- m_templateParamList(0),
- m_brief(0),
- m_detailed(0),
- m_inheritanceGraph(0),
- m_collaborationGraph(0),
- m_programListing(0),
- m_members(0),
- m_xmlDir(xmlDir),
- m_refCount(1),
- m_memberDict(257),
- m_memberNameDict(257),
- m_mainHandler(0)
-{
- m_superClasses.setAutoDelete(TRUE);
- m_subClasses.setAutoDelete(TRUE);
- m_sections.setAutoDelete(TRUE);
- m_memberNameDict.setAutoDelete(TRUE);
- m_innerCompounds.setAutoDelete(TRUE);
- m_includes.setAutoDelete(TRUE);
- m_includedBy.setAutoDelete(TRUE);
-
- addStartHandler("doxygen");
- addEndHandler("doxygen");
-
- addStartHandler("compounddef",this,&CompoundHandler::startCompound);
- addEndHandler("compounddef",this,&CompoundHandler::endCompound);
-
- addStartHandler("compoundname");
- addEndHandler("compoundname",this,&CompoundHandler::endCompoundName);
-
- addStartHandler("title",this,&CompoundHandler::startTitle);
-
- addStartHandler("basecompoundref",this,&CompoundHandler::startSuperClass);
- addEndHandler("basecompoundref",this,&CompoundHandler::endSuperClass);
-
- addStartHandler("derivedcompoundref",this,&CompoundHandler::startSubClass);
- addEndHandler("derivedcompoundref",this,&CompoundHandler::endSubClass);
-
- addStartHandler("includes",this,&CompoundHandler::startIncludes);
- addStartHandler("includedby",this,&CompoundHandler::startIncludedBy);
-
- addStartHandler("incdepgraph",this,&CompoundHandler::startIncludeDependencyGraph);
-
- addStartHandler("invincdepgraph",this,&CompoundHandler::startIncludedByDependencyGraph);
-
- addStartHandler("innerdir",this,&CompoundHandler::startInnerDir);
- addEndHandler("innerdir");
-
- addStartHandler("innerfile",this,&CompoundHandler::startInnerFile);
- addEndHandler("innerfile");
-
- addStartHandler("innerclass",this,&CompoundHandler::startInnerClass);
- addEndHandler("innerclass");
-
- addStartHandler("innernamespace",this,&CompoundHandler::startInnerNamespace);
- addEndHandler("innernamespace");
-
- addStartHandler("innerpage",this,&CompoundHandler::startInnerPage);
- addEndHandler("innerpage");
-
- addStartHandler("innergroup",this,&CompoundHandler::startInnerGroup);
- addEndHandler("innergroup");
-
- addStartHandler("templateparamlist",this,&CompoundHandler::startTemplateParamList);
-
- addStartHandler("sectiondef",this,&CompoundHandler::startSection);
-
- addStartHandler("briefdescription",this,&CompoundHandler::startBriefDesc);
-
- addStartHandler("detaileddescription",this,&CompoundHandler::startDetailedDesc);
-
- addStartHandler("inheritancegraph",this,&CompoundHandler::startInheritanceGraph);
-
- addStartHandler("collaborationgraph",this,&CompoundHandler::startCollaborationGraph);
-
- addStartHandler("programlisting",this,&CompoundHandler::startProgramListing);
-
- addStartHandler("location",this,&CompoundHandler::startLocation);
- addEndHandler("location");
-
- addStartHandler("listofallmembers",this,&CompoundHandler::startListOfAllMembers);
-}
-
-CompoundHandler::~CompoundHandler()
-{
- debug(2,"CompoundHandler::~CompoundHandler()\n");
- delete m_titleHandler;
- delete m_brief;
- delete m_detailed;
- delete m_programListing;
- delete m_inheritanceGraph;
- delete m_collaborationGraph;
- delete m_includeDependencyGraph;
- delete m_includedByDependencyGraph;
- delete m_templateParamList;
- delete m_members;
-}
-
-void CompoundHandler::startSection(const QXmlAttributes& attrib)
-{
- SectionHandler *sectHandler = new SectionHandler(this);
- sectHandler->startSection(attrib);
- m_sections.append(sectHandler);
-}
-
-void CompoundHandler::startBriefDesc(const QXmlAttributes& attrib)
-{
- DocHandler *docHandler = new DocHandler(this);
- docHandler->startDoc(attrib);
- m_brief = docHandler;
-}
-
-void CompoundHandler::startDetailedDesc(const QXmlAttributes& attrib)
-{
- DocHandler *docHandler = new DocHandler(this);
- docHandler->startDoc(attrib);
- m_detailed = docHandler;
-}
-
-void CompoundHandler::startProgramListing(const QXmlAttributes& attrib)
-{
- ProgramListingHandler *plHandler = new ProgramListingHandler(this);
- plHandler->startProgramListing(attrib);
- m_programListing = plHandler;
-}
-
-void CompoundHandler::startIncludes(const QXmlAttributes& attrib)
-{
- IncludeHandler *inc = new IncludeHandler(this,"includes");
- m_includes.append(inc);
- inc->startInclude(attrib);
-}
-
-void CompoundHandler::startIncludedBy(const QXmlAttributes& attrib)
-{
- IncludeHandler *inc = new IncludeHandler(this,"includedby");
- m_includedBy.append(inc);
- inc->startInclude(attrib);
-}
-
-void CompoundHandler::startCompound(const QXmlAttributes& attrib)
-{
- m_id = attrib.value("id");
- m_kindString = attrib.value("kind");
- m_kind = s_typeMap->map(m_kindString);
- m_protection = attrib.value("prot");
- debug(2,"startCompound(id='%s' type='%s')\n",m_id.data(),m_kindString.data());
-}
-
-void CompoundHandler::endCompound()
-{
- debug(2,"endCompound()\n");
-}
-
-void CompoundHandler::startLocation(const QXmlAttributes& attrib)
-{
- m_defFile = attrib.value("file");
- m_defLine = attrib.value("line").toInt();
- m_defBodyFile = attrib.value("bodyfile");
- m_defBodyStart = attrib.value("bodystart").toInt();
- m_defBodyEnd = attrib.value("bodyend").toInt();
-}
-
-void CompoundHandler::endCompoundName()
-{
- m_name = m_curString.stripWhiteSpace();
- debug(2,"Compound name '%s'\n",m_name.data());
-}
-
-void CompoundHandler::startInnerClass(const QXmlAttributes& attrib)
-{
- m_innerCompounds.append(new QString(attrib.value("refid")));
-}
-
-void CompoundHandler::startInnerNamespace(const QXmlAttributes& attrib)
-{
- m_innerCompounds.append(new QString(attrib.value("refid")));
-}
-
-void CompoundHandler::startInnerFile(const QXmlAttributes& attrib)
-{
- m_innerCompounds.append(new QString(attrib.value("refid")));
-}
-
-void CompoundHandler::startInnerGroup(const QXmlAttributes& attrib)
-{
- m_innerCompounds.append(new QString(attrib.value("refid")));
-}
-
-void CompoundHandler::startInnerPage(const QXmlAttributes& attrib)
-{
- m_innerCompounds.append(new QString(attrib.value("refid")));
-}
-
-void CompoundHandler::startInnerDir(const QXmlAttributes& attrib)
-{
- m_innerCompounds.append(new QString(attrib.value("refid")));
-}
-
-void CompoundHandler::startTemplateParamList(const QXmlAttributes& attrib)
-{
- m_templateParamList = new TemplateParamListHandler(this);
- m_templateParamList->startTemplateParamList(attrib);
-}
-
-void CompoundHandler::startListOfAllMembers(const QXmlAttributes& attrib)
-{
- m_members = new ListOfAllMembersHandler(this);
- m_members->startListOfAllMembers(attrib);
-}
-
-void CompoundHandler::startSuperClass(const QXmlAttributes& attrib)
-{
- IRelatedCompound::Protection prot = IRelatedCompound::Public;
- QString protString = attrib.value("prot");
- if (protString=="protected")
- {
- prot = IRelatedCompound::Protected;
- }
- else if (protString=="private")
- {
- prot = IRelatedCompound::Private;
- }
- IRelatedCompound::Kind kind = IRelatedCompound::Normal;
- QString kindString = attrib.value("virt");
- if (kindString=="virtual") kind = IRelatedCompound::Virtual;
-
- RelatedCompound *sc=new RelatedCompound(
- this,
- attrib.value("refid"),
- prot,
- kind
- );
- debug(2,"super class id='%s' prot='%s' virt='%s'\n",
- attrib.value("refid").data(),
- protString.data(),
- kindString.data());
- m_superClasses.append(sc);
- m_curString = "";
-}
-
-void CompoundHandler::endSuperClass()
-{
- m_superClasses.getLast()->setName(m_curString);
-}
-
-void CompoundHandler::startSubClass(const QXmlAttributes& attrib)
-{
- IRelatedCompound::Protection prot = IRelatedCompound::Public;
- QString protString = attrib.value("prot");
- if (protString=="protected") prot = IRelatedCompound::Protected;
- else if (protString=="private") prot = IRelatedCompound::Private;
-
- IRelatedCompound::Kind kind = IRelatedCompound::Normal;
- QString kindString = attrib.value("virt");
- if (kindString=="virtual") kind = IRelatedCompound::Virtual;
-
- RelatedCompound *sc = new RelatedCompound(
- this,
- attrib.value("refid"),
- prot,
- kind
- );
- debug(2,"sub class id='%s' prot='%s' virt='%s'\n",
- attrib.value("refid").data(),
- protString.data(),
- kindString.data());
- m_subClasses.append(sc);
- m_curString = "";
-}
-
-void CompoundHandler::endSubClass()
-{
- m_subClasses.getLast()->setName(m_curString);
-}
-
-void CompoundHandler::startTitle(const QXmlAttributes& attrib)
-{
- ASSERT(m_titleHandler==0);
- m_titleHandler = new TitleHandler(this);
- m_titleHandler->startTitle(attrib);
-}
-
-bool CompoundHandler::parseXML(const char *compId)
-{
- QFile xmlFile(m_xmlDir+"/"+compId+".xml");
- if (!xmlFile.exists()) return FALSE;
- CompoundErrorHandler errorHandler;
- QXmlInputSource source( xmlFile );
- QXmlSimpleReader reader;
- reader.setContentHandler( this );
- reader.setErrorHandler( &errorHandler );
- reader.parse( source );
- return TRUE;
-}
-
-void CompoundHandler::initialize(MainHandler *mh)
-{
- m_mainHandler = mh;
- QListIterator<SectionHandler> msi(m_sections);
- SectionHandler *sec;
- for (;(sec=msi.current());++msi)
- {
- sec->initialize(this);
- }
- if (m_members)
- {
- m_members->initialize(mh);
- }
-}
-
-void CompoundHandler::insertMember(MemberHandler *mh)
-{
- m_memberDict.insert(mh->id()->latin1(),mh);
- mh->initialize(m_mainHandler);
- QList<MemberHandler> *mhl = m_memberNameDict.find(mh->id()->latin1());
- if (mhl==0)
- {
- mhl = new QList<MemberHandler>;
- m_memberNameDict.insert(mh->name()->latin1(),mhl);
- }
- mhl->append(mh);
-}
-
-ICompound *CompoundHandler::toICompound() const
-{
- switch (m_kind)
- {
- case ICompound::Class: return (IClass *)this;
- case ICompound::Struct: return (IStruct *)this;
- case ICompound::Union: return (IUnion *)this;
- case ICompound::Interface: return (IInterface *)this;
- case ICompound::Protocol: return (IClass *)this;
- case ICompound::Category: return (IClass *)this;
- case ICompound::Exception: return (IException *)this;
- case ICompound::File: return (IFile *)this;
- case ICompound::Namespace: return (INamespace *)this;
- case ICompound::Group: return (IGroup *)this;
- case ICompound::Page: return (IPage *)this;
- case ICompound::Example: return (IPage *)this;
- case ICompound::Dir: return (IDir *)this;
- default: return 0;
- }
- return 0;
-}
-
-void CompoundHandler::release()
-{
- debug(2,"CompoundHandler::release() %d->%d\n",m_refCount,m_refCount-1);
- if (--m_refCount<=0)
- {
- m_mainHandler->unloadCompound(this);
- delete this;
- }
-}
-
-ISectionIterator *CompoundHandler::sections() const
-{
- return new SectionIterator(m_sections);
-}
-
-IMemberIterator *CompoundHandler::memberByName(const char *name) const
-{
- QList<MemberHandler> *ml = m_memberNameDict[name];
- if (ml==0) return 0;
- return new MemberIterator(*ml);
-}
-
-void CompoundHandler::startInheritanceGraph(const QXmlAttributes &attrib)
-{
- m_inheritanceGraph = new GraphHandler(this,"inheritancegraph");
- m_inheritanceGraph->startGraph(attrib);
-}
-
-void CompoundHandler::startCollaborationGraph(const QXmlAttributes &attrib)
-{
- m_collaborationGraph = new GraphHandler(this,"collaborationgraph");
- m_collaborationGraph->startGraph(attrib);
-}
-
-void CompoundHandler::startIncludeDependencyGraph(const QXmlAttributes &attrib)
-{
- m_includeDependencyGraph = new GraphHandler(this,"incdepgraph");
- m_includeDependencyGraph->startGraph(attrib);
-}
-
-void CompoundHandler::startIncludedByDependencyGraph(const QXmlAttributes &attrib)
-{
- m_includedByDependencyGraph = new GraphHandler(this,"invincdepgraph");
- m_includedByDependencyGraph->startGraph(attrib);
-}
-
-IDocRoot *CompoundHandler::briefDescription() const
-{
- return m_brief;
-}
-
-IDocRoot *CompoundHandler::detailedDescription() const
-{
- return m_detailed;
-}
-
-IMember *CompoundHandler::memberById(const char *id) const
-{
- return (IFunction*)m_memberDict[id];
-}
-
-IGraph *CompoundHandler::inheritanceGraph() const
-{
- return m_inheritanceGraph;
-}
-
-IGraph *CompoundHandler::collaborationGraph() const
-{
- return m_collaborationGraph;
-}
-
-IGraph *CompoundHandler::includeDependencyGraph() const
-{
- return m_includeDependencyGraph;
-}
-
-IGraph *CompoundHandler::includedByDependencyGraph() const
-{
- return m_includedByDependencyGraph;
-}
-
-IRelatedCompoundIterator *CompoundHandler::baseCompounds() const
-{
- return new RelatedCompoundIterator(m_superClasses);
-}
-
-IRelatedCompoundIterator *CompoundHandler::derivedCompounds() const
-{
- return new RelatedCompoundIterator(m_subClasses);
-}
-
-ICompoundIterator *CompoundHandler::nestedCompounds() const
-{
- return new CompoundIdIterator(m_mainHandler,m_innerCompounds);
-}
-
-IDocProgramListing *CompoundHandler::source() const
-{
- return m_programListing;
-}
-
-IIncludeIterator *CompoundHandler::includes() const
-{
- return new IncludeIterator(m_includes);
-}
-
-IIncludeIterator *CompoundHandler::includedBy() const
-{
- return new IncludeIterator(m_includedBy);
-}
-
-IParamIterator *CompoundHandler::templateParameters() const
-{
- return m_templateParamList ? m_templateParamList->templateParams() : 0;
-}
-
-const IDocTitle *CompoundHandler::title() const
-{
- return m_titleHandler;
-}
-
-IMemberReferenceIterator *CompoundHandler::members() const
-{
- return m_members ? m_members->members() : 0;
-}
-
-
diff --git a/addon/doxmlparser/src/compoundhandler.h b/addon/doxmlparser/src/compoundhandler.h
deleted file mode 100644
index 6f191dc..0000000
--- a/addon/doxmlparser/src/compoundhandler.h
+++ /dev/null
@@ -1,237 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-#ifndef _COMPOUNDHANDLER_H
-#define _COMPOUNDHANDLER_H
-
-#include <qstring.h>
-#include <qlist.h>
-#include <qxml.h>
-#include <doxmlintf.h>
-
-#include "stringimpl.h"
-#include "basehandler.h"
-#include "baseiterator.h"
-
-class MainHandler;
-class DocHandler;
-class ProgramListingHandler;
-class GraphHandler;
-class MemberHandler;
-class CompoundHandler;
-class SectionHandler;
-class ParamHandler;
-class TemplateParamListHandler;
-class TitleHandler;
-class ListOfAllMembersHandler;
-
-class IncludeHandler : public IInclude, public BaseHandler<IncludeHandler>
-{
- public:
- IncludeHandler(IBaseHandler *parent,const char *endtag);
- virtual ~IncludeHandler();
-
- void startInclude(const QXmlAttributes &attrib);
- void endInclude();
-
- // IInclude
- virtual const IString * name() const
- { return &m_name; }
- virtual const IString * refId() const
- { return &m_refId; }
- virtual bool isLocal() const
- { return m_isLocal; }
-
- private:
- IBaseHandler *m_parent = 0;
- StringImpl m_name; // element's content
- StringImpl m_refId; // refid
- bool m_isLocal = false; // local
-};
-
-class IncludeIterator : public BaseIterator<IIncludeIterator,IInclude,IncludeHandler>
-{
- public:
- IncludeIterator(const QList<IncludeHandler> &list) :
- BaseIterator<IIncludeIterator,IInclude,IncludeHandler>(list) {}
-};
-
-
-class RelatedCompound : public IRelatedCompound
-{
- public:
- RelatedCompound(CompoundHandler *parent,
- const QString &id,
- Protection prot,
- Kind kind
- ) :
- m_parent(parent), m_id(id), m_protection(prot), m_kind(kind) {}
- virtual ~RelatedCompound() {}
- void setName(const QString &str) { m_name = str; }
-
- virtual ICompound *compound() const;
- virtual Protection protection() const { return m_protection; }
- virtual Kind kind() const { return m_kind; }
- virtual const IString *name() const { return &m_name; }
-
- private:
- CompoundHandler *m_parent = 0;
- QString m_id; // refid
- Protection m_protection = Public; // prot
- Kind m_kind = Normal; // virt
- StringImpl m_name; // element's content
-};
-
-class RelatedCompoundIterator : public BaseIterator<IRelatedCompoundIterator,IRelatedCompound,RelatedCompound>
-{
- public:
- RelatedCompoundIterator(const QList<RelatedCompound> &list) :
- BaseIterator<IRelatedCompoundIterator,IRelatedCompound,RelatedCompound>(list) {}
-};
-
-
-class CompoundHandler : public IClass,
- public IStruct,
- public IUnion,
- public IException,
- public IInterface,
- public INamespace,
- public IFile,
- public IGroup,
- public IPage,
- public IDir,
- public BaseHandler<CompoundHandler>
-{
- friend class RelatedCompound;
-
- public:
- virtual void startSection(const QXmlAttributes& attrib);
- virtual void startCompound(const QXmlAttributes& attrib);
- virtual void startSuperClass(const QXmlAttributes& attrib);
- virtual void endSuperClass();
- virtual void startSubClass(const QXmlAttributes& attrib);
- virtual void endSubClass();
- virtual void endCompound();
- virtual void endCompoundName();
- virtual void startBriefDesc(const QXmlAttributes& attrib);
- virtual void startDetailedDesc(const QXmlAttributes& attrib);
- virtual void startLocation(const QXmlAttributes& attrib);
- virtual void startProgramListing(const QXmlAttributes& attrib);
- virtual void startInheritanceGraph(const QXmlAttributes& attrib);
- virtual void startCollaborationGraph(const QXmlAttributes& attrib);
- virtual void startIncludeDependencyGraph(const QXmlAttributes& attrib);
- virtual void startIncludedByDependencyGraph(const QXmlAttributes& attrib);
- virtual void startIncludes(const QXmlAttributes& attrib);
- virtual void startIncludedBy(const QXmlAttributes& attrib);
- virtual void startInnerDir(const QXmlAttributes& attrib);
- virtual void startInnerClass(const QXmlAttributes& attrib);
- virtual void startInnerNamespace(const QXmlAttributes& attrib);
- virtual void startInnerFile(const QXmlAttributes& attrib);
- virtual void startInnerGroup(const QXmlAttributes& attrib);
- virtual void startInnerPage(const QXmlAttributes& attrib);
- virtual void startTitle(const QXmlAttributes& attrib);
- virtual void startTemplateParamList(const QXmlAttributes& attrib);
- virtual void startListOfAllMembers(const QXmlAttributes& attrib);
- virtual void addref() { m_refCount++; }
-
- CompoundHandler(const QString &dirName);
- virtual ~CompoundHandler();
- bool parseXML(const char *compId);
- void initialize(MainHandler *mh);
- void insertMember(MemberHandler *mh);
- ICompound *toICompound() const;
-
- // ICompound implementation
- const IString *name() const { return &m_name; }
- const IString *id() const { return &m_id; }
- CompoundKind kind() const { return m_kind; }
- const IString *kindString() const { return &m_kindString; }
- ISectionIterator *sections() const;
- IDocRoot *briefDescription() const;
- IDocRoot *detailedDescription() const;
- IMember *memberById(const char *id) const;
- IMemberIterator *memberByName(const char *name) const;
- IParamIterator *templateParameters() const;
- void release();
-
- // IClass implementation
- IGraph *inheritanceGraph() const;
- IGraph *collaborationGraph() const;
- IRelatedCompoundIterator *baseCompounds() const;
- IRelatedCompoundIterator *derivedCompounds() const;
- ICompoundIterator *nestedCompounds() const;
- ICompoundIterator *nestedGroup() const;
- const IString *locationFile() const { return &m_defFile; }
- int locationLine() const { return m_defLine; }
- const IString *locationBodyFile() const { return &m_defBodyFile; }
- int locationBodyStartLine() const { return m_defBodyStart; }
- int locationBodyEndLine() const { return m_defBodyEnd; }
- IMemberReferenceIterator *members() const;
-
- // IFile implementation
- IGraph *includeDependencyGraph() const;
- IGraph *includedByDependencyGraph() const;
- IDocProgramListing *source() const;
- IIncludeIterator *includes() const;
- IIncludeIterator *includedBy() const;
-
- // IPage implementation
- const IDocTitle *title() const;
-
- private:
- // XML elements:
- // -------------
- StringImpl m_name; // compoundname
- TitleHandler* m_titleHandler = 0; // title
- QList<RelatedCompound> m_subClasses; // basecompoundref
- QList<RelatedCompound> m_superClasses; // derivedcompoundref
- QList<IncludeHandler> m_includes; // includes
- QList<IncludeHandler> m_includedBy; // includedBy
- GraphHandler* m_includeDependencyGraph = 0;// incdepgraph
- GraphHandler* m_includedByDependencyGraph = 0; // invincdepgraph
- QList<QString> m_innerCompounds; // innerdir/innerfile/innerclass/innernamespace/innergroup
- TemplateParamListHandler* m_templateParamList; // templateparamlist
- QList<SectionHandler> m_sections; // sectiondef
- DocHandler* m_brief = 0; // briefdescription
- DocHandler* m_detailed = 0; // detaileddescription
- GraphHandler* m_inheritanceGraph = 0; // inheritancegraph
- GraphHandler* m_collaborationGraph = 0; // collaborationgraph
- ProgramListingHandler* m_programListing = 0; // programlisting
- // location
- StringImpl m_defFile; // - file
- int m_defLine = 0; // - line
- StringImpl m_defBodyFile; // - bodyfile
- int m_defBodyStart = 0; // - bodystart
- int m_defBodyEnd = 0; // - bodyend
- ListOfAllMembersHandler* m_members = 0; // listofallmember
-
- // XML attributes:
- // ---------------
- StringImpl m_id; // id
- CompoundKind m_kind = Invalid; // kind
- StringImpl m_kindString; // kind as a string
- StringImpl m_protection; // prot
-
- // local variables
- QString m_xmlDir; // directory where the info is found
- int m_refCount = 0; // object reference counter
- QDict<MemberHandler> m_memberDict; // id->member lookup
- QDict<QList<MemberHandler> > m_memberNameDict; // name->memberlist lookup
- MainHandler* m_mainHandler = 0; // parent object
-};
-
-void compoundhandler_init();
-void compoundhandler_exit();
-
-#endif
diff --git a/addon/doxmlparser/src/debug.cpp b/addon/doxmlparser/src/debug.cpp
deleted file mode 100644
index a8be32c..0000000
--- a/addon/doxmlparser/src/debug.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-
-#include "debug.h"
-
-static int s_debugLevel = 0;
-
-void debug(int level,const char *msg,...)
-{
- if (level<=s_debugLevel)
- {
- va_list args;
- va_start(args, msg);
- vfprintf(stderr, msg, args);
- va_end(args);
- }
-}
-
-void setDebugLevel(int level)
-{
- s_debugLevel = level;
-}
-
diff --git a/addon/doxmlparser/src/debug.h b/addon/doxmlparser/src/debug.h
deleted file mode 100644
index c77f7fe..0000000
--- a/addon/doxmlparser/src/debug.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef _DEBUG_H
-#define _DEBUG_H
-
-void debug(int level,const char *msg,...);
-void setDebugLevel(int level);
-
-#endif
diff --git a/addon/doxmlparser/src/dochandler.cpp b/addon/doxmlparser/src/dochandler.cpp
deleted file mode 100644
index ea1abf5..0000000
--- a/addon/doxmlparser/src/dochandler.cpp
+++ /dev/null
@@ -1,2240 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-
-#include <qmap.h>
-
-#include "dochandler.h"
-#include "debug.h"
-#include "linkedtexthandler.h"
-
-
-//----------------------------------------------------------------------
-
-class TypeNameMapper
-{
- public:
- TypeNameMapper()
- {
- m_map.insert("see", SimpleSectHandler::See);
- m_map.insert("return", SimpleSectHandler::Return);
- m_map.insert("author", SimpleSectHandler::Author);
- m_map.insert("version", SimpleSectHandler::Version);
- m_map.insert("since", SimpleSectHandler::Since);
- m_map.insert("date", SimpleSectHandler::Date);
- m_map.insert("bug", SimpleSectHandler::Bug);
- m_map.insert("note", SimpleSectHandler::Note);
- m_map.insert("warning", SimpleSectHandler::Warning);
- m_map.insert("par", SimpleSectHandler::Par);
- m_map.insert("deprecated",SimpleSectHandler::Deprecated);
- m_map.insert("pre", SimpleSectHandler::Pre);
- m_map.insert("post", SimpleSectHandler::Post);
- m_map.insert("invariant", SimpleSectHandler::Invar);
- m_map.insert("remark", SimpleSectHandler::Remark);
- m_map.insert("attention", SimpleSectHandler::Attention);
- m_map.insert("todo", SimpleSectHandler::Todo);
- m_map.insert("test", SimpleSectHandler::Test);
- m_map.insert("rcs", SimpleSectHandler::RCS);
- m_map.insert("enumvalues",SimpleSectHandler::EnumValues);
- m_map.insert("examples", SimpleSectHandler::Examples);
- }
- SimpleSectHandler::Types stringToType(const QString &typeStr)
- {
- return m_map[typeStr];
- }
- private:
- QMap<QString,SimpleSectHandler::Types> m_map;
-};
-
-class HighlightMapper
-{
- public:
- HighlightMapper()
- {
- m_map.insert("comment", HighlightHandler::Comment);
- m_map.insert("keyword", HighlightHandler::Keyword);
- m_map.insert("keywordtype", HighlightHandler::KeywordType);
- m_map.insert("keywordflow", HighlightHandler::KeywordFlow);
- m_map.insert("charliteral", HighlightHandler::CharLiteral);
- m_map.insert("stringliteral", HighlightHandler::StringLiteral);
- m_map.insert("preprocessor", HighlightHandler::Preprocessor);
- }
- HighlightHandler::HighlightKind stringToKind(const QString &kindStr)
- {
- return m_map[kindStr];
- }
- private:
- QMap<QString,HighlightHandler::HighlightKind> m_map;
-};
-
-static TypeNameMapper *s_typeMapper;
-static HighlightMapper *s_highlightMapper;
-
-void dochandler_init()
-{
- s_typeMapper = new TypeNameMapper;
- s_highlightMapper = new HighlightMapper;
-}
-
-void dochandler_exit()
-{
- delete s_typeMapper;
- delete s_highlightMapper;
-}
-
-//----------------------------------------------------------------------
-// MarkupHandler
-//----------------------------------------------------------------------
-
-MarkupHandler::MarkupHandler(QList<DocImpl> &children,QString &curString)
- : m_children(children), m_curString(curString),
- m_curMarkup(IDocMarkup::Normal), m_headingLevel(0)
-{
- addStartHandler("bold",this,&MarkupHandler::startBold);
- addEndHandler("bold",this,&MarkupHandler::endBold);
-
- addStartHandler("emphasis",this,&MarkupHandler::startEmphasis);
- addEndHandler("emphasis",this,&MarkupHandler::endEmphasis);
-
- addStartHandler("computeroutput",this,&MarkupHandler::startComputerOutput);
- addEndHandler("computeroutput",this,&MarkupHandler::endComputerOutput);
-
- addStartHandler("center",this,&MarkupHandler::startCenter);
- addEndHandler("center",this,&MarkupHandler::endCenter);
-
- addStartHandler("small",this,&MarkupHandler::startSmallFont);
- addEndHandler("small",this,&MarkupHandler::endSmallFont);
-
- addStartHandler("subscript",this,&MarkupHandler::startSubscript);
- addEndHandler("subscript",this,&MarkupHandler::endSubscript);
-
- addStartHandler("superscript",this,&MarkupHandler::startSuperscript);
- addEndHandler("superscript",this,&MarkupHandler::endSuperscript);
-
- addStartHandler("preformatted",this,&MarkupHandler::startPreformatted);
- addEndHandler("preformatted",this,&MarkupHandler::endPreformatted);
-
- addStartHandler("heading1",this,&MarkupHandler::startHeading1);
- addEndHandler("heading1",this,&MarkupHandler::endHeading1);
-
- addStartHandler("heading2",this,&MarkupHandler::startHeading2);
- addEndHandler("heading2",this,&MarkupHandler::endHeading2);
-
- addStartHandler("heading3",this,&MarkupHandler::startHeading3);
- addEndHandler("heading3",this,&MarkupHandler::endHeading3);
-
- addStartHandler("heading4",this,&MarkupHandler::startHeading4);
- addEndHandler("heading4",this,&MarkupHandler::endHeading4);
-
- addStartHandler("heading5",this,&MarkupHandler::startHeading5);
- addEndHandler("heading5",this,&MarkupHandler::endHeading5);
-
- addStartHandler("heading6",this,&MarkupHandler::startHeading6);
- addEndHandler("heading6",this,&MarkupHandler::endHeading6);
-}
-
-MarkupHandler::~MarkupHandler()
-{
-}
-
-void MarkupHandler::addTextNode()
-{
- if (!m_curString.isEmpty())
- {
- m_children.append(new TextNode(m_curString,m_curMarkup,m_headingLevel));
- debug(2,"addTextNode() text=%s markup=%x\n",m_curString.data(),m_curMarkup);
- m_curString="";
- }
-}
-
-void MarkupHandler::startBold(const QXmlAttributes & /*attrib*/)
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Bold,TRUE));
- m_curMarkup |= IDocMarkup::Bold;
-}
-
-void MarkupHandler::endBold()
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Bold,FALSE));
- m_curMarkup &= ~IDocMarkup::Bold;
-}
-
-void MarkupHandler::startEmphasis(const QXmlAttributes & /*attrib*/)
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Emphasis,TRUE));
- m_curMarkup |= IDocMarkup::Emphasis;
-}
-
-void MarkupHandler::endEmphasis()
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Emphasis,FALSE));
- m_curMarkup &= ~IDocMarkup::Emphasis;
-}
-
-void MarkupHandler::startComputerOutput(const QXmlAttributes & /*attrib*/)
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::ComputerOutput,TRUE));
- m_curMarkup |= IDocMarkup::ComputerOutput;
-}
-
-void MarkupHandler::endComputerOutput()
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::ComputerOutput,FALSE));
- m_curMarkup &= ~IDocMarkup::ComputerOutput;
-}
-
-void MarkupHandler::startCenter(const QXmlAttributes & /*attrib*/)
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Center,TRUE));
- m_curMarkup |= IDocMarkup::Center;
-}
-
-void MarkupHandler::endCenter()
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Center,FALSE));
- m_curMarkup &= ~IDocMarkup::Center;
-}
-
-void MarkupHandler::startSmallFont(const QXmlAttributes & /*attrib*/)
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::SmallFont,TRUE));
- m_curMarkup |= IDocMarkup::SmallFont;
-}
-
-void MarkupHandler::endSmallFont()
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::SmallFont,FALSE));
- m_curMarkup &= ~IDocMarkup::SmallFont;
-}
-
-void MarkupHandler::startSubscript(const QXmlAttributes & /*attrib*/)
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Subscript,TRUE));
- m_curMarkup |= IDocMarkup::Subscript;
-}
-
-void MarkupHandler::endSubscript()
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Subscript,FALSE));
- m_curMarkup &= ~IDocMarkup::Subscript;
-}
-
-void MarkupHandler::startSuperscript(const QXmlAttributes & /*attrib*/)
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Superscript,TRUE));
- m_curMarkup |= IDocMarkup::Superscript;
-}
-
-void MarkupHandler::endSuperscript()
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Superscript,FALSE));
- m_curMarkup &= ~IDocMarkup::Superscript;
-}
-
-void MarkupHandler::startPreformatted(const QXmlAttributes & /*attrib*/)
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Preformatted,TRUE));
- m_curMarkup |= IDocMarkup::Preformatted;
-}
-
-void MarkupHandler::endPreformatted()
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Preformatted,FALSE));
- m_curMarkup &= ~IDocMarkup::Preformatted;
-}
-
-void MarkupHandler::startHeading1(const QXmlAttributes & /*attrib*/)
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,1));
- m_curMarkup |= IDocMarkup::Heading;
- m_headingLevel=1;
-}
-
-void MarkupHandler::endHeading1()
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,1));
- m_curMarkup &= ~IDocMarkup::Heading;
- m_headingLevel=0;
-}
-
-void MarkupHandler::startHeading2(const QXmlAttributes & /*attrib*/)
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,2));
- m_curMarkup |= IDocMarkup::Heading;
- m_headingLevel=2;
-}
-
-void MarkupHandler::endHeading2()
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,2));
- m_curMarkup &= ~IDocMarkup::Heading;
- m_headingLevel=0;
-}
-
-void MarkupHandler::startHeading3(const QXmlAttributes & /*attrib*/)
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,3));
- m_curMarkup |= IDocMarkup::Heading;
- m_headingLevel=3;
-}
-
-void MarkupHandler::endHeading3()
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,3));
- m_curMarkup &= ~IDocMarkup::Heading;
- m_headingLevel=0;
-}
-
-void MarkupHandler::startHeading4(const QXmlAttributes & /*attrib*/)
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,4));
- m_curMarkup |= IDocMarkup::Heading;
- m_headingLevel=4;
-}
-
-void MarkupHandler::endHeading4()
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,4));
- m_curMarkup &= ~IDocMarkup::Heading;
- m_headingLevel=0;
-}
-
-void MarkupHandler::startHeading5(const QXmlAttributes & /*attrib*/)
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,5));
- m_curMarkup |= IDocMarkup::Heading;
- m_headingLevel=5;
-}
-
-void MarkupHandler::endHeading5()
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,5));
- m_curMarkup &= ~IDocMarkup::Heading;
- m_headingLevel=0;
-}
-
-void MarkupHandler::startHeading6(const QXmlAttributes & /*attrib*/)
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Heading,TRUE,6));
- m_curMarkup |= IDocMarkup::Heading;
- m_headingLevel=6;
-}
-
-void MarkupHandler::endHeading6()
-{
- addTextNode();
- m_children.append(new MarkupModifierNode(IDocMarkup::Heading,FALSE,6));
- m_curMarkup &= ~IDocMarkup::Heading;
- m_headingLevel=0;
-}
-
-
-//----------------------------------------------------------------------
-// ListItemHandler
-//----------------------------------------------------------------------
-
-ListItemHandler::ListItemHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- m_children.setAutoDelete(TRUE);
-
- addEndHandler("listitem",this,&ListItemHandler::endListItem);
-
- addStartHandler("para",this,&ListItemHandler::startParagraph);
-}
-
-ListItemHandler::~ListItemHandler()
-{
-}
-
-void ListItemHandler::startListItem(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
- debug(2,"start list item handler\n");
-}
-
-void ListItemHandler::endListItem()
-{
- debug(2,"end list item handler\n");
- m_parent->setDelegate(0);
-}
-
-void ListItemHandler::startParagraph(const QXmlAttributes& attrib)
-{
- ParagraphHandler *parHandler = new ParagraphHandler(this);
- parHandler->startParagraph(attrib);
- m_children.append(parHandler);
-}
-
-IDocIterator *ListItemHandler::contents() const
-{
- return new ListItemIterator(*this);
-}
-
-//----------------------------------------------------------------------
-// OrderedListHandler
-//----------------------------------------------------------------------
-
-OrderedListHandler::OrderedListHandler(IBaseHandler *parent) : m_parent(parent)
-{
- m_children.setAutoDelete(TRUE);
- addEndHandler("orderedlist",this,&OrderedListHandler::endOrderedList);
- addStartHandler("listitem",this,&OrderedListHandler::startOrderedListItem);
-}
-
-OrderedListHandler::~OrderedListHandler()
-{
-}
-
-void OrderedListHandler::startOrderedList(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
-}
-
-void OrderedListHandler::endOrderedList()
-{
- m_parent->setDelegate(0);
-}
-
-void OrderedListHandler::startOrderedListItem(const QXmlAttributes& attrib)
-{
- ListItemHandler *liHandler = new ListItemHandler(this);
- liHandler->startListItem(attrib);
- m_children.append(liHandler);
-}
-
-IDocIterator *OrderedListHandler::elements() const
-{
- return new OrderedListIterator(*this);
-}
-
-//----------------------------------------------------------------------
-// ItemizedListHandler
-//----------------------------------------------------------------------
-
-ItemizedListHandler::ItemizedListHandler(IBaseHandler *parent) : m_parent(parent)
-{
- m_children.setAutoDelete(TRUE);
- addEndHandler("itemizedlist",this,&ItemizedListHandler::endItemizedList);
- addStartHandler("listitem",this,&ItemizedListHandler::startItemizedListItem);
-}
-
-ItemizedListHandler::~ItemizedListHandler()
-{
-}
-
-void ItemizedListHandler::startItemizedList(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
-}
-
-void ItemizedListHandler::endItemizedList()
-{
- m_parent->setDelegate(0);
-}
-
-void ItemizedListHandler::startItemizedListItem(const QXmlAttributes& attrib)
-{
- ListItemHandler *liHandler = new ListItemHandler(this);
- liHandler->startListItem(attrib);
- m_children.append(liHandler);
-}
-
-IDocIterator *ItemizedListHandler::elements() const
-{
- return new ItemizedListIterator(*this);
-}
-
-//----------------------------------------------------------------------
-// TocListHandler
-//----------------------------------------------------------------------
-
-TocListHandler::TocListHandler(IBaseHandler *parent) : m_parent(parent)
-{
- m_children.setAutoDelete(TRUE);
- addEndHandler("toclist",this,&TocListHandler::endTocList);
- addStartHandler("tocitem",this,&TocListHandler::startTocItem);
-}
-
-TocListHandler::~TocListHandler()
-{
-}
-
-void TocListHandler::startTocList(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
-}
-
-void TocListHandler::endTocList()
-{
- m_parent->setDelegate(0);
-}
-
-void TocListHandler::startTocItem(const QXmlAttributes& attrib)
-{
- TocItemHandler *tiHandler = new TocItemHandler(this);
- tiHandler->startTocItem(attrib);
- m_children.append(tiHandler);
-}
-
-IDocIterator *TocListHandler::elements() const
-{
- return new TocListIterator(*this);
-}
-
-//----------------------------------------------------------------------
-// TocItemHandler
-//----------------------------------------------------------------------
-
-TocItemHandler::TocItemHandler(IBaseHandler *parent) : m_parent(parent)
-{
- addEndHandler("tocitem",this,&TocItemHandler::endTocItem);
-}
-
-TocItemHandler::~TocItemHandler()
-{
-}
-
-void TocItemHandler::startTocItem(const QXmlAttributes& attrib)
-{
- m_parent->setDelegate(this);
- m_id = attrib.value("id");
- m_curString="";
-}
-
-void TocItemHandler::endTocItem()
-{
- m_title = m_curString;
- m_parent->setDelegate(0);
-}
-
-//----------------------------------------------------------------------
-// ParameterHandler
-//----------------------------------------------------------------------
-
-ParameterHandler::ParameterHandler(IBaseHandler *parent) :
- m_parent(parent)
-{
- addEndHandler("parametername",this,&ParameterHandler::endParameterName);
-}
-
-ParameterHandler::~ParameterHandler()
-{
-}
-
-void ParameterHandler::startParameterName(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
-}
-
-void ParameterHandler::endParameterName()
-{
- m_name = m_curString;
- debug(2,"parameter %s\n",m_name.data());
- m_curString="";
- m_parent->setDelegate(0);
-}
-
-//----------------------------------------------------------------------
-// ParameterListHandler
-//----------------------------------------------------------------------
-
-ParameterItemHandler::ParameterItemHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- addEndHandler("parameteritem",this,&ParameterItemHandler::endParameterItem);
- addStartHandler("parameternamelist");
- addEndHandler("parameternamelist");
- addStartHandler("parametername",this,&ParameterItemHandler::startParameterName);
- addStartHandler("parameterdescription");
- addEndHandler("parameterdescription");
- addStartHandler("para",this,&ParameterItemHandler::startParagraph);
- m_parameters.setAutoDelete(TRUE);
- m_description = 0;
-}
-
-ParameterItemHandler::~ParameterItemHandler()
-{
- delete m_description;
-}
-
-void ParameterItemHandler::startParameterItem(const QXmlAttributes&)
-{
- m_parent->setDelegate(this);
-}
-
-void ParameterItemHandler::endParameterItem()
-{
- m_parent->setDelegate(0);
-}
-
-void ParameterItemHandler::startParameterName(const QXmlAttributes& attrib)
-{
- ParameterHandler *param = new ParameterHandler(this);
- m_parameters.append(param);
- param->startParameterName(attrib);
-}
-
-void ParameterItemHandler::startParagraph(const QXmlAttributes& attrib)
-{
- m_description = new ParagraphHandler(this);
- m_description->startParagraph(attrib);
-}
-
-IDocIterator *ParameterItemHandler::paramNames() const
-{
- return new ParameterItemIterator(*this);
-}
-
-//----------------------------------------------------------------------
-// ParameterListHandler
-//----------------------------------------------------------------------
-
-ParameterListHandler::ParameterListHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- addEndHandler("parameterlist",this,&ParameterListHandler::endParameterList);
- addStartHandler("parameteritem",this,&ParameterListHandler::startParameterItem);
- m_paramItems.setAutoDelete(TRUE);
-}
-
-ParameterListHandler::~ParameterListHandler()
-{
-}
-
-void ParameterListHandler::startParameterList(const QXmlAttributes& attrib)
-{
- QString kind = attrib.value("kind");
- if (kind=="retval") m_type=RetVal;
- else if (kind=="exception") m_type=Exception;
- else if (kind=="param") m_type=Param;
- else
- {
- debug(1,"Error: invalid parameterlist type: %s\n",kind.data());
- }
- debug(2,"parameterlist kind=%s\n",kind.data());
- m_parent->setDelegate(this);
-}
-
-void ParameterListHandler::endParameterList()
-{
- m_parent->setDelegate(0);
-}
-
-void ParameterListHandler::startParameterItem(const QXmlAttributes& attrib)
-{
- ParameterItemHandler *paramItem = new ParameterItemHandler(this);
- m_paramItems.append(paramItem);
- paramItem->startParameterItem(attrib);
-}
-
-IDocIterator *ParameterListHandler::params() const
-{
- return new ParameterListIterator(*this);
-}
-
-//----------------------------------------------------------------------
-// LinkHandler
-//----------------------------------------------------------------------
-
-LinkHandler::LinkHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- addEndHandler("link",this,&LinkHandler::endLink);
-}
-
-LinkHandler::~LinkHandler()
-{
-}
-
-void LinkHandler::startLink(const QXmlAttributes& attrib)
-{
- m_parent->setDelegate(this);
- debug(2,"Start link\n");
- m_ref = attrib.value("linkend");
- m_curString="";
-}
-
-void LinkHandler::endLink()
-{
- m_text = m_curString;
- m_curString="";
- m_parent->setDelegate(0);
- debug(2,"End link\n");
-}
-
-//----------------------------------------------------------------------
-// EMailHandler
-//----------------------------------------------------------------------
-
-EMailHandler::EMailHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- addEndHandler("email",this,&EMailHandler::endEMail);
-}
-
-EMailHandler::~EMailHandler()
-{
-}
-
-void EMailHandler::startEMail(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
- debug(2,"Start email\n");
- m_curString="";
-}
-
-void EMailHandler::endEMail()
-{
- m_address = m_curString;
- m_curString="";
- m_parent->setDelegate(0);
- debug(2,"End email\n");
-}
-
-//----------------------------------------------------------------------
-// ULinkHandler
-//----------------------------------------------------------------------
-
-ULinkHandler::ULinkHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- addEndHandler("ulink",this,&ULinkHandler::endULink);
-}
-
-ULinkHandler::~ULinkHandler()
-{
-}
-
-void ULinkHandler::startULink(const QXmlAttributes& attrib)
-{
- m_parent->setDelegate(this);
- debug(2,"Start ulink\n");
- m_url = attrib.value("url");
- m_curString="";
-}
-
-void ULinkHandler::endULink()
-{
- m_text = m_curString;
- m_curString="";
- m_parent->setDelegate(0);
- debug(2,"End ulink\n");
-}
-
-//----------------------------------------------------------------------
-// LineBreakHandler
-//----------------------------------------------------------------------
-
-LineBreakHandler::LineBreakHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- addEndHandler("linebreak",this,&LineBreakHandler::endLineBreak);
-}
-
-LineBreakHandler::~LineBreakHandler()
-{
-}
-
-void LineBreakHandler::startLineBreak(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
- debug(2,"Start linebreak\n");
-}
-
-void LineBreakHandler::endLineBreak()
-{
- m_parent->setDelegate(0);
- debug(2,"End linebreak\n");
-}
-
-//----------------------------------------------------------------------
-// HRulerHandler
-//----------------------------------------------------------------------
-
-HRulerHandler::HRulerHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- addEndHandler("hruler",this,&HRulerHandler::endHRuler);
-}
-
-HRulerHandler::~HRulerHandler()
-{
-}
-
-void HRulerHandler::startHRuler(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
- debug(2,"Start hruler\n");
-}
-
-void HRulerHandler::endHRuler()
-{
- m_parent->setDelegate(0);
- debug(2,"End hruler\n");
-}
-
-//----------------------------------------------------------------------
-// RefHandler
-//----------------------------------------------------------------------
-
-RefHandler::RefHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- addEndHandler("ref",this,&RefHandler::endRef);
-}
-
-RefHandler::~RefHandler()
-{
-}
-
-void RefHandler::startRef(const QXmlAttributes& attrib)
-{
- m_parent->setDelegate(this);
- m_refId = attrib.value("refid");
- m_extId = attrib.value("external");
- ASSERT(attrib.value("kindref")=="compound" ||
- attrib.value("kindref")=="member");
- m_targetKind = attrib.value("kindref")=="compound" ? Compound : Member;
- debug(2,"Start ref refId=%s\n",m_refId.data());
- m_curString="";
-}
-
-void RefHandler::endRef()
-{
- m_linkText = m_curString;
- m_parent->setDelegate(0);
- debug(2,"End ref: text='%s'\n",m_linkText.data());
-}
-
-
-//----------------------------------------------------------------------
-// TitleHandler
-//----------------------------------------------------------------------
-
-TitleHandler::TitleHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- m_children.setAutoDelete(TRUE);
- m_markupHandler = new MarkupHandler(m_children,m_curString);
- setFallBackHandler(m_markupHandler);
- addStartHandler("ref",this,&TitleHandler::startRef);
- addEndHandler("title",this,&TitleHandler::endTitle);
-}
-
-TitleHandler::~TitleHandler()
-{
- delete m_markupHandler;
-}
-
-void TitleHandler::startTitle(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
- debug(2,"Start title\n");
- m_curString="";
-}
-
-void TitleHandler::endTitle()
-{
- addTextNode();
- m_parent->setDelegate(0);
- debug(2,"End title\n");
-}
-
-void TitleHandler::addTextNode()
-{
- if (!m_curString.isEmpty())
- {
- m_children.append(
- new TextNode(
- m_curString,
- m_markupHandler->markup(),
- m_markupHandler->headingLevel()
- )
- );
- debug(2,"addTextNode() text=\"%s\" markup=%x headingLevel=%d\n",
- m_curString.data(),m_markupHandler->markup(),m_markupHandler->headingLevel());
- m_curString="";
- }
-}
-
-void TitleHandler::startRef(const QXmlAttributes& attrib)
-{
- RefHandler *ref = new RefHandler(this);
- ref->startRef(attrib);
- m_children.append(ref);
-}
-
-IDocIterator *TitleHandler::title() const
-{
- return new TitleIterator(*this);
-}
-
-//----------------------------------------------------------------------
-// SimpleSectHandler
-//----------------------------------------------------------------------
-
-SimpleSectHandler::SimpleSectHandler(IBaseHandler *parent)
- : m_parent(parent), m_paragraph(0), m_title(0)
-{
- addStartHandler("title",this,&SimpleSectHandler::startTitle);
- addStartHandler("para",this,&SimpleSectHandler::startParagraph);
- addEndHandler("simplesect",this,&SimpleSectHandler::endSimpleSect);
-}
-
-SimpleSectHandler::~SimpleSectHandler()
-{
-}
-
-void SimpleSectHandler::startSimpleSect(const QXmlAttributes& attrib)
-{
- m_typeString = attrib.value("kind");
- m_type = s_typeMapper->stringToType(m_typeString);
- debug(2,"start simple section %s\n",m_typeString.data());
- m_parent->setDelegate(this);
-}
-
-void SimpleSectHandler::endSimpleSect()
-{
- debug(2,"end simple section\n");
- m_parent->setDelegate(0);
-}
-
-void SimpleSectHandler::startTitle(const QXmlAttributes& attrib)
-{
- ASSERT(m_title==0);
- m_title = new TitleHandler(this);
- m_title->startTitle(attrib);
-}
-
-void SimpleSectHandler::startParagraph(const QXmlAttributes& attrib)
-{
- ASSERT(m_paragraph==0);
- m_paragraph = new ParagraphHandler(this);
- m_paragraph->startParagraph(attrib);
-}
-
-//----------------------------------------------------------------------
-// VariableListEntryHandler
-//----------------------------------------------------------------------
-
-VariableListEntryHandler::VariableListEntryHandler(IBaseHandler *parent)
- : m_parent(parent), m_description(0), m_linkedTextHandler(0)
-{
- addStartHandler("term",this,&VariableListEntryHandler::startTerm);
- addEndHandler("term",this,&VariableListEntryHandler::endTerm);
- addStartHandler("para",this,&VariableListEntryHandler::startParagraph);
- addEndHandler("varlistentry",this,&VariableListEntryHandler::endVarListEntry);
- addEndHandler("listitem",this,&VariableListEntryHandler::endListItem);
-}
-
-VariableListEntryHandler::~VariableListEntryHandler()
-{
- delete m_description;
-}
-
-void VariableListEntryHandler::startVarListEntry(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
- debug(2,"start varlistentry\n");
-}
-
-void VariableListEntryHandler::endVarListEntry()
-{
- m_parent->setDelegate(0);
- debug(2,"end varlistentry\n");
-}
-
-void VariableListEntryHandler::startListItem(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
- debug(2,"start listitem\n");
-}
-
-void VariableListEntryHandler::endListItem()
-{
- m_parent->setDelegate(0);
- debug(2,"end listitem\n");
-}
-
-void VariableListEntryHandler::startTerm(const QXmlAttributes& /*attrib*/)
-{
- m_curString="";
- m_linkedTextHandler = new LinkedTextHandler(this,m_term);
- m_linkedTextHandler->start("term");
-}
-
-void VariableListEntryHandler::endTerm()
-{
- delete m_linkedTextHandler;
-}
-
-void VariableListEntryHandler::startParagraph(const QXmlAttributes& attrib)
-{
- ASSERT(m_description==0);
- m_description = new ParagraphHandler(this);
- m_description->startParagraph(attrib);
-}
-
-ILinkedTextIterator *VariableListEntryHandler::term() const
-{
- return new LinkedTextIterator(m_term);
-}
-
-
-//----------------------------------------------------------------------
-// VariableListHandler
-//----------------------------------------------------------------------
-
-VariableListHandler::VariableListHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- m_entries.setAutoDelete(TRUE);
- addStartHandler("varlistentry",this,&VariableListHandler::startVarListEntry);
- addStartHandler("listitem",this,&VariableListHandler::startListItem);
- addEndHandler("variablelist",this,&VariableListHandler::endVariableList);
-}
-
-VariableListHandler::~VariableListHandler()
-{
-}
-
-void VariableListHandler::startVariableList(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
- debug(2,"start variablelist\n");
-}
-
-void VariableListHandler::endVariableList()
-{
- debug(2,"end variablelist\n");
- m_parent->setDelegate(0);
-}
-
-void VariableListHandler::startVarListEntry(const QXmlAttributes& attrib)
-{
- VariableListEntryHandler *vle = new VariableListEntryHandler(this);
- vle->startVarListEntry(attrib);
- m_curEntry = vle;
- m_entries.append(vle);
-}
-
-void VariableListHandler::startListItem(const QXmlAttributes& attrib)
-{
- ASSERT(m_curEntry!=0);
- m_curEntry->startListItem(attrib);
-}
-
-IDocIterator *VariableListHandler::entries() const
-{
- return new VariableListIterator(*this);
-}
-
-//----------------------------------------------------------------------
-// HighlightHandler
-//----------------------------------------------------------------------
-
-HighlightHandler::HighlightHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- m_children.setAutoDelete(TRUE);
- addEndHandler("highlight",this,&HighlightHandler::endHighlight);
- addStartHandler("ref",this,&HighlightHandler::startRef);
- addStartHandler("sp",this,&HighlightHandler::startSpace);
- m_hl = IDocHighlight::Invalid;
-}
-
-HighlightHandler::~HighlightHandler()
-{
-}
-
-void HighlightHandler::startHighlight(const QXmlAttributes& attrib)
-{
- m_hlString = attrib.value("class");
- m_hl = s_highlightMapper->stringToKind(m_hlString);
- m_curString="";
- m_parent->setDelegate(this);
- debug(2,"start highlight\n");
-}
-
-void HighlightHandler::endHighlight()
-{
- addTextNode();
- debug(2,"end highlight class='%s'\n",m_hlString.data());
- m_parent->setDelegate(0);
-}
-
-void HighlightHandler::startRef(const QXmlAttributes& attrib)
-{
- addTextNode();
- RefHandler *rh = new RefHandler(this);
- m_children.append(rh);
- rh->startRef(attrib);
-}
-
-void HighlightHandler::startSpace(const QXmlAttributes&)
-{
- m_curString=" ";
- addTextNode();
-}
-
-void HighlightHandler::addTextNode()
-{
- if (!m_curString.isEmpty())
- {
- m_children.append(new TextNode(m_curString,IDocMarkup::Normal,0));
- debug(2,"addTextNode() text=\"%s\"\n",
- m_curString.data());
- m_curString="";
- }
-}
-
-IDocIterator *HighlightHandler::codeElements() const
-{
- return new HighlightIterator(*this);
-}
-
-//----------------------------------------------------------------------
-// CodeLineHandler
-//----------------------------------------------------------------------
-
-CodeLineHandler::CodeLineHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- m_children.setAutoDelete(TRUE);
- addEndHandler("codeline",this,&CodeLineHandler::endCodeLine);
- addEndHandler("linenumber",this,&CodeLineHandler::endLineNumber);
- addStartHandler("highlight",this,&CodeLineHandler::startHighlight);
- addStartHandler("ref",this,&CodeLineHandler::startRef);
- m_lineNumber = 0;
-}
-
-CodeLineHandler::~CodeLineHandler()
-{
-}
-
-void CodeLineHandler::startCodeLine(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
- debug(2,"start codeline\n");
-}
-
-void CodeLineHandler::endCodeLine()
-{
- addTextNode();
- debug(2,"end codeline\n");
- m_parent->setDelegate(0);
-}
-
-void CodeLineHandler::startLineNumber(const QXmlAttributes& attrib)
-{
- m_parent->setDelegate(this);
- debug(2,"start linenumber\n");
- m_lineNumber = attrib.value("line").toInt();
- m_refId = attrib.value("refid");
-}
-
-void CodeLineHandler::endLineNumber()
-{
- m_parent->setDelegate(0);
-}
-
-void CodeLineHandler::startHighlight(const QXmlAttributes& attrib)
-{
- addTextNode();
- HighlightHandler *hlh = new HighlightHandler(this);
- m_children.append(hlh);
- hlh->startHighlight(attrib);
-}
-
-void CodeLineHandler::startRef(const QXmlAttributes& attrib)
-{
- addTextNode();
- RefHandler *rh = new RefHandler(this);
- m_children.append(rh);
- rh->startRef(attrib);
-}
-
-void CodeLineHandler::addTextNode()
-{
- if (!m_curString.isEmpty())
- {
- m_children.append(new TextNode(m_curString,IDocMarkup::Normal,0));
- debug(2,"addTextNode() text=\"%s\"\n",
- m_curString.data());
- m_curString="";
- }
-}
-
-IDocIterator *CodeLineHandler::codeElements() const
-{
- return new CodeLineIterator(*this);
-}
-
-
-//----------------------------------------------------------------------
-// ProgramListingHandler
-//----------------------------------------------------------------------
-
-ProgramListingHandler::ProgramListingHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- m_children.setAutoDelete(TRUE);
- m_hasLineNumber=FALSE;
- addEndHandler("programlisting",this,&ProgramListingHandler::endProgramListing);
-
- addStartHandler("linenumber",this,&ProgramListingHandler::startLineNumber);
- addStartHandler("codeline",this,&ProgramListingHandler::startCodeLine);
-}
-
-ProgramListingHandler::~ProgramListingHandler()
-{
-}
-
-void ProgramListingHandler::startProgramListing(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
- debug(2,"start programlisting\n");
-}
-
-void ProgramListingHandler::endProgramListing()
-{
- debug(2,"end programlisting\n");
- m_parent->setDelegate(0);
-}
-
-void ProgramListingHandler::startLineNumber(const QXmlAttributes& attrib)
-{
- CodeLineHandler *clh = new CodeLineHandler(this);
- m_children.append(clh);
- m_hasLineNumber=TRUE;
- clh->startLineNumber(attrib);
-}
-
-void ProgramListingHandler::startCodeLine(const QXmlAttributes& attrib)
-{
- CodeLineHandler *clh = 0;
- if (!m_hasLineNumber)
- {
- clh = new CodeLineHandler(this);
- m_children.append(clh);
- }
- else
- {
- clh = m_children.getLast();
- }
- ASSERT(clh!=0);
- clh->startCodeLine(attrib);
- m_hasLineNumber=FALSE;
-}
-
-IDocIterator *ProgramListingHandler::codeLines() const
-{
- return new ProgramListingIterator(*this);
-}
-
-
-
-//----------------------------------------------------------------------
-// FormulaHandler
-//----------------------------------------------------------------------
-
-FormulaHandler::FormulaHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- addEndHandler("formula",this,&FormulaHandler::endFormula);
-}
-
-FormulaHandler::~FormulaHandler()
-{
-}
-
-void FormulaHandler::startFormula(const QXmlAttributes& attrib)
-{
- m_id = attrib.value("id");
- m_curString="";
- m_parent->setDelegate(this);
-}
-
-void FormulaHandler::endFormula()
-{
- m_text = m_curString;
- debug(2,"formula id='%s' text='%s'\n",m_id.data(),m_text.data());
- m_parent->setDelegate(0);
-}
-
-//----------------------------------------------------------------------
-// AnchorHandler
-//----------------------------------------------------------------------
-
-AnchorHandler::AnchorHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- addEndHandler("anchor",this,&AnchorHandler::endAnchor);
-}
-
-AnchorHandler::~AnchorHandler()
-{
-}
-
-void AnchorHandler::startAnchor(const QXmlAttributes& attrib)
-{
- m_id = attrib.value("id");
- m_parent->setDelegate(this);
-}
-
-void AnchorHandler::endAnchor()
-{
- debug(2,"anchor id='%s'\n",m_id.data());
- m_parent->setDelegate(0);
-}
-
-//----------------------------------------------------------------------
-// ImageHandler
-//----------------------------------------------------------------------
-
-ImageHandler::ImageHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- addEndHandler("image",this,&ImageHandler::endImage);
-}
-
-ImageHandler::~ImageHandler()
-{
-}
-
-void ImageHandler::startImage(const QXmlAttributes& attrib)
-{
- m_name = attrib.value("name");
- m_curString="";
- m_parent->setDelegate(this);
-}
-
-void ImageHandler::endImage()
-{
- m_caption = m_curString;
- debug(2,"image name='%s' caption='%s'\n",m_name.data(),m_caption.data());
- m_parent->setDelegate(0);
-}
-
-//----------------------------------------------------------------------
-// DotFileHandler
-//----------------------------------------------------------------------
-
-DotFileHandler::DotFileHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- addEndHandler("dotfile",this,&DotFileHandler::endDotFile);
-}
-
-DotFileHandler::~DotFileHandler()
-{
-}
-
-void DotFileHandler::startDotFile(const QXmlAttributes& attrib)
-{
- m_name = attrib.value("name");
- m_curString="";
- m_parent->setDelegate(this);
-}
-
-void DotFileHandler::endDotFile()
-{
- m_caption = m_curString;
- debug(2,"image name='%s' caption='%s'\n",m_name.data(),m_caption.data());
- m_parent->setDelegate(0);
-}
-
-//----------------------------------------------------------------------
-// IndexEntryHandler
-//----------------------------------------------------------------------
-
-IndexEntryHandler::IndexEntryHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- addEndHandler("indexentry",this,&IndexEntryHandler::endIndexEntry);
- addStartHandler("primaryie",this,&IndexEntryHandler::startPrimaryIE);
- addEndHandler("primaryie",this,&IndexEntryHandler::endPrimaryIE);
- addStartHandler("secondaryie",this,&IndexEntryHandler::startSecondaryIE);
- addEndHandler("secondaryie",this,&IndexEntryHandler::endSecondaryIE);
-}
-
-IndexEntryHandler::~IndexEntryHandler()
-{
-}
-
-void IndexEntryHandler::startIndexEntry(const QXmlAttributes& /*attrib*/)
-{
- debug(2,"start index entry\n");
- m_parent->setDelegate(this);
-}
-
-void IndexEntryHandler::endIndexEntry()
-{
- debug(2,"index entry primary='%s' secondary='%s'\n",
- m_primary.data(),m_secondary.data());
- m_parent->setDelegate(0);
-}
-
-void IndexEntryHandler::startPrimaryIE(const QXmlAttributes& /*attrib*/)
-{
- m_curString="";
-}
-
-void IndexEntryHandler::endPrimaryIE()
-{
- m_primary = m_curString;
-}
-
-void IndexEntryHandler::startSecondaryIE(const QXmlAttributes& /*attrib*/)
-{
- m_curString="";
-}
-
-void IndexEntryHandler::endSecondaryIE()
-{
- m_secondary = m_curString;
-}
-
-//----------------------------------------------------------------------
-// EntryHandler
-//----------------------------------------------------------------------
-
-EntryHandler::EntryHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- m_children.setAutoDelete(TRUE);
- addEndHandler("entry",this,&EntryHandler::endEntry);
- addStartHandler("para",this,&EntryHandler::startParagraph);
-}
-
-EntryHandler::~EntryHandler()
-{
-}
-
-void EntryHandler::startEntry(const QXmlAttributes&)
-{
- m_parent->setDelegate(this);
-}
-
-void EntryHandler::endEntry()
-{
- m_parent->setDelegate(0);
-}
-
-void EntryHandler::startParagraph(const QXmlAttributes& attrib)
-{
- ParagraphHandler *ph = new ParagraphHandler(this);
- ph->startParagraph(attrib);
- m_children.append(ph);
-}
-
-IDocIterator *EntryHandler::contents() const
-{
- return new EntryIterator(*this);
-}
-
-//----------------------------------------------------------------------
-// RowHandler
-//----------------------------------------------------------------------
-
-RowHandler::RowHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- m_children.setAutoDelete(TRUE);
- addEndHandler("row",this,&RowHandler::endRow);
- addStartHandler("entry",this,&RowHandler::startEntry);
-}
-
-RowHandler::~RowHandler()
-{
-}
-
-void RowHandler::startRow(const QXmlAttributes&)
-{
- m_parent->setDelegate(this);
-}
-
-void RowHandler::endRow()
-{
- m_parent->setDelegate(0);
-}
-
-void RowHandler::startEntry(const QXmlAttributes& attrib)
-{
- EntryHandler *eh = new EntryHandler(this);
- eh->startEntry(attrib);
- m_children.append(eh);
-}
-
-IDocIterator *RowHandler::entries() const
-{
- return new RowIterator(*this);
-}
-
-//----------------------------------------------------------------------
-// TableHandler
-//----------------------------------------------------------------------
-
-TableHandler::TableHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- m_children.setAutoDelete(TRUE);
- addEndHandler("table",this,&TableHandler::endTable);
- addStartHandler("row",this,&TableHandler::startRow);
- addStartHandler("caption",this,&TableHandler::startCaption);
- addEndHandler("caption",this,&TableHandler::endCaption);
-}
-
-TableHandler::~TableHandler()
-{
-}
-
-void TableHandler::startTable(const QXmlAttributes& attrib)
-{
- m_parent->setDelegate(this);
- m_numColumns = attrib.value("cols").toInt();
- debug(2,"table cols=%d\n",m_numColumns);
-}
-
-void TableHandler::endTable()
-{
- m_parent->setDelegate(0);
-}
-
-void TableHandler::startRow(const QXmlAttributes& attrib)
-{
- RowHandler *rh = new RowHandler(this);
- rh->startRow(attrib);
- m_children.append(rh);
-}
-
-void TableHandler::startCaption(const QXmlAttributes& /*attrib*/)
-{
- m_curString="";
-}
-
-void TableHandler::endCaption()
-{
- m_caption = m_curString;
-}
-
-IDocIterator *TableHandler::rows() const
-{
- return new TableIterator(*this);
-}
-
-//----------------------------------------------------------------------
-// CopyHandler
-//----------------------------------------------------------------------
-
-CopyHandler::CopyHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- m_children.setAutoDelete(TRUE);
-
- addEndHandler("copydoc",this,&CopyHandler::endCopy);
-
- addStartHandler("para",this,&CopyHandler::startParagraph);
-}
-
-CopyHandler::~CopyHandler()
-{
-}
-
-void CopyHandler::startCopy(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
- debug(2,"start copy handler\n");
-}
-
-void CopyHandler::endCopy()
-{
- debug(2,"end copy handler\n");
- m_parent->setDelegate(0);
-}
-
-void CopyHandler::startParagraph(const QXmlAttributes& attrib)
-{
- ParagraphHandler *parHandler = new ParagraphHandler(this);
- parHandler->startParagraph(attrib);
- m_children.append(parHandler);
-}
-
-IDocIterator *CopyHandler::contents() const
-{
- return new CopyIterator(*this);
-}
-
-//----------------------------------------------------------------------
-// VerbatimHandler
-//----------------------------------------------------------------------
-
-VerbatimHandler::VerbatimHandler(IBaseHandler *parent)
- : m_parent(parent), m_type(IDocVerbatim::Invalid)
-{
- addEndHandler("verbatim",this,&VerbatimHandler::endVerbatim);
- addEndHandler("latexonly",this,&VerbatimHandler::endVerbatim);
- addEndHandler("htmlonly",this,&VerbatimHandler::endVerbatim);
-}
-
-VerbatimHandler::~VerbatimHandler()
-{
-}
-
-void VerbatimHandler::startVerbatim(const QXmlAttributes&,Types type)
-{
- m_type = type;
- m_parent->setDelegate(this);
- m_curString="";
-}
-
-void VerbatimHandler::endVerbatim()
-{
- m_text = m_curString;
- m_parent->setDelegate(0);
-}
-
-
-//----------------------------------------------------------------------
-// SymbolHandler
-//----------------------------------------------------------------------
-
-SymbolHandler::SymbolHandler(IBaseHandler *parent,Types type)
- : m_parent(parent), m_letter('\0'), m_type(type)
-{
- addEndHandler("symbol");
- switch (type)
- {
- case IDocSymbol::Invalid: m_typeString="invalid"; break;
- case IDocSymbol::Umlaut: m_typeString="umlaut"; break;
- case IDocSymbol::Acute: m_typeString="acute"; break;
- case IDocSymbol::Grave: m_typeString="grave"; break;
- case IDocSymbol::Circ: m_typeString="circ"; break;
- case IDocSymbol::Tilde: m_typeString="tilde"; break;
- case IDocSymbol::Szlig: m_typeString="szlig"; break;
- case IDocSymbol::Cedil: m_typeString="cedil"; break;
- case IDocSymbol::Ring: m_typeString="ring"; break;
- case IDocSymbol::Nbsp: m_typeString="nbsp"; break;
- case IDocSymbol::Copy: m_typeString="copy"; break;
- }
-}
-
-SymbolHandler::~SymbolHandler()
-{
-}
-
-void SymbolHandler::startSymbol(const QXmlAttributes& attrib)
-{
- QString ls = attrib.value("char");
- if (!ls.isEmpty()) m_letter = ls.latin1()[0];
-}
-
-//----------------------------------------------------------------------
-// ParagraphHandler
-//----------------------------------------------------------------------
-
-ParagraphHandler::ParagraphHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- m_children.setAutoDelete(TRUE);
-
- m_markupHandler = new MarkupHandler(m_children,m_curString);
-
- // preformatted
- setFallBackHandler(m_markupHandler);
-
- addEndHandler("para",this,&ParagraphHandler::endParagraph);
-
- addStartHandler("linebreak",this,&ParagraphHandler::startLineBreak);
- addStartHandler("hruler",this,&ParagraphHandler::startHRuler);
- addStartHandler("programlisting",this,&ParagraphHandler::startProgramListing);
- addStartHandler("verbatim",this,&ParagraphHandler::startVerbatim);
- addStartHandler("indexentry",this,&ParagraphHandler::startIndexEntry);
- addStartHandler("orderedlist",this,&ParagraphHandler::startOrderedList);
- addStartHandler("itemizedlist",this,&ParagraphHandler::startItemizedList);
- addStartHandler("simplesect",this,&ParagraphHandler::startSimpleSect);
- // TODO: title
- addStartHandler("variablelist",this,&ParagraphHandler::startVariableList);
- addStartHandler("table",this,&ParagraphHandler::startTable);
- // TODO: heading
- addStartHandler("image",this,&ParagraphHandler::startImage);
- addStartHandler("dotfile",this,&ParagraphHandler::startDotFile);
- addStartHandler("toclist",this,&ParagraphHandler::startTocList);
- // TODO: language???
- addStartHandler("parameterlist",this,&ParagraphHandler::startParameterList);
- // TODO: xrefsect
- addStartHandler("copydoc",this,&ParagraphHandler::startCopyDoc);
-
- addStartHandler("ref",this,&ParagraphHandler::startRef);
- addStartHandler("ulink",this,&ParagraphHandler::startULink);
- addStartHandler("email",this,&ParagraphHandler::startEMail);
- addStartHandler("link",this,&ParagraphHandler::startLink);
- addStartHandler("formula",this,&ParagraphHandler::startFormula);
- addStartHandler("latexonly",this,&ParagraphHandler::startHtmlOnly);
- addStartHandler("htmlonly",this,&ParagraphHandler::startLatexOnly);
- addStartHandler("umlaut",this,&ParagraphHandler::startUmlaut);
- addStartHandler("acute",this,&ParagraphHandler::startAcute);
- addStartHandler("grave",this,&ParagraphHandler::startGrave);
- addStartHandler("circ",this,&ParagraphHandler::startCirc);
- addStartHandler("tilde",this,&ParagraphHandler::startTilde);
- addStartHandler("szlig",this,&ParagraphHandler::startSzlig);
- addStartHandler("cedil",this,&ParagraphHandler::startCedil);
- addStartHandler("ring",this,&ParagraphHandler::startRing);
- addStartHandler("nbsp",this,&ParagraphHandler::startNbsp);
- addStartHandler("copy",this,&ParagraphHandler::startCopy);
- addStartHandler("anchor",this,&ParagraphHandler::startAnchor);
-}
-
-ParagraphHandler::~ParagraphHandler()
-{
- delete m_markupHandler;
-}
-
-void ParagraphHandler::startParagraph(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
- debug(2,"para\n");
-}
-
-void ParagraphHandler::endParagraph()
-{
- addTextNode();
- debug(2,"end para\n");
- m_parent->setDelegate(0);
-}
-
-void ParagraphHandler::startItemizedList(const QXmlAttributes& attrib)
-{
- addTextNode();
- ItemizedListHandler *listHandler = new ItemizedListHandler(this);
- listHandler->startItemizedList(attrib);
- m_children.append(listHandler);
-}
-
-void ParagraphHandler::startOrderedList(const QXmlAttributes& attrib)
-{
- addTextNode();
- OrderedListHandler *listHandler = new OrderedListHandler(this);
- listHandler->startOrderedList(attrib);
- m_children.append(listHandler);
-}
-
-void ParagraphHandler::startParameterList(const QXmlAttributes& attrib)
-{
- addTextNode();
- ParameterListHandler *listHandler = new ParameterListHandler(this);
- listHandler->startParameterList(attrib);
- m_children.append(listHandler);
-}
-
-void ParagraphHandler::startSimpleSect(const QXmlAttributes& attrib)
-{
- addTextNode();
- SimpleSectHandler *sectHandler = new SimpleSectHandler(this);
- sectHandler->startSimpleSect(attrib);
- m_children.append(sectHandler);
-}
-
-void ParagraphHandler::startRef(const QXmlAttributes& attrib)
-{
- addTextNode();
- RefHandler *ref = new RefHandler(this);
- ref->startRef(attrib);
- m_children.append(ref);
-}
-
-void ParagraphHandler::startVariableList(const QXmlAttributes& attrib)
-{
- addTextNode();
- VariableListHandler *vl = new VariableListHandler(this);
- vl->startVariableList(attrib);
- m_children.append(vl);
-}
-
-void ParagraphHandler::startHRuler(const QXmlAttributes& attrib)
-{
- addTextNode();
- HRulerHandler *hr = new HRulerHandler(this);
- hr->startHRuler(attrib);
- m_children.append(hr);
-}
-
-void ParagraphHandler::startLineBreak(const QXmlAttributes& attrib)
-{
- addTextNode();
- LineBreakHandler *lb = new LineBreakHandler(this);
- lb->startLineBreak(attrib);
- m_children.append(lb);
-}
-
-void ParagraphHandler::startULink(const QXmlAttributes& attrib)
-{
- addTextNode();
- ULinkHandler *uh = new ULinkHandler(this);
- uh->startULink(attrib);
- m_children.append(uh);
-}
-
-void ParagraphHandler::startEMail(const QXmlAttributes& attrib)
-{
- addTextNode();
- EMailHandler *eh = new EMailHandler(this);
- eh->startEMail(attrib);
- m_children.append(eh);
-}
-
-void ParagraphHandler::startLink(const QXmlAttributes& attrib)
-{
- addTextNode();
- LinkHandler *lh = new LinkHandler(this);
- lh->startLink(attrib);
- m_children.append(lh);
-}
-
-void ParagraphHandler::startProgramListing(const QXmlAttributes& attrib)
-{
- addTextNode();
- ProgramListingHandler *pl = new ProgramListingHandler(this);
- pl->startProgramListing(attrib);
- m_children.append(pl);
-}
-
-void ParagraphHandler::startFormula(const QXmlAttributes& attrib)
-{
- addTextNode();
- FormulaHandler *fh = new FormulaHandler(this);
- fh->startFormula(attrib);
- m_children.append(fh);
-}
-
-void ParagraphHandler::startImage(const QXmlAttributes& attrib)
-{
- addTextNode();
- ImageHandler *ih = new ImageHandler(this);
- ih->startImage(attrib);
- m_children.append(ih);
-}
-
-void ParagraphHandler::startDotFile(const QXmlAttributes& attrib)
-{
- addTextNode();
- DotFileHandler *df = new DotFileHandler(this);
- df->startDotFile(attrib);
- m_children.append(df);
-}
-
-void ParagraphHandler::startIndexEntry(const QXmlAttributes& attrib)
-{
- addTextNode();
- IndexEntryHandler *df = new IndexEntryHandler(this);
- df->startIndexEntry(attrib);
- m_children.append(df);
-}
-
-void ParagraphHandler::startTable(const QXmlAttributes& attrib)
-{
- addTextNode();
- TableHandler *th = new TableHandler(this);
- th->startTable(attrib);
- m_children.append(th);
-}
-
-void ParagraphHandler::startVerbatim(const QXmlAttributes& attrib)
-{
- addTextNode();
- VerbatimHandler *vh = new VerbatimHandler(this);
- vh->startVerbatim(attrib,IDocVerbatim::Verbatim);
- m_children.append(vh);
-}
-
-void ParagraphHandler::startHtmlOnly(const QXmlAttributes& attrib)
-{
- addTextNode();
- VerbatimHandler *vh = new VerbatimHandler(this);
- vh->startVerbatim(attrib,IDocVerbatim::HtmlOnly);
- m_children.append(vh);
-}
-
-void ParagraphHandler::startLatexOnly(const QXmlAttributes& attrib)
-{
- addTextNode();
- VerbatimHandler *vh = new VerbatimHandler(this);
- vh->startVerbatim(attrib,IDocVerbatim::LatexOnly);
- m_children.append(vh);
-}
-
-void ParagraphHandler::startUmlaut(const QXmlAttributes& attrib)
-{
- addTextNode();
- SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Umlaut);
- sh->startSymbol(attrib);
- m_children.append(sh);
-}
-
-void ParagraphHandler::startAcute(const QXmlAttributes& attrib)
-{
- addTextNode();
- SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Acute);
- sh->startSymbol(attrib);
- m_children.append(sh);
-}
-
-void ParagraphHandler::startGrave(const QXmlAttributes& attrib)
-{
- addTextNode();
- SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Grave);
- sh->startSymbol(attrib);
- m_children.append(sh);
-}
-
-void ParagraphHandler::startCirc(const QXmlAttributes& attrib)
-{
- addTextNode();
- SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Circ);
- sh->startSymbol(attrib);
- m_children.append(sh);
-}
-
-void ParagraphHandler::startTilde(const QXmlAttributes& attrib)
-{
- addTextNode();
- SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Tilde);
- sh->startSymbol(attrib);
- m_children.append(sh);
-}
-
-void ParagraphHandler::startSzlig(const QXmlAttributes& attrib)
-{
- addTextNode();
- SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Szlig);
- sh->startSymbol(attrib);
- m_children.append(sh);
-}
-
-void ParagraphHandler::startCedil(const QXmlAttributes& attrib)
-{
- addTextNode();
- SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Cedil);
- sh->startSymbol(attrib);
- m_children.append(sh);
-}
-
-void ParagraphHandler::startRing(const QXmlAttributes& attrib)
-{
- addTextNode();
- SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Ring);
- sh->startSymbol(attrib);
- m_children.append(sh);
-}
-
-void ParagraphHandler::startNbsp(const QXmlAttributes& attrib)
-{
- addTextNode();
- SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Nbsp);
- sh->startSymbol(attrib);
- m_children.append(sh);
-}
-
-void ParagraphHandler::startCopy(const QXmlAttributes& attrib)
-{
- addTextNode();
- SymbolHandler *sh = new SymbolHandler(this,IDocSymbol::Copy);
- sh->startSymbol(attrib);
- m_children.append(sh);
-}
-
-void ParagraphHandler::startAnchor(const QXmlAttributes& attrib)
-{
- addTextNode();
- AnchorHandler *ah = new AnchorHandler(this);
- ah->startAnchor(attrib);
- m_children.append(ah);
-}
-
-void ParagraphHandler::startCopyDoc(const QXmlAttributes& attrib)
-{
- addTextNode();
- CopyHandler *ch = new CopyHandler(this);
- ch->startCopy(attrib);
- m_children.append(ch);
-}
-
-void ParagraphHandler::startTocList(const QXmlAttributes& attrib)
-{
- addTextNode();
- TocListHandler *th = new TocListHandler(this);
- th->startTocList(attrib);
- m_children.append(th);
-}
-
-void ParagraphHandler::addTextNode()
-{
- if (!m_curString.isEmpty())
- {
- m_children.append(
- new TextNode(
- m_curString,
- m_markupHandler->markup(),
- m_markupHandler->headingLevel()
- )
- );
- debug(2,"addTextNode() text=\"%s\" markup=%x headingLevel=%d\n",
- m_curString.data(),m_markupHandler->markup(),m_markupHandler->headingLevel());
- m_curString="";
- }
-}
-
-IDocIterator *ParagraphHandler::contents() const
-{
- return new ParagraphIterator(*this);
-}
-
-//----------------------------------------------------------------------
-// DocSectionHandler
-//----------------------------------------------------------------------
-
-DocSectionHandler::DocSectionHandler(IBaseHandler *parent,int level)
- : m_parent(parent), m_internal(0), m_level(level), m_title(0)
-{
- QString sectionKey;
- m_paragraphs.setAutoDelete(TRUE);
- m_subsections.setAutoDelete(TRUE);
- addStartHandler("title",this,&DocSectionHandler::startTitle);
- addStartHandler("para",this,&DocSectionHandler::startParagraph);
- if (level<6)
- {
- sectionKey.sprintf("sect%d",level+1);
- addStartHandler(sectionKey.utf8(),this,&DocSectionHandler::startSubSection);
- }
- addStartHandler("internal",this,&DocSectionHandler::startInternal);
- sectionKey.sprintf("sect%d",level);
- addEndHandler(sectionKey.utf8(),this,&DocSectionHandler::endDocSection);
-}
-
-DocSectionHandler::~DocSectionHandler()
-{
-}
-
-void DocSectionHandler::startDocSection(const QXmlAttributes& attrib)
-{
- m_parent->setDelegate(this);
- debug(2,"Start docsection\n");
- m_id = attrib.value("id");
-}
-
-void DocSectionHandler::endDocSection()
-{
- m_parent->setDelegate(0);
- debug(2,"End docsection\n");
-}
-
-void DocSectionHandler::startSubSection(const QXmlAttributes& attrib)
-{
- DocSectionHandler *secHandler = new DocSectionHandler(this,m_level+1);
- secHandler->startDocSection(attrib);
- m_subsections.append(secHandler);
-}
-
-void DocSectionHandler::startParagraph(const QXmlAttributes& attrib)
-{
- ParagraphHandler *parHandler = new ParagraphHandler(this);
- parHandler->startParagraph(attrib);
- m_paragraphs.append(parHandler);
-}
-
-void DocSectionHandler::startInternal(const QXmlAttributes& attrib)
-{
- m_internal = new DocInternalHandler(this,m_level);
- m_internal->startInternal(attrib);
-}
-
-void DocSectionHandler::startTitle(const QXmlAttributes& attrib)
-{
- m_title = new TitleHandler(this);
- m_title->startTitle(attrib);
-}
-
-IDocIterator *DocSectionHandler::paragraphs() const
-{
- return new DocSectionParaIterator(*this);
-}
-
-IDocIterator *DocSectionHandler::subSections() const
-{
- return new DocSectionSubIterator(*this);
-}
-
-IDocInternal *DocSectionHandler::internal() const
-{
- return m_internal;
-}
-
-//----------------------------------------------------------------------
-// DocInternal
-//----------------------------------------------------------------------
-
-DocInternalHandler::DocInternalHandler(IBaseHandler *parent,int level)
- : m_parent(parent), m_level(level)
-{
- m_paragraphs.setAutoDelete(TRUE);
- m_subsections.setAutoDelete(TRUE);
- addStartHandler("para",this,&DocInternalHandler::startParagraph);
- QString sectionKey;
- sectionKey.sprintf("sect%d",level+1);
- addStartHandler(sectionKey.utf8(),this,&DocInternalHandler::startSubSection);
- addEndHandler("internal",this,&DocInternalHandler::endInternal);
-}
-
-DocInternalHandler::~DocInternalHandler()
-{
-}
-
-void DocInternalHandler::startInternal(const QXmlAttributes&)
-{
- m_parent->setDelegate(this);
- debug(2,"Start internal\n");
-}
-
-void DocInternalHandler::endInternal()
-{
- m_parent->setDelegate(0);
- debug(2,"End internal\n");
-}
-
-void DocInternalHandler::startSubSection(const QXmlAttributes& attrib)
-{
- DocSectionHandler *secHandler = new DocSectionHandler(this,m_level+1);
- secHandler->startDocSection(attrib);
- m_subsections.append(secHandler);
-}
-
-void DocInternalHandler::startParagraph(const QXmlAttributes& attrib)
-{
- ParagraphHandler *parHandler = new ParagraphHandler(this);
- parHandler->startParagraph(attrib);
- m_paragraphs.append(parHandler);
-}
-
-IDocIterator *DocInternalHandler::paragraphs() const
-{
- return new DocInternalParaIterator(*this);
-}
-
-IDocIterator *DocInternalHandler::subSections() const
-{
- return new DocInternalSubIterator(*this);
-}
-
-
-//----------------------------------------------------------------------
-// DocHandler
-//----------------------------------------------------------------------
-
-DocHandler::DocHandler(IBaseHandler *parent) : m_parent(parent)
-{
- m_children.setAutoDelete(TRUE);
-
- addEndHandler("briefdescription",this,&DocHandler::endDoc);
- addEndHandler("detaileddescription",this,&DocHandler::endDoc);
- addEndHandler("inbodydescription",this,&DocHandler::endDoc);
- //addEndHandler("internal"); // TODO: implement this as a section
- addStartHandler("internal",this,&DocHandler::startInternal);
-
- addStartHandler("para",this,&DocHandler::startParagraph);
- addStartHandler("sect1",this,&DocHandler::startSect1);
- addStartHandler("title",this,&DocHandler::startTitle);
- //addStartHandler("internal");
-}
-
-DocHandler::~DocHandler()
-{
-}
-
-void DocHandler::startDoc(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
- debug(2,"start dochandler\n");
-}
-
-void DocHandler::endDoc()
-{
- debug(2,"end dochandler\n");
- m_parent->setDelegate(0);
-}
-
-void DocHandler::startParagraph(const QXmlAttributes& attrib)
-{
- ParagraphHandler *parHandler = new ParagraphHandler(this);
- parHandler->startParagraph(attrib);
- m_children.append(parHandler);
-}
-
-void DocHandler::startSect1(const QXmlAttributes& attrib)
-{
- DocSectionHandler *secHandler = new DocSectionHandler(this,1);
- secHandler->startDocSection(attrib);
- m_children.append(secHandler);
-}
-
-void DocHandler::startTitle(const QXmlAttributes& attrib)
-{
- TitleHandler *titleHandler = new TitleHandler(this);
- titleHandler->startTitle(attrib);
- m_children.append(titleHandler);
-}
-
-void DocHandler::startInternal(const QXmlAttributes& attrib)
-{
- m_internal = new DocInternalHandler(this,1);
- m_internal->startInternal(attrib);
-}
-
-IDocIterator *DocHandler::contents() const
-{
- return new DocIterator(*this);
-}
-
-IDocInternal *DocHandler::internal() const
-{
- return m_internal;
-}
-
diff --git a/addon/doxmlparser/src/dochandler.h b/addon/doxmlparser/src/dochandler.h
deleted file mode 100644
index 59af4e3..0000000
--- a/addon/doxmlparser/src/dochandler.h
+++ /dev/null
@@ -1,1352 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-
-#ifndef _DOCHANDLER_H
-#define _DOCHANDLER_H
-
-#include <qstring.h>
-#include <qlist.h>
-#include <qxml.h>
-
-#include <doxmlintf.h>
-#include "stringimpl.h"
-#include "basehandler.h"
-#include "baseiterator.h"
-
-class ParagraphHandler;
-class DocInternalHandler;
-class LinkedTextImpl;
-class LinkedTextHandler;
-
-//-----------------------------------------------------------------------------
-
-class DocImpl : public IDoc { public: virtual ~DocImpl() {} };
-
-#define DEFINE_CLS_IMPL(cls) \
- class cls##Impl : public I##cls, public DocImpl { public: virtual ~cls##Impl() {} }
-
-DEFINE_CLS_IMPL(DocMarkup);
-DEFINE_CLS_IMPL(DocPara);
-DEFINE_CLS_IMPL(DocText);
-DEFINE_CLS_IMPL(DocMarkupModifier);
-DEFINE_CLS_IMPL(DocItemizedList);
-DEFINE_CLS_IMPL(DocOrderedList);
-DEFINE_CLS_IMPL(DocListItem);
-DEFINE_CLS_IMPL(DocParameterList);
-DEFINE_CLS_IMPL(DocParameterItem);
-DEFINE_CLS_IMPL(DocParameter);
-DEFINE_CLS_IMPL(DocTitle);
-DEFINE_CLS_IMPL(DocSimpleSect);
-DEFINE_CLS_IMPL(DocRef);
-DEFINE_CLS_IMPL(DocVariableList);
-DEFINE_CLS_IMPL(DocVariableListEntry);
-DEFINE_CLS_IMPL(DocHRuler);
-DEFINE_CLS_IMPL(DocLineBreak);
-DEFINE_CLS_IMPL(DocULink);
-DEFINE_CLS_IMPL(DocEMail);
-DEFINE_CLS_IMPL(DocLink);
-DEFINE_CLS_IMPL(DocProgramListing);
-DEFINE_CLS_IMPL(DocCodeLine);
-DEFINE_CLS_IMPL(DocHighlight);
-DEFINE_CLS_IMPL(DocFormula);
-DEFINE_CLS_IMPL(DocImage);
-DEFINE_CLS_IMPL(DocDotFile);
-DEFINE_CLS_IMPL(DocIndexEntry);
-DEFINE_CLS_IMPL(DocTable);
-DEFINE_CLS_IMPL(DocRow);
-DEFINE_CLS_IMPL(DocEntry);
-DEFINE_CLS_IMPL(DocSection);
-DEFINE_CLS_IMPL(DocVerbatim);
-DEFINE_CLS_IMPL(DocCopy);
-DEFINE_CLS_IMPL(DocTocList);
-DEFINE_CLS_IMPL(DocTocItem);
-DEFINE_CLS_IMPL(DocAnchor);
-DEFINE_CLS_IMPL(DocSymbol);
-DEFINE_CLS_IMPL(DocInternal);
-DEFINE_CLS_IMPL(DocRoot);
-
-//-----------------------------------------------------------------------------
-
-
-/*! \brief Node representing a piece of text.
- *
- */
-class TextNode : public DocTextImpl
-{
- public:
- TextNode(const QString &t,int markup,int level)
- : m_text(t), m_markup(markup), m_headingLevel(level) {}
- virtual ~TextNode() {}
-
- // IDocText
- virtual Kind kind() const { return DocImpl::Text; }
- virtual const IString *text() const { return &m_text; }
- virtual int markup() const { return m_markup; }
- virtual int headingLevel() const { return m_headingLevel; }
-
- private:
- StringImpl m_text;
- int m_markup;
- int m_headingLevel;
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing a change in the markup style.
- *
- */
-class MarkupModifierNode : public DocMarkupModifierImpl
-{
- public:
- MarkupModifierNode(int markup,bool enabled,int level=0)
- : m_markup(markup), m_enabled(enabled), m_headingLevel(level) {}
- virtual ~MarkupModifierNode() {}
-
- // IDocMarkupModifier
- virtual Kind kind() const { return DocImpl::MarkupModifier; }
- virtual bool enabled() const { return m_enabled; }
- virtual int markup() const { return m_markup; }
- virtual int headingLevel() const { return m_headingLevel; }
-
- private:
- int m_markup;
- bool m_enabled;
- int m_headingLevel;
-};
-
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Handles markup commands in the XML input.
- *
- */
-class MarkupHandler : public BaseFallBackHandler<MarkupHandler>
-{
- public:
- MarkupHandler(QList<DocImpl> &children,QString &curString);
- virtual ~MarkupHandler();
- int markup() const { return m_curMarkup; }
- int headingLevel() const { return m_headingLevel; }
-
- virtual void startBold(const QXmlAttributes &attrib);
- virtual void endBold();
- virtual void startEmphasis(const QXmlAttributes &attrib);
- virtual void endEmphasis();
- virtual void startComputerOutput(const QXmlAttributes &attrib);
- virtual void endComputerOutput();
- virtual void startCenter(const QXmlAttributes &attrib);
- virtual void endCenter();
- virtual void startSmallFont(const QXmlAttributes &attrib);
- virtual void endSmallFont();
- virtual void startSubscript(const QXmlAttributes &attrib);
- virtual void endSubscript();
- virtual void startSuperscript(const QXmlAttributes &attrib);
- virtual void endSuperscript();
- virtual void startPreformatted(const QXmlAttributes &attrib);
- virtual void endPreformatted();
- virtual void startHeading1(const QXmlAttributes &attrib);
- virtual void endHeading1();
- virtual void startHeading2(const QXmlAttributes &attrib);
- virtual void endHeading2();
- virtual void startHeading3(const QXmlAttributes &attrib);
- virtual void endHeading3();
- virtual void startHeading4(const QXmlAttributes &attrib);
- virtual void endHeading4();
- virtual void startHeading5(const QXmlAttributes &attrib);
- virtual void endHeading5();
- virtual void startHeading6(const QXmlAttributes &attrib);
- virtual void endHeading6();
-
-
- private:
- void addTextNode();
-
- QList<DocImpl> &m_children;
- QString &m_curString;
- int m_curMarkup;
- int m_headingLevel;
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing a paragraph of text and commands.
- *
- */
-// children: itemizedlist, orderedlist, parameterlist, simplesect, ref,
-// variablelist, hruler, linebreak, ulink, email, link
-// programlisting, formula, image, dotfile, indexentry,
-// table
-//
-// children handled by MarkupHandler:
-// bold, computeroutput, emphasis, center,
-// small, subscript, superscript.
-//
-class ParagraphHandler : public DocParaImpl,
- public BaseHandler<ParagraphHandler>
-{
- friend class ParagraphIterator;
-
- public:
- virtual void startParagraph(const QXmlAttributes& attrib);
- virtual void endParagraph();
- virtual void startItemizedList(const QXmlAttributes& attrib);
- virtual void startOrderedList(const QXmlAttributes& attrib);
- virtual void startParameterList(const QXmlAttributes& attrib);
- virtual void startSimpleSect(const QXmlAttributes& attrib);
- virtual void startRef(const QXmlAttributes& attrib);
- virtual void startVariableList(const QXmlAttributes& attrib);
- virtual void startHRuler(const QXmlAttributes& attrib);
- virtual void startLineBreak(const QXmlAttributes& attrib);
- virtual void startULink(const QXmlAttributes& attrib);
- virtual void startEMail(const QXmlAttributes& attrib);
- virtual void startLink(const QXmlAttributes& attrib);
- virtual void startProgramListing(const QXmlAttributes& attrib);
- virtual void startFormula(const QXmlAttributes& attrib);
- virtual void startImage(const QXmlAttributes& attrib);
- virtual void startDotFile(const QXmlAttributes& attrib);
- virtual void startIndexEntry(const QXmlAttributes& attrib);
- virtual void startTable(const QXmlAttributes& attrib);
- virtual void startVerbatim(const QXmlAttributes& attrib);
- virtual void startHtmlOnly(const QXmlAttributes& attrib);
- virtual void startLatexOnly(const QXmlAttributes& attrib);
- virtual void startUmlaut(const QXmlAttributes& attrib);
- virtual void startAcute(const QXmlAttributes& attrib);
- virtual void startGrave(const QXmlAttributes& attrib);
- virtual void startCirc(const QXmlAttributes& attrib);
- virtual void startTilde(const QXmlAttributes& attrib);
- virtual void startSzlig(const QXmlAttributes& attrib);
- virtual void startCedil(const QXmlAttributes& attrib);
- virtual void startRing(const QXmlAttributes& attrib);
- virtual void startNbsp(const QXmlAttributes& attrib);
- virtual void startCopy(const QXmlAttributes& attrib);
- virtual void startAnchor(const QXmlAttributes& attrib);
- virtual void startCopyDoc(const QXmlAttributes& attrib);
- virtual void startTocList(const QXmlAttributes& attrib);
-
- ParagraphHandler(IBaseHandler *parent);
- virtual ~ParagraphHandler();
-
- // IDocPara
- virtual Kind kind() const { return DocImpl::Para; }
- virtual IDocIterator *contents() const;
-
- private:
- void addTextNode();
- IBaseHandler *m_parent;
- QList<DocImpl> m_children;
- MarkupHandler *m_markupHandler;
-};
-
-class ParagraphIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
-{
- public:
- ParagraphIterator(const ParagraphHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing a list item.
- *
- */
-class ListItemHandler : public DocListItemImpl, public BaseHandler<ListItemHandler>
-{
- friend class ListItemIterator;
- public:
- ListItemHandler(IBaseHandler *parent);
- virtual ~ListItemHandler();
- virtual void startListItem(const QXmlAttributes& attrib);
- virtual void endListItem();
- virtual void startParagraph(const QXmlAttributes& attrib);
-
- // IDocItem
- virtual Kind kind() const { return DocImpl::ListItem; }
- virtual IDocIterator *contents() const;
-
- private:
- IBaseHandler *m_parent;
- QList<DocImpl> m_children;
-};
-
-class ListItemIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
-{
- public:
- ListItemIterator(const ListItemHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
-};
-
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing list of items.
- *
- */
-class OrderedListHandler : public DocOrderedListImpl, public BaseHandler<OrderedListHandler>
-{
- friend class OrderedListIterator;
- public:
- OrderedListHandler(IBaseHandler *parent);
- virtual ~OrderedListHandler();
- virtual void startOrderedList(const QXmlAttributes& attrib);
- virtual void endOrderedList();
- virtual void startOrderedListItem(const QXmlAttributes& attrib);
-
- // IDocOrderedList
- virtual Kind kind() const { return DocImpl::OrderedList; }
- virtual IDocIterator *elements() const;
-
- private:
- IBaseHandler *m_parent;
- QList<DocImpl> m_children;
-};
-
-class OrderedListIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
-{
- public:
- OrderedListIterator(const OrderedListHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing table of contents list.
- *
- */
-class TocListHandler : public DocTocListImpl, public BaseHandler<TocListHandler>
-{
- friend class TocListIterator;
- public:
- TocListHandler(IBaseHandler *parent);
- virtual ~TocListHandler();
- virtual void startTocList(const QXmlAttributes& attrib);
- virtual void endTocList();
- virtual void startTocItem(const QXmlAttributes& attrib);
-
- // IDocTocList
- virtual Kind kind() const { return DocImpl::TocList; }
- virtual IDocIterator *elements() const;
-
- private:
- IBaseHandler *m_parent;
- QList<DocImpl> m_children;
-};
-
-class TocListIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
-{
- public:
- TocListIterator(const TocListHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing a table of contents item.
- *
- */
-class TocItemHandler : public DocTocItemImpl, public BaseHandler<TocItemHandler>
-{
- friend class TocItemIterator;
- public:
- TocItemHandler(IBaseHandler *parent);
- virtual ~TocItemHandler();
- virtual void startTocItem(const QXmlAttributes& attrib);
- virtual void endTocItem();
-
- // IDocItem
- virtual Kind kind() const { return DocImpl::TocItem; }
- virtual const IString *id() const { return &m_id; }
- virtual const IString *title() const { return &m_title; }
-
- private:
- IBaseHandler *m_parent;
- StringImpl m_id;
- StringImpl m_title;
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing list of items.
- *
- */
-class ItemizedListHandler : public DocItemizedListImpl, public BaseHandler<ItemizedListHandler>
-{
- friend class ItemizedListIterator;
- public:
- ItemizedListHandler(IBaseHandler *parent);
- virtual ~ItemizedListHandler();
- virtual void startItemizedList(const QXmlAttributes& attrib);
- virtual void endItemizedList();
- virtual void startItemizedListItem(const QXmlAttributes& attrib);
-
- // IDocItemizedList
- virtual Kind kind() const { return DocImpl::ItemizedList; }
- virtual IDocIterator *elements() const;
-
- private:
- IBaseHandler *m_parent;
- QList<DocImpl> m_children;
-};
-
-class ItemizedListIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
-{
- public:
- ItemizedListIterator(const ItemizedListHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
-};
-
-
-//-----------------------------------------------------------------------------
-/*! \brief Node representing a parameter.
- *
- */
-class ParameterHandler : public DocParameterImpl,
- public BaseHandler<ParameterHandler>
-{
- public:
- ParameterHandler(IBaseHandler *parent);
- virtual ~ParameterHandler();
- virtual void startParameterName(const QXmlAttributes& attrib);
- virtual void endParameterName();
-
- // IDocParameter
- virtual Kind kind() const { return DocImpl::Parameter; }
- virtual const IString *name() const { return &m_name; }
-
- private:
- IBaseHandler *m_parent;
- StringImpl m_name;
-};
-
-//-----------------------------------------------------------------------------
-
-/* \brief Node representing a list of param names with a single description.
- *
- */
-class ParameterItemHandler : public DocParameterItemImpl,
- public BaseHandler<ParameterItemHandler>
-{
- friend class ParameterItemIterator;
- public:
- ParameterItemHandler(IBaseHandler *parent);
- virtual ~ParameterItemHandler();
- virtual void startParameterItem(const QXmlAttributes& attrib);
- virtual void endParameterItem();
- virtual void startParameterName(const QXmlAttributes& attrib);
- virtual void startParagraph(const QXmlAttributes& attrib);
-
- // IDocParameterItem
- virtual Kind kind() const { return DocImpl::ParameterItem; }
- virtual IDocIterator *paramNames() const;
- virtual IDocPara *description() const { return m_description; }
-
- private:
- IBaseHandler *m_parent;
- QList<ParameterHandler> m_parameters;
- ParagraphHandler *m_description;
-};
-
-class ParameterItemIterator : public BaseIteratorVia<IDocIterator,IDoc,ParameterHandler,DocImpl>
-{
- public:
- ParameterItemIterator(const ParameterItemHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,ParameterHandler,DocImpl>(handler.m_parameters) {}
-};
-
-//-----------------------------------------------------------------------------
-
-/* \brief Node representing a parameter section.
- *
- */
-class ParameterListHandler : public DocParameterListImpl,
- public BaseHandler<ParameterListHandler>
-{
- friend class ParameterListIterator;
- public:
- ParameterListHandler(IBaseHandler *parent);
- virtual ~ParameterListHandler();
- virtual void startParameterList(const QXmlAttributes& attrib);
- virtual void endParameterList();
- virtual void startParameterItem(const QXmlAttributes& attrib);
-
- // IDocParameterList
- virtual Kind kind() const { return DocImpl::ParameterList; }
- virtual Types sectType() const { return m_type; }
- virtual IDocIterator *params() const;
-
- private:
- IBaseHandler *m_parent;
- QList<ParameterItemHandler> m_paramItems;
- Types m_type;
-};
-
-class ParameterListIterator : public BaseIteratorVia<IDocIterator,IDoc,ParameterItemHandler,DocImpl>
-{
- public:
- ParameterListIterator(const ParameterListHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,ParameterItemHandler,DocImpl>(handler.m_paramItems) {}
-};
-
-//-----------------------------------------------------------------------------
-
-/* \brief Node representing a horizontal ruler
- *
- */
-class LineBreakHandler : public DocLineBreakImpl, public BaseHandler<LineBreakHandler>
-{
- public:
- LineBreakHandler(IBaseHandler *parent);
- virtual ~LineBreakHandler();
-
- void startLineBreak(const QXmlAttributes& attrib);
- void endLineBreak();
-
- // IDocLineBreak
- virtual Kind kind() const { return DocImpl::LineBreak; }
-
- private:
- IBaseHandler *m_parent;
-};
-
-//-----------------------------------------------------------------------------
-
-/* \brief Node representing a link to section
- *
- */
-class LinkHandler : public DocLinkImpl, public BaseHandler<LinkHandler>
-{
- public:
- LinkHandler(IBaseHandler *parent);
- virtual ~LinkHandler();
-
- void startLink(const QXmlAttributes& attrib);
- void endLink();
-
- // IDocLink
- virtual Kind kind() const { return DocImpl::Link; }
- virtual const IString *refId() const { return &m_ref; }
- virtual const IString *text() const { return &m_text; }
-
- private:
- IBaseHandler *m_parent;
- StringImpl m_ref;
- StringImpl m_text;
-};
-
-
-//-----------------------------------------------------------------------------
-
-/* \brief Node representing a link to an email address
- *
- */
-class EMailHandler : public DocEMailImpl, public BaseHandler<EMailHandler>
-{
- public:
- EMailHandler(IBaseHandler *parent);
- virtual ~EMailHandler();
-
- void startEMail(const QXmlAttributes& attrib);
- void endEMail();
-
- // IDocEMail
- virtual Kind kind() const { return DocImpl::EMail; }
- virtual const IString *address() const { return &m_address; }
-
- private:
- IBaseHandler *m_parent;
- StringImpl m_address;
-};
-
-
-//-----------------------------------------------------------------------------
-
-/* \brief Node representing a link to a URL
- *
- */
-class ULinkHandler : public DocULinkImpl, public BaseHandler<ULinkHandler>
-{
- public:
- ULinkHandler(IBaseHandler *parent);
- virtual ~ULinkHandler();
-
- void startULink(const QXmlAttributes& attrib);
- void endULink();
-
- // IDocULink
- virtual Kind kind() const { return DocImpl::ULink; }
- virtual const IString * url() const { return &m_url; }
- virtual const IString * text() const { return &m_text; }
-
- private:
- IBaseHandler *m_parent;
- StringImpl m_url;
- StringImpl m_text;
-};
-
-//-----------------------------------------------------------------------------
-
-/* \brief Node representing a horizontal ruler
- *
- */
-class HRulerHandler : public DocHRulerImpl, public BaseHandler<HRulerHandler>
-{
- public:
- HRulerHandler(IBaseHandler *parent);
- virtual ~HRulerHandler();
-
- void startHRuler(const QXmlAttributes& attrib);
- void endHRuler();
-
- // IDocHRuler
- virtual Kind kind() const { return DocImpl::HRuler; }
-
- private:
- IBaseHandler *m_parent;
-};
-
-//-----------------------------------------------------------------------------
-
-/* \brief Node representing a reference to another item
- *
- */
-class RefHandler : public DocRefImpl, public BaseHandler<RefHandler>
-{
- public:
- RefHandler(IBaseHandler *parent);
- virtual ~RefHandler();
- void startRef(const QXmlAttributes& attrib);
- void endRef();
-
- // IDocRef
- virtual Kind kind() const { return DocImpl::Ref; }
- virtual const IString *refId() const { return &m_refId; }
- virtual TargetKind targetKind() const { return m_targetKind; }
- virtual const IString *external() const { return &m_extId; }
- virtual const IString *text() const { return &m_linkText; }
-
- private:
- IBaseHandler *m_parent;
- StringImpl m_refId;
- StringImpl m_extId;
- StringImpl m_linkText;
- TargetKind m_targetKind;
-};
-
-//-----------------------------------------------------------------------------
-
-/* \brief Node representing the title of a section
- *
- */
-// children: text, ref
-// children handled by MarkupHandler:
-// bold, computeroutput, emphasis, center,
-// small, subscript, superscript.
-class TitleHandler : public DocTitleImpl, public BaseHandler<TitleHandler>
-{
- friend class TitleIterator;
- public:
- TitleHandler(IBaseHandler *parent);
- virtual ~TitleHandler();
- virtual void startTitle(const QXmlAttributes& attrib);
- virtual void endTitle();
- virtual void startRef(const QXmlAttributes& attrib);
- void addTextNode();
-
- // IDocTitle
- virtual Kind kind() const { return DocImpl::Title; }
- virtual IDocIterator *title() const;
-
- private:
- IBaseHandler *m_parent;
- QList<DocImpl> m_children;
- MarkupHandler *m_markupHandler;
-};
-
-class TitleIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
-{
- public:
- TitleIterator(const TitleHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
-};
-
-//-----------------------------------------------------------------------------
-
-/* \brief Node representing a simple section with an unnumbered header.
- *
- */
-// children: title, para
-class SimpleSectHandler : public DocSimpleSectImpl,
- public BaseHandler<SimpleSectHandler>
-{
- public:
- SimpleSectHandler(IBaseHandler *parent);
- virtual ~SimpleSectHandler();
- virtual void startSimpleSect(const QXmlAttributes& attrib);
- virtual void endSimpleSect();
- virtual void startTitle(const QXmlAttributes& attrib);
- virtual void startParagraph(const QXmlAttributes& attrib);
-
- // IDocSimpleSect
- virtual Kind kind() const { return DocImpl::SimpleSect; }
- virtual Types type() const { return m_type; }
- virtual const IString *typeString() const { return &m_typeString; }
- virtual IDocTitle *title() const { return m_title; }
- virtual IDocPara *description() const { return m_paragraph; }
-
- private:
- IBaseHandler *m_parent;
- ParagraphHandler *m_paragraph;
- Types m_type;
- StringImpl m_typeString;
- TitleHandler *m_title;
-};
-
-//-----------------------------------------------------------------------------
-
-/* \brief Node representing an named item of a VariableList.
- *
- */
-class VariableListEntryHandler : public DocVariableListEntryImpl,
- public BaseHandler<VariableListEntryHandler>
-{
- public:
- virtual void startVarListEntry(const QXmlAttributes& attrib);
- virtual void endVarListEntry();
- virtual void startListItem(const QXmlAttributes& attrib);
- virtual void endListItem();
- virtual void startTerm(const QXmlAttributes& attrib);
- virtual void endTerm();
- virtual void startParagraph(const QXmlAttributes& attrib);
-
- VariableListEntryHandler(IBaseHandler *parent);
- virtual ~VariableListEntryHandler();
-
- // IDocVariableListEntry
- virtual Kind kind() const { return DocImpl::VariableListEntry; }
- virtual ILinkedTextIterator *term() const;
- virtual IDocPara *description() const { return m_description; }
-
- private:
- IBaseHandler* m_parent;
- QList<LinkedTextImpl> m_term;
- ParagraphHandler* m_description;
- LinkedTextHandler* m_linkedTextHandler;
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing a list of named items.
- *
- */
-// children: varlistentry, listitem
-class VariableListHandler : public DocVariableListImpl,
- public BaseHandler<VariableListHandler>
-{
- friend class VariableListIterator;
-
- public:
- virtual void startVariableList(const QXmlAttributes& attrib);
- virtual void endVariableList();
- virtual void startVarListEntry(const QXmlAttributes& attrib);
- virtual void startListItem(const QXmlAttributes& attrib);
-
- VariableListHandler(IBaseHandler *parent);
- virtual ~VariableListHandler();
-
- // IDocVariableList
- virtual Kind kind() const { return DocImpl::VariableList; }
- virtual IDocIterator *entries() const;
-
- private:
- IBaseHandler *m_parent;
- QList<VariableListEntryHandler> m_entries;
- VariableListEntryHandler *m_curEntry;
-};
-
-class VariableListIterator : public BaseIteratorVia<IDocIterator,IDoc,VariableListEntryHandler,DocImpl>
-{
- public:
- VariableListIterator(const VariableListHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,VariableListEntryHandler,DocImpl>(handler.m_entries) {}
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing a highlighted text fragment.
- *
- */
-// children: ref
-class HighlightHandler : public DocHighlightImpl, public BaseHandler<HighlightHandler>
-{
- friend class HighlightIterator;
- public:
- HighlightHandler(IBaseHandler *parent);
- virtual ~HighlightHandler();
- void startHighlight(const QXmlAttributes& attrib);
- void endHighlight();
- virtual void startRef(const QXmlAttributes&);
- virtual void startSpace(const QXmlAttributes&);
-
- // IDocHighlight
- virtual Kind kind() const { return DocImpl::Highlight; }
- virtual HighlightKind highlightKind() const { return m_hl; }
- virtual IDocIterator *codeElements() const;
-
- private:
- void addTextNode();
-
- IBaseHandler *m_parent;
- HighlightKind m_hl;
- QString m_hlString;
- QList<DocImpl> m_children;
-};
-
-class HighlightIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
-{
- public:
- HighlightIterator(const HighlightHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing a line of code.
- *
- */
-// children: linenumber, highlight, anchor, ref
-class CodeLineHandler : public DocCodeLineImpl, public BaseHandler<CodeLineHandler>
-{
- friend class CodeLineIterator;
- public:
-
- virtual void startCodeLine(const QXmlAttributes&);
- virtual void endCodeLine();
- virtual void startLineNumber(const QXmlAttributes&);
- virtual void endLineNumber();
- virtual void startHighlight(const QXmlAttributes&);
- virtual void startRef(const QXmlAttributes&);
-
- CodeLineHandler(IBaseHandler *parent);
- virtual ~CodeLineHandler();
-
- // IDocCodeLine
- virtual Kind kind() const { return DocImpl::CodeLine; }
- virtual int lineNumber() const { return m_lineNumber; }
- virtual const IString *refId() const { return &m_refId; }
- virtual IDocIterator *codeElements() const;
-
- private:
- void addTextNode();
-
- IBaseHandler *m_parent;
- int m_lineNumber;
- StringImpl m_refId;
- QList<DocImpl> m_children;
-};
-
-class CodeLineIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
-{
- public:
- CodeLineIterator(const CodeLineHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing a program listing
- *
- */
-// children: codeline, linenumber
-class ProgramListingHandler : public DocProgramListingImpl, public BaseHandler<ProgramListingHandler>
-{
- friend class ProgramListingIterator;
- public:
- virtual void startProgramListing(const QXmlAttributes& attrib);
- virtual void endProgramListing();
- virtual void startCodeLine(const QXmlAttributes&);
- virtual void startLineNumber(const QXmlAttributes&);
-
- ProgramListingHandler(IBaseHandler *parent);
- virtual ~ProgramListingHandler();
-
- // IDocProgramListing
- virtual Kind kind() const { return DocImpl::ProgramListing; }
- virtual IDocIterator *codeLines() const;
-
- private:
- IBaseHandler *m_parent;
- QList<CodeLineHandler> m_children;
- bool m_hasLineNumber;
-};
-
-//-----------------------------------------------------------------------------
-
-class ProgramListingIterator : public BaseIteratorVia<IDocIterator,IDoc,CodeLineHandler,DocImpl>
-{
- public:
- ProgramListingIterator(const ProgramListingHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,CodeLineHandler,DocImpl>(handler.m_children) {}
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing a formula.
- *
- */
-// children: -
-class FormulaHandler : public DocFormulaImpl, public BaseHandler<FormulaHandler>
-{
- public:
- FormulaHandler(IBaseHandler *parent);
- virtual ~FormulaHandler();
- void startFormula(const QXmlAttributes& attrib);
- void endFormula();
-
- // IDocFormula
- virtual Kind kind() const { return DocImpl::Formula; }
- virtual const IString *id() const { return &m_id; }
- virtual const IString *text() const { return &m_text; }
-
- private:
- IBaseHandler *m_parent;
- StringImpl m_id;
- StringImpl m_text;
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing an image.
- *
- */
-// children: -
-class ImageHandler : public DocImageImpl, public BaseHandler<ImageHandler>
-{
- public:
- ImageHandler(IBaseHandler *parent);
- virtual ~ImageHandler();
- void startImage(const QXmlAttributes& attrib);
- void endImage();
-
- // IDocImage
- virtual Kind kind() const { return DocImpl::Image; }
- virtual const IString *name() const { return &m_name; }
- virtual const IString *caption() const { return &m_caption; }
-
- private:
- IBaseHandler *m_parent;
- StringImpl m_name;
- StringImpl m_caption;
-};
-
-
-//-----------------------------------------------------------------------------
-/*! \brief Node representing an anchor.
- *
- */
-// children: -
-class AnchorHandler : public DocAnchorImpl, public BaseHandler<AnchorHandler>
-{
- public:
- AnchorHandler(IBaseHandler *parent);
- virtual ~AnchorHandler();
- void startAnchor(const QXmlAttributes& attrib);
- void endAnchor();
-
- // IDocAnchor
- virtual Kind kind() const { return DocImpl::Anchor; }
- virtual const IString *id() const { return &m_id; }
-
- private:
- IBaseHandler *m_parent;
- StringImpl m_id;
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing a dot file.
- *
- */
-// children: -
-class DotFileHandler : public DocDotFileImpl, public BaseHandler<DotFileHandler>
-{
- public:
- DotFileHandler(IBaseHandler *parent);
- virtual ~DotFileHandler();
- void startDotFile(const QXmlAttributes& attrib);
- void endDotFile();
-
- // IDocDotFile
- virtual Kind kind() const { return DocImpl::DotFile; }
- virtual const IString *name() const { return &m_name; }
- virtual const IString *caption() const { return &m_caption; }
-
- private:
- IBaseHandler *m_parent;
- StringImpl m_name;
- StringImpl m_caption;
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing an entry in the index.
- *
- */
-// children: -
-class IndexEntryHandler : public DocIndexEntryImpl, public BaseHandler<IndexEntryHandler>
-{
- public:
- IndexEntryHandler(IBaseHandler *parent);
- virtual ~IndexEntryHandler();
- void startIndexEntry(const QXmlAttributes& attrib);
- void endIndexEntry();
- void startPrimaryIE(const QXmlAttributes& attrib);
- void endPrimaryIE();
- void startSecondaryIE(const QXmlAttributes& attrib);
- void endSecondaryIE();
-
- // IDocIndexEntry
- virtual Kind kind() const { return DocImpl::IndexEntry; }
- virtual const IString *primary() const { return &m_primary; }
- virtual const IString *secondary() const { return &m_secondary; }
-
- private:
- IBaseHandler *m_parent;
- StringImpl m_primary;
- StringImpl m_secondary;
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing an entry in the table entry.
- *
- */
-// children: para
-class EntryHandler : public DocEntryImpl, public BaseHandler<EntryHandler>
-{
- friend class EntryIterator;
- public:
- EntryHandler(IBaseHandler *parent);
- virtual ~EntryHandler();
- void startEntry(const QXmlAttributes& attrib);
- void endEntry();
- void startParagraph(const QXmlAttributes& attrib);
-
- // IDocEntry
- virtual Kind kind() const { return DocImpl::Entry; }
- virtual IDocIterator *contents() const;
-
- private:
- IBaseHandler *m_parent;
- QList<DocImpl> m_children;
-};
-
-class EntryIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
-{
- public:
- EntryIterator(const EntryHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing an entry in the table row.
- *
- */
-// children: entry
-class RowHandler : public DocRowImpl, public BaseHandler<RowHandler>
-{
- friend class RowIterator;
- public:
- RowHandler(IBaseHandler *parent);
- virtual ~RowHandler();
- void startRow(const QXmlAttributes& attrib);
- void endRow();
- void startEntry(const QXmlAttributes& attrib);
-
- // IDocRow
- virtual Kind kind() const { return DocImpl::Row; }
- virtual IDocIterator *entries() const;
-
- private:
- IBaseHandler *m_parent;
- QList<EntryHandler> m_children;
-};
-
-class RowIterator : public BaseIteratorVia<IDocIterator,IDoc,EntryHandler,DocImpl>
-{
- public:
- RowIterator(const RowHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,EntryHandler,DocImpl>(handler.m_children) {}
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing an entry in the table.
- *
- */
-// children: row, caption
-class TableHandler : public DocTableImpl, public BaseHandler<TableHandler>
-{
- friend class TableIterator;
- public:
- TableHandler(IBaseHandler *parent);
- virtual ~TableHandler();
- void startTable(const QXmlAttributes& attrib);
- void endTable();
- void startRow(const QXmlAttributes& attrib);
- void startCaption(const QXmlAttributes& attrib);
- void endCaption();
-
- // IDocTable
- virtual Kind kind() const { return DocImpl::Table; }
- virtual IDocIterator *rows() const;
- virtual int numColumns() const { return m_numColumns; }
- virtual const IString *caption() const { return &m_caption; }
-
- private:
- IBaseHandler *m_parent;
- QList<RowHandler> m_children;
- int m_numColumns;
- StringImpl m_caption;
-};
-
-class TableIterator : public BaseIteratorVia<IDocIterator,IDoc,RowHandler,DocImpl>
-{
- public:
- TableIterator(const TableHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,RowHandler,DocImpl>(handler.m_children) {}
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing a copied piece of documentation.
- *
- */
-class CopyHandler : public DocCopyImpl, public BaseHandler<CopyHandler>
-{
- friend class CopyIterator;
- public:
- CopyHandler(IBaseHandler *parent);
- virtual ~CopyHandler();
- virtual void startCopy(const QXmlAttributes& attrib);
- virtual void endCopy();
- virtual void startParagraph(const QXmlAttributes& attrib);
-
- // IDocCopy
- virtual Kind kind() const { return DocImpl::Copy; }
- virtual IDocIterator *contents() const;
-
- private:
- IBaseHandler *m_parent;
- QList<DocImpl> m_children;
-};
-
-class CopyIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
-{
- public:
- CopyIterator(const CopyHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
-};
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing an preformatted section
- */
-class VerbatimHandler : public DocVerbatimImpl,
- public BaseHandler<VerbatimHandler>
-{
- public:
- VerbatimHandler(IBaseHandler *parent);
- virtual ~VerbatimHandler();
- void startVerbatim(const QXmlAttributes& attrib,Types type);
- void endVerbatim();
-
- // IDocVerbatim
- virtual Kind kind() const { return DocImpl::Verbatim; }
- virtual const IString *text() const { return &m_text; }
- virtual Types type() const { return m_type; }
-
- private:
- IBaseHandler *m_parent;
- StringImpl m_text;
- Types m_type;
-};
-
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing an special symbol.
- *
- */
-// children: -
-class SymbolHandler : public DocSymbolImpl, public BaseHandler<SymbolHandler>
-{
- public:
- SymbolHandler(IBaseHandler *parent,Types type);
- virtual ~SymbolHandler();
- void startSymbol(const QXmlAttributes& attrib);
- void endSymbol();
-
- // IDocSymbol
- virtual Kind kind() const { return DocImpl::Symbol; }
- virtual Types type() const { return m_type; }
- virtual const IString *typeString() const { return &m_typeString; }
- virtual char letter() const { return m_letter; }
-
- private:
- IBaseHandler *m_parent;
- char m_letter;
- Types m_type;
- StringImpl m_typeString;
-};
-
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing a section.
- *
- */
-// children: title, para, sect(n+1)
-class DocSectionHandler : public DocSectionImpl, public BaseHandler<DocSectionHandler>
-{
- friend class DocSectionParaIterator;
- friend class DocSectionSubIterator;
- public:
- DocSectionHandler(IBaseHandler *parent,int level);
- virtual ~DocSectionHandler();
- virtual void startDocSection(const QXmlAttributes& attrib);
- virtual void endDocSection();
- virtual void startTitle(const QXmlAttributes& attrib);
- virtual void startSubSection(const QXmlAttributes& attrib);
- virtual void startParagraph(const QXmlAttributes& attrib);
- virtual void startInternal(const QXmlAttributes& attrib);
-
- // IDocSection
- virtual Kind kind() const { return DocImpl::Section; }
- virtual const IString *id() const { return &m_id; }
- virtual int level() const { return m_level; }
- virtual IDocTitle *title() const { return m_title; }
- virtual IDocIterator *paragraphs() const;
- virtual IDocIterator *subSections() const;
- virtual IDocInternal *internal() const;
-
- private:
- IBaseHandler *m_parent;
- QList<DocImpl> m_paragraphs;
- QList<DocImpl> m_subsections;
- DocInternalHandler *m_internal;
- StringImpl m_id;
- int m_level;
- TitleHandler *m_title;
-};
-
-class DocSectionParaIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
-{
- public:
- DocSectionParaIterator(const DocSectionHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_paragraphs) {}
-};
-
-class DocSectionSubIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
-{
- public:
- DocSectionSubIterator(const DocSectionHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_subsections) {}
-};
-
-//-----------------------------------------------------------------------------
-
-class DocInternalHandler : public DocInternalImpl, public BaseHandler<DocInternalHandler>
-{
- public:
- friend class DocInternalParaIterator;
- friend class DocInternalSubIterator;
- DocInternalHandler(IBaseHandler *parent,int level);
- virtual ~DocInternalHandler();
- virtual void startInternal(const QXmlAttributes& attrib);
- virtual void endInternal();
- virtual void startSubSection(const QXmlAttributes& attrib);
- virtual void startParagraph(const QXmlAttributes& attrib);
-
- // IDocInternal
- virtual Kind kind() const { return DocImpl::Internal; }
- virtual IDocIterator *paragraphs() const;
- virtual IDocIterator *subSections() const;
-
- private:
- IBaseHandler *m_parent;
- QList<DocImpl> m_paragraphs;
- QList<DocImpl> m_subsections;
- int m_level;
-};
-
-class DocInternalParaIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
-{
- public:
- DocInternalParaIterator(const DocInternalHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_paragraphs) {}
-};
-
-class DocInternalSubIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
-{
- public:
- DocInternalSubIterator(const DocInternalHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_subsections) {}
-};
-
-
-//-----------------------------------------------------------------------------
-
-/*! \brief Node representing a documentation block.
- *
- */
-// children: para, title, sect1, internal
-class DocHandler : public DocRootImpl, public BaseHandler<DocHandler>
-{
- friend class DocIterator;
- public:
- virtual void startDoc(const QXmlAttributes& attrib);
- virtual void endDoc();
- virtual void startParagraph(const QXmlAttributes& attrib);
- virtual void startSect1(const QXmlAttributes& attrib);
- virtual void startTitle(const QXmlAttributes& attrib);
- virtual void startInternal(const QXmlAttributes& attrib);
-
- DocHandler(IBaseHandler *parent);
- virtual ~DocHandler();
-
- // IDocRoot
- virtual Kind kind() const { return DocImpl::Root; }
- virtual IDocIterator *contents() const;
- virtual IDocInternal *internal() const;
-
- private:
- IBaseHandler *m_parent;
- QList<DocImpl> m_children;
- DocInternalHandler *m_internal;
-};
-
-class DocIterator : public BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>
-{
- public:
- DocIterator(const DocHandler &handler) :
- BaseIteratorVia<IDocIterator,IDoc,DocImpl,DocImpl>(handler.m_children) {}
-};
-
-//-----------------------------------------------------------------------------
-
-void dochandler_init();
-void dochandler_exit();
-
-#endif
diff --git a/addon/doxmlparser/src/graphhandler.cpp b/addon/doxmlparser/src/graphhandler.cpp
deleted file mode 100644
index de30923..0000000
--- a/addon/doxmlparser/src/graphhandler.cpp
+++ /dev/null
@@ -1,216 +0,0 @@
-#include "graphhandler.h"
-
-class EdgeRelationMapper
-{
- public:
- EdgeRelationMapper()
- {
- m_map.insert("public-inheritance", IChildNode::PublicInheritance);
- m_map.insert("protected-inheritance", IChildNode::ProtectedInheritance);
- m_map.insert("private-inheritance", IChildNode::PrivateInheritance);
- m_map.insert("usage", IChildNode::Usage);
- m_map.insert("template-instance", IChildNode::TemplateInstance);
- }
- IChildNode::NodeRelation stringToNodeRelation(const QString &nrStr)
- {
- return m_map[nrStr];
- }
- private:
- QMap<QString,IChildNode::NodeRelation> m_map;
-};
-
-static EdgeRelationMapper *s_edgeRelationMapper;
-
-void graphhandler_init()
-{
- s_edgeRelationMapper = new EdgeRelationMapper;
-}
-
-void graphhandler_exit()
-{
- delete s_edgeRelationMapper;
-}
-
-//------------------------------------------------------------------------
-
-GraphHandler::GraphHandler(IBaseHandler *parent,const char *endTag)
- : m_parent(parent)
-{
- addEndHandler(endTag,this,&GraphHandler::endGraph);
- addStartHandler("node",this,&GraphHandler::startNode);
- m_nodes.setAutoDelete(TRUE);
- m_nodeDict = new QDict<NodeHandler>(1009);
-}
-
-GraphHandler::~GraphHandler()
-{
- delete m_nodeDict;
-}
-
-void GraphHandler::startGraph(const QXmlAttributes &)
-{
- debug(2,"startGraph\n");
- m_parent->setDelegate(this);
-}
-
-void GraphHandler::endGraph()
-{
- debug(2,"endGraph\n");
- m_parent->setDelegate(0);
-}
-
-void GraphHandler::startNode(const QXmlAttributes &attrib)
-{
- NodeHandler *n = new NodeHandler(this);
- n->startNode(attrib);
- m_nodes.append(n);
- m_nodeDict->insert(attrib.value("id").utf8(),n);
-}
-
-INodeIterator *GraphHandler::nodes() const
-{
- return new NodeIterator(*this);
-}
-
-NodeHandler *GraphHandler::getNodeById(const QString &id) const
-{
- return m_nodeDict->find(id.utf8());
-}
-
-//------------------------------------------------------------------------
-
-NodeHandler::NodeHandler(GraphHandler *gh)
- : m_parent(gh), m_graph(gh)
-{
- addEndHandler("node",this,&NodeHandler::endNode);
- addStartHandler("link",this,&NodeHandler::startLink);
- addEndHandler("link",this,&NodeHandler::endLink);
- addStartHandler("label",this,&NodeHandler::startLabel);
- addEndHandler("label",this,&NodeHandler::endLabel);
- addStartHandler("childnode",this,&NodeHandler::startChildNode);
- m_children.setAutoDelete(TRUE);
-}
-
-NodeHandler::~NodeHandler()
-{
-}
-
-void NodeHandler::startNode(const QXmlAttributes &attrib)
-{
- debug(2,"startNode\n");
- m_parent->setDelegate(this);
- m_id = attrib.value("id");
-}
-
-void NodeHandler::endNode()
-{
- debug(2,"endNode\n");
- m_parent->setDelegate(0);
-}
-
-void NodeHandler::startLink(const QXmlAttributes &attrib)
-{
- m_link = attrib.value("refid");
-}
-
-void NodeHandler::endLink()
-{
-}
-
-void NodeHandler::startLabel(const QXmlAttributes &/*attrib*/)
-{
- m_curString="";
-}
-
-void NodeHandler::endLabel()
-{
- m_label = m_curString;
-}
-
-void NodeHandler::startChildNode(const QXmlAttributes &attrib)
-{
- ChildNodeHandler *cnh = new ChildNodeHandler(this,m_graph);
- cnh->startChildNode(attrib);
- m_children.append(cnh);
-}
-
-IChildNodeIterator *NodeHandler::children() const
-{
- return new ChildNodeIterator(*this);
-}
-
-//------------------------------------------------------------------------
-
-ChildNodeHandler::ChildNodeHandler(IBaseHandler *parent,GraphHandler *gh)
- : m_parent(parent), m_graph(gh)
-{
- addEndHandler("childnode",this,&ChildNodeHandler::endChildNode);
- addStartHandler("edgelabel",this,&ChildNodeHandler::startEdgeLabel);
- m_edgeLabels.setAutoDelete(TRUE);
-}
-
-ChildNodeHandler::~ChildNodeHandler()
-{
-}
-
-void ChildNodeHandler::startChildNode(const QXmlAttributes &attrib)
-{
- debug(2,"startChildNode\n");
- m_id = attrib.value("refid");
- m_relationString = attrib.value("relation");
- m_relation = s_edgeRelationMapper->stringToNodeRelation(m_relationString);
- m_parent->setDelegate(this);
-}
-
-void ChildNodeHandler::endChildNode()
-{
- debug(2,"endChildNode\n");
- m_parent->setDelegate(0);
-}
-
-
-void ChildNodeHandler::startEdgeLabel(const QXmlAttributes &attrib)
-{
- EdgeLabelHandler *elh = new EdgeLabelHandler(this);
- elh->startEdgeLabel(attrib);
- m_edgeLabels.append(elh);
-}
-
-IEdgeLabelIterator *ChildNodeHandler::edgeLabels() const
-{
- return new EdgeLabelIterator(*this);
-}
-
-INode *ChildNodeHandler::node() const
-{
- return m_graph->getNodeById(m_id);
-}
-
-//-----------------------------------------------------------------------
-
-EdgeLabelHandler::EdgeLabelHandler(IBaseHandler *parent)
- : m_parent(parent)
-{
- addEndHandler("edgelabel",this,&EdgeLabelHandler::endEdgeLabel);
-}
-
-EdgeLabelHandler::~EdgeLabelHandler()
-{
-}
-
-void EdgeLabelHandler::startEdgeLabel(const QXmlAttributes &)
-{
- m_parent->setDelegate(this);
- m_curString="";
-}
-
-void EdgeLabelHandler::endEdgeLabel()
-{
- m_label=m_curString;
- m_parent->setDelegate(0);
-}
-
-
-
-
-
diff --git a/addon/doxmlparser/src/graphhandler.h b/addon/doxmlparser/src/graphhandler.h
deleted file mode 100644
index 783b9f2..0000000
--- a/addon/doxmlparser/src/graphhandler.h
+++ /dev/null
@@ -1,154 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-
-#ifndef _GRAPHHANDLER_H
-#define _GRAPHHANDLER_H
-
-#include "stringimpl.h"
-#include "doxmlintf.h"
-#include "basehandler.h"
-#include "baseiterator.h"
-
-class NodeHandler;
-class ChildNodeHandler;
-class EdgeLabelHandler;
-
-class GraphHandler : public IGraph, public BaseHandler<GraphHandler>
-{
- friend class NodeIterator;
- public:
- GraphHandler(IBaseHandler *parent,const char *endTag);
- virtual ~GraphHandler();
-
- void startGraph(const QXmlAttributes &attrib);
- void endGraph();
- void startNode(const QXmlAttributes &attrib);
- NodeHandler *getNodeById(const QString &id) const;
-
- // IGraph
- virtual INodeIterator *nodes() const;
-
- private:
- IBaseHandler *m_parent;
- QList<NodeHandler> m_nodes;
- QDict<NodeHandler> *m_nodeDict;
-};
-
-//----------------------------------------------------------------------
-
-class NodeHandler : public INode, public BaseHandler<NodeHandler>
-{
- friend class ChildNodeIterator;
- public:
- NodeHandler(GraphHandler *gh);
- virtual ~NodeHandler();
-
- void startNode(const QXmlAttributes &attrib);
- void endNode();
- void startLabel(const QXmlAttributes &attrib);
- void endLabel();
- void startLink(const QXmlAttributes &attrib);
- void endLink();
- void startChildNode(const QXmlAttributes &attrib);
-
- // INode
- virtual const IString *id() const { return &m_id; }
- virtual const IString *label() const { return &m_label; }
- virtual const IString *linkId() const { return &m_link; }
- virtual IChildNodeIterator *children() const;
-
- private:
- IBaseHandler *m_parent;
- StringImpl m_id;
- StringImpl m_label;
- StringImpl m_link;
- QList<ChildNodeHandler> m_children;
- GraphHandler *m_graph;
-};
-
-class NodeIterator : public BaseIterator<INodeIterator,INode,NodeHandler>
-{
- public:
- NodeIterator(const GraphHandler &handler) :
- BaseIterator<INodeIterator,INode,NodeHandler>(handler.m_nodes) {}
-};
-
-//----------------------------------------------------------------------
-
-class ChildNodeHandler : public IChildNode, public BaseHandler<ChildNodeHandler>
-{
- friend class EdgeLabelIterator;
- public:
- ChildNodeHandler(IBaseHandler *parent,GraphHandler *gh);
- virtual ~ChildNodeHandler();
-
- void startChildNode(const QXmlAttributes &attrib);
- void endChildNode();
- void startEdgeLabel(const QXmlAttributes &attrib);
-
- // IChildNode
- virtual INode *node() const;
- virtual NodeRelation relation() const { return m_relation; }
- virtual const IString * relationString() const { return &m_relationString; }
- virtual IEdgeLabelIterator *edgeLabels() const;
-
- private:
- IBaseHandler *m_parent;
- QString m_id;
- NodeRelation m_relation;
- StringImpl m_relationString;
- QList<EdgeLabelHandler> m_edgeLabels;
- GraphHandler *m_graph;
-};
-
-class ChildNodeIterator : public BaseIterator<IChildNodeIterator,IChildNode,ChildNodeHandler>
-{
- public:
- ChildNodeIterator(const NodeHandler &handler) :
- BaseIterator<IChildNodeIterator,IChildNode,ChildNodeHandler>(handler.m_children) {}
-};
-
-//----------------------------------------------------------------------
-
-class EdgeLabelHandler : public IEdgeLabel, public BaseHandler<EdgeLabelHandler>
-{
- friend class EdgeLabelIterator;
- public:
- EdgeLabelHandler(IBaseHandler *parent);
- virtual ~EdgeLabelHandler();
-
- void startEdgeLabel(const QXmlAttributes &attrib);
- void endEdgeLabel();
-
- // IEdgeLabel
- virtual const IString *label() const { return &m_label; }
-
- private:
- IBaseHandler *m_parent;
- StringImpl m_label;
-};
-
-class EdgeLabelIterator : public BaseIterator<IEdgeLabelIterator,IEdgeLabel,EdgeLabelHandler>
-{
- public:
- EdgeLabelIterator(const ChildNodeHandler &handler) :
- BaseIterator<IEdgeLabelIterator,IEdgeLabel,EdgeLabelHandler>(handler.m_edgeLabels) {}
-};
-
-void graphhandler_init();
-void graphhandler_exit();
-
-#endif
-
diff --git a/addon/doxmlparser/src/linkedtexthandler.cpp b/addon/doxmlparser/src/linkedtexthandler.cpp
deleted file mode 100644
index 140a48b..0000000
--- a/addon/doxmlparser/src/linkedtexthandler.cpp
+++ /dev/null
@@ -1,133 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-#include "linkedtexthandler.h"
-#include "debug.h"
-#include <doxmlintf.h>
-#include "stringimpl.h"
-
-class LT_Text : public LinkedTextImpl, public ILT_Text
-{
- public:
- LT_Text(const QString &text) : m_text(text) {}
- virtual ~LT_Text() {}
-
- // ILT_Text
- virtual const IString *text() const { return &m_text; }
- virtual Kind kind() const { return LinkedTextImpl::Kind_Text; }
- private:
- StringImpl m_text;
-};
-
-class LT_Ref : public LinkedTextImpl, public ILT_Ref
-{
- public:
- LT_Ref() {}
- virtual ~LT_Ref() {}
- void setRefId(const QString &refId) { m_refId=refId; }
- void setText(const QString &text) { m_text=text; }
- void setExtId(const QString &extId) { m_extId=extId; }
- void setTargetKind(TargetKind k) { m_targetKind=k; }
-
- // ILT_Ref
- virtual const IString *text() const { return &m_text; }
- virtual const IString * id() const { return &m_refId; }
- virtual TargetKind targetKind() const { return m_targetKind; }
- virtual const IString *external() const { return &m_extId; }
- virtual Kind kind() const { return LinkedTextImpl::Kind_Ref; }
-
- private:
- StringImpl m_refId;
- StringImpl m_extId;
- StringImpl m_text;
- TargetKind m_targetKind = TargetKind::Member;
-};
-
-LinkedTextHandler::LinkedTextHandler(IBaseHandler *parent,
- QList<LinkedTextImpl> &children
- )
- : m_parent(parent), m_children(children)
-{
- addStartHandler("ref",this,&LinkedTextHandler::startRef);
- addEndHandler("ref",this,&LinkedTextHandler::endRef);
- m_children.setAutoDelete(TRUE);
- m_ref=0;
-}
-
-LinkedTextHandler::~LinkedTextHandler()
-{
-}
-
-void LinkedTextHandler::start(const char *endTag)
-{
- addEndHandler(endTag,this,&LinkedTextHandler::end);
- m_parent->setDelegate(this);
- m_curString="";
-}
-
-void LinkedTextHandler::end()
-{
- if (!m_curString.isEmpty())
- {
- m_children.append(new LT_Text(m_curString));
- debug(2,"LinkedTextHandler: add text '%s'\n",m_curString.data());
- m_curString="";
- }
- m_parent->setDelegate(0);
-}
-
-void LinkedTextHandler::startRef(const QXmlAttributes& attrib)
-{
- if (!m_curString.isEmpty())
- {
- m_children.append(new LT_Text(m_curString));
- debug(2,"LinkedTextHandler: add text '%s'\n",m_curString.data());
- m_curString="";
- }
- ASSERT(m_ref==0);
- m_ref = new LT_Ref;
- m_ref->setRefId(attrib.value("refid"));
- m_ref->setExtId(attrib.value("external"));
- ASSERT(attrib.value("kindref")=="compound" || attrib.value("kindref")=="member");
- m_ref->setTargetKind(attrib.value("kindref")=="compound" ? ILT_Ref::Compound : ILT_Ref::Member);
-}
-
-void LinkedTextHandler::endRef()
-{
- m_ref->setText(m_curString);
- m_children.append(m_ref);
- debug(2,"LinkedTextHandler: add ref '%s'\n",m_ref->text()->latin1());
- m_ref=0;
-}
-
-QString LinkedTextHandler::toString(const QList<LinkedTextImpl> &list)
-{
- QListIterator<LinkedTextImpl> li(list);
- QString result;
- LinkedTextImpl *lt;
- for (li.toFirst();(lt=li.current());++li)
- {
- switch(lt->kind())
- {
- case ILinkedText::Kind_Text:
- result+=dynamic_cast<ILT_Text*>(lt)->text()->latin1();
- break;
- case ILinkedText::Kind_Ref:
- result+=dynamic_cast<ILT_Ref *>(lt)->text()->latin1();
- break;
- }
- }
- return result;
-}
-
diff --git a/addon/doxmlparser/src/linkedtexthandler.h b/addon/doxmlparser/src/linkedtexthandler.h
deleted file mode 100644
index 816726e..0000000
--- a/addon/doxmlparser/src/linkedtexthandler.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-#ifndef LINKEDTEXTHANDLER_H
-#define LINKEDTEXTHANDLER_H
-
-#include "baseiterator.h"
-#include "basehandler.h"
-
-class LT_Ref;
-class LinkedTextImpl : public ILinkedText
-{
- public:
- virtual ~LinkedTextImpl() {}
-};
-
-class LinkedTextHandler : public BaseHandler<LinkedTextHandler>
-{
- public:
- LinkedTextHandler(IBaseHandler *parent,QList<LinkedTextImpl> &children);
- virtual ~LinkedTextHandler();
- virtual void start(const char *endTag);
- virtual void end();
- virtual void startRef(const QXmlAttributes& attrib);
- virtual void endRef();
- static QString toString(const QList<LinkedTextImpl> &list);
-
- // ILinkedText
-
- private:
- IBaseHandler *m_parent;
- QList<LinkedTextImpl> &m_children;
- LT_Ref *m_ref;
-};
-
-class LinkedTextIterator : public BaseIterator<ILinkedTextIterator,ILinkedText,LinkedTextImpl>
-{
- public:
- LinkedTextIterator(const QList<LinkedTextImpl> &list) :
- BaseIterator<ILinkedTextIterator,ILinkedText,LinkedTextImpl>(list) {}
-};
-
-#endif
diff --git a/addon/doxmlparser/src/loamhandler.cpp b/addon/doxmlparser/src/loamhandler.cpp
deleted file mode 100644
index 52aa576..0000000
--- a/addon/doxmlparser/src/loamhandler.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-#include "loamhandler.h"
-#include "memberhandler.h"
-#include "linkedtexthandler.h"
-#include "paramhandler.h"
-
-
-ListOfAllMembersHandler::ListOfAllMembersHandler(IBaseHandler *parent) : m_parent(parent)
-{
- m_members.setAutoDelete(TRUE);
-
- addStartHandler("member",this,&ListOfAllMembersHandler::startMember);
- addStartHandler("name",this,&ListOfAllMembersHandler::startName);
- addEndHandler("name",this,&ListOfAllMembersHandler::endName);
- addStartHandler("scope",this,&ListOfAllMembersHandler::startScope);
- addEndHandler("scope",this,&ListOfAllMembersHandler::endScope);
-
- addEndHandler("listofallmembers",this,&ListOfAllMembersHandler::endListOfAllMembers);
-}
-
-void ListOfAllMembersHandler::initialize(MainHandler *mh)
-{
- QListIterator<MemberReference> mli(m_members);
- MemberReference *mr;
- for (;(mr=mli.current());++mli)
- {
- mr->initialize(mh);
- }
-}
-
-void ListOfAllMembersHandler::startMember(const QXmlAttributes& attrib)
-{
- MemberReference *mr = new MemberReference;
- mr->m_memId = attrib.value("refid");
- mr->m_virtualness = attrib.value("virt");
- mr->m_protection = attrib.value("prot");
- mr->m_ambiguityScope = attrib.value("ambiguityscope");
- m_members.append(new MemberReference);
-}
-
-void ListOfAllMembersHandler::startName(const QXmlAttributes&)
-{
- m_curString="";
-}
-
-void ListOfAllMembersHandler::endName()
-{
- ASSERT(m_members.getLast());
- m_members.getLast()->m_name = m_curString;
-}
-
-void ListOfAllMembersHandler::startScope(const QXmlAttributes&)
-{
- m_curString="";
-}
-
-void ListOfAllMembersHandler::endScope()
-{
- ASSERT(m_members.getLast());
- m_members.getLast()->m_scope = m_curString;
-}
-
-void ListOfAllMembersHandler::startListOfAllMembers(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
- debug(2,"listofallmembers start\n");
-}
-
-void ListOfAllMembersHandler::endListOfAllMembers()
-{
- m_parent->setDelegate(0);
- debug(2,"listofallmembers end\n");
-}
-
-IMemberReferenceIterator *ListOfAllMembersHandler::members() const
-{
- return new MemberReferenceIterator(m_members);
-}
diff --git a/addon/doxmlparser/src/loamhandler.h b/addon/doxmlparser/src/loamhandler.h
deleted file mode 100644
index 48a9952..0000000
--- a/addon/doxmlparser/src/loamhandler.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-
-#ifndef _LOAMHANDLER_H
-#define _LOAMHANDLER_H
-
-#include <qstring.h>
-#include <qlist.h>
-#include <doxmlintf.h>
-
-#include "basehandler.h"
-
-class MainHandler;
-class MemberReference;
-
-class ListOfAllMembersHandler : public BaseHandler<ListOfAllMembersHandler>
-{
- public:
- virtual void startMember(const QXmlAttributes& attrib);
- virtual void startName(const QXmlAttributes& attrib);
- virtual void endName();
- virtual void startScope(const QXmlAttributes& attrib);
- virtual void endScope();
- virtual void startListOfAllMembers(const QXmlAttributes& attrib);
- virtual void endListOfAllMembers();
-
- ListOfAllMembersHandler(IBaseHandler *parent);
- virtual ~ListOfAllMembersHandler() {}
-
- void initialize(MainHandler *mh);
-
- virtual IMemberReferenceIterator *members() const;
-
- protected:
- IBaseHandler *m_parent;
- QList<MemberReference> m_members;
-};
-
-#endif
-
diff --git a/addon/doxmlparser/src/mainhandler.cpp b/addon/doxmlparser/src/mainhandler.cpp
deleted file mode 100644
index a1ba216..0000000
--- a/addon/doxmlparser/src/mainhandler.cpp
+++ /dev/null
@@ -1,301 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-
-#include <qxml.h>
-#include "mainhandler.h"
-#include "compoundhandler.h"
-#include "sectionhandler.h"
-#include "graphhandler.h"
-#include "dochandler.h"
-#include "memberhandler.h"
-#include "linkedtexthandler.h"
-#include "paramhandler.h"
-#include "debug.h"
-
-
-class ErrorHandler : public QXmlErrorHandler
-{
- public:
- virtual ~ErrorHandler() {}
- bool warning( const QXmlParseException & )
- {
- return FALSE;
- }
- bool error( const QXmlParseException & )
- {
- return FALSE;
- }
- bool fatalError( const QXmlParseException &exception )
- {
- debug(1,"Fatal error at line %d column %d: %s\n",
- exception.lineNumber(),exception.columnNumber(),
- exception.message().data());
- return FALSE;
- }
- QString errorString() { return ""; }
-
- private:
- QString errorMsg;
-};
-
-//--------------------------------------------------------------------------
-
-class CompoundEntryIterator : public ICompoundIterator,
- public QListIterator<CompoundEntry>
-{
- public:
- CompoundEntryIterator(const MainHandler *m,const QList<CompoundEntry> &list) :
- QListIterator<CompoundEntry>(list), m_mainHandler(m) {}
- virtual ~CompoundEntryIterator() {}
-
- virtual void toFirst()
- {
- QListIterator<CompoundEntry>::toFirst();
- }
- virtual void toLast()
- {
- QListIterator<CompoundEntry>::toLast();
- }
- virtual void toNext()
- {
- QListIterator<CompoundEntry>::operator++();
- }
- virtual void toPrev()
- {
- QListIterator<CompoundEntry>::operator--();
- }
- virtual ICompound *current() const
- {
- CompoundEntry *ch = QListIterator<CompoundEntry>::current();
- return ch ? m_mainHandler->compoundById(ch->id.utf8()) : 0;
- }
- virtual void release()
- { delete this; }
-
- private:
- const MainHandler *m_mainHandler;
-};
-
-//--------------------------------------------------------------------------
-
-MainHandler::MainHandler() : m_compoundDict(2999), m_compoundNameDict(2999),
- m_memberDict(12251), m_memberNameDict(12251),
- m_compoundsLoaded(1009)
-{
- m_compounds.setAutoDelete(TRUE);
- m_memberNameDict.setAutoDelete(TRUE);
- addStartHandler("doxygenindex");
- addEndHandler("doxygenindex");
- addStartHandler("compound",this,&MainHandler::startCompound);
- addEndHandler("compound");
- addStartHandler("member",this,&MainHandler::startMember);
- addEndHandler("member",this,&MainHandler::endMember);
- addStartHandler("name",this,&MainHandler::startName);
- addEndHandler("name",this,&MainHandler::endName);
- m_curCompound = 0;
- m_insideMember = FALSE;
-}
-
-MainHandler::~MainHandler()
-{
- debug(2,"MainHandler::~MainHandler()\n");
-}
-
-void MainHandler::startCompound(const QXmlAttributes& attrib)
-{
- m_curCompound = new CompoundEntry(257);
- m_curCompound->id = attrib.value("refid");
- m_compounds.append(m_curCompound);
- m_compoundDict.insert(m_curCompound->id.utf8(),m_curCompound);
-}
-
-void MainHandler::startName(const QXmlAttributes& /*attrib*/)
-{
- m_curString = "";
-}
-
-void MainHandler::endName()
-{
- if (m_insideMember)
- {
- m_curMember->name = m_curString;
- }
- else
- {
- m_curCompound->name = m_curString;
- m_compoundNameDict.insert(m_curString.utf8(),m_curCompound);
- }
-}
-
-void MainHandler::startMember(const QXmlAttributes& attrib)
-{
- m_insideMember = TRUE;
- m_curMember = new MemberEntry;
- m_curMember->id = attrib.value("refid");
- m_curMember->compound = m_curCompound;
- m_memberDict.insert(m_curMember->id.utf8(),m_curMember);
-}
-
-void MainHandler::endMember()
-{
- m_curCompound->memberDict.insert(m_curMember->name.utf8(),m_curMember);
- QList<CompoundEntry> *cel=0;
- if ((cel=m_memberNameDict.find(m_curMember->name.utf8()))==0)
- {
- cel = new QList<CompoundEntry>;
- m_memberNameDict.insert(m_curMember->name.utf8(),cel);
- }
- cel->append(m_curCompound);
- m_insideMember = FALSE;
-}
-
-void MainHandler::setDebugLevel(int level)
-{
- ::setDebugLevel(level);
-}
-
-void MainHandler::dump()
-{
- QListIterator<CompoundEntry> cli(m_compounds);
- CompoundEntry *ce;
- for (cli.toFirst();(ce=cli.current());++cli)
- {
- debug(2,"compound id='%s' name='%s'\n",ce->id.data(),ce->name.data());
- QDictIterator<MemberEntry> mdi(ce->memberDict);
- MemberEntry *me;
- for (mdi.toFirst();(me=mdi.current());++mdi)
- {
- debug(2," member id='%s' name='%s'\n",me->id.data(),me->name.data());
- }
- }
-}
-
-bool MainHandler::readXMLDir(const char * xmlDirName)
-{
- m_xmlDirName = xmlDirName;
- QString xmlFileName=m_xmlDirName+"/index.xml";
- QFile xmlFile(xmlFileName);
- //printf("Trying %s xmlFile.exists()=%d isReadable()=%d\n",
- // xmlFileName.data(),xmlFile.exists(),xmlFile.isReadable());
- if (xmlFile.exists())
- {
- ErrorHandler errorHandler;
- QXmlInputSource source( xmlFile );
- QXmlSimpleReader reader;
- reader.setContentHandler( this );
- reader.setErrorHandler( &errorHandler );
- reader.parse( source );
- dump();
- return TRUE;
- }
- return FALSE;
-}
-
-ICompoundIterator *MainHandler::compounds() const
-{
- return new CompoundEntryIterator(this,m_compounds);
-}
-
-ICompound *MainHandler::compoundById(const char *id) const
-{
- QString ids = id;
- if (ids.isEmpty()) return 0;
- CompoundHandler *ch = m_compoundsLoaded[ids.utf8()];
- if (ch) // compound already in memory
- {
- ch->addref(); // returning alias -> increase reference counter
- return ch->toICompound();
- }
- CompoundEntry *ce = m_compoundDict.find(ids.utf8());
- if (ce==0) return 0; // id not found
- // create and load a new compound
- ch = new CompoundHandler(m_xmlDirName);
- if (!ch->parseXML(id))
- {
- // compound could not be initialized.
- delete ch;
- return 0;
- }
-
- // we disregard the constness here, because the object stays conceptually
- // unchanged.
- MainHandler *that = (MainHandler *)this;
- ch->initialize(that);
- //printf("loading compound %s in memory\n",id);
- that->m_compoundsLoaded.insert(id,ch);
- return ch->toICompound();
-}
-
-void MainHandler::unloadCompound(CompoundHandler *ch)
-{
- //printf("unloading compound %s from memory\n",ch->id()->latin1());
- bool result = m_compoundsLoaded.remove(ch->id()->latin1());
- if (!result) debug(1,"Failed to unload component!\n");
-}
-
-ICompound *MainHandler::compoundByName(const char *name) const
-{
- QString nameStr = name;
- if (nameStr.isEmpty()) return 0;
- CompoundEntry *ce = m_compoundNameDict[name];
- if (ce==0) return 0; // name not found
- return compoundById(ce->id.utf8());
-}
-
-ICompound *MainHandler::memberById(const char *id) const
-{
- QString ids = id;
- if (ids.isEmpty()) return 0;
- MemberEntry *me = m_memberDict[id];
- if (me==0) return 0; // id not found
- return compoundById(me->compound->id.utf8());
-}
-
-ICompoundIterator *MainHandler::memberByName(const char *name) const
-{
- QString nameStr = name;
- if (nameStr.isEmpty()) return 0;
- QList<CompoundEntry> *cel = m_memberNameDict[name];
- if (cel==0) return 0; // name not found
- return new CompoundEntryIterator(this,*cel);
-}
-
-IDoxygen *createObjectModel()
-{
- compoundhandler_init();
- sectionhandler_init();
- memberhandler_init();
- dochandler_init();
- graphhandler_init();
- return new MainHandler;
-}
-
-void MainHandler::release()
-{
- //printf("MainHandler::release()\n");
- QDictIterator<CompoundHandler> chi(m_compoundsLoaded);
- CompoundHandler *ch;
- for (chi.toFirst();(ch=chi.current());++chi)
- {
- debug(1,"Compound %s not released\n",ch->name()->latin1());
- }
- graphhandler_exit();
- dochandler_exit();
- memberhandler_exit();
- sectionhandler_exit();
- compoundhandler_exit();
- delete this;
-}
-
diff --git a/addon/doxmlparser/src/mainhandler.h b/addon/doxmlparser/src/mainhandler.h
deleted file mode 100644
index 21e9b0a..0000000
--- a/addon/doxmlparser/src/mainhandler.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-
-#ifndef _MAINHANDLER_H
-#define _MAINHANDLER_H
-
-#include <qlist.h>
-
-#include <doxmlintf.h>
-#include "basehandler.h"
-
-class CompoundHandler;
-struct CompoundEntry;
-
-struct IndexEntry
-{
- QString id;
- QString name;
-};
-
-struct MemberEntry : public IndexEntry
-{
- CompoundEntry *compound;
-};
-
-struct CompoundEntry : public IndexEntry
-{
- CompoundEntry(int size) : memberDict(size)
- { memberDict.setAutoDelete(TRUE); }
- QDict<MemberEntry> memberDict;
-};
-
-class MainHandler : public IDoxygen, public BaseHandler<MainHandler>
-{
- public:
- virtual void startCompound(const QXmlAttributes& attrib);
- virtual void startMember(const QXmlAttributes& attrib);
- virtual void endMember();
- virtual void startName(const QXmlAttributes& attrib);
- virtual void endName();
- MainHandler();
- virtual ~MainHandler();
-
- // IDoxygen
- ICompoundIterator *compounds() const;
- ICompound *compoundById(const char *id) const;
- virtual ICompound *compoundByName(const char *name) const;
- virtual ICompound *memberById(const char *id) const;
- virtual ICompoundIterator *memberByName(const char *name) const;
-
- virtual void release();
- void setDebugLevel(int level);
- bool readXMLDir(const char *dirName);
- void dump();
- void unloadCompound(CompoundHandler *ch);
-
- private:
- CompoundEntry *m_curCompound;
- MemberEntry *m_curMember;
- QList<CompoundEntry> m_compounds;
- QDict<CompoundEntry> m_compoundDict;
- QDict<CompoundEntry> m_compoundNameDict;
- QDict<MemberEntry> m_memberDict;
- QDict<QList<CompoundEntry> > m_memberNameDict;
- QString m_xmlDirName;
- QDict<CompoundHandler> m_compoundsLoaded;
- bool m_insideMember;
-};
-
-#endif
diff --git a/addon/doxmlparser/src/memberhandler.cpp b/addon/doxmlparser/src/memberhandler.cpp
deleted file mode 100644
index df8c04f..0000000
--- a/addon/doxmlparser/src/memberhandler.cpp
+++ /dev/null
@@ -1,600 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-
-#include "memberhandler.h"
-#include "sectionhandler.h"
-#include "dochandler.h"
-#include "mainhandler.h"
-#include "linkedtexthandler.h"
-#include "paramhandler.h"
-#include "compoundhandler.h"
-#include "debug.h"
-
-//------------------------------------------------------------------------------
-
-class MemberTypeMap
-{
- public:
- MemberTypeMap()
- {
- m_map.setAutoDelete(TRUE);
- m_map.insert("define",new int(IMember::Define));
- m_map.insert("property",new int(IMember::Property));
- m_map.insert("variable",new int(IMember::Variable));
- m_map.insert("typedef",new int(IMember::Typedef));
- m_map.insert("enum",new int(IMember::Enum));
- m_map.insert("function",new int(IMember::Function));
- m_map.insert("signal",new int(IMember::Signal));
- m_map.insert("prototype",new int(IMember::Prototype));
- m_map.insert("friend",new int(IMember::Friend));
- m_map.insert("dcop",new int(IMember::DCOP));
- m_map.insert("slot",new int(IMember::Slot));
- m_map.insert("enumvalue",new int(IMember::EnumValue));
- }
- IMember::MemberKind map(const QString &s)
- {
- int *val = m_map.find(s.utf8());
- if (val==0)
- {
- debug(1,"Warning: '%s' is an invalid member type\n",s.data());
- return IMember::Invalid;
- }
- else return (IMember::MemberKind)*val;
- }
- private:
- QDict<int> m_map;
-};
-
-static MemberTypeMap *s_typeMap;
-
-void memberhandler_init()
-{
- s_typeMap = new MemberTypeMap;
-}
-
-void memberhandler_exit()
-{
- delete s_typeMap;
-}
-
-//------------------------------------------------------------------------------
-
-void MemberReference::initialize(MainHandler *mh)
-{
- m_mainHandler = mh;
-}
-
-IMember *MemberReference::member() const
-{
- //return m_mainHandler->memberById(m_memId);
- return 0;
-}
-
-//------------------------------------------------------------------------------
-
-
-#if 0
-EnumValueHandler::EnumValueHandler(IBaseHandler *parent) :
- m_parent(parent), m_brief(0), m_detailed(0), m_linkedTextHandler(0)
-{
- addEndHandler("enumvalue",this,&EnumValueHandler::endEnumValue);
-
- addStartHandler("name",this,&EnumValueHandler::startName);
- addEndHandler("name",this,&EnumValueHandler::endName);
- addStartHandler("initializer",this,&EnumValueHandler::startInitializer);
-
- addStartHandler("briefdescription",this,&EnumValueHandler::startBriefDesc);
-
- addStartHandler("detaileddescription",this,&EnumValueHandler::startDetailedDesc);
-
- m_initializer.setAutoDelete(TRUE);
-}
-
-EnumValueHandler::~EnumValueHandler()
-{
- delete m_brief;
- delete m_detailed;
- delete m_linkedTextHandler;
-}
-
-void EnumValueHandler::startEnumValue(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
-}
-
-void EnumValueHandler::endEnumValue()
-{
- m_parent->setDelegate(0);
-}
-
-void EnumValueHandler::startName(const QXmlAttributes& /*attrib*/)
-{
- m_curString="";
-}
-
-void EnumValueHandler::endName()
-{
- m_name = m_curString;
-}
-
-void EnumValueHandler::startInitializer(const QXmlAttributes& /*attrib*/)
-{
- delete m_linkedTextHandler;
- m_linkedTextHandler = new LinkedTextHandler(this,m_initializer);
- m_linkedTextHandler->start("initializer");
-}
-
-void EnumValueHandler::startBriefDesc(const QXmlAttributes& attrib)
-{
- DocHandler *docHandler = new DocHandler(this);
- docHandler->startDoc(attrib);
- m_brief = docHandler;
-}
-
-void EnumValueHandler::startDetailedDesc(const QXmlAttributes& attrib)
-{
- DocHandler *docHandler = new DocHandler(this);
- docHandler->startDoc(attrib);
- m_detailed = docHandler;
-}
-#endif
-
-//------------------------------------------------------------------------------
-
-MemberHandler::MemberHandler(IBaseHandler *parent)
- : m_brief(0), m_detailed(0), m_inbody(0),
- m_compound(0), m_section(0), m_parent(parent)
-{
- //printf("MemberHandler::MemberHandler() %p\n",this);
- addEndHandler("memberdef",this,&MemberHandler::endMember);
-
- addStartHandler("templateparamlist",this,&MemberHandler::startTemplateParamList);
- addEndHandler("templateparamlist",this,&MemberHandler::endTemplateParamList);
-
- addStartHandler("type",this,&MemberHandler::startType);
-
- addStartHandler("definition",this,&MemberHandler::startDefinition);
- addEndHandler("definition",this,&MemberHandler::endDefinition);
-
- addStartHandler("argsstring",this,&MemberHandler::startArgsString);
- addEndHandler("argsstring",this,&MemberHandler::endArgsString);
-
- addStartHandler("name",this,&MemberHandler::startName);
- addEndHandler("name",this,&MemberHandler::endName);
-
- addStartHandler("read",this,&MemberHandler::startRead);
- addEndHandler("read",this,&MemberHandler::endRead);
-
- addStartHandler("write",this,&MemberHandler::startWrite);
- addEndHandler("write",this,&MemberHandler::endWrite);
-
- addStartHandler("reimplements",this,&MemberHandler::startReimplements);
- addEndHandler("reimplements",this,&MemberHandler::endReimplements);
-
- addStartHandler("reimplementedby",this,&MemberHandler::startReimplementedBy);
- addEndHandler("reimplementedby",this,&MemberHandler::endReimplementedBy);
-
- addStartHandler("param",this,&MemberHandler::startParam);
-
- addStartHandler("enumvalue",this,&MemberHandler::startEnumValue2);
- addEndHandler("enumvalue",this,&MemberHandler::endMember);
-
- addStartHandler("initializer",this,&MemberHandler::startInitializer);
- addStartHandler("exceptions",this,&MemberHandler::startException);
-
- addStartHandler("briefdescription",this,&MemberHandler::startBriefDesc);
-
- addStartHandler("detaileddescription",this,&MemberHandler::startDetailedDesc);
-
- addStartHandler("inbodydescription",this,&MemberHandler::startInbodyDesc);
-
- addStartHandler("location",this,&MemberHandler::startLocation);
- addEndHandler("location");
-
- addStartHandler("references",this,&MemberHandler::startReferences);
- addEndHandler("references",this,&MemberHandler::endReferences);
-
- addStartHandler("referencedby",this,&MemberHandler::startReferencedBy);
- addEndHandler("referencedby",this,&MemberHandler::endReferencedBy);
-
- m_type.setAutoDelete(TRUE);
- m_initializer.setAutoDelete(TRUE);
- m_exception.setAutoDelete(TRUE);
- m_params.setAutoDelete(TRUE);
- m_references.setAutoDelete(TRUE);
- m_referencedBy.setAutoDelete(TRUE);
- m_reimplements = 0;
- m_reimplementedBy.setAutoDelete(TRUE);
- m_enumValues.setAutoDelete(TRUE);
- m_linkedTextHandler = 0;
- m_defLine=0;
- m_bodyStart=0;
- m_bodyEnd=0;
- m_insideTemplateParamList=FALSE;
- m_hasTemplateParamList=FALSE;
-}
-
-MemberHandler::~MemberHandler()
-{
- debug(2,"MemberHandler::~MemberHandler() %p\n",this);
- delete m_brief;
- delete m_detailed;
- delete m_inbody;
- delete m_linkedTextHandler;
- delete m_reimplements;
-}
-
-void MemberHandler::startMember(const QXmlAttributes& attrib)
-{
- m_parent->setDelegate(this);
- m_kindString = attrib.value("kind");
- //printf("startMember kindString='%s'\n",m_kindString.data());
- m_kind = s_typeMap->map(m_kindString);
- m_id = attrib.value("id");
- m_protection = attrib.value("prot");
- m_isStatic = attrib.value("static")=="yes";
- m_isConst = attrib.value("const")=="yes";
- m_isExplicit = attrib.value("explicit")=="yes";
- m_isInline = attrib.value("inline")=="yes";
- m_virtualness = attrib.value("virt");
- m_isVolatile = attrib.value("volatile")=="yes";
- m_isMutable = attrib.value("mutable")=="yes";
- m_isReadable = attrib.value("readable")=="yes";
- m_isWritable = attrib.value("writable")=="yes";
-
- debug(2,"member kind='%s' id='%s' prot='%s' virt='%s'\n",
- m_kindString.data(),m_id.data(),m_protection.data(),m_virtualness.data());
-}
-
-void MemberHandler::startEnumValue(const QXmlAttributes& attrib)
-{
- m_parent->setDelegate(this);
- m_kindString = "enumvalue";
- //printf("startEnumValue kindString='%s'\n",m_kindString.data());
- m_kind = s_typeMap->map(m_kindString);
- m_id = attrib.value("id");
- m_protection = attrib.value("prot");
- m_isStatic = FALSE;
- m_isConst = FALSE;
- m_isExplicit = FALSE;
- m_isInline = FALSE;
- m_virtualness = "non-virtual";
- m_isVolatile = FALSE;
- m_isMutable = FALSE;
- m_isReadable = FALSE;
- m_isWritable = FALSE;
- debug(2,"member kind='%s' id='%s' prot='%s' virt='%s'\n",
- m_kindString.data(),m_id.data(),m_protection.data(),m_virtualness.data());
-}
-
-void MemberHandler::startEnumValue2(const QXmlAttributes& attrib)
-{
- MemberHandler *mh = new MemberHandler(this);
- mh->startEnumValue(attrib);
- m_enumValues.append(mh);
-}
-
-
-void MemberHandler::startBriefDesc(const QXmlAttributes& attrib)
-{
- DocHandler *docHandler = new DocHandler(this);
- docHandler->startDoc(attrib);
- m_brief = docHandler;
-}
-
-void MemberHandler::startDetailedDesc(const QXmlAttributes& attrib)
-{
- DocHandler *docHandler = new DocHandler(this);
- docHandler->startDoc(attrib);
- m_detailed = docHandler;
-}
-
-void MemberHandler::startInbodyDesc(const QXmlAttributes& attrib)
-{
- DocHandler *docHandler = new DocHandler(this);
- docHandler->startDoc(attrib);
- m_inbody = docHandler;
-}
-
-void MemberHandler::startLocation(const QXmlAttributes& attrib)
-{
- m_defFile = attrib.value("file");
- m_bodyFile = attrib.value("bodyfile");
- QString s;
- s = attrib.value("line");
- if (!s.isEmpty()) m_defLine=s.toInt();
- s = attrib.value("bodystart");
- if (!s.isEmpty()) m_bodyStart=s.toInt();
- s = attrib.value("bodyend");
- if (!s.isEmpty()) m_bodyEnd=s.toInt();
-}
-
-void MemberHandler::startReferences(const QXmlAttributes& attrib)
-{
- MemberReference *mr = new MemberReference;
- mr->m_memId = attrib.value("refid");
- m_references.append(mr);
- m_curString="";
-}
-
-void MemberHandler::endReferences()
-{
- m_references.getLast()->m_name = m_curString;
-}
-
-void MemberHandler::startReferencedBy(const QXmlAttributes& attrib)
-{
- MemberReference *mr = new MemberReference;
- mr->m_memId = attrib.value("refid");
- m_referencedBy.append(mr);
- m_curString="";
-}
-
-void MemberHandler::endReferencedBy()
-{
- m_referencedBy.getLast()->m_name = m_curString;
-}
-
-void MemberHandler::startReimplements(const QXmlAttributes& attrib)
-{
- m_reimplements = new MemberReference;
- m_reimplements->m_memId = attrib.value("refid");
- m_curString="";
-}
-
-void MemberHandler::endReimplements()
-{
- m_reimplements->m_name = m_curString;
-}
-
-void MemberHandler::startReimplementedBy(const QXmlAttributes& attrib)
-{
- MemberReference *mr = new MemberReference;
- mr->m_memId = attrib.value("refid");
- m_reimplementedBy.append(mr);
- m_curString="";
-}
-
-void MemberHandler::endReimplementedBy()
-{
- m_reimplementedBy.getLast()->m_name = m_curString;
-}
-
-void MemberHandler::endMember()
-{
- m_parent->setDelegate(0);
-}
-
-void MemberHandler::startType(const QXmlAttributes &)
-{
- debug(2,"startType!\n");
- delete m_linkedTextHandler;
- m_linkedTextHandler = new LinkedTextHandler(this,m_type);
- m_linkedTextHandler->start("type");
-}
-
-void MemberHandler::startInitializer(const QXmlAttributes &)
-{
- debug(2,"startInitializer!\n");
- delete m_linkedTextHandler;
- m_linkedTextHandler = new LinkedTextHandler(this,m_initializer);
- m_linkedTextHandler->start("initializer");
-}
-
-void MemberHandler::startException(const QXmlAttributes &)
-{
- debug(2,"startException!\n");
- delete m_linkedTextHandler;
- m_linkedTextHandler = new LinkedTextHandler(this,m_exception);
- m_linkedTextHandler->start("exceptions");
-}
-
-void MemberHandler::startName(const QXmlAttributes &)
-{
- m_curString="";
-}
-
-void MemberHandler::endName()
-{
- m_name = m_curString.stripWhiteSpace();
- debug(2,"member name='%s'\n",m_name.data());
-}
-
-void MemberHandler::startRead(const QXmlAttributes &)
-{
- m_curString="";
-}
-
-void MemberHandler::endRead()
-{
- m_read = m_curString.stripWhiteSpace();
- debug(2,"member read='%s'\n",m_read.data());
-}
-
-void MemberHandler::startWrite(const QXmlAttributes &)
-{
- m_curString="";
-}
-
-void MemberHandler::endWrite()
-{
- m_write = m_curString.stripWhiteSpace();
- debug(2,"member write='%s'\n",m_write.data());
-}
-
-void MemberHandler::startDefinition(const QXmlAttributes&)
-{
- m_curString="";
-}
-
-void MemberHandler::endDefinition()
-{
- m_definition = m_curString.stripWhiteSpace();
- debug(2,"definition=%s\n",m_definition.data());
-}
-
-void MemberHandler::startArgsString(const QXmlAttributes&)
-{
- m_curString="";
-}
-
-void MemberHandler::endArgsString()
-{
- m_argsstring = m_curString.stripWhiteSpace();
- debug(2,"argstring=%s\n",m_argsstring.data());
-}
-
-void MemberHandler::startParam(const QXmlAttributes& attrib)
-{
- ParamHandler *paramHandler = new ParamHandler(this);
- paramHandler->startParam(attrib);
- if (m_insideTemplateParamList)
- {
- m_templateParams.append(paramHandler);
- }
- else
- {
- m_params.append(paramHandler);
- }
-}
-
-void MemberHandler::startTemplateParamList(const QXmlAttributes&)
-{
- m_insideTemplateParamList = TRUE;
- m_hasTemplateParamList = TRUE;
-}
-
-void MemberHandler::endTemplateParamList()
-{
- m_insideTemplateParamList = FALSE;
-}
-
-void MemberHandler::initialize(MainHandler *mh)
-{
- {
- QListIterator<MemberReference> mli(m_references);
- MemberReference *mr;
- for (;(mr=mli.current());++mli)
- {
- mr->initialize(mh);
- }
- }
- {
- QListIterator<MemberReference> mli(m_referencedBy);
- MemberReference *mr;
- for (;(mr=mli.current());++mli)
- {
- mr->initialize(mh);
- }
- }
- {
- QListIterator<MemberReference> mli(m_reimplementedBy);
- MemberReference *mr;
- for (;(mr=mli.current());++mli)
- {
- mr->initialize(mh);
- }
- }
- if (m_reimplements) m_reimplements->initialize(mh);
-}
-
-void MemberHandler::setCompoundHandler(CompoundHandler *c)
-{
- m_compound = c;
-}
-
-ICompound *MemberHandler::compound() const
-{
- m_compound->addref();
- return m_compound->toICompound();
-}
-
-void MemberHandler::setSectionHandler(SectionHandler *c)
-{
- m_section = c;
-}
-
-ISection *MemberHandler::section() const
-{
- return m_section;
-}
-
-IMemberIterator *MemberHandler::enumValues() const
-{
- return new MemberIterator(m_enumValues);
-}
-
-ILinkedTextIterator *MemberHandler::type() const
-{
- return new LinkedTextIterator(m_type);
-}
-
-const IString *MemberHandler::typeString() const
-{
- MemberHandler *that = (MemberHandler *)this;
- that->m_typeString = LinkedTextHandler::toString(m_type);
- return &m_typeString;
-}
-
-IParamIterator *MemberHandler::parameters() const
-{
- return new ParamIterator(m_params);
-}
-
-IParamIterator *MemberHandler::templateParameters() const
-{
- return m_hasTemplateParamList ? new ParamIterator(m_templateParams) : 0;
-}
-
-IMemberReferenceIterator *MemberHandler::references() const
-{
- return new MemberReferenceIterator(m_references);
-}
-
-IMemberReferenceIterator *MemberHandler::referencedBy() const
-{
- return new MemberReferenceIterator(m_referencedBy);
-}
-
-ILinkedTextIterator *MemberHandler::initializer() const
-{
- return new LinkedTextIterator(m_initializer);
-}
-
-ILinkedTextIterator *MemberHandler::exceptions() const
-{
- return new LinkedTextIterator(m_exception);
-}
-
-IMemberReferenceIterator *MemberHandler::reimplementedBy() const
-{
- return new MemberReferenceIterator(m_reimplementedBy);
-}
-
-IDocRoot *MemberHandler::briefDescription() const
-{
- return m_brief;
-}
-
-IDocRoot *MemberHandler::detailedDescription() const
-{
- return m_detailed;
-}
-
-IDocRoot *MemberHandler::inbodyDescription() const
-{
- return m_inbody;
-}
-
diff --git a/addon/doxmlparser/src/memberhandler.h b/addon/doxmlparser/src/memberhandler.h
deleted file mode 100644
index 7438172..0000000
--- a/addon/doxmlparser/src/memberhandler.h
+++ /dev/null
@@ -1,252 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-
-#ifndef _MEMBERHANDLER_H
-#define _MEMBERHANDLER_H
-
-#include <qstring.h>
-#include <qlist.h>
-#include <qxml.h>
-#include <doxmlintf.h>
-
-#include "basehandler.h"
-#include "baseiterator.h"
-#include "stringimpl.h"
-
-class MainHandler;
-class CompoundHandler;
-class SectionHandler;
-class ParamHandler;
-class LinkedTextImpl;
-class LinkedTextHandler;
-class DocHandler;
-
-class MemberReference : public IMemberReference
-{
- public:
- virtual ~MemberReference() {}
- virtual IMember *member() const;
- virtual const IString *name() const { return &m_name; }
- virtual const IString *scope() const { return &m_scope; }
- virtual const IString *protection() const { return &m_protection; }
- virtual const IString *virtualness() const { return &m_virtualness; }
- virtual const IString *ambiguityScope() const { return &m_ambiguityScope; }
- void initialize(MainHandler *m);
-
- QString m_memId;
- StringImpl m_name;
- StringImpl m_scope;
- StringImpl m_virtualness;
- StringImpl m_protection;
- StringImpl m_ambiguityScope;
- MainHandler *m_mainHandler;
-};
-
-class MemberReferenceIterator : public BaseIterator<IMemberReferenceIterator,IMemberReference,MemberReference>
-{
- public:
- MemberReferenceIterator(const QList<MemberReference> &list) :
- BaseIterator<IMemberReferenceIterator,IMemberReference,MemberReference>(list) {}
-};
-
-class MemberHandler : public IDefine,
- public IProperty,
- public IVariable,
- public ITypedef,
- public IFunction,
- public ISignal,
- public IPrototype,
- public IFriend,
- public IDCOP,
- public ISlot,
- public IEnum,
- public IEnumValue,
- public BaseHandler<MemberHandler>
-{
- public:
- virtual void startMember(const QXmlAttributes& attrib);
- virtual void endMember();
- virtual void startParam(const QXmlAttributes& attrib);
- virtual void startType(const QXmlAttributes& attrib);
- virtual void startName(const QXmlAttributes& attrib);
- virtual void endName();
- virtual void startRead(const QXmlAttributes& attrib);
- virtual void endRead();
- virtual void startWrite(const QXmlAttributes& attrib);
- virtual void endWrite();
- virtual void startDefinition(const QXmlAttributes& attrib);
- virtual void endDefinition();
- virtual void startArgsString(const QXmlAttributes& attrib);
- virtual void endArgsString();
- virtual void startBriefDesc(const QXmlAttributes& attrib);
- virtual void startDetailedDesc(const QXmlAttributes& attrib);
- virtual void startInbodyDesc(const QXmlAttributes& attrib);
- virtual void startLocation(const QXmlAttributes& attrib);
- virtual void startReferences(const QXmlAttributes& attrib);
- virtual void endReferences();
- virtual void startReferencedBy(const QXmlAttributes& attrib);
- virtual void endReferencedBy();
- virtual void startReimplements(const QXmlAttributes& attrib);
- virtual void endReimplements();
- virtual void startReimplementedBy(const QXmlAttributes& attrib);
- virtual void endReimplementedBy();
- virtual void startInitializer(const QXmlAttributes& attrib);
- virtual void startException(const QXmlAttributes& attrib);
- virtual void startEnumValue(const QXmlAttributes& attrib);
- virtual void startEnumValue2(const QXmlAttributes& attrib);
- virtual void startTemplateParamList(const QXmlAttributes &attrib);
- virtual void endTemplateParamList();
-
- MemberHandler(IBaseHandler *parent);
- virtual ~MemberHandler();
-
- // IMember implementation
- virtual ICompound *compound() const;
- virtual ISection *section() const;
- virtual MemberKind kind() const
- { return m_kind; }
- virtual const IString *kindString() const
- { return &m_kindString; }
- virtual const IString *id() const
- { return &m_id; }
- virtual const IString *protection() const
- { return &m_protection; }
- virtual const IString *virtualness() const
- { return &m_virtualness; }
- virtual const IString *name() const
- { return &m_name; }
- virtual const IString *readAccessor() const
- { return &m_read; }
- virtual const IString *writeAccessor() const
- { return &m_write; }
- virtual const IString *definition() const
- { return &m_definition; }
- virtual const IString *argsstring() const
- { return &m_argsstring; }
- virtual bool isConst() const
- { return m_isConst; }
- virtual bool isVolatile() const
- { return m_isVolatile; }
- virtual bool isStatic() const
- { return m_isStatic; }
- virtual bool isExplicit() const
- { return m_isExplicit; }
- virtual bool isInline() const
- { return m_isInline; }
- virtual bool isMutable() const
- { return m_isMutable; }
- virtual bool isReadable() const
- { return m_isReadable; }
- virtual bool isWritable() const
- { return m_isWritable; }
- virtual ILinkedTextIterator *type() const;
- virtual const IString *typeString() const;
- virtual IParamIterator *parameters() const;
- virtual IParamIterator *templateParameters() const;
- virtual IMemberReferenceIterator *references() const;
- virtual IMemberReferenceIterator *referencedBy() const;
- virtual ILinkedTextIterator *initializer() const;
- virtual ILinkedTextIterator *exceptions() const;
- virtual const IString *bodyFile() const
- { return &m_bodyFile; }
- virtual int bodyStart() const
- { return m_bodyStart; }
- virtual int bodyEnd() const
- { return m_bodyEnd; }
- virtual const IString *definitionFile() const
- { return &m_defFile; }
- virtual int definitionLine() const
- { return m_defLine; }
- virtual IMemberReference *reimplements() const
- { return m_reimplements; }
- virtual IMemberReferenceIterator *reimplementedBy() const;
- virtual IDocRoot *briefDescription() const;
- virtual IDocRoot *detailedDescription() const;
- virtual IDocRoot *inbodyDescription() const;
-
- // IEnum
- virtual IMemberIterator *enumValues() const;
-
- void initialize(MainHandler *m);
- void setCompoundHandler(CompoundHandler *c);
- void setSectionHandler(SectionHandler *s);
-
- private:
- // XML elements:
- // -----------------
- QList<ParamHandler> m_templateParams; // templateparamlist
- QList<LinkedTextImpl> m_type; // type
- StringImpl m_definition; // definition
- StringImpl m_argsstring; // argsstring
- StringImpl m_name; // name
- StringImpl m_read; // read
- StringImpl m_write; // write
- MemberReference *m_reimplements; // reimplements
- QList<MemberReference> m_reimplementedBy; // reimplementedby
- QList<ParamHandler> m_params; // param
- QList<MemberHandler> m_enumValues; // enumvalue
- QList<LinkedTextImpl> m_initializer; // initializer
- QList<LinkedTextImpl> m_exception; // exceptions
- DocHandler *m_brief; // briefdescription
- DocHandler *m_detailed; // detaileddescription
- DocHandler *m_inbody; // inbodydescription
- // location
- StringImpl m_defFile; // - file
- int m_defLine; // - line
- StringImpl m_bodyFile; // - bodyfile
- int m_bodyStart; // - bodystart
- int m_bodyEnd; // - bodyend
- QList<MemberReference> m_references; // references
- QList<MemberReference> m_referencedBy; // referencedby
-
- // XML attributes:
- // ---------------
- MemberKind m_kind; // kind
- StringImpl m_kindString; // kind as a string
- StringImpl m_id; // id
- StringImpl m_protection; // prot
- bool m_isStatic; // static
- bool m_isConst; // const
- bool m_isExplicit; // explicit
- bool m_isInline; // inline
- StringImpl m_virtualness; // virt
- bool m_isVolatile; // volatile
- bool m_isMutable; // mutable
- bool m_isReadable; // readable
- bool m_isWritable; // writable
-
- CompoundHandler *m_compound;
- SectionHandler *m_section;
- StringImpl m_typeString;
- LinkedTextHandler *m_linkedTextHandler;
- bool m_insideTemplateParamList;
- bool m_hasTemplateParamList;
- IBaseHandler *m_parent;
-};
-
-class MemberIterator : public BaseIteratorVia<IMemberIterator,
- IMember,
- MemberHandler,
- IFunction>
-{
- public:
- MemberIterator(const QList<MemberHandler> &list) :
- BaseIteratorVia<IMemberIterator,IMember,MemberHandler,IFunction>(list) {}
-};
-
-void memberhandler_init();
-void memberhandler_exit();
-
-#endif
diff --git a/addon/doxmlparser/src/paramhandler.cpp b/addon/doxmlparser/src/paramhandler.cpp
deleted file mode 100644
index 7a6f455..0000000
--- a/addon/doxmlparser/src/paramhandler.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-
-#include "paramhandler.h"
-#include "memberhandler.h"
-#include "linkedtexthandler.h"
-#include "debug.h"
-#include "dochandler.h"
-
-TemplateParamListHandler::TemplateParamListHandler(IBaseHandler *parent) : m_parent(parent)
-{
- addStartHandler("param",this,&TemplateParamListHandler::startParam);
-
- addEndHandler("templateparamlist",this,&TemplateParamListHandler::endTemplateParamList);
-}
-
-void TemplateParamListHandler::startParam(const QXmlAttributes& attrib)
-{
- ParamHandler *ph = new ParamHandler(this);
- ph->startParam(attrib);
- m_templateParams.append(ph);
-}
-
-void TemplateParamListHandler::endParam()
-{
-}
-
-void TemplateParamListHandler::startTemplateParamList(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
- debug(2,"templateparamlist\n");
-}
-
-void TemplateParamListHandler::endTemplateParamList()
-{
- m_parent->setDelegate(0);
-}
-
-///////////////////////////////////////////////////////////////////////////////////////////////////////
-
-ParamHandler::ParamHandler(IBaseHandler *parent) : m_brief(0), m_parent(parent)
-{
- addEndHandler("param",this,&ParamHandler::endParam);
-
- addStartHandler("type",this,&ParamHandler::startType);
-
- addStartHandler("declname");
- addEndHandler("declname",this,&ParamHandler::endDeclName);
-
- addStartHandler("defname");
- addEndHandler("defname",this,&ParamHandler::endDefName);
-
- addStartHandler("array");
- addEndHandler("array",this,&ParamHandler::endArray);
-
- addStartHandler("attribute");
- addEndHandler("attribute",this,&ParamHandler::endAttrib);
-
- addStartHandler("briefdescription",this,&ParamHandler::startBriefDesc);
-
- addStartHandler("defval",this,&ParamHandler::startDefVal);
-
- m_linkedTextHandler = 0;
-}
-
-ParamHandler::~ParamHandler()
-{
- delete m_brief;
- delete m_linkedTextHandler;
-}
-
-void ParamHandler::startParam(const QXmlAttributes& /*attrib*/)
-{
- m_parent->setDelegate(this);
- debug(2,"param\n");
-}
-
-void ParamHandler::endParam()
-{
- m_parent->setDelegate(0);
-}
-
-void ParamHandler::startType(const QXmlAttributes& /*attrib*/)
-{
- delete m_linkedTextHandler;
- m_linkedTextHandler = new LinkedTextHandler(this,m_type);
- m_linkedTextHandler->start("type");
- debug(2,"param type\n");
-}
-
-void ParamHandler::endDeclName()
-{
- m_declName = m_curString.stripWhiteSpace();
- debug(2,"member declName='%s'\n",m_declName.data());
-}
-
-void ParamHandler::endDefName()
-{
- m_defName = m_curString.stripWhiteSpace();
- debug(2,"member defName='%s'\n",m_defName.data());
-}
-
-void ParamHandler::endAttrib()
-{
- m_attrib = m_curString.stripWhiteSpace();
- debug(2,"member attrib='%s'\n",m_attrib.data());
-}
-
-void ParamHandler::endArray()
-{
- m_array = m_curString.stripWhiteSpace();
- debug(2,"member array='%s'\n",m_array.data());
-}
-
-void ParamHandler::startDefVal(const QXmlAttributes& /*attrib*/)
-{
- delete m_linkedTextHandler;
- m_linkedTextHandler = new LinkedTextHandler(this,m_defVal);
- m_linkedTextHandler->start("defval");
- debug(2,"member defVal\n");
-}
-
-void ParamHandler::startBriefDesc(const QXmlAttributes& attrib)
-{
- DocHandler *docHandler = new DocHandler(this);
- docHandler->startDoc(attrib);
- m_brief = docHandler;
-}
-
-ILinkedTextIterator *ParamHandler::type() const
-{
- return new LinkedTextIterator(m_type);
-}
-
-ILinkedTextIterator *ParamHandler::defaultValue() const
-{
- return new LinkedTextIterator(m_defVal);
-}
-
-IDocRoot *ParamHandler::briefDescription() const
-{
- return m_brief;
-}
-
-
-
diff --git a/addon/doxmlparser/src/paramhandler.h b/addon/doxmlparser/src/paramhandler.h
deleted file mode 100644
index 3f0f09b..0000000
--- a/addon/doxmlparser/src/paramhandler.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-
-#ifndef _PARAMHANDLER_H
-#define _PARAMHANDLER_H
-
-#include <qstring.h>
-#include <qlist.h>
-#include <qxml.h>
-#include <doxmlintf.h>
-
-#include "stringimpl.h"
-#include "basehandler.h"
-#include "baseiterator.h"
-
-class LinkedTextImpl;
-class LinkedTextHandler;
-class DocHandler;
-
-
-class ParamHandler : public IParam, public BaseHandler<ParamHandler>
-{
- public:
- virtual void startParam(const QXmlAttributes& attrib);
- virtual void endParam();
- virtual void startType(const QXmlAttributes& attrib);
- virtual void endDeclName();
- virtual void endDefName();
- virtual void endAttrib();
- virtual void endArray();
- virtual void startDefVal(const QXmlAttributes& attrib);
- virtual void startBriefDesc(const QXmlAttributes& attrib);
-
- ParamHandler(IBaseHandler *parent);
- virtual ~ParamHandler();
-
- // IParam
- virtual ILinkedTextIterator *type() const;
- virtual const IString * declarationName() const { return &m_declName; }
- virtual const IString * definitionName() const { return &m_defName; }
- virtual const IString * attrib() const { return &m_attrib; }
- virtual const IString * arraySpecifier() const { return &m_array; }
- virtual ILinkedTextIterator *defaultValue() const;
- virtual IDocRoot *briefDescription() const;
-
- private:
-
- // XML elements:
- // -------------
- QList<LinkedTextImpl> m_type; // type
- StringImpl m_declName; // declname
- StringImpl m_defName; // defname
- StringImpl m_array; // array
- QList<LinkedTextImpl> m_defVal; // defval
- DocHandler *m_brief; // briefdescription
-
- StringImpl m_attrib; // TODO: not yet in XML output
-
- IBaseHandler *m_parent;
- LinkedTextHandler *m_linkedTextHandler;
-};
-
-class ParamIterator : public BaseIterator<IParamIterator,IParam,ParamHandler>
-{
- public:
- ParamIterator(const QList<ParamHandler> &list) :
- BaseIterator<IParamIterator,IParam,ParamHandler>(list) {}
-};
-
-class TemplateParamListHandler : public BaseHandler<TemplateParamListHandler>
-{
- public:
-
- virtual void startParam(const QXmlAttributes& attrib);
- virtual void endParam();
-
- virtual void startTemplateParamList(const QXmlAttributes& attrib);
- virtual void endTemplateParamList();
-
- TemplateParamListHandler(IBaseHandler *parent);
- virtual ~TemplateParamListHandler() {}
-
- ParamIterator* templateParams() { return new ParamIterator(m_templateParams); }
-
- protected:
- IBaseHandler *m_parent;
- QList<ParamHandler> m_templateParams;
-};
-
-
-#endif
diff --git a/addon/doxmlparser/src/sectionhandler.cpp b/addon/doxmlparser/src/sectionhandler.cpp
deleted file mode 100644
index b6cc31e..0000000
--- a/addon/doxmlparser/src/sectionhandler.cpp
+++ /dev/null
@@ -1,170 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-
-#include "mainhandler.h"
-#include "compoundhandler.h"
-#include "sectionhandler.h"
-#include "memberhandler.h"
-#include "linkedtexthandler.h"
-#include "paramhandler.h"
-#include "dochandler.h"
-#include "debug.h"
-
-class SectionTypeMap
-{
- public:
- SectionTypeMap() : m_map(37)
- {
- m_map.setAutoDelete(TRUE);
- m_map.insert("user-defined",new int(ISection::UserDefined));
- m_map.insert("public-type",new int(ISection::PubTypes));
- m_map.insert("public-func",new int(ISection::PubFuncs));
- m_map.insert("public-attrib",new int(ISection::PubAttribs));
- m_map.insert("public-slot",new int(ISection::PubSlots));
- m_map.insert("signal",new int(ISection::Signals));
- m_map.insert("dcop-func",new int(ISection::DCOPFuncs));
- m_map.insert("property",new int(ISection::Properties));
- m_map.insert("event",new int(ISection::Events));
- m_map.insert("public-static-func",new int(ISection::PubStatFuncs));
- m_map.insert("public-static-attrib",new int(ISection::PubStatAttribs));
- m_map.insert("protected-type",new int(ISection::ProTypes));
- m_map.insert("protected-func",new int(ISection::ProFuncs));
- m_map.insert("protected-attrib",new int(ISection::ProAttribs));
- m_map.insert("protected-slot",new int(ISection::ProSlots));
- m_map.insert("protected-static-func",new int(ISection::ProStatFuncs));
- m_map.insert("protected-static-attrib",new int(ISection::ProStatAttribs));
- m_map.insert("package-type",new int(ISection::PacTypes));
- m_map.insert("package-func",new int(ISection::PacFuncs));
- m_map.insert("package-attrib",new int(ISection::PacAttribs));
- m_map.insert("package-static-func",new int(ISection::PacStatFuncs));
- m_map.insert("package-static-attrib",new int(ISection::PacStatAttribs));
- m_map.insert("private-type",new int(ISection::PriTypes));
- m_map.insert("private-func",new int(ISection::PriFuncs));
- m_map.insert("private-attrib",new int(ISection::PriAttribs));
- m_map.insert("private-slot",new int(ISection::PriSlots));
- m_map.insert("private-static-func",new int(ISection::PriStatFuncs));
- m_map.insert("private-static-attrib",new int(ISection::PriStatAttribs));
- m_map.insert("friend",new int(ISection::Friend));
- m_map.insert("related",new int(ISection::Related));
- m_map.insert("define",new int(ISection::Defines));
- m_map.insert("prototype",new int(ISection::Prototypes));
- m_map.insert("typedef",new int(ISection::Typedefs));
- m_map.insert("enum",new int(ISection::Enums));
- m_map.insert("func",new int(ISection::Functions));
- m_map.insert("var",new int(ISection::Variables));
- }
- ISection::SectionKind map(const QString &s)
- {
- int *val = m_map.find(s.utf8());
- if (val==0)
- {
- debug(1,"Warning: '%s' is an invalid section type\n",s.data());
- return ISection::Invalid;
- }
- else return (ISection::SectionKind)*val;
- }
- private:
- QDict<int> m_map;
-};
-
-static SectionTypeMap *s_typeMap;
-
-void sectionhandler_init()
-{
- s_typeMap = new SectionTypeMap;
-}
-
-void sectionhandler_exit()
-{
- delete s_typeMap;
-}
-
-SectionHandler::SectionHandler(IBaseHandler *parent) : m_parent(parent)
-{
- //printf("SectionHandler::SectionHandler()\n");
- m_members.setAutoDelete(TRUE);
- addEndHandler("sectiondef",this,&SectionHandler::endSection);
- addStartHandler("memberdef",this,&SectionHandler::startMember);
- addStartHandler("header",this,&SectionHandler::startHeader);
- addEndHandler("header",this,&SectionHandler::endHeader);
- addStartHandler("description",this,&SectionHandler::startDescription);
-}
-
-SectionHandler::~SectionHandler()
-{
- debug(2,"SectionHandler::~SectionHandler()\n");
-}
-
-void SectionHandler::startSection(const QXmlAttributes& attrib)
-{
- m_parent->setDelegate(this);
- m_kindString = attrib.value("kind");
- m_kind = s_typeMap->map(m_kindString);
- debug(2,"section kind='%s'\n",m_kindString.data());
-}
-
-void SectionHandler::startDescription(const QXmlAttributes& attrib)
-{
- DocHandler *docHandler = new DocHandler(this);
- docHandler->startDoc(attrib);
- m_description = docHandler;
-}
-
-void SectionHandler::endSection()
-{
- m_parent->setDelegate(0);
-}
-
-void SectionHandler::startMember(const QXmlAttributes& attrib)
-{
- MemberHandler *memHandler = new MemberHandler(this);
- memHandler->startMember(attrib);
- m_members.append(memHandler);
-}
-
-void SectionHandler::startHeader(const QXmlAttributes&)
-{
- m_header="";
- m_curString="";
-}
-
-void SectionHandler::endHeader()
-{
- m_header = m_curString.stripWhiteSpace();
- debug(2,"member header='%s'\n",m_header.data());
-}
-
-void SectionHandler::initialize(CompoundHandler *ch)
-{
- QListIterator<MemberHandler> mli(m_members);
- MemberHandler *mh;
- for (;(mh=mli.current());++mli)
- {
- mh->setCompoundHandler(ch);
- ch->insertMember(mh);
- mh->setSectionHandler(this);
- }
-}
-
-IDocRoot *SectionHandler::description() const
-{
- return m_description;
-}
-
-IMemberIterator *SectionHandler::members() const
-{
- return new MemberIterator(m_members);
-}
-
diff --git a/addon/doxmlparser/src/sectionhandler.h b/addon/doxmlparser/src/sectionhandler.h
deleted file mode 100644
index a212e62..0000000
--- a/addon/doxmlparser/src/sectionhandler.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * 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.
- *
- */
-
-#ifndef _SECTIONHANDLER_H
-#define _SECTIONHANDLER_H
-
-#include <qstring.h>
-#include <qlist.h>
-#include <qxml.h>
-#include <doxmlintf.h>
-
-#include "basehandler.h"
-
-class SectionIterator :
- public BaseIterator<ISectionIterator,ISection,SectionHandler>
-{
- public:
- SectionIterator(const QList<SectionHandler> &list) :
- BaseIterator<ISectionIterator,ISection,SectionHandler>(list) {}
-};
-
-
-class SectionHandler : public IUserDefined, public BaseHandler<SectionHandler>
-{
- public:
- virtual void startMember(const QXmlAttributes& attrib);
- virtual void startHeader(const QXmlAttributes& attrib);
- virtual void startSection(const QXmlAttributes& attrib);
- virtual void startDescription(const QXmlAttributes& attrib);
- virtual void endSection();
- virtual void endHeader();
-
- SectionHandler(IBaseHandler *parent);
- virtual ~SectionHandler();
-
- // ISection
- virtual const IString *kindString() const
- { return &m_kindString; }
- virtual SectionKind kind() const
- { return m_kind; }
- IDocRoot *description() const;
- virtual IMemberIterator *members() const;
- virtual bool isStatic() const
- {
- return m_kind==PubStatFuncs || m_kind==PubStatAttribs ||
- m_kind==ProStatFuncs || m_kind==ProStatAttribs ||
- m_kind==PriStatFuncs || m_kind==PriStatAttribs;
- }
- virtual bool isPublic() const
- {
- return !isProtected() && !isPrivate();
- }
- virtual bool isProtected() const
- {
- return m_kind==ProTypes || m_kind==ProFuncs || m_kind==ProAttribs ||
- m_kind==ProSlots || m_kind==ProStatFuncs || m_kind==ProStatAttribs;
- }
- virtual bool isPrivate() const
- {
- return m_kind==PriTypes || m_kind==PriFuncs || m_kind==PriAttribs ||
- m_kind==PriSlots || m_kind==PriStatFuncs || m_kind==PriStatAttribs;
- }
-
- void initialize(CompoundHandler *c);
-
- // IUserDefined implementation
- virtual const IString *header() const
- {
- return &m_header;
- }
-
- private:
- IBaseHandler *m_parent;
-
- // XML elements:
- // -------------
- StringImpl m_header; // header
- DocHandler* m_description; // description
- QList<MemberHandler> m_members; // memberdef
-
- // XML attributes:
- // ---------------
- SectionKind m_kind; // kind
- StringImpl m_kindString; // kind as a string
-};
-
-void sectionhandler_init();
-void sectionhandler_exit();
-
-#endif
diff --git a/addon/doxmlparser/src/stringimpl.h b/addon/doxmlparser/src/stringimpl.h
deleted file mode 100644
index 8931b42..0000000
--- a/addon/doxmlparser/src/stringimpl.h
+++ /dev/null
@@ -1,38 +0,0 @@
-#ifndef STRINGIMPL_H
-#define STRINGIMPL_H
-
-#include <qstring.h>
-#include "doxmlintf.h"
-
-class StringImpl : public IString
-{
- public:
- StringImpl() {}
- StringImpl(const QString &str) : m_str(str) {}
- StringImpl &operator=(const QString &str)
- { m_str=str; return *this; }
- virtual ~StringImpl() {}
- const char *data() const
- { return m_str.data(); }
-
- // IString
- const char *latin1() const
- { return m_str.latin1(); }
- const char *utf8() const
- { m_cstr = m_str.utf8(); return m_cstr.data(); }
- unsigned short unicodeCharAt(int index) const
- { return m_str.unicode()[index].unicode(); }
- bool isEmpty() const
- { return m_str.isEmpty(); }
- int length() const
- { return m_str.length(); }
-
- operator QString() const { return m_str; }
-
- private:
- QString m_str;
- mutable QCString m_cstr; // used as a cache for m_str.utf8() to avoid returning a temporary
-};
-
-#endif
-
diff --git a/addon/doxmlparser/test/CMakeLists.txt b/addon/doxmlparser/test/CMakeLists.txt
deleted file mode 100644
index 4caef57..0000000
--- a/addon/doxmlparser/test/CMakeLists.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-
-include_directories(
- ../include
- ${PROJECT_SOURCE_DIR}/libversion
- ${PROJECT_SOURCE_DIR}/qtools
-)
-
-add_executable(doxmlparser_test
-main.cpp
-)
-
-
-target_link_libraries(doxmlparser_test
- doxmlparser
- doxygen_version
- qtools
- ${COVERAGE_LINKER_FLAGS}
-)
diff --git a/addon/doxmlparser/test/main.cpp b/addon/doxmlparser/test/main.cpp
deleted file mode 100644
index 35fd700..0000000
--- a/addon/doxmlparser/test/main.cpp
+++ /dev/null
@@ -1,776 +0,0 @@
-/******************************************************************************
- *
- * $Id$
- *
- *
- * Copyright (C) 1997-2006 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.
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <doxmlintf.h>
-#include <qstring.h>
-#include "version.h"
-
-/*! Dumps the contents of a hyperlinked text fragment as plain text to the
- * output.
- */
-QString linkedTextToString(ILinkedTextIterator *ti)
-{
- QString result;
- ILinkedText *lt=0;
- for (ti->toFirst();(lt=ti->current());ti->toNext())
- {
- switch (lt->kind())
- {
- case ILinkedText::Kind_Text: // plain text
- result+=dynamic_cast<ILT_Text*>(lt)->text()->latin1(); break;
- case ILinkedText::Kind_Ref: // a link
- result+=dynamic_cast<ILT_Ref *>(lt)->text()->latin1(); break;
- }
- }
- return result;
-}
-
-/*! Macro for printing an indented message. */
-#define InPrint(x) printf("%s",indent.latin1()), printf x;
-
-/*! Dumps the contents of a documentation block to stdout.
- * @note This function will call itself recursively.
- * @param doc The root of the documentation tree.
- * @param level The indent level.
- */
-void DumpDoc(IDoc *doc,int level)
-{
- if (doc==0) return;
- QString indent;
- indent.fill(' ',level);
- //printf(" doc node kind='%d'\n",doc->kind());
- switch (doc->kind())
- {
- case IDoc::Para:
- {
- InPrint(("<para>\n"));
- IDocPara *par = dynamic_cast<IDocPara*>(doc);
- ASSERT(par!=0);
- IDocIterator *di = par->contents();
- IDoc *pdoc;
- for (di->toFirst();(pdoc=di->current());di->toNext())
- {
- DumpDoc(pdoc,level+1);
- }
- di->release();
- InPrint(("</para>\n"));
- }
- break;
- case IDoc::Text:
- {
- IDocText *txt = dynamic_cast<IDocText*>(doc);
- ASSERT(txt!=0);
- InPrint(("<text value='%s' markup=%d headingLevel=%d/>\n",
- txt->text()->latin1(),txt->markup(),txt->headingLevel()));
- }
- break;
- case IDoc::MarkupModifier:
- {
- IDocMarkupModifier *md = dynamic_cast<IDocMarkupModifier*>(doc);
- ASSERT(md!=0);
- InPrint(("<markup modifier enabled=%d markup=%d headingLevel=%d/>\n",
- md->enabled(),md->markup(),md->headingLevel()));
- }
- break;
- case IDoc::ItemizedList:
- {
- InPrint(("<itemized list>\n"));
- IDocItemizedList *list = dynamic_cast<IDocItemizedList*>(doc);
- ASSERT(list!=0);
- IDocIterator *di = list->elements();
- IDoc *pdoc;
- for (di->toFirst();(pdoc=di->current());di->toNext())
- {
- DumpDoc(pdoc,level+1);
- }
- di->release();
- InPrint(("</itemized list>\n"));
- }
- break;
- case IDoc::OrderedList:
- {
- InPrint(("<ordered list>\n"));
- IDocOrderedList *list = dynamic_cast<IDocOrderedList*>(doc);
- ASSERT(list!=0);
- IDocIterator *di = list->elements();
- IDoc *pdoc;
- for (di->toFirst();(pdoc=di->current());di->toNext())
- {
- DumpDoc(pdoc,level+1);
- }
- di->release();
- InPrint(("</ordered list>\n"));
- }
- break;
- case IDoc::ListItem:
- {
- InPrint(("<list item>\n"));
- IDocListItem *li = dynamic_cast<IDocListItem*>(doc);
- ASSERT(li!=0);
- IDocIterator *di = li->contents();
- IDoc *pdoc;
- for (di->toFirst();(pdoc=di->current());di->toNext())
- {
- DumpDoc(pdoc,level+1);
- }
- di->release();
- InPrint(("</list item>\n"));
- }
- break;
- case IDoc::ParameterItem:
- {
- IDocParameterItem *item = dynamic_cast<IDocParameterItem*>(doc);
- InPrint(("<parameter item>\n"));
- IDocIterator *di = item->paramNames();
- IDoc *pdoc;
- for (di->toFirst();(pdoc=di->current());di->toNext())
- {
- DumpDoc(pdoc,level+1);
- }
- di->release();
- DumpDoc(item->description(),level+1);
- InPrint(("</parameter item>\n"));
- }
- break;
- case IDoc::ParameterList:
- {
- IDocParameterList *list = dynamic_cast<IDocParameterList*>(doc);
- InPrint(("<parameter list type=%d>\n",list->sectType()));
- IDocIterator *di = list->params();
- IDoc *pdoc;
- for (di->toFirst();(pdoc=di->current());di->toNext())
- {
- DumpDoc(pdoc,level+1);
- }
- di->release();
- InPrint(("</parameter list>\n"));
- ASSERT(list!=0);
- }
- break;
- case IDoc::Parameter:
- {
- IDocParameter *par = dynamic_cast<IDocParameter*>(doc);
- ASSERT(par!=0);
- InPrint(("<parameter name=%s/>\n",par->name()->latin1()));
- }
- break;
- case IDoc::SimpleSect:
- {
- IDocSimpleSect *ss = dynamic_cast<IDocSimpleSect*>(doc);
- ASSERT(ss!=0);
- InPrint(("<simplesect type=%s>\n",ss->typeString()->latin1()));
- DumpDoc(ss->title(),level+1);
- DumpDoc(ss->description(),level+1);
- InPrint(("<simplesect/>\n"));
- }
- break;
- case IDoc::Title:
- {
- InPrint(("<title>\n"));
- IDocTitle *t = dynamic_cast<IDocTitle*>(doc);
- ASSERT(t!=0);
- IDocIterator *di = t->title();
- IDoc *pdoc;
- for (di->toFirst();(pdoc=di->current());di->toNext())
- {
- DumpDoc(pdoc,level+1);
- }
- InPrint(("<title/>\n"));
- }
- break;
- case IDoc::Ref:
- {
- IDocRef *ref = dynamic_cast<IDocRef*>(doc);
- ASSERT(ref!=0);
- InPrint(("<ref id=%s text=%s/>\n",
- ref->refId()->latin1(),ref->text()->latin1()));
- }
- break;
- case IDoc::VariableList:
- {
- InPrint(("<variablelist>\n"));
- IDocVariableList *vl = dynamic_cast<IDocVariableList*>(doc);
- ASSERT(vl!=0);
- IDocIterator *di = vl->entries();
- IDoc *pdoc;
- for (di->toFirst();(pdoc=di->current());di->toNext())
- {
- DumpDoc(pdoc,level+1);
- }
- di->release();
- InPrint(("<variablelist/>\n"));
- }
- break;
- case IDoc::VariableListEntry:
- {
- IDocVariableListEntry *vle = dynamic_cast<IDocVariableListEntry*>(doc);
- ASSERT(vle!=0);
- ILinkedTextIterator *lti = vle->term();
- QString term = linkedTextToString(lti);
- lti->release();
- InPrint(("<variablelistentry term=%s>\n",term.latin1()));
- DumpDoc(vle->description(),level+1);
- InPrint(("<variablelistentry/>\n"));
- }
- break;
- case IDoc::HRuler:
- {
- IDocHRuler *hr = dynamic_cast<IDocHRuler*>(doc);
- ASSERT(hr!=0);
- InPrint(("<hruler/>\n"));
- }
- break;
- case IDoc::LineBreak:
- {
- IDocLineBreak *lb = dynamic_cast<IDocLineBreak*>(doc);
- ASSERT(lb!=0);
- InPrint(("<linebreak/>\n"));
- }
- break;
- case IDoc::ULink:
- {
- IDocULink *ul = dynamic_cast<IDocULink*>(doc);
- ASSERT(ul!=0);
- InPrint(("<ulink url='%s' text='%s'/>\n",ul->url()->latin1(),ul->text()->latin1()));
- }
- break;
- case IDoc::EMail:
- {
- IDocEMail *em = dynamic_cast<IDocEMail*>(doc);
- ASSERT(em!=0);
- InPrint(("<email address='%s'/>\n",em->address()->latin1()));
- }
- break;
- case IDoc::Link:
- {
- IDocLink *lk = dynamic_cast<IDocLink*>(doc);
- ASSERT(lk!=0);
- InPrint(("<link refid='%s' text='%s'/>\n",lk->refId()->latin1(),lk->text()->latin1()));
- }
- break;
- case IDoc::ProgramListing:
- {
- IDocProgramListing *pl = dynamic_cast<IDocProgramListing*>(doc);
- ASSERT(pl!=0);
- InPrint(("<programlisting>\n"));
- IDocIterator *cli = pl->codeLines();
- IDoc *cl;
- for (cli->toFirst();(cl=cli->current());cli->toNext())
- {
- DumpDoc(cl,level+1);
- }
- cli->release();
- InPrint(("</programlisting>\n"));
- }
- break;
- case IDoc::CodeLine:
- {
- IDocCodeLine *cl = dynamic_cast<IDocCodeLine*>(doc);
- ASSERT(cl!=0);
- InPrint(("<codeline lineNumber=%d refId='%s'>\n",cl->lineNumber(),cl->refId()->latin1()));
- IDocIterator *cei = cl->codeElements();
- IDoc *ce;
- for (cei->toFirst();(ce=cei->current());cei->toNext())
- {
- DumpDoc(ce,level+1);
- }
- cei->release();
- InPrint(("</codeline>\n"));
- }
- break;
- case IDoc::Highlight:
- {
- IDocHighlight *hl = dynamic_cast<IDocHighlight*>(doc);
- ASSERT(hl!=0);
- InPrint(("<highlight kind=%d>\n",hl->kind()));
- IDocIterator *cei = hl->codeElements();
- IDoc *ce;
- for (cei->toFirst();(ce=cei->current());cei->toNext())
- {
- DumpDoc(ce,level+1);
- }
- cei->release();
- InPrint(("</highlight>\n"));
- }
- break;
- case IDoc::Formula:
- {
- IDocFormula *fm = dynamic_cast<IDocFormula*>(doc);
- ASSERT(fm!=0);
- InPrint(("<formula id='%s' text='%s'/>\n",fm->id()->latin1(),fm->text()->latin1()));
- }
- break;
- case IDoc::Image:
- {
- IDocImage *img = dynamic_cast<IDocImage*>(doc);
- ASSERT(img!=0);
- InPrint(("<image name='%s' caption='%s'/>\n",img->name()->latin1(),img->caption()->latin1()));
- }
- break;
- case IDoc::DotFile:
- {
- IDocDotFile *df = dynamic_cast<IDocDotFile*>(doc);
- ASSERT(df!=0);
- InPrint(("<dotfile name='%s' caption='%s'/>\n",df->name()->latin1(),df->caption()->latin1()));
- }
- break;
- case IDoc::IndexEntry:
- {
- IDocIndexEntry *ie = dynamic_cast<IDocIndexEntry*>(doc);
- ASSERT(ie!=0);
- InPrint(("<indexentry primary='%s' secondary='%s'/>\n",ie->primary()->latin1(),ie->secondary()->latin1()));
- }
- break;
- case IDoc::Table:
- {
- IDocTable *tbl = dynamic_cast<IDocTable*>(doc);
- ASSERT(tbl!=0);
- InPrint(("<table numcols=%d caption='%s'>\n",tbl->numColumns(),tbl->caption()->latin1()));
- IDocIterator *ri = tbl->rows();
- IDoc *row;
- for (ri->toFirst();(row=ri->current());ri->toNext())
- {
- DumpDoc(row,level+1);
- }
- ri->release();
- InPrint(("</table>\n"));
- }
- break;
- case IDoc::Row:
- {
- IDocRow *row = dynamic_cast<IDocRow*>(doc);
- ASSERT(row!=0);
- InPrint(("<row>\n"));
- IDocIterator *ei = row->entries();
- IDoc *e;
- for (ei->toFirst();(e=ei->current());ei->toNext())
- {
- DumpDoc(e,level+1);
- }
- ei->release();
- InPrint(("</row>\n"));
- }
- break;
- case IDoc::Entry:
- {
- IDocEntry *ent = dynamic_cast<IDocEntry*>(doc);
- ASSERT(ent!=0);
- InPrint(("<entry>\n"));
- IDocIterator *di = ent->contents();
- IDoc *pdoc;
- for (di->toFirst();(pdoc=di->current());di->toNext())
- {
- DumpDoc(pdoc,level+1);
- }
- di->release();
- InPrint(("</entry>\n"));
- }
- break;
- case IDoc::Section:
- {
- IDocSection *sec = dynamic_cast<IDocSection*>(doc);
- ASSERT(sec!=0);
- InPrint(("<section id='%s' level=%d>\n",
- sec->id()->latin1(),sec->level()));
- DumpDoc(sec->title(),level+1);
- IDocIterator *di = sec->paragraphs();
- IDoc *pdoc;
- for (di->toFirst();(pdoc=di->current());di->toNext())
- {
- DumpDoc(pdoc,level+1);
- }
- di=sec->subSections();
- for (di->toFirst();(pdoc=di->current());di->toNext())
- {
- DumpDoc(pdoc,level+1);
- }
- IDocInternal *intern = sec->internal();
- if (intern)
- {
- DumpDoc(intern,level+1);
- }
- InPrint(("</section>\n"));
- }
- break;
- case IDoc::Internal:
- {
- IDocInternal *intern = dynamic_cast<IDocInternal*>(doc);
- ASSERT(intern!=0);
- InPrint(("<internal>\n"));
- IDocIterator *di = intern->paragraphs();
- IDoc *pdoc;
- for (di->toFirst();(pdoc=di->current());di->toNext())
- {
- DumpDoc(pdoc,level+1);
- }
- di=intern->subSections();
- for (di->toFirst();(pdoc=di->current());di->toNext())
- {
- DumpDoc(pdoc,level+1);
- }
- InPrint(("</internal>\n"));
- }
- break;
- case IDoc::Copy:
- {
- IDocCopy *cpy = dynamic_cast<IDocCopy*>(doc);
- ASSERT(cpy!=0);
- InPrint(("<copydoc>\n"));
- IDocIterator *di = cpy->contents();
- IDoc *pdoc;
- for (di->toFirst();(pdoc=di->current());di->toNext())
- {
- DumpDoc(pdoc,level+1);
- }
- di->release();
- InPrint(("<copydoc/>\n"));
- }
- break;
- case IDoc::TocItem:
- {
- IDocTocItem *ti = dynamic_cast<IDocTocItem*>(doc);
- ASSERT(ti!=0);
- InPrint(("<tocitem id=\"%s\" title=\"%s\"/>\n",
- ti->id()->latin1(),ti->title()->latin1()));
- }
- break;
- case IDoc::TocList:
- {
- IDocTocList *tl = dynamic_cast<IDocTocList*>(doc);
- ASSERT(tl!=0);
- InPrint(("<toclist>\n"));
- IDocIterator *di = tl->elements();
- IDoc *pdoc;
- for (di->toFirst();(pdoc=di->current());di->toNext())
- {
- DumpDoc(pdoc,level+1);
- }
- di->release();
- InPrint(("<toclist/>\n"));
- }
- break;
- case IDoc::Verbatim:
- {
- IDocVerbatim *vt = dynamic_cast<IDocVerbatim*>(doc);
- ASSERT(vt!=0);
- const char *s=0;
- switch (vt->type())
- {
- case IDocVerbatim::Verbatim: s="verbatim"; break;
- case IDocVerbatim::HtmlOnly: s="htmlonly"; break;
- case IDocVerbatim::LatexOnly: s="latexonly"; break;
- default:
- printf("Invalid verbatim type!\n");
- }
- InPrint(("<verbatim %s>\n",s));
- InPrint(("%s",vt->text()->latin1()));
- InPrint(("</verbatim>\n"));
- }
- break;
- case IDoc::Anchor:
- {
- IDocAnchor *anc = dynamic_cast<IDocAnchor*>(doc);
- ASSERT(anc!=0);
- InPrint(("<anchor id='%s'/>\n",anc->id()->latin1()));
- }
- break;
- case IDoc::Symbol:
- {
- IDocSymbol *sym = dynamic_cast<IDocSymbol*>(doc);
- ASSERT(sym!=0);
- InPrint(("<symbol type=%s letter=%c/>\n",
- sym->typeString()->latin1(),sym->letter()));
- }
- break;
- case IDoc::Root:
- {
- InPrint(("<root>\n"));
- IDocRoot *root = dynamic_cast<IDocRoot*>(doc);
- ASSERT(root!=0);
- IDocIterator *di = root->contents();
- IDoc *pdoc;
- for (di->toFirst();(pdoc=di->current());di->toNext())
- {
- DumpDoc(pdoc,level+1);
- }
- di->release();
- InPrint(("</root>\n"));
- }
- break;
-
- default:
- printf("Found unsupported node type %d!\n",doc->kind());
- break;
- }
-}
-
-void DumpGraph(IGraph *graph)
-{
- if (graph==0) { printf(" --- no graph ---\n"); return; }
- printf(" --- graph ----\n");
- INodeIterator *ni = graph->nodes();
- INode *node;
- for (ni->toFirst();(node=ni->current());ni->toNext())
- {
- printf(" --- node id=%s label=%s linkId=%s\n",
- node->id()->latin1(),
- node->label()->latin1(),
- node->linkId()->latin1()
- );
- IChildNodeIterator *cni = node->children();
- IChildNode *cn;
- for (cni->toFirst();(cn=cni->current());cni->toNext())
- {
- printf(" + child id=%s label=%s relation=%s\n",
- cn->node()->id()->latin1(),
- cn->node()->label()->latin1(),
- cn->relationString()->latin1()
- );
- IEdgeLabelIterator *eli = cn->edgeLabels();
- IEdgeLabel *el;
- for (eli->toFirst();(el=eli->current());eli->toNext())
- {
- printf(" edgeLabel=%s\n",el->label()->latin1());
- }
- eli->release();
- }
- cni->release();
- }
- ni->release();
- printf(" --- end graph ----\n");
-
-}
-
-void DumpParamList(IParamIterator *pli,int indent)
-{
- QString indentStr;
- indentStr.fill(' ',indent);
- IParam *par;
- for (pli->toFirst();(par=pli->current());pli->toNext())
- {
- ILinkedTextIterator *lti = par->type();
- QString parType = linkedTextToString(lti);
- lti->release();
- lti = par->defaultValue();
- QString defVal = linkedTextToString(lti);
- lti->release();
- printf("%sParam type=%s decl_name=%s def_name=%s defvalue=%s\n",
- indentStr.data(), parType.latin1(),
- par->declarationName()->latin1(),
- par->definitionName()->latin1(),
- defVal.latin1());
- }
-}
-
-int main(int argc,char **argv)
-{
- int locArgc = argc;
-
- if (locArgc == 2)
- {
- if (!strcmp(argv[1],"--help"))
- {
- printf("Usage: %s xml_dir\n",argv[0]);
- exit(0);
- }
- else if (!strcmp(argv[1],"--version"))
- {
- printf("%s version: %s\n",argv[0],getFullVersion());
- exit(0);
- }
- }
-
- if (locArgc!=2)
- {
- printf("Usage: %s xml_dir\n",argv[0]);
- exit(1);
- }
-
- IDoxygen *dox = createObjectModel();
-
- dox->setDebugLevel(4);
-
- if (!dox->readXMLDir(argv[1]))
- {
- printf("Error reading %s/index.xml\n",argv[1]);
- exit(1);
- }
-
- ICompoundIterator *cli = dox->compounds();
- ICompound *comp;
- printf("--- compound list ---------\n");
- for (cli->toFirst();(comp=cli->current());cli->toNext())
- {
- printf("Compound name=%s id=%s kind=%s\n",
- comp->name()->latin1(),comp->id()->latin1(),comp->kindString()->latin1());
-
- ISectionIterator *sli = comp->sections();
- ISection *sec;
- for (sli->toFirst();(sec=sli->current());sli->toNext())
- {
- printf(" Section kind=%s\n",sec->kindString()->latin1());
- IMemberIterator *mli = sec->members();
- IMember *mem;
- if( sec->kind() == ISection::UserDefined )
- {
- IUserDefined *group = dynamic_cast<IUserDefined*>(sec);
- printf(" Title=%s\n", group->header()->latin1() );
- }
- for (mli->toFirst();(mem=mli->current());mli->toNext())
- {
- ILinkedTextIterator *lti = mem->type();
- printf(" Member type=%s name=%s\n",
- linkedTextToString(lti).latin1(),mem->name()->latin1());
- lti->release();
-
- IParamIterator *pli = mem->parameters();
- DumpParamList(pli,6);
- pli->release();
- IMemberReferenceIterator *mri = mem->references();
- IMemberReference *mr;
- for (mri->toFirst();(mr=mri->current());mri->toNext())
- {
- IMember *memr = mr->member();
- printf(" References %s at line %d\n",
- mr->name()->latin1(),memr->bodyStart());
- }
-
- mri->release();
- mri = mem->referencedBy();
- for (mri->toFirst();(mr=mri->current());mri->toNext())
- {
- IMember *memr = mr->member();
- printf(" ReferencedBy %s at line %d\n",
- mr->name()->latin1(),memr->bodyStart());
- }
- mri->release();
-
- if (mem->kind()==IMember::Enum) // we have found an enum
- {
- IEnum *e = dynamic_cast<IEnum*>(mem);
- IMemberIterator *evi = e->enumValues(); // get the enum values
- IMember *mev;
- for (evi->toFirst();(mev=evi->current());evi->toNext())
- {
- IEnumValue *ev = dynamic_cast<IEnumValue*>(mev);
- ILinkedTextIterator *lti = ev->initializer();
- QString init = linkedTextToString(lti);
- lti->release();
- printf(" Enum value '%s' init='%s'\n",
- ev->name()->latin1(),init.latin1());
- }
- evi->release();
- }
-
- pli = mem->templateParameters();
- if (pli)
- {
- printf(" Template parameters\n");
- DumpParamList(pli,8);
- pli->release();
- }
-
- IDoc *doc = mem->briefDescription();
- if (doc)
- {
- printf("===== brief description ==== \n");
- DumpDoc(doc,0);
- }
-
- doc = mem->detailedDescription();
- if (doc)
- {
- printf("===== detailed description ==== \n");
- DumpDoc(doc,0);
- }
- }
- mli->release();
- }
- sli->release();
-
- IDoc *doc = comp->briefDescription();
- if (doc)
- {
- printf("===== brief description ==== \n");
- DumpDoc(doc,0);
- }
-
- doc = comp->detailedDescription();
- if (doc)
- {
- printf("===== detailed description ==== \n");
- DumpDoc(doc,0);
- }
-
- if (comp->kind()==ICompound::Class)
- {
- IClass *cls = dynamic_cast<IClass*>(comp);
- ASSERT(cls!=0);
-
- printf("==== inheritance graph ==== \n");
- DumpGraph(cls->inheritanceGraph());
-
- printf("==== collaboration graph ==== \n");
- DumpGraph(cls->collaborationGraph());
-
- printf("==== base classes ==== \n");
- IRelatedCompoundIterator *bcli = cls->baseCompounds();
- IRelatedCompound *bClass;
- for (bcli->toFirst();(bClass=bcli->current());bcli->toNext())
- {
- ICompound *bc = bClass->compound();
- printf(" + class %s\n",bc->name()->latin1());
- bc->release();
- }
- bcli->release();
-
- printf("==== derived classes ==== \n");
- IRelatedCompoundIterator *dcli = cls->derivedCompounds();
- IRelatedCompound *dClass;
- for (dcli->toFirst();(dClass=dcli->current());dcli->toNext())
- {
- ICompound *dc = dClass->compound();
- printf(" + class %s\n",dc->name()->latin1());
- dc->release();
- }
- dcli->release();
- }
- else if (comp->kind()==ICompound::File)
- {
- IFile *file = dynamic_cast<IFile*>(comp);
- ASSERT(file!=0);
-
- printf("==== include dependency graph ==== \n");
- DumpGraph(file->includeDependencyGraph());
-
- printf("==== included by dependency graph ==== \n");
- DumpGraph(file->includedByDependencyGraph());
-
- printf("==== source ====\n");
- DumpDoc(file->source(),0);
- }
-
- comp->release();
- }
- cli->release();
- printf("---------------------------\n");
-
- dox->release();
-
- return 0;
-}
-
diff --git a/addon/doxyapp/CMakeLists.txt b/addon/doxyapp/CMakeLists.txt
index 707fded..a6fde42 100644
--- a/addon/doxyapp/CMakeLists.txt
+++ b/addon/doxyapp/CMakeLists.txt
@@ -4,7 +4,6 @@ include_directories(
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/libversion
${GENERATED_SRC}
- ${PROJECT_SOURCE_DIR}/qtools
${ICONV_INCLUDE_DIR}
${CLANG_INCLUDEDIR}
)
@@ -36,8 +35,8 @@ endif()
target_link_libraries(doxyapp
doxymain
-qtools
md5
+xml
lodepng
mscgen
doxygen_version
diff --git a/addon/doxyapp/doxyapp.cpp b/addon/doxyapp/doxyapp.cpp
index 5fc07be..e51966d 100644
--- a/addon/doxyapp/doxyapp.cpp
+++ b/addon/doxyapp/doxyapp.cpp
@@ -26,8 +26,7 @@
*/
#include <stdlib.h>
-#include <qfile.h>
-#include <qdir.h>
+#include "dir.h"
#include "doxygen.h"
#include "outputgen.h"
#include "parserintf.h"
@@ -48,23 +47,21 @@ class XRefDummyCodeGenerator : public CodeOutputInterface
// these are just null functions, they can be used to produce a syntax highlighted
// and cross-linked version of the source code, but who needs that anyway ;-)
- void codify(const char *) {}
- void writeCodeLink(const char *,const char *,const char *,const char *,const char *) {}
- void writeLineNumber(const char *,const char *,const char *,int) {}
- virtual void writeTooltip(const char *,const DocLinkInfo &,
- const char *,const char *,const SourceLinkInfo &,
- const SourceLinkInfo &) {}
- void startCodeLine(bool) {}
- void endCodeLine() {}
- void startCodeAnchor(const char *) {}
- void endCodeAnchor() {}
- 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 *) {}
- void endCodeFragment(const char *) {}
+ void codify(const QCString &) override {}
+ void writeCodeLink(const QCString &,const QCString &,const QCString &,const QCString &,const QCString &) override {}
+ void writeLineNumber(const QCString &,const QCString &,const QCString &,int) override {}
+ virtual 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 &) 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 &) override {}
+ void endCodeFragment(const QCString &) override {}
// here we are presented with the symbols found by the code parser
void linkableSymbol(int l, const char *sym,Definition *symDef,Definition *context)
@@ -179,8 +176,8 @@ static void lookupSymbol(Definition *d)
case Definition::TypeFile:
{
FileDef *fd = dynamic_cast<FileDef*>(d);
- printf("Kind: File: #includes %d other files\n",
- fd->includeFileList() ? fd->includeFileList()->count() : 0);
+ printf("Kind: File: #includes %zu other files\n",
+ fd->includeFileList().size());
}
break;
case Definition::TypeNamespace:
@@ -297,7 +294,7 @@ int main(int argc,char **argv)
}
// clean up after us
- QDir().rmdir("/tmp/doxygen");
+ Dir().rmdir("/tmp/doxygen");
while (1)
{
diff --git a/addon/doxyparse/CMakeLists.txt b/addon/doxyparse/CMakeLists.txt
index fe2f2c2..f439c29 100644
--- a/addon/doxyparse/CMakeLists.txt
+++ b/addon/doxyparse/CMakeLists.txt
@@ -4,7 +4,6 @@ include_directories(
${PROJECT_SOURCE_DIR}/src
${PROJECT_SOURCE_DIR}/libversion
${GENERATED_SRC}
- ${PROJECT_SOURCE_DIR}/qtools
${ICONV_INCLUDE_DIR}
${CLANG_INCLUDEDIR}
)
@@ -24,8 +23,8 @@ endif()
target_link_libraries(doxyparse
doxymain
-qtools
md5
+xml
lodepng
mscgen
doxygen_version
diff --git a/addon/doxyparse/doxyparse.cpp b/addon/doxyparse/doxyparse.cpp
index 1181231..65e7327 100644
--- a/addon/doxyparse/doxyparse.cpp
+++ b/addon/doxyparse/doxyparse.cpp
@@ -40,9 +40,7 @@
#include <cstdlib>
#include <sstream>
#include <map>
-#include <qdir.h>
-#include <qcstring.h>
-#include <qregexp.h>
+#include "qcstring.h"
#include "namespacedef.h"
#include "portable.h"
@@ -54,24 +52,21 @@ class Doxyparse : public CodeOutputInterface
// these are just null functions, they can be used to produce a syntax highlighted
// and cross-linked version of the source code, but who needs that anyway ;-)
- void codify(const char *) {}
- void writeCodeLink(const char *,const char *,const char *,const char *,const char *) {}
- void startCodeLine() {}
- void endCodeLine() {}
- void startCodeAnchor(const char *) {}
- void endCodeAnchor() {}
- void startFontClass(const char *) {}
- void endFontClass() {}
- void writeCodeAnchor(const char *) {}
- void writeLineNumber(const char *,const char *,const char *,int) {}
- virtual void writeTooltip(const char *,const DocLinkInfo &,
- const char *,const char *,const SourceLinkInfo &,
- const SourceLinkInfo &) {}
- void startCodeLine(bool) {}
- void setCurrentDoc(const Definition *,const char *,bool) {}
- void addWord(const char *,bool) {}
- void startCodeFragment(const char *) {}
- void endCodeFragment(const char *) {}
+ void codify(const QCString &) override {}
+ void writeCodeLink(const QCString &,const QCString &,const QCString &,const QCString &,const QCString &) override {}
+ void startCodeLine(bool) override {}
+ void endCodeLine() override {}
+ void writeCodeAnchor(const QCString &) override {}
+ void startFontClass(const QCString &) override {}
+ void endFontClass() override {}
+ void writeLineNumber(const QCString &,const QCString &,const QCString &,int) override {}
+ virtual void writeTooltip(const QCString &,const DocLinkInfo &,
+ const QCString &,const QCString &,const SourceLinkInfo &,
+ const SourceLinkInfo &) 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 linkableSymbol(int l, const char *sym, Definition *symDef, Definition *context)
{
@@ -184,8 +179,8 @@ static int isPartOfCStruct(const MemberDef * md) {
std::string sanitizeString(std::string data) {
QCString new_data = QCString(data.c_str());
- new_data.replace(QRegExp("\""), "");
- new_data.replace(QRegExp("\\"), ""); // https://github.com/analizo/analizo/issues/138
+ new_data = substitute(new_data,"\"", "");
+ new_data = substitute(new_data,"\'", ""); // https://github.com/analizo/analizo/issues/138
return !new_data.isEmpty() ? new_data.data() : "";
}
@@ -258,13 +253,11 @@ void cModule(const ClassDef* cd) {
if (ml) {
const FileDef *fd = cd->getFileDef();
const MemberList *fd_ml = fd->getMemberList(MemberListType_allMembersList);
- if (!fd_ml || fd_ml->count() == 0) {
+ if (!fd_ml || fd_ml->size() == 0) {
printModule(fd->getOutputFileBase().data());
printDefines();
}
- MemberListIterator mli(*ml);
- const MemberDef* md;
- for (mli.toFirst(); (md=mli.current()); ++mli) {
+ for (const auto &md : *ml) {
printDefinition("variable", cd->name().data() + std::string("::") + md->name().data(), md->getDefLine());
protectionInformation(md->protection());
}
@@ -336,9 +329,7 @@ static void lookupSymbol(const Definition *d) {
void listMembers(const MemberList *ml) {
if (ml) {
- MemberListIterator mli(*ml);
- const MemberDef *md;
- for (mli.toFirst(); (md=mli.current()); ++mli) {
+ for (const auto &md : *ml) {
lookupSymbol((Definition*) md);
}
}
@@ -384,7 +375,7 @@ static bool checkLanguage(std::string& filename, std::string extension) {
* about whether it is a C project or not. */
static void detectProgrammingLanguage(FileNameLinkedMap &fnli) {
for (const auto &fn : fnli) {
- std::string filename = fn->fileName();
+ std::string filename = fn->fileName().str();
if (
checkLanguage(filename, ".cc") ||
checkLanguage(filename, ".cxx") ||
@@ -407,7 +398,7 @@ static void listSymbols() {
for (const auto &fd : *fn) {
printFile(fd->absFilePath().data());
MemberList *ml = fd->getMemberList(MemberListType_allMembersList);
- if (ml && ml->count() > 0) {
+ if (ml && ml->size() > 0) {
printModule(fd->getOutputFileBase().data());
printDefines();
listMembers(ml);
@@ -460,9 +451,9 @@ int main(int argc,char **argv) {
// we need a place to put intermediate files
std::ostringstream tmpdir;
unsigned int pid = Portable::pid();
- if (Portable::getenv("TMP"))
+ if (!Portable::getenv("TMP").isEmpty())
tmpdir << Portable::getenv("TMP") << "/doxyparse-" << pid;
- else if (Portable::getenv("TEMP"))
+ else if (!Portable::getenv("TEMP").isEmpty())
tmpdir << Portable::getenv("TEMP") << "/doxyparse-" << pid;
else
tmpdir << "doxyparse-" << pid;
@@ -526,12 +517,12 @@ int main(int argc,char **argv) {
}
}
- QDir thisDir;
+ Dir thisDir;
// remove temporary files
- if (!Doxygen::filterDBFileName.isEmpty()) thisDir.remove(Doxygen::filterDBFileName);
+ if (!Doxygen::filterDBFileName.isEmpty()) thisDir.remove(Doxygen::filterDBFileName.str());
// clean up after us
- thisDir.rmdir(Config_getString(OUTPUT_DIRECTORY));
+ thisDir.rmdir(Config_getString(OUTPUT_DIRECTORY).str());
startYamlDocument();
listSymbols();
diff --git a/addon/doxysearch/CMakeLists.txt b/addon/doxysearch/CMakeLists.txt
index d0c8724..2c1ac08 100644
--- a/addon/doxysearch/CMakeLists.txt
+++ b/addon/doxysearch/CMakeLists.txt
@@ -7,7 +7,7 @@ endif()
include_directories(
${PROJECT_SOURCE_DIR}/libversion
- ${PROJECT_SOURCE_DIR}/qtools
+ ${PROJECT_SOURCE_DIR}/libxml
${XAPIAN_INCLUDE_DIR}
${ZLIB_INCLUDE_DIRS}
)
@@ -20,7 +20,7 @@ target_link_libraries(doxyindexer
${WIN_EXTRA_LIBS}
${COVERAGE_LINKER_FLAGS}
doxygen_version
- qtools
+ xml
)
add_executable(doxysearch.cgi
diff --git a/addon/doxysearch/doxyindexer.cpp b/addon/doxysearch/doxyindexer.cpp
index ae4e046..8d295cb 100644
--- a/addon/doxysearch/doxyindexer.cpp
+++ b/addon/doxysearch/doxyindexer.cpp
@@ -20,17 +20,17 @@
#include <string>
#include <algorithm>
#include <sstream>
+#include <fstream>
+#include <iterator>
+#include <regex>
-// Qtools includes
-#include <qregexp.h>
-#include <qxml.h>
-#include <qfile.h>
-#include <qfileinfo.h>
+#include <sys/stat.h>
// Xapian include
#include <xapian.h>
#include "version.h"
+#include "xml.h"
#define MAX_TERM_LENGTH 245
@@ -106,13 +106,14 @@ static void addWords(const std::string &s,Xapian::Document &doc,int wfd)
/** Adds all identifiers in \a s to document \a doc with weight \a wfd */
static void addIdentifiers(const std::string &s,Xapian::Document &doc,int wfd)
{
- QRegExp re("[A-Z_a-z][A-Z_a-z0-9]*");
- int i,l,p=0;
- QCString qs = s.c_str();
- while ((i=re.match(qs,p,&l))!=-1)
+ std::regex id_re("[A-Z_a-z][A-Z_a-z0-9]*");
+ auto id_begin = std::sregex_iterator(s.begin(), s.end(), id_re);
+ auto id_end = std::sregex_iterator();
+
+ for (auto i = id_begin; i!=id_end; ++i)
{
- safeAddTerm(qs.mid(p,i-p).data(),doc,wfd);
- p=i+l;
+ std::smatch match = *i;
+ safeAddTerm(match.str(),doc,wfd);
}
}
@@ -142,12 +143,12 @@ static std::string unescapeXmlEntities(const std::string &s)
/** This class is a wrapper around SAX style XML parser, which
* parses the file without first building a DOM tree in memory.
*/
-class XMLContentHandler : public QXmlDefaultHandler
+class XMLContentHandler
{
public:
/** Handler for parsing XML data */
- XMLContentHandler(const QString &path)
- : m_db((path+"doxysearch.db").utf8().data(),Xapian::DB_CREATE_OR_OVERWRITE),
+ XMLContentHandler(const std::string &path)
+ : m_db(path+"doxysearch.db",Xapian::DB_CREATE_OR_OVERWRITE),
m_stemmer("english")
{
m_curFieldName = UnknownField;
@@ -161,7 +162,6 @@ class XMLContentHandler : public QXmlDefaultHandler
m_db.commit();
}
- private:
enum FieldNames
{
UnknownField = 0,
@@ -175,13 +175,12 @@ class XMLContentHandler : public QXmlDefaultHandler
};
/** Handler for a start tag. Called for <doc> and <field> tags */
- bool startElement(const QString &, const QString &,
- const QString &name, const QXmlAttributes &attrib)
+ void startElement(const std::string &name, const XMLHandlers::Attributes &attrib)
{
m_data="";
if (name=="field")
{
- QString fieldName = attrib.value("name");
+ std::string fieldName = XMLHandlers::value(attrib,"name");
if (fieldName=="type") m_curFieldName=TypeField;
else if (fieldName=="name") m_curFieldName=NameField;
else if (fieldName=="args") m_curFieldName=ArgsField;
@@ -191,11 +190,10 @@ class XMLContentHandler : public QXmlDefaultHandler
else if (fieldName=="text") m_curFieldName=TextField;
else m_curFieldName=UnknownField;
}
- return TRUE;
}
/** Handler for an end tag. Called for </doc> and </field> tags */
- bool endElement(const QString &, const QString &, const QString &name)
+ void endElement(const std::string &name)
{
if (name=="doc") // </doc>
{
@@ -260,16 +258,21 @@ class XMLContentHandler : public QXmlDefaultHandler
m_curFieldName=UnknownField;
}
// reset m_data
- return TRUE;
}
/** Handler for inline text */
- bool characters(const QString& ch)
+ void characters(const std::string& ch)
{
- m_data += std::string(ch.utf8());
- return TRUE;
+ m_data += ch;
}
+ void error(const std::string &fileName,int lineNr,const std::string &msg)
+ {
+ std::cerr << "Fatal error at " << fileName << ":" << lineNr << ": " << msg << std::endl;
+ }
+
+ private:
+
// internal state
Xapian::WritableDatabase m_db;
Xapian::Document m_doc;
@@ -279,38 +282,31 @@ class XMLContentHandler : public QXmlDefaultHandler
FieldNames m_curFieldName;
};
-/** Class for handling error during XML parsing */
-class XMLErrorHandler : public QXmlErrorHandler
-{
- public:
- virtual ~XMLErrorHandler() {}
- bool warning( const QXmlParseException & )
- {
- return FALSE;
- }
- bool error( const QXmlParseException & )
- {
- return FALSE;
- }
- bool fatalError( const QXmlParseException &exception )
- {
- std::cerr << "Fatal error at line " << exception.lineNumber()
- << " column " << exception.columnNumber() << ": "
- << exception.message().utf8() << std::endl;
- return FALSE;
- }
- QString errorString() { return ""; }
-
- private:
- QString errorMsg;
-};
-
static void usage(const char *name, int exitVal = 1)
{
std::cerr << "Usage: " << name << " [-o output_dir] searchdata.xml [searchdata2.xml ...]" << std::endl;
exit(exitVal);
}
+// return the contents of a file as a string
+inline std::string fileToString(const std::string &fileName)
+{
+ std::ifstream t(fileName);
+ std::string result;
+ t.seekg(0, std::ios::end);
+ result.reserve(t.tellg());
+ t.seekg(0, std::ios::beg);
+ result.assign(std::istreambuf_iterator<char>(t),
+ std::istreambuf_iterator<char>());
+ return result;
+}
+
+bool dirExists(const char *path)
+{
+ struct stat info = {};
+ return stat(path,&info)==0 && (info.st_mode&S_IFDIR);
+}
+
/** main function to index data */
int main(int argc,const char **argv)
{
@@ -318,7 +314,7 @@ int main(int argc,const char **argv)
{
usage(argv[0]);
}
- QString outputDir;
+ std::string outputDir;
for (int i=1;i<argc;i++)
{
if (std::string(argv[i])=="-o")
@@ -332,8 +328,7 @@ int main(int argc,const char **argv)
{
i++;
outputDir=argv[i];
- QFileInfo fi(outputDir);
- if (!fi.exists() || !fi.isDir())
+ if (!dirExists(outputDir.c_str()))
{
std::cerr << "Error: specified output directory does not exist!" << std::endl;
usage(argv[0]);
@@ -353,12 +348,16 @@ int main(int argc,const char **argv)
try
{
- if (!outputDir.isEmpty() && outputDir.at(outputDir.length()-1)!=pathSep)
+ if (!outputDir.empty() && outputDir.at(outputDir.length()-1)!=pathSep)
{
outputDir+=pathSep;
}
- XMLContentHandler handler(outputDir);
- XMLErrorHandler errorHandler;
+ XMLContentHandler contentHandler(outputDir);
+ XMLHandlers handlers;
+ handlers.startElement = [&contentHandler](const std::string &name,const XMLHandlers::Attributes &attrs) { contentHandler.startElement(name,attrs); };
+ handlers.endElement = [&contentHandler](const std::string &name) { contentHandler.endElement(name); };
+ handlers.characters = [&contentHandler](const std::string &chars) { contentHandler.characters(chars); };
+ handlers.error = [&contentHandler](const std::string &fileName,int lineNr,const std::string &msg) { contentHandler.error(fileName,lineNr,msg); };
for (int i=1;i<argc;i++)
{
if (std::string(argv[i])=="-o")
@@ -367,14 +366,10 @@ int main(int argc,const char **argv)
}
else
{
- QString xmlFileName = argv[i];
- std::cout << "Processing " << xmlFileName.utf8() << "..." << std::endl;
- QFile xmlFile(xmlFileName);
- QXmlInputSource source(xmlFile);
- QXmlSimpleReader reader;
- reader.setContentHandler(&handler);
- reader.setErrorHandler(&errorHandler);
- reader.parse(source);
+ std::cout << "Processing " << argv[i] << "..." << std::endl;
+ std::string inputStr = fileToString(argv[i]);
+ XMLParser parser(handlers);
+ parser.parse(argv[i],inputStr.c_str(),false);
}
}
}
diff --git a/addon/doxywizard/CMakeLists.txt b/addon/doxywizard/CMakeLists.txt
index a6f65f8..6813a6d 100644
--- a/addon/doxywizard/CMakeLists.txt
+++ b/addon/doxywizard/CMakeLists.txt
@@ -31,7 +31,6 @@ endif()
include_directories(
.
${PROJECT_SOURCE_DIR}/libversion
- ${PROJECT_SOURCE_DIR}/qtools
${GENERATED_SRC}
)
diff --git a/addon/doxywizard/doxywizard.cpp b/addon/doxywizard/doxywizard.cpp
index f713025..5031221 100755
--- a/addon/doxywizard/doxywizard.cpp
+++ b/addon/doxywizard/doxywizard.cpp
@@ -553,7 +553,11 @@ void MainWindow::runDoxygen()
m_runProcess->setEnvironment(env);
QStringList args;
+#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
+ QStringList runOptions = m_runOptions->text().split(QLatin1Char(' '),Qt::SkipEmptyParts);
+#else
QStringList runOptions = m_runOptions->text().split(QLatin1Char(' '),QString::SkipEmptyParts);
+#endif
args << runOptions;
args << QString::fromLatin1("-b"); // make stdout unbuffered
diff --git a/addon/doxywizard/expert.cpp b/addon/doxywizard/expert.cpp
index 7fd7df3..a50ff2b 100644
--- a/addon/doxywizard/expert.cpp
+++ b/addon/doxywizard/expert.cpp
@@ -760,13 +760,13 @@ void Expert::saveTopic(QTextStream &t,QDomElement &elem,QTextCodec *codec,
{
if (!brief)
{
- t << endl;
+ t << "\n";
}
if (!condensed)
{
- t << "#---------------------------------------------------------------------------" << endl;
- t << "# " << elem.attribute(SA("docs")) << endl;
- t << "#---------------------------------------------------------------------------" << endl;
+ t << "#---------------------------------------------------------------------------\n";
+ t << "# " << elem.attribute(SA("docs")) << "\n";
+ t << "#---------------------------------------------------------------------------\n";
}
// write options...
QDomElement childElem = elem.firstChildElement();
@@ -783,9 +783,9 @@ void Expert::saveTopic(QTextStream &t,QDomElement &elem,QTextCodec *codec,
Input *option = i.value();
if (option && !brief)
{
- t << endl;
+ t << "\n";
t << convertToComment(option->templateDocs());
- t << endl;
+ t << "\n";
}
bool toPrint = true;
if (option && condensed) toPrint = !option->isDefault();
@@ -797,7 +797,7 @@ void Expert::saveTopic(QTextStream &t,QDomElement &elem,QTextCodec *codec,
t << " ";
option->writeValue(t,codec);
}
- t << endl;
+ t << "\n";
}
}
}
@@ -808,7 +808,7 @@ void Expert::saveTopic(QTextStream &t,QDomElement &elem,QTextCodec *codec,
bool Expert::writeConfig(QTextStream &t,bool brief, bool condensed)
{
// write global header
- t << "# Doxyfile " << getDoxygenVersion() << endl << endl;
+ t << "# Doxyfile " << getDoxygenVersion() << "\n\n";
if (!brief && !condensed)
{
t << convertToComment(m_header);
diff --git a/addon/doxywizard/inputstrlist.cpp b/addon/doxywizard/inputstrlist.cpp
index cdc7d14..2f4c7f7 100644
--- a/addon/doxywizard/inputstrlist.cpp
+++ b/addon/doxywizard/inputstrlist.cpp
@@ -250,7 +250,7 @@ void InputStrList::writeValue(QTextStream &t,QTextCodec *codec)
{
if (!first)
{
- t << " \\" << endl;
+ t << " \\\n";
t << " ";
}
first=false;
@@ -276,8 +276,8 @@ bool InputStrList::isDefault()
if (it1==m_strList.end() && it2==m_default.end()) return true;
// one list is empty but the other is not
- if (it1==m_default.end()) return false;
- if (it2==m_strList.end()) return false;
+ if (it1==m_strList.end()) return false;
+ if (it2==m_default.end()) return false;
it1 = m_strList.begin();
it2 = m_default.begin();
diff --git a/cmake/FindJavacc.cmake b/cmake/FindJavacc.cmake
index a134020..97a7827 100755
--- a/cmake/FindJavacc.cmake
+++ b/cmake/FindJavacc.cmake
@@ -1,25 +1,25 @@
find_program(JAVACC_EXECUTABLE NAMES javacc javaCC Javacc JavaCC javacc.bat DOC "path to the javacc executable")
mark_as_advanced(JAVACC_EXECUTABLE)
+set(JAVACC_FOUND 0)
if(JAVACC_EXECUTABLE)
- set(JAVACC_FOUND 1)
- message(STATUS "The javacc executable: ${JAVACC_EXECUTABLE}")
execute_process(
COMMAND "${JAVACC_EXECUTABLE}" -version
OUTPUT_VARIABLE JAVACC_TEMP_VERSION
)
string(REGEX MATCH ".* ([0-9]+(\\.[0-9]+)+) .*" JAVACC_TEMP_VERSION2_UNUSED "${JAVACC_TEMP_VERSION}")
if(CMAKE_MATCH_1)
+ set(JAVACC_FOUND 1)
set(JAVACC_VERSION ${CMAKE_MATCH_1})
else()
string(REGEX MATCH "([0-9]+(\\.[0-9]+)+)" JAVACC_TEMP_VERSION3_UNUSED "${JAVACC_TEMP_VERSION}")
if(CMAKE_MATCH_1)
+ set(JAVACC_FOUND 1)
set(JAVACC_VERSION ${CMAKE_MATCH_1})
- else()
- message(STATUS "Unable to determine JavaCC version, using existing files")
- set(JAVACC_FOUND 0)
endif()
endif()
+endif()
+if(JAVACC_FOUND)
+ message(STATUS "The javacc executable: ${JAVACC_EXECUTABLE} (found version \"${JAVACC_VERSION}\")")
else()
- set(JAVACC_FOUND 0)
message(STATUS "The javacc executable not found, using existing files")
endif()
diff --git a/cmake/FindgenerateDS.cmake b/cmake/FindgenerateDS.cmake
new file mode 100644
index 0000000..77011fc
--- /dev/null
+++ b/cmake/FindgenerateDS.cmake
@@ -0,0 +1,19 @@
+find_program(GENERATEDS_EXECUTABLE NAMES generateDS generateDS.py DOC "path to the generateDS executable")
+mark_as_advanced(GENERATEDS_EXECUTABLE)
+set(GENERATEDS_FOUND 0)
+if(GENERATEDS_EXECUTABLE)
+ execute_process(
+ COMMAND "${GENERATEDS_EXECUTABLE}" --version
+ OUTPUT_VARIABLE GENERATEDS_TEMP_VERSION
+ )
+ string(REGEX MATCH ".* ([0-9]+(\\.[0-9]+)+)" GENERATEDS_TEMP_VERSION_UNUSED "${GENERATEDS_TEMP_VERSION}")
+ if(CMAKE_MATCH_1)
+ set(GENERATEDS_FOUND 1)
+ set(GENERATEDS_VERSION ${CMAKE_MATCH_1})
+ endif()
+endif()
+if(GENERATEDS_FOUND)
+ message(STATUS "The generateDS executable: ${GENERATEDS_EXECUTABLE} (found version \"${GENERATEDS_VERSION}\")")
+else()
+ message(STATUS "The generateDS executable not found, using existing files")
+endif()
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index f2d177e..f7f680f 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -82,7 +82,6 @@ set(DOC_FILES
infoflow.fig
infoflow.png
install.doc
- install_prefix
lists.doc
markdown.doc
output.doc
diff --git a/doc/changelog.doc b/doc/changelog.doc
index 0d3dd2a..b2dc8fc 100644
--- a/doc/changelog.doc
+++ b/doc/changelog.doc
@@ -3774,7 +3774,7 @@ make sure you add the following:
<li> id <a href="https://github.com/doxygen/doxygen/issues/4508">4508</a>: Added support for &lt;inheritdoc/&gt; C# XML command
(thanks to John Werner for the patch).</li>
<li> id <a href="https://github.com/doxygen/doxygen/issues/4588">4588</a>, Added support for resolving environment variables of the
- form $(PROGRAMFILES(X86)) inside the config file</li>
+ form &#36;(PROGRAMFILES(X86)) inside the config file</li>
<li> Doxygen now shows Objective-C properties in collaboration diagrams
(thanks to Sven Weidauer for the patch).</li>
<li> Added ability to search for group or page titles.</li>
@@ -5849,7 +5849,7 @@ make sure you add the following:
<li> id 457857: Leading "struct" keyword is no longer stripped from the documentation of
functions that return a pointer to a struct.</li>
<li> id 458710: Expanding environment variables in the config file to a
- file or path name with spaces (e.g. "$(VCInstallDir)include") was
+ file or path name with spaces (e.g. "&#36;(VCInstallDir)include") was
incorrectly interpreted as a list when used with for instance <code>INPUT</code>.</li>
<li> id 458749: Undocumented constructors/destructors inside an undocumented member group
were not visible in the output.</li>
@@ -7264,7 +7264,7 @@ make sure you add the following:
now be improved significantly.</li>
<li> Made some cosmetic changes to the HTML output (thanks to Ben Harper).</li>
<li> STRIP_FROM_PATH now by default strips the path from which doxygen is
- run (i.e. $(PWD)/ on Unix)</li>
+ run (i.e. &#36;(PWD)/ on Unix)</li>
</ul>
<h3>New features</h3>
<ul>
@@ -7315,7 +7315,7 @@ make sure you add the following:
Eoin MacDonell for the fix).</li>
<li> Grouped pages in the XML output did have the same id as their group.</li>
<li> Fixed problem handling environment variables inside a
- quoted string in the config file (e.g. "$(HOME)/My Path/").</li>
+ quoted string in the config file (e.g. "&#36;(HOME)/My Path/").</li>
<li> Using "\mainpage notitle" caused the "notitle" to appear in the treeview.</li>
<li> Page references where wrong in the latex output when PDF_HYPERLINKS
was disabled.</li>
@@ -9166,7 +9166,7 @@ make sure you add the following:
(thanks to Marvin Wolfthal).</li>
<li> In some situations doxygen wanted to write a files containing a \n.</li>
<li> Environment variables can now also be used for non-string values
- in the config file, like for example QUIET = $(QUIET_ON)</li>
+ in the config file, like for example QUIET = &#36;(QUIET_ON)</li>
<li> Fixed a number of typo's in the docs (thanks to Philippe Lhoste &amp;
Jens Seidel).</li>
<li> Inheritance through typedefs within a namespace did not yield the
diff --git a/doc/commands.doc b/doc/commands.doc
index 1465a1e..eff2f42 100644
--- a/doc/commands.doc
+++ b/doc/commands.doc
@@ -60,6 +60,7 @@ documentation:
\refitem cmdcite \\cite
\refitem cmdclass \\class
\refitem cmdcode \\code
+\refitem cmdconcept \\concept
\refitem cmdcond \\cond
\refitem cmdcopybrief \\copybrief
\refitem cmdcopydetails \\copydetails
@@ -457,6 +458,15 @@ Structural indicators
\endlatexonly
<hr>
+\section cmdconcept \\concept <name>
+
+ \addindex \\concept
+ Indicates that a comment block contains documentation for a
+ C++20 concept with name \<name\>.
+ See also the \ref cmdheaderfile "\\headerfile" command to specify the
+ header a user should be included to use the concept.
+
+<hr>
\section cmddef \\def <name>
\addindex \\def
@@ -2132,7 +2142,7 @@ Make sure you have first read \ref intro "the introduction".
\warning This command only works inside related page documentation and
\e not in other documentation blocks and only has effect in the
- the specified output!
+ specified output!
<hr>
\section cmdsection \\section <section-name> (section title)
@@ -2558,7 +2568,7 @@ Commands for displaying examples
\section cmdxmlinclude \\xmlinclude <file-name>
\addindex \\xmlinclude
- This command includes contents of the the file \<file-name\> as is in the XML documentation.
+ This command includes contents of the file \<file-name\> as is in the XML documentation.
The command is equivalent to pasting the contents of the file in the documentation and
placing \ref cmdxmlonly "\\xmlonly" and \ref cmdendxmlonly "\\endxmlonly"
commands around it.
diff --git a/doc/customize.doc b/doc/customize.doc
index 52f8d7a..eebeb5c 100644
--- a/doc/customize.doc
+++ b/doc/customize.doc
@@ -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.
*
@@ -18,12 +18,12 @@
\tableofcontents{html,latex}
-Doxygen provides various levels of customization.
-The section \ref minor_tweaks "Minor Tweaks" discusses what to
-do if you want to do minor tweaking to the look and feel of the output.
-The section \ref layout "Layout" show how to reorder and hide certain
-information on a page.
-The section \ref xmlgenerator "XML output" show how to generate
+Doxygen provides various levels of customization.
+The section \ref minor_tweaks "Minor Tweaks" discusses what to
+do if you want to do minor tweaking to the look and feel of the output.
+The section \ref layout "Layout" show how to reorder and hide certain
+information on a page.
+The section \ref xmlgenerator "XML output" show how to generate
whatever output you want based on the XML output produced by doxygen.
\section minor_tweaks Minor Tweaks
@@ -40,8 +40,8 @@ To change the overall color of the HTML output doxygen provides three options
to change the hue, saturation, and gamma correction of the colors respectively.
-For your convenience the GUI frontend \ref doxywizard_usage "Doxywizard"
-has a control that allows you to see the effect of changing the values of these options
+For your convenience the GUI frontend \ref doxywizard_usage "Doxywizard"
+has a control that allows you to see the effect of changing the values of these options
on the output in real time.
\subsection minor_tweaks_treeview Navigation
@@ -78,10 +78,10 @@ then you can also disable all indices, like so:
To make the HTML output more interactive, doxygen provides a number of options
that are disabled by default:
- enabling \ref cfg_html_dynamic_sections "HTML_DYNAMIC_SECTIONS" will make
- doxygen hide certain content (like graphs) in the HTML by default,
+ doxygen hide certain content (like graphs) in the HTML by default,
and let the reader expand these sections on request.
-- enabling \ref cfg_have_dot "HAVE_DOT" along
- with \ref cfg_interactive_svg "INTERACTIVE_SVG" while setting
+- enabling \ref cfg_have_dot "HAVE_DOT" along
+ with \ref cfg_interactive_svg "INTERACTIVE_SVG" while setting
\ref cfg_dot_image_format "DOT_IMAGE_FORMAT" to \c svg, will make doxygen
produce SVG images that will allow the user to zoom and pan (this only
happens when the size of the images exceeds a certain size).
@@ -89,24 +89,24 @@ that are disabled by default:
\subsection minor_tweaks_header_css Header, Footer, and Stylesheet changes
To tweak things like fonts or colors, margins, or other look \& feel
-aspects of the HTML output in detail, you can create a different
-<a href="https://www.w3schools.com/css/default.asp">cascading style sheet</a>.
-You can also let doxygen use a custom header and footer for each HTML
-page it generates, for instance to make the output conform to the style
+aspects of the HTML output in detail, you can create a different
+<a href="https://www.w3schools.com/css/default.asp">cascading style sheet</a>.
+You can also let doxygen use a custom header and footer for each HTML
+page it generates, for instance to make the output conform to the style
used on the rest of your web site.
To do this first run doxygen as follows:
\verbatim
-doxygen -w html header.html footer.html customdoxygen.css
+doxygen -w html header.html footer.html customdoxygen.css
\endverbatim
This will create 3 files:
- header.html is a HTML fragment which doxygen normally uses to start
a HTML page. Note that the fragment ends with a body tag and that is
contains a couple of commands of the form \$word. These will be replaced
- by doxygen on the fly.
-- footer.html is a HTML fragment which doxygen normally uses to end
- a HTML page. Also here special commands can be used. This file contain the
+ by doxygen on the fly.
+- footer.html is a HTML fragment which doxygen normally uses to end
+ a HTML page. Also here special commands can be used. This file contain the
link to www.doxygen.org and the body and html end tags.
- customdoxygen.css is the default cascading style sheet
used by doxygen. It is recommended only to look into this file and overrule
@@ -128,7 +128,7 @@ for more information about the possible meta commands you can use inside
your custom header.
\note You should not put the style sheet in the HTML output directory. Treat
-it as a source file. Doxygen will copy it for you.
+it as a source file. Doxygen will copy it for you.
\note If you use images or other external content in a custom header you
need to make sure these end up in the HTML output directory yourself,
@@ -136,24 +136,24 @@ for instance by writing a script that runs doxygen can then copies the
images to the output.
\warning The structure of headers and footers may change after upgrading to
-a newer version of doxygen, so if you are using a custom header or footer,
-it might not produce valid output anymore after upgrading.
+a newer version of doxygen, so if you are using a custom header or footer,
+it might not produce valid output anymore after upgrading.
\section layout Changing the layout of pages
In some cases you may want to change the way the output is structured.
-A different style sheet or custom headers and footers do not help in such
+A different style sheet or custom headers and footers do not help in such
case.
The solution doxygen provides is a layout file, which you can
-modify and doxygen will use to control what information is presented,
+modify and doxygen will use to control what information is presented,
in which order, and to some extent also how information is presented.
-The layout file is an XML file.
+The layout file is an XML file.
The default layout can be generated
by doxygen using the following command:
\verbatim
-doxygen -l
+doxygen -l
\endverbatim
optionally the name of the layout file can be specified, if omitted
\c DoxygenLayout.xml will be used.
@@ -192,25 +192,25 @@ The root element of the XML file is \c doxygenlayout, it has an attribute named
\c version, which will be used in the future to cope with changes that are
not backward compatible.
-The first section, identified by the \c navindex element, represents the
+The first section, identified by the \c navindex element, represents the
layout of the navigation tabs displayed at the top of each HTML page. At the
same time it also controls the items in the navigation tree in case
-\ref cfg_generate_treeview "GENERATE_TREEVIEW" is enabled.
+\ref cfg_generate_treeview "GENERATE_TREEVIEW" is enabled.
Each tab is represented by a \c tab element in the XML file.
-You can hide tabs by setting the \c visible attribute to \c no.
-You can also override the default title of a tab by specifying it as
+You can hide tabs by setting the \c visible attribute to \c no.
+You can also override the default title of a tab by specifying it as
the value of the \c title attribute. If the title field is the empty string
(the default) then doxygen will fill in an appropriate language specific title.
You can reorder the tabs by moving the tab elements in the XML file
-within the \c navindex element and even change the tree structure.
-Do not change the value of the \c type attribute however.
-Only a fixed set of types are supported, each representing a link to a
+within the \c navindex element and even change the tree structure.
+Do not change the value of the \c type attribute however.
+Only a fixed set of types are supported, each representing a link to a
specific index.
You can also add custom tabs using a type with name "user". Here is an
-example that shows how to add a tab with title "Google" pointing to
+example that shows how to add a tab with title "Google" pointing to
www.google.com:
\verbatim
@@ -222,9 +222,9 @@ www.google.com:
\endverbatim
The url field can also be a relative URL. If the URL starts with \@ref
-the link will point to a documented entities, such as a class, a function,
-a group, or a related page. Suppose we have defined a page using \@page with
-label mypage, then a tab with label "My Page" to this page would look
+the link will point to a documented entities, such as a class, a function,
+a group, or a related page. Suppose we have defined a page using \@page with
+label mypage, then a tab with label "My Page" to this page would look
as follows:
\verbatim
@@ -250,7 +250,7 @@ defined group with title "My Group":
</navindex>
\endverbatim
-Groups can be nested to form a hierarchy.
+Groups can be nested to form a hierarchy.
By default a usergroup entry in the navigation tree is a link to
a landing page with the contents of the group. You can link to a
@@ -263,7 +263,7 @@ different page using the `url` attribute just like you can for the
</tab>
\endverbatim
-The elements after \c navindex represent the layout of the different
+The elements after \c navindex represent the layout of the different
pages generated by doxygen:
- The \c class element represents the layout of all pages generated for
documented classes, structs, unions, and interfaces.
@@ -279,8 +279,8 @@ pages generated by doxygen:
Each XML element within one of the above page elements represents a certain
piece of information. Some pieces can appear in each type of page,
others are specific for a certain type of page.
-Doxygen will list the pieces in the order in which they appear
-in the XML file.
+Doxygen will list the pieces in the order in which they appear
+in the XML file.
The following generic elements are possible for each page:
<dl>
@@ -298,25 +298,25 @@ The following generic elements are possible for each page:
<dt>\c memberdecl
<dd>Represents the quick overview of members on a page (member declarations).
This elements has child elements per type of member list.
- The possible child elements are not listed in detail in the document,
- but the name of the element should be a good indication of the type
+ The possible child elements are not listed in detail in the document,
+ but the name of the element should be a good indication of the type
of members that the element represents.
<dt>\c memberdef
<dd>Represents the detailed member list on a page (member definition).
- Like the \c memberdecl element, also this element has a number of
- possible child elements.
+ Like the \c memberdecl element, also this element has a number of
+ possible child elements.
</dl>
The class page has the following specific elements:
<dl>
<dt>\c includes
- <dd>Represents the include file needed to obtain the definition for
+ <dd>Represents the include file needed to obtain the definition for
this class.
<dt>\c inheritancegraph
- <dd>Represents the inheritance relations for a class.
+ <dd>Represents the inheritance relations for a class.
Note that the CLASS_DIAGRAM option determines
if the inheritance relation is a list of base and derived classes or
- a graph.
+ a graph.
<dt>\c collaborationgraph
<dd>Represents the collaboration graph for a class.
<dt>\c allmemberslink
@@ -341,14 +341,14 @@ The file page has the following specific elements:
The group page has a specific \c groupgraph element which represents the
graph showing the dependencies between groups.
-Similarly, the directory page has a specific \c directorygraph element
-which represents the graph showing the dependencies between the directories
+Similarly, the directory page has a specific \c directorygraph element
+which represents the graph showing the dependencies between the directories
based on the \#include relations of the files inside the directories.
-Some elements have a \c visible attribute which can be
+Some elements have a \c visible attribute which can be
used to hide the fragment from the generated output, by setting the attribute's
-value to "no". You can also use the value of a configuration option to
-determine the visibility, by using
+value to "no". You can also use the value of a configuration option to
+determine the visibility, by using
its name prefixed with a dollar sign, e.g.
\verbatim
...
@@ -356,15 +356,15 @@ its name prefixed with a dollar sign, e.g.
...
\endverbatim
This was mainly added for backward compatibility.
-Note that the \c visible attribute is just a hint for doxygen.
-If no relevant information is available for a certain piece it is
-omitted even if it is set to \c yes (i.e. no empty sections are generated).
+Note that the \c visible attribute is just a hint for doxygen.
+If no relevant information is available for a certain piece it is
+omitted even if it is set to \c yes (i.e. no empty sections are generated).
Some elements have a \c title attribute. This attribute can be used
to customize the title doxygen will use as a header for the piece.
@warning at the moment you should not remove elements from the layout file
-as a way to hide information. Doing so can cause broken links in the
+as a way to hide information. Doing so can cause broken links in the
generated output!
@@ -378,27 +378,29 @@ generate the output you like. To do this set
The XML output consists of an index file named \c index.xml which
lists all items extracted by doxygen with references to the other XML files
for details. The structure of the index is described by a schema file
-\c index.xsd. All other XML files are described by the schema file
-named \c compound.xsd. If you prefer one big XML file
-you can combine the index and the other files using the
+\c index.xsd. All other XML files are described by the schema file
+named \c compound.xsd. If you prefer one big XML file
+you can combine the index and the other files using the
XSLT file \c combine.xslt.
-You can use any XML parser to parse the file or use the one that can be found
-in the \c addon/doxmlparser directory of doxygen source distribution.
-Look at \c addon/doxmlparser/include/doxmlintf.h for the interface of the
-parser and in \c addon/doxmlparser/example for examples.
+You can use any XML parser to parse the files or use the one that can be found
+in the \c addon/doxmlparser directory of doxygen's source distribution.
+Look at \c addon/doxmlparser/doxmlparser/index.py and
+\c addon/doxmlparser/doxmlparser/compound.py for the interface of the
+parser (it is generated by <a href="https://www.davekuhlman.org/generateDS.html">generatedDS</a>
+and follows the XML schema files \c index.xsd and \c compound.xsd found in
+\c templates/xml). Look in \c addon/doxmlparser/examples for examples.
The advantage of using the doxmlparser is that it
-will only read the index file into memory and then only those XML
-files that you implicitly load via navigating through the index. As a
+allows you to only read the index file into memory and then only those XML
+files that you implicitly load via navigating through the index. As a
result this works even for very large projects where reading all XML
files as one big DOM tree would not fit into memory.
See <a href="https://github.com/michaeljones/breathe">the Breathe project</a> for
-an example that uses doxygen XML output from Python to bridge it with the
+an example that uses doxygen XML output from Python to bridge it with the
<a href="http://www.sphinx-doc.org/en/stable/">Sphinx</a> document generator.
-
\htmlonly
Go to the <a href="custcmd.html">next</a> section or return to the
<a href="index.html">index</a>.
diff --git a/doc/faq.doc b/doc/faq.doc
index 95de571..16765ce 100644
--- a/doc/faq.doc
+++ b/doc/faq.doc
@@ -184,13 +184,11 @@ in the HEAD section of the HTML page.
\section faq_use_qt Why does doxygen use Qt?
-The most important reason is to have a platform abstraction for most
-Unices and Windows by means of the QFile, QFileInfo, QDir, QDate,
-QTime and QIODevice classes.
-Another reason is for the nice and bug free utility classes, like QList,
-QDict, QString, QArray, QTextStream, QRegExp, QXML etc.
+In the past (prior to version 1.9.2) doxygen used a part of Qt 2.x for various
+utility classes. These have been replaced by STL container classes in the meantime.
-The GUI front-end doxywizard uses Qt for... well... the GUI!
+The GUI front-end called Doxywizard is based on a modern version of Qt.
+Doxygen itself can also be used without the GUI.
\section faq_excl_dir How can I exclude all test directories from my directory tree?
@@ -306,6 +304,14 @@ Doc++ but that just wasn't good enough (it didn't support signals and
slots and did not have the Qt look and feel I had grown to like),
so I started to write my own tool...
+\section faq_bin How to prevent interleaved output
+
+When redirecting all the console output of doxygen, i.e. messages and warnings, this can be interleaved or
+in a non-expected order.
+The, technical, reason for this is that the `stdout` can be buffered.
+It is possible to overcome this by means of the `-b` of doxygen, like e.g `doxygen -b > out.txt 2>&1`.
+Note this might cost a little more time though.
+
\htmlonly
Go to the <a href="trouble.html">next</a> section or return to the
<a href="index.html">index</a>.
diff --git a/doc/features.doc b/doc/features.doc
index e746ac3..9c42d5b 100644
--- a/doc/features.doc
+++ b/doc/features.doc
@@ -28,7 +28,7 @@
output even from undocumented code.
<li>Generates structured XML output for parsed sources, which can be
used by external tools.
-<li>Supports C/C++, Java, (Corba and Microsoft) Java, Python, VHDL, PHP
+<li>Supports C/C++, Lex, Java, (Corba and Microsoft) Java, Python, VHDL, PHP
IDL, C#, Fortran, Objective-C 2.0, and to some extent D sources.
<li>Supports documentation of files, namespaces, packages, classes,
structs, unions, templates, variables, functions, typedefs, enums and
diff --git a/doc/install.doc b/doc/install.doc
index 99cecc6..53c4466 100644
--- a/doc/install.doc
+++ b/doc/install.doc
@@ -229,8 +229,10 @@ of the GraphViz package to render nicer diagrams, see the
If you want to produce compressed HTML files (see \ref
cfg_generate_htmlhelp "GENERATE_HTMLHELP") in the configuration file, then
you need the Microsoft HTML help workshop.
-You can download it from
-<a href="https://www.microsoft.com/en-us/download/details.aspx?id=21138">Microsoft</a>.
+In the beginning of 2021 Microsoft took the original page, with a.o. the download links,
+offline the HTML help workshop was already many years in maintenance mode).
+You can download the HTML help workshop from the web archives at
+<a href="http://web.archive.org/web/20160201063255/http://download.microsoft.com/download/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe">Installation executable</a>.
If you want to produce Qt Compressed Help files (see \ref
cfg_qhg_location "QHG_LOCATION") in the configuration file, then
diff --git a/doc/install_prefix b/doc/install_prefix
deleted file mode 100644
index 681eca9..0000000
--- a/doc/install_prefix
+++ /dev/null
@@ -1,2 +0,0 @@
-VERSION = $(VERSION)
-
diff --git a/doc/preprocessing.doc b/doc/preprocessing.doc
index 4df83ff..34aa3ed 100644
--- a/doc/preprocessing.doc
+++ b/doc/preprocessing.doc
@@ -259,6 +259,10 @@ you can run doxygen as follows:
\verbatim
doxygen -d Preprocessor
\endverbatim
+or when the line numbers are not wanted:
+\verbatim
+ doxygen -d Preprocessor -d NoLineno
+\endverbatim
This will instruct doxygen to dump the input sources to standard output after
preprocessing has been done (Hint: set <code>QUIET = YES</code> and
<code>WARNINGS = NO</code> in the configuration file to disable any other
diff --git a/doc/searching.doc b/doc/searching.doc
index 880c3f4..1bdb12d 100644
--- a/doc/searching.doc
+++ b/doc/searching.doc
@@ -43,8 +43,12 @@ has its own advantages and disadvantages:
searching, i.e. the search results are presented and adapted as you type.
This method also has its drawbacks: it is limited to searching for symbols
- only. It does not provide full text search capabilities, and it does not
+ only. It does not provide full text search capabilities and it does not
scale well to very large projects (then searching becomes very slow).
+ Furthermore the searching is done from the beginning of the indexed items, so
+ when having the available items `A_STRING`, `AA_STRING` and `STRING` and
+ typing in the search box `A` it will find `A_STRING` and `AA_STRING`, but when
+ typing e.g. `STR` it will only find `STRING` and not `A_STRING`.
<h2>2. Server side searching</h2>
If you plan to put the HTML documentation on a web server, and that
diff --git a/doc/starting.doc b/doc/starting.doc
index 3ae2692..44f2a92 100644
--- a/doc/starting.doc
+++ b/doc/starting.doc
@@ -37,7 +37,7 @@ tries to be complete):
\section step0 Step 0: Check if doxygen supports your programming language
First, assure that your programming language has a reasonable chance of being
-recognized by doxygen. These languages are supported by default: C, C++, C#,
+recognized by doxygen. These languages are supported by default: C, C++, Lex, C#,
Objective-C, IDL, Java, VHDL, PHP, Python, Fortran and D. It
is possible to configure certain file type extensions to use certain parsers:
see the \ref cfg_extension_mapping "Configuration/ExtensionMappings" for details.
@@ -120,7 +120,7 @@ Extension | Language | Extension | Language | Extension | Language
.ixx |C / C++ | .php5 |PHP | .vhdl |VHDL
.ipp |C / C++ | .inc |PHP | .ucf |VHDL
.i++ |C / C++ | .phtml |PHP | .qsf |VHDL
-.inl |C / C++ | .m |Objective-C | &nbsp; |&nbsp;
+.inl |C / C++ | .m |Objective-C | .l |Lex
.h |C / C++ | .M |Objective-C | .md |Markdown
.H |C / C++ | .py |Python | .markdown |Markdown
.hh |C / C++ | .pyw |Python | .ice |Slice
@@ -249,7 +249,8 @@ files and can be used for validation or to steer XSLT scripts.
In the `addon/doxmlparser` directory you can find a parser library for reading
the XML output produced by doxygen in an incremental way
-(see `addon/doxmlparser/include/doxmlintf.h` for the interface of the library)
+(see `addon/doxmlparser/doxmparser/index.py` and `addon/doxmlparser/doxmlparser/compound.py`
+for the interface of the library)
\subsection man_out Man page output
\addindex man
diff --git a/doc/trouble.doc b/doc/trouble.doc
index cb50399..a2e9be6 100644
--- a/doc/trouble.doc
+++ b/doc/trouble.doc
@@ -34,7 +34,7 @@
or unions with the same name in your code. It should not crash however,
rather it should ignore all of the classes with the same name except one.
<li>Some commands do not work inside the arguments of other commands.
- Inside a HTML link (i.e. \<a&nbsp;href="..."\>...\<a\>) for instance
+ Inside a HTML link (i.e. \<a&nbsp;href="..."\>...\</a\>) for instance
other commands (including other HTML commands) do not work!
The sectioning commands are an important exception.
<li>Redundant braces can confuse doxygen in some cases.
@@ -106,7 +106,8 @@ helpful and it will cost me much more time to figure out what you mean.
In the worst-case your bug report may even be completely ignored by me, so
always try to include the following information in your bug report:
- The version of doxygen you are using (for instance 1.5.3, use
- `doxygen --version` if you are not sure).
+ `doxygen --version` if you are not sure or `doxygen --Version` for a bit
+ more information).
- The name and version number of your operating system (for instance
Ubuntu Linux 18.04 LTS)
- It is usually a good idea to send along the configuration file as well,
diff --git a/doc/xmlcmds.doc b/doc/xmlcmds.doc
index 3a58301..6cb78bd 100644
--- a/doc/xmlcmds.doc
+++ b/doc/xmlcmds.doc
@@ -18,7 +18,7 @@
Doxygen supports most of the XML commands that are typically used in C#
code comments. The XML tags are defined in Appendix D of the
-<a href="http://www.ecma-international.org/publications/standards/Ecma-334.htm">ECMA-334</a>
+<a href="https://www.ecma-international.org/publications-and-standards/standards/ecma-334/">ECMA-334</a>
standard, which defines the C# language. Unfortunately, the specification is
not very precise and a number of the examples given are of poor quality.
diff --git a/filesystem/filesystem.hpp b/filesystem/filesystem.hpp
new file mode 100644
index 0000000..e4e0e27
--- /dev/null
+++ b/filesystem/filesystem.hpp
@@ -0,0 +1,5868 @@
+//---------------------------------------------------------------------------------------
+//
+// ghc::filesystem - A C++17-like filesystem implementation for C++11/C++14/C++17/C++20
+//
+//---------------------------------------------------------------------------------------
+//
+// Copyright (c) 2018, Steffen Schümann <s.schuemann@pobox.com>
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in all
+// copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+// SOFTWARE.
+//
+//---------------------------------------------------------------------------------------
+//
+// To dynamically select std::filesystem where available on most platforms,
+// you could use:
+//
+// #if ((defined(_MSVC_LANG) && _MSVC_LANG >= 201703L) || (defined(__cplusplus) && __cplusplus >= 201703L)) && defined(__has_include)
+// #if __has_include(<filesystem>) && (!defined(__MAC_OS_X_VERSION_MIN_REQUIRED) || __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500)
+// #define GHC_USE_STD_FS
+// #include <filesystem>
+// namespace fs = std::filesystem;
+// #endif
+// #endif
+// #ifndef GHC_USE_STD_FS
+// #include <ghc/filesystem.hpp>
+// namespace fs = ghc::filesystem;
+// #endif
+//
+//---------------------------------------------------------------------------------------
+#ifndef GHC_FILESYSTEM_H
+#define GHC_FILESYSTEM_H
+
+// #define BSD manifest constant only in
+// sys/param.h
+#ifndef _WIN32
+#include <sys/param.h>
+#endif
+
+#ifndef GHC_OS_DETECTED
+#if defined(__APPLE__) && defined(__MACH__)
+#define GHC_OS_MACOS
+#elif defined(__linux__)
+#define GHC_OS_LINUX
+#if defined(__ANDROID__)
+#define GHC_OS_ANDROID
+#endif
+#elif defined(_WIN64)
+#define GHC_OS_WINDOWS
+#define GHC_OS_WIN64
+#elif defined(_WIN32)
+#define GHC_OS_WINDOWS
+#define GHC_OS_WIN32
+#elif defined(__CYGWIN__)
+#define GHC_OS_CYGWIN
+#elif defined(__svr4__)
+#define GHC_OS_SYS5R4
+#elif defined(BSD)
+#define GHC_OS_BSD
+#elif defined(__EMSCRIPTEN__)
+#define GHC_OS_WEB
+#include <wasi/api.h>
+#else
+#error "Operating system currently not supported!"
+#endif
+#define GHC_OS_DETECTED
+#if (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
+#if _MSVC_LANG == 201703L
+#define GHC_FILESYSTEM_RUNNING_CPP17
+#else
+#define GHC_FILESYSTEM_RUNNING_CPP20
+#endif
+#elif (defined(__cplusplus) && __cplusplus >= 201703L)
+#if __cplusplus == 201703L
+#define GHC_FILESYSTEM_RUNNING_CPP17
+#else
+#define GHC_FILESYSTEM_RUNNING_CPP20
+#endif
+#endif
+#endif
+
+#if defined(GHC_FILESYSTEM_IMPLEMENTATION)
+#define GHC_EXPAND_IMPL
+#define GHC_INLINE
+#ifdef GHC_OS_WINDOWS
+#ifndef GHC_FS_API
+#define GHC_FS_API
+#endif
+#ifndef GHC_FS_API_CLASS
+#define GHC_FS_API_CLASS
+#endif
+#else
+#ifndef GHC_FS_API
+#define GHC_FS_API __attribute__((visibility("default")))
+#endif
+#ifndef GHC_FS_API_CLASS
+#define GHC_FS_API_CLASS __attribute__((visibility("default")))
+#endif
+#endif
+#elif defined(GHC_FILESYSTEM_FWD)
+#define GHC_INLINE
+#ifdef GHC_OS_WINDOWS
+#ifndef GHC_FS_API
+#define GHC_FS_API extern
+#endif
+#ifndef GHC_FS_API_CLASS
+#define GHC_FS_API_CLASS
+#endif
+#else
+#ifndef GHC_FS_API
+#define GHC_FS_API extern
+#endif
+#ifndef GHC_FS_API_CLASS
+#define GHC_FS_API_CLASS
+#endif
+#endif
+#else
+#define GHC_EXPAND_IMPL
+#define GHC_INLINE inline
+#ifndef GHC_FS_API
+#define GHC_FS_API
+#endif
+#ifndef GHC_FS_API_CLASS
+#define GHC_FS_API_CLASS
+#endif
+#endif
+
+#ifdef GHC_EXPAND_IMPL
+
+#ifdef GHC_OS_WINDOWS
+#include <windows.h>
+// additional includes
+#include <shellapi.h>
+#include <sys/stat.h>
+#include <sys/types.h>
+#include <wchar.h>
+#include <winioctl.h>
+#else
+#include <dirent.h>
+#include <fcntl.h>
+#include <limits.h>
+#include <sys/param.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <sys/types.h>
+#include <unistd.h>
+#ifdef GHC_OS_ANDROID
+#include <android/api-level.h>
+#if __ANDROID_API__ < 12
+#include <sys/syscall.h>
+#endif
+#include <sys/vfs.h>
+#define statvfs statfs
+#else
+#include <sys/statvfs.h>
+#endif
+#ifdef GHC_OS_CYGWIN
+#include <strings.h>
+#endif
+#if !defined(__ANDROID__) || __ANDROID_API__ >= 26
+#include <langinfo.h>
+#endif
+#endif
+#ifdef GHC_OS_MACOS
+#include <Availability.h>
+#endif
+
+#if defined(__cpp_impl_three_way_comparison) && defined(__has_include)
+#if __has_include(<compare>)
+#define GHC_HAS_THREEWAY_COMP
+#include <compare>
+#endif
+#endif
+
+#include <algorithm>
+#include <cctype>
+#include <chrono>
+#include <clocale>
+#include <cstdlib>
+#include <cstring>
+#include <fstream>
+#include <functional>
+#include <memory>
+#include <stack>
+#include <stdexcept>
+#include <string>
+#include <system_error>
+#include <type_traits>
+#include <utility>
+#include <vector>
+
+#else // GHC_EXPAND_IMPL
+
+#if defined(__cpp_impl_three_way_comparison) && defined(__has_include)
+#if __has_include(<compare>)
+#define GHC_HAS_THREEWAY_COMP
+#include <compare>
+#endif
+#endif
+#include <chrono>
+#include <fstream>
+#include <memory>
+#include <stack>
+#include <stdexcept>
+#include <string>
+#include <system_error>
+#ifdef GHC_OS_WINDOWS
+#include <vector>
+#endif
+#endif // GHC_EXPAND_IMPL
+
+// After standard library includes.
+// Standard library support for std::string_view.
+#if defined(__cpp_lib_string_view)
+#define GHC_HAS_STD_STRING_VIEW
+#elif defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION >= 4000) && (__cplusplus >= 201402)
+#define GHC_HAS_STD_STRING_VIEW
+#elif defined(_GLIBCXX_RELEASE) && (_GLIBCXX_RELEASE >= 7) && (__cplusplus >= 201703)
+#define GHC_HAS_STD_STRING_VIEW
+#elif defined(_MSC_VER) && (_MSC_VER >= 1910 && _MSVC_LANG >= 201703)
+#define GHC_HAS_STD_STRING_VIEW
+#endif
+
+// Standard library support for std::experimental::string_view.
+#if defined(_LIBCPP_VERSION) && (_LIBCPP_VERSION >= 3700 && _LIBCPP_VERSION < 7000) && (__cplusplus >= 201402)
+#define GHC_HAS_STD_EXPERIMENTAL_STRING_VIEW
+#elif defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) || (__GNUC__ > 4)) && (__cplusplus >= 201402)
+#define GHC_HAS_STD_EXPERIMENTAL_STRING_VIEW
+#endif
+
+#if defined(GHC_HAS_STD_STRING_VIEW)
+#include <string_view>
+#elif defined(GHC_HAS_STD_EXPERIMENTAL_STRING_VIEW)
+#include <experimental/string_view>
+#endif
+
+//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+// Behaviour Switches (see README.md, should match the config in test/filesystem_test.cpp):
+//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+// Enforce C++17 API where possible when compiling for C++20, handles the following cases:
+// * fs::path::u8string() returns std::string instead of std::u8string
+// #define GHC_FILESYSTEM_ENFORCE_CPP17_API
+//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+// LWG #2682 disables the since then invalid use of the copy option create_symlinks on directories
+// configure LWG conformance ()
+#define LWG_2682_BEHAVIOUR
+//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+// LWG #2395 makes crate_directory/create_directories not emit an error if there is a regular
+// file with that name, it is superseded by P1164R1, so only activate if really needed
+// #define LWG_2935_BEHAVIOUR
+//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+// LWG #2936 enables new element wise (more expensive) path comparison
+// * if this->root_name().native().compare(p.root_name().native()) != 0 return result
+// * if this->has_root_directory() and !p.has_root_directory() return -1
+// * if !this->has_root_directory() and p.has_root_directory() return -1
+// * else result of element wise comparison of path iteration where first comparison is != 0 or 0
+// if all comparisons are 0 (on Windows this implementation does case insensitive root_name()
+// comparison)
+#define LWG_2936_BEHAVIOUR
+//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+// LWG #2937 enforces that fs::equivalent emits an error, if !fs::exists(p1)||!exists(p2)
+#define LWG_2937_BEHAVIOUR
+//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+// UTF8-Everywhere is the original behaviour of ghc::filesystem. But since v1.5 the windows
+// version defaults to std::wstring storage backend. Still all std::string will be interpreted
+// as UTF-8 encoded. With this define you can enfoce the old behavior on Windows, using
+// std::string as backend and for fs::path::native() and char for fs::path::c_str(). This
+// needs more conversions so it is (an was before v1.5) slower, bot might help keeping source
+// homogeneous in a multi platform project.
+// #define GHC_WIN_DISABLE_WSTRING_STORAGE_TYPE
+//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+// Raise errors/exceptions when invalid unicode codepoints or UTF-8 sequences are found,
+// instead of replacing them with the unicode replacement character (U+FFFD).
+// #define GHC_RAISE_UNICODE_ERRORS
+//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+// Automatic prefix windows path with "\\?\" if they would break the MAX_PATH length.
+// instead of replacing them with the unicode replacement character (U+FFFD).
+#ifndef GHC_WIN_DISABLE_AUTO_PREFIXES
+#define GHC_WIN_AUTO_PREFIX_LONG_PATH
+#endif // GHC_WIN_DISABLE_AUTO_PREFIXES
+//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+// ghc::filesystem version in decimal (major * 10000 + minor * 100 + patch)
+#define GHC_FILESYSTEM_VERSION 10504L
+
+#if !defined(GHC_WITH_EXCEPTIONS) && (defined(__EXCEPTIONS) || defined(__cpp_exceptions) || defined(_CPPUNWIND))
+#define GHC_WITH_EXCEPTIONS
+#endif
+#if !defined(GHC_WITH_EXCEPTIONS) && defined(GHC_RAISE_UNICODE_ERRORS)
+#error "Can't raise unicode errors with exception support disabled"
+#endif
+
+namespace ghc {
+namespace filesystem {
+
+#if defined(GHC_HAS_CUSTOM_STRING_VIEW)
+#define GHC_WITH_STRING_VIEW
+#elif defined(GHC_HAS_STD_STRING_VIEW)
+#define GHC_WITH_STRING_VIEW
+using std::basic_string_view;
+#elif defined(GHC_HAS_STD_EXPERIMENTAL_STRING_VIEW)
+#define GHC_WITH_STRING_VIEW
+using std::experimental::basic_string_view;
+#endif
+
+// temporary existing exception type for yet unimplemented parts
+class GHC_FS_API_CLASS not_implemented_exception : public std::logic_error
+{
+public:
+ not_implemented_exception()
+ : std::logic_error("function not implemented yet.")
+ {
+ }
+};
+
+template <typename char_type>
+class path_helper_base
+{
+public:
+ using value_type = char_type;
+#ifdef GHC_OS_WINDOWS
+ static constexpr value_type preferred_separator = '\\';
+#else
+ static constexpr value_type preferred_separator = '/';
+#endif
+};
+
+#if __cplusplus < 201703L
+template <typename char_type>
+constexpr char_type path_helper_base<char_type>::preferred_separator;
+#endif
+
+#ifdef GHC_OS_WINDOWS
+class path;
+namespace detail {
+bool has_executable_extension(const path& p);
+}
+#endif
+
+// 30.10.8 class path
+class GHC_FS_API_CLASS path
+#if defined(GHC_OS_WINDOWS) && !defined(GHC_WIN_DISABLE_WSTRING_STORAGE_TYPE)
+#define GHC_USE_WCHAR_T
+#define GHC_NATIVEWP(p) p.c_str()
+#define GHC_PLATFORM_LITERAL(str) L##str
+ : private path_helper_base<std::wstring::value_type>
+{
+public:
+ using path_helper_base<std::wstring::value_type>::value_type;
+#else
+#define GHC_NATIVEWP(p) p.wstring().c_str()
+#define GHC_PLATFORM_LITERAL(str) str
+ : private path_helper_base<std::string::value_type>
+{
+public:
+ using path_helper_base<std::string::value_type>::value_type;
+#endif
+ using string_type = std::basic_string<value_type>;
+ using path_helper_base<value_type>::preferred_separator;
+
+ // 30.10.10.1 enumeration format
+ /// The path format in which the constructor argument is given.
+ enum format {
+ generic_format, ///< The generic format, internally used by
+ ///< ghc::filesystem::path with slashes
+ native_format, ///< The format native to the current platform this code
+ ///< is build for
+ auto_format, ///< Try to auto-detect the format, fallback to native
+ };
+
+ template <class T>
+ struct _is_basic_string : std::false_type
+ {
+ };
+ template <class CharT, class Traits, class Alloc>
+ struct _is_basic_string<std::basic_string<CharT, Traits, Alloc>> : std::true_type
+ {
+ };
+ template <class CharT>
+ struct _is_basic_string<std::basic_string<CharT, std::char_traits<CharT>, std::allocator<CharT>>> : std::true_type
+ {
+ };
+#ifdef GHC_WITH_STRING_VIEW
+ template <class CharT, class Traits>
+ struct _is_basic_string<basic_string_view<CharT, Traits>> : std::true_type
+ {
+ };
+ template <class CharT>
+ struct _is_basic_string<basic_string_view<CharT, std::char_traits<CharT>>> : std::true_type
+ {
+ };
+#endif
+
+ template <typename T1, typename T2 = void>
+ using path_type = typename std::enable_if<!std::is_same<path, T1>::value, path>::type;
+ template <typename T>
+ using path_from_string = typename std::enable_if<_is_basic_string<T>::value || std::is_same<char const*, typename std::decay<T>::type>::value || std::is_same<char*, typename std::decay<T>::type>::value ||
+ std::is_same<wchar_t const*, typename std::decay<T>::type>::value || std::is_same<wchar_t*, typename std::decay<T>::type>::value,
+ path>::type;
+ template <typename T>
+ using path_type_EcharT = typename std::enable_if<std::is_same<T, char>::value || std::is_same<T, char16_t>::value || std::is_same<T, char32_t>::value || std::is_same<T, wchar_t>::value, path>::type;
+ // 30.10.8.4.1 constructors and destructor
+ path() noexcept;
+ path(const path& p);
+ path(path&& p) noexcept;
+ path(string_type&& source, format fmt = auto_format);
+ template <class Source, typename = path_from_string<Source>>
+ path(const Source& source, format fmt = auto_format);
+ template <class InputIterator>
+ path(InputIterator first, InputIterator last, format fmt = auto_format);
+#ifdef GHC_WITH_EXCEPTIONS
+ template <class Source, typename = path_from_string<Source>>
+ path(const Source& source, const std::locale& loc, format fmt = auto_format);
+ template <class InputIterator>
+ path(InputIterator first, InputIterator last, const std::locale& loc, format fmt = auto_format);
+#endif
+ ~path();
+
+ // 30.10.8.4.2 assignments
+ path& operator=(const path& p);
+ path& operator=(path&& p) noexcept;
+ path& operator=(string_type&& source);
+ path& assign(string_type&& source);
+ template <class Source>
+ path& operator=(const Source& source);
+ template <class Source>
+ path& assign(const Source& source);
+ template <class InputIterator>
+ path& assign(InputIterator first, InputIterator last);
+
+ // 30.10.8.4.3 appends
+ path& operator/=(const path& p);
+ template <class Source>
+ path& operator/=(const Source& source);
+ template <class Source>
+ path& append(const Source& source);
+ template <class InputIterator>
+ path& append(InputIterator first, InputIterator last);
+
+ // 30.10.8.4.4 concatenation
+ path& operator+=(const path& x);
+ path& operator+=(const string_type& x);
+#ifdef GHC_WITH_STRING_VIEW
+ path& operator+=(basic_string_view<value_type> x);
+#endif
+ path& operator+=(const value_type* x);
+ path& operator+=(value_type x);
+ template <class Source>
+ path_from_string<Source>& operator+=(const Source& x);
+ template <class EcharT>
+ path_type_EcharT<EcharT>& operator+=(EcharT x);
+ template <class Source>
+ path& concat(const Source& x);
+ template <class InputIterator>
+ path& concat(InputIterator first, InputIterator last);
+
+ // 30.10.8.4.5 modifiers
+ void clear() noexcept;
+ path& make_preferred();
+ path& remove_filename();
+ path& replace_filename(const path& replacement);
+ path& replace_extension(const path& replacement = path());
+ void swap(path& rhs) noexcept;
+
+ // 30.10.8.4.6 native format observers
+ const string_type& native() const noexcept;
+ const value_type* c_str() const noexcept;
+ operator string_type() const;
+ template <class EcharT, class traits = std::char_traits<EcharT>, class Allocator = std::allocator<EcharT>>
+ std::basic_string<EcharT, traits, Allocator> string(const Allocator& a = Allocator()) const;
+ std::string string() const;
+ std::wstring wstring() const;
+#if defined(__cpp_lib_char8_t) && !defined(GHC_FILESYSTEM_ENFORCE_CPP17_API)
+ std::u8string u8string() const;
+#else
+ std::string u8string() const;
+#endif
+ std::u16string u16string() const;
+ std::u32string u32string() const;
+
+ // 30.10.8.4.7 generic format observers
+ template <class EcharT, class traits = std::char_traits<EcharT>, class Allocator = std::allocator<EcharT>>
+ std::basic_string<EcharT, traits, Allocator> generic_string(const Allocator& a = Allocator()) const;
+ std::string generic_string() const;
+ std::wstring generic_wstring() const;
+#if defined(__cpp_lib_char8_t) && !defined(GHC_FILESYSTEM_ENFORCE_CPP17_API)
+ std::u8string generic_u8string() const;
+#else
+ std::string generic_u8string() const;
+#endif
+ std::u16string generic_u16string() const;
+ std::u32string generic_u32string() const;
+
+ // 30.10.8.4.8 compare
+ int compare(const path& p) const noexcept;
+ int compare(const string_type& s) const;
+#ifdef GHC_WITH_STRING_VIEW
+ int compare(basic_string_view<value_type> s) const;
+#endif
+ int compare(const value_type* s) const;
+
+ // 30.10.8.4.9 decomposition
+ path root_name() const;
+ path root_directory() const;
+ path root_path() const;
+ path relative_path() const;
+ path parent_path() const;
+ path filename() const;
+ path stem() const;
+ path extension() const;
+
+ // 30.10.8.4.10 query
+ bool empty() const noexcept;
+ bool has_root_name() const;
+ bool has_root_directory() const;
+ bool has_root_path() const;
+ bool has_relative_path() const;
+ bool has_parent_path() const;
+ bool has_filename() const;
+ bool has_stem() const;
+ bool has_extension() const;
+ bool is_absolute() const;
+ bool is_relative() const;
+
+ // 30.10.8.4.11 generation
+ path lexically_normal() const;
+ path lexically_relative(const path& base) const;
+ path lexically_proximate(const path& base) const;
+
+ // 30.10.8.5 iterators
+ class iterator;
+ using const_iterator = iterator;
+ iterator begin() const;
+ iterator end() const;
+
+private:
+ using impl_value_type = value_type;
+ using impl_string_type = std::basic_string<impl_value_type>;
+ friend class directory_iterator;
+ void append_name(const value_type* name);
+ static constexpr impl_value_type generic_separator = '/';
+ template <typename InputIterator>
+ class input_iterator_range
+ {
+ public:
+ typedef InputIterator iterator;
+ typedef InputIterator const_iterator;
+ typedef typename InputIterator::difference_type difference_type;
+
+ input_iterator_range(const InputIterator& first, const InputIterator& last)
+ : _first(first)
+ , _last(last)
+ {
+ }
+
+ InputIterator begin() const { return _first; }
+ InputIterator end() const { return _last; }
+
+ private:
+ InputIterator _first;
+ InputIterator _last;
+ };
+ friend void swap(path& lhs, path& rhs) noexcept;
+ friend size_t hash_value(const path& p) noexcept;
+ friend path canonical(const path& p, std::error_code& ec);
+ string_type::size_type root_name_length() const noexcept;
+ void postprocess_path_with_format(format fmt);
+ void check_long_path();
+ impl_string_type _path;
+#ifdef GHC_OS_WINDOWS
+ void handle_prefixes();
+ friend bool detail::has_executable_extension(const path& p);
+#ifdef GHC_WIN_AUTO_PREFIX_LONG_PATH
+ string_type::size_type _prefixLength{0};
+#else // GHC_WIN_AUTO_PREFIX_LONG_PATH
+ static const string_type::size_type _prefixLength{0};
+#endif // GHC_WIN_AUTO_PREFIX_LONG_PATH
+#else
+ static const string_type::size_type _prefixLength{0};
+#endif
+};
+
+// 30.10.8.6 path non-member functions
+GHC_FS_API void swap(path& lhs, path& rhs) noexcept;
+GHC_FS_API size_t hash_value(const path& p) noexcept;
+#ifdef GHC_HAS_THREEWAY_COMP
+GHC_FS_API std::strong_ordering operator<=>(const path& lhs, const path& rhs) noexcept;
+#endif
+GHC_FS_API bool operator==(const path& lhs, const path& rhs) noexcept;
+GHC_FS_API bool operator!=(const path& lhs, const path& rhs) noexcept;
+GHC_FS_API bool operator<(const path& lhs, const path& rhs) noexcept;
+GHC_FS_API bool operator<=(const path& lhs, const path& rhs) noexcept;
+GHC_FS_API bool operator>(const path& lhs, const path& rhs) noexcept;
+GHC_FS_API bool operator>=(const path& lhs, const path& rhs) noexcept;
+GHC_FS_API path operator/(const path& lhs, const path& rhs);
+
+// 30.10.8.6.1 path inserter and extractor
+template <class charT, class traits>
+std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const path& p);
+template <class charT, class traits>
+std::basic_istream<charT, traits>& operator>>(std::basic_istream<charT, traits>& is, path& p);
+
+// 30.10.8.6.2 path factory functions
+template <class Source, typename = path::path_from_string<Source>>
+#if defined(__cpp_lib_char8_t) && !defined(GHC_FILESYSTEM_ENFORCE_CPP17_API)
+[[deprecated("use ghc::filesystem::path::path() with std::u8string instead")]]
+#endif
+path u8path(const Source& source);
+template <class InputIterator>
+#if defined(__cpp_lib_char8_t) && !defined(GHC_FILESYSTEM_ENFORCE_CPP17_API)
+[[deprecated("use ghc::filesystem::path::path() with std::u8string instead")]]
+#endif
+path u8path(InputIterator first, InputIterator last);
+
+// 30.10.9 class filesystem_error
+class GHC_FS_API_CLASS filesystem_error : public std::system_error
+{
+public:
+ filesystem_error(const std::string& what_arg, std::error_code ec);
+ filesystem_error(const std::string& what_arg, const path& p1, std::error_code ec);
+ filesystem_error(const std::string& what_arg, const path& p1, const path& p2, std::error_code ec);
+ const path& path1() const noexcept;
+ const path& path2() const noexcept;
+ const char* what() const noexcept override;
+
+private:
+ std::string _what_arg;
+ std::error_code _ec;
+ path _p1, _p2;
+};
+
+class GHC_FS_API_CLASS path::iterator
+{
+public:
+ using value_type = const path;
+ using difference_type = std::ptrdiff_t;
+ using pointer = const path*;
+ using reference = const path&;
+ using iterator_category = std::bidirectional_iterator_tag;
+
+ iterator();
+ iterator(const path& p, const impl_string_type::const_iterator& pos);
+ iterator& operator++();
+ iterator operator++(int);
+ iterator& operator--();
+ iterator operator--(int);
+ bool operator==(const iterator& other) const;
+ bool operator!=(const iterator& other) const;
+ reference operator*() const;
+ pointer operator->() const;
+
+private:
+ friend class path;
+ impl_string_type::const_iterator increment(const impl_string_type::const_iterator& pos) const;
+ impl_string_type::const_iterator decrement(const impl_string_type::const_iterator& pos) const;
+ void updateCurrent();
+ impl_string_type::const_iterator _first;
+ impl_string_type::const_iterator _last;
+ impl_string_type::const_iterator _prefix;
+ impl_string_type::const_iterator _root;
+ impl_string_type::const_iterator _iter;
+ path _current;
+};
+
+struct space_info
+{
+ uintmax_t capacity;
+ uintmax_t free;
+ uintmax_t available;
+};
+
+// 30.10.10, enumerations
+enum class file_type {
+ none,
+ not_found,
+ regular,
+ directory,
+ symlink,
+ block,
+ character,
+ fifo,
+ socket,
+ unknown,
+};
+
+enum class perms : uint16_t {
+ none = 0,
+
+ owner_read = 0400,
+ owner_write = 0200,
+ owner_exec = 0100,
+ owner_all = 0700,
+
+ group_read = 040,
+ group_write = 020,
+ group_exec = 010,
+ group_all = 070,
+
+ others_read = 04,
+ others_write = 02,
+ others_exec = 01,
+ others_all = 07,
+
+ all = 0777,
+ set_uid = 04000,
+ set_gid = 02000,
+ sticky_bit = 01000,
+
+ mask = 07777,
+ unknown = 0xffff
+};
+
+enum class perm_options : uint16_t {
+ replace = 3,
+ add = 1,
+ remove = 2,
+ nofollow = 4,
+};
+
+enum class copy_options : uint16_t {
+ none = 0,
+
+ skip_existing = 1,
+ overwrite_existing = 2,
+ update_existing = 4,
+
+ recursive = 8,
+
+ copy_symlinks = 0x10,
+ skip_symlinks = 0x20,
+
+ directories_only = 0x40,
+ create_symlinks = 0x80,
+#ifndef GHC_OS_WEB
+ create_hard_links = 0x100
+#endif
+};
+
+enum class directory_options : uint16_t {
+ none = 0,
+ follow_directory_symlink = 1,
+ skip_permission_denied = 2,
+};
+
+// 30.10.11 class file_status
+class GHC_FS_API_CLASS file_status
+{
+public:
+ // 30.10.11.1 constructors and destructor
+ file_status() noexcept;
+ explicit file_status(file_type ft, perms prms = perms::unknown) noexcept;
+ file_status(const file_status&) noexcept;
+ file_status(file_status&&) noexcept;
+ ~file_status();
+ // assignments:
+ file_status& operator=(const file_status&) noexcept;
+ file_status& operator=(file_status&&) noexcept;
+ // 30.10.11.3 modifiers
+ void type(file_type ft) noexcept;
+ void permissions(perms prms) noexcept;
+ // 30.10.11.2 observers
+ file_type type() const noexcept;
+ perms permissions() const noexcept;
+ friend bool operator==(const file_status& lhs, const file_status& rhs) noexcept { return lhs.type() == rhs.type() && lhs.permissions() == rhs.permissions(); }
+private:
+ file_type _type;
+ perms _perms;
+};
+
+using file_time_type = std::chrono::time_point<std::chrono::system_clock>;
+
+// 30.10.12 Class directory_entry
+class GHC_FS_API_CLASS directory_entry
+{
+public:
+ // 30.10.12.1 constructors and destructor
+ directory_entry() noexcept = default;
+ directory_entry(const directory_entry&) = default;
+ directory_entry(directory_entry&&) noexcept = default;
+#ifdef GHC_WITH_EXCEPTIONS
+ explicit directory_entry(const path& p);
+#endif
+ directory_entry(const path& p, std::error_code& ec);
+ ~directory_entry();
+
+ // assignments:
+ directory_entry& operator=(const directory_entry&) = default;
+ directory_entry& operator=(directory_entry&&) noexcept = default;
+
+ // 30.10.12.2 modifiers
+#ifdef GHC_WITH_EXCEPTIONS
+ void assign(const path& p);
+ void replace_filename(const path& p);
+ void refresh();
+#endif
+ void assign(const path& p, std::error_code& ec);
+ void replace_filename(const path& p, std::error_code& ec);
+ void refresh(std::error_code& ec) noexcept;
+
+ // 30.10.12.3 observers
+ const filesystem::path& path() const noexcept;
+ operator const filesystem::path&() const noexcept;
+#ifdef GHC_WITH_EXCEPTIONS
+ bool exists() const;
+ bool is_block_file() const;
+ bool is_character_file() const;
+ bool is_directory() const;
+ bool is_fifo() const;
+ bool is_other() const;
+ bool is_regular_file() const;
+ bool is_socket() const;
+ bool is_symlink() const;
+ uintmax_t file_size() const;
+ file_time_type last_write_time() const;
+ file_status status() const;
+ file_status symlink_status() const;
+#endif
+ bool exists(std::error_code& ec) const noexcept;
+ bool is_block_file(std::error_code& ec) const noexcept;
+ bool is_character_file(std::error_code& ec) const noexcept;
+ bool is_directory(std::error_code& ec) const noexcept;
+ bool is_fifo(std::error_code& ec) const noexcept;
+ bool is_other(std::error_code& ec) const noexcept;
+ bool is_regular_file(std::error_code& ec) const noexcept;
+ bool is_socket(std::error_code& ec) const noexcept;
+ bool is_symlink(std::error_code& ec) const noexcept;
+ uintmax_t file_size(std::error_code& ec) const noexcept;
+ file_time_type last_write_time(std::error_code& ec) const noexcept;
+ file_status status(std::error_code& ec) const noexcept;
+ file_status symlink_status(std::error_code& ec) const noexcept;
+
+#ifndef GHC_OS_WEB
+#ifdef GHC_WITH_EXCEPTIONS
+ uintmax_t hard_link_count() const;
+#endif
+ uintmax_t hard_link_count(std::error_code& ec) const noexcept;
+#endif
+
+#ifdef GHC_HAS_THREEWAY_COMP
+ std::strong_ordering operator<=>(const directory_entry& rhs) const noexcept;
+#endif
+ bool operator<(const directory_entry& rhs) const noexcept;
+ bool operator==(const directory_entry& rhs) const noexcept;
+ bool operator!=(const directory_entry& rhs) const noexcept;
+ bool operator<=(const directory_entry& rhs) const noexcept;
+ bool operator>(const directory_entry& rhs) const noexcept;
+ bool operator>=(const directory_entry& rhs) const noexcept;
+
+private:
+ friend class directory_iterator;
+#ifdef GHC_WITH_EXCEPTIONS
+ file_type status_file_type() const;
+#endif
+ file_type status_file_type(std::error_code& ec) const noexcept;
+ filesystem::path _path;
+ file_status _status;
+ file_status _symlink_status;
+ uintmax_t _file_size = static_cast<uintmax_t>(-1);
+#ifndef GHC_OS_WINDOWS
+ uintmax_t _hard_link_count = static_cast<uintmax_t>(-1);
+#endif
+ time_t _last_write_time = 0;
+};
+
+// 30.10.13 Class directory_iterator
+class GHC_FS_API_CLASS directory_iterator
+{
+public:
+ class GHC_FS_API_CLASS proxy
+ {
+ public:
+ const directory_entry& operator*() const& noexcept { return _dir_entry; }
+ directory_entry operator*() && noexcept { return std::move(_dir_entry); }
+
+ private:
+ explicit proxy(const directory_entry& dir_entry)
+ : _dir_entry(dir_entry)
+ {
+ }
+ friend class directory_iterator;
+ friend class recursive_directory_iterator;
+ directory_entry _dir_entry;
+ };
+ using iterator_category = std::input_iterator_tag;
+ using value_type = directory_entry;
+ using difference_type = std::ptrdiff_t;
+ using pointer = const directory_entry*;
+ using reference = const directory_entry&;
+
+ // 30.10.13.1 member functions
+ directory_iterator() noexcept;
+#ifdef GHC_WITH_EXCEPTIONS
+ explicit directory_iterator(const path& p);
+ directory_iterator(const path& p, directory_options options);
+#endif
+ directory_iterator(const path& p, std::error_code& ec) noexcept;
+ directory_iterator(const path& p, directory_options options, std::error_code& ec) noexcept;
+ directory_iterator(const directory_iterator& rhs);
+ directory_iterator(directory_iterator&& rhs) noexcept;
+ ~directory_iterator();
+ directory_iterator& operator=(const directory_iterator& rhs);
+ directory_iterator& operator=(directory_iterator&& rhs) noexcept;
+ const directory_entry& operator*() const;
+ const directory_entry* operator->() const;
+#ifdef GHC_WITH_EXCEPTIONS
+ directory_iterator& operator++();
+#endif
+ directory_iterator& increment(std::error_code& ec) noexcept;
+
+ // other members as required by 27.2.3, input iterators
+#ifdef GHC_WITH_EXCEPTIONS
+ proxy operator++(int)
+ {
+ proxy p{**this};
+ ++*this;
+ return p;
+ }
+#endif
+ bool operator==(const directory_iterator& rhs) const;
+ bool operator!=(const directory_iterator& rhs) const;
+
+private:
+ friend class recursive_directory_iterator;
+ class impl;
+ std::shared_ptr<impl> _impl;
+};
+
+// 30.10.13.2 directory_iterator non-member functions
+GHC_FS_API directory_iterator begin(directory_iterator iter) noexcept;
+GHC_FS_API directory_iterator end(const directory_iterator&) noexcept;
+
+// 30.10.14 class recursive_directory_iterator
+class GHC_FS_API_CLASS recursive_directory_iterator
+{
+public:
+ using iterator_category = std::input_iterator_tag;
+ using value_type = directory_entry;
+ using difference_type = std::ptrdiff_t;
+ using pointer = const directory_entry*;
+ using reference = const directory_entry&;
+
+ // 30.10.14.1 constructors and destructor
+ recursive_directory_iterator() noexcept;
+#ifdef GHC_WITH_EXCEPTIONS
+ explicit recursive_directory_iterator(const path& p);
+ recursive_directory_iterator(const path& p, directory_options options);
+#endif
+ recursive_directory_iterator(const path& p, directory_options options, std::error_code& ec) noexcept;
+ recursive_directory_iterator(const path& p, std::error_code& ec) noexcept;
+ recursive_directory_iterator(const recursive_directory_iterator& rhs);
+ recursive_directory_iterator(recursive_directory_iterator&& rhs) noexcept;
+ ~recursive_directory_iterator();
+
+ // 30.10.14.1 observers
+ directory_options options() const;
+ int depth() const;
+ bool recursion_pending() const;
+
+ const directory_entry& operator*() const;
+ const directory_entry* operator->() const;
+
+ // 30.10.14.1 modifiers recursive_directory_iterator&
+ recursive_directory_iterator& operator=(const recursive_directory_iterator& rhs);
+ recursive_directory_iterator& operator=(recursive_directory_iterator&& rhs) noexcept;
+#ifdef GHC_WITH_EXCEPTIONS
+ recursive_directory_iterator& operator++();
+#endif
+ recursive_directory_iterator& increment(std::error_code& ec) noexcept;
+
+#ifdef GHC_WITH_EXCEPTIONS
+ void pop();
+#endif
+ void pop(std::error_code& ec);
+ void disable_recursion_pending();
+
+ // other members as required by 27.2.3, input iterators
+#ifdef GHC_WITH_EXCEPTIONS
+ directory_iterator::proxy operator++(int)
+ {
+ directory_iterator::proxy proxy{**this};
+ ++*this;
+ return proxy;
+ }
+#endif
+ bool operator==(const recursive_directory_iterator& rhs) const;
+ bool operator!=(const recursive_directory_iterator& rhs) const;
+
+private:
+ struct recursive_directory_iterator_impl
+ {
+ directory_options _options;
+ bool _recursion_pending;
+ std::stack<directory_iterator> _dir_iter_stack;
+ recursive_directory_iterator_impl(directory_options options, bool recursion_pending)
+ : _options(options)
+ , _recursion_pending(recursion_pending)
+ {
+ }
+ };
+ std::shared_ptr<recursive_directory_iterator_impl> _impl;
+};
+
+// 30.10.14.2 directory_iterator non-member functions
+GHC_FS_API recursive_directory_iterator begin(recursive_directory_iterator iter) noexcept;
+GHC_FS_API recursive_directory_iterator end(const recursive_directory_iterator&) noexcept;
+
+// 30.10.15 filesystem operations
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_FS_API path absolute(const path& p);
+GHC_FS_API path canonical(const path& p);
+GHC_FS_API void copy(const path& from, const path& to);
+GHC_FS_API void copy(const path& from, const path& to, copy_options options);
+GHC_FS_API bool copy_file(const path& from, const path& to);
+GHC_FS_API bool copy_file(const path& from, const path& to, copy_options option);
+GHC_FS_API void copy_symlink(const path& existing_symlink, const path& new_symlink);
+GHC_FS_API bool create_directories(const path& p);
+GHC_FS_API bool create_directory(const path& p);
+GHC_FS_API bool create_directory(const path& p, const path& attributes);
+GHC_FS_API void create_directory_symlink(const path& to, const path& new_symlink);
+GHC_FS_API void create_symlink(const path& to, const path& new_symlink);
+GHC_FS_API path current_path();
+GHC_FS_API void current_path(const path& p);
+GHC_FS_API bool exists(const path& p);
+GHC_FS_API bool equivalent(const path& p1, const path& p2);
+GHC_FS_API uintmax_t file_size(const path& p);
+GHC_FS_API bool is_block_file(const path& p);
+GHC_FS_API bool is_character_file(const path& p);
+GHC_FS_API bool is_directory(const path& p);
+GHC_FS_API bool is_empty(const path& p);
+GHC_FS_API bool is_fifo(const path& p);
+GHC_FS_API bool is_other(const path& p);
+GHC_FS_API bool is_regular_file(const path& p);
+GHC_FS_API bool is_socket(const path& p);
+GHC_FS_API bool is_symlink(const path& p);
+GHC_FS_API file_time_type last_write_time(const path& p);
+GHC_FS_API void last_write_time(const path& p, file_time_type new_time);
+GHC_FS_API void permissions(const path& p, perms prms, perm_options opts = perm_options::replace);
+GHC_FS_API path proximate(const path& p, const path& base = current_path());
+GHC_FS_API path read_symlink(const path& p);
+GHC_FS_API path relative(const path& p, const path& base = current_path());
+GHC_FS_API bool remove(const path& p);
+GHC_FS_API uintmax_t remove_all(const path& p);
+GHC_FS_API void rename(const path& from, const path& to);
+GHC_FS_API void resize_file(const path& p, uintmax_t size);
+GHC_FS_API space_info space(const path& p);
+GHC_FS_API file_status status(const path& p);
+GHC_FS_API file_status symlink_status(const path& p);
+GHC_FS_API path temp_directory_path();
+GHC_FS_API path weakly_canonical(const path& p);
+#endif
+GHC_FS_API path absolute(const path& p, std::error_code& ec);
+GHC_FS_API path canonical(const path& p, std::error_code& ec);
+GHC_FS_API void copy(const path& from, const path& to, std::error_code& ec) noexcept;
+GHC_FS_API void copy(const path& from, const path& to, copy_options options, std::error_code& ec) noexcept;
+GHC_FS_API bool copy_file(const path& from, const path& to, std::error_code& ec) noexcept;
+GHC_FS_API bool copy_file(const path& from, const path& to, copy_options option, std::error_code& ec) noexcept;
+GHC_FS_API void copy_symlink(const path& existing_symlink, const path& new_symlink, std::error_code& ec) noexcept;
+GHC_FS_API bool create_directories(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API bool create_directory(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API bool create_directory(const path& p, const path& attributes, std::error_code& ec) noexcept;
+GHC_FS_API void create_directory_symlink(const path& to, const path& new_symlink, std::error_code& ec) noexcept;
+GHC_FS_API void create_symlink(const path& to, const path& new_symlink, std::error_code& ec) noexcept;
+GHC_FS_API path current_path(std::error_code& ec);
+GHC_FS_API void current_path(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API bool exists(file_status s) noexcept;
+GHC_FS_API bool exists(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API bool equivalent(const path& p1, const path& p2, std::error_code& ec) noexcept;
+GHC_FS_API uintmax_t file_size(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API bool is_block_file(file_status s) noexcept;
+GHC_FS_API bool is_block_file(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API bool is_character_file(file_status s) noexcept;
+GHC_FS_API bool is_character_file(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API bool is_directory(file_status s) noexcept;
+GHC_FS_API bool is_directory(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API bool is_empty(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API bool is_fifo(file_status s) noexcept;
+GHC_FS_API bool is_fifo(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API bool is_other(file_status s) noexcept;
+GHC_FS_API bool is_other(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API bool is_regular_file(file_status s) noexcept;
+GHC_FS_API bool is_regular_file(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API bool is_socket(file_status s) noexcept;
+GHC_FS_API bool is_socket(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API bool is_symlink(file_status s) noexcept;
+GHC_FS_API bool is_symlink(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API file_time_type last_write_time(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API void last_write_time(const path& p, file_time_type new_time, std::error_code& ec) noexcept;
+GHC_FS_API void permissions(const path& p, perms prms, std::error_code& ec) noexcept;
+GHC_FS_API void permissions(const path& p, perms prms, perm_options opts, std::error_code& ec) noexcept;
+GHC_FS_API path proximate(const path& p, std::error_code& ec);
+GHC_FS_API path proximate(const path& p, const path& base, std::error_code& ec);
+GHC_FS_API path read_symlink(const path& p, std::error_code& ec);
+GHC_FS_API path relative(const path& p, std::error_code& ec);
+GHC_FS_API path relative(const path& p, const path& base, std::error_code& ec);
+GHC_FS_API bool remove(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API uintmax_t remove_all(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API void rename(const path& from, const path& to, std::error_code& ec) noexcept;
+GHC_FS_API void resize_file(const path& p, uintmax_t size, std::error_code& ec) noexcept;
+GHC_FS_API space_info space(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API file_status status(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API bool status_known(file_status s) noexcept;
+GHC_FS_API file_status symlink_status(const path& p, std::error_code& ec) noexcept;
+GHC_FS_API path temp_directory_path(std::error_code& ec) noexcept;
+GHC_FS_API path weakly_canonical(const path& p, std::error_code& ec) noexcept;
+
+#ifndef GHC_OS_WEB
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_FS_API void create_hard_link(const path& to, const path& new_hard_link);
+GHC_FS_API uintmax_t hard_link_count(const path& p);
+#endif
+GHC_FS_API void create_hard_link(const path& to, const path& new_hard_link, std::error_code& ec) noexcept;
+GHC_FS_API uintmax_t hard_link_count(const path& p, std::error_code& ec) noexcept;
+#endif
+
+// Non-C++17 add-on std::fstream wrappers with path
+template <class charT, class traits = std::char_traits<charT>>
+class basic_filebuf : public std::basic_filebuf<charT, traits>
+{
+public:
+ basic_filebuf() {}
+ ~basic_filebuf() override {}
+ basic_filebuf(const basic_filebuf&) = delete;
+ const basic_filebuf& operator=(const basic_filebuf&) = delete;
+ basic_filebuf<charT, traits>* open(const path& p, std::ios_base::openmode mode)
+ {
+#if defined(GHC_OS_WINDOWS) && !defined(__GLIBCXX__)
+ return std::basic_filebuf<charT, traits>::open(p.wstring().c_str(), mode) ? this : 0;
+#else
+ return std::basic_filebuf<charT, traits>::open(p.string().c_str(), mode) ? this : 0;
+#endif
+ }
+};
+
+template <class charT, class traits = std::char_traits<charT>>
+class basic_ifstream : public std::basic_ifstream<charT, traits>
+{
+public:
+ basic_ifstream() {}
+#if defined(GHC_OS_WINDOWS) && !defined(__GLIBCXX__)
+ explicit basic_ifstream(const path& p, std::ios_base::openmode mode = std::ios_base::in)
+ : std::basic_ifstream<charT, traits>(p.wstring().c_str(), mode)
+ {
+ }
+ void open(const path& p, std::ios_base::openmode mode = std::ios_base::in) { std::basic_ifstream<charT, traits>::open(p.wstring().c_str(), mode); }
+#else
+ explicit basic_ifstream(const path& p, std::ios_base::openmode mode = std::ios_base::in)
+ : std::basic_ifstream<charT, traits>(p.string().c_str(), mode)
+ {
+ }
+ void open(const path& p, std::ios_base::openmode mode = std::ios_base::in) { std::basic_ifstream<charT, traits>::open(p.string().c_str(), mode); }
+#endif
+ basic_ifstream(const basic_ifstream&) = delete;
+ const basic_ifstream& operator=(const basic_ifstream&) = delete;
+ ~basic_ifstream() override {}
+};
+
+template <class charT, class traits = std::char_traits<charT>>
+class basic_ofstream : public std::basic_ofstream<charT, traits>
+{
+public:
+ basic_ofstream() {}
+#if defined(GHC_OS_WINDOWS) && !defined(__GLIBCXX__)
+ explicit basic_ofstream(const path& p, std::ios_base::openmode mode = std::ios_base::out)
+ : std::basic_ofstream<charT, traits>(p.wstring().c_str(), mode)
+ {
+ }
+ void open(const path& p, std::ios_base::openmode mode = std::ios_base::out) { std::basic_ofstream<charT, traits>::open(p.wstring().c_str(), mode); }
+#else
+ explicit basic_ofstream(const path& p, std::ios_base::openmode mode = std::ios_base::out)
+ : std::basic_ofstream<charT, traits>(p.string().c_str(), mode)
+ {
+ }
+ void open(const path& p, std::ios_base::openmode mode = std::ios_base::out) { std::basic_ofstream<charT, traits>::open(p.string().c_str(), mode); }
+#endif
+ basic_ofstream(const basic_ofstream&) = delete;
+ const basic_ofstream& operator=(const basic_ofstream&) = delete;
+ ~basic_ofstream() override {}
+};
+
+template <class charT, class traits = std::char_traits<charT>>
+class basic_fstream : public std::basic_fstream<charT, traits>
+{
+public:
+ basic_fstream() {}
+#if defined(GHC_OS_WINDOWS) && !defined(__GLIBCXX__)
+ explicit basic_fstream(const path& p, std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out)
+ : std::basic_fstream<charT, traits>(p.wstring().c_str(), mode)
+ {
+ }
+ void open(const path& p, std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out) { std::basic_fstream<charT, traits>::open(p.wstring().c_str(), mode); }
+#else
+ explicit basic_fstream(const path& p, std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out)
+ : std::basic_fstream<charT, traits>(p.string().c_str(), mode)
+ {
+ }
+ void open(const path& p, std::ios_base::openmode mode = std::ios_base::in | std::ios_base::out) { std::basic_fstream<charT, traits>::open(p.string().c_str(), mode); }
+#endif
+ basic_fstream(const basic_fstream&) = delete;
+ const basic_fstream& operator=(const basic_fstream&) = delete;
+ ~basic_fstream() override {}
+};
+
+typedef basic_filebuf<char> filebuf;
+typedef basic_filebuf<wchar_t> wfilebuf;
+typedef basic_ifstream<char> ifstream;
+typedef basic_ifstream<wchar_t> wifstream;
+typedef basic_ofstream<char> ofstream;
+typedef basic_ofstream<wchar_t> wofstream;
+typedef basic_fstream<char> fstream;
+typedef basic_fstream<wchar_t> wfstream;
+
+class GHC_FS_API_CLASS u8arguments
+{
+public:
+ u8arguments(int& argc, char**& argv);
+ ~u8arguments()
+ {
+ _refargc = _argc;
+ _refargv = _argv;
+ }
+
+ bool valid() const { return _isvalid; }
+
+private:
+ int _argc;
+ char** _argv;
+ int& _refargc;
+ char**& _refargv;
+ bool _isvalid;
+#ifdef GHC_OS_WINDOWS
+ std::vector<std::string> _args;
+ std::vector<char*> _argp;
+#endif
+};
+
+//-------------------------------------------------------------------------------------------------
+// Implementation
+//-------------------------------------------------------------------------------------------------
+
+namespace detail {
+enum utf8_states_t { S_STRT = 0, S_RJCT = 8 };
+GHC_FS_API void appendUTF8(std::string& str, uint32_t unicode);
+GHC_FS_API bool is_surrogate(uint32_t c);
+GHC_FS_API bool is_high_surrogate(uint32_t c);
+GHC_FS_API bool is_low_surrogate(uint32_t c);
+GHC_FS_API unsigned consumeUtf8Fragment(const unsigned state, const uint8_t fragment, uint32_t& codepoint);
+enum class portable_error {
+ none = 0,
+ exists,
+ not_found,
+ not_supported,
+ not_implemented,
+ invalid_argument,
+ is_a_directory,
+};
+GHC_FS_API std::error_code make_error_code(portable_error err);
+#ifdef GHC_OS_WINDOWS
+GHC_FS_API std::error_code make_system_error(uint32_t err = 0);
+#else
+GHC_FS_API std::error_code make_system_error(int err = 0);
+#endif
+} // namespace detail
+
+namespace detail {
+
+#ifdef GHC_EXPAND_IMPL
+
+GHC_INLINE std::error_code make_error_code(portable_error err)
+{
+#ifdef GHC_OS_WINDOWS
+ switch (err) {
+ case portable_error::none:
+ return std::error_code();
+ case portable_error::exists:
+ return std::error_code(ERROR_ALREADY_EXISTS, std::system_category());
+ case portable_error::not_found:
+ return std::error_code(ERROR_PATH_NOT_FOUND, std::system_category());
+ case portable_error::not_supported:
+ return std::error_code(ERROR_NOT_SUPPORTED, std::system_category());
+ case portable_error::not_implemented:
+ return std::error_code(ERROR_CALL_NOT_IMPLEMENTED, std::system_category());
+ case portable_error::invalid_argument:
+ return std::error_code(ERROR_INVALID_PARAMETER, std::system_category());
+ case portable_error::is_a_directory:
+#ifdef ERROR_DIRECTORY_NOT_SUPPORTED
+ return std::error_code(ERROR_DIRECTORY_NOT_SUPPORTED, std::system_category());
+#else
+ return std::error_code(ERROR_NOT_SUPPORTED, std::system_category());
+#endif
+ }
+#else
+ switch (err) {
+ case portable_error::none:
+ return std::error_code();
+ case portable_error::exists:
+ return std::error_code(EEXIST, std::system_category());
+ case portable_error::not_found:
+ return std::error_code(ENOENT, std::system_category());
+ case portable_error::not_supported:
+ return std::error_code(ENOTSUP, std::system_category());
+ case portable_error::not_implemented:
+ return std::error_code(ENOSYS, std::system_category());
+ case portable_error::invalid_argument:
+ return std::error_code(EINVAL, std::system_category());
+ case portable_error::is_a_directory:
+ return std::error_code(EISDIR, std::system_category());
+ }
+#endif
+ return std::error_code();
+}
+
+#ifdef GHC_OS_WINDOWS
+GHC_INLINE std::error_code make_system_error(uint32_t err)
+{
+ return std::error_code(err ? static_cast<int>(err) : static_cast<int>(::GetLastError()), std::system_category());
+}
+#else
+GHC_INLINE std::error_code make_system_error(int err)
+{
+ return std::error_code(err ? err : errno, std::system_category());
+}
+#endif
+
+#endif // GHC_EXPAND_IMPL
+
+template <typename Enum>
+using EnableBitmask = typename std::enable_if<std::is_same<Enum, perms>::value || std::is_same<Enum, perm_options>::value || std::is_same<Enum, copy_options>::value || std::is_same<Enum, directory_options>::value, Enum>::type;
+} // namespace detail
+
+template <typename Enum>
+constexpr detail::EnableBitmask<Enum> operator&(Enum X, Enum Y)
+{
+ using underlying = typename std::underlying_type<Enum>::type;
+ return static_cast<Enum>(static_cast<underlying>(X) & static_cast<underlying>(Y));
+}
+
+template <typename Enum>
+constexpr detail::EnableBitmask<Enum> operator|(Enum X, Enum Y)
+{
+ using underlying = typename std::underlying_type<Enum>::type;
+ return static_cast<Enum>(static_cast<underlying>(X) | static_cast<underlying>(Y));
+}
+
+template <typename Enum>
+constexpr detail::EnableBitmask<Enum> operator^(Enum X, Enum Y)
+{
+ using underlying = typename std::underlying_type<Enum>::type;
+ return static_cast<Enum>(static_cast<underlying>(X) ^ static_cast<underlying>(Y));
+}
+
+template <typename Enum>
+constexpr detail::EnableBitmask<Enum> operator~(Enum X)
+{
+ using underlying = typename std::underlying_type<Enum>::type;
+ return static_cast<Enum>(~static_cast<underlying>(X));
+}
+
+template <typename Enum>
+detail::EnableBitmask<Enum>& operator&=(Enum& X, Enum Y)
+{
+ X = X & Y;
+ return X;
+}
+
+template <typename Enum>
+detail::EnableBitmask<Enum>& operator|=(Enum& X, Enum Y)
+{
+ X = X | Y;
+ return X;
+}
+
+template <typename Enum>
+detail::EnableBitmask<Enum>& operator^=(Enum& X, Enum Y)
+{
+ X = X ^ Y;
+ return X;
+}
+
+#ifdef GHC_EXPAND_IMPL
+
+namespace detail {
+
+GHC_INLINE bool in_range(uint32_t c, uint32_t lo, uint32_t hi)
+{
+ return (static_cast<uint32_t>(c - lo) < (hi - lo + 1));
+}
+
+GHC_INLINE bool is_surrogate(uint32_t c)
+{
+ return in_range(c, 0xd800, 0xdfff);
+}
+
+GHC_INLINE bool is_high_surrogate(uint32_t c)
+{
+ return (c & 0xfffffc00) == 0xd800;
+}
+
+GHC_INLINE bool is_low_surrogate(uint32_t c)
+{
+ return (c & 0xfffffc00) == 0xdc00;
+}
+
+GHC_INLINE void appendUTF8(std::string& str, uint32_t unicode)
+{
+ if (unicode <= 0x7f) {
+ str.push_back(static_cast<char>(unicode));
+ }
+ else if (unicode >= 0x80 && unicode <= 0x7ff) {
+ str.push_back(static_cast<char>((unicode >> 6) + 192));
+ str.push_back(static_cast<char>((unicode & 0x3f) + 128));
+ }
+ else if ((unicode >= 0x800 && unicode <= 0xd7ff) || (unicode >= 0xe000 && unicode <= 0xffff)) {
+ str.push_back(static_cast<char>((unicode >> 12) + 224));
+ str.push_back(static_cast<char>(((unicode & 0xfff) >> 6) + 128));
+ str.push_back(static_cast<char>((unicode & 0x3f) + 128));
+ }
+ else if (unicode >= 0x10000 && unicode <= 0x10ffff) {
+ str.push_back(static_cast<char>((unicode >> 18) + 240));
+ str.push_back(static_cast<char>(((unicode & 0x3ffff) >> 12) + 128));
+ str.push_back(static_cast<char>(((unicode & 0xfff) >> 6) + 128));
+ str.push_back(static_cast<char>((unicode & 0x3f) + 128));
+ }
+ else {
+#ifdef GHC_RAISE_UNICODE_ERRORS
+ throw filesystem_error("Illegal code point for unicode character.", str, std::make_error_code(std::errc::illegal_byte_sequence));
+#else
+ appendUTF8(str, 0xfffd);
+#endif
+ }
+}
+
+// Thanks to Bjoern Hoehrmann (https://bjoern.hoehrmann.de/utf-8/decoder/dfa/)
+// and Taylor R Campbell for the ideas to this DFA approach of UTF-8 decoding;
+// Generating debugging and shrinking my own DFA from scratch was a day of fun!
+GHC_INLINE unsigned consumeUtf8Fragment(const unsigned state, const uint8_t fragment, uint32_t& codepoint)
+{
+ static const uint32_t utf8_state_info[] = {
+ // encoded states
+ 0x11111111u, 0x11111111u, 0x77777777u, 0x77777777u, 0x88888888u, 0x88888888u, 0x88888888u, 0x88888888u, 0x22222299u, 0x22222222u, 0x22222222u, 0x22222222u, 0x3333333au, 0x33433333u, 0x9995666bu, 0x99999999u,
+ 0x88888880u, 0x22818108u, 0x88888881u, 0x88888882u, 0x88888884u, 0x88888887u, 0x88888886u, 0x82218108u, 0x82281108u, 0x88888888u, 0x88888883u, 0x88888885u, 0u, 0u, 0u, 0u,
+ };
+ uint8_t category = fragment < 128 ? 0 : (utf8_state_info[(fragment >> 3) & 0xf] >> ((fragment & 7) << 2)) & 0xf;
+ codepoint = (state ? (codepoint << 6) | (fragment & 0x3fu) : (0xffu >> category) & fragment);
+ return state == S_RJCT ? static_cast<unsigned>(S_RJCT) : static_cast<unsigned>((utf8_state_info[category + 16] >> (state << 2)) & 0xf);
+}
+
+GHC_INLINE bool validUtf8(const std::string& utf8String)
+{
+ std::string::const_iterator iter = utf8String.begin();
+ unsigned utf8_state = S_STRT;
+ std::uint32_t codepoint = 0;
+ while (iter < utf8String.end()) {
+ if ((utf8_state = consumeUtf8Fragment(utf8_state, static_cast<uint8_t>(*iter++), codepoint)) == S_RJCT) {
+ return false;
+ }
+ }
+ if (utf8_state) {
+ return false;
+ }
+ return true;
+}
+
+} // namespace detail
+
+#endif
+
+namespace detail {
+
+template <class StringType, class Utf8String, typename std::enable_if<path::_is_basic_string<Utf8String>::value && (sizeof(typename Utf8String::value_type) == 1) && (sizeof(typename StringType::value_type) == 1)>::type* = nullptr>
+inline StringType fromUtf8(const Utf8String& utf8String, const typename StringType::allocator_type& alloc = typename StringType::allocator_type())
+{
+ return StringType(utf8String.begin(), utf8String.end(), alloc);
+}
+
+template <class StringType, class Utf8String, typename std::enable_if<path::_is_basic_string<Utf8String>::value && (sizeof(typename Utf8String::value_type) == 1) && (sizeof(typename StringType::value_type) == 2)>::type* = nullptr>
+inline StringType fromUtf8(const Utf8String& utf8String, const typename StringType::allocator_type& alloc = typename StringType::allocator_type())
+{
+ StringType result(alloc);
+ result.reserve(utf8String.length());
+ auto iter = utf8String.cbegin();
+ unsigned utf8_state = S_STRT;
+ std::uint32_t codepoint = 0;
+ while (iter < utf8String.cend()) {
+ if ((utf8_state = consumeUtf8Fragment(utf8_state, static_cast<uint8_t>(*iter++), codepoint)) == S_STRT) {
+ if (codepoint <= 0xffff) {
+ result += static_cast<typename StringType::value_type>(codepoint);
+ }
+ else {
+ codepoint -= 0x10000;
+ result += static_cast<typename StringType::value_type>((codepoint >> 10) + 0xd800);
+ result += static_cast<typename StringType::value_type>((codepoint & 0x3ff) + 0xdc00);
+ }
+ codepoint = 0;
+ }
+ else if (utf8_state == S_RJCT) {
+#ifdef GHC_RAISE_UNICODE_ERRORS
+ throw filesystem_error("Illegal byte sequence for unicode character.", utf8String, std::make_error_code(std::errc::illegal_byte_sequence));
+#else
+ result += static_cast<typename StringType::value_type>(0xfffd);
+ utf8_state = S_STRT;
+ codepoint = 0;
+#endif
+ }
+ }
+ if (utf8_state) {
+#ifdef GHC_RAISE_UNICODE_ERRORS
+ throw filesystem_error("Illegal byte sequence for unicode character.", utf8String, std::make_error_code(std::errc::illegal_byte_sequence));
+#else
+ result += static_cast<typename StringType::value_type>(0xfffd);
+#endif
+ }
+ return result;
+}
+
+template <class StringType, class Utf8String, typename std::enable_if<path::_is_basic_string<Utf8String>::value && (sizeof(typename Utf8String::value_type) == 1) && (sizeof(typename StringType::value_type) == 4)>::type* = nullptr>
+inline StringType fromUtf8(const Utf8String& utf8String, const typename StringType::allocator_type& alloc = typename StringType::allocator_type())
+{
+ StringType result(alloc);
+ result.reserve(utf8String.length());
+ auto iter = utf8String.cbegin();
+ unsigned utf8_state = S_STRT;
+ std::uint32_t codepoint = 0;
+ while (iter < utf8String.cend()) {
+ if ((utf8_state = consumeUtf8Fragment(utf8_state, static_cast<uint8_t>(*iter++), codepoint)) == S_STRT) {
+ result += static_cast<typename StringType::value_type>(codepoint);
+ codepoint = 0;
+ }
+ else if (utf8_state == S_RJCT) {
+#ifdef GHC_RAISE_UNICODE_ERRORS
+ throw filesystem_error("Illegal byte sequence for unicode character.", utf8String, std::make_error_code(std::errc::illegal_byte_sequence));
+#else
+ result += static_cast<typename StringType::value_type>(0xfffd);
+ utf8_state = S_STRT;
+ codepoint = 0;
+#endif
+ }
+ }
+ if (utf8_state) {
+#ifdef GHC_RAISE_UNICODE_ERRORS
+ throw filesystem_error("Illegal byte sequence for unicode character.", utf8String, std::make_error_code(std::errc::illegal_byte_sequence));
+#else
+ result += static_cast<typename StringType::value_type>(0xfffd);
+#endif
+ }
+ return result;
+}
+
+template <class StringType, typename charT, std::size_t N>
+inline StringType fromUtf8(const charT (&utf8String)[N])
+{
+#ifdef GHC_WITH_STRING_VIEW
+ return fromUtf8<StringType>(basic_string_view<charT>(utf8String, N - 1));
+#else
+ return fromUtf8<StringType>(std::basic_string<charT>(utf8String, N - 1));
+#endif
+}
+
+template <typename strT, typename std::enable_if<path::_is_basic_string<strT>::value && (sizeof(typename strT::value_type) == 1), int>::type size = 1>
+inline std::string toUtf8(const strT& unicodeString)
+{
+ return std::string(unicodeString.begin(), unicodeString.end());
+}
+
+template <typename strT, typename std::enable_if<path::_is_basic_string<strT>::value && (sizeof(typename strT::value_type) == 2), int>::type size = 2>
+inline std::string toUtf8(const strT& unicodeString)
+{
+ std::string result;
+ for (auto iter = unicodeString.begin(); iter != unicodeString.end(); ++iter) {
+ char32_t c = *iter;
+ if (is_surrogate(c)) {
+ ++iter;
+ if (iter != unicodeString.end() && is_high_surrogate(c) && is_low_surrogate(*iter)) {
+ appendUTF8(result, (char32_t(c) << 10) + *iter - 0x35fdc00);
+ }
+ else {
+#ifdef GHC_RAISE_UNICODE_ERRORS
+ throw filesystem_error("Illegal code point for unicode character.", result, std::make_error_code(std::errc::illegal_byte_sequence));
+#else
+ appendUTF8(result, 0xfffd);
+ if (iter == unicodeString.end()) {
+ break;
+ }
+#endif
+ }
+ }
+ else {
+ appendUTF8(result, c);
+ }
+ }
+ return result;
+}
+
+template <typename strT, typename std::enable_if<path::_is_basic_string<strT>::value && (sizeof(typename strT::value_type) == 4), int>::type size = 4>
+inline std::string toUtf8(const strT& unicodeString)
+{
+ std::string result;
+ for (auto c : unicodeString) {
+ appendUTF8(result, static_cast<uint32_t>(c));
+ }
+ return result;
+}
+
+template <typename charT>
+inline std::string toUtf8(const charT* unicodeString)
+{
+#ifdef GHC_WITH_STRING_VIEW
+ return toUtf8(basic_string_view<charT, std::char_traits<charT>>(unicodeString));
+#else
+ return toUtf8(std::basic_string<charT, std::char_traits<charT>>(unicodeString));
+#endif
+}
+
+#ifdef GHC_USE_WCHAR_T
+template <class StringType, class WString, typename std::enable_if<path::_is_basic_string<WString>::value && (sizeof(typename WString::value_type) == 2) && (sizeof(typename StringType::value_type) == 1), bool>::type = false>
+inline StringType fromWChar(const WString& wString, const typename StringType::allocator_type& alloc = typename StringType::allocator_type())
+{
+ auto temp = toUtf8(wString);
+ return StringType(temp.begin(), temp.end(), alloc);
+}
+
+template <class StringType, class WString, typename std::enable_if<path::_is_basic_string<WString>::value && (sizeof(typename WString::value_type) == 2) && (sizeof(typename StringType::value_type) == 2), bool>::type = false>
+inline StringType fromWChar(const WString& wString, const typename StringType::allocator_type& alloc = typename StringType::allocator_type())
+{
+ return StringType(wString.begin(), wString.end(), alloc);
+}
+
+template <class StringType, class WString, typename std::enable_if<path::_is_basic_string<WString>::value && (sizeof(typename WString::value_type) == 2) && (sizeof(typename StringType::value_type) == 4), bool>::type = false>
+inline StringType fromWChar(const WString& wString, const typename StringType::allocator_type& alloc = typename StringType::allocator_type())
+{
+ auto temp = toUtf8(wString);
+ return fromUtf8<StringType>(temp, alloc);
+}
+
+template <typename strT, typename std::enable_if<path::_is_basic_string<strT>::value && (sizeof(typename strT::value_type) == 1), bool>::type = false>
+inline std::wstring toWChar(const strT& unicodeString)
+{
+ return fromUtf8<std::wstring>(unicodeString);
+}
+
+template <typename strT, typename std::enable_if<path::_is_basic_string<strT>::value && (sizeof(typename strT::value_type) == 2), bool>::type = false>
+inline std::wstring toWChar(const strT& unicodeString)
+{
+ return std::wstring(unicodeString.begin(), unicodeString.end());
+}
+
+template <typename strT, typename std::enable_if<path::_is_basic_string<strT>::value && (sizeof(typename strT::value_type) == 4), bool>::type = false>
+inline std::wstring toWChar(const strT& unicodeString)
+{
+ auto temp = toUtf8(unicodeString);
+ return fromUtf8<std::wstring>(temp);
+}
+
+template <typename charT>
+inline std::wstring toWChar(const charT* unicodeString)
+{
+#ifdef GHC_WITH_STRING_VIEW
+ return toWChar(basic_string_view<charT, std::char_traits<charT>>(unicodeString));
+#else
+ return toWChar(std::basic_string<charT, std::char_traits<charT>>(unicodeString));
+#endif
+}
+#endif // GHC_USE_WCHAR_T
+
+} // namespace detail
+
+#ifdef GHC_EXPAND_IMPL
+
+namespace detail {
+
+template <typename strT, typename std::enable_if<path::_is_basic_string<strT>::value, bool>::type = true>
+GHC_INLINE bool startsWith(const strT& what, const strT& with)
+{
+ return with.length() <= what.length() && equal(with.begin(), with.end(), what.begin());
+}
+
+template <typename strT, typename std::enable_if<path::_is_basic_string<strT>::value, bool>::type = true>
+GHC_INLINE bool endsWith(const strT& what, const strT& with)
+{
+ return with.length() <= what.length() && what.compare(what.length() - with.length(), with.size(), with) == 0;
+}
+
+} // namespace detail
+
+GHC_INLINE void path::check_long_path()
+{
+#if defined(GHC_OS_WINDOWS) && defined(GHC_WIN_AUTO_PREFIX_LONG_PATH)
+ if (is_absolute() && _path.length() >= MAX_PATH - 12 && !detail::startsWith(_path, impl_string_type(GHC_PLATFORM_LITERAL("\\\\?\\")))) {
+ postprocess_path_with_format(native_format);
+ }
+#endif
+}
+
+GHC_INLINE void path::postprocess_path_with_format(path::format fmt)
+{
+#ifdef GHC_RAISE_UNICODE_ERRORS
+ if (!detail::validUtf8(_path)) {
+ path t;
+ t._path = _path;
+ throw filesystem_error("Illegal byte sequence for unicode character.", t, std::make_error_code(std::errc::illegal_byte_sequence));
+ }
+#endif
+ switch (fmt) {
+#ifdef GHC_OS_WINDOWS
+ case path::native_format:
+ case path::auto_format:
+ case path::generic_format:
+ for (auto& c : _path) {
+ if (c == generic_separator) {
+ c = preferred_separator;
+ }
+ }
+#ifdef GHC_WIN_AUTO_PREFIX_LONG_PATH
+ if (is_absolute() && _path.length() >= MAX_PATH - 12 && !detail::startsWith(_path, impl_string_type(GHC_PLATFORM_LITERAL("\\\\?\\")))) {
+ _path = GHC_PLATFORM_LITERAL("\\\\?\\") + _path;
+ }
+#endif
+ handle_prefixes();
+ break;
+#else
+ case path::auto_format:
+ case path::native_format:
+ case path::generic_format:
+ // nothing to do
+ break;
+#endif
+ }
+ if (_path.length() > _prefixLength + 2 && _path[_prefixLength] == preferred_separator && _path[_prefixLength + 1] == preferred_separator && _path[_prefixLength + 2] != preferred_separator) {
+ impl_string_type::iterator new_end = std::unique(_path.begin() + static_cast<string_type::difference_type>(_prefixLength) + 2, _path.end(), [](path::value_type lhs, path::value_type rhs) { return lhs == rhs && lhs == preferred_separator; });
+ _path.erase(new_end, _path.end());
+ }
+ else {
+ impl_string_type::iterator new_end = std::unique(_path.begin() + static_cast<string_type::difference_type>(_prefixLength), _path.end(), [](path::value_type lhs, path::value_type rhs) { return lhs == rhs && lhs == preferred_separator; });
+ _path.erase(new_end, _path.end());
+ }
+}
+
+#endif // GHC_EXPAND_IMPL
+
+template <class Source, typename>
+inline path::path(const Source& source, format fmt)
+#ifdef GHC_USE_WCHAR_T
+ : _path(detail::toWChar(source))
+#else
+ : _path(detail::toUtf8(source))
+#endif
+{
+ postprocess_path_with_format(fmt);
+}
+
+template <class Source, typename>
+inline path u8path(const Source& source)
+{
+ return path(source);
+}
+template <class InputIterator>
+inline path u8path(InputIterator first, InputIterator last)
+{
+ return path(first, last);
+}
+
+template <class InputIterator>
+inline path::path(InputIterator first, InputIterator last, format fmt)
+ : path(std::basic_string<typename std::iterator_traits<InputIterator>::value_type>(first, last), fmt)
+{
+ // delegated
+}
+
+#ifdef GHC_EXPAND_IMPL
+
+namespace detail {
+
+GHC_INLINE bool equals_simple_insensitive(const path::value_type* str1, const path::value_type* str2)
+{
+#ifdef GHC_OS_WINDOWS
+#ifdef __GNUC__
+ while (::tolower((unsigned char)*str1) == ::tolower((unsigned char)*str2++)) {
+ if (*str1++ == 0)
+ return true;
+ }
+ return false;
+#else // __GNUC__
+#ifdef GHC_USE_WCHAR_T
+ return 0 == ::_wcsicmp(str1, str2);
+#else // GHC_USE_WCHAR_T
+ return 0 == ::_stricmp(str1, str2);
+#endif // GHC_USE_WCHAR_T
+#endif // __GNUC__
+#else // GHC_OS_WINDOWS
+ return 0 == ::strcasecmp(str1, str2);
+#endif // GHC_OS_WINDOWS
+}
+
+GHC_INLINE int compare_simple_insensitive(const path::value_type* str1, size_t len1, const path::value_type* str2, size_t len2)
+{
+ while (len1 > 0 && len2 > 0 && ::tolower(static_cast<unsigned char>(*str1)) == ::tolower(static_cast<unsigned char>(*str2))) {
+ --len1;
+ --len2;
+ ++str1;
+ ++str2;
+ }
+ if (len1 && len2) {
+ return *str1 < *str2 ? -1 : 1;
+ }
+ if (len1 == 0 && len2 == 0) {
+ return 0;
+ }
+ return len1 == 0 ? -1 : 1;
+}
+
+GHC_INLINE const char* strerror_adapter(char* gnu, char*)
+{
+ return gnu;
+}
+
+GHC_INLINE const char* strerror_adapter(int posix, char* buffer)
+{
+ if (posix) {
+ return "Error in strerror_r!";
+ }
+ return buffer;
+}
+
+template <typename ErrorNumber>
+GHC_INLINE std::string systemErrorText(ErrorNumber code = 0)
+{
+#if defined(GHC_OS_WINDOWS)
+ LPVOID msgBuf;
+ DWORD dw = code ? static_cast<DWORD>(code) : ::GetLastError();
+ FormatMessageW(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPWSTR)&msgBuf, 0, NULL);
+ std::string msg = toUtf8(std::wstring((LPWSTR)msgBuf));
+ LocalFree(msgBuf);
+ return msg;
+#else
+ char buffer[512];
+ return strerror_adapter(strerror_r(code ? code : errno, buffer, sizeof(buffer)), buffer);
+#endif
+}
+
+#ifdef GHC_OS_WINDOWS
+using CreateSymbolicLinkW_fp = BOOLEAN(WINAPI*)(LPCWSTR, LPCWSTR, DWORD);
+using CreateHardLinkW_fp = BOOLEAN(WINAPI*)(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES);
+
+GHC_INLINE void create_symlink(const path& target_name, const path& new_symlink, bool to_directory, std::error_code& ec)
+{
+ std::error_code tec;
+ auto fs = status(target_name, tec);
+ if ((fs.type() == file_type::directory && !to_directory) || (fs.type() == file_type::regular && to_directory)) {
+ ec = detail::make_error_code(detail::portable_error::not_supported);
+ return;
+ }
+#if defined(__GNUC__) && __GNUC__ >= 8
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wcast-function-type"
+#endif
+ static CreateSymbolicLinkW_fp api_call = reinterpret_cast<CreateSymbolicLinkW_fp>(GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "CreateSymbolicLinkW"));
+#if defined(__GNUC__) && __GNUC__ >= 8
+#pragma GCC diagnostic pop
+#endif
+ if (api_call) {
+ if (api_call(detail::fromUtf8<std::wstring>(new_symlink.u8string()).c_str(), detail::fromUtf8<std::wstring>(target_name.u8string()).c_str(), to_directory ? 1 : 0) == 0) {
+ auto result = ::GetLastError();
+ if (result == ERROR_PRIVILEGE_NOT_HELD && api_call(detail::fromUtf8<std::wstring>(new_symlink.u8string()).c_str(), detail::fromUtf8<std::wstring>(target_name.u8string()).c_str(), to_directory ? 3 : 2) != 0) {
+ return;
+ }
+ ec = detail::make_system_error(result);
+ }
+ }
+ else {
+ ec = detail::make_system_error(ERROR_NOT_SUPPORTED);
+ }
+}
+
+GHC_INLINE void create_hardlink(const path& target_name, const path& new_hardlink, std::error_code& ec)
+{
+#if defined(__GNUC__) && __GNUC__ >= 8
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wcast-function-type"
+#endif
+ static CreateHardLinkW_fp api_call = reinterpret_cast<CreateHardLinkW_fp>(GetProcAddress(GetModuleHandleW(L"kernel32.dll"), "CreateHardLinkW"));
+#if defined(__GNUC__) && __GNUC__ >= 8
+#pragma GCC diagnostic pop
+#endif
+ if (api_call) {
+ if (api_call(GHC_NATIVEWP(new_hardlink), GHC_NATIVEWP(target_name), NULL) == 0) {
+ ec = detail::make_system_error();
+ }
+ }
+ else {
+ ec = detail::make_system_error(ERROR_NOT_SUPPORTED);
+ }
+}
+
+GHC_INLINE path getFullPathName(const wchar_t* p, std::error_code& ec)
+{
+ ULONG size = ::GetFullPathNameW(p, 0, 0, 0);
+ if (size) {
+ std::vector<wchar_t> buf(size, 0);
+ ULONG s2 = GetFullPathNameW(p, size, buf.data(), nullptr);
+ if (s2 && s2 < size) {
+ return path(std::wstring(buf.data(), s2));
+ }
+ }
+ ec = detail::make_system_error();
+ return path();
+}
+
+#else
+GHC_INLINE void create_symlink(const path& target_name, const path& new_symlink, bool, std::error_code& ec)
+{
+ if (::symlink(target_name.c_str(), new_symlink.c_str()) != 0) {
+ ec = detail::make_system_error();
+ }
+}
+
+#ifndef GHC_OS_WEB
+GHC_INLINE void create_hardlink(const path& target_name, const path& new_hardlink, std::error_code& ec)
+{
+ if (::link(target_name.c_str(), new_hardlink.c_str()) != 0) {
+ ec = detail::make_system_error();
+ }
+}
+#endif
+#endif
+
+template <typename T>
+GHC_INLINE file_status file_status_from_st_mode(T mode)
+{
+#ifdef GHC_OS_WINDOWS
+ file_type ft = file_type::unknown;
+ if ((mode & _S_IFDIR) == _S_IFDIR) {
+ ft = file_type::directory;
+ }
+ else if ((mode & _S_IFREG) == _S_IFREG) {
+ ft = file_type::regular;
+ }
+ else if ((mode & _S_IFCHR) == _S_IFCHR) {
+ ft = file_type::character;
+ }
+ perms prms = static_cast<perms>(mode & 0xfff);
+ return file_status(ft, prms);
+#else
+ file_type ft = file_type::unknown;
+ if (S_ISDIR(mode)) {
+ ft = file_type::directory;
+ }
+ else if (S_ISREG(mode)) {
+ ft = file_type::regular;
+ }
+ else if (S_ISCHR(mode)) {
+ ft = file_type::character;
+ }
+ else if (S_ISBLK(mode)) {
+ ft = file_type::block;
+ }
+ else if (S_ISFIFO(mode)) {
+ ft = file_type::fifo;
+ }
+ else if (S_ISLNK(mode)) {
+ ft = file_type::symlink;
+ }
+ else if (S_ISSOCK(mode)) {
+ ft = file_type::socket;
+ }
+ perms prms = static_cast<perms>(mode & 0xfff);
+ return file_status(ft, prms);
+#endif
+}
+
+GHC_INLINE path resolveSymlink(const path& p, std::error_code& ec)
+{
+#ifdef GHC_OS_WINDOWS
+#ifndef REPARSE_DATA_BUFFER_HEADER_SIZE
+ typedef struct _REPARSE_DATA_BUFFER
+ {
+ ULONG ReparseTag;
+ USHORT ReparseDataLength;
+ USHORT Reserved;
+ union
+ {
+ struct
+ {
+ USHORT SubstituteNameOffset;
+ USHORT SubstituteNameLength;
+ USHORT PrintNameOffset;
+ USHORT PrintNameLength;
+ ULONG Flags;
+ WCHAR PathBuffer[1];
+ } SymbolicLinkReparseBuffer;
+ struct
+ {
+ USHORT SubstituteNameOffset;
+ USHORT SubstituteNameLength;
+ USHORT PrintNameOffset;
+ USHORT PrintNameLength;
+ WCHAR PathBuffer[1];
+ } MountPointReparseBuffer;
+ struct
+ {
+ UCHAR DataBuffer[1];
+ } GenericReparseBuffer;
+ } DUMMYUNIONNAME;
+ } REPARSE_DATA_BUFFER;
+#ifndef MAXIMUM_REPARSE_DATA_BUFFER_SIZE
+#define MAXIMUM_REPARSE_DATA_BUFFER_SIZE (16 * 1024)
+#endif
+#endif
+
+ std::shared_ptr<void> file(CreateFileW(GHC_NATIVEWP(p), 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_FLAG_OPEN_REPARSE_POINT | FILE_FLAG_BACKUP_SEMANTICS, 0), CloseHandle);
+ if (file.get() == INVALID_HANDLE_VALUE) {
+ ec = detail::make_system_error();
+ return path();
+ }
+
+ std::shared_ptr<REPARSE_DATA_BUFFER> reparseData((REPARSE_DATA_BUFFER*)std::calloc(1, MAXIMUM_REPARSE_DATA_BUFFER_SIZE), std::free);
+ ULONG bufferUsed;
+ path result;
+ if (DeviceIoControl(file.get(), FSCTL_GET_REPARSE_POINT, 0, 0, reparseData.get(), MAXIMUM_REPARSE_DATA_BUFFER_SIZE, &bufferUsed, 0)) {
+ if (IsReparseTagMicrosoft(reparseData->ReparseTag)) {
+ switch (reparseData->ReparseTag) {
+ case IO_REPARSE_TAG_SYMLINK: {
+ auto printName = std::wstring(&reparseData->SymbolicLinkReparseBuffer.PathBuffer[reparseData->SymbolicLinkReparseBuffer.PrintNameOffset / sizeof(WCHAR)], reparseData->SymbolicLinkReparseBuffer.PrintNameLength / sizeof(WCHAR));
+ auto substituteName =
+ std::wstring(&reparseData->SymbolicLinkReparseBuffer.PathBuffer[reparseData->SymbolicLinkReparseBuffer.SubstituteNameOffset / sizeof(WCHAR)], reparseData->SymbolicLinkReparseBuffer.SubstituteNameLength / sizeof(WCHAR));
+ if (detail::endsWith(substituteName, printName) && detail::startsWith(substituteName, std::wstring(L"\\??\\"))) {
+ result = printName;
+ }
+ else {
+ result = substituteName;
+ }
+ if (reparseData->SymbolicLinkReparseBuffer.Flags & 0x1 /*SYMLINK_FLAG_RELATIVE*/) {
+ result = p.parent_path() / result;
+ }
+ break;
+ }
+ case IO_REPARSE_TAG_MOUNT_POINT:
+ result = std::wstring(&reparseData->MountPointReparseBuffer.PathBuffer[reparseData->MountPointReparseBuffer.SubstituteNameOffset / sizeof(WCHAR)], reparseData->MountPointReparseBuffer.SubstituteNameLength / sizeof(WCHAR));
+ break;
+ default:
+ break;
+ }
+ }
+ }
+ else {
+ ec = detail::make_system_error();
+ }
+ return result;
+#else
+ size_t bufferSize = 256;
+ while (true) {
+ std::vector<char> buffer(bufferSize, static_cast<char>(0));
+ auto rc = ::readlink(p.c_str(), buffer.data(), buffer.size());
+ if (rc < 0) {
+ ec = detail::make_system_error();
+ return path();
+ }
+ else if (rc < static_cast<int>(bufferSize)) {
+ return path(std::string(buffer.data(), static_cast<std::string::size_type>(rc)));
+ }
+ bufferSize *= 2;
+ }
+ return path();
+#endif
+}
+
+#ifdef GHC_OS_WINDOWS
+GHC_INLINE time_t timeFromFILETIME(const FILETIME& ft)
+{
+ ULARGE_INTEGER ull;
+ ull.LowPart = ft.dwLowDateTime;
+ ull.HighPart = ft.dwHighDateTime;
+ return static_cast<time_t>(ull.QuadPart / 10000000ULL - 11644473600ULL);
+}
+
+GHC_INLINE void timeToFILETIME(time_t t, FILETIME& ft)
+{
+ LONGLONG ll;
+ ll = Int32x32To64(t, 10000000) + 116444736000000000;
+ ft.dwLowDateTime = static_cast<DWORD>(ll);
+ ft.dwHighDateTime = static_cast<DWORD>(ll >> 32);
+}
+
+template <typename INFO>
+GHC_INLINE uintmax_t hard_links_from_INFO(const INFO* info)
+{
+ return static_cast<uintmax_t>(-1);
+}
+
+template <>
+GHC_INLINE uintmax_t hard_links_from_INFO<BY_HANDLE_FILE_INFORMATION>(const BY_HANDLE_FILE_INFORMATION* info)
+{
+ return info->nNumberOfLinks;
+}
+
+template <typename INFO>
+GHC_INLINE file_status status_from_INFO(const path& p, const INFO* info, std::error_code&, uintmax_t* sz = nullptr, time_t* lwt = nullptr)
+{
+ file_type ft = file_type::unknown;
+ if ((info->dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT)) {
+ ft = file_type::symlink;
+ }
+ else {
+ if ((info->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
+ ft = file_type::directory;
+ }
+ else {
+ ft = file_type::regular;
+ }
+ }
+ perms prms = perms::owner_read | perms::group_read | perms::others_read;
+ if (!(info->dwFileAttributes & FILE_ATTRIBUTE_READONLY)) {
+ prms = prms | perms::owner_write | perms::group_write | perms::others_write;
+ }
+ if (has_executable_extension(p)) {
+ prms = prms | perms::owner_exec | perms::group_exec | perms::others_exec;
+ }
+ if (sz) {
+ *sz = static_cast<uintmax_t>(info->nFileSizeHigh) << (sizeof(info->nFileSizeHigh) * 8) | info->nFileSizeLow;
+ }
+ if (lwt) {
+ *lwt = detail::timeFromFILETIME(info->ftLastWriteTime);
+ }
+ return file_status(ft, prms);
+}
+
+#endif
+
+GHC_INLINE bool is_not_found_error(std::error_code& ec)
+{
+#ifdef GHC_OS_WINDOWS
+ return ec.value() == ERROR_FILE_NOT_FOUND || ec.value() == ERROR_PATH_NOT_FOUND || ec.value() == ERROR_INVALID_NAME;
+#else
+ return ec.value() == ENOENT || ec.value() == ENOTDIR;
+#endif
+}
+
+GHC_INLINE file_status symlink_status_ex(const path& p, std::error_code& ec, uintmax_t* sz = nullptr, uintmax_t* nhl = nullptr, time_t* lwt = nullptr) noexcept
+{
+#ifdef GHC_OS_WINDOWS
+ file_status fs;
+ WIN32_FILE_ATTRIBUTE_DATA attr;
+ if (!GetFileAttributesExW(GHC_NATIVEWP(p), GetFileExInfoStandard, &attr)) {
+ ec = detail::make_system_error();
+ }
+ else {
+ ec.clear();
+ fs = detail::status_from_INFO(p, &attr, ec, sz, lwt);
+ if (nhl) {
+ *nhl = 0;
+ }
+ if (attr.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
+ fs.type(file_type::symlink);
+ }
+ }
+ if (detail::is_not_found_error(ec)) {
+ return file_status(file_type::not_found);
+ }
+ return ec ? file_status(file_type::none) : fs;
+#else
+ (void)sz;
+ (void)nhl;
+ (void)lwt;
+ struct ::stat fs;
+ auto result = ::lstat(p.c_str(), &fs);
+ if (result == 0) {
+ ec.clear();
+ file_status f_s = detail::file_status_from_st_mode(fs.st_mode);
+ return f_s;
+ }
+ ec = detail::make_system_error();
+ if (detail::is_not_found_error(ec)) {
+ return file_status(file_type::not_found, perms::unknown);
+ }
+ return file_status(file_type::none);
+#endif
+}
+
+GHC_INLINE file_status status_ex(const path& p, std::error_code& ec, file_status* sls = nullptr, uintmax_t* sz = nullptr, uintmax_t* nhl = nullptr, time_t* lwt = nullptr, int recurse_count = 0) noexcept
+{
+ ec.clear();
+#ifdef GHC_OS_WINDOWS
+ if (recurse_count > 16) {
+ ec = detail::make_system_error(0x2A9 /*ERROR_STOPPED_ON_SYMLINK*/);
+ return file_status(file_type::unknown);
+ }
+ WIN32_FILE_ATTRIBUTE_DATA attr;
+ if (!::GetFileAttributesExW(GHC_NATIVEWP(p), GetFileExInfoStandard, &attr)) {
+ ec = detail::make_system_error();
+ }
+ else if (attr.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
+ path target = resolveSymlink(p, ec);
+ file_status result;
+ if (!ec && !target.empty()) {
+ if (sls) {
+ *sls = status_from_INFO(p, &attr, ec);
+ }
+ return detail::status_ex(target, ec, nullptr, sz, nhl, lwt, recurse_count + 1);
+ }
+ return file_status(file_type::unknown);
+ }
+ if (ec) {
+ if (detail::is_not_found_error(ec)) {
+ return file_status(file_type::not_found);
+ }
+ return file_status(file_type::none);
+ }
+ if (nhl) {
+ *nhl = 0;
+ }
+ return detail::status_from_INFO(p, &attr, ec, sz, lwt);
+#else
+ (void)recurse_count;
+ struct ::stat st;
+ auto result = ::lstat(p.c_str(), &st);
+ if (result == 0) {
+ ec.clear();
+ file_status fs = detail::file_status_from_st_mode(st.st_mode);
+ if (sls) {
+ *sls = fs;
+ }
+ if (fs.type() == file_type::symlink) {
+ result = ::stat(p.c_str(), &st);
+ if (result == 0) {
+ fs = detail::file_status_from_st_mode(st.st_mode);
+ }
+ else {
+ ec = detail::make_system_error();
+ if (detail::is_not_found_error(ec)) {
+ return file_status(file_type::not_found, perms::unknown);
+ }
+ return file_status(file_type::none);
+ }
+ }
+ if (sz) {
+ *sz = static_cast<uintmax_t>(st.st_size);
+ }
+ if (nhl) {
+ *nhl = st.st_nlink;
+ }
+ if (lwt) {
+ *lwt = st.st_mtime;
+ }
+ return fs;
+ }
+ else {
+ ec = detail::make_system_error();
+ if (detail::is_not_found_error(ec)) {
+ return file_status(file_type::not_found, perms::unknown);
+ }
+ return file_status(file_type::none);
+ }
+#endif
+}
+
+} // namespace detail
+
+GHC_INLINE u8arguments::u8arguments(int& argc, char**& argv)
+ : _argc(argc)
+ , _argv(argv)
+ , _refargc(argc)
+ , _refargv(argv)
+ , _isvalid(false)
+{
+#ifdef GHC_OS_WINDOWS
+ LPWSTR* p;
+ p = ::CommandLineToArgvW(::GetCommandLineW(), &argc);
+ _args.reserve(static_cast<size_t>(argc));
+ _argp.reserve(static_cast<size_t>(argc));
+ for (size_t i = 0; i < static_cast<size_t>(argc); ++i) {
+ _args.push_back(detail::toUtf8(std::wstring(p[i])));
+ _argp.push_back((char*)_args[i].data());
+ }
+ argv = _argp.data();
+ ::LocalFree(p);
+ _isvalid = true;
+#else
+ std::setlocale(LC_ALL, "");
+#if defined(__ANDROID__) && __ANDROID_API__ < 26
+ _isvalid = true;
+#else
+ if (detail::equals_simple_insensitive(::nl_langinfo(CODESET), "UTF-8")) {
+ _isvalid = true;
+ }
+#endif
+#endif
+}
+
+//-----------------------------------------------------------------------------
+// 30.10.8.4.1 constructors and destructor
+
+GHC_INLINE path::path() noexcept {}
+
+GHC_INLINE path::path(const path& p)
+ : _path(p._path)
+#if defined(GHC_OS_WINDOWS) && defined(GHC_WIN_AUTO_PREFIX_LONG_PATH)
+ , _prefixLength(p._prefixLength)
+#endif
+{
+}
+
+GHC_INLINE path::path(path&& p) noexcept
+ : _path(std::move(p._path))
+#if defined(GHC_OS_WINDOWS) && defined(GHC_WIN_AUTO_PREFIX_LONG_PATH)
+ , _prefixLength(p._prefixLength)
+#endif
+{
+}
+
+GHC_INLINE path::path(string_type&& source, format fmt)
+ : _path(std::move(source))
+{
+ postprocess_path_with_format(fmt);
+}
+
+#endif // GHC_EXPAND_IMPL
+
+#ifdef GHC_WITH_EXCEPTIONS
+template <class Source, typename>
+inline path::path(const Source& source, const std::locale& loc, format fmt)
+ : path(source, fmt)
+{
+ std::string locName = loc.name();
+ if (!(locName.length() >= 5 && (locName.substr(locName.length() - 5) == "UTF-8" || locName.substr(locName.length() - 5) == "utf-8"))) {
+ throw filesystem_error("This implementation only supports UTF-8 locales!", path(_path), detail::make_error_code(detail::portable_error::not_supported));
+ }
+}
+
+template <class InputIterator>
+inline path::path(InputIterator first, InputIterator last, const std::locale& loc, format fmt)
+ : path(std::basic_string<typename std::iterator_traits<InputIterator>::value_type>(first, last), fmt)
+{
+ std::string locName = loc.name();
+ if (!(locName.length() >= 5 && (locName.substr(locName.length() - 5) == "UTF-8" || locName.substr(locName.length() - 5) == "utf-8"))) {
+ throw filesystem_error("This implementation only supports UTF-8 locales!", path(_path), detail::make_error_code(detail::portable_error::not_supported));
+ }
+}
+#endif
+
+#ifdef GHC_EXPAND_IMPL
+
+GHC_INLINE path::~path() {}
+
+//-----------------------------------------------------------------------------
+// 30.10.8.4.2 assignments
+
+GHC_INLINE path& path::operator=(const path& p)
+{
+ _path = p._path;
+#if defined(GHC_OS_WINDOWS) && defined(GHC_WIN_AUTO_PREFIX_LONG_PATH)
+ _prefixLength = p._prefixLength;
+#endif
+ return *this;
+}
+
+GHC_INLINE path& path::operator=(path&& p) noexcept
+{
+ _path = std::move(p._path);
+#if defined(GHC_OS_WINDOWS) && defined(GHC_WIN_AUTO_PREFIX_LONG_PATH)
+ _prefixLength = p._prefixLength;
+#endif
+ return *this;
+}
+
+GHC_INLINE path& path::operator=(path::string_type&& source)
+{
+ return assign(source);
+}
+
+GHC_INLINE path& path::assign(path::string_type&& source)
+{
+ _path = std::move(source);
+ postprocess_path_with_format(native_format);
+ return *this;
+}
+
+#endif // GHC_EXPAND_IMPL
+
+template <class Source>
+inline path& path::operator=(const Source& source)
+{
+ return assign(source);
+}
+
+template <class Source>
+inline path& path::assign(const Source& source)
+{
+#ifdef GHC_USE_WCHAR_T
+ _path.assign(detail::toWChar(source));
+#else
+ _path.assign(detail::toUtf8(source));
+#endif
+ postprocess_path_with_format(native_format);
+ return *this;
+}
+
+template <>
+inline path& path::assign<path>(const path& source)
+{
+ _path = source._path;
+#if defined(GHC_OS_WINDOWS) && defined(GHC_WIN_AUTO_PREFIX_LONG_PATH)
+ _prefixLength = source._prefixLength;
+#endif
+ return *this;
+}
+
+template <class InputIterator>
+inline path& path::assign(InputIterator first, InputIterator last)
+{
+ _path.assign(first, last);
+ postprocess_path_with_format(native_format);
+ return *this;
+}
+
+#ifdef GHC_EXPAND_IMPL
+
+//-----------------------------------------------------------------------------
+// 30.10.8.4.3 appends
+
+GHC_INLINE path& path::operator/=(const path& p)
+{
+ if (p.empty()) {
+ // was: if ((!has_root_directory() && is_absolute()) || has_filename())
+ if (!_path.empty() && _path[_path.length() - 1] != preferred_separator && _path[_path.length() - 1] != ':') {
+ _path += preferred_separator;
+ }
+ return *this;
+ }
+ if ((p.is_absolute() && (_path != root_name()._path || p._path != "/")) || (p.has_root_name() && p.root_name() != root_name())) {
+ assign(p);
+ return *this;
+ }
+ if (p.has_root_directory()) {
+ assign(root_name());
+ }
+ else if ((!has_root_directory() && is_absolute()) || has_filename()) {
+ _path += preferred_separator;
+ }
+ auto iter = p.begin();
+ bool first = true;
+ if (p.has_root_name()) {
+ ++iter;
+ }
+ while (iter != p.end()) {
+ if (!first && !(!_path.empty() && _path[_path.length() - 1] == preferred_separator)) {
+ _path += preferred_separator;
+ }
+ first = false;
+ _path += (*iter++).native();
+ }
+ check_long_path();
+ return *this;
+}
+
+GHC_INLINE void path::append_name(const value_type* name)
+{
+ if (_path.empty()) {
+ this->operator/=(path(name));
+ }
+ else {
+ if (_path.back() != path::preferred_separator) {
+ _path.push_back(path::preferred_separator);
+ }
+ _path += name;
+ check_long_path();
+ }
+}
+
+#endif // GHC_EXPAND_IMPL
+
+template <class Source>
+inline path& path::operator/=(const Source& source)
+{
+ return append(source);
+}
+
+template <class Source>
+inline path& path::append(const Source& source)
+{
+ return this->operator/=(path(source));
+}
+
+template <>
+inline path& path::append<path>(const path& p)
+{
+ return this->operator/=(p);
+}
+
+template <class InputIterator>
+inline path& path::append(InputIterator first, InputIterator last)
+{
+ std::basic_string<typename std::iterator_traits<InputIterator>::value_type> part(first, last);
+ return append(part);
+}
+
+#ifdef GHC_EXPAND_IMPL
+
+//-----------------------------------------------------------------------------
+// 30.10.8.4.4 concatenation
+
+GHC_INLINE path& path::operator+=(const path& x)
+{
+ return concat(x._path);
+}
+
+GHC_INLINE path& path::operator+=(const string_type& x)
+{
+ return concat(x);
+}
+
+#ifdef GHC_WITH_STRING_VIEW
+GHC_INLINE path& path::operator+=(basic_string_view<value_type> x)
+{
+ return concat(x);
+}
+#endif
+
+GHC_INLINE path& path::operator+=(const value_type* x)
+{
+#ifdef GHC_WITH_STRING_VIEW
+ basic_string_view<value_type> part(x);
+#else
+ string_type part(x);
+#endif
+ return concat(part);
+}
+
+GHC_INLINE path& path::operator+=(value_type x)
+{
+#ifdef GHC_OS_WINDOWS
+ if (x == generic_separator) {
+ x = preferred_separator;
+ }
+#endif
+ if (_path.empty() || _path.back() != preferred_separator) {
+ _path += x;
+ }
+ check_long_path();
+ return *this;
+}
+
+#endif // GHC_EXPAND_IMPL
+
+template <class Source>
+inline path::path_from_string<Source>& path::operator+=(const Source& x)
+{
+ return concat(x);
+}
+
+template <class EcharT>
+inline path::path_type_EcharT<EcharT>& path::operator+=(EcharT x)
+{
+#ifdef GHC_WITH_STRING_VIEW
+ basic_string_view<EcharT> part(&x, 1);
+#else
+ std::basic_string<EcharT> part(1, x);
+#endif
+ concat(part);
+ return *this;
+}
+
+template <class Source>
+inline path& path::concat(const Source& x)
+{
+ path p(x);
+ _path += p._path;
+ postprocess_path_with_format(native_format);
+ return *this;
+}
+template <class InputIterator>
+inline path& path::concat(InputIterator first, InputIterator last)
+{
+ _path.append(first, last);
+ postprocess_path_with_format(native_format);
+ return *this;
+}
+
+#ifdef GHC_EXPAND_IMPL
+
+//-----------------------------------------------------------------------------
+// 30.10.8.4.5 modifiers
+GHC_INLINE void path::clear() noexcept
+{
+ _path.clear();
+#if defined(GHC_OS_WINDOWS) && defined(GHC_WIN_AUTO_PREFIX_LONG_PATH)
+ _prefixLength = 0;
+#endif
+}
+
+GHC_INLINE path& path::make_preferred()
+{
+ // as this filesystem implementation only uses generic_format
+ // internally, this must be a no-op
+ return *this;
+}
+
+GHC_INLINE path& path::remove_filename()
+{
+ if (has_filename()) {
+ _path.erase(_path.size() - filename()._path.size());
+ }
+ return *this;
+}
+
+GHC_INLINE path& path::replace_filename(const path& replacement)
+{
+ remove_filename();
+ return append(replacement);
+}
+
+GHC_INLINE path& path::replace_extension(const path& replacement)
+{
+ if (has_extension()) {
+ _path.erase(_path.size() - extension()._path.size());
+ }
+ if (!replacement.empty() && replacement._path[0] != '.') {
+ _path += '.';
+ }
+ return concat(replacement);
+}
+
+GHC_INLINE void path::swap(path& rhs) noexcept
+{
+ _path.swap(rhs._path);
+#if defined(GHC_OS_WINDOWS) && defined(GHC_WIN_AUTO_PREFIX_LONG_PATH)
+ std::swap(_prefixLength, rhs._prefixLength);
+#endif
+}
+
+//-----------------------------------------------------------------------------
+// 30.10.8.4.6, native format observers
+GHC_INLINE const path::string_type& path::native() const noexcept
+{
+ return _path;
+}
+
+GHC_INLINE const path::value_type* path::c_str() const noexcept
+{
+ return native().c_str();
+}
+
+GHC_INLINE path::operator path::string_type() const
+{
+ return native();
+}
+
+#endif // GHC_EXPAND_IMPL
+
+template <class EcharT, class traits, class Allocator>
+inline std::basic_string<EcharT, traits, Allocator> path::string(const Allocator& a) const
+{
+#ifdef GHC_USE_WCHAR_T
+ return detail::fromWChar<std::basic_string<EcharT, traits, Allocator>>(_path, a);
+#else
+ return detail::fromUtf8<std::basic_string<EcharT, traits, Allocator>>(_path, a);
+#endif
+}
+
+#ifdef GHC_EXPAND_IMPL
+
+GHC_INLINE std::string path::string() const
+{
+#ifdef GHC_USE_WCHAR_T
+ return detail::toUtf8(native());
+#else
+ return native();
+#endif
+}
+
+GHC_INLINE std::wstring path::wstring() const
+{
+#ifdef GHC_USE_WCHAR_T
+ return native();
+#else
+ return detail::fromUtf8<std::wstring>(native());
+#endif
+}
+
+#if defined(__cpp_lib_char8_t) && !defined(GHC_FILESYSTEM_ENFORCE_CPP17_API)
+GHC_INLINE std::u8string path::u8string() const
+{
+#ifdef GHC_USE_WCHAR_T
+ return std::u8string(reinterpret_cast<const char8_t*>(detail::toUtf8(native()).c_str()));
+#else
+ return std::u8string(reinterpret_cast<const char8_t*>(c_str()));
+#endif
+}
+#else
+GHC_INLINE std::string path::u8string() const
+{
+#ifdef GHC_USE_WCHAR_T
+ return detail::toUtf8(native());
+#else
+ return native();
+#endif
+}
+#endif
+
+GHC_INLINE std::u16string path::u16string() const
+{
+ // TODO: optimize
+ return detail::fromUtf8<std::u16string>(string());
+}
+
+GHC_INLINE std::u32string path::u32string() const
+{
+ // TODO: optimize
+ return detail::fromUtf8<std::u32string>(string());
+}
+
+#endif // GHC_EXPAND_IMPL
+
+//-----------------------------------------------------------------------------
+// 30.10.8.4.7, generic format observers
+template <class EcharT, class traits, class Allocator>
+inline std::basic_string<EcharT, traits, Allocator> path::generic_string(const Allocator& a) const
+{
+#ifdef GHC_OS_WINDOWS
+#ifdef GHC_USE_WCHAR_T
+ auto result = detail::fromWChar<std::basic_string<EcharT, traits, Allocator>, path::string_type>(_path, a);
+#else
+ auto result = detail::fromUtf8<std::basic_string<EcharT, traits, Allocator>>(_path, a);
+#endif
+ for (auto& c : result) {
+ if (c == preferred_separator) {
+ c = generic_separator;
+ }
+ }
+ return result;
+#else
+ return detail::fromUtf8<std::basic_string<EcharT, traits, Allocator>>(_path, a);
+#endif
+}
+
+#ifdef GHC_EXPAND_IMPL
+
+GHC_INLINE std::string path::generic_string() const
+{
+#ifdef GHC_OS_WINDOWS
+ return generic_string<std::string::value_type, std::string::traits_type, std::string::allocator_type>();
+#else
+ return _path;
+#endif
+}
+
+GHC_INLINE std::wstring path::generic_wstring() const
+{
+#ifdef GHC_OS_WINDOWS
+ return generic_string<std::wstring::value_type, std::wstring::traits_type, std::wstring::allocator_type>();
+#else
+ return detail::fromUtf8<std::wstring>(_path);
+#endif
+} // namespace filesystem
+
+#if defined(__cpp_lib_char8_t) && !defined(GHC_FILESYSTEM_ENFORCE_CPP17_API)
+GHC_INLINE std::u8string path::generic_u8string() const
+{
+#ifdef GHC_OS_WINDOWS
+ return generic_string<std::u8string::value_type, std::u8string::traits_type, std::u8string::allocator_type>();
+#else
+ return std::u8string(reinterpret_cast<const char8_t*>(_path.c_str()));
+#endif
+}
+#else
+GHC_INLINE std::string path::generic_u8string() const
+{
+#ifdef GHC_OS_WINDOWS
+ return generic_string<std::string::value_type, std::string::traits_type, std::string::allocator_type>();
+#else
+ return _path;
+#endif
+}
+#endif
+
+GHC_INLINE std::u16string path::generic_u16string() const
+{
+#ifdef GHC_OS_WINDOWS
+ return generic_string<std::u16string::value_type, std::u16string::traits_type, std::u16string::allocator_type>();
+#else
+ return detail::fromUtf8<std::u16string>(_path);
+#endif
+}
+
+GHC_INLINE std::u32string path::generic_u32string() const
+{
+#ifdef GHC_OS_WINDOWS
+ return generic_string<std::u32string::value_type, std::u32string::traits_type, std::u32string::allocator_type>();
+#else
+ return detail::fromUtf8<std::u32string>(_path);
+#endif
+}
+
+//-----------------------------------------------------------------------------
+// 30.10.8.4.8, compare
+GHC_INLINE int path::compare(const path& p) const noexcept
+{
+#ifdef LWG_2936_BEHAVIOUR
+ auto rnl1 = root_name_length();
+ auto rnl2 = p.root_name_length();
+#ifdef GHC_OS_WINDOWS
+ auto rnc = detail::compare_simple_insensitive(_path.c_str(), rnl1, p._path.c_str(), rnl2);
+#else
+ auto rnc = _path.compare(0, rnl1, p._path, 0, (std::min(rnl1, rnl2)));
+#endif
+ if (rnc) {
+ return rnc;
+ }
+ bool hrd1 = has_root_directory(), hrd2 = p.has_root_directory();
+ if (hrd1 != hrd2) {
+ return hrd1 ? 1 : -1;
+ }
+ if (hrd1) {
+ ++rnl1;
+ ++rnl2;
+ }
+ auto iter1 = _path.begin() + static_cast<int>(rnl1);
+ auto iter2 = p._path.begin() + static_cast<int>(rnl2);
+ while (iter1 != _path.end() && iter2 != p._path.end() && *iter1 == *iter2) {
+ ++iter1;
+ ++iter2;
+ }
+ if (iter1 == _path.end()) {
+ return iter2 == p._path.end() ? 0 : -1;
+ }
+ if (iter2 == p._path.end()) {
+ return 1;
+ }
+ if (*iter1 == preferred_separator) {
+ return -1;
+ }
+ if (*iter2 == preferred_separator) {
+ return 1;
+ }
+ return *iter1 < *iter2 ? -1 : 1;
+#else // LWG_2936_BEHAVIOUR
+#ifdef GHC_OS_WINDOWS
+ auto rnl1 = root_name_length();
+ auto rnl2 = p.root_name_length();
+ auto rnc = detail::compare_simple_insensitive(_path.c_str(), rnl1, p._path.c_str(), rnl2);
+ if (rnc) {
+ return rnc;
+ }
+ return _path.compare(rnl1, std::string::npos, p._path, rnl2, std::string::npos);
+#else
+ return _path.compare(p._path);
+#endif
+#endif
+}
+
+GHC_INLINE int path::compare(const string_type& s) const
+{
+ return compare(path(s));
+}
+
+#ifdef GHC_WITH_STRING_VIEW
+GHC_INLINE int path::compare(basic_string_view<value_type> s) const
+{
+ return compare(path(s));
+}
+#endif
+
+GHC_INLINE int path::compare(const value_type* s) const
+{
+ return compare(path(s));
+}
+
+//-----------------------------------------------------------------------------
+// 30.10.8.4.9, decomposition
+#ifdef GHC_OS_WINDOWS
+GHC_INLINE void path::handle_prefixes()
+{
+#if defined(GHC_WIN_AUTO_PREFIX_LONG_PATH)
+ _prefixLength = 0;
+ if (_path.length() >= 6 && _path[2] == '?' && std::toupper(static_cast<unsigned char>(_path[4])) >= 'A' && std::toupper(static_cast<unsigned char>(_path[4])) <= 'Z' && _path[5] == ':') {
+ if (detail::startsWith(_path, impl_string_type(GHC_PLATFORM_LITERAL("\\\\?\\"))) || detail::startsWith(_path, impl_string_type(GHC_PLATFORM_LITERAL("\\??\\")))) {
+ _prefixLength = 4;
+ }
+ }
+#endif // GHC_WIN_AUTO_PREFIX_LONG_PATH
+}
+#endif
+
+GHC_INLINE path::string_type::size_type path::root_name_length() const noexcept
+{
+#ifdef GHC_OS_WINDOWS
+ if (_path.length() >= _prefixLength + 2 && std::toupper(static_cast<unsigned char>(_path[_prefixLength])) >= 'A' && std::toupper(static_cast<unsigned char>(_path[_prefixLength])) <= 'Z' && _path[_prefixLength + 1] == ':') {
+ return 2;
+ }
+#endif
+ if (_path.length() > _prefixLength + 2 && _path[_prefixLength] == preferred_separator && _path[_prefixLength + 1] == preferred_separator && _path[_prefixLength + 2] != preferred_separator && std::isprint(_path[_prefixLength + 2])) {
+ impl_string_type::size_type pos = _path.find(preferred_separator, _prefixLength + 3);
+ if (pos == impl_string_type::npos) {
+ return _path.length();
+ }
+ else {
+ return pos;
+ }
+ }
+ return 0;
+}
+
+GHC_INLINE path path::root_name() const
+{
+ return path(_path.substr(_prefixLength, root_name_length()), native_format);
+}
+
+GHC_INLINE path path::root_directory() const
+{
+ if (has_root_directory()) {
+ static const path _root_dir(std::string(1, preferred_separator), native_format);
+ return _root_dir;
+ }
+ return path();
+}
+
+GHC_INLINE path path::root_path() const
+{
+ return path(root_name().string() + root_directory().string(), native_format);
+}
+
+GHC_INLINE path path::relative_path() const
+{
+ auto rootPathLen = _prefixLength + root_name_length() + (has_root_directory() ? 1 : 0);
+ return path(_path.substr((std::min)(rootPathLen, _path.length())), generic_format);
+}
+
+GHC_INLINE path path::parent_path() const
+{
+ auto rootPathLen = _prefixLength + root_name_length() + (has_root_directory() ? 1 : 0);
+ if (rootPathLen < _path.length()) {
+ if (empty()) {
+ return path();
+ }
+ else {
+ auto piter = end();
+ auto iter = piter.decrement(_path.end());
+ if (iter > _path.begin() + static_cast<long>(rootPathLen) && *iter != preferred_separator) {
+ --iter;
+ }
+ return path(_path.begin(), iter, native_format);
+ }
+ }
+ else {
+ return *this;
+ }
+}
+
+GHC_INLINE path path::filename() const
+{
+ return !has_relative_path() ? path() : path(*--end());
+}
+
+GHC_INLINE path path::stem() const
+{
+ impl_string_type fn = filename().native();
+ if (fn != "." && fn != "..") {
+ impl_string_type::size_type pos = fn.rfind('.');
+ if (pos != impl_string_type::npos && pos > 0) {
+ return path{fn.substr(0, pos), native_format};
+ }
+ }
+ return path{fn, native_format};
+}
+
+GHC_INLINE path path::extension() const
+{
+ if (has_relative_path()) {
+ auto iter = end();
+ const auto& fn = *--iter;
+ impl_string_type::size_type pos = fn._path.rfind('.');
+ if (pos != std::string::npos && pos > 0) {
+ return path(fn._path.substr(pos), native_format);
+ }
+ }
+ return path();
+}
+
+#ifdef GHC_OS_WINDOWS
+namespace detail {
+GHC_INLINE bool has_executable_extension(const path& p)
+{
+ if (p.has_relative_path()) {
+ auto iter = p.end();
+ const auto& fn = *--iter;
+ auto pos = fn._path.find_last_of('.');
+ if (pos == std::string::npos || pos == 0 || fn._path.length() - pos != 3) {
+ return false;
+ }
+ const path::value_type* ext = fn._path.c_str() + pos + 1;
+ if (detail::equals_simple_insensitive(ext, GHC_PLATFORM_LITERAL("exe")) || detail::equals_simple_insensitive(ext, GHC_PLATFORM_LITERAL("cmd")) || detail::equals_simple_insensitive(ext, GHC_PLATFORM_LITERAL("bat")) || detail::equals_simple_insensitive(ext, GHC_PLATFORM_LITERAL("com"))) {
+ return true;
+ }
+ }
+ return false;
+}
+} // namespace detail
+#endif
+
+//-----------------------------------------------------------------------------
+// 30.10.8.4.10, query
+GHC_INLINE bool path::empty() const noexcept
+{
+ return _path.empty();
+}
+
+GHC_INLINE bool path::has_root_name() const
+{
+ return root_name_length() > 0;
+}
+
+GHC_INLINE bool path::has_root_directory() const
+{
+ auto rootLen = _prefixLength + root_name_length();
+ return (_path.length() > rootLen && _path[rootLen] == preferred_separator);
+}
+
+GHC_INLINE bool path::has_root_path() const
+{
+ return has_root_name() || has_root_directory();
+}
+
+GHC_INLINE bool path::has_relative_path() const
+{
+ auto rootPathLen = _prefixLength + root_name_length() + (has_root_directory() ? 1 : 0);
+ return rootPathLen < _path.length();
+}
+
+GHC_INLINE bool path::has_parent_path() const
+{
+ return !parent_path().empty();
+}
+
+GHC_INLINE bool path::has_filename() const
+{
+ return has_relative_path() && !filename().empty();
+}
+
+GHC_INLINE bool path::has_stem() const
+{
+ return !stem().empty();
+}
+
+GHC_INLINE bool path::has_extension() const
+{
+ return !extension().empty();
+}
+
+GHC_INLINE bool path::is_absolute() const
+{
+#ifdef GHC_OS_WINDOWS
+ return has_root_name() && has_root_directory();
+#else
+ return has_root_directory();
+#endif
+}
+
+GHC_INLINE bool path::is_relative() const
+{
+ return !is_absolute();
+}
+
+//-----------------------------------------------------------------------------
+// 30.10.8.4.11, generation
+GHC_INLINE path path::lexically_normal() const
+{
+ path dest;
+ bool lastDotDot = false;
+ for (string_type s : *this) {
+ if (s == ".") {
+ dest /= "";
+ continue;
+ }
+ else if (s == ".." && !dest.empty()) {
+ auto root = root_path();
+ if (dest == root) {
+ continue;
+ }
+ else if (*(--dest.end()) != "..") {
+ if (dest._path.back() == preferred_separator) {
+ dest._path.pop_back();
+ }
+ dest.remove_filename();
+ continue;
+ }
+ }
+ if (!(s.empty() && lastDotDot)) {
+ dest /= s;
+ }
+ lastDotDot = s == "..";
+ }
+ if (dest.empty()) {
+ dest = ".";
+ }
+ return dest;
+}
+
+GHC_INLINE path path::lexically_relative(const path& base) const
+{
+ if (root_name() != base.root_name() || is_absolute() != base.is_absolute() || (!has_root_directory() && base.has_root_directory())) {
+ return path();
+ }
+ const_iterator a = begin(), b = base.begin();
+ while (a != end() && b != base.end() && *a == *b) {
+ ++a;
+ ++b;
+ }
+ if (a == end() && b == base.end()) {
+ return path(".");
+ }
+ int count = 0;
+ for (const auto& element : input_iterator_range<const_iterator>(b, base.end())) {
+ if (element != "." && element != "" && element != "..") {
+ ++count;
+ }
+ else if (element == "..") {
+ --count;
+ }
+ }
+ if (count < 0) {
+ return path();
+ }
+ path result;
+ for (int i = 0; i < count; ++i) {
+ result /= "..";
+ }
+ for (const auto& element : input_iterator_range<const_iterator>(a, end())) {
+ result /= element;
+ }
+ return result;
+}
+
+GHC_INLINE path path::lexically_proximate(const path& base) const
+{
+ path result = lexically_relative(base);
+ return result.empty() ? *this : result;
+}
+
+//-----------------------------------------------------------------------------
+// 30.10.8.5, iterators
+GHC_INLINE path::iterator::iterator() {}
+
+GHC_INLINE path::iterator::iterator(const path& p, const impl_string_type::const_iterator& pos)
+ : _first(p._path.begin())
+ , _last(p._path.end())
+ , _prefix(_first + static_cast<string_type::difference_type>(p._prefixLength))
+ , _root(p.has_root_directory() ? _first + static_cast<string_type::difference_type>(p._prefixLength + p.root_name_length()) : _last)
+ , _iter(pos)
+{
+ if(pos != _last) {
+ updateCurrent();
+ }
+}
+
+GHC_INLINE path::impl_string_type::const_iterator path::iterator::increment(const path::impl_string_type::const_iterator& pos) const
+{
+ path::impl_string_type::const_iterator i = pos;
+ bool fromStart = i == _first || i == _prefix;
+ if (i != _last) {
+ if (fromStart && i == _first && _prefix > _first) {
+ i = _prefix;
+ }
+ else if (*i++ == preferred_separator) {
+ // we can only sit on a slash if it is a network name or a root
+ if (i != _last && *i == preferred_separator) {
+ if (fromStart && !(i + 1 != _last && *(i + 1) == preferred_separator)) {
+ // leadind double slashes detected, treat this and the
+ // following until a slash as one unit
+ i = std::find(++i, _last, preferred_separator);
+ }
+ else {
+ // skip redundant slashes
+ while (i != _last && *i == preferred_separator) {
+ ++i;
+ }
+ }
+ }
+ }
+ else {
+ if (fromStart && i != _last && *i == ':') {
+ ++i;
+ }
+ else {
+ i = std::find(i, _last, preferred_separator);
+ }
+ }
+ }
+ return i;
+}
+
+GHC_INLINE path::impl_string_type::const_iterator path::iterator::decrement(const path::impl_string_type::const_iterator& pos) const
+{
+ path::impl_string_type::const_iterator i = pos;
+ if (i != _first) {
+ --i;
+ // if this is now the root slash or the trailing slash, we are done,
+ // else check for network name
+ if (i != _root && (pos != _last || *i != preferred_separator)) {
+#ifdef GHC_OS_WINDOWS
+ static const impl_string_type seps = GHC_PLATFORM_LITERAL("\\:");
+ i = std::find_first_of(std::reverse_iterator<path::impl_string_type::const_iterator>(i), std::reverse_iterator<path::impl_string_type::const_iterator>(_first), seps.begin(), seps.end()).base();
+ if (i > _first && *i == ':') {
+ i++;
+ }
+#else
+ i = std::find(std::reverse_iterator<path::impl_string_type::const_iterator>(i), std::reverse_iterator<path::impl_string_type::const_iterator>(_first), preferred_separator).base();
+#endif
+ // Now we have to check if this is a network name
+ if (i - _first == 2 && *_first == preferred_separator && *(_first + 1) == preferred_separator) {
+ i -= 2;
+ }
+ }
+ }
+ return i;
+}
+
+GHC_INLINE void path::iterator::updateCurrent()
+{
+ if ((_iter == _last) || (_iter != _first && _iter != _last && (*_iter == preferred_separator && _iter != _root) && (_iter + 1 == _last))) {
+ _current.clear();
+ }
+ else {
+ _current.assign(_iter, increment(_iter));
+ }
+}
+
+GHC_INLINE path::iterator& path::iterator::operator++()
+{
+ _iter = increment(_iter);
+ while (_iter != _last && // we didn't reach the end
+ _iter != _root && // this is not a root position
+ *_iter == preferred_separator && // we are on a separator
+ (_iter + 1) != _last // the slash is not the last char
+ ) {
+ ++_iter;
+ }
+ updateCurrent();
+ return *this;
+}
+
+GHC_INLINE path::iterator path::iterator::operator++(int)
+{
+ path::iterator i{*this};
+ ++(*this);
+ return i;
+}
+
+GHC_INLINE path::iterator& path::iterator::operator--()
+{
+ _iter = decrement(_iter);
+ updateCurrent();
+ return *this;
+}
+
+GHC_INLINE path::iterator path::iterator::operator--(int)
+{
+ auto i = *this;
+ --(*this);
+ return i;
+}
+
+GHC_INLINE bool path::iterator::operator==(const path::iterator& other) const
+{
+ return _iter == other._iter;
+}
+
+GHC_INLINE bool path::iterator::operator!=(const path::iterator& other) const
+{
+ return _iter != other._iter;
+}
+
+GHC_INLINE path::iterator::reference path::iterator::operator*() const
+{
+ return _current;
+}
+
+GHC_INLINE path::iterator::pointer path::iterator::operator->() const
+{
+ return &_current;
+}
+
+GHC_INLINE path::iterator path::begin() const
+{
+ return iterator(*this, _path.begin());
+}
+
+GHC_INLINE path::iterator path::end() const
+{
+ return iterator(*this, _path.end());
+}
+
+//-----------------------------------------------------------------------------
+// 30.10.8.6, path non-member functions
+GHC_INLINE void swap(path& lhs, path& rhs) noexcept
+{
+ swap(lhs._path, rhs._path);
+}
+
+GHC_INLINE size_t hash_value(const path& p) noexcept
+{
+ return std::hash<std::string>()(p.generic_string());
+}
+
+#ifdef GHC_HAS_THREEWAY_COMP
+GHC_INLINE std::strong_ordering operator<=>(const path& lhs, const path& rhs) noexcept
+{
+ return lhs.compare(rhs) <=> 0;
+}
+#endif
+
+GHC_INLINE bool operator==(const path& lhs, const path& rhs) noexcept
+{
+ return lhs.compare(rhs) == 0;
+}
+
+GHC_INLINE bool operator!=(const path& lhs, const path& rhs) noexcept
+{
+ return !(lhs == rhs);
+}
+
+GHC_INLINE bool operator<(const path& lhs, const path& rhs) noexcept
+{
+ return lhs.compare(rhs) < 0;
+}
+
+GHC_INLINE bool operator<=(const path& lhs, const path& rhs) noexcept
+{
+ return lhs.compare(rhs) <= 0;
+}
+
+GHC_INLINE bool operator>(const path& lhs, const path& rhs) noexcept
+{
+ return lhs.compare(rhs) > 0;
+}
+
+GHC_INLINE bool operator>=(const path& lhs, const path& rhs) noexcept
+{
+ return lhs.compare(rhs) >= 0;
+}
+
+GHC_INLINE path operator/(const path& lhs, const path& rhs)
+{
+ path result(lhs);
+ result /= rhs;
+ return result;
+}
+
+#endif // GHC_EXPAND_IMPL
+
+//-----------------------------------------------------------------------------
+// 30.10.8.6.1 path inserter and extractor
+template <class charT, class traits>
+inline std::basic_ostream<charT, traits>& operator<<(std::basic_ostream<charT, traits>& os, const path& p)
+{
+ os << "\"";
+ auto ps = p.string<charT, traits>();
+ for (auto c : ps) {
+ if (c == '"' || c == '\\') {
+ os << '\\';
+ }
+ os << c;
+ }
+ os << "\"";
+ return os;
+}
+
+template <class charT, class traits>
+inline std::basic_istream<charT, traits>& operator>>(std::basic_istream<charT, traits>& is, path& p)
+{
+ std::basic_string<charT, traits> tmp;
+ charT c;
+ is >> c;
+ if (c == '"') {
+ auto sf = is.flags();
+ is >> std::noskipws;
+ while (is) {
+ auto c2 = is.get();
+ if (is) {
+ if (c2 == '\\') {
+ c2 = is.get();
+ if (is) {
+ tmp += static_cast<charT>(c2);
+ }
+ }
+ else if (c2 == '"') {
+ break;
+ }
+ else {
+ tmp += static_cast<charT>(c2);
+ }
+ }
+ }
+ if ((sf & std::ios_base::skipws) == std::ios_base::skipws) {
+ is >> std::skipws;
+ }
+ p = path(tmp);
+ }
+ else {
+ is >> tmp;
+ p = path(static_cast<charT>(c) + tmp);
+ }
+ return is;
+}
+
+#ifdef GHC_EXPAND_IMPL
+
+//-----------------------------------------------------------------------------
+// 30.10.9 Class filesystem_error
+GHC_INLINE filesystem_error::filesystem_error(const std::string& what_arg, std::error_code ec)
+ : std::system_error(ec, what_arg)
+ , _what_arg(what_arg)
+ , _ec(ec)
+{
+}
+
+GHC_INLINE filesystem_error::filesystem_error(const std::string& what_arg, const path& p1, std::error_code ec)
+ : std::system_error(ec, what_arg)
+ , _what_arg(what_arg)
+ , _ec(ec)
+ , _p1(p1)
+{
+ if (!_p1.empty()) {
+ _what_arg += ": '" + _p1.string() + "'";
+ }
+}
+
+GHC_INLINE filesystem_error::filesystem_error(const std::string& what_arg, const path& p1, const path& p2, std::error_code ec)
+ : std::system_error(ec, what_arg)
+ , _what_arg(what_arg)
+ , _ec(ec)
+ , _p1(p1)
+ , _p2(p2)
+{
+ if (!_p1.empty()) {
+ _what_arg += ": '" + _p1.string() + "'";
+ }
+ if (!_p2.empty()) {
+ _what_arg += ", '" + _p2.string() + "'";
+ }
+}
+
+GHC_INLINE const path& filesystem_error::path1() const noexcept
+{
+ return _p1;
+}
+
+GHC_INLINE const path& filesystem_error::path2() const noexcept
+{
+ return _p2;
+}
+
+GHC_INLINE const char* filesystem_error::what() const noexcept
+{
+ return _what_arg.c_str();
+}
+
+//-----------------------------------------------------------------------------
+// 30.10.15, filesystem operations
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE path absolute(const path& p)
+{
+ std::error_code ec;
+ path result = absolute(p, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p, ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE path absolute(const path& p, std::error_code& ec)
+{
+ ec.clear();
+#ifdef GHC_OS_WINDOWS
+ if (p.empty()) {
+ return absolute(current_path(ec), ec) / "";
+ }
+ ULONG size = ::GetFullPathNameW(GHC_NATIVEWP(p), 0, 0, 0);
+ if (size) {
+ std::vector<wchar_t> buf(size, 0);
+ ULONG s2 = GetFullPathNameW(GHC_NATIVEWP(p), size, buf.data(), nullptr);
+ if (s2 && s2 < size) {
+ path result = path(std::wstring(buf.data(), s2));
+ if (p.filename() == ".") {
+ result /= ".";
+ }
+ return result;
+ }
+ }
+ ec = detail::make_system_error();
+ return path();
+#else
+ path base = current_path(ec);
+ if (!ec) {
+ if (p.empty()) {
+ return base / p;
+ }
+ if (p.has_root_name()) {
+ if (p.has_root_directory()) {
+ return p;
+ }
+ else {
+ return p.root_name() / base.root_directory() / base.relative_path() / p.relative_path();
+ }
+ }
+ else {
+ if (p.has_root_directory()) {
+ return base.root_name() / p;
+ }
+ else {
+ return base / p;
+ }
+ }
+ }
+ ec = detail::make_system_error();
+ return path();
+#endif
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE path canonical(const path& p)
+{
+ std::error_code ec;
+ auto result = canonical(p, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p, ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE path canonical(const path& p, std::error_code& ec)
+{
+ if (p.empty()) {
+ ec = detail::make_error_code(detail::portable_error::not_found);
+ return path();
+ }
+ path work = p.is_absolute() ? p : absolute(p, ec);
+ path result;
+
+ auto fs = status(work, ec);
+ if (ec) {
+ return path();
+ }
+ if (fs.type() == file_type::not_found) {
+ ec = detail::make_error_code(detail::portable_error::not_found);
+ return path();
+ }
+ bool redo;
+ do {
+ auto rootPathLen = work._prefixLength + work.root_name_length() + (work.has_root_directory() ? 1 : 0);
+ redo = false;
+ result.clear();
+ for (auto pe : work) {
+ if (pe.empty() || pe == ".") {
+ continue;
+ }
+ else if (pe == "..") {
+ result = result.parent_path();
+ continue;
+ }
+ else if ((result / pe).string().length() <= rootPathLen) {
+ result /= pe;
+ continue;
+ }
+ auto sls = symlink_status(result / pe, ec);
+ if (ec) {
+ return path();
+ }
+ if (is_symlink(sls)) {
+ redo = true;
+ auto target = read_symlink(result / pe, ec);
+ if (ec) {
+ return path();
+ }
+ if (target.is_absolute()) {
+ result = target;
+ continue;
+ }
+ else {
+ result /= target;
+ continue;
+ }
+ }
+ else {
+ result /= pe;
+ }
+ }
+ work = result;
+ } while (redo);
+ ec.clear();
+ return result;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE void copy(const path& from, const path& to)
+{
+ copy(from, to, copy_options::none);
+}
+
+GHC_INLINE void copy(const path& from, const path& to, copy_options options)
+{
+ std::error_code ec;
+ copy(from, to, options, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), from, to, ec);
+ }
+}
+#endif
+
+GHC_INLINE void copy(const path& from, const path& to, std::error_code& ec) noexcept
+{
+ copy(from, to, copy_options::none, ec);
+}
+
+GHC_INLINE void copy(const path& from, const path& to, copy_options options, std::error_code& ec) noexcept
+{
+ std::error_code tec;
+ file_status fs_from, fs_to;
+ ec.clear();
+ if ((options & (copy_options::skip_symlinks | copy_options::copy_symlinks | copy_options::create_symlinks)) != copy_options::none) {
+ fs_from = symlink_status(from, ec);
+ }
+ else {
+ fs_from = status(from, ec);
+ }
+ if (!exists(fs_from)) {
+ if (!ec) {
+ ec = detail::make_error_code(detail::portable_error::not_found);
+ }
+ return;
+ }
+ if ((options & (copy_options::skip_symlinks | copy_options::create_symlinks)) != copy_options::none) {
+ fs_to = symlink_status(to, tec);
+ }
+ else {
+ fs_to = status(to, tec);
+ }
+ if (is_other(fs_from) || is_other(fs_to) || (is_directory(fs_from) && is_regular_file(fs_to)) || (exists(fs_to) && equivalent(from, to, ec))) {
+ ec = detail::make_error_code(detail::portable_error::invalid_argument);
+ }
+ else if (is_symlink(fs_from)) {
+ if ((options & copy_options::skip_symlinks) == copy_options::none) {
+ if (!exists(fs_to) && (options & copy_options::copy_symlinks) != copy_options::none) {
+ copy_symlink(from, to, ec);
+ }
+ else {
+ ec = detail::make_error_code(detail::portable_error::invalid_argument);
+ }
+ }
+ }
+ else if (is_regular_file(fs_from)) {
+ if ((options & copy_options::directories_only) == copy_options::none) {
+ if ((options & copy_options::create_symlinks) != copy_options::none) {
+ create_symlink(from.is_absolute() ? from : canonical(from, ec), to, ec);
+ }
+#ifndef GHC_OS_WEB
+ else if ((options & copy_options::create_hard_links) != copy_options::none) {
+ create_hard_link(from, to, ec);
+ }
+#endif
+ else if (is_directory(fs_to)) {
+ copy_file(from, to / from.filename(), options, ec);
+ }
+ else {
+ copy_file(from, to, options, ec);
+ }
+ }
+ }
+#ifdef LWG_2682_BEHAVIOUR
+ else if (is_directory(fs_from) && (options & copy_options::create_symlinks) != copy_options::none) {
+ ec = detail::make_error_code(detail::portable_error::is_a_directory);
+ }
+#endif
+ else if (is_directory(fs_from) && (options == copy_options::none || (options & copy_options::recursive) != copy_options::none)) {
+ if (!exists(fs_to)) {
+ create_directory(to, from, ec);
+ if (ec) {
+ return;
+ }
+ }
+ for (auto iter = directory_iterator(from, ec); iter != directory_iterator(); iter.increment(ec)) {
+ if (!ec) {
+ copy(iter->path(), to / iter->path().filename(), options | static_cast<copy_options>(0x8000), ec);
+ }
+ if (ec) {
+ return;
+ }
+ }
+ }
+ return;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool copy_file(const path& from, const path& to)
+{
+ return copy_file(from, to, copy_options::none);
+}
+
+GHC_INLINE bool copy_file(const path& from, const path& to, copy_options option)
+{
+ std::error_code ec;
+ auto result = copy_file(from, to, option, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), from, to, ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE bool copy_file(const path& from, const path& to, std::error_code& ec) noexcept
+{
+ return copy_file(from, to, copy_options::none, ec);
+}
+
+GHC_INLINE bool copy_file(const path& from, const path& to, copy_options options, std::error_code& ec) noexcept
+{
+ std::error_code tecf, tect;
+ auto sf = status(from, tecf);
+ auto st = status(to, tect);
+ bool overwrite = false;
+ ec.clear();
+ if (!is_regular_file(sf)) {
+ ec = tecf;
+ return false;
+ }
+ if (exists(st) && (!is_regular_file(st) || equivalent(from, to, ec) || (options & (copy_options::skip_existing | copy_options::overwrite_existing | copy_options::update_existing)) == copy_options::none)) {
+ ec = tect ? tect : detail::make_error_code(detail::portable_error::exists);
+ return false;
+ }
+ if (exists(st)) {
+ if ((options & copy_options::update_existing) == copy_options::update_existing) {
+ auto from_time = last_write_time(from, ec);
+ if (ec) {
+ ec = detail::make_system_error();
+ return false;
+ }
+ auto to_time = last_write_time(to, ec);
+ if (ec) {
+ ec = detail::make_system_error();
+ return false;
+ }
+ if (from_time <= to_time) {
+ return false;
+ }
+ }
+ overwrite = true;
+ }
+#ifdef GHC_OS_WINDOWS
+ if (!::CopyFileW(GHC_NATIVEWP(from), GHC_NATIVEWP(to), !overwrite)) {
+ ec = detail::make_system_error();
+ return false;
+ }
+ return true;
+#else
+ std::vector<char> buffer(16384, '\0');
+ int in = -1, out = -1;
+ if ((in = ::open(from.c_str(), O_RDONLY)) < 0) {
+ ec = detail::make_system_error();
+ return false;
+ }
+ int mode = O_CREAT | O_WRONLY | O_TRUNC;
+ if (!overwrite) {
+ mode |= O_EXCL;
+ }
+ if ((out = ::open(to.c_str(), mode, static_cast<int>(sf.permissions() & perms::all))) < 0) {
+ ec = detail::make_system_error();
+ ::close(in);
+ return false;
+ }
+ ssize_t br, bw;
+ while ((br = ::read(in, buffer.data(), buffer.size())) > 0) {
+ ssize_t offset = 0;
+ do {
+ if ((bw = ::write(out, buffer.data() + offset, static_cast<size_t>(br))) > 0) {
+ br -= bw;
+ offset += bw;
+ }
+ else if (bw < 0) {
+ ec = detail::make_system_error();
+ ::close(in);
+ ::close(out);
+ return false;
+ }
+ } while (br);
+ }
+ ::close(in);
+ ::close(out);
+ return true;
+#endif
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE void copy_symlink(const path& existing_symlink, const path& new_symlink)
+{
+ std::error_code ec;
+ copy_symlink(existing_symlink, new_symlink, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), existing_symlink, new_symlink, ec);
+ }
+}
+#endif
+
+GHC_INLINE void copy_symlink(const path& existing_symlink, const path& new_symlink, std::error_code& ec) noexcept
+{
+ ec.clear();
+ auto to = read_symlink(existing_symlink, ec);
+ if (!ec) {
+ if (exists(to, ec) && is_directory(to, ec)) {
+ create_directory_symlink(to, new_symlink, ec);
+ }
+ else {
+ create_symlink(to, new_symlink, ec);
+ }
+ }
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool create_directories(const path& p)
+{
+ std::error_code ec;
+ auto result = create_directories(p, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p, ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE bool create_directories(const path& p, std::error_code& ec) noexcept
+{
+ path current;
+ ec.clear();
+ bool didCreate = false;
+ for (path::string_type part : p) {
+ current /= part;
+ if (current != p.root_name() && current != p.root_path()) {
+ std::error_code tec;
+ auto fs = status(current, tec);
+ if (tec && fs.type() != file_type::not_found) {
+ ec = tec;
+ return false;
+ }
+ if (!exists(fs)) {
+ create_directory(current, ec);
+ if (ec) {
+ std::error_code tmp_ec;
+ if (is_directory(current, tmp_ec)) {
+ ec.clear();
+ }
+ else {
+ return false;
+ }
+ }
+ didCreate = true;
+ }
+#ifndef LWG_2935_BEHAVIOUR
+ else if (!is_directory(fs)) {
+ ec = detail::make_error_code(detail::portable_error::exists);
+ return false;
+ }
+#endif
+ }
+ }
+ return didCreate;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool create_directory(const path& p)
+{
+ std::error_code ec;
+ auto result = create_directory(p, path(), ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p, ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE bool create_directory(const path& p, std::error_code& ec) noexcept
+{
+ return create_directory(p, path(), ec);
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool create_directory(const path& p, const path& attributes)
+{
+ std::error_code ec;
+ auto result = create_directory(p, attributes, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p, ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE bool create_directory(const path& p, const path& attributes, std::error_code& ec) noexcept
+{
+ std::error_code tec;
+ ec.clear();
+ auto fs = status(p, tec);
+#ifdef LWG_2935_BEHAVIOUR
+ if (status_known(fs) && exists(fs)) {
+ return false;
+ }
+#else
+ if (status_known(fs) && exists(fs) && is_directory(fs)) {
+ return false;
+ }
+#endif
+#ifdef GHC_OS_WINDOWS
+ if (!attributes.empty()) {
+ if (!::CreateDirectoryExW(GHC_NATIVEWP(attributes), GHC_NATIVEWP(p), NULL)) {
+ ec = detail::make_system_error();
+ return false;
+ }
+ }
+ else if (!::CreateDirectoryW(GHC_NATIVEWP(p), NULL)) {
+ ec = detail::make_system_error();
+ return false;
+ }
+#else
+ ::mode_t attribs = static_cast<mode_t>(perms::all);
+ if (!attributes.empty()) {
+ struct ::stat fileStat;
+ if (::stat(attributes.c_str(), &fileStat) != 0) {
+ ec = detail::make_system_error();
+ return false;
+ }
+ attribs = fileStat.st_mode;
+ }
+ if (::mkdir(p.c_str(), attribs) != 0) {
+ ec = detail::make_system_error();
+ return false;
+ }
+#endif
+ return true;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE void create_directory_symlink(const path& to, const path& new_symlink)
+{
+ std::error_code ec;
+ create_directory_symlink(to, new_symlink, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), to, new_symlink, ec);
+ }
+}
+#endif
+
+GHC_INLINE void create_directory_symlink(const path& to, const path& new_symlink, std::error_code& ec) noexcept
+{
+ detail::create_symlink(to, new_symlink, true, ec);
+}
+
+#ifndef GHC_OS_WEB
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE void create_hard_link(const path& to, const path& new_hard_link)
+{
+ std::error_code ec;
+ create_hard_link(to, new_hard_link, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), to, new_hard_link, ec);
+ }
+}
+#endif
+
+GHC_INLINE void create_hard_link(const path& to, const path& new_hard_link, std::error_code& ec) noexcept
+{
+ detail::create_hardlink(to, new_hard_link, ec);
+}
+#endif
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE void create_symlink(const path& to, const path& new_symlink)
+{
+ std::error_code ec;
+ create_symlink(to, new_symlink, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), to, new_symlink, ec);
+ }
+}
+#endif
+
+GHC_INLINE void create_symlink(const path& to, const path& new_symlink, std::error_code& ec) noexcept
+{
+ detail::create_symlink(to, new_symlink, false, ec);
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE path current_path()
+{
+ std::error_code ec;
+ auto result = current_path(ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE path current_path(std::error_code& ec)
+{
+ ec.clear();
+#ifdef GHC_OS_WINDOWS
+ DWORD pathlen = ::GetCurrentDirectoryW(0, 0);
+ std::unique_ptr<wchar_t[]> buffer(new wchar_t[size_t(pathlen) + 1]);
+ if (::GetCurrentDirectoryW(pathlen, buffer.get()) == 0) {
+ ec = detail::make_system_error();
+ return path();
+ }
+ return path(std::wstring(buffer.get()), path::native_format);
+#else
+ size_t pathlen = static_cast<size_t>(std::max(int(::pathconf(".", _PC_PATH_MAX)), int(PATH_MAX)));
+ std::unique_ptr<char[]> buffer(new char[pathlen + 1]);
+ if (::getcwd(buffer.get(), pathlen) == nullptr) {
+ ec = detail::make_system_error();
+ return path();
+ }
+ return path(buffer.get());
+#endif
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE void current_path(const path& p)
+{
+ std::error_code ec;
+ current_path(p, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p, ec);
+ }
+}
+#endif
+
+GHC_INLINE void current_path(const path& p, std::error_code& ec) noexcept
+{
+ ec.clear();
+#ifdef GHC_OS_WINDOWS
+ if (!::SetCurrentDirectoryW(GHC_NATIVEWP(p))) {
+ ec = detail::make_system_error();
+ }
+#else
+ if (::chdir(p.string().c_str()) == -1) {
+ ec = detail::make_system_error();
+ }
+#endif
+}
+
+GHC_INLINE bool exists(file_status s) noexcept
+{
+ return status_known(s) && s.type() != file_type::not_found;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool exists(const path& p)
+{
+ return exists(status(p));
+}
+#endif
+
+GHC_INLINE bool exists(const path& p, std::error_code& ec) noexcept
+{
+ file_status s = status(p, ec);
+ if (status_known(s)) {
+ ec.clear();
+ }
+ return exists(s);
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool equivalent(const path& p1, const path& p2)
+{
+ std::error_code ec;
+ bool result = equivalent(p1, p2, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p1, p2, ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE bool equivalent(const path& p1, const path& p2, std::error_code& ec) noexcept
+{
+ ec.clear();
+#ifdef GHC_OS_WINDOWS
+ std::shared_ptr<void> file1(::CreateFileW(GHC_NATIVEWP(p1), 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0), CloseHandle);
+ auto e1 = ::GetLastError();
+ std::shared_ptr<void> file2(::CreateFileW(GHC_NATIVEWP(p2), 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0), CloseHandle);
+ if (file1.get() == INVALID_HANDLE_VALUE || file2.get() == INVALID_HANDLE_VALUE) {
+#ifdef LWG_2937_BEHAVIOUR
+ ec = detail::make_system_error(e1 ? e1 : ::GetLastError());
+#else
+ if (file1 == file2) {
+ ec = detail::make_system_error(e1 ? e1 : ::GetLastError());
+ }
+#endif
+ return false;
+ }
+ BY_HANDLE_FILE_INFORMATION inf1, inf2;
+ if (!::GetFileInformationByHandle(file1.get(), &inf1)) {
+ ec = detail::make_system_error();
+ return false;
+ }
+ if (!::GetFileInformationByHandle(file2.get(), &inf2)) {
+ ec = detail::make_system_error();
+ return false;
+ }
+ return inf1.ftLastWriteTime.dwLowDateTime == inf2.ftLastWriteTime.dwLowDateTime && inf1.ftLastWriteTime.dwHighDateTime == inf2.ftLastWriteTime.dwHighDateTime && inf1.nFileIndexHigh == inf2.nFileIndexHigh && inf1.nFileIndexLow == inf2.nFileIndexLow &&
+ inf1.nFileSizeHigh == inf2.nFileSizeHigh && inf1.nFileSizeLow == inf2.nFileSizeLow && inf1.dwVolumeSerialNumber == inf2.dwVolumeSerialNumber;
+#else
+ struct ::stat s1, s2;
+ auto rc1 = ::stat(p1.c_str(), &s1);
+ auto e1 = errno;
+ auto rc2 = ::stat(p2.c_str(), &s2);
+ if (rc1 || rc2) {
+#ifdef LWG_2937_BEHAVIOUR
+ ec = detail::make_system_error(e1 ? e1 : errno);
+#else
+ if (rc1 && rc2) {
+ ec = detail::make_system_error(e1 ? e1 : errno);
+ }
+#endif
+ return false;
+ }
+ return s1.st_dev == s2.st_dev && s1.st_ino == s2.st_ino && s1.st_size == s2.st_size && s1.st_mtime == s2.st_mtime;
+#endif
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE uintmax_t file_size(const path& p)
+{
+ std::error_code ec;
+ auto result = file_size(p, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p, ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE uintmax_t file_size(const path& p, std::error_code& ec) noexcept
+{
+ ec.clear();
+#ifdef GHC_OS_WINDOWS
+ WIN32_FILE_ATTRIBUTE_DATA attr;
+ if (!GetFileAttributesExW(GHC_NATIVEWP(p), GetFileExInfoStandard, &attr)) {
+ ec = detail::make_system_error();
+ return static_cast<uintmax_t>(-1);
+ }
+ return static_cast<uintmax_t>(attr.nFileSizeHigh) << (sizeof(attr.nFileSizeHigh) * 8) | attr.nFileSizeLow;
+#else
+ struct ::stat fileStat;
+ if (::stat(p.c_str(), &fileStat) == -1) {
+ ec = detail::make_system_error();
+ return static_cast<uintmax_t>(-1);
+ }
+ return static_cast<uintmax_t>(fileStat.st_size);
+#endif
+}
+
+#ifndef GHC_OS_WEB
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE uintmax_t hard_link_count(const path& p)
+{
+ std::error_code ec;
+ auto result = hard_link_count(p, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p, ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE uintmax_t hard_link_count(const path& p, std::error_code& ec) noexcept
+{
+ ec.clear();
+#ifdef GHC_OS_WINDOWS
+ uintmax_t result = static_cast<uintmax_t>(-1);
+ std::shared_ptr<void> file(::CreateFileW(GHC_NATIVEWP(p), 0, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, 0, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, 0), CloseHandle);
+ BY_HANDLE_FILE_INFORMATION inf;
+ if (file.get() == INVALID_HANDLE_VALUE) {
+ ec = detail::make_system_error();
+ }
+ else {
+ if (!::GetFileInformationByHandle(file.get(), &inf)) {
+ ec = detail::make_system_error();
+ }
+ else {
+ result = inf.nNumberOfLinks;
+ }
+ }
+ return result;
+#else
+ uintmax_t result = 0;
+ file_status fs = detail::status_ex(p, ec, nullptr, nullptr, &result, nullptr);
+ if (fs.type() == file_type::not_found) {
+ ec = detail::make_error_code(detail::portable_error::not_found);
+ }
+ return ec ? static_cast<uintmax_t>(-1) : result;
+#endif
+}
+#endif
+
+GHC_INLINE bool is_block_file(file_status s) noexcept
+{
+ return s.type() == file_type::block;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool is_block_file(const path& p)
+{
+ return is_block_file(status(p));
+}
+#endif
+
+GHC_INLINE bool is_block_file(const path& p, std::error_code& ec) noexcept
+{
+ return is_block_file(status(p, ec));
+}
+
+GHC_INLINE bool is_character_file(file_status s) noexcept
+{
+ return s.type() == file_type::character;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool is_character_file(const path& p)
+{
+ return is_character_file(status(p));
+}
+#endif
+
+GHC_INLINE bool is_character_file(const path& p, std::error_code& ec) noexcept
+{
+ return is_character_file(status(p, ec));
+}
+
+GHC_INLINE bool is_directory(file_status s) noexcept
+{
+ return s.type() == file_type::directory;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool is_directory(const path& p)
+{
+ return is_directory(status(p));
+}
+#endif
+
+GHC_INLINE bool is_directory(const path& p, std::error_code& ec) noexcept
+{
+ return is_directory(status(p, ec));
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool is_empty(const path& p)
+{
+ if (is_directory(p)) {
+ return directory_iterator(p) == directory_iterator();
+ }
+ else {
+ return file_size(p) == 0;
+ }
+}
+#endif
+
+GHC_INLINE bool is_empty(const path& p, std::error_code& ec) noexcept
+{
+ auto fs = status(p, ec);
+ if (ec) {
+ return false;
+ }
+ if (is_directory(fs)) {
+ directory_iterator iter(p, ec);
+ if (ec) {
+ return false;
+ }
+ return iter == directory_iterator();
+ }
+ else {
+ auto sz = file_size(p, ec);
+ if (ec) {
+ return false;
+ }
+ return sz == 0;
+ }
+}
+
+GHC_INLINE bool is_fifo(file_status s) noexcept
+{
+ return s.type() == file_type::fifo;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool is_fifo(const path& p)
+{
+ return is_fifo(status(p));
+}
+#endif
+
+GHC_INLINE bool is_fifo(const path& p, std::error_code& ec) noexcept
+{
+ return is_fifo(status(p, ec));
+}
+
+GHC_INLINE bool is_other(file_status s) noexcept
+{
+ return exists(s) && !is_regular_file(s) && !is_directory(s) && !is_symlink(s);
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool is_other(const path& p)
+{
+ return is_other(status(p));
+}
+#endif
+
+GHC_INLINE bool is_other(const path& p, std::error_code& ec) noexcept
+{
+ return is_other(status(p, ec));
+}
+
+GHC_INLINE bool is_regular_file(file_status s) noexcept
+{
+ return s.type() == file_type::regular;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool is_regular_file(const path& p)
+{
+ return is_regular_file(status(p));
+}
+#endif
+
+GHC_INLINE bool is_regular_file(const path& p, std::error_code& ec) noexcept
+{
+ return is_regular_file(status(p, ec));
+}
+
+GHC_INLINE bool is_socket(file_status s) noexcept
+{
+ return s.type() == file_type::socket;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool is_socket(const path& p)
+{
+ return is_socket(status(p));
+}
+#endif
+
+GHC_INLINE bool is_socket(const path& p, std::error_code& ec) noexcept
+{
+ return is_socket(status(p, ec));
+}
+
+GHC_INLINE bool is_symlink(file_status s) noexcept
+{
+ return s.type() == file_type::symlink;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool is_symlink(const path& p)
+{
+ return is_symlink(symlink_status(p));
+}
+#endif
+
+GHC_INLINE bool is_symlink(const path& p, std::error_code& ec) noexcept
+{
+ return is_symlink(symlink_status(p, ec));
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE file_time_type last_write_time(const path& p)
+{
+ std::error_code ec;
+ auto result = last_write_time(p, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p, ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE file_time_type last_write_time(const path& p, std::error_code& ec) noexcept
+{
+ time_t result = 0;
+ ec.clear();
+ file_status fs = detail::status_ex(p, ec, nullptr, nullptr, nullptr, &result);
+ return ec ? (file_time_type::min)() : std::chrono::system_clock::from_time_t(result);
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE void last_write_time(const path& p, file_time_type new_time)
+{
+ std::error_code ec;
+ last_write_time(p, new_time, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p, ec);
+ }
+}
+#endif
+
+GHC_INLINE void last_write_time(const path& p, file_time_type new_time, std::error_code& ec) noexcept
+{
+ ec.clear();
+ auto d = new_time.time_since_epoch();
+#ifdef GHC_OS_WINDOWS
+ std::shared_ptr<void> file(::CreateFileW(GHC_NATIVEWP(p), FILE_WRITE_ATTRIBUTES, FILE_SHARE_DELETE | FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL), ::CloseHandle);
+ FILETIME ft;
+ auto tt = std::chrono::duration_cast<std::chrono::microseconds>(d).count() * 10 + 116444736000000000;
+ ft.dwLowDateTime = static_cast<DWORD>(tt);
+ ft.dwHighDateTime = static_cast<DWORD>(tt >> 32);
+ if (!::SetFileTime(file.get(), 0, 0, &ft)) {
+ ec = detail::make_system_error();
+ }
+#elif defined(GHC_OS_MACOS)
+#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
+#if __MAC_OS_X_VERSION_MIN_REQUIRED < 101300
+ struct ::stat fs;
+ if (::stat(p.c_str(), &fs) == 0) {
+ struct ::timeval tv[2];
+ tv[0].tv_sec = fs.st_atimespec.tv_sec;
+ tv[0].tv_usec = static_cast<int>(fs.st_atimespec.tv_nsec / 1000);
+ tv[1].tv_sec = std::chrono::duration_cast<std::chrono::seconds>(d).count();
+ tv[1].tv_usec = static_cast<int>(std::chrono::duration_cast<std::chrono::microseconds>(d).count() % 1000000);
+ if (::utimes(p.c_str(), tv) == 0) {
+ return;
+ }
+ }
+ ec = detail::make_system_error();
+ return;
+#else
+ struct ::timespec times[2];
+ times[0].tv_sec = 0;
+ times[0].tv_nsec = UTIME_OMIT;
+ times[1].tv_sec = std::chrono::duration_cast<std::chrono::seconds>(d).count();
+ times[1].tv_nsec = 0; // std::chrono::duration_cast<std::chrono::nanoseconds>(d).count() % 1000000000;
+ if (::utimensat(AT_FDCWD, p.c_str(), times, AT_SYMLINK_NOFOLLOW) != 0) {
+ ec = detail::make_system_error();
+ }
+ return;
+#endif
+#endif
+#else
+#ifndef UTIME_OMIT
+#define UTIME_OMIT ((1l << 30) - 2l)
+#endif
+ struct ::timespec times[2];
+ times[0].tv_sec = 0;
+ times[0].tv_nsec = UTIME_OMIT;
+ times[1].tv_sec = static_cast<decltype(times[1].tv_sec)>(std::chrono::duration_cast<std::chrono::seconds>(d).count());
+ times[1].tv_nsec = static_cast<decltype(times[1].tv_nsec)>(std::chrono::duration_cast<std::chrono::nanoseconds>(d).count() % 1000000000);
+#if defined(__ANDROID_API__) && __ANDROID_API__ < 12
+ if (syscall(__NR_utimensat, AT_FDCWD, p.c_str(), times, AT_SYMLINK_NOFOLLOW) != 0) {
+#else
+ if (::utimensat(AT_FDCWD, p.c_str(), times, AT_SYMLINK_NOFOLLOW) != 0) {
+#endif
+ ec = detail::make_system_error();
+ }
+ return;
+#endif
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE void permissions(const path& p, perms prms, perm_options opts)
+{
+ std::error_code ec;
+ permissions(p, prms, opts, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p, ec);
+ }
+}
+#endif
+
+GHC_INLINE void permissions(const path& p, perms prms, std::error_code& ec) noexcept
+{
+ permissions(p, prms, perm_options::replace, ec);
+}
+
+GHC_INLINE void permissions(const path& p, perms prms, perm_options opts, std::error_code& ec) noexcept
+{
+ if (static_cast<int>(opts & (perm_options::replace | perm_options::add | perm_options::remove)) == 0) {
+ ec = detail::make_error_code(detail::portable_error::invalid_argument);
+ return;
+ }
+ auto fs = symlink_status(p, ec);
+ if ((opts & perm_options::replace) != perm_options::replace) {
+ if ((opts & perm_options::add) == perm_options::add) {
+ prms = fs.permissions() | prms;
+ }
+ else {
+ prms = fs.permissions() & ~prms;
+ }
+ }
+#ifdef GHC_OS_WINDOWS
+#ifdef __GNUC__
+ auto oldAttr = GetFileAttributesW(GHC_NATIVEWP(p));
+ if (oldAttr != INVALID_FILE_ATTRIBUTES) {
+ DWORD newAttr = ((prms & perms::owner_write) == perms::owner_write) ? oldAttr & ~(static_cast<DWORD>(FILE_ATTRIBUTE_READONLY)) : oldAttr | FILE_ATTRIBUTE_READONLY;
+ if (oldAttr == newAttr || SetFileAttributesW(GHC_NATIVEWP(p), newAttr)) {
+ return;
+ }
+ }
+ ec = detail::make_system_error();
+#else
+ int mode = 0;
+ if ((prms & perms::owner_read) == perms::owner_read) {
+ mode |= _S_IREAD;
+ }
+ if ((prms & perms::owner_write) == perms::owner_write) {
+ mode |= _S_IWRITE;
+ }
+ if (::_wchmod(p.wstring().c_str(), mode) != 0) {
+ ec = detail::make_system_error();
+ }
+#endif
+#else
+ if ((opts & perm_options::nofollow) != perm_options::nofollow) {
+ if (::chmod(p.c_str(), static_cast<mode_t>(prms)) != 0) {
+ ec = detail::make_system_error();
+ }
+ }
+#endif
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE path proximate(const path& p, std::error_code& ec)
+{
+ auto cp = current_path(ec);
+ if (!ec) {
+ return proximate(p, cp, ec);
+ }
+ return path();
+}
+#endif
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE path proximate(const path& p, const path& base)
+{
+ return weakly_canonical(p).lexically_proximate(weakly_canonical(base));
+}
+#endif
+
+GHC_INLINE path proximate(const path& p, const path& base, std::error_code& ec)
+{
+ return weakly_canonical(p, ec).lexically_proximate(weakly_canonical(base, ec));
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE path read_symlink(const path& p)
+{
+ std::error_code ec;
+ auto result = read_symlink(p, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p, ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE path read_symlink(const path& p, std::error_code& ec)
+{
+ file_status fs = symlink_status(p, ec);
+ if (fs.type() != file_type::symlink) {
+ ec = detail::make_error_code(detail::portable_error::invalid_argument);
+ return path();
+ }
+ auto result = detail::resolveSymlink(p, ec);
+ return ec ? path() : result;
+}
+
+GHC_INLINE path relative(const path& p, std::error_code& ec)
+{
+ return relative(p, current_path(ec), ec);
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE path relative(const path& p, const path& base)
+{
+ return weakly_canonical(p).lexically_relative(weakly_canonical(base));
+}
+#endif
+
+GHC_INLINE path relative(const path& p, const path& base, std::error_code& ec)
+{
+ return weakly_canonical(p, ec).lexically_relative(weakly_canonical(base, ec));
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool remove(const path& p)
+{
+ std::error_code ec;
+ auto result = remove(p, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p, ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE bool remove(const path& p, std::error_code& ec) noexcept
+{
+ ec.clear();
+#ifdef GHC_OS_WINDOWS
+#ifdef GHC_USE_WCHAR_T
+ auto cstr = p.c_str();
+#else
+ std::wstring np = detail::fromUtf8<std::wstring>(p.u8string());
+ auto cstr = np.c_str();
+#endif
+ DWORD attr = GetFileAttributesW(cstr);
+ if (attr == INVALID_FILE_ATTRIBUTES) {
+ auto error = ::GetLastError();
+ if (error == ERROR_FILE_NOT_FOUND || error == ERROR_PATH_NOT_FOUND) {
+ return false;
+ }
+ ec = detail::make_system_error(error);
+ }
+ if (!ec) {
+ if (attr & FILE_ATTRIBUTE_DIRECTORY) {
+ if (!RemoveDirectoryW(cstr)) {
+ ec = detail::make_system_error();
+ }
+ }
+ else {
+ if (!DeleteFileW(cstr)) {
+ ec = detail::make_system_error();
+ }
+ }
+ }
+#else
+ if (::remove(p.c_str()) == -1) {
+ auto error = errno;
+ if (error == ENOENT) {
+ return false;
+ }
+ ec = detail::make_system_error();
+ }
+#endif
+ return ec ? false : true;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE uintmax_t remove_all(const path& p)
+{
+ std::error_code ec;
+ auto result = remove_all(p, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p, ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE uintmax_t remove_all(const path& p, std::error_code& ec) noexcept
+{
+ ec.clear();
+ uintmax_t count = 0;
+ if (p == "/") {
+ ec = detail::make_error_code(detail::portable_error::not_supported);
+ return static_cast<uintmax_t>(-1);
+ }
+ std::error_code tec;
+ auto fs = status(p, tec);
+ if (exists(fs) && is_directory(fs)) {
+ for (auto iter = directory_iterator(p, ec); iter != directory_iterator(); iter.increment(ec)) {
+ if (ec && !detail::is_not_found_error(ec)) {
+ break;
+ }
+ bool is_symlink_result = iter->is_symlink(ec);
+ if (ec)
+ return static_cast<uintmax_t>(-1);
+ if (!is_symlink_result && iter->is_directory(ec)) {
+ count += remove_all(iter->path(), ec);
+ if (ec) {
+ return static_cast<uintmax_t>(-1);
+ }
+ }
+ else {
+ if (!ec) {
+ remove(iter->path(), ec);
+ }
+ if (ec) {
+ return static_cast<uintmax_t>(-1);
+ }
+ ++count;
+ }
+ }
+ }
+ if (!ec) {
+ if (remove(p, ec)) {
+ ++count;
+ }
+ }
+ if (ec) {
+ return static_cast<uintmax_t>(-1);
+ }
+ return count;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE void rename(const path& from, const path& to)
+{
+ std::error_code ec;
+ rename(from, to, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), from, to, ec);
+ }
+}
+#endif
+
+GHC_INLINE void rename(const path& from, const path& to, std::error_code& ec) noexcept
+{
+ ec.clear();
+#ifdef GHC_OS_WINDOWS
+ if (from != to) {
+ if (!MoveFileExW(GHC_NATIVEWP(from), GHC_NATIVEWP(to), (DWORD)MOVEFILE_REPLACE_EXISTING)) {
+ ec = detail::make_system_error();
+ }
+ }
+#else
+ if (from != to) {
+ if (::rename(from.c_str(), to.c_str()) != 0) {
+ ec = detail::make_system_error();
+ }
+ }
+#endif
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE void resize_file(const path& p, uintmax_t size)
+{
+ std::error_code ec;
+ resize_file(p, size, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p, ec);
+ }
+}
+#endif
+
+GHC_INLINE void resize_file(const path& p, uintmax_t size, std::error_code& ec) noexcept
+{
+ ec.clear();
+#ifdef GHC_OS_WINDOWS
+ LARGE_INTEGER lisize;
+ lisize.QuadPart = static_cast<LONGLONG>(size);
+ if (lisize.QuadPart < 0) {
+#ifdef ERROR_FILE_TOO_LARGE
+ ec = detail::make_system_error(ERROR_FILE_TOO_LARGE);
+#else
+ ec = detail::make_system_error(223);
+#endif
+ return;
+ }
+ std::shared_ptr<void> file(CreateFileW(GHC_NATIVEWP(p), GENERIC_WRITE, 0, NULL, OPEN_EXISTING, 0, NULL), CloseHandle);
+ if (file.get() == INVALID_HANDLE_VALUE) {
+ ec = detail::make_system_error();
+ }
+ else if (SetFilePointerEx(file.get(), lisize, NULL, FILE_BEGIN) == 0 || SetEndOfFile(file.get()) == 0) {
+ ec = detail::make_system_error();
+ }
+#else
+ if (::truncate(p.c_str(), static_cast<off_t>(size)) != 0) {
+ ec = detail::make_system_error();
+ }
+#endif
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE space_info space(const path& p)
+{
+ std::error_code ec;
+ auto result = space(p, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p, ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE space_info space(const path& p, std::error_code& ec) noexcept
+{
+ ec.clear();
+#ifdef GHC_OS_WINDOWS
+ ULARGE_INTEGER freeBytesAvailableToCaller = {{ 0, 0 }};
+ ULARGE_INTEGER totalNumberOfBytes = {{ 0, 0 }};
+ ULARGE_INTEGER totalNumberOfFreeBytes = {{ 0, 0 }};
+ if (!GetDiskFreeSpaceExW(GHC_NATIVEWP(p), &freeBytesAvailableToCaller, &totalNumberOfBytes, &totalNumberOfFreeBytes)) {
+ ec = detail::make_system_error();
+ return {static_cast<uintmax_t>(-1), static_cast<uintmax_t>(-1), static_cast<uintmax_t>(-1)};
+ }
+ return {static_cast<uintmax_t>(totalNumberOfBytes.QuadPart), static_cast<uintmax_t>(totalNumberOfFreeBytes.QuadPart), static_cast<uintmax_t>(freeBytesAvailableToCaller.QuadPart)};
+#else
+ struct ::statvfs sfs;
+ if (::statvfs(p.c_str(), &sfs) != 0) {
+ ec = detail::make_system_error();
+ return {static_cast<uintmax_t>(-1), static_cast<uintmax_t>(-1), static_cast<uintmax_t>(-1)};
+ }
+ return {static_cast<uintmax_t>(sfs.f_blocks * sfs.f_frsize), static_cast<uintmax_t>(sfs.f_bfree * sfs.f_frsize), static_cast<uintmax_t>(sfs.f_bavail * sfs.f_frsize)};
+#endif
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE file_status status(const path& p)
+{
+ std::error_code ec;
+ auto result = status(p, ec);
+ if (result.type() == file_type::none) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p, ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE file_status status(const path& p, std::error_code& ec) noexcept
+{
+ return detail::status_ex(p, ec);
+}
+
+GHC_INLINE bool status_known(file_status s) noexcept
+{
+ return s.type() != file_type::none;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE file_status symlink_status(const path& p)
+{
+ std::error_code ec;
+ auto result = symlink_status(p, ec);
+ if (result.type() == file_type::none) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE file_status symlink_status(const path& p, std::error_code& ec) noexcept
+{
+ return detail::symlink_status_ex(p, ec);
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE path temp_directory_path()
+{
+ std::error_code ec;
+ path result = temp_directory_path(ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE path temp_directory_path(std::error_code& ec) noexcept
+{
+ ec.clear();
+#ifdef GHC_OS_WINDOWS
+ wchar_t buffer[512];
+ auto rc = GetTempPathW(511, buffer);
+ if (!rc || rc > 511) {
+ ec = detail::make_system_error();
+ return path();
+ }
+ return path(std::wstring(buffer));
+#else
+ static const char* temp_vars[] = {"TMPDIR", "TMP", "TEMP", "TEMPDIR", nullptr};
+ const char* temp_path = nullptr;
+ for (auto temp_name = temp_vars; *temp_name != nullptr; ++temp_name) {
+ temp_path = std::getenv(*temp_name);
+ if (temp_path) {
+ return path(temp_path);
+ }
+ }
+ return path("/tmp");
+#endif
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE path weakly_canonical(const path& p)
+{
+ std::error_code ec;
+ auto result = weakly_canonical(p, ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), p, ec);
+ }
+ return result;
+}
+#endif
+
+GHC_INLINE path weakly_canonical(const path& p, std::error_code& ec) noexcept
+{
+ path result;
+ ec.clear();
+ bool scan = true;
+ for (auto pe : p) {
+ if (scan) {
+ std::error_code tec;
+ if (exists(result / pe, tec)) {
+ result /= pe;
+ }
+ else {
+ if (ec) {
+ return path();
+ }
+ scan = false;
+ if (!result.empty()) {
+ result = canonical(result, ec) / pe;
+ if (ec) {
+ break;
+ }
+ }
+ else {
+ result /= pe;
+ }
+ }
+ }
+ else {
+ result /= pe;
+ }
+ }
+ if (scan) {
+ if (!result.empty()) {
+ result = canonical(result, ec);
+ }
+ }
+ return ec ? path() : result.lexically_normal();
+}
+
+//-----------------------------------------------------------------------------
+// 30.10.11 class file_status
+// 30.10.11.1 constructors and destructor
+GHC_INLINE file_status::file_status() noexcept
+ : file_status(file_type::none)
+{
+}
+
+GHC_INLINE file_status::file_status(file_type ft, perms prms) noexcept
+ : _type(ft)
+ , _perms(prms)
+{
+}
+
+GHC_INLINE file_status::file_status(const file_status& other) noexcept
+ : _type(other._type)
+ , _perms(other._perms)
+{
+}
+
+GHC_INLINE file_status::file_status(file_status&& other) noexcept
+ : _type(other._type)
+ , _perms(other._perms)
+{
+}
+
+GHC_INLINE file_status::~file_status() {}
+
+// assignments:
+GHC_INLINE file_status& file_status::operator=(const file_status& rhs) noexcept
+{
+ _type = rhs._type;
+ _perms = rhs._perms;
+ return *this;
+}
+
+GHC_INLINE file_status& file_status::operator=(file_status&& rhs) noexcept
+{
+ _type = rhs._type;
+ _perms = rhs._perms;
+ return *this;
+}
+
+// 30.10.11.3 modifiers
+GHC_INLINE void file_status::type(file_type ft) noexcept
+{
+ _type = ft;
+}
+
+GHC_INLINE void file_status::permissions(perms prms) noexcept
+{
+ _perms = prms;
+}
+
+// 30.10.11.2 observers
+GHC_INLINE file_type file_status::type() const noexcept
+{
+ return _type;
+}
+
+GHC_INLINE perms file_status::permissions() const noexcept
+{
+ return _perms;
+}
+
+//-----------------------------------------------------------------------------
+// 30.10.12 class directory_entry
+// 30.10.12.1 constructors and destructor
+// directory_entry::directory_entry() noexcept = default;
+// directory_entry::directory_entry(const directory_entry&) = default;
+// directory_entry::directory_entry(directory_entry&&) noexcept = default;
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE directory_entry::directory_entry(const filesystem::path& p)
+ : _path(p)
+ , _file_size(static_cast<uintmax_t>(-1))
+#ifndef GHC_OS_WINDOWS
+ , _hard_link_count(static_cast<uintmax_t>(-1))
+#endif
+ , _last_write_time(0)
+{
+ refresh();
+}
+#endif
+
+GHC_INLINE directory_entry::directory_entry(const filesystem::path& p, std::error_code& ec)
+ : _path(p)
+ , _file_size(static_cast<uintmax_t>(-1))
+#ifndef GHC_OS_WINDOWS
+ , _hard_link_count(static_cast<uintmax_t>(-1))
+#endif
+ , _last_write_time(0)
+{
+ refresh(ec);
+}
+
+GHC_INLINE directory_entry::~directory_entry() {}
+
+// assignments:
+// directory_entry& directory_entry::operator=(const directory_entry&) = default;
+// directory_entry& directory_entry::operator=(directory_entry&&) noexcept = default;
+
+// 30.10.12.2 directory_entry modifiers
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE void directory_entry::assign(const filesystem::path& p)
+{
+ _path = p;
+ refresh();
+}
+#endif
+
+GHC_INLINE void directory_entry::assign(const filesystem::path& p, std::error_code& ec)
+{
+ _path = p;
+ refresh(ec);
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE void directory_entry::replace_filename(const filesystem::path& p)
+{
+ _path.replace_filename(p);
+ refresh();
+}
+#endif
+
+GHC_INLINE void directory_entry::replace_filename(const filesystem::path& p, std::error_code& ec)
+{
+ _path.replace_filename(p);
+ refresh(ec);
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE void directory_entry::refresh()
+{
+ std::error_code ec;
+ refresh(ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), _path, ec);
+ }
+}
+#endif
+
+GHC_INLINE void directory_entry::refresh(std::error_code& ec) noexcept
+{
+#ifdef GHC_OS_WINDOWS
+ _status = detail::status_ex(_path, ec, &_symlink_status, &_file_size, nullptr, &_last_write_time);
+#else
+ _status = detail::status_ex(_path, ec, &_symlink_status, &_file_size, &_hard_link_count, &_last_write_time);
+#endif
+}
+
+// 30.10.12.3 directory_entry observers
+GHC_INLINE const filesystem::path& directory_entry::path() const noexcept
+{
+ return _path;
+}
+
+GHC_INLINE directory_entry::operator const filesystem::path&() const noexcept
+{
+ return _path;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE file_type directory_entry::status_file_type() const
+{
+ return _status.type() != file_type::none ? _status.type() : filesystem::status(path()).type();
+}
+#endif
+
+GHC_INLINE file_type directory_entry::status_file_type(std::error_code& ec) const noexcept
+{
+ if(_status.type() != file_type::none) {
+ ec.clear();
+ return _status.type();
+ }
+ return filesystem::status(path(), ec).type();
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool directory_entry::exists() const
+{
+ return status_file_type() != file_type::not_found;
+}
+#endif
+
+GHC_INLINE bool directory_entry::exists(std::error_code& ec) const noexcept
+{
+ return status_file_type(ec) != file_type::not_found;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool directory_entry::is_block_file() const
+{
+ return status_file_type() == file_type::block;
+}
+#endif
+GHC_INLINE bool directory_entry::is_block_file(std::error_code& ec) const noexcept
+{
+ return status_file_type(ec) == file_type::block;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool directory_entry::is_character_file() const
+{
+ return status_file_type() == file_type::character;
+}
+#endif
+
+GHC_INLINE bool directory_entry::is_character_file(std::error_code& ec) const noexcept
+{
+ return status_file_type(ec) == file_type::character;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool directory_entry::is_directory() const
+{
+ return status_file_type() == file_type::directory;
+}
+#endif
+
+GHC_INLINE bool directory_entry::is_directory(std::error_code& ec) const noexcept
+{
+ return status_file_type(ec) == file_type::directory;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool directory_entry::is_fifo() const
+{
+ return status_file_type() == file_type::fifo;
+}
+#endif
+
+GHC_INLINE bool directory_entry::is_fifo(std::error_code& ec) const noexcept
+{
+ return status_file_type(ec) == file_type::fifo;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool directory_entry::is_other() const
+{
+ auto ft = status_file_type();
+ return ft != file_type::none && ft != file_type::not_found && ft != file_type::regular && ft != file_type::directory && !is_symlink();
+}
+#endif
+
+GHC_INLINE bool directory_entry::is_other(std::error_code& ec) const noexcept
+{
+ auto ft = status_file_type(ec);
+ bool other = ft != file_type::none && ft != file_type::not_found && ft != file_type::regular && ft != file_type::directory && !is_symlink(ec);
+ return !ec && other;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool directory_entry::is_regular_file() const
+{
+ return status_file_type() == file_type::regular;
+}
+#endif
+
+GHC_INLINE bool directory_entry::is_regular_file(std::error_code& ec) const noexcept
+{
+ return status_file_type(ec) == file_type::regular;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool directory_entry::is_socket() const
+{
+ return status_file_type() == file_type::socket;
+}
+#endif
+
+GHC_INLINE bool directory_entry::is_socket(std::error_code& ec) const noexcept
+{
+ return status_file_type(ec) == file_type::socket;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE bool directory_entry::is_symlink() const
+{
+ return _symlink_status.type() != file_type::none ? _symlink_status.type() == file_type::symlink : filesystem::is_symlink(symlink_status());
+}
+#endif
+
+GHC_INLINE bool directory_entry::is_symlink(std::error_code& ec) const noexcept
+{
+ if(_symlink_status.type() != file_type::none) {
+ ec.clear();
+ return _symlink_status.type() == file_type::symlink;
+ }
+ return filesystem::is_symlink(symlink_status(ec));
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE uintmax_t directory_entry::file_size() const
+{
+ if (_file_size != static_cast<uintmax_t>(-1)) {
+ return _file_size;
+ }
+ return filesystem::file_size(path());
+}
+#endif
+
+GHC_INLINE uintmax_t directory_entry::file_size(std::error_code& ec) const noexcept
+{
+ if (_file_size != static_cast<uintmax_t>(-1)) {
+ ec.clear();
+ return _file_size;
+ }
+ return filesystem::file_size(path(), ec);
+}
+
+#ifndef GHC_OS_WEB
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE uintmax_t directory_entry::hard_link_count() const
+{
+#ifndef GHC_OS_WINDOWS
+ if (_hard_link_count != static_cast<uintmax_t>(-1)) {
+ return _hard_link_count;
+ }
+#endif
+ return filesystem::hard_link_count(path());
+}
+#endif
+
+GHC_INLINE uintmax_t directory_entry::hard_link_count(std::error_code& ec) const noexcept
+{
+#ifndef GHC_OS_WINDOWS
+ if (_hard_link_count != static_cast<uintmax_t>(-1)) {
+ ec.clear();
+ return _hard_link_count;
+ }
+#endif
+ return filesystem::hard_link_count(path(), ec);
+}
+#endif
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE file_time_type directory_entry::last_write_time() const
+{
+ if (_last_write_time != 0) {
+ return std::chrono::system_clock::from_time_t(_last_write_time);
+ }
+ return filesystem::last_write_time(path());
+}
+#endif
+
+GHC_INLINE file_time_type directory_entry::last_write_time(std::error_code& ec) const noexcept
+{
+ if (_last_write_time != 0) {
+ ec.clear();
+ return std::chrono::system_clock::from_time_t(_last_write_time);
+ }
+ return filesystem::last_write_time(path(), ec);
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE file_status directory_entry::status() const
+{
+ if (_status.type() != file_type::none && _status.permissions() != perms::unknown) {
+ return _status;
+ }
+ return filesystem::status(path());
+}
+#endif
+
+GHC_INLINE file_status directory_entry::status(std::error_code& ec) const noexcept
+{
+ if (_status.type() != file_type::none && _status.permissions() != perms::unknown) {
+ ec.clear();
+ return _status;
+ }
+ return filesystem::status(path(), ec);
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE file_status directory_entry::symlink_status() const
+{
+ if (_symlink_status.type() != file_type::none && _symlink_status.permissions() != perms::unknown) {
+ return _symlink_status;
+ }
+ return filesystem::symlink_status(path());
+}
+#endif
+
+GHC_INLINE file_status directory_entry::symlink_status(std::error_code& ec) const noexcept
+{
+ if (_symlink_status.type() != file_type::none && _symlink_status.permissions() != perms::unknown) {
+ ec.clear();
+ return _symlink_status;
+ }
+ return filesystem::symlink_status(path(), ec);
+}
+
+#ifdef GHC_HAS_THREEWAY_COMP
+GHC_INLINE std::strong_ordering directory_entry::operator<=>(const directory_entry& rhs) const noexcept
+{
+ return _path <=> rhs._path;
+}
+#endif
+
+GHC_INLINE bool directory_entry::operator<(const directory_entry& rhs) const noexcept
+{
+ return _path < rhs._path;
+}
+
+GHC_INLINE bool directory_entry::operator==(const directory_entry& rhs) const noexcept
+{
+ return _path == rhs._path;
+}
+
+GHC_INLINE bool directory_entry::operator!=(const directory_entry& rhs) const noexcept
+{
+ return _path != rhs._path;
+}
+
+GHC_INLINE bool directory_entry::operator<=(const directory_entry& rhs) const noexcept
+{
+ return _path <= rhs._path;
+}
+
+GHC_INLINE bool directory_entry::operator>(const directory_entry& rhs) const noexcept
+{
+ return _path > rhs._path;
+}
+
+GHC_INLINE bool directory_entry::operator>=(const directory_entry& rhs) const noexcept
+{
+ return _path >= rhs._path;
+}
+
+//-----------------------------------------------------------------------------
+// 30.10.13 class directory_iterator
+
+#ifdef GHC_OS_WINDOWS
+class directory_iterator::impl
+{
+public:
+ impl(const path& p, directory_options options)
+ : _base(p)
+ , _options(options)
+ , _dirHandle(INVALID_HANDLE_VALUE)
+ {
+ if (!_base.empty()) {
+ ZeroMemory(&_findData, sizeof(WIN32_FIND_DATAW));
+ if ((_dirHandle = FindFirstFileW(GHC_NATIVEWP((_base / "*")), &_findData)) != INVALID_HANDLE_VALUE) {
+ if (std::wstring(_findData.cFileName) == L"." || std::wstring(_findData.cFileName) == L"..") {
+ increment(_ec);
+ }
+ else {
+ _dir_entry._path = _base / std::wstring(_findData.cFileName);
+ copyToDirEntry(_ec);
+ }
+ }
+ else {
+ auto error = ::GetLastError();
+ _base = filesystem::path();
+ if (error != ERROR_ACCESS_DENIED || (options & directory_options::skip_permission_denied) == directory_options::none) {
+ _ec = detail::make_system_error();
+ }
+ }
+ }
+ }
+ impl(const impl& other) = delete;
+ ~impl()
+ {
+ if (_dirHandle != INVALID_HANDLE_VALUE) {
+ FindClose(_dirHandle);
+ _dirHandle = INVALID_HANDLE_VALUE;
+ }
+ }
+ void increment(std::error_code& ec)
+ {
+ if (_dirHandle != INVALID_HANDLE_VALUE) {
+ do {
+ if (FindNextFileW(_dirHandle, &_findData)) {
+ _dir_entry._path = _base;
+#ifdef GHC_USE_WCHAR_T
+ _dir_entry._path.append_name(_findData.cFileName);
+#else
+#ifdef GHC_RAISE_UNICODE_ERRORS
+ try {
+ _dir_entry._path.append_name(detail::toUtf8(_findData.cFileName).c_str());
+ }
+ catch (filesystem_error& fe) {
+ ec = fe.code();
+ return;
+ }
+#else
+ _dir_entry._path.append_name(detail::toUtf8(_findData.cFileName).c_str());
+#endif
+#endif
+ copyToDirEntry(ec);
+ }
+ else {
+ auto err = ::GetLastError();
+ if (err != ERROR_NO_MORE_FILES) {
+ _ec = ec = detail::make_system_error(err);
+ }
+ FindClose(_dirHandle);
+ _dirHandle = INVALID_HANDLE_VALUE;
+ _dir_entry._path.clear();
+ break;
+ }
+ } while (std::wstring(_findData.cFileName) == L"." || std::wstring(_findData.cFileName) == L"..");
+ }
+ else {
+ ec = _ec;
+ }
+ }
+ void copyToDirEntry(std::error_code& ec)
+ {
+ if (_findData.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) {
+ _dir_entry._status = detail::status_ex(_dir_entry._path, ec, &_dir_entry._symlink_status, &_dir_entry._file_size, nullptr, &_dir_entry._last_write_time);
+ }
+ else {
+ _dir_entry._status = detail::status_from_INFO(_dir_entry._path, &_findData, ec, &_dir_entry._file_size, &_dir_entry._last_write_time);
+ _dir_entry._symlink_status = _dir_entry._status;
+ }
+ if (ec) {
+ if (_dir_entry._status.type() != file_type::none && _dir_entry._symlink_status.type() != file_type::none) {
+ ec.clear();
+ }
+ else {
+ _dir_entry._file_size = static_cast<uintmax_t>(-1);
+ _dir_entry._last_write_time = 0;
+ }
+ }
+ }
+ path _base;
+ directory_options _options;
+ WIN32_FIND_DATAW _findData;
+ HANDLE _dirHandle;
+ directory_entry _dir_entry;
+ std::error_code _ec;
+};
+#else
+// POSIX implementation
+class directory_iterator::impl
+{
+public:
+ impl(const path& path, directory_options options)
+ : _base(path)
+ , _options(options)
+ , _dir(nullptr)
+ , _entry(nullptr)
+ {
+ if (!path.empty()) {
+ _dir = ::opendir(path.native().c_str());
+ if (!_dir) {
+ auto error = errno;
+ _base = filesystem::path();
+ if ((error != EACCES && error != EPERM) || (options & directory_options::skip_permission_denied) == directory_options::none) {
+ _ec = detail::make_system_error();
+ }
+ }
+ else {
+ increment(_ec);
+ }
+ }
+ }
+ impl(const impl& other) = delete;
+ ~impl()
+ {
+ if (_dir) {
+ ::closedir(_dir);
+ }
+ }
+ void increment(std::error_code& ec)
+ {
+ if (_dir) {
+ bool skip;
+ do {
+ skip = false;
+ errno = 0;
+ _entry = ::readdir(_dir);
+ if (_entry) {
+ _dir_entry._path = _base;
+ _dir_entry._path.append_name(_entry->d_name);
+ copyToDirEntry();
+ if (ec && (ec.value() == EACCES || ec.value() == EPERM) && (_options & directory_options::skip_permission_denied) == directory_options::skip_permission_denied) {
+ ec.clear();
+ skip = true;
+ }
+ }
+ else {
+ ::closedir(_dir);
+ _dir = nullptr;
+ _dir_entry._path.clear();
+ if (errno) {
+ ec = detail::make_system_error();
+ }
+ break;
+ }
+ } while (skip || std::strcmp(_entry->d_name, ".") == 0 || std::strcmp(_entry->d_name, "..") == 0);
+ }
+ }
+ void copyToDirEntry()
+ {
+ _dir_entry._symlink_status.permissions(perms::unknown);
+ switch(_entry->d_type) {
+ case DT_BLK: _dir_entry._symlink_status.type(file_type::block); break;
+ case DT_CHR: _dir_entry._symlink_status.type(file_type::character); break;
+ case DT_DIR: _dir_entry._symlink_status.type(file_type::directory); break;
+ case DT_FIFO: _dir_entry._symlink_status.type(file_type::fifo); break;
+ case DT_LNK: _dir_entry._symlink_status.type(file_type::symlink); break;
+ case DT_REG: _dir_entry._symlink_status.type(file_type::regular); break;
+ case DT_SOCK: _dir_entry._symlink_status.type(file_type::socket); break;
+ default: _dir_entry._symlink_status.type(file_type::unknown); break;
+ }
+ if (_entry->d_type != DT_LNK) {
+ _dir_entry._status = _dir_entry._symlink_status;
+ }
+ else {
+ _dir_entry._status.type(file_type::none);
+ _dir_entry._status.permissions(perms::unknown);
+ }
+ _dir_entry._file_size = static_cast<uintmax_t>(-1);
+ _dir_entry._hard_link_count = static_cast<uintmax_t>(-1);
+ _dir_entry._last_write_time = 0;
+ }
+ path _base;
+ directory_options _options;
+ DIR* _dir;
+ struct ::dirent* _entry;
+ directory_entry _dir_entry;
+ std::error_code _ec;
+};
+#endif
+
+// 30.10.13.1 member functions
+GHC_INLINE directory_iterator::directory_iterator() noexcept
+ : _impl(new impl(path(), directory_options::none))
+{
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE directory_iterator::directory_iterator(const path& p)
+ : _impl(new impl(p, directory_options::none))
+{
+ if (_impl->_ec) {
+ throw filesystem_error(detail::systemErrorText(_impl->_ec.value()), p, _impl->_ec);
+ }
+ _impl->_ec.clear();
+}
+
+GHC_INLINE directory_iterator::directory_iterator(const path& p, directory_options options)
+ : _impl(new impl(p, options))
+{
+ if (_impl->_ec) {
+ throw filesystem_error(detail::systemErrorText(_impl->_ec.value()), p, _impl->_ec);
+ }
+}
+#endif
+
+GHC_INLINE directory_iterator::directory_iterator(const path& p, std::error_code& ec) noexcept
+ : _impl(new impl(p, directory_options::none))
+{
+ if (_impl->_ec) {
+ ec = _impl->_ec;
+ }
+}
+
+GHC_INLINE directory_iterator::directory_iterator(const path& p, directory_options options, std::error_code& ec) noexcept
+ : _impl(new impl(p, options))
+{
+ if (_impl->_ec) {
+ ec = _impl->_ec;
+ }
+}
+
+GHC_INLINE directory_iterator::directory_iterator(const directory_iterator& rhs)
+ : _impl(rhs._impl)
+{
+}
+
+GHC_INLINE directory_iterator::directory_iterator(directory_iterator&& rhs) noexcept
+ : _impl(std::move(rhs._impl))
+{
+}
+
+GHC_INLINE directory_iterator::~directory_iterator() {}
+
+GHC_INLINE directory_iterator& directory_iterator::operator=(const directory_iterator& rhs)
+{
+ _impl = rhs._impl;
+ return *this;
+}
+
+GHC_INLINE directory_iterator& directory_iterator::operator=(directory_iterator&& rhs) noexcept
+{
+ _impl = std::move(rhs._impl);
+ return *this;
+}
+
+GHC_INLINE const directory_entry& directory_iterator::operator*() const
+{
+ return _impl->_dir_entry;
+}
+
+GHC_INLINE const directory_entry* directory_iterator::operator->() const
+{
+ return &_impl->_dir_entry;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE directory_iterator& directory_iterator::operator++()
+{
+ std::error_code ec;
+ _impl->increment(ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), _impl->_dir_entry._path, ec);
+ }
+ return *this;
+}
+#endif
+
+GHC_INLINE directory_iterator& directory_iterator::increment(std::error_code& ec) noexcept
+{
+ _impl->increment(ec);
+ return *this;
+}
+
+GHC_INLINE bool directory_iterator::operator==(const directory_iterator& rhs) const
+{
+ return _impl->_dir_entry._path == rhs._impl->_dir_entry._path;
+}
+
+GHC_INLINE bool directory_iterator::operator!=(const directory_iterator& rhs) const
+{
+ return _impl->_dir_entry._path != rhs._impl->_dir_entry._path;
+}
+
+// 30.10.13.2 directory_iterator non-member functions
+
+GHC_INLINE directory_iterator begin(directory_iterator iter) noexcept
+{
+ return iter;
+}
+
+GHC_INLINE directory_iterator end(const directory_iterator&) noexcept
+{
+ return directory_iterator();
+}
+
+//-----------------------------------------------------------------------------
+// 30.10.14 class recursive_directory_iterator
+
+GHC_INLINE recursive_directory_iterator::recursive_directory_iterator() noexcept
+ : _impl(new recursive_directory_iterator_impl(directory_options::none, true))
+{
+ _impl->_dir_iter_stack.push(directory_iterator());
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE recursive_directory_iterator::recursive_directory_iterator(const path& p)
+ : _impl(new recursive_directory_iterator_impl(directory_options::none, true))
+{
+ _impl->_dir_iter_stack.push(directory_iterator(p));
+}
+
+GHC_INLINE recursive_directory_iterator::recursive_directory_iterator(const path& p, directory_options options)
+ : _impl(new recursive_directory_iterator_impl(options, true))
+{
+ _impl->_dir_iter_stack.push(directory_iterator(p, options));
+}
+#endif
+
+GHC_INLINE recursive_directory_iterator::recursive_directory_iterator(const path& p, directory_options options, std::error_code& ec) noexcept
+ : _impl(new recursive_directory_iterator_impl(options, true))
+{
+ _impl->_dir_iter_stack.push(directory_iterator(p, options, ec));
+}
+
+GHC_INLINE recursive_directory_iterator::recursive_directory_iterator(const path& p, std::error_code& ec) noexcept
+ : _impl(new recursive_directory_iterator_impl(directory_options::none, true))
+{
+ _impl->_dir_iter_stack.push(directory_iterator(p, ec));
+}
+
+GHC_INLINE recursive_directory_iterator::recursive_directory_iterator(const recursive_directory_iterator& rhs)
+ : _impl(rhs._impl)
+{
+}
+
+GHC_INLINE recursive_directory_iterator::recursive_directory_iterator(recursive_directory_iterator&& rhs) noexcept
+ : _impl(std::move(rhs._impl))
+{
+}
+
+GHC_INLINE recursive_directory_iterator::~recursive_directory_iterator() {}
+
+// 30.10.14.1 observers
+GHC_INLINE directory_options recursive_directory_iterator::options() const
+{
+ return _impl->_options;
+}
+
+GHC_INLINE int recursive_directory_iterator::depth() const
+{
+ return static_cast<int>(_impl->_dir_iter_stack.size() - 1);
+}
+
+GHC_INLINE bool recursive_directory_iterator::recursion_pending() const
+{
+ return _impl->_recursion_pending;
+}
+
+GHC_INLINE const directory_entry& recursive_directory_iterator::operator*() const
+{
+ return *(_impl->_dir_iter_stack.top());
+}
+
+GHC_INLINE const directory_entry* recursive_directory_iterator::operator->() const
+{
+ return &(*(_impl->_dir_iter_stack.top()));
+}
+
+// 30.10.14.1 modifiers recursive_directory_iterator&
+GHC_INLINE recursive_directory_iterator& recursive_directory_iterator::operator=(const recursive_directory_iterator& rhs)
+{
+ _impl = rhs._impl;
+ return *this;
+}
+
+GHC_INLINE recursive_directory_iterator& recursive_directory_iterator::operator=(recursive_directory_iterator&& rhs) noexcept
+{
+ _impl = std::move(rhs._impl);
+ return *this;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE recursive_directory_iterator& recursive_directory_iterator::operator++()
+{
+ std::error_code ec;
+ increment(ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), _impl->_dir_iter_stack.empty() ? path() : _impl->_dir_iter_stack.top()->path(), ec);
+ }
+ return *this;
+}
+#endif
+
+GHC_INLINE recursive_directory_iterator& recursive_directory_iterator::increment(std::error_code& ec) noexcept
+{
+ bool isDir = (*this)->is_directory(ec);
+ bool isSymLink = !ec && (*this)->is_symlink(ec);
+ if(!ec) {
+ if (recursion_pending() && isDir && (!isSymLink || (options() & directory_options::follow_directory_symlink) != directory_options::none)) {
+ _impl->_dir_iter_stack.push(directory_iterator((*this)->path(), _impl->_options, ec));
+ }
+ else {
+ _impl->_dir_iter_stack.top().increment(ec);
+ }
+ if (!ec) {
+ while (depth() && _impl->_dir_iter_stack.top() == directory_iterator()) {
+ _impl->_dir_iter_stack.pop();
+ _impl->_dir_iter_stack.top().increment(ec);
+ }
+ }
+ else if (!_impl->_dir_iter_stack.empty()) {
+ _impl->_dir_iter_stack.pop();
+ }
+ _impl->_recursion_pending = true;
+ }
+ return *this;
+}
+
+#ifdef GHC_WITH_EXCEPTIONS
+GHC_INLINE void recursive_directory_iterator::pop()
+{
+ std::error_code ec;
+ pop(ec);
+ if (ec) {
+ throw filesystem_error(detail::systemErrorText(ec.value()), _impl->_dir_iter_stack.empty() ? path() : _impl->_dir_iter_stack.top()->path(), ec);
+ }
+}
+#endif
+
+GHC_INLINE void recursive_directory_iterator::pop(std::error_code& ec)
+{
+ if (depth() == 0) {
+ *this = recursive_directory_iterator();
+ }
+ else {
+ do {
+ _impl->_dir_iter_stack.pop();
+ _impl->_dir_iter_stack.top().increment(ec);
+ } while (depth() && _impl->_dir_iter_stack.top() == directory_iterator());
+ }
+}
+
+GHC_INLINE void recursive_directory_iterator::disable_recursion_pending()
+{
+ _impl->_recursion_pending = false;
+}
+
+// other members as required by 27.2.3, input iterators
+GHC_INLINE bool recursive_directory_iterator::operator==(const recursive_directory_iterator& rhs) const
+{
+ return _impl->_dir_iter_stack.top() == rhs._impl->_dir_iter_stack.top();
+}
+
+GHC_INLINE bool recursive_directory_iterator::operator!=(const recursive_directory_iterator& rhs) const
+{
+ return _impl->_dir_iter_stack.top() != rhs._impl->_dir_iter_stack.top();
+}
+
+// 30.10.14.2 directory_iterator non-member functions
+GHC_INLINE recursive_directory_iterator begin(recursive_directory_iterator iter) noexcept
+{
+ return iter;
+}
+
+GHC_INLINE recursive_directory_iterator end(const recursive_directory_iterator&) noexcept
+{
+ return recursive_directory_iterator();
+}
+
+#endif // GHC_EXPAND_IMPL
+
+} // namespace filesystem
+} // namespace ghc
+
+// cleanup some macros
+#undef GHC_INLINE
+#undef GHC_EXPAND_IMPL
+
+#endif // GHC_FILESYSTEM_H
diff --git a/libmd5/md5.c b/libmd5/md5.c
index d0627ff..1fdcb3a 100644
--- a/libmd5/md5.c
+++ b/libmd5/md5.c
@@ -31,13 +31,13 @@ MD5Transform(UWORD32 buf[4], UWORD32 const in[16]);
int g_bigEndian = 0;
int g_endianessDetected = 0;
-static void
+static void
detectEndianess()
{
int nl = 0x12345678;
short ns = 0x1234;
- unsigned char *p = (unsigned char *)(&nl);
+ unsigned char *p = (unsigned char *)(&nl);
unsigned char *sp = (unsigned char *)(&ns);
if (g_endianessDetected) return;
@@ -132,7 +132,7 @@ MD5Update(struct MD5Context *ctx, md5byte const *buf, unsigned len)
}
/*
- * Final wrapup - pad to 64-byte boundary with the bit pattern
+ * Final wrapup - pad to 64-byte boundary with the bit pattern
* 1 0* (64-bit count of bits processed, MSB-first)
*/
void
@@ -282,14 +282,13 @@ void MD5Buffer (const unsigned char *buf,unsigned int len,unsigned char sig[16])
#define HEX_STRING "0123456789abcdef" /* to convert to hex */
-void MD5SigToString(unsigned char signature[16],char *str,int len)
+void MD5SigToString(unsigned char signature[16],char str[33])
{
unsigned char *sig_p;
- char *str_p, *max_p;
+ char *str_p;
unsigned int high, low;
str_p = str;
- max_p = str + len;
for (sig_p = (unsigned char *)signature;
sig_p < (unsigned char *)signature + 16;
@@ -298,16 +297,11 @@ void MD5SigToString(unsigned char signature[16],char *str,int len)
high = *sig_p / 16;
low = *sig_p % 16;
/* account for 2 chars */
- if (str_p + 1 >= max_p) {
- break;
- }
*str_p++ = HEX_STRING[high];
*str_p++ = HEX_STRING[low];
}
- /* account for 2 chars */
- if (str_p < max_p) {
- *str_p++ = '\0';
- }
+ /* account for 1 terminator */
+ *str_p++ = '\0';
}
diff --git a/libmd5/md5.h b/libmd5/md5.h
index 03f8ff6..5d0c0b0 100644
--- a/libmd5/md5.h
+++ b/libmd5/md5.h
@@ -48,7 +48,7 @@ void MD5Init(struct MD5Context *context);
void MD5Update(struct MD5Context *context, md5byte const *buf, unsigned len);
void MD5Final(unsigned char digest[16], struct MD5Context *context);
void MD5Buffer (const unsigned char *buf,unsigned int len,unsigned char sig[16]);
-void MD5SigToString(unsigned char sig[16],char *str,int len);
+void MD5SigToString(unsigned char sig[16],char str[33]);
#ifdef __cplusplus
}
diff --git a/libxml/CMakeLists.txt b/libxml/CMakeLists.txt
new file mode 100644
index 0000000..96c5653
--- /dev/null
+++ b/libxml/CMakeLists.txt
@@ -0,0 +1,19 @@
+include_directories(
+ ${PROJECT_SOURCE_DIR}/libxml
+)
+
+add_custom_command(
+ COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/src/scan_states.py ${PROJECT_SOURCE_DIR}/libxml/xml.l > ${GENERATED_SRC}/xml.l.h
+ DEPENDS ${PROJECT_SOURCE_DIR}/src/scan_states.py ${PROJECT_SOURCE_DIR}/libxml/xml.l
+ OUTPUT ${GENERATED_SRC}/xml.l.h
+)
+set_source_files_properties(${GENERATED_SRC}/xml.l.h PROPERTIES GENERATED 1)
+
+FLEX_TARGET(xml xml.l ${GENERATED_SRC}/xml.cpp COMPILE_FLAGS "${LEX_FLAGS}")
+
+add_library(xml
+${GENERATED_SRC}/xml.cpp
+${GENERATED_SRC}/xml.l.h
+)
+
+
diff --git a/src/xml.h b/libxml/xml.h
index add95f1..9670837 100644
--- a/src/xml.h
+++ b/libxml/xml.h
@@ -1,6 +1,21 @@
#ifndef XML_H
#define XML_H
+/******************************************************************************
+ *
+ * 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 <memory>
#include <functional>
#include <string>
@@ -61,8 +76,9 @@ class XMLParser : public XMLLocator
/*! Parses a file gives the contents of the file as a string.
* @param fileName the name of the file, used for error reporting.
* @param inputString the contents of the file as a zero terminated UTF-8 string.
+ * @param debugEnabled indicates if debugging via -d lex is enabled or not.
*/
- void parse(const char *fileName,const char *inputString);
+ void parse(const char *fileName,const char *inputString,bool debugEnabled);
private:
virtual int lineNr() const override;
diff --git a/src/xml.l b/libxml/xml.l
index ace35d5..13ff219 100644
--- a/src/xml.l
+++ b/libxml/xml.l
@@ -31,7 +31,7 @@
#include <vector>
#include <stdio.h>
#include "xml.h"
-#include "message.h"
+//#include "message.h"
#define YY_NEVER_INTERACTIVE 1
#define YY_NO_INPUT 1
@@ -426,7 +426,7 @@ XMLParser::~XMLParser()
xmlYYlex_destroy(p->yyscanner);
}
-void XMLParser::parse(const char *fileName,const char *inputStr)
+void XMLParser::parse(const char *fileName,const char *inputStr, bool debugEnabled)
{
yyscan_t yyscanner = p->yyscanner;
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
@@ -437,7 +437,17 @@ void XMLParser::parse(const char *fileName,const char *inputStr)
if (inputStr==nullptr || inputStr[0]=='\0') return; // empty input
- printlex(yy_flex_debug, true, __FILE__, fileName);
+ FILE *output = 0;
+ const char *enter_txt = 0;
+ const char *finished_txt = 0;
+ const char *pre_txt = 0;
+ if (yy_flex_debug) { output=stderr; pre_txt="--"; enter_txt="entering"; finished_txt="finished"; }
+ else if (debugEnabled) { output=stdout; pre_txt=""; enter_txt="Entering"; finished_txt="Finished"; }
+
+ if (output)
+ {
+ fprintf(output,"%s%s lexical analyzer: %s (for: %s)\n",pre_txt,enter_txt, __FILE__, fileName);
+ }
BEGIN(Initial);
yyextra->fileName = fileName;
@@ -464,7 +474,10 @@ void XMLParser::parse(const char *fileName,const char *inputStr)
reportError(yyscanner,msg);
}
- printlex(yy_flex_debug, false, __FILE__, fileName);
+ if (output)
+ {
+ fprintf(output,"%s%s lexical analyzer: %s (for: %s)\n",pre_txt,finished_txt, __FILE__, fileName);
+ }
}
int XMLParser::lineNr() const
diff --git a/qtools/CMakeLists.txt b/qtools/CMakeLists.txt
deleted file mode 100644
index d49ca47..0000000
--- a/qtools/CMakeLists.txt
+++ /dev/null
@@ -1,48 +0,0 @@
-include_directories(.)
-
-list(APPEND qtools_src
-qbuffer.cpp
-qcollection.cpp
-qcstring.cpp
-qdatastream.cpp
-qdatetime.cpp
-qdir.cpp
-qfile.cpp
-qfileinfo.cpp
-qgarray.cpp
-qgdict.cpp
-qglist.cpp
-qglobal.cpp
-qgstring.cpp
-qiodevice.cpp
-qregexp.cpp
-qstring.cpp
-qtextstream.cpp
-qtextcodec.cpp
-qstringlist.cpp
-qcstringlist.cpp
-qxml.cpp
-qmap.cpp
-qutfcodec.cpp
-)
-
-if (UNIX)
-list(APPEND qtools_src
-qfile_unix.cpp
-qdir_unix.cpp
-qfileinfo_unix.cpp
-)
-endif()
-
-if (WIN32)
-list(APPEND qtools_src
-qfile_win32.cpp
-qdir_win32.cpp
-qfileinfo_win32.cpp
-
-)
-endif()
-
-add_library(qtools STATIC
-${qtools_src}
-)
diff --git a/qtools/Doxyfile b/qtools/Doxyfile
deleted file mode 100644
index d3ab25a..0000000
--- a/qtools/Doxyfile
+++ /dev/null
@@ -1,320 +0,0 @@
-# Doxyfile 1.8.14
-
-#---------------------------------------------------------------------------
-# Project related configuration options
-#---------------------------------------------------------------------------
-DOXYFILE_ENCODING = UTF-8
-PROJECT_NAME = Qtools
-PROJECT_NUMBER =
-PROJECT_BRIEF =
-PROJECT_LOGO =
-OUTPUT_DIRECTORY = ../qtools_docs
-CREATE_SUBDIRS = YES
-ALLOW_UNICODE_NAMES = NO
-OUTPUT_LANGUAGE = English
-BRIEF_MEMBER_DESC = YES
-REPEAT_BRIEF = YES
-ABBREVIATE_BRIEF =
-ALWAYS_DETAILED_SEC = NO
-INLINE_INHERITED_MEMB = NO
-FULL_PATH_NAMES = YES
-STRIP_FROM_PATH = $(PWD)/
-STRIP_FROM_INC_PATH =
-SHORT_NAMES = NO
-JAVADOC_AUTOBRIEF = YES
-QT_AUTOBRIEF = NO
-MULTILINE_CPP_IS_BRIEF = NO
-INHERIT_DOCS = YES
-SEPARATE_MEMBER_PAGES = NO
-TAB_SIZE = 8
-ALIASES =
-OPTIMIZE_OUTPUT_FOR_C = NO
-OPTIMIZE_OUTPUT_JAVA = NO
-OPTIMIZE_FOR_FORTRAN = NO
-OPTIMIZE_OUTPUT_VHDL = NO
-EXTENSION_MAPPING =
-MARKDOWN_SUPPORT = YES
-TOC_INCLUDE_HEADINGS = 0
-AUTOLINK_SUPPORT = YES
-BUILTIN_STL_SUPPORT = NO
-CPP_CLI_SUPPORT = NO
-SIP_SUPPORT = NO
-IDL_PROPERTY_SUPPORT = YES
-DISTRIBUTE_GROUP_DOC = NO
-GROUP_NESTED_COMPOUNDS = NO
-SUBGROUPING = YES
-INLINE_GROUPED_CLASSES = NO
-INLINE_SIMPLE_STRUCTS = NO
-TYPEDEF_HIDES_STRUCT = NO
-LOOKUP_CACHE_SIZE = 0
-#---------------------------------------------------------------------------
-# Build related configuration options
-#---------------------------------------------------------------------------
-EXTRACT_ALL = YES
-EXTRACT_PRIVATE = YES
-EXTRACT_PACKAGE = NO
-EXTRACT_STATIC = YES
-EXTRACT_LOCAL_CLASSES = YES
-EXTRACT_LOCAL_METHODS = NO
-EXTRACT_ANON_NSPACES = NO
-HIDE_UNDOC_MEMBERS = NO
-HIDE_UNDOC_CLASSES = NO
-HIDE_FRIEND_COMPOUNDS = NO
-HIDE_IN_BODY_DOCS = NO
-INTERNAL_DOCS = NO
-CASE_SENSE_NAMES = NO
-HIDE_SCOPE_NAMES = NO
-HIDE_COMPOUND_REFERENCE= NO
-SHOW_INCLUDE_FILES = YES
-SHOW_GROUPED_MEMB_INC = NO
-FORCE_LOCAL_INCLUDES = NO
-INLINE_INFO = YES
-SORT_MEMBER_DOCS = YES
-SORT_BRIEF_DOCS = NO
-SORT_MEMBERS_CTORS_1ST = NO
-SORT_GROUP_NAMES = NO
-SORT_BY_SCOPE_NAME = NO
-STRICT_PROTO_MATCHING = NO
-GENERATE_TODOLIST = YES
-GENERATE_TESTLIST = YES
-GENERATE_BUGLIST = YES
-GENERATE_DEPRECATEDLIST= YES
-ENABLED_SECTIONS =
-MAX_INITIALIZER_LINES = 30
-SHOW_USED_FILES = YES
-SHOW_FILES = YES
-SHOW_NAMESPACES = YES
-FILE_VERSION_FILTER =
-LAYOUT_FILE =
-CITE_BIB_FILES =
-#---------------------------------------------------------------------------
-# Configuration options related to warning and progress messages
-#---------------------------------------------------------------------------
-QUIET = NO
-WARNINGS = YES
-WARN_IF_UNDOCUMENTED = YES
-WARN_IF_DOC_ERROR = YES
-WARN_NO_PARAMDOC = NO
-WARN_AS_ERROR = NO
-WARN_FORMAT = "$file:$line: $text "
-WARN_LOGFILE =
-#---------------------------------------------------------------------------
-# Configuration options related to the input files
-#---------------------------------------------------------------------------
-INPUT = .
-INPUT_ENCODING = UTF-8
-FILE_PATTERNS = *.h \
- *.cpp \
- *.doc
-RECURSIVE = NO
-EXCLUDE =
-EXCLUDE_SYMLINKS = NO
-EXCLUDE_PATTERNS =
-EXCLUDE_SYMBOLS =
-EXAMPLE_PATH =
-EXAMPLE_PATTERNS =
-EXAMPLE_RECURSIVE = NO
-IMAGE_PATH =
-INPUT_FILTER =
-FILTER_PATTERNS =
-FILTER_SOURCE_FILES = NO
-FILTER_SOURCE_PATTERNS =
-USE_MDFILE_AS_MAINPAGE =
-#---------------------------------------------------------------------------
-# Configuration options related to source browsing
-#---------------------------------------------------------------------------
-SOURCE_BROWSER = YES
-INLINE_SOURCES = NO
-STRIP_CODE_COMMENTS = YES
-REFERENCED_BY_RELATION = YES
-REFERENCES_RELATION = YES
-REFERENCES_LINK_SOURCE = YES
-SOURCE_TOOLTIPS = YES
-USE_HTAGS = NO
-VERBATIM_HEADERS = YES
-#---------------------------------------------------------------------------
-# Configuration options related to the alphabetical class index
-#---------------------------------------------------------------------------
-ALPHABETICAL_INDEX = YES
-COLS_IN_ALPHA_INDEX = 4
-IGNORE_PREFIX = Q
-#---------------------------------------------------------------------------
-# Configuration options related to the HTML output
-#---------------------------------------------------------------------------
-GENERATE_HTML = YES
-HTML_OUTPUT =
-HTML_FILE_EXTENSION = .html
-HTML_HEADER =
-HTML_FOOTER =
-HTML_STYLESHEET =
-HTML_EXTRA_STYLESHEET =
-HTML_EXTRA_FILES =
-HTML_COLORSTYLE_HUE = 220
-HTML_COLORSTYLE_SAT = 100
-HTML_COLORSTYLE_GAMMA = 80
-HTML_TIMESTAMP = YES
-HTML_DYNAMIC_MENUS = YES
-HTML_DYNAMIC_SECTIONS = NO
-HTML_INDEX_NUM_ENTRIES = 100
-GENERATE_DOCSET = YES
-DOCSET_FEEDNAME = "Doxygen generated docs"
-DOCSET_BUNDLE_ID = org.doxygen.Project
-DOCSET_PUBLISHER_ID = org.doxygen.Publisher
-DOCSET_PUBLISHER_NAME = Publisher
-GENERATE_HTMLHELP = NO
-CHM_FILE =
-HHC_LOCATION =
-GENERATE_CHI = NO
-CHM_INDEX_ENCODING =
-BINARY_TOC = NO
-TOC_EXPAND = NO
-GENERATE_QHP = YES
-QCH_FILE =
-QHP_NAMESPACE = com.qtools
-QHP_VIRTUAL_FOLDER = doc
-QHP_CUST_FILTER_NAME =
-QHP_CUST_FILTER_ATTRS =
-QHP_SECT_FILTER_ATTRS =
-QHG_LOCATION =
-GENERATE_ECLIPSEHELP = YES
-ECLIPSE_DOC_ID = org.doxygen.qtools
-DISABLE_INDEX = NO
-GENERATE_TREEVIEW = NO
-ENUM_VALUES_PER_LINE = 4
-TREEVIEW_WIDTH = 250
-EXT_LINKS_IN_WINDOW = NO
-FORMULA_FONTSIZE = 10
-FORMULA_TRANSPARENT = YES
-USE_MATHJAX = NO
-MATHJAX_FORMAT = HTML-CSS
-MATHJAX_RELPATH = https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/
-MATHJAX_EXTENSIONS =
-MATHJAX_CODEFILE =
-SEARCHENGINE = YES
-SERVER_BASED_SEARCH = NO
-EXTERNAL_SEARCH = NO
-SEARCHENGINE_URL = http://macbookpro/~dimitri/doxysearch.cgi
-SEARCHDATA_FILE = searchdata.xml
-EXTERNAL_SEARCH_ID =
-EXTRA_SEARCH_MAPPINGS =
-#---------------------------------------------------------------------------
-# Configuration options related to the LaTeX output
-#---------------------------------------------------------------------------
-GENERATE_LATEX = YES
-LATEX_OUTPUT =
-LATEX_CMD_NAME = latex
-MAKEINDEX_CMD_NAME = makeindex
-COMPACT_LATEX = NO
-PAPER_TYPE = a4wide
-EXTRA_PACKAGES =
-LATEX_HEADER =
-LATEX_FOOTER =
-LATEX_EXTRA_STYLESHEET =
-LATEX_EXTRA_FILES =
-PDF_HYPERLINKS = YES
-USE_PDFLATEX = YES
-LATEX_BATCHMODE = NO
-LATEX_HIDE_INDICES = NO
-LATEX_SOURCE_CODE = YES
-LATEX_BIB_STYLE = plain
-LATEX_TIMESTAMP = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the RTF output
-#---------------------------------------------------------------------------
-GENERATE_RTF = NO
-RTF_OUTPUT =
-COMPACT_RTF = NO
-RTF_HYPERLINKS = NO
-RTF_STYLESHEET_FILE =
-RTF_EXTENSIONS_FILE =
-RTF_SOURCE_CODE = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the man page output
-#---------------------------------------------------------------------------
-GENERATE_MAN = NO
-MAN_OUTPUT =
-MAN_EXTENSION = .3
-MAN_SUBDIR =
-MAN_LINKS = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the XML output
-#---------------------------------------------------------------------------
-GENERATE_XML = NO
-XML_OUTPUT = xml
-XML_PROGRAMLISTING = YES
-#---------------------------------------------------------------------------
-# Configuration options related to the DOCBOOK output
-#---------------------------------------------------------------------------
-GENERATE_DOCBOOK = NO
-DOCBOOK_OUTPUT = docbook
-DOCBOOK_PROGRAMLISTING = NO
-#---------------------------------------------------------------------------
-# Configuration options for the AutoGen Definitions output
-#---------------------------------------------------------------------------
-GENERATE_AUTOGEN_DEF = NO
-#---------------------------------------------------------------------------
-# Configuration options related to the Perl module output
-#---------------------------------------------------------------------------
-GENERATE_PERLMOD = NO
-PERLMOD_LATEX = NO
-PERLMOD_PRETTY = YES
-PERLMOD_MAKEVAR_PREFIX =
-#---------------------------------------------------------------------------
-# Configuration options related to the preprocessor
-#---------------------------------------------------------------------------
-ENABLE_PREPROCESSING = YES
-MACRO_EXPANSION = YES
-EXPAND_ONLY_PREDEF = YES
-SEARCH_INCLUDES = YES
-INCLUDE_PATH =
-INCLUDE_FILE_PATTERNS =
-PREDEFINED = Q_EXPORT=
-EXPAND_AS_DEFINED =
-SKIP_FUNCTION_MACROS = YES
-#---------------------------------------------------------------------------
-# Configuration options related to external references
-#---------------------------------------------------------------------------
-TAGFILES =
-GENERATE_TAGFILE = ../qtools_docs/qtools.tag
-ALLEXTERNALS = NO
-EXTERNAL_GROUPS = YES
-EXTERNAL_PAGES = YES
-#---------------------------------------------------------------------------
-# Configuration options related to the dot tool
-#---------------------------------------------------------------------------
-CLASS_DIAGRAMS = YES
-MSCGEN_PATH =
-DIA_PATH =
-HIDE_UNDOC_RELATIONS = YES
-HAVE_DOT = YES
-DOT_NUM_THREADS = 0
-DOT_FONTNAME =
-DOT_FONTSIZE = 10
-DOT_FONTPATH =
-CLASS_GRAPH = YES
-COLLABORATION_GRAPH = YES
-GROUP_GRAPHS = YES
-UML_LOOK = NO
-UML_LIMIT_NUM_FIELDS = 10
-TEMPLATE_RELATIONS = YES
-INCLUDE_GRAPH = YES
-INCLUDED_BY_GRAPH = YES
-CALL_GRAPH = NO
-CALLER_GRAPH = NO
-GRAPHICAL_HIERARCHY = YES
-DIRECTORY_GRAPH = YES
-DOT_IMAGE_FORMAT = svg
-INTERACTIVE_SVG = YES
-DOT_PATH =
-DOTFILE_DIRS =
-MSCFILE_DIRS =
-DIAFILE_DIRS =
-PLANTUML_JAR_PATH =
-PLANTUML_CFG_FILE =
-PLANTUML_INCLUDE_PATH =
-DOT_GRAPH_MAX_NODES = 50
-MAX_DOT_GRAPH_DEPTH = 0
-DOT_TRANSPARENT = YES
-DOT_MULTI_TARGETS = NO
-GENERATE_LEGEND = YES
-DOT_CLEANUP = YES
diff --git a/qtools/LICENSE.QPL b/qtools/LICENSE.QPL
deleted file mode 100644
index ecdad6e..0000000
--- a/qtools/LICENSE.QPL
+++ /dev/null
@@ -1,103 +0,0 @@
- THE Q PUBLIC LICENSE
- version 1.0
-
- Copyright (C) 1999-2000 Trolltech AS, Norway.
- Everyone is permitted to copy and
- distribute this license document.
-
-The intent of this license is to establish freedom to share and change the
-software regulated by this license under the open source model.
-
-This license applies to any software containing a notice placed by the
-copyright holder saying that it may be distributed under the terms of
-the Q Public License version 1.0. Such software is herein referred to as
-the Software. This license covers modification and distribution of the
-Software, use of third-party application programs based on the Software,
-and development of free software which uses the Software.
-
- Granted Rights
-
-1. You are granted the non-exclusive rights set forth in this license
- provided you agree to and comply with any and all conditions in this
- license. Whole or partial distribution of the Software, or software
- items that link with the Software, in any form signifies acceptance of
- this license.
-
-2. You may copy and distribute the Software in unmodified form provided
- that the entire package, including - but not restricted to - copyright,
- trademark notices and disclaimers, as released by the initial developer
- of the Software, is distributed.
-
-3. You may make modifications to the Software and distribute your
- modifications, in a form that is separate from the Software, such as
- patches. The following restrictions apply to modifications:
-
- a. Modifications must not alter or remove any copyright notices in
- the Software.
-
- b. When modifications to the Software are released under this
- license, a non-exclusive royalty-free right is granted to the
- initial developer of the Software to distribute your modification
- in future versions of the Software provided such versions remain
- available under these terms in addition to any other license(s) of
- the initial developer.
-
-4. You may distribute machine-executable forms of the Software or
- machine-executable forms of modified versions of the Software, provided
- that you meet these restrictions:
-
- a. You must include this license document in the distribution.
-
- b. You must ensure that all recipients of the machine-executable forms
- are also able to receive the complete machine-readable source code
- to the distributed Software, including all modifications, without
- any charge beyond the costs of data transfer, and place prominent
- notices in the distribution explaining this.
-
- c. You must ensure that all modifications included in the
- machine-executable forms are available under the terms of this
- license.
-
-5. You may use the original or modified versions of the Software to
- compile, link and run application programs legally developed by you
- or by others.
-
-6. You may develop application programs, reusable components and other
- software items that link with the original or modified versions of the
- Software. These items, when distributed, are subject to the following
- requirements:
-
- a. You must ensure that all recipients of machine-executable forms of
- these items are also able to receive and use the complete
- machine-readable source code to the items without any charge
- beyond the costs of data transfer.
-
- b. You must explicitly license all recipients of your items to use
- and re-distribute original and modified versions of the items in
- both machine-executable and source code forms. The recipients must
- be able to do so without any charges whatsoever, and they must be
- able to re-distribute to anyone they choose.
-
-
- c. If the items are not available to the general public, and the
- initial developer of the Software requests a copy of the items,
- then you must supply one.
-
- Limitations of Liability
-
-In no event shall the initial developers or copyright holders be liable
-for any damages whatsoever, including - but not restricted to - lost
-revenue or profits or other direct, indirect, special, incidental or
-consequential damages, even if they have been advised of the possibility
-of such damages, except to the extent invariable law, if any, provides
-otherwise.
-
- No Warranty
-
-The Software and this license document are provided AS IS with NO WARRANTY
-OF ANY KIND, INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS
-FOR A PARTICULAR PURPOSE.
- Choice of Law
-
-This license is governed by the Laws of Norway. Disputes shall be settled
-by Oslo City Court.
diff --git a/qtools/Makefile.in b/qtools/Makefile.in
deleted file mode 100644
index 411ee5d..0000000
--- a/qtools/Makefile.in
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-#
-#
-# Copyright (C) 1997-2000 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.
-#
-
-all: Makefile.qtools Makefile
- $(MAKE) -f Makefile.qtools $@
-
-Makefile.qtools: qtools.pro
- $(ENV) $(PERL) "$(TMAKE)" qtools.pro >Makefile.qtools
-
-tmake:
- $(ENV) $(PERL) "$(TMAKE)" qtools.pro >Makefile.qtools
-
-clean: Makefile.qtools
- $(MAKE) -f Makefile.qtools clean
-
-distclean: clean
- $(RM) Makefile.qtools
-
-FORCE:
diff --git a/qtools/README b/qtools/README
deleted file mode 100644
index 1e7fc8d..0000000
--- a/qtools/README
+++ /dev/null
@@ -1,4 +0,0 @@
-This directory contains a small subset of Troll-Tech's Qt library
-The subset is enough to build the doxygen executable, but lacks many of
-the features found in the Qt library. See http://www.trolltech.com
-for the full package.
diff --git a/qtools/qarray.doc b/qtools/qarray.doc
deleted file mode 100644
index 6914dbc..0000000
--- a/qtools/qarray.doc
+++ /dev/null
@@ -1,486 +0,0 @@
-/****************************************************************************
-**
-**
-** QArray class documentation
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-
-/*****************************************************************************
- QArray documentation
- *****************************************************************************/
-
-/*!
- \class QArray qarray.h
- \brief The QArray class is a template class that provides arrays of simple types.
-
- \ingroup tools
-
- QArray is implemented as a template class. Define a template
- instance QArray\<X\> to create an array that contains X items.
-
- QArray stores the array elements directly in the array. It can only
- deal with simple types, i.e. C++ types, structs and classes that have
- no constructors, destructors or virtual functions. QArray uses
- bitwise operations to copy and compare array elements.
-
- The QVector collection class is also a kind of array. Like most
- \link collection.html collection classes\endlink, it has pointers to the
- contained items.
-
- QArray uses explicit \link shclass.html sharing\endlink with a reference
- count. If more than one array share common data, and one array is
- modified, all arrays will be modified.
-
- The benefit of sharing is that a program does not need to duplicate
- data when it is not required, which results in less memory usage and
- less copying of data.
-
- Example:
- \code
- #include <qarray.h>
- #include <stdio.h>
-
- QArray<int> fib( int num ) // returns fibonacci array
- {
- ASSERT( num > 2 );
- QArray<int> f( num ); // array of ints
-
- f[0] = f[1] = 1; // initialize first two numbers
- for ( int i=2; i<num; i++ )
- f[i] = f[i-1] + f[i-2];
-
- return f;
- }
-
- void main()
- {
- QArray<int> a = fib( 6 ); // get 6 first fibonaccis
- int i;
-
- for ( i=0; i<a.size(); i++ ) // print them
- prinf( "%d: %d\n", i, a[i] );
-
- printf( "1 is found %d time(s)\n", a.contains(1) );
- printf( "5 is found at index %d\n", a.find(5) );
- }
- \endcode
-
- Program output:
- \code
- 0: 1
- 1: 1
- 2: 2
- 3: 3
- 4: 5
- 5: 8
- 1 is found 2 times
- 5 is found at index 4
- \endcode
-
- Note about using QArray for manipulating structs or classes:
- Compilers will often pad the size of structs of odd sizes up to the
- nearest word boundary. This will then be the size QArray will use
- for its bitwise element comparisons. Since the remaining bytes will
- typically be uninitialized, this can cause find() etc. to fail to
- find the element. Example:
-
- \code
- struct MyStruct
- {
- short i; // 2 bytes
- char c; // 1 byte
- }; // sizeof(MyStruct) may be padded to 4 bytes
-
- QArray<MyStruct> a(1);
- a[0].i = 5;
- a[0].c = 't';
-
- MyStruct x;
- x.i = '5';
- x.c = 't';
- int i = a.find( x ); // May return -1 if the pad bytes differ
- \endcode
-
- To workaround this, make sure that you use a struct where sizeof()
- returns the same as the sum of the sizes of the members, either by
- changing the types of the struct members or by adding dummy members.
-
- \sa \link shclass.html Shared Classes\endlink
-*/
-
-
-/*!
- \fn QArray::QArray()
- Constructs a null array.
- \sa isNull()
-*/
-
-/*!
- \fn QArray::QArray( int size )
- Constructs an array with room for \e size elements.
- Makes a null array if \e size == 0.
-
- Note that the elements are not initialized.
-
- \sa resize(), isNull()
-*/
-
-/*!
- \fn QArray::QArray( const QArray<type> &a )
- Constructs a shallow copy of \e a.
- \sa assign()
-*/
-
-/*!
- \fn QArray::QArray( int, int )
- Constructs an array <em>without allocating</em> array space.
- The arguments should be (0, 0). Use at own risk.
-*/
-
-/*!
- \fn QArray::~QArray()
- Dereferences the array data and deletes it if this was the last
- reference.
-*/
-
-/*!
- \fn QArray<type> &QArray::operator=( const QArray<type> &a )
- Assigns a shallow copy of \e a to this array and returns a reference
- to this array.
-
- Equivalent to assign( a ).
-*/
-
-/*!
- \fn type *QArray::data() const
- Returns a pointer to the actual array data.
-
- The array is a null array if data() == 0 (null pointer).
-
- \sa isNull()
-*/
-
-/*!
- \fn uint QArray::nrefs() const
- Returns the reference count for the shared array data. This reference count
- is always greater than zero.
-*/
-
-/*!
- \fn uint QArray::size() const
- Returns the size of the array (max number of elements).
-
- The array is a null array if size() == 0.
-
- \sa isNull(), resize()
-*/
-
-/*!
- \fn uint QArray::count() const
- Returns the same as size().
-
- \sa size()
-*/
-
-/*!
- \fn bool QArray::isEmpty() const
- Returns TRUE if the array is empty, i.e. size() == 0, otherwise FALSE.
-
- isEmpty() is equivalent with isNull() for QArray. Note that this is not
- the case for QCString::isEmpty().
-*/
-
-/*!
- \fn bool QArray::isNull() const
- Returns TRUE if the array is null, otherwise FALSE.
-
- A null array has size() == 0 and data() == 0.
-*/
-
-/*!
- \fn bool QArray::resize( uint size )
- Resizes (expands or shrinks) the array to \e size elements. The array
- becomes a null array if \e size == 0.
-
- Returns TRUE if successful, or FALSE if the memory cannot be allocated.
-
- New elements will not be initialized.
-
- \sa size()
-*/
-
-/*!
- \fn bool QArray::truncate( uint pos )
- Truncates the array at position \e pos.
-
- Returns TRUE if successful, or FALSE if the memory cannot be allocated.
-
- Equivalent to resize(\e pos).
-
- \sa resize()
-*/
-
-/*!
- \fn bool QArray::fill( const type &v, int size )
- Fills the array with the value \e v. If \e size is specified as different
- from -1, then the array will be resized before filled.
-
- Returns TRUE if successful, or FALSE if the memory cannot be allocated
- (only when \e size != -1).
-
- \sa resize()
-*/
-
-/*!
- \fn void QArray::detach()
- Detaches this array from shared array data, i.e. makes a private, deep
- copy of the data.
-
- Copying will only be performed if the
- \link nrefs() reference count\endlink is greater than one.
-
- \sa copy()
-*/
-
-/*!
- \fn QArray<type> QArray::copy() const
- Returns a deep copy of this array.
- \sa detach(), duplicate()
-*/
-
-/*!
- \fn QArray<type> &QArray::assign( const QArray<type> &a )
- Shallow copy. Dereferences the current array and references the data
- contained in \e a instead. Returns a reference to this array.
- \sa operator=()
-*/
-
-/*!
- \fn QArray<type> &QArray::assign( const type *data, uint size )
- Shallow copy. Dereferences the current array and references the
- array data \e data, which contains \e size elements.
- Returns a reference to this array.
-
- Do not delete \e data later, QArray takes care of that.
-*/
-
-/*!
- \fn QArray<type> &QArray::duplicate( const QArray<type> &a )
- Deep copy. Dereferences the current array and obtains a copy of the data
- contained in \e a instead. Returns a reference to this array.
- \sa copy()
-*/
-
-/*!
- \fn QArray<type> &QArray::duplicate( const type *data, uint size )
- Deep copy. Dereferences the current array and obtains a copy of the
- array data \e data instead. Returns a reference to this array.
- \sa copy()
-*/
-
-/*!
- \fn QArray<type> &QArray::setRawData( const type *data, uint size )
-
- Sets raw data and returns a reference to the array.
-
- Dereferences the current array and sets the new array data to \e data and
- the new array size to \e size. Do not attempt to resize or re-assign the
- array data when raw data has been set.
- Call resetRawData(d,len) to reset the array.
-
- Setting raw data is useful because it sets QArray data without allocating
- memory or copying data.
-
- Example I (intended use):
- \code
- static char bindata[] = { 231, 1, 44, ... };
- QByteArray a;
- a.setRawData( bindata, sizeof(bindata) ); // a points to bindata
- QDataStream s( a, IO_ReadOnly ); // open on a's data
- s >> <something>; // read raw bindata
- a.resetRawData( bindata, sizeof(bindata) ); // finished
- \endcode
-
- Example II (you don't want to do this):
- \code
- static char bindata[] = { 231, 1, 44, ... };
- QByteArray a, b;
- a.setRawData( bindata, sizeof(bindata) ); // a points to bindata
- a.resize( 8 ); // will crash
- b = a; // will crash
- a[2] = 123; // might crash
- // forget to resetRawData - will crash
- \endcode
-
- \warning If you do not call resetRawData(), QArray will attempt to
- deallocate or reallocate the raw data, which might not be too good.
- Be careful.
-
- \sa resetRawData()
-*/
-
-/*!
- \fn void QArray::resetRawData( const type *data, uint size )
- Resets raw data that was set using setRawData().
-
- The arguments must be the data and length that were passed to
- setRawData(). This is for consistency checking.
-
- \sa setRawData()
-*/
-
-/*!
- \fn int QArray::find( const type &v, uint index ) const
- Finds the first occurrence of \e v, starting at position \e index.
-
- Returns the position of \e v, or -1 if \e v could not be found.
-
- \sa contains()
-*/
-
-/*!
- \fn int QArray::contains( const type &v ) const
- Returns the number of times \e v occurs in the array.
- \sa find()
-*/
-
-/*!
- \fn void QArray::sort()
- Sorts the array elements in ascending order, using bitwise
- comparison (memcmp()).
-
- \sa bsearch()
-*/
-
-/*!
- \fn int QArray::bsearch( const type &v ) const
- In a sorted array, finds the first occurrence of \e v using binary
- search. For a sorted array, this is generally much faster than
- find(), which does a linear search.
-
- Returns the position of \e v, or -1 if \e v could not be found.
-
- \sa sort(), find()
-*/
-
-/*!
- \fn type &QArray::operator[]( int index ) const
- Returns a reference to the element at position \e index in the array.
-
- This can be used to both read and set an element. Equivalent to at().
-
- \sa at()
-*/
-
-/*!
- \fn type &QArray::at( uint index ) const
- Returns a reference to the element at position \e index in the array.
-
- This can be used to both read and set an element.
-
- \sa operator[]()
-*/
-
-/*!
- \fn QArray::operator const type *() const
- Cast operator. Returns a pointer to the array.
- \sa data()
-*/
-
-/*!
- \fn bool QArray::operator==( const QArray<type> &a ) const
- Returns TRUE if this array is equal to \e a, otherwise FALSE.
-
- The two arrays are bitwise compared.
-
- \sa operator!=()
-*/
-
-/*!
- \fn bool QArray::operator!=( const QArray<type> &a ) const
- Returns TRUE if this array is different from \e a, otherwise FALSE.
-
- The two arrays are bitwise compared.
-
- \sa operator==()
-*/
-
-/*!
- \fn Iterator QArray::begin()
- Returns an iterator pointing at the beginning of this array.
- This iterator can be used as the iterators of QValueList and QMap
- for example. In fact it does not only behave like a usual pointer:
- It is a pointer.
-*/
-
-/*!
- \fn Iterator QArray::end()
- Returns an iterator pointing behind the last element of this array.
- This iterator can be used as the iterators of QValueList and QMap
- for example. In fact it does not only behave like a usual pointer:
- It is a pointer.
-*/
-
-/*!
- \fn ConstIterator QArray::begin() const
- Returns a const iterator pointing at the beginning of this array.
- This iterator can be used as the iterators of QValueList and QMap
- for example. In fact it does not only behave like a usual pointer:
- It is a pointer.
-*/
-
-/*!
- \fn ConstIterator QArray::end() const
- Returns a const iterator pointing behind the last element of this array.
- This iterator can be used as the iterators of QValueList and QMap
- for example. In fact it does not only behave like a usual pointer:
- It is a pointer.
-*/
-
-
-/*****************************************************************************
- QByteArray documentation
- *****************************************************************************/
-
-/*!
- \class QByteArray qcstring.h
- \brief The QByteArray class provides an array of bytes.
-
- \inherit QArray
-
- \ingroup tools
-
- The QByteArray class provides an explicitly shared array of
- bytes. It is useful for manipulating memory areas with custom
- data. QByteArray is implemented as QArray<char>. See the QArray
- documentation for further information.
-*/
diff --git a/qtools/qarray.h b/qtools/qarray.h
deleted file mode 100644
index 3d67fe9..0000000
--- a/qtools/qarray.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QArray template/macro class
-**
-** Created : 930906
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QARRAY_H
-#define QARRAY_H
-
-#ifndef QT_H
-#include "qgarray.h"
-#endif // QT_H
-
-
-template<class type> class Q_EXPORT QArray : public QGArray
-{
-public:
- typedef type* Iterator;
- typedef const type* ConstIterator;
- typedef type ValueType;
-
-protected:
- QArray( int, int ) : QGArray( 0, 0 ) {}
-
-public:
- QArray() {}
- QArray( int size ) : QGArray(size*(int)sizeof(type)) {}
- QArray( const QArray<type> &a ) : QGArray(a) {}
- ~QArray() {}
- QArray<type> &operator=(const QArray<type> &a)
- { return (QArray<type>&)QGArray::assign(a); }
- type *data() const { return (type *)QGArray::data(); }
- uint nrefs() const { return QGArray::nrefs(); }
- uint size() const { return QGArray::size()/(int)sizeof(type); }
- uint count() const { return size(); }
- bool isEmpty() const { return QGArray::size() == 0; }
- bool isNull() const { return QGArray::data() == 0; }
- bool resize( uint size ) { return QGArray::resize(size*(int)sizeof(type)); }
- bool truncate( uint pos ) { return QGArray::resize(pos*(int)sizeof(type)); }
- bool fill( const type &d, int size = -1 )
- { return QGArray::fill((char*)&d,size,sizeof(type) ); }
- void detach() { QGArray::detach(); }
- QArray<type> copy() const
- { QArray<type> tmp; return tmp.duplicate(*this); }
- QArray<type>& assign( const QArray<type>& a )
- { return (QArray<type>&)QGArray::assign(a); }
- QArray<type>& assign( const type *a, uint n )
- { return (QArray<type>&)QGArray::assign((char*)a,n*sizeof(type)); }
- QArray<type>& duplicate( const QArray<type>& a )
- { return (QArray<type>&)QGArray::duplicate(a); }
- QArray<type>& duplicate( const type *a, uint n )
- { return (QArray<type>&)QGArray::duplicate((char*)a,n*sizeof(type)); }
- QArray<type>& setRawData( const type *a, uint n )
- { return (QArray<type>&)QGArray::setRawData((char*)a,
- n*sizeof(type)); }
- void resetRawData( const type *a, uint n )
- { QGArray::resetRawData((char*)a,n*sizeof(type)); }
- int find( const type &d, uint i=0 ) const
- { return QGArray::find((char*)&d,i,sizeof(type)); }
- int contains( const type &d ) const
- { return QGArray::contains((char*)&d,sizeof(type)); }
- void sort() { QGArray::sort(sizeof(type)); }
- int bsearch( const type &d ) const
- { return QGArray::bsearch((const char*)&d,sizeof(type)); }
- type& operator[]( int i ) const
- { return (type &)(*(type *)QGArray::at(i*(int)sizeof(type))); }
- type& at( uint i ) const
- { return (type &)(*(type *)QGArray::at(i*(int)sizeof(type))); }
- operator const type*() const { return (const type *)QGArray::data(); }
- bool operator==( const QArray<type> &a ) const { return isEqual(a); }
- bool operator!=( const QArray<type> &a ) const { return !isEqual(a); }
- Iterator begin() { return data(); }
- Iterator end() { return data() + size(); }
- ConstIterator begin() const { return data(); }
- ConstIterator end() const { return data() + size(); }
-};
-
-
-#endif // QARRAY_H
diff --git a/qtools/qasciidict.h b/qtools/qasciidict.h
deleted file mode 100644
index 6a93a02..0000000
--- a/qtools/qasciidict.h
+++ /dev/null
@@ -1,107 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QAsciiDict template class
-**
-** Created : 920821
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QASCIIDICT_H
-#define QASCIIDICT_H
-
-#ifndef QT_H
-#include "qgdict.h"
-#endif // QT_H
-
-
-template<class type> class Q_EXPORT QAsciiDict : public QGDict
-{
-public:
- QAsciiDict(uint size=17, bool caseSensitive=TRUE, bool copyKeys=TRUE )
- : QGDict(size,AsciiKey,caseSensitive,copyKeys) {}
- QAsciiDict( const QAsciiDict<type> &d ) : QGDict(d) {}
- ~QAsciiDict() { clear(); }
- QAsciiDict<type> &operator=(const QAsciiDict<type> &d)
- { return (QAsciiDict<type>&)QGDict::operator=(d); }
- uint count() const { return QGDict::count(); }
- uint size() const { return QGDict::size(); }
- bool isEmpty() const { return QGDict::count() == 0; }
-
- void insert( const char *k, const type *d )
- { QGDict::look_ascii(k,(Item)d,1); }
- void replace( const char *k, const type *d )
- { QGDict::look_ascii(k,(Item)d,2); }
- bool remove( const char *k ) { return QGDict::remove_ascii(k); }
- type *take( const char *k ) { return (type *)QGDict::take_ascii(k); }
- type *find( const char *k ) const
- { return (type *)((QGDict*)this)->QGDict::look_ascii(k,0,0); }
- type *operator[]( const char *k ) const
- { return (type *)((QGDict*)this)->QGDict::look_ascii(k,0,0); }
-
- void clear() { QGDict::clear(); }
- void resize( uint n ) { QGDict::resize(n); }
- void statistics() const { QGDict::statistics(); }
-private:
- void deleteItem( Item d );
-};
-
-#if defined(Q_DELETING_VOID_UNDEFINED)
-template<> inline void QAsciiDict<void>::deleteItem( Item )
-{
-}
-#endif
-
-template<class type> inline void QAsciiDict<type>::deleteItem( QCollection::Item d )
-{
- if ( del_item ) delete (type *)d;
-}
-
-
-template<class type> class Q_EXPORT QAsciiDictIterator : public QGDictIterator
-{
-public:
- QAsciiDictIterator(const QAsciiDict<type> &d)
- : QGDictIterator((QGDict &)d) {}
- ~QAsciiDictIterator() {}
- uint count() const { return dict->count(); }
- bool isEmpty() const { return dict->count() == 0; }
- type *toFirst() { return (type *)QGDictIterator::toFirst(); }
- operator type *() const { return (type *)QGDictIterator::get(); }
- type *current() const { return (type *)QGDictIterator::get(); }
- const char *currentKey() const { return QGDictIterator::getKeyAscii(); }
- type *operator()() { return (type *)QGDictIterator::operator()(); }
- type *operator++() { return (type *)QGDictIterator::operator++(); }
- type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j);}
-};
-
-
-#endif // QASCIIDICT_H
diff --git a/qtools/qbuffer.cpp b/qtools/qbuffer.cpp
deleted file mode 100644
index f68ef54..0000000
--- a/qtools/qbuffer.cpp
+++ /dev/null
@@ -1,465 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QBuffer class
-**
-** Created : 930812
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qbuffer.h"
-#include <stdlib.h>
-
-// REVISED: paul
-/*!
- \class QBuffer qbuffer.h
- \brief The QBuffer class is an I/O device that operates on a QByteArray
-
- \ingroup io
-
- QBuffer allows reading and writing a memory buffer. It is normally
- used together with a QTextStream or a QDataStream. QBuffer has an
- associated QByteArray which holds the buffer data. The size() of the
- buffer is automatically adjusted as data is written.
-
- The constructor \c QBuffer(QByteArray) creates a QBuffer with an
- existing byte array. The byte array can also be set with setBuffer().
- Writing to the QBuffer will modify the original byte array, since
- QByteArray is \link shclass.html explicitly shared.\endlink
-
- Use open() to open the buffer before use, and to set the mode
- (read-only,write-only, etc.). close() closes the buffer. The buffer
- must be closed before reopening or calling setBuffer().
-
- The common way to use QBuffer is through \l QDataStream or \l QTextStream
- which have constructors that take a QBuffer parameter. For
- convenience, there are also QDataStream and QTextStream constructors
- that take a QByteArray parameter. These constructors create and open
- an internal QBuffer.
-
- Note that QTextStream can also operate on a QString (a Unicode
- string); a QBuffer cannot.
-
- You can also use QBuffer directly through the standard QIODevice
- functions readBlock(), writeBlock() readLine(), at(), getch(), putch() and
- ungetch().
-
- \sa QFile, QDataStream, QTextStream, QByteArray, \link shclass.html Shared Classes\endlink
-*/
-
-
-/*!
- Constructs an empty buffer.
-*/
-
-QBuffer::QBuffer()
-{
- setFlags( IO_Direct );
- a_inc = 16; // initial increment
- a_len = 0;
- ioIndex = 0;
-}
-
-
-/*!
- Constructs a buffer that operates on \a buf.
- If you open the buffer in write mode (\c IO_WriteOnly or
- \c IO_ReadWrite) and write something into the buffer, \a buf
- will be modified.
-
-
- Example:
- \code
- QCString str = "abc";
- QBuffer b( str );
- b.open( IO_WriteOnly );
- b.at( 3 ); // position at \0
- b.writeBlock( "def", 4 ); // write including \0
- b.close();
- // Now, str == "abcdef"
- \endcode
-
-
- \sa setBuffer()
-*/
-
-QBuffer::QBuffer( QByteArray buf ) : a(buf)
-{
- setFlags( IO_Direct );
- a_len = a.size();
- a_inc = (a_len > 512) ? 512 : a_len; // initial increment
- if ( a_inc < 16 )
- a_inc = 16;
- ioIndex = 0;
-}
-
-/*!
- Destructs the buffer.
-*/
-
-QBuffer::~QBuffer()
-{
-}
-
-
-/*!
- Replaces the buffer's contents with \a buf.
-
- This may not be done when isOpen() is TRUE.
-
- Note that if you open the buffer in write mode (\c IO_WriteOnly or
- IO_ReadWrite) and write something into the buffer, \a buf is also
- modified because QByteArray is an explicitly shared class.
-
- \sa buffer(), open(), close()
-*/
-
-bool QBuffer::setBuffer( QByteArray buf )
-{
- if ( isOpen() ) {
-#if defined(CHECK_STATE)
- qWarning( "QBuffer::setBuffer: Buffer is open");
-#endif
- return FALSE;
- }
- a = buf;
- a_len = a.size();
- a_inc = (a_len > 512) ? 512 : a_len; // initial increment
- if ( a_inc < 16 )
- a_inc = 16;
- ioIndex = 0;
- return TRUE;
-}
-
-/*!
- \fn QByteArray QBuffer::buffer() const
-
- Returns this buffer's byte array.
-
- \sa setBuffer()
-*/
-
-/*!
- \reimp
- Opens the buffer in the mode \a m. Returns TRUE if successful,
- otherwise FALSE. The buffer must be opened before use.
-
- The mode parameter \a m must be a combination of the following flags.
- <ul>
- <li>\c IO_ReadOnly opens a buffer in read-only mode.
- <li>\c IO_WriteOnly opens a buffer in write-only mode.
- <li>\c IO_ReadWrite opens a buffer in read/write mode.
- <li>\c IO_Append sets the buffer index to the end of the buffer.
- <li>\c IO_Truncate truncates the buffer.
- </ul>
-
- \sa close(), isOpen()
-*/
-
-bool QBuffer::open( int m )
-{
- if ( isOpen() ) { // buffer already open
-#if defined(CHECK_STATE)
- qWarning( "QBuffer::open: Buffer already open" );
-#endif
- return FALSE;
- }
- setMode( m );
- if ( m & IO_Truncate ) { // truncate buffer
- a.resize( 0 );
- a_len = 0;
- }
- if ( m & IO_Append ) { // append to end of buffer
- ioIndex = a.size();
- } else {
- ioIndex = 0;
- }
- a_inc = 16;
- setState( IO_Open );
- setStatus( 0 );
- return TRUE;
-}
-
-/*!
- \reimp
- Closes an open buffer.
- \sa open()
-*/
-
-void QBuffer::close()
-{
- if ( isOpen() ) {
- setFlags( IO_Direct );
- ioIndex = 0;
- a_inc = 16;
- }
-}
-
-/*!
- \reimp
- The flush function does nothing for a QBuffer.
-*/
-
-void QBuffer::flush()
-{
- return;
-}
-
-
-/*!
- \fn int QBuffer::at() const
- \reimp
-*/
-
-/*!
- \fn uint QBuffer::size() const
- \reimp
-*/
-
-/*!
- \reimp
-*/
-
-bool QBuffer::at( int pos )
-{
-#if defined(CHECK_STATE)
- if ( !isOpen() ) {
- qWarning( "QBuffer::at: Buffer is not open" );
- return FALSE;
- }
-#endif
- if ( (uint)pos > a_len ) {
-#if defined(CHECK_RANGE)
- qWarning( "QBuffer::at: Index %d out of range", pos );
-#endif
- return FALSE;
- }
- ioIndex = pos;
- return TRUE;
-}
-
-
-/*!
- \reimp
-*/
-
-int QBuffer::readBlock( char *p, uint len )
-{
-#if defined(CHECK_STATE)
- CHECK_PTR( p );
- if ( !isOpen() ) { // buffer not open
- qWarning( "QBuffer::readBlock: Buffer not open" );
- return -1;
- }
- if ( !isReadable() ) { // reading not permitted
- qWarning( "QBuffer::readBlock: Read operation not permitted" );
- return -1;
- }
-#endif
- if ( (uint)ioIndex + len > a.size() ) { // overflow
- if ( (uint)ioIndex >= a.size() ) {
- setStatus( IO_ReadError );
- return -1;
- } else {
- len = a.size() - (uint)ioIndex;
- }
- }
- memcpy( p, a.data()+ioIndex, len );
- ioIndex += len;
- return len;
-}
-
-/*!
- \reimp
-
- Writes \a len bytes from \a p into the buffer at the current index,
- overwriting any characters there and extending the buffer if necessary.
- Returns the number of bytes actually written.
-
- Returns -1 if a serious error occurred.
-
- \sa readBlock()
-*/
-
-int QBuffer::writeBlock( const char *p, uint len )
-{
-#if defined(CHECK_NULL)
- if ( p == 0 && len != 0 )
- qWarning( "QBuffer::writeBlock: Null pointer error" );
-#endif
-#if defined(CHECK_STATE)
- if ( !isOpen() ) { // buffer not open
- qWarning( "QBuffer::writeBlock: Buffer not open" );
- return -1;
- }
- if ( !isWritable() ) { // writing not permitted
- qWarning( "QBuffer::writeBlock: Write operation not permitted" );
- return -1;
- }
-#endif
- if ( (uint)ioIndex + len >= a_len ) { // overflow
- uint new_len = a_len + a_inc*(((uint)ioIndex+len-a_len)/a_inc+1);
- if ( !a.resize( new_len ) ) { // could not resize
-#if defined(CHECK_NULL)
- qWarning( "QBuffer::writeBlock: Memory allocation error" );
-#endif
- setStatus( IO_ResourceError );
- return -1;
- }
- a_inc *= 2; // double increment
- a_len = new_len;
- a.shd->len = (uint)ioIndex + len;
- }
- memcpy( a.data()+ioIndex, p, len );
- ioIndex += len;
- if ( a.shd->len < (uint)ioIndex )
- a.shd->len = (uint)ioIndex; // fake (not alloc'd) length
- return len;
-}
-
-
-/*!
- \reimp
-*/
-
-int QBuffer::readLine( char *p, uint maxlen )
-{
-#if defined(CHECK_STATE)
- CHECK_PTR( p );
- if ( !isOpen() ) { // buffer not open
- qWarning( "QBuffer::readLine: Buffer not open" );
- return -1;
- }
- if ( !isReadable() ) { // reading not permitted
- qWarning( "QBuffer::readLine: Read operation not permitted" );
- return -1;
- }
-#endif
- if ( maxlen == 0 )
- return 0;
- uint start = (uint)ioIndex;
- char *d = a.data() + ioIndex;
- maxlen--; // make room for 0-terminator
- if ( a.size() - (uint)ioIndex < maxlen )
- maxlen = a.size() - (uint)ioIndex;
- while ( maxlen-- ) {
- if ( (*p++ = *d++) == '\n' )
- break;
- }
- *p = '\0';
- ioIndex = (int)(d - a.data());
- return (uint)ioIndex - start;
-}
-
-
-/*!
- \reimp
-*/
-
-int QBuffer::getch()
-{
-#if defined(CHECK_STATE)
- if ( !isOpen() ) { // buffer not open
- qWarning( "QBuffer::getch: Buffer not open" );
- return -1;
- }
- if ( !isReadable() ) { // reading not permitted
- qWarning( "QBuffer::getch: Read operation not permitted" );
- return -1;
- }
-#endif
- if ( (uint)ioIndex+1 > a.size() ) { // overflow
- setStatus( IO_ReadError );
- return -1;
- }
- return uchar(*(a.data()+ioIndex++));
-}
-
-/*!
- \reimp
- Writes the character \a ch into the buffer, overwriting
- the character at the current index, extending the buffer
- if necessary.
-
- Returns \a ch, or -1 if some error occurred.
-
- \sa getch(), ungetch()
-*/
-
-int QBuffer::putch( int ch )
-{
-#if defined(CHECK_STATE)
- if ( !isOpen() ) { // buffer not open
- qWarning( "QBuffer::putch: Buffer not open" );
- return -1;
- }
- if ( !isWritable() ) { // writing not permitted
- qWarning( "QBuffer::putch: Write operation not permitted" );
- return -1;
- }
-#endif
- if ( (uint)ioIndex + 1 >= a_len ) { // overflow
- char buf[1];
- buf[0] = (char)ch;
- if ( writeBlock(buf,1) != 1 )
- return -1; // write error
- } else {
- *(a.data() + ioIndex++) = (char)ch;
- if ( a.shd->len < (uint)ioIndex )
- a.shd->len = (uint)ioIndex;
- }
- return ch;
-}
-
-/*!
- \reimp
-*/
-
-int QBuffer::ungetch( int ch )
-{
-#if defined(CHECK_STATE)
- if ( !isOpen() ) { // buffer not open
- qWarning( "QBuffer::ungetch: Buffer not open" );
- return -1;
- }
- if ( !isReadable() ) { // reading not permitted
- qWarning( "QBuffer::ungetch: Read operation not permitted" );
- return -1;
- }
-#endif
- if ( ch != -1 ) {
- if ( ioIndex )
- ioIndex--;
- else
- ch = -1;
- }
- return ch;
-}
diff --git a/qtools/qbuffer.h b/qtools/qbuffer.h
deleted file mode 100644
index 9dcd286..0000000
--- a/qtools/qbuffer.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QBuffer class
-**
-** Created : 930812
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QBUFFER_H
-#define QBUFFER_H
-
-#ifndef QT_H
-#include "qiodevice.h"
-#include "qstring.h"
-#endif // QT_H
-
-
-class Q_EXPORT QBuffer : public QIODevice
-{
-public:
- QBuffer();
- QBuffer( QByteArray );
- ~QBuffer();
-
- QByteArray buffer() const;
- bool setBuffer( QByteArray );
-
- bool open( int );
- void close();
- void flush();
-
- uint size() const;
- int at() const;
- bool at( int );
-
- int readBlock( char *p, uint );
- int writeBlock( const char *p, uint );
- int readLine( char *p, uint );
-
- int getch();
- int putch( int );
- int ungetch( int );
-
-protected:
- QByteArray a;
-
-private:
- uint a_len;
- uint a_inc;
-
-private: // Disabled copy constructor and operator=
-#if defined(Q_DISABLE_COPY)
- QBuffer( const QBuffer & );
- QBuffer &operator=( const QBuffer & );
-#endif
-};
-
-
-inline QByteArray QBuffer::buffer() const
-{ return a; }
-
-inline uint QBuffer::size() const
-{ return a.size(); }
-
-inline int QBuffer::at() const
-{ return ioIndex; }
-
-
-#endif // QBUFFER_H
diff --git a/qtools/qcollection.cpp b/qtools/qcollection.cpp
deleted file mode 100644
index 4f86227..0000000
--- a/qtools/qcollection.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of base class for all collection classes
-**
-** Created : 920820
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qcollection.h"
-
-// NOT REVISED
-/*!
- \class QCollection qcollection.h
- \brief The QCollection class is the base class of all Qt collections.
-
- \ingroup collection
- \ingroup tools
-
- The QCollection class is an abstract base class for the Qt \link
- collection.html collection classes\endlink QDict, QList etc. via QGDict,
- QGList etc.
-
- A QCollection knows only about the number of objects in the
- collection and the deletion strategy (see setAutoDelete()).
-
- A collection is implemented using the \c Item (generic collection
- item) type, which is a \c void*. The template classes that create
- the real collections cast the \c Item to the required type.
-
- \sa \link collection.html Collection Classes\endlink
-*/
-
-
-/*! \typedef QCollection::Item
-
- This type is the generic "item" in a QCollection.
-*/
-
-
-/*!
- \fn QCollection::QCollection()
-
- Constructs a collection. The constructor is protected because
- QCollection is an abstract class.
-*/
-
-/*!
- \fn QCollection::QCollection( const QCollection & source )
-
- Constructs a copy of \a source with autoDelete() set to FALSE. The
- constructor is protected because QCollection is an abstract class.
-
- Note that if \a source has autoDelete turned on, copying it is a
- good way to get memory leaks, reading freed memory, or both.
-*/
-
-/*!
- \fn QCollection::~QCollection()
- Destroys the collection. The destructor is protected because QCollection
- is an abstract class.
-*/
-
-
-/*!
- \fn bool QCollection::autoDelete() const
- Returns the setting of the auto-delete option (default is FALSE).
- \sa setAutoDelete()
-*/
-
-/*!
- \fn void QCollection::setAutoDelete( bool enable )
-
- Sets the auto-delete option of the collection.
-
- Enabling auto-delete (\e enable is TRUE) will delete objects that
- are removed from the collection. This can be useful if the
- collection has the only reference to the objects. (Note that the
- object can still be copied using the copy constructor - copying such
- objects is a good way to get memory leaks, reading freed memory or
- both.)
-
- Disabling auto-delete (\e enable is FALSE) will \e not delete objects
- that are removed from the collection. This is useful if the objects
- are part of many collections.
-
- The default setting is FALSE.
-
- \sa autoDelete()
-*/
-
-
-/*!
- \fn virtual uint QCollection::count() const
- Returns the number of objects in the collection.
-*/
-
-/*!
- \fn virtual void QCollection::clear()
- Removes all objects from the collection. The objects will be deleted
- if auto-delete has been enabled.
- \sa setAutoDelete()
-*/
-
-
-/*!
- Virtual function that creates a copy of an object that is about to
- be inserted into the collection.
-
- The default implementation returns the \e d pointer, i.e. no copy
- is made.
-
- This function is seldom reimplemented in the collection template
- classes. It is not common practice to make a copy of something
- that is being inserted.
-
- \sa deleteItem()
-*/
-
-QCollection::Item QCollection::newItem( Item d )
-{
- return d; // just return reference
-}
-
-/*!
- Virtual function that deletes an item that is about to be removed from
- the collection.
-
- The default implementation deletes \e d pointer if and only if
- auto-delete has been enabled.
-
- This function is always reimplemented in the collection template
- classes.
-
- \warning If you reimplement this function you must also reimplement
- the destructor and call the virtual function clear() from your
- destructor. This is due to the way virtual functions and
- destructors work in C++: virtual functions in derived classes cannot
- be called from a destructor. If you do not do this your
- deleteItem() function will not be called when the container is
- destructed.
-
- \sa newItem(), setAutoDelete()
-*/
-
-void QCollection::deleteItem( Item d )
-{
- if ( del_item )
-#if defined(Q_DELETING_VOID_UNDEFINED)
- delete (char *)d; // default operation
-#else
- delete d; // default operation
-#endif
-}
diff --git a/qtools/qcollection.h b/qtools/qcollection.h
deleted file mode 100644
index c187569..0000000
--- a/qtools/qcollection.h
+++ /dev/null
@@ -1,73 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of base class for all collection classes
-**
-** Created : 920629
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QCOLLECTION_H
-#define QCOLLECTION_H
-
-#ifndef QT_H
-#include "qglobal.h"
-#endif // QT_H
-
-
-class QGList;
-class QGDict;
-
-
-class Q_EXPORT QCollection // inherited by all collections
-{
-public:
- bool autoDelete() const { return del_item; }
- void setAutoDelete( bool enable ) { del_item = enable; }
-
- virtual uint count() const = 0;
- virtual void clear() = 0; // delete all objects
-
- typedef void *Item; // generic collection item
-
-protected:
- QCollection() { del_item = FALSE; } // no deletion of objects
- QCollection(const QCollection &) { del_item = FALSE; }
- virtual ~QCollection() {}
-
- bool del_item; // default FALSE
-
- virtual Item newItem( Item ); // create object
- virtual void deleteItem( Item ); // delete object
-};
-
-
-#endif // QCOLLECTION_H
diff --git a/qtools/qconfig.h b/qtools/qconfig.h
deleted file mode 100644
index 7a880f9..0000000
--- a/qtools/qconfig.h
+++ /dev/null
@@ -1 +0,0 @@
-// Everything
diff --git a/qtools/qcstringlist.cpp b/qtools/qcstringlist.cpp
deleted file mode 100644
index 4bb231d..0000000
--- a/qtools/qcstringlist.cpp
+++ /dev/null
@@ -1,192 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1997-2018 by Dimitri van Heesch.
-**
-** Permission to use, copy, modify, and distribute this software and its
-** documentation under the terms of the GNU General Public License is hereby
-** granted. No representations are made about the suitability of this software
-** for any purpose. It is provided "as is" without express or implied warranty.
-** See the GNU General Public License for more details.
-**
-** Implementation of QCStringList
-**
-**********************************************************************/
-
-#include "qcstringlist.h"
-
-#include "qstrlist.h"
-#include "qdatastream.h"
-#include "qtl.h"
-
-/*!
- Splits the string \a str using \a sep as separator. Returns the
- list of strings. If \a allowEmptyEntries is TRUE, also empty
- entries are inserted into the list, else not. So if you have
- a string 'abc..d.e.', a list which contains 'abc', 'd', and 'e'
- would be returned if \a allowEmptyEntries is FALSE, but
- a list containing 'abc', '', 'd', 'e' and '' would be returned if
- \a allowEmptyEntries is TRUE.
- If \a str doesn't contain \a sep, a stringlist
- with one item, which is the same as \a str, is returned.
-
- \sa join()
-*/
-
-QCStringList QCStringList::split( char sep, const QCString &str, bool allowEmptyEntries )
-{
- char cs[2] = { sep, '\0' };
- return split( cs, str, allowEmptyEntries );
-}
-
-/*!
- Splits the string \a str using \a sep as separator. Returns the
- list of strings. If \a allowEmptyEntries is TRUE, also empty
- entries are inserted into the list, else not. So if you have
- a string 'abc..d.e.', a list which contains 'abc', 'd', and 'e'
- would be returned if \a allowEmptyEntries is FALSE, but
- a list containing 'abc', '', 'd', 'e' and '' would be returned if
- \a allowEmptyEntries is TRUE.
- If \a str doesn't contain \a sep, a stringlist
- with one item, which is the same as \a str, is returned.
-
- \sa join()
-*/
-
-QCStringList QCStringList::split( const QCString &sep, const QCString &str, bool allowEmptyEntries )
-{
- QCStringList lst;
-
- int j = 0;
- int i = str.find( sep, j );
-
- while ( i != -1 ) {
- if ( str.mid( j, i - j ).length() > 0 )
- lst << str.mid( j, i - j );
- else if ( allowEmptyEntries )
- lst << QCString();
- j = i + sep.length();
- i = str.find( sep, j );
- }
-
- int l = str.length() - 1;
- if ( str.mid( j, l - j + 1 ).length() > 0 )
- lst << str.mid( j, l - j + 1 );
- else if ( allowEmptyEntries )
- lst << QCString();
-
- return lst;
-}
-
-/*!
- Splits the string \a str using the regular expression \a sep as separator. Returns the
- list of strings. If \a allowEmptyEntries is TRUE, also empty
- entries are inserted into the list, else not. So if you have
- a string 'abc..d.e.', a list which contains 'abc', 'd', and 'e'
- would be returned if \a allowEmptyEntries is FALSE, but
- a list containing 'abc', '', 'd', 'e' and '' would be returned if
- \a allowEmptyEntries is TRUE.
- If \a str doesn't contain \a sep, a stringlist
- with one item, which is the same as \a str, is returned.
-
- \sa join()
-*/
-
-QCStringList QCStringList::split( const QRegExp &sep, const QCString &str, bool allowEmptyEntries )
-{
- QCStringList lst;
-
- int j = 0;
- int len = 0;
- int i = sep.match( str.data(), j, &len );
-
- while ( i != -1 ) {
- if ( str.mid( j, i - j ).length() > 0 )
- lst << str.mid( j, i - j );
- else if ( allowEmptyEntries )
- lst << QCString();
- j = i + len;
- i = sep.match( str.data(), j, &len );
- }
-
- int l = str.length() - 1;
- if ( str.mid( j, l - j + 1 ).length() > 0 )
- lst << str.mid( j, l - j + 1 );
- else if ( allowEmptyEntries )
- lst << QCString();
-
- return lst;
-}
-
-/*!
- Returns a list of all strings containing the substring \a str.
-
- If \a cs is TRUE, the grep is done case sensitively, else not.
-*/
-
-QCStringList QCStringList::grep( const QCString &str, bool cs ) const
-{
- QCStringList res;
- for ( QCStringList::ConstIterator it = begin(); it != end(); ++it )
- if ( (*it).contains( str, cs ) )
- res << *it;
-
- return res;
-}
-
-/*!
- Returns a list of all strings containing a substring that matches
- the regular expression \a expr.
-*/
-
-QCStringList QCStringList::grep( const QRegExp &expr ) const
-{
- QCStringList res;
- for ( QCStringList::ConstIterator it = begin(); it != end(); ++it )
- if ( (*it).contains( expr ) )
- res << *it;
-
- return res;
-}
-
-/*!
- Joins the stringlist into a single string with each element
- separated by \a sep.
-
- \sa split()
-*/
-QCString QCStringList::join( const QCString &sep ) const
-{
- QCString res;
- bool already = FALSE;
- for ( QCStringList::ConstIterator it = begin(); it != end(); ++it ) {
- if ( already )
- res += sep;
- already = TRUE;
- res += *it;
- }
-
- return res;
-}
-
-Q_EXPORT QDataStream &operator>>( QDataStream & s, QCStringList& l )
-{
- return s >> (QValueList<QCString>&)l;
-}
-
-Q_EXPORT QDataStream &operator<<( QDataStream & s, const QCStringList& l )
-{
- return s << (const QValueList<QCString>&)l;
-}
-
-/*!
- Converts from a QStrList (ASCII) to a QCStringList (Unicode).
-*/
-QCStringList QCStringList::fromStrList(const QStrList& ascii)
-{
- QCStringList res;
- const char * s;
- for ( QStrListIterator it(ascii); (s=it.current()); ++it )
- res << s;
- return res;
-}
-
diff --git a/qtools/qcstringlist.h b/qtools/qcstringlist.h
deleted file mode 100644
index 7ffd4d2..0000000
--- a/qtools/qcstringlist.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 1997-2018 by Dimitri van Heesch.
-**
-** Permission to use, copy, modify, and distribute this software and its
-** documentation under the terms of the GNU General Public License is hereby
-** granted. No representations are made about the suitability of this software
-** for any purpose. It is provided "as is" without express or implied warranty.
-** See the GNU General Public License for more details.
-**
-** Note: this is a variant of the qstringlist.h but for QCString's
-**
-**********************************************************************/
-#ifndef QCSTRINGLIST_H
-#define QCSTRINGLIST_H
-
-#include "qvaluelist.h"
-#include "qcstring.h"
-#include "qregexp.h"
-
-class QStrList;
-class QDataStream;
-
-class QCStringList : public QValueList<QCString>
-{
-public:
- QCStringList() { }
- QCStringList( const QCStringList& l ) : QValueList<QCString>(l) { }
- QCStringList( const QValueList<QCString>& l ) : QValueList<QCString>(l) { }
- QCStringList( const QCString& i ) { append(i); }
- QCStringList( const char* i ) { append(i); }
- QCStringList &operator=(const QCStringList &l)
- {
- return static_cast<QCStringList&>(QValueList<QCString>::operator=(l));
- }
-
- static QCStringList fromStrList(const QStrList&);
-
- static QCStringList split( const QCString &sep, const QCString &str, bool allowEmptyEntries = FALSE );
- static QCStringList split( char sep, const QCString &str, bool allowEmptyEntries = FALSE );
- static QCStringList split( const QRegExp &sep, const QCString &str, bool allowEmptyEntries = FALSE );
- QCString join( const QCString &sep ) const;
-
- QCStringList grep( const QCString &str, bool cs = TRUE ) const;
- QCStringList grep( const QRegExp &expr ) const;
-};
-
-extern Q_EXPORT QDataStream &operator>>( QDataStream &, QCStringList& );
-extern Q_EXPORT QDataStream &operator<<( QDataStream &, const QCStringList& );
-
-#endif // QCSTRINGLIST_H
diff --git a/qtools/qdatastream.cpp b/qtools/qdatastream.cpp
deleted file mode 100644
index d539daf..0000000
--- a/qtools/qdatastream.cpp
+++ /dev/null
@@ -1,944 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QDataStream class
-**
-** Created : 930831
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qdatastream.h"
-
-#ifndef QT_NO_DATASTREAM
-#include "qbuffer.h"
-#include <stdio.h>
-#include <ctype.h>
-#include <stdlib.h>
-
-// REVISED: warwick
-/*!
- \class QDataStream qdatastream.h
-
- \brief The QDataStream class provides serialization of
- binary data to a QIODevice.
-
- \ingroup io
-
- A data stream is a binary stream of encoded information which is 100%
- independent of the host computer operation system, CPU or byte order. A
- stream that is written by a PC under DOS/Windows can be read by a
- Sun SPARC running Solaris.
-
- The QDataStream class implements serialization of primitive types, like
- \c char, \c short, \c int, \c char* etc. Serialization of more complex
- data is accomplished by breaking up the data into primitive units.
-
- The programmer can select which byte order to use when serializing data.
- The default setting is big endian (MSB first). Changing it to little
- endian breaks the portability (unless the reader also changes to little
- endian). We recommend keeping this setting unless you have
- special requirements.
-
- A data stream cooperates closely with a QIODevice. A QIODevice
- represents an input/output medium one can read data from and write data
- to. The QFile class is an example of an IO device.
-
- Example (write data to a stream):
- \code
- QFile f( "file.dta" );
- f.open( IO_WriteOnly ); // open file for writing
- QDataStream s( &f ); // serialize using f
- s << "the answer is"; // serialize string
- s << (Q_INT32)42; // serialize integer
- \endcode
-
- Example (read data from a stream):
- \code
- QFile f( "file.dta" );
- f.open( IO_ReadOnly ); // open file for reading
- QDataStream s( &f ); // serialize using f
- char *str;
- Q_INT32 a;
- s >> str >> a; // "the answer is" and 42
- delete str; // delete string
- \endcode
-
- In the last example, if you read into a QString instead of a \c char*
- you do not have to delete it.
-
- Normally, each item written to the stream is written in a fixed binary
- format.
- For example, a \c char* is written as a 32-bit integer equal to the
- length of the string including the NUL byte, followed by all the
- characters of the string including the NUL byte. Similarly when
- reading a string, 4 bytes are read to create the 32-bit length value,
- then that many characters for the string including the NUL. For a complete
- description of all Qt types supporting data streaming see \link
- datastreamformat.html Format of the QDataStream operators \endlink .
-
- If you want a "parsing" input stream, see QTextStream. If you just want the
- data to be human-readable to aid in debugging, you can set the data
- stream into printable data mode with setPrintableData(). The data is
- then written slower, in a human readable bloated form that is sufficient
- for debugging.
-
- If you are producing a new binary data format, such as a file format
- for documents created by your application, you could use a QDataStream
- to write the data in a portable format. Typically, you would write
- a brief header containing a magic string and a version number to give
- yourself room for future expansion. For example:
-
- \code
- // Open the file.
- QFile f( "file.xxx" );
- f.open( IO_WriteOnly );
- QDataStream s( &f );
-
- // Write a header with a "magic number" and a version
- s << 0xa0b0c0d0;
- s << 123;
-
- // Write the data
- s << [lots of interesting data]
- \endcode
-
- Then read it in with:
-
- \code
- // Open the file.
- QFile f( "file.xxx" );
- f.open( IO_ReadOnly );
- QDataStream s( &f );
-
- // Read and check the header
- Q_UINT32 magic;
- s >> magic;
- if ( magic != 0xa0b0c0d0 )
- return XXX_BAD_FILE_FORMAT;
-
- // Read the version
- Q_INT32 version;
- s >> version;
- if ( version < 100 )
- return XXX_BAD_FILE_TOO_OLD;
- if ( version > 123 )
- return XXX_BAD_FILE_TOO_NEW;
- if ( version <= 110 )
- s.setVersion(1);
-
- // Read the data
- s >> [lots of interesting data];
- if ( version > 120 )
- s >> [data new in XXX version 1.2];
- s >> [other interesting data];
- \endcode
-
- \sa QTextStream QVariant
-*/
-
-
-/*****************************************************************************
- QDataStream member functions
- *****************************************************************************/
-
-#if defined(CHECK_STATE)
-#undef CHECK_STREAM_PRECOND
-#define CHECK_STREAM_PRECOND if ( !dev ) { \
- qWarning( "QDataStream: No device" ); \
- return *this; }
-#else
-#define CHECK_STREAM_PRECOND
-#endif
-
-static int systemWordSize = 0;
-static bool systemBigEndian;
-
-static const int DefaultStreamVersion = 3;
-// 3 is default in Qt 2.1
-// 2 is the Qt 2.0.x format
-// 1 is the Qt 1.x format
-
-/*!
- Constructs a data stream that has no IO device.
-
- \sa setDevice()
-*/
-
-QDataStream::QDataStream()
-{
- if ( systemWordSize == 0 ) // get system features
- qSysInfo( &systemWordSize, &systemBigEndian );
- dev = 0; // no device set
- owndev = FALSE;
- byteorder = BigEndian; // default byte order
- printable = FALSE;
- ver = DefaultStreamVersion;
- noswap = systemBigEndian;
-}
-
-/*!
- Constructs a data stream that uses the IO device \a d.
-
- \sa setDevice(), device()
-*/
-
-QDataStream::QDataStream( QIODevice *d )
-{
- if ( systemWordSize == 0 ) // get system features
- qSysInfo( &systemWordSize, &systemBigEndian );
- dev = d; // set device
- owndev = FALSE;
- byteorder = BigEndian; // default byte order
- printable = FALSE;
- ver = DefaultStreamVersion;
- noswap = systemBigEndian;
-}
-
-/*!
- Constructs a data stream that operates on a byte array through an
- internal QBuffer device.
-
- Example:
- \code
- static char bindata[] = { 231, 1, 44, ... };
- QByteArray a;
- a.setRawData( bindata, sizeof(bindata) ); // a points to bindata
- QDataStream s( a, IO_ReadOnly ); // open on a's data
- s >> [something]; // read raw bindata
- a.resetRawData( bindata, sizeof(bindata) ); // finished
- \endcode
-
- The QArray::setRawData() function is not for the inexperienced.
-*/
-
-QDataStream::QDataStream( QByteArray a, int mode )
-{
- if ( systemWordSize == 0 ) // get system features
- qSysInfo( &systemWordSize, &systemBigEndian );
- dev = new QBuffer( a ); // create device
- ((QBuffer *)dev)->open( mode ); // open device
- owndev = TRUE;
- byteorder = BigEndian; // default byte order
- printable = FALSE;
- ver = DefaultStreamVersion;
- noswap = systemBigEndian;
-}
-
-/*!
- Destructs the data stream.
-
- The destructor will not affect the current IO device, unless it
- is an internal IO device processing a QByteArray passed in the constructor.
-*/
-
-QDataStream::~QDataStream()
-{
- if ( owndev )
- delete dev;
-}
-
-
-/*!
- \fn QIODevice *QDataStream::device() const
- Returns the IO device currently set.
- \sa setDevice(), unsetDevice()
-*/
-
-/*!
- void QDataStream::setDevice(QIODevice *d )
- Sets the IO device to \a d.
- \sa device(), unsetDevice()
-*/
-
-void QDataStream::setDevice(QIODevice *d )
-{
- if ( owndev ) {
- delete dev;
- owndev = FALSE;
- }
- dev = d;
-}
-
-/*!
- Unsets the IO device. This is the same as calling setDevice( 0 ).
- \sa device(), setDevice()
-*/
-
-void QDataStream::unsetDevice()
-{
- setDevice( 0 );
-}
-
-
-/*!
- \fn bool QDataStream::atEnd() const
- Returns TRUE if the IO device has reached the end position (end of
- stream or file) or if there is no IO device set.
-
- Returns FALSE if the current position of the read/write head of the IO
- device is somewhere before the end position.
-
- \sa QIODevice::atEnd()
-*/
-
-/*!\fn bool QDataStream::eof() const
-
- \obsolete
-
- Returns TRUE if the IO device has reached the end position (end of
- stream or file) or if there is no IO device set.
-
- Returns FALSE if the current position of the read/write head of the IO
- device is somewhere before the end position.
-
- \sa QIODevice::atEnd()
-*/
-
-/*!
- \fn int QDataStream::byteOrder() const
- Returns the current byte order setting - either \c BigEndian or
- \c LittleEndian.
-
- \sa setByteOrder()
-*/
-
-/*!
- Sets the serialization byte order to \a bo.
-
- The \a bo parameter can be \c QDataStream::BigEndian or
- \c QDataStream::LittleEndian.
-
- The default setting is big endian. We recommend leaving this setting unless
- you have special requirements.
-
- \sa byteOrder()
-*/
-
-void QDataStream::setByteOrder( int bo )
-{
- byteorder = bo;
- if ( systemBigEndian )
- noswap = byteorder == BigEndian;
- else
- noswap = byteorder == LittleEndian;
-}
-
-
-/*!
- \fn bool QDataStream::isPrintableData() const
- Returns TRUE if the printable data flag has been set.
- \sa setPrintableData()
-*/
-
-/*!
- \fn void QDataStream::setPrintableData( bool enable )
- Sets or clears the printable data flag.
-
- If this flag is set, the write functions will generate output that
- consists of printable characters (7 bit ASCII).
-
- We recommend enabling printable data only for debugging purposes
- (it is slower and creates larger output).
-*/
-
-
-/*!
- \fn int QDataStream::version() const
- Returns the version number of the data serialization format.
- In Qt 2.1, this number is by default 3.
- \sa setVersion()
-*/
-
-/*!
- \fn void QDataStream::setVersion( int v )
- Sets the version number of the data serialization format.
-
- In order to accommodate for new functionality, the datastream
- serialization format of some Qt classes has changed in some versions of
- Qt. If you want to read data that was created by an earlier version of
- Qt, or write data that can be read by a program that was compiled with
- an earlier version of Qt, use this function to modify the serialization
- format of QDataStream.
-
- For Qt 1.x compatibility, use \a v == 1.
-
- For Qt 2.0.x compatibility, use \a v == 2 (Not required for reading in
- Qt 2.1).
-
- \sa version()
-*/
-
-/*****************************************************************************
- QDataStream read functions
- *****************************************************************************/
-
-
-static Q_INT32 read_int_ascii( QDataStream *s )
-{
- int n = 0;
- char buf[40];
- while ( TRUE ) {
- buf[n] = s->device()->getch();
- if ( buf[n] == '\n' || n > 38 ) // $-terminator
- break;
- n++;
- }
- buf[n] = '\0';
- return (Q_INT32)atol( buf );
-}
-
-
-/*!
- \fn QDataStream &QDataStream::operator>>( Q_UINT8 &i )
- Reads an unsigned byte from the stream and returns a reference to
- the stream.
-*/
-
-/*!
- Reads a signed byte from the stream.
-*/
-
-QDataStream &QDataStream::operator>>( Q_INT8 &i )
-{
- CHECK_STREAM_PRECOND
- if ( printable ) { // printable data
- i = (Q_INT8)dev->getch();
- if ( i == '\\' ) { // read octal code
- char buf[4];
- dev->readBlock( buf, 3 );
- i = (buf[2] & 0x07)+((buf[1] & 0x07) << 3)+((buf[0] & 0x07) << 6);
- }
- } else { // data or text
- i = (Q_INT8)dev->getch();
- }
- return *this;
-}
-
-
-/*!
- \fn QDataStream &QDataStream::operator>>( Q_UINT16 &i )
- Reads an unsigned 16-bit integer from the stream and returns a reference to
- the stream.
-*/
-
-/*!
- Reads a signed 16-bit integer from the stream and returns a reference to
- the stream.
-*/
-
-QDataStream &QDataStream::operator>>( Q_INT16 &i )
-{
- CHECK_STREAM_PRECOND
- if ( printable ) { // printable data
- i = (Q_INT16)read_int_ascii( this );
- } else if ( noswap ) { // no conversion needed
- dev->readBlock( (char *)&i, sizeof(Q_INT16) );
- } else { // swap bytes
- uchar *p = (uchar *)(&i);
- char b[2];
- dev->readBlock( b, 2 );
- *p++ = b[1];
- *p = b[0];
- }
- return *this;
-}
-
-
-/*!
- \fn QDataStream &QDataStream::operator>>( Q_UINT32 &i )
- Reads an unsigned 32-bit integer from the stream and returns a reference to
- the stream.
-*/
-
-/*!
- Reads a signed 32-bit integer from the stream and returns a reference to
- the stream.
-*/
-
-QDataStream &QDataStream::operator>>( Q_INT32 &i )
-{
- CHECK_STREAM_PRECOND
- if ( printable ) { // printable data
- i = read_int_ascii( this );
- } else if ( noswap ) { // no conversion needed
- dev->readBlock( (char *)&i, sizeof(Q_INT32) );
- } else { // swap bytes
- uchar *p = (uchar *)(&i);
- char b[4];
- dev->readBlock( b, 4 );
- *p++ = b[3];
- *p++ = b[2];
- *p++ = b[1];
- *p = b[0];
- }
- return *this;
-}
-
-/*!
- \fn QDataStream &QDataStream::operator>>( Q_UINT64 &i )
- Reads an unsigned 64-bit integer from the stream and returns a reference to
- the stream, or uses the Q_UINT32 operator if 64 bit is not available.
-*/
-
-/*!
- Reads a signed 64-bit integer from the stream and returns a reference to
- the stream, or uses the Q_UINT32 operator if 64 bit is not available.
-*/
-
-QDataStream &QDataStream::operator>>( Q_INT64 &i )
-{
- CHECK_STREAM_PRECOND
- if ( printable ) { // printable data
- i = read_int_ascii( this );
- } else if ( noswap ) { // no conversion needed
- dev->readBlock( (char *)&i, sizeof(Q_INT64) );
- } else { // swap bytes
- uchar *p = (uchar *)(&i);
- char b[sizeof(Q_INT64)];
- dev->readBlock( b, sizeof(Q_INT64) );
- if ( sizeof(Q_INT64) == 8 ) {
- *p++ = b[7];
- *p++ = b[6];
- *p++ = b[5];
- *p++ = b[4];
- }
- *p++ = b[3];
- *p++ = b[2];
- *p++ = b[1];
- *p = b[0];
- }
- return *this;
-}
-
-static double read_double_ascii( QDataStream *s )
-{
- int n = 0;
- char buf[80];
- while ( TRUE ) {
- buf[n] = s->device()->getch();
- if ( buf[n] == '\n' || n > 78 ) // $-terminator
- break;
- n++;
- }
- buf[n] = '\0';
- return atof( buf );
-}
-
-
-/*!
- Reads a 32-bit floating point number from the stream using the standard
- IEEE754 format. Returns a reference to the stream.
-*/
-
-QDataStream &QDataStream::operator>>( float &f )
-{
- CHECK_STREAM_PRECOND
- if ( printable ) { // printable data
- f = (float)read_double_ascii( this );
- } else if ( noswap ) { // no conversion needed
- dev->readBlock( (char *)&f, sizeof(float) );
- } else { // swap bytes
- uchar *p = (uchar *)(&f);
- char b[4];
- dev->readBlock( b, 4 );
- *p++ = b[3];
- *p++ = b[2];
- *p++ = b[1];
- *p = b[0];
- }
- return *this;
-}
-
-
-/*!
- Reads a 64-bit floating point number from the stream using the standard
- IEEE754 format. Returns a reference to the stream.
-*/
-
-QDataStream &QDataStream::operator>>( double &f )
-{
- CHECK_STREAM_PRECOND
- if ( printable ) { // printable data
- f = read_double_ascii( this );
- } else if ( noswap ) { // no conversion needed
- dev->readBlock( (char *)&f, sizeof(double) );
- } else { // swap bytes
- uchar *p = (uchar *)(&f);
- char b[8];
- dev->readBlock( b, 8 );
- *p++ = b[7];
- *p++ = b[6];
- *p++ = b[5];
- *p++ = b[4];
- *p++ = b[3];
- *p++ = b[2];
- *p++ = b[1];
- *p = b[0];
- }
- return *this;
-}
-
-
-/*!
- Reads the '\0'-terminated string \a s from the stream and returns
- a reference to the stream.
-
- Space for the string is allocated using \c new - the caller must
- eventually call delete[] on the value.
-*/
-
-QDataStream &QDataStream::operator>>( char *&s )
-{
- uint len = 0;
- return readBytes( s, len );
-}
-
-
-/*!
- Reads the buffer \a s from the stream and returns a reference to the
- stream.
-
- The buffer \a s is allocated using \c new. Destroy it with the \c delete[]
- operator. If the length is zero or \a s cannot be allocated, \a s is
- set to 0.
-
- The \a l parameter will be set to the length of the buffer.
-
- The serialization format is an Q_UINT32 length specifier first, then the
- data (\a l bytes).
-
- \sa readRawBytes(), writeBytes()
-*/
-
-QDataStream &QDataStream::readBytes( char *&s, uint &l )
-{
- CHECK_STREAM_PRECOND
- Q_UINT32 len;
- *this >> len; // first read length spec
- l = (uint)len;
- if ( len == 0 || eof() ) {
- s = 0;
- return *this;
- } else {
- s = new char[len]; // create char array
- CHECK_PTR( s );
- if ( !s ) // no memory
- return *this;
- return readRawBytes( s, (uint)len );
- }
-}
-
-
-/*!
- Reads \a len bytes from the stream into \a s and returns a reference to
- the stream.
-
- The buffer \a s must be preallocated.
-
- \sa readBytes(), QIODevice::readBlock(), writeRawBytes()
-*/
-
-QDataStream &QDataStream::readRawBytes( char *s, uint len )
-{
- CHECK_STREAM_PRECOND
- if ( printable ) { // printable data
- Q_INT8 *p = (Q_INT8*)s;
- while ( len-- )
- *this >> *p++;
- } else { // read data char array
- dev->readBlock( s, len );
- }
- return *this;
-}
-
-
-/*****************************************************************************
- QDataStream write functions
- *****************************************************************************/
-
-
-/*!
- \fn QDataStream &QDataStream::operator<<( Q_UINT8 i )
- Writes an unsigned byte to the stream and returns a reference to
- the stream.
-*/
-
-/*!
- Writes a signed byte to the stream.
-*/
-
-QDataStream &QDataStream::operator<<( Q_INT8 i )
-{
- CHECK_STREAM_PRECOND
- if ( printable && (i == '\\' || !isprint(i)) ) {
- char buf[6]; // write octal code
- buf[0] = '\\';
- buf[1] = '0' + ((i >> 6) & 0x07);
- buf[2] = '0' + ((i >> 3) & 0x07);
- buf[3] = '0' + (i & 0x07);
- buf[4] = '\0';
- dev->writeBlock( buf, 4 );
- } else {
- dev->putch( i );
- }
- return *this;
-}
-
-
-/*!
- \fn QDataStream &QDataStream::operator<<( Q_UINT16 i )
- Writes an unsigned 16-bit integer to the stream and returns a reference
- to the stream.
-*/
-
-/*!
- Writes a signed 16-bit integer to the stream and returns a reference to
- the stream.
-*/
-
-QDataStream &QDataStream::operator<<( Q_INT16 i )
-{
- CHECK_STREAM_PRECOND
- if ( printable ) { // printable data
- char buf[16];
- sprintf( buf, "%d\n", i );
- dev->writeBlock( buf, (int)strlen(buf) );
- } else if ( noswap ) { // no conversion needed
- dev->writeBlock( (char *)&i, sizeof(Q_INT16) );
- } else { // swap bytes
- uchar *p = (uchar *)(&i);
- char b[2];
- b[1] = *p++;
- b[0] = *p;
- dev->writeBlock( b, 2 );
- }
- return *this;
-}
-
-
-/*!
- \fn QDataStream &QDataStream::operator<<( Q_UINT32 i )
- Writes an unsigned 32-bit integer to the stream and returns a reference to
- the stream.
-*/
-
-/*!
- Writes a signed 32-bit integer to the stream and returns a reference to
- the stream.
-*/
-
-QDataStream &QDataStream::operator<<( Q_INT32 i )
-{
- CHECK_STREAM_PRECOND
- if ( printable ) { // printable data
- char buf[16];
- sprintf( buf, "%d\n", i );
- dev->writeBlock( buf, (int)strlen(buf) );
- } else if ( noswap ) { // no conversion needed
- dev->writeBlock( (char *)&i, sizeof(Q_INT32) );
- } else { // swap bytes
- uchar *p = (uchar *)(&i);
- char b[4];
- b[3] = *p++;
- b[2] = *p++;
- b[1] = *p++;
- b[0] = *p;
- dev->writeBlock( b, 4 );
- }
- return *this;
-}
-
-/*!
- \fn QDataStream &QDataStream::operator<<( Q_UINT64 i )
- Writes an unsigned 64-bit integer to the stream and returns a reference to
- the stream, or uses the Q_UINT32-operator if 64 bit is not available.
-*/
-
-/*!
- Writes a signed 64-bit integer to the stream and returns a reference to
- the stream, or calls the Q_INT32-operator if 64 bit is not available.
-*/
-
-QDataStream &QDataStream::operator<<( Q_INT64 i )
-{
- CHECK_STREAM_PRECOND
- if ( printable ) { // printable data
- char buf[20];
- sprintf( buf, "%ld\n", i );
- dev->writeBlock( buf, (int)strlen(buf) );
- } else if ( noswap ) { // no conversion needed
- dev->writeBlock( (char *)&i, sizeof(Q_INT64) );
- } else { // swap bytes
- uchar *p = (uchar *)(&i);
- char b[sizeof(Q_INT64)];
- if ( sizeof(Q_INT64) == 8 ) {
- b[7] = *p++;
- b[6] = *p++;
- b[5] = *p++;
- b[4] = *p++;
- }
- b[3] = *p++;
- b[2] = *p++;
- b[1] = *p++;
- b[0] = *p;
- dev->writeBlock( b, sizeof(Q_INT64) );
- }
- return *this;
-}
-
-/*!
- \fn QDataStream &QDataStream::operator<<( int i )
- Writes a signed integer to the stream as a 32-bit signed integer (Q_INT32).
- Returns a reference to the stream.
-*/
-
-
-/*!
- Writes a 32-bit floating point number to the stream using the standard
- IEEE754 format. Returns a reference to the stream.
-*/
-
-QDataStream &QDataStream::operator<<( float f )
-{
- CHECK_STREAM_PRECOND
- if ( printable ) { // printable data
- char buf[32];
- sprintf( buf, "%g\n", (double)f );
- dev->writeBlock( buf, (int)strlen(buf) );
- } else {
- float g = f; // fixes float-on-stack problem
- if ( noswap ) { // no conversion needed
- dev->writeBlock( (char *)&g, sizeof(float) );
- } else { // swap bytes
- uchar *p = (uchar *)(&g);
- char b[4];
- b[3] = *p++;
- b[2] = *p++;
- b[1] = *p++;
- b[0] = *p;
- dev->writeBlock( b, 4 );
- }
- }
- return *this;
-}
-
-
-/*!
- Writes a 64-bit floating point number to the stream using the standard
- IEEE754 format. Returns a reference to the stream.
-*/
-
-QDataStream &QDataStream::operator<<( double f )
-{
- CHECK_STREAM_PRECOND
- if ( printable ) { // printable data
- char buf[32];
- sprintf( buf, "%g\n", f );
- dev->writeBlock( buf, (int)strlen(buf) );
- } else if ( noswap ) { // no conversion needed
- dev->writeBlock( (char *)&f, sizeof(double) );
- } else { // swap bytes
- uchar *p = (uchar *)(&f);
- char b[8];
- b[7] = *p++;
- b[6] = *p++;
- b[5] = *p++;
- b[4] = *p++;
- b[3] = *p++;
- b[2] = *p++;
- b[1] = *p++;
- b[0] = *p;
- dev->writeBlock( b, 8 );
- }
- return *this;
-}
-
-
-/*!
- Writes the '\0'-terminated string \a s to the stream and returns
- a reference to the stream.
-
- The string is serialized using writeBytes().
-*/
-
-QDataStream &QDataStream::operator<<( const char *s )
-{
- if ( !s ) {
- *this << (Q_UINT32)0;
- return *this;
- }
- uint len = qstrlen( s ) + 1; // also write null terminator
- *this << (Q_UINT32)len; // write length specifier
- return writeRawBytes( s, len );
-}
-
-
-/*!
- Writes the length specifier \a len and the buffer \a s to the stream and
- returns a reference to the stream.
-
- The \a len is serialized as an Q_UINT32, followed by \a len bytes from
- \a s.
-
- \sa writeRawBytes(), readBytes()
-*/
-
-QDataStream &QDataStream::writeBytes(const char *s, uint len)
-{
- CHECK_STREAM_PRECOND
- *this << (Q_UINT32)len; // write length specifier
- if ( len )
- writeRawBytes( s, len );
- return *this;
-}
-
-
-/*!
- Writes \a len bytes from \a s to the stream and returns a reference to the
- stream.
-
- \sa writeBytes(), QIODevice::writeBlock(), readRawBytes()
-*/
-
-QDataStream &QDataStream::writeRawBytes( const char *s, uint len )
-{
- CHECK_STREAM_PRECOND
- if ( printable ) { // write printable
- char *p = (char *)s;
- while ( len-- )
- *this << *p++;
- } else { // write data char array
- dev->writeBlock( s, len );
- }
- return *this;
-}
-
-#endif // QT_NO_DATASTREAM
diff --git a/qtools/qdatastream.h b/qtools/qdatastream.h
deleted file mode 100644
index 3d18062..0000000
--- a/qtools/qdatastream.h
+++ /dev/null
@@ -1,173 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QDataStream class
-**
-** Created : 930831
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QDATASTREAM_H
-#define QDATASTREAM_H
-
-#ifndef QT_H
-#include "qiodevice.h"
-#include "qstring.h"
-#endif // QT_H
-
-#ifndef QT_NO_DATASTREAM
-class Q_EXPORT QDataStream // data stream class
-{
-public:
- QDataStream();
- QDataStream( QIODevice * );
- QDataStream( QByteArray, int mode );
- virtual ~QDataStream();
-
- QIODevice *device() const;
- void setDevice( QIODevice * );
- void unsetDevice();
-
- bool atEnd() const;
- bool eof() const;
-
- enum ByteOrder { BigEndian, LittleEndian };
- int byteOrder() const;
- void setByteOrder( int );
-
- bool isPrintableData() const;
- void setPrintableData( bool );
-
- int version() const;
- void setVersion( int );
-
- QDataStream &operator>>( Q_INT8 &i );
- QDataStream &operator>>( Q_UINT8 &i );
- QDataStream &operator>>( Q_INT16 &i );
- QDataStream &operator>>( Q_UINT16 &i );
- QDataStream &operator>>( Q_INT32 &i );
- QDataStream &operator>>( Q_UINT32 &i );
- QDataStream &operator>>( Q_INT64 &i );
- QDataStream &operator>>( Q_UINT64 &i );
-
- QDataStream &operator>>( float &f );
- QDataStream &operator>>( double &f );
- QDataStream &operator>>( char *&str );
-
- QDataStream &operator<<( Q_INT8 i );
- QDataStream &operator<<( Q_UINT8 i );
- QDataStream &operator<<( Q_INT16 i );
- QDataStream &operator<<( Q_UINT16 i );
- QDataStream &operator<<( Q_INT32 i );
- QDataStream &operator<<( Q_UINT32 i );
- QDataStream &operator<<( Q_INT64 i );
- QDataStream &operator<<( Q_UINT64 i );
- QDataStream &operator<<( float f );
- QDataStream &operator<<( double f );
- QDataStream &operator<<( const char *str );
-
- QDataStream &readBytes( char *&, uint &len );
- QDataStream &readRawBytes( char *, uint len );
-
- QDataStream &writeBytes( const char *, uint len );
- QDataStream &writeRawBytes( const char *, uint len );
-
-private:
- QIODevice *dev;
- bool owndev;
- int byteorder;
- bool printable;
- bool noswap;
- int ver;
-
-private: // Disabled copy constructor and operator=
-#if defined(Q_DISABLE_COPY)
- QDataStream( const QDataStream & );
- QDataStream &operator=( const QDataStream & );
-#endif
-};
-
-
-/*****************************************************************************
- QDataStream inline functions
- *****************************************************************************/
-
-inline QIODevice *QDataStream::device() const
-{ return dev; }
-
-inline bool QDataStream::atEnd() const
-{ return dev ? dev->atEnd() : TRUE; }
-
-inline bool QDataStream::eof() const
-{ return atEnd(); }
-
-inline int QDataStream::byteOrder() const
-{ return byteorder; }
-
-inline bool QDataStream::isPrintableData() const
-{ return printable; }
-
-inline void QDataStream::setPrintableData( bool p )
-{ printable = p; }
-
-inline int QDataStream::version() const
-{ return ver; }
-
-inline void QDataStream::setVersion( int v )
-{ ver = v; }
-
-inline QDataStream &QDataStream::operator>>( Q_UINT8 &i )
-{ return *this >> (Q_INT8&)i; }
-
-inline QDataStream &QDataStream::operator>>( Q_UINT16 &i )
-{ return *this >> (Q_INT16&)i; }
-
-inline QDataStream &QDataStream::operator>>( Q_UINT32 &i )
-{ return *this >> (Q_INT32&)i; }
-
-inline QDataStream &QDataStream::operator>>( Q_UINT64 &i )
-{ return *this >> (Q_INT64&)i; }
-
-inline QDataStream &QDataStream::operator<<( Q_UINT8 i )
-{ return *this << (Q_INT8)i; }
-
-inline QDataStream &QDataStream::operator<<( Q_UINT16 i )
-{ return *this << (Q_INT16)i; }
-
-inline QDataStream &QDataStream::operator<<( Q_UINT32 i )
-{ return *this << (Q_INT32)i; }
-
-inline QDataStream &QDataStream::operator<<( Q_UINT64 i )
-{ return *this << (Q_INT64)i; }
-
-
-#endif // QT_NO_DATASTREAM
-#endif // QDATASTREAM_H
diff --git a/qtools/qdatetime.cpp b/qtools/qdatetime.cpp
deleted file mode 100644
index 8f1cab2..0000000
--- a/qtools/qdatetime.cpp
+++ /dev/null
@@ -1,1455 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of date and time classes
-**
-** Created : 940124
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#define gettimeofday __hide_gettimeofday
-#include "qdatetime.h"
-#include "qdatastream.h"
-#include <stdio.h>
-#include <time.h>
-#if defined(_OS_WIN32_)
-#if defined(_CC_BOOL_DEF_)
-#undef bool
-#include <windows.h>
-#define bool int
-#else
-#include <windows.h>
-#endif
-#elif defined(_OS_MSDOS_)
-#include <dos.h>
-#elif defined(_OS_OS2_)
-#include <os2.h>
-#elif defined(_OS_UNIX_) || defined(_OS_MAC_)
-#include <sys/time.h>
-#include <unistd.h>
-#undef gettimeofday
-extern "C" int gettimeofday( struct timeval *, struct timezone * );
-#endif
-
-static const uint FIRST_DAY = 2361222; // Julian day for 1752/09/14
-static const int FIRST_YEAR = 1752; // ### wrong for many countries
-static const uint SECS_PER_DAY = 86400;
-static const uint MSECS_PER_DAY = 86400000;
-static const uint SECS_PER_HOUR = 3600;
-static const uint MSECS_PER_HOUR= 3600000;
-static const uint SECS_PER_MIN = 60;
-static const uint MSECS_PER_MIN = 60000;
-
-static const short monthDays[] ={0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
-
-// ##### Localize.
-
-const char * const QDate::monthNames[] = {
- "Jan", "Feb", "Mar", "Apr", "May", "Jun",
- "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
-
-const char * const QDate::weekdayNames[] ={
- "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" };
-
-
-/*****************************************************************************
- QDate member functions
- *****************************************************************************/
-
-// REVISED: aavit
-
-/*!
- \class QDate qdatetime.h
- \brief The QDate class provides date functions.
-
- \ingroup time
-
- A QDate object contains a calendar date, i.e. year, month, and day
- numbers in the modern western (Gregorian) calendar. It can read the
- current date from the system clock. It provides functions for
- comparing dates and for manipulating a date by adding a number of
- days.
-
- A QDate object is typically created either by giving the year, month
- and day numbers explicitly, or by using the static function
- currentDate(), which makes a QDate object which contains the
- system's clock date. An explicit date can also be set using
- setYMD().
-
- The year(), month(), and day() functions provide access to the year,
- month, and day numbers. Also, dayOfWeek() and dayOfYear() functions
- are provided. The same information is provided in textual format by
- the toString(), dayName(), and monthName() functions.
-
- QDate provides a full set of operators to compare two QDate
- objects. A date is considered smaller than another if it is earlier
- than the other.
-
- The date a given number of days later than a given date can be found
- using the addDays() function. Correspondingly, the number of days
- between two dates can be found using the daysTo() function.
-
- The daysInMonth() and daysInYear() functions tell how many days
- there are in this date's month and year, respectively. The
- isLeapYear() function tells whether this date is in a leap year.
-
- Note that QDate may not be used for date calculations for dates in
- the remote past, i.e. prior to the introduction of the Gregorian
- calendar. This calendar was adopted by England Sep. 14. 1752 (hence
- this is the earliest valid QDate), and subsequently by most other
- western countries, until 1923.
-
- The end of time is reached around 8000AD, by which time we expect Qt
- to be obsolete.
-
- \sa QTime, QDateTime
-*/
-
-
-/*!
- \fn QDate::QDate()
- Constructs a null date. Null dates are invalid.
-
- \sa isNull(), isValid()
-*/
-
-
-/*!
- Constructs a date with the year \a y, month \a m and day \a d.
-
- \a y must be in the range 1752-ca. 8000, \a m must be in the range
- 1-12, and \a d must be in the range 1-31. Exception: if \a y is in
- the range 0-99, it is interpreted as 1900-1999.
-
- \sa isValid()
-*/
-
-QDate::QDate( int y, int m, int d )
-{
- jd = 0;
- setYMD( y, m, d );
-}
-
-
-/*!
- \fn bool QDate::isNull() const
-
- Returns TRUE if the date is null. A null date is invalid.
-
- \sa isValid()
-*/
-
-
-/*!
- Returns TRUE if this date is valid.
-
- \sa isNull()
-*/
-
-bool QDate::isValid() const
-{
- return jd >= FIRST_DAY;
-}
-
-
-/*!
- Returns the year (>= 1752) of this date.
-
- \sa month(), day()
-*/
-
-int QDate::year() const
-{
- int y, m, d;
- jul2greg( jd, y, m, d );
- return y;
-}
-
-/*!
- Returns the month (January=1 .. December=12) of this date.
-
- \sa year(), day()
-*/
-
-int QDate::month() const
-{
- int y, m, d;
- jul2greg( jd, y, m, d );
- return m;
-}
-
-/*!
- Returns the day of the month (1..31) of this date.
-
- \sa year(), month(), dayOfWeek()
-*/
-
-int QDate::day() const
-{
- int y, m, d;
- jul2greg( jd, y, m, d );
- return d;
-}
-
-/*!
- Returns the weekday (Monday=1 .. Sunday=7) for this date.
-
- \sa day(), dayOfYear()
-*/
-
-int QDate::dayOfWeek() const
-{
- return (((jd+1) % 7) + 6)%7 + 1;
-}
-
-/*!
- Returns the day of the year (1..365) for this date.
-
- \sa day(), dayOfWeek()
-*/
-
-int QDate::dayOfYear() const
-{
- return jd - greg2jul(year(), 1, 1) + 1;
-}
-
-/*!
- Returns the number of days in the month (28..31) for this date.
-
- \sa day(), daysInYear()
-*/
-
-int QDate::daysInMonth() const
-{
- int y, m, d;
- jul2greg( jd, y, m, d );
- if ( m == 2 && leapYear(y) )
- return 29;
- else
- return monthDays[m];
-}
-
-/*!
- Returns the number of days in the year (365 or 366) for this date.
-
- \sa day(), daysInMonth()
-*/
-
-int QDate::daysInYear() const
-{
- int y, m, d;
- jul2greg( jd, y, m, d );
- return leapYear(y) ? 366 : 365;
-}
-
-
-/*!
- Returns the name of the \a month.
-
- Month 1 == "Jan", month 2 == "Feb" etc.
-
- \sa toString(), dayName()
-*/
-
-QCString QDate::monthName( int month ) const
-{
-#if defined(CHECK_RANGE)
- if ( month < 1 || month > 12 ) {
- qWarning( "QDate::monthName: Parameter out ouf range." );
- month = 1;
- }
-#endif
- return monthNames[month-1];
-}
-
-/*!
- Returns the name of the \a weekday.
-
- Weekday 1 == "Mon", day 2 == "Tue" etc.
-
- \sa toString(), monthName()
-*/
-
-QCString QDate::dayName( int weekday ) const
-{
-#if defined(CHECK_RANGE)
- if ( weekday < 1 || weekday > 7 ) {
- qWarning( "QDate::dayName: Parameter out of range." );
- weekday = 1;
- }
-#endif
- return weekdayNames[weekday-1];
-}
-
-
-/*!
- Returns the date as a string.
-
- The string format is "Sat May 20 1995". This function uses the
- dayName() and monthName() functions to generate the string.
-
- \sa dayName(), monthName()
-*/
-
-QCString QDate::toString() const
-{
- int y, m, d;
- jul2greg( jd, y, m, d );
- QCString buf = dayName(dayOfWeek());
- buf += ' ';
- buf += monthName(m);
- QCString t;
- t.sprintf( " %d %d", d, y);
- buf += t;
- return buf;
-}
-
-
-/*!
- Sets the year \a y, month \a m and day \a d.
-
- \a y must be in the range 1752-ca. 8000, \a m must be in the range
- 1-12, and \a d must be in the range 1-31. Exception: if \a y is in
- the range 0-99, it is interpreted as 1900-1999.
-
- Returns TRUE if the date is valid, otherwise FALSE.
-*/
-
-bool QDate::setYMD( int y, int m, int d )
-{
- if ( !isValid(y,m,d) ) {
-#if defined(CHECK_RANGE)
- qWarning( "QDate::setYMD: Invalid date %04d/%02d/%02d", y, m, d );
-#endif
- return FALSE;
- }
- jd = greg2jul( y, m, d );
-#if defined(DEBUG)
- ASSERT( year() == (y > 99 ? y : 1900+y) && month() == m && day() == d );
-#endif
- return TRUE;
-}
-
-/*!
- Returns a QDate object containing a date \a ndays later than the
- date of this object (or earlier if \a ndays is negative).
-
- \sa daysTo()
-*/
-
-QDate QDate::addDays( int ndays ) const
-{
- QDate d;
- d.jd = jd + ndays;
- return d;
-}
-
-/*!
- Returns the number of days from this date to \a d (which is negative
- if \a d is earlier than this date).
-
- Example:
- \code
- QDate d1( 1995, 5, 17 ); // May 17th 1995
- QDate d2( 1995, 5, 20 ); // May 20th 1995
- d1.daysTo( d2 ); // returns 3
- d2.daysTo( d1 ); // returns -3
- \endcode
-
- \sa addDays()
-*/
-
-int QDate::daysTo( const QDate &d ) const
-{
- return d.jd - jd;
-}
-
-
-/*!
- \fn bool QDate::operator==( const QDate &d ) const
- Returns TRUE if this date is equal to \a d, or FALSE if
- they are different.
-*/
-
-/*!
- \fn bool QDate::operator!=( const QDate &d ) const
- Returns TRUE if this date is different from \a d, or FALSE if
- they are equal.
-*/
-
-/*!
- \fn bool QDate::operator<( const QDate &d ) const
- Returns TRUE if this date is earlier than \a d, otherwise FALSE.
-*/
-
-/*!
- \fn bool QDate::operator<=( const QDate &d ) const
- Returns TRUE if this date is earlier than or equal to \a d, otherwise FALSE.
-*/
-
-/*!
- \fn bool QDate::operator>( const QDate &d ) const
- Returns TRUE if this date is later than \a d, otherwise FALSE.
-*/
-
-/*!
- \fn bool QDate::operator>=( const QDate &d ) const
- Returns TRUE if this date is later than or equal to \a d, otherwise FALSE.
-*/
-
-
-/*!
- Returns the current date, as reported by the system clock.
-
- \sa QTime::currentTime(), QDateTime::currentDateTime()
-*/
-
-QDate QDate::currentDate()
-{
-#if defined(_OS_WIN32_)
-
- SYSTEMTIME t;
- GetLocalTime( &t );
- QDate d;
- d.jd = greg2jul( t.wYear, t.wMonth, t.wDay );
- return d;
-
-#else
-
- time_t ltime;
- time( &ltime );
- tm *t = localtime( &ltime );
- QDate d;
- d.jd = greg2jul( t->tm_year + 1900, t->tm_mon + 1, t->tm_mday );
- return d;
-
-#endif
-}
-
-/*!
- Returns TRUE if the specified date (year \a y, month \a m and day \a
- d) is valid.
-
- Example:
- \code
- QDate::isValid( 2002, 5, 17 ); // TRUE; May 17th 2002 is OK.
- QDate::isValid( 2002, 2, 30 ); // FALSE; Feb 30th does not exist
- QDate::isValid( 2004, 2, 29 ); // TRUE; 2004 is a leap year
- QDate::isValid( 1202, 6, 6 ); // FALSE; 1202 is pre-Gregorian
- \endcode
-
- Note that a \a y value in the range 00-99 is interpreted as
- 1900-1999.
-
- \sa isNull(), setYMD()
-*/
-
-bool QDate::isValid( int y, int m, int d )
-{
- if ( y >= 0 && y <= 99 )
- y += 1900;
- else if ( y < FIRST_YEAR || (y == FIRST_YEAR && (m < 9 ||
- (m == 9 && d < 14))) )
- return FALSE;
- return (d > 0 && m > 0 && m <= 12) &&
- (d <= monthDays[m] || (d == 29 && m == 2 && leapYear(y)));
-}
-
-/*!
- Returns TRUE if the specified year \a y is a leap year.
-*/
-
-bool QDate::leapYear( int y )
-{
- return (y % 4 == 0 && y % 100 != 0) || (y % 400 == 0);
-}
-
-/*!
- \internal
- Converts a Gregorian date to a Julian day.
- This algorithm is taken from Communications of the ACM, Vol 6, No 8.
- \sa jul2greg()
-*/
-
-uint QDate::greg2jul( int y, int m, int d )
-{
- uint c, ya;
- if ( y <= 99 )
- y += 1900;
- if ( m > 2 ) {
- m -= 3;
- } else {
- m += 9;
- y--;
- }
- c = y; // NOTE: Sym C++ 6.0 bug
- c /= 100;
- ya = y - 100*c;
- return 1721119 + d + (146097*c)/4 + (1461*ya)/4 + (153*m+2)/5;
-}
-
-/*!
- \internal
- Converts a Julian day to a Gregorian date.
- This algorithm is taken from Communications of the ACM, Vol 6, No 8.
- \sa greg2jul()
-*/
-
-void QDate::jul2greg( uint jd, int &y, int &m, int &d )
-{
- uint x;
- uint j = jd - 1721119;
- y = (j*4 - 1)/146097;
- j = j*4 - 146097*y - 1;
- x = j/4;
- j = (x*4 + 3) / 1461;
- y = 100*y + j;
- x = (x*4) + 3 - 1461*j;
- x = (x + 4)/4;
- m = (5*x - 3)/153;
- x = 5*x - 3 - 153*m;
- d = (x + 5)/5;
- if ( m < 10 ) {
- m += 3;
- } else {
- m -= 9;
- y++;
- }
-}
-
-
-/*****************************************************************************
- QTime member functions
- *****************************************************************************/
-
-/*!
- \class QTime qdatetime.h
-
- \brief The QTime class provides clock time functions.
-
- \ingroup time
-
- A QTime object contains a clock time, i.e. a number of hours,
- minutes, seconds and milliseconds since midnight. It can read the
- current time from the system clock, and measure a span of elapsed
- time. It provides functions for comparing times and for manipulating
- a time by adding a number of (milli)seconds.
-
- QTime operates with 24-hour clock format; it has no concept of
- AM/PM. It operates with local time; it does not know anything about
- time zones or daylight savings time.
-
- A QTime object is typically created either by giving the number of
- hours, minutes, seconds, and milliseconds explicitly, or by using
- the static function currentTime(), which makes a QTime object which
- contains the system's clock time. Note that the accuracy depends on
- the accuracy of the underlying operating system; not all systems
- provide 1-millisecond accuracy.
-
- The hour(), minute(), second(), and msec() functions provide access
- to the number of hours, minutes, seconds, and milliseconds of the
- time. The same information is provided in textual format by the
- toString() function.
-
- QTime provides a full set of operators to compare two QTime
- objects. A time is considered smaller than another if it is earlier
- than the other.
-
- The time a given number of seconds or milliseconds later than a
- given time can be found using the addSecs() or addMSecs()
- functions. Correspondingly, the number of (milli)seconds between two
- times can be found using the secsTo() or msecsTo() functions.
-
- QTime can be used to measure a span of elapsed time using the
- start(), restart(), and elapsed() functions.
-
- \sa QDate, QDateTime
-*/
-
-/*!
- \fn QTime::QTime()
-
- Constructs the time 0 hours, minutes, seconds and milliseconds,
- i.e. 00:00:00.000 (midnight). This is a valid time.
-
- \sa isValid()
-*/
-
-/*!
- Constructs a time with hour \a h, minute \a m, seconds \a s and
- milliseconds \a ms.
-
- \a h must be in the range 0-23, \a m and \a s must be in the range
- 0-59, and \a ms must be in the range 0-999.
-
- \sa isValid()
-*/
-
-QTime::QTime( int h, int m, int s, int ms )
-{
- setHMS( h, m, s, ms );
-}
-
-
-/*!
- \fn bool QTime::isNull() const
- Returns TRUE if the time is equal to 00:00:00.000. A null time is valid.
-
- \sa isValid()
-*/
-
-/*!
- Returns TRUE if the time is valid, or FALSE if the time is invalid.
- The time 23:30:55.746 is valid, while 24:12:30 is invalid.
-
- \sa isNull()
-*/
-
-bool QTime::isValid() const
-{
- return ds < MSECS_PER_DAY;
-}
-
-
-/*!
- Returns the hour part (0..23) of the time.
-*/
-
-int QTime::hour() const
-{
- return ds / MSECS_PER_HOUR;
-}
-
-/*!
- Returns the minute part (0..59) of the time.
-*/
-
-int QTime::minute() const
-{
- return (ds % MSECS_PER_HOUR)/MSECS_PER_MIN;
-}
-
-/*!
- Returns the second part (0..59) of the time.
-*/
-
-int QTime::second() const
-{
- return (ds / 1000)%SECS_PER_MIN;
-}
-
-/*!
- Returns the millisecond part (0..999) of the time.
-*/
-
-int QTime::msec() const
-{
- return ds % 1000;
-}
-
-
-/*!
- Returns the time of this object in a textual format. Milliseconds
- are not included. The string format is HH:MM:SS, e.g. 1 second
- before midnight would be "23:59:59".
-*/
-
-QCString QTime::toString() const
-{
- QCString buf;
- buf.sprintf( "%.2d:%.2d:%.2d", hour(), minute(), second() );
- return buf;
-}
-
-
-/*!
- Sets the time to hour \a h, minute \a m, seconds \a s and
- milliseconds \a ms.
-
- \a h must be in the range 0-23, \a m and \a s must be in the range
- 0-59, and \a ms must be in the range 0-999. Returns TRUE if the set
- time is valid, otherwise FALSE.
-
- \sa isValid()
-*/
-
-bool QTime::setHMS( int h, int m, int s, int ms )
-{
- if ( !isValid(h,m,s,ms) ) {
-#if defined(CHECK_RANGE)
- qWarning( "QTime::setHMS Invalid time %02d:%02d:%02d.%03d", h, m, s,
- ms );
-#endif
- ds = MSECS_PER_DAY; // make this invalid
- return FALSE;
- }
- ds = (h*SECS_PER_HOUR + m*SECS_PER_MIN + s)*1000 + ms;
- return TRUE;
-}
-
-/*!
- Returns a QTime object containing a time \a nsecs seconds later than
- the time of this object (or earlier if \a ms is negative).
-
- Note that the time will wrap if it passes midnight.
-
- Example:
- \code
- QTime n( 14, 0, 0 ); // n == 14:00:00
- QTime t;
- t = n.addSecs( 70 ); // t == 14:01:10
- t = n.addSecs( -70 ); // t == 13:58:50
- t = n.addSecs( 10*60*60 + 5 ); // t == 00:00:05
- t = n.addSecs( -15*60*60 ); // t == 23:00:00
- \endcode
-
- \sa addMSecs(), secsTo(), QDateTime::addSecs()
-*/
-
-QTime QTime::addSecs( int nsecs ) const
-{
- return addMSecs(nsecs*1000);
-}
-
-/*!
- Returns the number of seconds from this time to \a t (which is
- negative if \a t is earlier than this time).
-
- Since QTime measures time within a day and there are 86400 seconds
- in a day, the result is between -86400 and 86400.
-
- \sa addSecs() QDateTime::secsTo()
-*/
-
-int QTime::secsTo( const QTime &t ) const
-{
- return ((int)t.ds - (int)ds)/1000;
-}
-
-/*!
- Returns a QTime object containing a time \a ms milliseconds later than
- the time of this object (or earlier if \a ms is negative).
-
- Note that the time will wrap if it passes midnight. See addSecs()
- for an example.
-
- \sa addSecs(), msecsTo()
-*/
-
-QTime QTime::addMSecs( int ms ) const
-{
- QTime t;
- if ( ms < 0 ) {
- // % not well-defined for -ve, but / is.
- int negdays = (MSECS_PER_DAY-ms) / MSECS_PER_DAY;
- t.ds = ((int)ds + ms + negdays*MSECS_PER_DAY)
- % MSECS_PER_DAY;
- } else {
- t.ds = ((int)ds + ms) % MSECS_PER_DAY;
- }
- return t;
-}
-
-/*!
- Returns the number of milliseconds from this time to \a t (which is
- negative if \a t is earlier than this time).
-
- Since QTime measures time within a day and there are 86400000
- milliseconds in a day, the result is between -86400000 and 86400000.
-
- \sa secsTo()
-*/
-
-int QTime::msecsTo( const QTime &t ) const
-{
- return (int)t.ds - (int)ds;
-}
-
-
-/*!
- \fn bool QTime::operator==( const QTime &t ) const
-
- Returns TRUE if this time is equal to \a t, or FALSE if they are
- different.
-*/
-
-/*!
- \fn bool QTime::operator!=( const QTime &t ) const
-
- Returns TRUE if this time is different from \a t, or FALSE if they
- are equal.
-*/
-
-/*!
- \fn bool QTime::operator<( const QTime &t ) const
-
- Returns TRUE if this time is earlier than \a t, otherwise FALSE.
-*/
-
-/*!
- \fn bool QTime::operator<=( const QTime &t ) const
-
- Returns TRUE if this time is earlier than or equal to \a t,
- otherwise FALSE.
-*/
-
-/*!
- \fn bool QTime::operator>( const QTime &t ) const
-
- Returns TRUE if this time is later than \a t, otherwise FALSE.
-*/
-
-/*!
- \fn bool QTime::operator>=( const QTime &t ) const
-
- Returns TRUE if this time is later than or equal to \a t, otherwise
- FALSE.
-*/
-
-
-
-/*!
- Returns the current time, as reported by the system clock.
-
- Note that the accuracy depends on the accuracy of the underlying
- operating system; not all systems provide 1-millisecond accuracy.
-*/
-
-QTime QTime::currentTime()
-{
- QTime ct;
- currentTime( &ct );
- return ct;
-}
-
-/*!
- \internal
-
- Fetches the current time and returns TRUE if the time is within one
- minute after midnight, otherwise FALSE. The return value is used by
- QDateTime::currentDateTime() to ensure that the date there is correct.
-*/
-
-bool QTime::currentTime( QTime *ct )
-{
- if ( !ct ) {
-#if defined(CHECK_NULL)
- qWarning( "QTime::currentTime(QTime *): Null pointer not allowed" );
-#endif
- return FALSE;
- }
-
-#if defined(_OS_WIN32_)
-
- SYSTEMTIME t;
- GetLocalTime( &t );
- ct->ds = MSECS_PER_HOUR*t.wHour + MSECS_PER_MIN*t.wMinute +
- 1000*t.wSecond + t.wMilliseconds;
- return (t.wHour == 0 && t.wMinute == 0);
-
-#elif defined(_OS_OS2_)
-
- DATETIME t;
- DosGetDateTime( &t );
- ct->ds = MSECS_PER_HOUR*t.hours + MSECS_PER_MIN*t.minutes +
- 1000*t.seconds + 10*t.hundredths;
- return (t.hours == 0 && t.minutes == 0);
-
-#elif defined(_OS_MSDOS_)
-
- _dostime_t t;
- _dos_gettime( &t );
- ct->ds = MSECS_PER_HOUR*t.hour + MSECS_PER_MIN*t.minute +
- t.second*1000 + t.hsecond*10;
- return (t.hour== 0 && t.minute == 0);
-
-#elif defined(_OS_UNIX_) || defined(_OS_MAC_)
-
- struct timeval tv;
- gettimeofday( &tv, 0 );
- time_t ltime = tv.tv_sec;
- tm *t = localtime( &ltime );
- ct->ds = (uint)( MSECS_PER_HOUR*t->tm_hour + MSECS_PER_MIN*t->tm_min +
- 1000*t->tm_sec + tv.tv_usec/1000 );
- return (t->tm_hour== 0 && t->tm_min == 0);
-
-#else
-
- time_t ltime; // no millisecond resolution!!
- ::time( &ltime );
- tm *t = localtime( &ltime );
- ct->ds = MSECS_PER_HOUR*t->tm_hour + MSECS_PER_MIN*t->tm_min +
- 1000*t->tm_sec;
- return (t->tm_hour== 0 && t->tm_min == 0);
-#endif
-}
-
-/*!
- Returns TRUE if the specified time is valid, otherwise FALSE.
-
- The time is valid if \a h is in the range 0-23, \a m and \a s are in
- the range 0-59, and \a ms is in the range 0-999.
-
- Example:
- \code
- QTime::isValid(21, 10, 30); // returns TRUE
- QTime::isValid(22, 5, 62); // returns FALSE
- \endcode
-*/
-
-bool QTime::isValid( int h, int m, int s, int ms )
-{
- return (uint)h < 24 && (uint)m < 60 && (uint)s < 60 && (uint)ms < 1000;
-}
-
-
-/*!
- Sets this time to the current time. This is practical for timing:
-
- \code
- QTime t;
- t.start(); // start clock
- ... // some lengthy task
- qDebug( "%d\n", t.elapsed() ); // prints # msecs elapsed
- \endcode
-
- \sa restart(), elapsed(), currentTime()
-*/
-
-void QTime::start()
-{
- *this = currentTime();
-}
-
-/*!
- Sets this time to the current time, and returns the number of
- milliseconds that have elapsed since the last time start() or
- restart() was called.
-
- This function is guaranteed to be atomic, and is thus very handy for
- repeated measurements: call start() to start the first measurement,
- then restart() for each later measurement.
-
- Note that the counter wraps to zero 24 hours after the last call to
- start() or restart().
-
- \warning If the system's clock setting has been changed since the
- last time start() or restart() was called, the result is undefined.
- This can happen e.g. when daylight saving is turned on or off.
-
- \sa start(), elapsed(), currentTime()
-*/
-
-int QTime::restart()
-{
- QTime t = currentTime();
- int n = msecsTo( t );
- if ( n < 0 ) // passed midnight
- n += 86400*1000;
- *this = t;
- return n;
-}
-
-/*!
- Returns the number of milliseconds that have elapsed since the last
- time start() or restart() was called.
-
- Note that the counter wraps to zero 24 hours after the last call to
- start() or restart.
-
- Note that the accuracy depends on the accuracy of the underlying
- operating system; not all systems provide 1-millisecond accuracy.
-
- \warning If the system's clock setting has been changed since the
- last time start() or restart() was called, the result is undefined.
- This can happen e.g. when daylight saving is turned on or off.
-
- \sa start(), restart()
-*/
-
-int QTime::elapsed()
-{
- int n = msecsTo( currentTime() );
- if ( n < 0 ) // passed midnight
- n += 86400*1000;
- return n;
-}
-
-
-/*****************************************************************************
- QDateTime member functions
- *****************************************************************************/
-
-/*!
- \class QDateTime qdatetime.h
- \brief The QDateTime class provides date and time functions.
-
- \ingroup time
-
- A QDateTime object contains a calendar date and a clock time (a
- "datetime"). It is a combination of the QDate and QTime classes. It
- can read the current datetime from the system clock. It provides
- functions for comparing datetimes and for manipulating a datetime by
- adding a number of seconds or days.
-
- A QDateTime object is typically created either by giving a date and
- time explicitly, or by using the static function currentTime(),
- which makes a QDateTime object which contains the system's clock
- time.
-
- The date() and time() functions provide access to the date and time
- parts of the datetime. The same information is provided in textual
- format by the toString() function.
-
- QDateTime provides a full set of operators to compare two QDateTime
- objects. A datetime is considered smaller than another if it is
- earlier than the other.
-
- The datetime a given number of days or seconds later than a given
- datetime can be found using the addDays() and addSecs()
- functions. Correspondingly, the number of days or seconds between
- two times can be found using the daysTo() or secsTo() functions.
-
- A datetime can also be set using the setTime_t() function, which
- takes a POSIX-standard "number of seconds since 00:00:00 on January
- 1, 1970" value.
-
- The limitations regarding range and resolution mentioned in the
- QDate and QTime documentation apply for QDateTime also.
-
- \sa QDate, QTime
-*/
-
-
-/*!
- \fn QDateTime::QDateTime()
-
- Constructs a null datetime (i.e. null date and null time). A null
- datetime is invalid, since the date is invalid.
-
- \sa isValid()
-*/
-
-
-/*!
- Constructs a datetime with date \a date and null time (00:00:00.000).
-*/
-
-QDateTime::QDateTime( const QDate &date )
- : d(date)
-{
-}
-
-/*!
- Constructs a datetime with date \a date and time \a time.
-*/
-
-QDateTime::QDateTime( const QDate &date, const QTime &time )
- : d(date), t(time)
-{
-}
-
-
-/*!
- \fn bool QDateTime::isNull() const
-
- Returns TRUE if both the date and the time are null. A null date is invalid.
-
- \sa QDate::isNull(), QTime::isNull()
-*/
-
-/*!
- \fn bool QDateTime::isValid() const
-
- Returns TRUE if both the date and the time are valid.
-
- \sa QDate::isValid(), QTime::isValid()
-*/
-
-/*!
- \fn QDate QDateTime::date() const
-
- Returns the date part of this datetime.
-
- \sa setDate(), time()
-*/
-
-/*!
- \fn QTime QDateTime::time() const
-
- Returns the time part of this datetime.
-
- \sa setTime(), date()
-*/
-
-/*!
- \fn void QDateTime::setDate( const QDate &date )
-
- Sets the date part of this datetime.
-
- \sa date(), setTime()
-*/
-
-/*!
- \fn void QDateTime::setTime( const QTime &time )
-
- Sets the time part of this datetime.
-
- \sa time(), setDate()
-*/
-
-
-/*!
- Sets the local date and time given the number of seconds that have passed
- since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC).
- On systems that do not support timezones this function will behave as if
- local time were UTC.
-
- Note that Microsoft Windows supports only a limited range of values for
- \a secsSince1Jan1970UTC.
-*/
-
-void QDateTime::setTime_t( uint secsSince1Jan1970UTC )
-{
- time_t tmp = (time_t) secsSince1Jan1970UTC;
- tm *tM = localtime( &tmp );
- if ( !tM ) {
- tM = gmtime( &tmp );
- if ( !tM ) {
- d.jd = QDate::greg2jul( 1970, 1, 1 );
- t.ds = 0;
- return;
- }
- }
- d.jd = QDate::greg2jul( tM->tm_year + 1900, tM->tm_mon + 1, tM->tm_mday );
- t.ds = MSECS_PER_HOUR*tM->tm_hour + MSECS_PER_MIN*tM->tm_min +
- 1000*tM->tm_sec;
-}
-
-
-/*!
- Sets the UTC date and time given the number of seconds that have passed
- since 00:00:00 on January 1, 1970, Coordinated Universal Time (UTC).
-
- Note that Microsoft Windows supports only a limited range of values for
- \a secsSince1Jan1970UTC.
-*/
-
-void QDateTime::setTimeUtc_t( uint secsSince1Jan1970UTC )
-{
- time_t tmp = (time_t) secsSince1Jan1970UTC;
- tm *tM = gmtime( &tmp );
- if ( !tM ) {
- d.jd = QDate::greg2jul( 1970, 1, 1 );
- t.ds = 0;
- return;
- }
- d.jd = QDate::greg2jul( tM->tm_year + 1900, tM->tm_mon + 1, tM->tm_mday );
- t.ds = MSECS_PER_HOUR*tM->tm_hour + MSECS_PER_MIN*tM->tm_min +
- 1000*tM->tm_sec;
-}
-
-
-/*!
- Returns the datetime as a string.
-
- The string format is "Sat May 20 03:40:13 1998".
-
- This function uses QDate::dayName(), QDate::monthName(), and
- QTime::toString() to generate the string.
-
-*/
-
-QCString QDateTime::toString() const
-{
- QCString buf = d.dayName(d.dayOfWeek());
- buf += ' ';
- buf += d.monthName(d.month());
- buf += ' ';
- buf += QCString().setNum(d.day());
- buf += ' ';
- buf += t.toString();
- buf += ' ';
- buf += QCString().setNum(d.year());
- return buf;
-}
-
-/*!
- Returns a QDateTime object containing a datetime \a ndays days later
- than the datetime of this object (or earlier if \a ndays is
- negative).
-
- \sa daysTo(), addSecs()
-*/
-
-QDateTime QDateTime::addDays( int ndays ) const
-{
- return QDateTime( d.addDays(ndays), t );
-}
-
-/*!
- Returns a QDateTime object containing a datetime \a nsecs seconds
- later than the datetime of this object (or earlier if \a nsecs is
- negative).
-
- \sa secsTo(), addDays()
-*/
-
-QDateTime QDateTime::addSecs( int nsecs ) const
-{
- uint dd = d.jd;
- int tt = t.ds;
- int sign = 1;
- if ( nsecs < 0 ) {
- nsecs = -nsecs;
- sign = -1;
- }
- if ( nsecs >= (int)SECS_PER_DAY ) {
- dd += sign*(nsecs/SECS_PER_DAY);
- nsecs %= SECS_PER_DAY;
- }
- tt += sign*nsecs*1000;
- if ( tt < 0 ) {
- tt = MSECS_PER_DAY - tt - 1;
- dd -= tt / MSECS_PER_DAY;
- tt = tt % MSECS_PER_DAY;
- tt = MSECS_PER_DAY - tt - 1;
- } else if ( tt >= (int)MSECS_PER_DAY ) {
- dd += ( tt / MSECS_PER_DAY );
- tt = tt % MSECS_PER_DAY;
- }
- QDateTime ret;
- ret.t.ds = tt;
- ret.d.jd = dd;
- return ret;
-}
-
-/*!
- Returns the number of days from this datetime to \a dt (which is
- negative if \a dt is earlier than this datetime).
-
- \sa addDays(), secsTo()
-*/
-
-int QDateTime::daysTo( const QDateTime &dt ) const
-{
- return d.daysTo( dt.d );
-}
-
-/*!
- Returns the number of seconds from this datetime to \a dt (which is
- negative if \a dt is earlier than this datetime).
-
- Example:
- \code
- QDateTime dt = QDateTime::currentDateTime();
- QDateTime x( QDate(dt.year(),12,24), QTime(17,00) );
- qDebug( "There are %d seconds to Christmas", dt.secsTo(x) );
- \endcode
-
- \sa addSecs(), daysTo(), QTime::secsTo()
-*/
-
-int QDateTime::secsTo( const QDateTime &dt ) const
-{
- return t.secsTo(dt.t) + d.daysTo(dt.d)*SECS_PER_DAY;
-}
-
-
-/*!
- Returns TRUE if this datetime is equal to \a dt, or FALSE if
- they are different.
- \sa operator!=()
-*/
-
-bool QDateTime::operator==( const QDateTime &dt ) const
-{
- return t == dt.t && d == dt.d;
-}
-
-/*!
- Returns TRUE if this datetime is different from \a dt, or FALSE if
- they are equal.
- \sa operator==()
-*/
-
-bool QDateTime::operator!=( const QDateTime &dt ) const
-{
- return t != dt.t || d != dt.d;
-}
-
-/*!
- Returns TRUE if this datetime is earlier than \a dt, otherwise FALSE.
-*/
-
-bool QDateTime::operator<( const QDateTime &dt ) const
-{
- if ( d < dt.d )
- return TRUE;
- return d == dt.d ? t < dt.t : FALSE;
-}
-
-/*!
- Returns TRUE if this datetime is earlier than or equal to \a dt,
- otherwise FALSE.
-*/
-
-bool QDateTime::operator<=( const QDateTime &dt ) const
-{
- if ( d < dt.d )
- return TRUE;
- return d == dt.d ? t <= dt.t : FALSE;
-}
-
-/*!
- Returns TRUE if this datetime is later than \a dt, otherwise FALSE.
-*/
-
-bool QDateTime::operator>( const QDateTime &dt ) const
-{
- if ( d > dt.d )
- return TRUE;
- return d == dt.d ? t > dt.t : FALSE;
-}
-
-/*!
- Returns TRUE if this datetime is later than or equal to \a dt,
- otherwise FALSE.
-*/
-
-bool QDateTime::operator>=( const QDateTime &dt ) const
-{
- if ( d > dt.d )
- return TRUE;
- return d == dt.d ? t >= dt.t : FALSE;
-}
-
-/*!
- Returns the current datetime, as reported by the system clock.
-
- \sa QDate::currentDate(), QTime::currentTime()
-*/
-
-QDateTime QDateTime::currentDateTime()
-{
- QDate cd = QDate::currentDate();
- QTime ct;
- if ( QTime::currentTime(&ct) ) // too close to midnight?
- cd = QDate::currentDate(); // YES! time for some midnight
- // voodoo, fetch date again
- return QDateTime( cd, ct );
-}
-
-
-/*****************************************************************************
- Date/time stream functions
- *****************************************************************************/
-
-#ifndef QT_NO_DATASTREAM
-/*!
- \relates QDate
- Writes the date to the stream.
-
- \sa \link datastreamformat.html Format of the QDataStream operators \endlink
-*/
-
-QDataStream &operator<<( QDataStream &s, const QDate &d )
-{
- return s << (Q_UINT32)(d.jd);
-}
-
-/*!
- \relates QDate
- Reads a date from the stream.
-
- \sa \link datastreamformat.html Format of the QDataStream operators \endlink
-*/
-
-QDataStream &operator>>( QDataStream &s, QDate &d )
-{
- Q_UINT32 jd;
- s >> jd;
- d.jd = jd;
- return s;
-}
-
-/*!
- \relates QTime
- Writes a time to the stream.
-
- \sa \link datastreamformat.html Format of the QDataStream operators \endlink
-*/
-
-QDataStream &operator<<( QDataStream &s, const QTime &t )
-{
- return s << (Q_UINT32)(t.ds);
-}
-
-/*!
- \relates QTime
- Reads a time from the stream.
-
- \sa \link datastreamformat.html Format of the QDataStream operators \endlink
-*/
-
-QDataStream &operator>>( QDataStream &s, QTime &t )
-{
- Q_UINT32 ds;
- s >> ds;
- t.ds = ds;
- return s;
-}
-
-/*!
- \relates QDateTime
- Writes a datetime to the stream.
-
- \sa \link datastreamformat.html Format of the QDataStream operators \endlink
-*/
-
-QDataStream &operator<<( QDataStream &s, const QDateTime &dt )
-{
- return s << dt.d << dt.t;
-}
-
-/*!
- \relates QDateTime
- Reads a datetime from the stream.
-
- \sa \link datastreamformat.html Format of the QDataStream operators \endlink
-*/
-
-QDataStream &operator>>( QDataStream &s, QDateTime &dt )
-{
- s >> dt.d >> dt.t;
- return s;
-}
-#endif //QT_NO_DATASTREAM
diff --git a/qtools/qdatetime.h b/qtools/qdatetime.h
deleted file mode 100644
index 63007f3..0000000
--- a/qtools/qdatetime.h
+++ /dev/null
@@ -1,217 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of date and time classes
-**
-** Created : 940124
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QDATETIME_H
-#define QDATETIME_H
-
-#ifndef QT_H
-#include "qcstring.h"
-#endif // QT_H
-
-
-/*****************************************************************************
- QDate class
- *****************************************************************************/
-
-class Q_EXPORT QDate
-{
-public:
- QDate() { jd=0; } // set null date
- QDate( int y, int m, int d ); // set date
- virtual ~QDate() {}
-
- bool isNull() const { return jd == 0; }
- bool isValid() const; // valid date
-
- int year() const; // 1752..
- int month() const; // 1..12
- int day() const; // 1..31
- int dayOfWeek() const; // 1..7 (monday==1)
- int dayOfYear() const; // 1..365
- int daysInMonth() const; // 28..31
- int daysInYear() const; // 365 or 366
-
- virtual QCString monthName( int month ) const;
- virtual QCString dayName( int weekday ) const;
-
- QCString toString() const;
-
- bool setYMD( int y, int m, int d );
-
- QDate addDays( int days ) const;
- int daysTo( const QDate & ) const;
-
- bool operator==( const QDate &d ) const { return jd == d.jd; }
- bool operator!=( const QDate &d ) const { return jd != d.jd; }
- bool operator<( const QDate &d ) const { return jd < d.jd; }
- bool operator<=( const QDate &d ) const { return jd <= d.jd; }
- bool operator>( const QDate &d ) const { return jd > d.jd; }
- bool operator>=( const QDate &d ) const { return jd >= d.jd; }
-
- static QDate currentDate();
- static bool isValid( int y, int m, int d );
- static bool leapYear( int year );
-
-protected:
- static uint greg2jul( int y, int m, int d );
- static void jul2greg( uint jd, int &y, int &m, int &d );
-private:
- static const char * const monthNames[];
- static const char * const weekdayNames[];
- uint jd;
- friend class QDateTime;
-#ifndef QT_NO_DATASTREAM
- friend Q_EXPORT QDataStream &operator<<( QDataStream &, const QDate & );
- friend Q_EXPORT QDataStream &operator>>( QDataStream &, QDate & );
-#endif
-};
-
-
-/*****************************************************************************
- QTime class
- *****************************************************************************/
-
-class Q_EXPORT QTime
-{
-public:
- QTime() { ds=0; } // set null time
- QTime( int h, int m, int s=0, int ms=0 ); // set time
-
- bool isNull() const { return ds == 0; }
- bool isValid() const; // valid time
-
- int hour() const; // 0..23
- int minute() const; // 0..59
- int second() const; // 0..59
- int msec() const; // 0..999
-
- QCString toString() const;
-
- bool setHMS( int h, int m, int s, int ms=0 );
-
- QTime addSecs( int secs ) const;
- int secsTo( const QTime & ) const;
- QTime addMSecs( int ms ) const;
- int msecsTo( const QTime & ) const;
-
- bool operator==( const QTime &d ) const { return ds == d.ds; }
- bool operator!=( const QTime &d ) const { return ds != d.ds; }
- bool operator<( const QTime &d ) const { return ds < d.ds; }
- bool operator<=( const QTime &d ) const { return ds <= d.ds; }
- bool operator>( const QTime &d ) const { return ds > d.ds; }
- bool operator>=( const QTime &d ) const { return ds >= d.ds; }
-
- static QTime currentTime();
- static bool isValid( int h, int m, int s, int ms=0 );
-
- void start();
- int restart();
- int elapsed();
-
-private:
- static bool currentTime( QTime * );
-
- uint ds;
- friend class QDateTime;
-#ifndef QT_NO_DATASTREAM
- friend Q_EXPORT QDataStream &operator<<( QDataStream &, const QTime & );
- friend Q_EXPORT QDataStream &operator>>( QDataStream &, QTime & );
-#endif
-};
-
-
-/*****************************************************************************
- QDateTime class
- *****************************************************************************/
-
-class Q_EXPORT QDateTime
-{
-public:
- QDateTime() {} // set null date and null time
- QDateTime( const QDate & );
- QDateTime( const QDate &, const QTime & );
-
- bool isNull() const { return d.isNull() && t.isNull(); }
- bool isValid() const { return d.isValid() && t.isValid(); }
-
- QDate date() const { return d; }
- QTime time() const { return t; }
- void setDate( const QDate &date ) { d=date; }
- void setTime( const QTime &time ) { t=time; }
- void setTime_t( uint secsSince1Jan1970UTC );
- void setTimeUtc_t( uint secsSince1Jan1970UTC );
-
- QCString toString() const;
-
- QDateTime addDays( int days ) const;
- QDateTime addSecs( int secs ) const;
- int daysTo( const QDateTime & ) const;
- int secsTo( const QDateTime & ) const;
-
- bool operator==( const QDateTime &dt ) const;
- bool operator!=( const QDateTime &dt ) const;
- bool operator<( const QDateTime &dt ) const;
- bool operator<=( const QDateTime &dt ) const;
- bool operator>( const QDateTime &dt ) const;
- bool operator>=( const QDateTime &dt ) const;
-
- static QDateTime currentDateTime();
-
-private:
- QDate d;
- QTime t;
-#ifndef QT_NO_DATASTREAM
- friend Q_EXPORT QDataStream &operator<<( QDataStream &, const QDateTime &);
- friend Q_EXPORT QDataStream &operator>>( QDataStream &, QDateTime & );
-#endif
-};
-
-
-/*****************************************************************************
- Date and time stream functions
- *****************************************************************************/
-
-#ifndef QT_NO_DATASTREAM
-Q_EXPORT QDataStream &operator<<( QDataStream &, const QDate & );
-Q_EXPORT QDataStream &operator>>( QDataStream &, QDate & );
-Q_EXPORT QDataStream &operator<<( QDataStream &, const QTime & );
-Q_EXPORT QDataStream &operator>>( QDataStream &, QTime & );
-Q_EXPORT QDataStream &operator<<( QDataStream &, const QDateTime & );
-Q_EXPORT QDataStream &operator>>( QDataStream &, QDateTime & );
-#endif // QT_NO_DATASTREAM
-
-#endif // QDATETIME_H
diff --git a/qtools/qdict.doc b/qtools/qdict.doc
deleted file mode 100644
index bf1ea01..0000000
--- a/qtools/qdict.doc
+++ /dev/null
@@ -1,492 +0,0 @@
-/****************************************************************************
-**
-**
-** QDict and QDictIterator class documentation
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-
-/*****************************************************************************
- QDict documentation
- *****************************************************************************/
-
-/*!
- \class QDict qdict.h
- \brief The QDict class is a template class that provides a dictionary based on \c QString keys.
-
- \ingroup collection
- \ingroup tools
-
- QDict is implemented as a template class. Define a template instance
- QDict\<X\> to create a dictionary that operates on pointers to X, or X*.
-
- A dictionary is a collection that associates an item with a key.
- The key is used for inserting and looking up an item. QDict has
- \l QString keys, which are Unicode strings. If you want to use
- non-Unicode, plain 8-bit \c char* keys, use the QAsciiDict template.
- A QDict has the same performance as a QAsciiDict.
-
- The dictionary has very fast insertion and lookup.
-
- Example:
- \code
- #include <qdict.h>
- #include <stdio.h>
-
- void main()
- {
- // Creates a dictionary that maps QString ==> char* (case insensitive)
- QDict<char> dict( 17, FALSE );
-
- dict.insert( "France", "Paris" );
- dict.insert( "Russia", "Moscow" );
- dict.insert( "Norway", "Oslo" );
-
- printf( "%s\n", dict["Norway"] );
- printf( "%s\n", dict["FRANCE"] );
- printf( "%s\n", dict["russia"] );
-
- if ( !dict["Italy"] )
- printf( "Italy not defined\n" );
- }
- \endcode
-
- Program output:
- \code
- Oslo
- Paris
- Moscow
- Italy not defined
- \endcode
-
- The dictionary in our example maps \c QString keys to \c char* items.
- Note that the mapping is case insensitive (specified in the
- \link QDict::QDict() constructor\endlink).
- QDict implements the \link operator[] [] operator\endlink to lookup an item.
-
- QDict is implemented by QGDict as a hash array with a fixed number of
- entries. Each array entry points to a singly linked list of buckets, in
- which the dictionary items are stored.
-
- When an item is inserted with a key, the key is converted (hashed) to
- an integer index into the hash array. The item is inserted before the
- first bucket in the list of buckets.
-
- Looking up an item is normally very fast. The key is again hashed to an
- array index. Then QDict scans the list of buckets and returns the item
- found or null if the item was not found. You cannot insert null pointers
- into a dictionary.
-
- The size of the hash array is very important. In order to get good
- performance, you should use a suitably large \link primes.html prime
- number\endlink. Suitable means equal to or larger than the maximum
- expected number of dictionary items.
-
- Items with equal keys are allowed. When inserting two items with the
- same key, only the last inserted item will be visible (last in, first out)
- until it is removed.
-
- Example:
- \code
- #include <qdict.h>
- #include <stdio.h>
-
- void main()
- {
- // Creates a dictionary that maps QString ==> char* (case sensitive)
- QDict<char> dict;
-
- dict.insert( "Germany", "Berlin" );
- dict.insert( "Germany", "Bonn" );
-
- printf( "%s\n", dict["Germany"] );
- dict.remove( "Germany" ); // Oct 3rd 1990
- printf( "%s\n", dict["Germany"] );
- }
- \endcode
-
- Program output:
- \code
- Bonn
- Berlin
- \endcode
-
- The QDictIterator class can traverse the dictionary contents, but only
- in an arbitrary order. Multiple iterators may independently traverse the
- same dictionary.
-
- Calling setAutoDelete(TRUE) for a dictionary tells it to delete items
- that are removed . The default is to not delete items when they are
- removed.
-
- When inserting an item into a dictionary, only the pointer is copied, not
- the item itself. This is called a shallow copy. It is possible to make the
- dictionary copy all of the item's data (known as a deep copy) when an
- item is inserted. insert() calls the virtual function
- QCollection::newItem() for the item to be inserted.
- Inherit a dictionary and reimplement it if you want deep copies.
-
- When removing a dictionary item, the virtual function
- QCollection::deleteItem() is called. QDict's default implementation
- is to delete the item if auto-deletion is enabled.
-
- \sa QDictIterator, QAsciiDict, QIntDict, QPtrDict,
- \link collection.html Collection Classes\endlink
-*/
-
-
-/*!
- \fn QDict::QDict( int size, bool caseSensitive )
- Constructs a dictionary with the following properties:
- \arg \e size is the size of the internal hash array.
- \arg \e caseSensitive specifies whether to use case sensitive lookup or not.
-
- Setting \e size to a suitably large \link primes.html prime
- number\endlink (equal to or greater than the expected number of entries)
- makes the hash distribution better and hence the lookup faster.
-
- Setting \e caseSensitive to TRUE will treat "abc" and "Abc" as different
- keys. Setting it to FALSE will make the dictionary ignore case.
- Case insensitive comparison includes the whole Unicode alphabet.
-*/
-
-/*!
- \fn QDict::QDict( const QDict<type> &dict )
- Constructs a copy of \e dict.
-
- Each item in \e dict are inserted into this dictionary.
- Only the pointers are copied (shallow copy).
-*/
-
-/*!
- \fn QDict::~QDict()
- Removes all items from the dictionary and destroys it.
- All iterators that access this dictionary will be reset.
-
- \sa setAutoDelete()
-*/
-
-/*!
- \fn QDict<type> &QDict::operator=(const QDict<type> &dict)
- Assigns \e dict to this dictionary and returns a reference to this
- dictionary.
-
- This dictionary is first cleared, then each item in \e dict is inserted
- into this dictionary.
- Only the pointers are copied (shallow copy), unless newItem() has been
- reimplemented().
-*/
-
-/*!
- \fn uint QDict::count() const
- Returns the number of items in the dictionary.
- \sa isEmpty()
-*/
-
-/*!
- \fn uint QDict::size() const
- Returns the size of the internal hash array (as specified in the
- constructor).
- \sa count()
-*/
-
-/*!
- \fn void QDict::resize( uint newsize )
- Changes the size of the hashtable the \a newsize.
- The contents of the dictionary are preserved,
- but all iterators on the dictionary become invalid.
-*/
-
-/*!
- \fn bool QDict::isEmpty() const
- Returns TRUE if the dictionary is empty, i.e. count() == 0. Returns FALSE
- otherwise.
- \sa count()
-*/
-
-/*!
- \fn void QDict::insert( const QString &key, const type *item )
-
- Inserts the \e key with the \e item into the dictionary.
-
- The key does not have to be a unique dictionary key. If multiple items
- are inserted with the same key, only the last item will be visible.
-
- Null items are not allowed.
-
- \sa replace()
-*/
-
-/*!
- \fn void QDict::replace( const QString &key, const type *item )
-
- Replaces an item which has a key equal to \e key with \e item.
-
- If the item does not already exist, it will be inserted.
-
- Null items are not allowed.
-
- Equivalent to:
- \code
- QDict<char> dict;
- ...
- if ( dict.find(key) )
- dict.remove( key );
- dict.insert( key, item );
- \endcode
-
- If there are two or more items with equal keys, then the last inserted
- of these will be replaced.
-
- \sa insert()
-*/
-
-/*!
- \fn bool QDict::remove( const QString &key )
-
- Removes the item associated with \e key from the dictionary.
- Returns TRUE if successful, or FALSE if the key does not exist in the
- dictionary.
-
- If there are two or more items with equal keys, then the last inserted
- of these will be removed.
-
- The removed item is deleted if \link QCollection::setAutoDelete()
- auto-deletion\endlink is enabled.
-
- All dictionary iterators that refer to the removed item will be set to
- point to the next item in the dictionary traversing order.
-
- \sa take(), clear(), setAutoDelete()
-*/
-
-/*!
- \fn type *QDict::take( const QString &key )
-
- Takes the item associated with \e key out of the dictionary without
- deleting it (even if \link QCollection::setAutoDelete()
- auto-deletion\endlink is enabled).
-
- If there are two or more items with equal keys, then the last inserted
- of these will be taken.
-
- Returns a pointer to the item taken out, or null if the key does not
- exist in the dictionary.
-
- All dictionary iterators that refer to the taken item will be set to
- point to the next item in the dictionary traversal order.
-
- \sa remove(), clear(), setAutoDelete()
-*/
-
-/*!
- \fn void QDict::clear()
-
- Removes all items from the dictionary.
-
- The removed items are deleted if \link QCollection::setAutoDelete()
- auto-deletion\endlink is enabled.
-
- All dictionary iterators that operate on dictionary are reset.
-
- \sa remove(), take(), setAutoDelete()
-*/
-
-/*!
- \fn type *QDict::find( const QString &key ) const
-
- Returns the item associated with \e key, or null if the key does not
- exist in the dictionary.
-
- This function uses an internal hashing algorithm to optimize lookup.
-
- If there are two or more items with equal keys, then the last inserted
- of these will be found.
-
- Equivalent to the [] operator.
-
- \sa operator[]()
-*/
-
-/*!
- \fn type *QDict::operator[]( const QString &key ) const
-
- Returns the item associated with \e key, or null if the key does not
- exist in the dictionary.
-
- This function uses an internal hashing algorithm to optimize lookup.
-
- If there are two or more items with equal keys, then the last inserted
- of these will be found.
-
- Equivalent to the find() function.
-
- \sa find()
-*/
-
-/*!
- \fn void QDict::statistics() const
- Debugging-only function that prints out the dictionary distribution
- using qDebug().
-*/
-
-
-/*****************************************************************************
- QDictIterator documentation
- *****************************************************************************/
-
-/*!
- \class QDictIterator qdict.h
- \brief The QDictIterator class provides an iterator for QDict collections.
-
- \ingroup collection
- \ingroup tools
-
- QDictIterator is implemented as a template class.
- Define a template instance QDictIterator\<X\> to create a
- dictionary iterator that operates on QDict\<X\> (dictionary of X*).
-
- Example:
- \code
- #include <qdict.h>
- #include <stdio.h>
-
- void main()
- {
- // Creates a dictionary that maps QString ==> char* (case insensitive)
- QDict<char> dict( 17, FALSE );
-
- dict.insert( "France", "Paris" );
- dict.insert( "Russia", "Moscow" );
- dict.insert( "Norway", "Oslo" );
-
- QDictIterator<char> it( dict ); // iterator for dict
-
- while ( it.current() ) {
- printf( "%s -> %s\n", it.currentKey().latin1(), it.current() );
- ++it;
- }
- }
- \endcode
-
- Program output:
- \code
- Russia -> Moscow
- Norway -> Oslo
- France -> Paris
- \endcode
-
- Note that the traversal order is arbitrary, you are not guaranteed the
- order above.
-
- Multiple iterators may independently traverse the same dictionary.
- A QDict knows about all iterators that are operating on the dictionary.
- When an item is removed from the dictionary, QDict update all iterators
- that are referring the removed item to point to the next item in the
- traversing order.
-
- \sa QDict, \link collection.html Collection Classes\endlink
-*/
-
-/*!
- \fn QDictIterator::QDictIterator( const QDict<type> &dict )
- Constructs an iterator for \e dict. The current iterator item is
- set to point on the first item in the \e dict.
-*/
-
-/*!
- \fn QDictIterator::~QDictIterator()
- Destroys the iterator.
-*/
-
-/*!
- \fn uint QDictIterator::count() const
- Returns the number of items in the dictionary this iterator operates on.
- \sa isEmpty()
-*/
-
-/*!
- \fn bool QDictIterator::isEmpty() const
- Returns TRUE if the dictionary is empty, i.e. count() == 0, otherwise FALSE.
- \sa count()
-*/
-
-/*!
- \fn type *QDictIterator::toFirst()
- Sets the current iterator item to point to the first item in the
- dictionary and returns a pointer to the item.
- If the dictionary is empty it sets the current item to null and
- returns null.
-*/
-
-/*!
- \fn QDictIterator::operator type *() const
- Cast operator. Returns a pointer to the current iterator item.
- Same as current().
-*/
-
-/*!
- \fn type *QDictIterator::current() const
- Returns a pointer to the current iterator item.
-*/
-
-/*!
- \fn QString QDictIterator::currentKey() const
- Returns a pointer to the key for the current iterator item.
-*/
-
-/*!
- \fn type *QDictIterator::operator()()
- Makes the succeeding item current and returns the original current item.
-
- If the current iterator item was the last item in the dictionary or if it
- was null, null is returned.
-*/
-
-/*!
- \fn type *QDictIterator::operator++()
- Prefix ++ makes the succeeding item current and returns the new current
- item.
-
- If the current iterator item was the last item in the dictionary or if it
- was null, null is returned.
-*/
-
-/*!
- \fn type *QDictIterator::operator+=( uint jump )
- Sets the current item to the item \e jump positions after the current item,
- and returns a pointer to that item.
-
- If that item is beyond the last item or if the dictionary is empty,
- it sets the current item to null and returns null.
-*/
-
-
diff --git a/qtools/qdict.h b/qtools/qdict.h
deleted file mode 100644
index 12db365..0000000
--- a/qtools/qdict.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QDict template class
-**
-** Created : 920821
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QDICT_H
-#define QDICT_H
-
-#ifndef QT_H
-#include "qgdict.h"
-#endif // QT_H
-
-#define QAsciiDict QDict
-#define QAsciiDictIterator QDictIterator
-#include "qasciidict.h"
-
-#endif // QDICT_H
diff --git a/qtools/qdir.cpp b/qtools/qdir.cpp
deleted file mode 100644
index 782a9c6..0000000
--- a/qtools/qdir.cpp
+++ /dev/null
@@ -1,1200 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QDir class
-**
-** Created : 950427
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qglobal.h"
-
-#include "qdir.h"
-
-#ifndef QT_NO_DIR
-#include "qfileinfo.h"
-#include "qfiledefs_p.h"
-#include "qregexp.h"
-#include "qstringlist.h"
-#include <stdlib.h>
-#include <ctype.h>
-
-// NOT REVISED
-/*!
- \class QDir qdir.h
- \brief Traverses directory structures and contents in a
- platform-independent way.
-
- \ingroup io
-
- A QDir can point to a file using either a relative or an absolute file
- path. Absolute file paths begin with the directory separator ('/') or a
- drive specification (not applicable to UNIX). Relative file names begin
- with a directory name or a file name and specify a path relative to the
- current directory.
-
- An example of an absolute path is the string "/tmp/quartz", a relative
- path might look like "src/fatlib". You can use the function isRelative()
- to check if a QDir is using a relative or an absolute file path. You can
- call the function convertToAbs() to convert a relative QDir to an
- absolute one.
-
- The directory "example" under the current directory is checked for existence
- in the example below:
-
- \code
- QDir d( "example" ); // "./example"
- if ( !d.exists() )
- qWarning( "Cannot find the example directory" );
- \endcode
-
- If you always use '/' as a directory separator, Qt will translate your
- paths to conform to the underlying operating system.
-
- cd() and cdUp() can be used to navigate the directory tree. Note that the
- logical cd and cdUp operations are not performed if the new directory does
- not exist.
-
- Example:
- \code
- QDir d = QDir::root(); // "/"
- if ( !d.cd("tmp") ) { // "/tmp"
- qWarning( "Cannot find the \"/tmp\" directory" );
- } else {
- QFile f( d.filePath("ex1.txt") ); // "/tmp/ex1.txt"
- if ( !f.open(IO_ReadWrite) )
- qWarning( "Cannot create the file %s", f.name() );
- }
- \endcode
-
- To read the contents of a directory you can use the entryList() and
- entryInfoList() functions.
-
- Example:
- \code
- #include <stdio.h>
- #include <qdir.h>
-
- //
- // This program scans the current directory and lists all files
- // that are not symbolic links, sorted by size with the smallest files
- // first.
- //
-
- int main( int argc, char **argv )
- {
- QDir d;
- d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks );
- d.setSorting( QDir::Size | QDir::Reversed );
-
- const QFileInfoList *list = d.entryInfoList();
- QFileInfoListIterator it( *list ); // create list iterator
- QFileInfo *fi; // pointer for traversing
-
- printf( " BYTES FILENAME\n" ); // print header
- while ( (fi=it.current()) ) { // for each file...
- printf( "%10li %s\n", fi->size(), fi->fileName().data() );
- ++it; // goto next list element
- }
- }
- \endcode
-*/
-
-
-/*!
- Constructs a QDir pointing to the current directory.
- \sa currentDirPath()
-*/
-
-QDir::QDir()
-{
- dPath = QString::fromLatin1(".");
- init();
-}
-
-/*!
- Constructs a QDir.
-
- \arg \e path is the directory.
- \arg \e nameFilter is the file name filter.
- \arg \e sortSpec is the sort specification, which describes how to
- sort the files in the directory.
- \arg \e filterSpec is the filter specification, which describes how
- to filter the files in the directory.
-
- Most of these arguments (except \e path) have optional values.
-
- Example:
- \code
- // lists all files in /tmp
-
- QDir d( "/tmp" );
- for ( int i=0; i<d.count(); i++ )
- printf( "%s\n", d[i] );
- \endcode
-
- If \e path is "" or null, the directory is set to "." (the current
- directory). If \e nameFilter is "" or null, it is set to "*" (all
- files).
-
- No check is made to ensure that the directory exists.
-
- \sa exists(), setPath(), setNameFilter(), setFilter(), setSorting()
-*/
-
-QDir::QDir( const QString &path, const QString &nameFilter,
- int sortSpec, int filterSpec )
-{
- init();
- dPath = cleanDirPath( path );
- if ( dPath.isEmpty() )
- dPath = QString::fromLatin1(".");
- nameFilt = nameFilter;
- if ( nameFilt.isEmpty() )
- nameFilt = QString::fromLatin1("*");
- filtS = (FilterSpec)filterSpec;
- sortS = (SortSpec)sortSpec;
-}
-
-/*!
- Constructs a QDir that is a copy of the given directory.
- \sa operator=()
-*/
-
-QDir::QDir( const QDir &d )
-{
- dPath = d.dPath;
- fList = 0;
- fiList = 0;
- nameFilt = d.nameFilt;
- dirty = TRUE;
- allDirs = d.allDirs;
- filtS = d.filtS;
- sortS = d.sortS;
-}
-
-
-void QDir::init()
-{
- fList = 0;
- fiList = 0;
- nameFilt = QString::fromLatin1("*");
- dirty = TRUE;
- allDirs = FALSE;
- filtS = All;
- sortS = SortSpec(Name | IgnoreCase);
-}
-
-/*!
- Destructs the QDir and cleans up.
-*/
-
-QDir::~QDir()
-{
- if ( fList )
- delete fList;
- if ( fiList )
- delete fiList;
-}
-
-
-/*!
- Sets the path of the directory. The path is cleaned of redundant ".", ".."
- and multiple separators. No check is made to ensure that a directory
- with this path exists.
-
- The path can be either absolute or relative. Absolute paths begin with the
- directory separator ('/') or a drive specification (not
- applicable to UNIX).
- Relative file names begin with a directory name or a file name and specify
- a path relative to the current directory. An example of
- an absolute path is the string "/tmp/quartz", a relative path might look like
- "src/fatlib". You can use the function isRelative() to check if a QDir
- is using a relative or an absolute file path. You can call the function
- convertToAbs() to convert a relative QDir to an absolute one.
-
- \sa path(), absPath(), exists(), cleanDirPath(), dirName(),
- absFilePath(), isRelative(), convertToAbs()
-*/
-
-void QDir::setPath( const QString &path )
-{
- dPath = cleanDirPath( path );
- if ( dPath.isEmpty() )
- dPath = QString::fromLatin1(".");
- dirty = TRUE;
-}
-
-/*!
- \fn QString QDir::path() const
- Returns the path, this may contain symbolic links, but never contains
- redundant ".", ".." or multiple separators.
-
- The returned path can be either absolute or relative (see setPath()).
-
- \sa setPath(), absPath(), exists(), cleanDirPath(), dirName(),
- absFilePath(), convertSeparators()
-*/
-
-/*!
- Returns the absolute (a path that starts with '/') path, which may
- contain symbolic links, but never contains redundant ".", ".." or
- multiple separators.
-
- \sa setPath(), canonicalPath(), exists(), cleanDirPath(), dirName(),
- absFilePath()
-*/
-
-QString QDir::absPath() const
-{
- if ( QDir::isRelativePath(dPath) ) {
- QString tmp = currentDirPath();
- if ( tmp.right(1) != QString::fromLatin1("/") )
- tmp += '/';
- tmp += dPath;
- return cleanDirPath( tmp );
- } else {
- return cleanDirPath( dPath );
- }
-}
-
-/*!
- Returns the name of the directory, this is NOT the same as the path, e.g.
- a directory with the name "mail", might have the path "/var/spool/mail".
- If the directory has no name (e.g. the root directory) a null string is
- returned.
-
- No check is made to ensure that a directory with this name actually exists.
-
- \sa path(), absPath(), absFilePath(), exists(), QString::isNull()
-*/
-
-QString QDir::dirName() const
-{
- int pos = dPath.findRev( '/' );
- if ( pos == -1 )
- return dPath;
- return dPath.right( dPath.length() - pos - 1 );
-}
-
-/*!
- Returns the path name of a file in the directory. Does NOT check if
- the file actually exists in the directory. If the QDir is relative
- the returned path name will also be relative. Redundant multiple separators
- or "." and ".." directories in \e fileName will not be removed (see
- cleanDirPath()).
-
- If \e acceptAbsPath is TRUE a \e fileName starting with a separator
- ('/') will be returned without change.
- If \e acceptAbsPath is FALSE an absolute path will be appended to
- the directory path.
-
- \sa absFilePath(), isRelative(), canonicalPath()
-*/
-
-QString QDir::filePath( const QString &fileName,
- bool acceptAbsPath ) const
-{
- if ( acceptAbsPath && !isRelativePath(fileName) )
- return QString(fileName);
-
- QString tmp = dPath;
- if ( tmp.isEmpty() || (tmp[(int)tmp.length()-1] != '/' && !!fileName &&
- fileName[0] != '/') )
- tmp += '/';
- tmp += fileName;
- return tmp;
-}
-
-/*!
- Returns the absolute path name of a file in the directory. Does NOT check if
- the file actually exists in the directory. Redundant multiple separators
- or "." and ".." directories in \e fileName will NOT be removed (see
- cleanDirPath()).
-
- If \e acceptAbsPath is TRUE a \e fileName starting with a separator
- ('/') will be returned without change.
- if \e acceptAbsPath is FALSE an absolute path will be appended to
- the directory path.
-
- \sa filePath()
-*/
-
-QString QDir::absFilePath( const QString &fileName,
- bool acceptAbsPath ) const
-{
- if ( acceptAbsPath && !isRelativePath( fileName ) )
- return fileName;
-
- QString tmp = absPath();
- if ( tmp.isEmpty() || (tmp[(int)tmp.length()-1] != '/' && !!fileName &&
- fileName[0] != '/') )
- tmp += '/';
- tmp += fileName;
- return tmp;
-}
-
-
-/*!
- Converts the '/' separators in \a pathName to system native
- separators. Returns the translated string.
-
- On Windows, convertSeparators("c:/winnt/system32") returns
- "c:\winnt\system32".
-
- No conversion is done on UNIX.
-*/
-
-QString QDir::convertSeparators( const QString &pathName )
-{
- QString n( pathName );
-#if defined(_OS_FATFS_) || defined(_OS_OS2EMX_)
- for ( int i=0; i<(int)n.length(); i++ ) {
- if ( n[i] == '/' )
- n[i] = '\\';
- }
-#endif
- return n;
-}
-
-
-/*!
- Changes directory by descending into the given directory. Returns
- TRUE if the new directory exists and is readable. Note that the logical
- cd operation is NOT performed if the new directory does not exist.
-
- If \e acceptAbsPath is TRUE a path starting with a separator ('/')
- will cd to the absolute directory, if \e acceptAbsPath is FALSE
- any number of separators at the beginning of \e dirName will be removed.
-
- Example:
- \code
- QDir d = QDir::home(); // now points to home directory
- if ( !d.cd("c++") ) { // now points to "c++" under home directory if OK
- QFileInfo fi( d, "c++" );
- if ( fi.exists() ) {
- if ( fi.isDir() )
- qWarning( "Cannot cd into \"%s\".", (char*)d.absFilePath("c++") );
- else
- qWarning( "Cannot create directory \"%s\"\n"
- "A file named \"c++\" already exists in \"%s\"",
- (const char *)d.absFilePath("c++"),
- (const char *)d.path() );
- return;
- } else {
- qWarning( "Creating directory \"%s\"",
- (const char *) d.absFilePath("c++") );
- if ( !d.mkdir( "c++" ) ) {
- qWarning("Could not create directory \"%s\"",
- (const char *)d.absFilePath("c++") );
- return;
- }
- }
- }
- \endcode
-
- Calling cd( ".." ) is equivalent to calling cdUp().
-
- \sa cdUp(), isReadable(), exists(), path()
-*/
-
-bool QDir::cd( const QString &dirName, bool acceptAbsPath )
-{
- if ( dirName.isEmpty() || dirName==QString::fromLatin1(".") )
- return TRUE;
- QString old = dPath;
- if ( acceptAbsPath && !isRelativePath(dirName) ) {
- dPath = cleanDirPath( dirName );
- } else {
- if ( !isRoot() )
- dPath += '/';
- dPath += dirName;
- if ( dirName.find('/') >= 0
- || old == QString::fromLatin1(".")
- || dirName == QString::fromLatin1("..") )
- dPath = cleanDirPath( dPath );
- }
- if ( !exists() ) {
- dPath = old; // regret
- return FALSE;
- }
- dirty = TRUE;
- return TRUE;
-}
-
-/*!
- Changes directory by moving one directory up the path followed to arrive
- at the current directory.
-
- Returns TRUE if the new directory exists and is readable. Note that the
- logical cdUp() operation is not performed if the new directory does not
- exist.
-
- \sa cd(), isReadable(), exists(), path()
-*/
-
-bool QDir::cdUp()
-{
- return cd( QString::fromLatin1("..") );
-}
-
-/*!
- \fn QString QDir::nameFilter() const
- Returns the string set by setNameFilter()
-*/
-
-/*!
- Sets the name filter used by entryList() and entryInfoList().
-
- The name filter is a wildcarding filter that understands "*" and "?"
- wildcards, You may specify several filter entries separated by a " " or a ";". If
- you want entryList() and entryInfoList() to list all files ending with
- ".cpp" and all files ending with ".h", you simply call
- dir.setNameFilter("*.cpp *.h") or dir.setNameFilter("*.cpp;*.h")
-
- \sa nameFilter(), setFilter()
-*/
-
-void QDir::setNameFilter( const QString &nameFilter )
-{
- nameFilt = nameFilter;
- if ( nameFilt.isEmpty() )
- nameFilt = QString::fromLatin1("*");
- dirty = TRUE;
-}
-
-/*!
- \fn QDir::FilterSpec QDir::filter() const
- Returns the value set by setFilter()
-*/
-
-/*! \enum QDir::FilterSpec
-
- This enum describes how QDir is to select what entries in a
- directory to return. The filter value is specified by or-ing
- together values from the following list: <ul>
-
- <li> \c Dirs - List directories only
- <li> \c Files - List files only
-
- <li> \c Drives - List disk drives (does nothing under unix)
- <li> \c NoSymLinks - Do not list symbolic links (where they exist)
- <li> \c Readable - List files for which the application has read access.
- <li> \c Writable - List files for which the application has write access.
- <li> \c Executable - List files for which the application has execute access
- <li> \c Modified - Only list files that have been modified (does nothing
- under unix)
- <li> \c Hidden - List hidden files (on unix, files starting with a .)
- <li> \c System - List system files (does nothing under unix)
- </ul>
-
- If you do not set any of \c Readable, \c Writable or \c Executable,
- QDir will set all three of them. This makes the default easy to
- write and at the same time useful.
-
- Examples: \c Readable|Writable means list all files for which the
- application has read access, write access or both. \c Dirs|Drives
- means list drives, directories, all files that the application can
- read, write or execute, and also symlinks to such files/directories.
-*/
-
-
-/*!
- Sets the filter used by entryList() and entryInfoList(). The filter is used
- to specify the kind of files that should be returned by entryList() and
- entryInfoList().
-
- \sa filter(), setNameFilter()
-*/
-
-void QDir::setFilter( int filterSpec )
-{
- if ( filtS == (FilterSpec) filterSpec )
- return;
- filtS = (FilterSpec) filterSpec;
- dirty = TRUE;
-}
-
-/*!
- \fn QDir::SortSpec QDir::sorting() const
-
- Returns the value set by setSorting()
-
- \sa setSorting()
-*/
-
-/*! \enum QDir::SortSpec
-
- This enum describes how QDir is to sort entries in a directory when
- it returns a list of them. The sort value is specified by or-ing
- together values from the following list: <ul>
-
- <li> \c Name - sort by name
- <li> \c Time - sort by time (modification time)
- <li> \c Size - sort by file size
- <li> \c Unsorted - do not sort
-
- <li> \c DirsFirst - put all directories first in the list
- <li> \c Reversed - reverse the sort order
- <li> \c IgnoreCase - sort case-insensitively
-
- </ul>
-
- You can only specify one of the first four. If you specify both \c
- DirsFirst and \c Reversed, directories are still put first but the
- list is otherwise reversed.
-*/
-
-// ### Unsorted+DirsFirst ? Unsorted+Reversed?
-
-/*!
- Sets the sorting order used by entryList() and entryInfoList().
-
- The \e sortSpec is specified by or-ing values from the enum
- SortSpec. The different values are:
-
- One of these:
- <dl compact>
- <dt>Name<dd> Sort by name (alphabetical order).
- <dt>Time<dd> Sort by time (most recent first).
- <dt>Size<dd> Sort by size (largest first).
- <dt>Unsorted<dd> Use the operating system order (UNIX does NOT sort
- alphabetically).
-
- ORed with zero or more of these:
-
- <dt>DirsFirst<dd> Always put directory names first.
- <dt>Reversed<dd> Reverse sort order.
- <dt>IgnoreCase<dd> Ignore case when sorting by name.
- </dl>
-*/
-
-void QDir::setSorting( int sortSpec )
-{
- if ( sortS == (SortSpec) sortSpec )
- return;
- sortS = (SortSpec) sortSpec;
- dirty = TRUE;
-}
-
-/*!
- \fn bool QDir::matchAllDirs() const
- Returns the value set by setMatchAllDirs()
-
- \sa setMatchAllDirs()
-*/
-
-/*!
- If \e enable is TRUE, all directories will be listed (even if they do not
- match the filter or the name filter), otherwise only matched directories
- will be listed.
-
- \bug Currently, directories that do not match the filter will not be
- included (the name filter will be ignored as expected).
-
- \sa matchAllDirs()
-*/
-
-void QDir::setMatchAllDirs( bool enable )
-{
- if ( (bool)allDirs == enable )
- return;
- allDirs = enable;
- dirty = TRUE;
-}
-
-
-/*!
- Returns the number of files that was found.
- Equivalent to entryList().count().
- \sa operator[](), entryList()
-*/
-
-uint QDir::count() const
-{
- return entryList().count();
-}
-
-/*!
- Returns the file name at position \e index in the list of found file
- names.
- Equivalent to entryList().at(index).
-
- Returns null if the \e index is out of range or if the entryList()
- function failed.
-
- \sa count(), entryList()
-*/
-
-QString QDir::operator[]( int index ) const
-{
- entryList();
- return fList && index >= 0 && index < (int)fList->count() ?
- (*fList)[index] : QString::null;
-}
-
-
-/*!
- This function is included to easy porting from Qt 1.x to Qt 2.0,
- it is the same as entryList(), but encodes the filenames as 8-bit
- strings using QFile::encodedName().
-
- It is more efficient to use entryList().
-*/
-QStrList QDir::encodedEntryList( int filterSpec, int sortSpec ) const
-{
- QStrList r;
- QStringList l = entryList(filterSpec,sortSpec);
- for ( QStringList::Iterator it = l.begin(); it != l.end(); ++it ) {
- r.append( QFile::encodeName(*it) );
- }
- return r;
-}
-
-/*!
- This function is included to easy porting from Qt 1.x to Qt 2.0,
- it is the same as entryList(), but encodes the filenames as 8-bit
- strings using QFile::encodedName().
-
- It is more efficient to use entryList().
-*/
-QStrList QDir::encodedEntryList( const QString &nameFilter,
- int filterSpec,
- int sortSpec ) const
-{
- QStrList r;
- QStringList l = entryList(nameFilter,filterSpec,sortSpec);
- for ( QStringList::Iterator it = l.begin(); it != l.end(); ++it ) {
- r.append( QFile::encodeName(*it) );
- }
- return r;
-}
-
-
-
-/*!
- Returns a list of the names of all files and directories in the directory
- indicated by the setSorting(), setFilter() and setNameFilter()
- specifications.
-
- The filter and sorting specifications can be overridden using the
- \e filterSpec and \e sortSpec arguments.
-
- Returns an empty list if the directory is unreadable or does not exist.
-
- \sa entryInfoList(), setNameFilter(), setSorting(), setFilter(),
- encodedEntryList()
-*/
-
-QStringList QDir::entryList( int filterSpec, int sortSpec ) const
-{
- if ( !dirty && filterSpec == (int)DefaultFilter &&
- sortSpec == (int)DefaultSort )
- return *fList;
- return entryList( nameFilt, filterSpec, sortSpec );
-}
-
-/*!
- Returns a list of the names of all files and directories in the directory
- indicated by the setSorting(), setFilter() and setNameFilter()
- specifications.
-
- The filter and sorting specifications can be overridden using the
- \e nameFilter, \e filterSpec and \e sortSpec arguments.
-
- Returns and empty list if the directory is unreadable or does not exist.
-
- \sa entryInfoList(), setNameFilter(), setSorting(), setFilter(),
- encodedEntryList()
-*/
-
-QStringList QDir::entryList( const QString &nameFilter,
- int filterSpec, int sortSpec ) const
-{
- if ( filterSpec == (int)DefaultFilter )
- filterSpec = filtS;
- if ( sortSpec == (int)DefaultSort )
- sortSpec = sortS;
- QDir *that = (QDir*)this; // mutable function
- if ( that->readDirEntries(nameFilter, filterSpec, sortSpec) )
- return *that->fList;
- else
- return QStringList();
-}
-
-/*!
- Returns a list of QFileInfo objects for all files and directories in
- the directory pointed to using the setSorting(), setFilter() and
- setNameFilter() specifications.
-
- The filter and sorting specifications can be overridden using the
- \e filterSpec and \e sortSpec arguments.
-
- Returns 0 if the directory is unreadable or does not exist.
-
- The returned pointer is a const pointer to a QFileInfoList. The list is
- owned by the QDir object and will be reused on the next call to
- entryInfoList() for the same QDir instance. If you want to keep the
- entries of the list after a subsequent call to this function you will
- need to copy them.
-
- \sa entryList(), setNameFilter(), setSorting(), setFilter()
-*/
-
-const QFileInfoList *QDir::entryInfoList( int filterSpec, int sortSpec ) const
-{
- if ( !dirty && filterSpec == (int)DefaultFilter &&
- sortSpec == (int)DefaultSort )
- return fiList;
- return entryInfoList( nameFilt, filterSpec, sortSpec );
-}
-
-/*!
- Returns a list of QFileInfo objects for all files and directories in
- the directory pointed to using the setSorting(), setFilter() and
- setNameFilter() specifications.
-
- The filter and sorting specifications can be overridden using the
- \e nameFilter, \e filterSpec and \e sortSpec arguments.
-
- Returns 0 if the directory is unreadable or does not exist.
-
- The returned pointer is a const pointer to a QFileInfoList. The list is
- owned by the QDir object and will be reused on the next call to
- entryInfoList() for the same QDir instance. If you want to keep the
- entries of the list after a subsequent call to this function you will
- need to copy them.
-
- \sa entryList(), setNameFilter(), setSorting(), setFilter()
-*/
-
-const QFileInfoList *QDir::entryInfoList( const QString &nameFilter,
- int filterSpec, int sortSpec ) const
-{
- if ( filterSpec == (int)DefaultFilter )
- filterSpec = filtS;
- if ( sortSpec == (int)DefaultSort )
- sortSpec = sortS;
- QDir *that = (QDir*)this; // mutable function
- if ( that->readDirEntries(nameFilter, filterSpec, sortSpec) )
- return that->fiList;
- else
- return 0;
-}
-
-/*!
- Returns TRUE if the directory exists. (If a file with the same
- name is found this function will of course return FALSE).
-
- \sa QFileInfo::exists(), QFile::exists()
-*/
-
-bool QDir::exists() const
-{
- QFileInfo fi( dPath );
- return fi.exists() && fi.isDir();
-}
-
-/*!
- Returns TRUE if the directory path is relative to the current directory,
- FALSE if the path is absolute (e.g. under UNIX a path is relative if it
- does not start with a '/').
-
- According to Einstein this function should always return TRUE.
-
- \sa convertToAbs()
-*/
-
-bool QDir::isRelative() const
-{
- return isRelativePath( dPath );
-}
-
-/*!
- Converts the directory path to an absolute path. If it is already
- absolute nothing is done.
-
- \sa isRelative()
-*/
-
-void QDir::convertToAbs()
-{
- dPath = absPath();
-}
-
-/*!
- Makes a copy of d and assigns it to this QDir.
-*/
-
-QDir &QDir::operator=( const QDir &d )
-{
- dPath = d.dPath;
- delete fList;
- fList = 0;
- delete fiList;
- fiList = 0;
- nameFilt = d.nameFilt;
- dirty = TRUE;
- allDirs = d.allDirs;
- filtS = d.filtS;
- sortS = d.sortS;
- return *this;
-}
-
-/*!
- Sets the directory path to be the given path.
-*/
-
-QDir &QDir::operator=( const QString &path )
-{
- dPath = cleanDirPath( path );
- dirty = TRUE;
- return *this;
-}
-
-
-/*!
- \fn bool QDir::operator!=( const QDir &d ) const
- Returns TRUE if the \e d and this dir have different path or
- different sort/filter settings, otherwise FALSE.
-*/
-
-/*!
- Returns TRUE if the \e d and this dir have the same path and all sort
- and filter settings are equal, otherwise FALSE.
-*/
-
-bool QDir::operator==( const QDir &d ) const
-{
- return dPath == d.dPath &&
- nameFilt == d.nameFilt &&
- allDirs == d.allDirs &&
- filtS == d.filtS &&
- sortS == d.sortS;
-}
-
-
-/*!
- Removes a file.
-
- If \e acceptAbsPath is TRUE a path starting with a separator ('/')
- will remove the file with the absolute path, if \e acceptAbsPath is FALSE
- any number of separators at the beginning of \e fileName will be removed.
-
- Returns TRUE if successful, otherwise FALSE.
-*/
-
-bool QDir::remove( const QString &fileName, bool acceptAbsPath )
-{
- if ( fileName.isEmpty() ) {
-#if defined(CHECK_NULL)
- qWarning( "QDir::remove: Empty or null file name" );
-#endif
- return FALSE;
- }
- QString p = filePath( fileName, acceptAbsPath );
- return QFile::remove( p );
-}
-
-/*!
- Checks for existence of a file.
-
- If \e acceptAbsPaths is TRUE a path starting with a separator ('/')
- will check the file with the absolute path, if \e acceptAbsPath is FALSE
- any number of separators at the beginning of \e name will be removed.
-
- Returns TRUE if the file exists, otherwise FALSE.
-
- \sa QFileInfo::exists(), QFile::exists()
-*/
-
-bool QDir::exists( const QString &name, bool acceptAbsPath )
-{
- if ( name.isEmpty() ) {
-#if defined(CHECK_NULL)
- qWarning( "QDir::exists: Empty or null file name" );
-#endif
- return FALSE;
- }
- QString tmp = filePath( name, acceptAbsPath );
- return QFile::exists( tmp );
-}
-
-/*!
- Returns the native directory separator; '/' under UNIX and '\' under
- MS-DOS, Windows NT and OS/2.
-
- You do not need to use this function to build file paths. If you always
- use '/', Qt will translate your paths to conform to the underlying
- operating system.
-*/
-
-char QDir::separator()
-{
-#if defined(_OS_UNIX_)
- return '/';
-#elif defined (_OS_FATFS_)
- return '\\';
-#elif defined (_OS_MAC_)
- return ':';
-#else
- return '/';
-#endif
-}
-
-/*!
- Returns the current directory.
- \sa currentDirPath(), QDir::QDir()
-*/
-
-QDir QDir::current()
-{
- return QDir( currentDirPath() );
-}
-
-/*!
- Returns the home directory.
- \sa homeDirPath()
-*/
-
-QDir QDir::home()
-{
- return QDir( homeDirPath() );
-}
-
-/*!
- Returns the root directory.
- \sa rootDirPath() drives()
-*/
-
-QDir QDir::root()
-{
- return QDir( rootDirPath() );
-}
-
-/*!
- \fn QString QDir::homeDirPath()
-
- Returns the absolute path for the user's home directory,
- \sa home()
-*/
-
-QStringList qt_makeFilterList( const QString &filter )
-{
- if ( filter.isEmpty() )
- return QStringList();
-
- QChar sep( ';' );
- int i = filter.find( sep, 0 );
- if ( i == -1 && filter.find( ' ', 0 ) != -1 )
- sep = QChar( ' ' );
-
- QStringList lst = QStringList::split( sep, filter );
- QStringList lst2;
- QStringList::Iterator it = lst.begin();
-
- for ( ; it != lst.end(); ++it ) {
- QString s = *it;
- lst2 << s.stripWhiteSpace();
- }
- return lst2;
-}
-
-/*!
- Returns TRUE if the \e fileName matches one of the wildcards in the list \e filters.
- \sa QRegExp
-*/
-
-bool QDir::match( const QStringList &filters, const QString &fileName )
-{
- QStringList::ConstIterator sit = filters.begin();
- bool matched = FALSE;
- for ( ; sit != filters.end(); ++sit ) {
- QRegExp regexp( (*sit).data(), FALSE, TRUE );
- if ( regexp.match( fileName.data() ) != -1 ) {
- matched = TRUE;
- break;
- }
- }
-
- return matched;
-}
-
-/*!
- Returns TRUE if the \e fileName matches the wildcard \e filter.
- \a Filter may also contain multiple wildcards separated by spaces or
- semicolons.
- \sa QRegExp
-*/
-
-bool QDir::match( const QString &filter, const QString &fileName )
-{
- QStringList lst = qt_makeFilterList( filter );
- return match( lst, fileName );
-}
-
-
-/*!
- Removes all multiple directory separators ('/') and resolves
- any "." or ".." found in the path.
-
- Symbolic links are kept. This function does not return the
- canonical path, but rather the most simplified version of the input.
- "../stuff" becomes "stuff", "stuff/../nonsense" becomes "nonsense"
- and "\\stuff\\more\\..\\nonsense" becomes "\\stuff\\nonsense".
-
- \sa absPath() canonicalPath()
-*/
-
-QString QDir::cleanDirPath( const QString &filePath )
-{
- QString name = filePath;
- QString newPath;
-
- if ( name.isEmpty() )
- return name;
-
- slashify( name );
-
- bool addedSeparator;
- if ( isRelativePath(name) ) {
- addedSeparator = TRUE;
- name.insert( 0, '/' );
- } else {
- addedSeparator = FALSE;
- }
-
- int ePos, pos, upLevel;
-
- pos = ePos = name.length();
- upLevel = 0;
- int len;
-
- while ( pos && (pos = name.findRev('/',--pos)) != -1 ) {
- len = ePos - pos - 1;
- if ( len == 2 && name.at(pos + 1) == '.'
- && name.at(pos + 2) == '.' ) {
- upLevel++;
- } else {
- if ( len != 0 && (len != 1 || name.at(pos + 1) != '.') ) {
- if ( !upLevel )
- newPath = QString::fromLatin1("/")
- + name.mid(pos + 1, len) + newPath;
- else
- upLevel--;
- }
- }
- ePos = pos;
- }
- if ( addedSeparator ) {
- while ( upLevel-- )
- newPath.insert( 0, QString::fromLatin1("/..") );
- if ( !newPath.isEmpty() )
- newPath.remove( 0, 1 );
- else
- newPath = QString::fromLatin1(".");
- } else {
- if ( newPath.isEmpty() )
- newPath = QString::fromLatin1("/");
-#if defined(_OS_FATFS_) || defined(_OS_OS2EMX_)
- if ( name[0] == '/' ) {
- if ( name[1] == '/' ) // "\\machine\x\ ..."
- newPath.insert( 0, '/' );
- } else {
- newPath = name.left(2) + newPath;
- }
-#endif
- }
- return newPath;
-}
-
-int qt_cmp_si_sortSpec;
-
-#if defined(Q_C_CALLBACKS)
-extern "C" {
-#endif
-
-int qt_cmp_si( const void *n1, const void *n2 )
-{
- if ( !n1 || !n2 )
- return 0;
-
- QDirSortItem* f1 = (QDirSortItem*)n1;
- QDirSortItem* f2 = (QDirSortItem*)n2;
-
- if ( qt_cmp_si_sortSpec & QDir::DirsFirst )
- if ( f1->item->isDir() != f2->item->isDir() )
- return f1->item->isDir() ? -1 : 1;
-
- int r = 0;
- int sortBy = qt_cmp_si_sortSpec & QDir::SortByMask;
-
- switch ( sortBy ) {
- case QDir::Time:
- r = f1->item->lastModified().secsTo(f2->item->lastModified());
- break;
- case QDir::Size:
- r = f2->item->size() - f1->item->size();
- break;
- default:
- ;
- }
-
- if ( r == 0 && sortBy != QDir::Unsorted ) {
- // Still not sorted - sort by name
- bool ic = qt_cmp_si_sortSpec & QDir::IgnoreCase;
-
- if ( f1->filename_cache.isNull() )
- f1->filename_cache = ic ? f1->item->fileName().lower()
- : f1->item->fileName();
- if ( f2->filename_cache.isNull() )
- f2->filename_cache = ic ? f2->item->fileName().lower()
- : f2->item->fileName();
-
- r = f1->filename_cache.compare(f2->filename_cache);
- }
-
- if ( r == 0 ) {
- // Enforce an order - the order the items appear in the array
- r = (int)((char*)n1 - (char*)n2);
- }
-
- if ( qt_cmp_si_sortSpec & QDir::Reversed )
- return -r;
- else
- return r;
-}
-
-#if defined(Q_C_CALLBACKS)
-}
-#endif
-
-#endif // QT_NO_DIR
diff --git a/qtools/qdir.h b/qtools/qdir.h
deleted file mode 100644
index cec3897..0000000
--- a/qtools/qdir.h
+++ /dev/null
@@ -1,235 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QDir class
-**
-** Created : 950427
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QDIR_H
-#define QDIR_H
-
-#ifndef QT_H
-#include "qstrlist.h"
-#include "qfileinfo.h"
-#endif // QT_H
-
-#ifndef QT_NO_DIR
-typedef QInternalList<QFileInfo> QFileInfoList;
-typedef QInternalListIterator<QFileInfo> QFileInfoListIterator;
-class QStringList;
-
-
-class Q_EXPORT QDir
-{
-public:
- enum FilterSpec { Dirs = 0x001,
- Files = 0x002,
- Drives = 0x004,
- NoSymLinks = 0x008,
- All = 0x007,
- TypeMask = 0x00F,
-
- Readable = 0x010,
- Writable = 0x020,
- Executable = 0x040,
- RWEMask = 0x070,
-
- Modified = 0x080,
- Hidden = 0x100,
- System = 0x200,
- AccessMask = 0x3F0,
-
- DefaultFilter = -1 };
-
- enum SortSpec { Name = 0x00,
- Time = 0x01,
- Size = 0x02,
- Unsorted = 0x03,
- SortByMask = 0x03,
-
- DirsFirst = 0x04,
- Reversed = 0x08,
- IgnoreCase = 0x10,
- DefaultSort = -1 };
-
- QDir();
- QDir( const QString &path, const QString &nameFilter = QString::null,
- int sortSpec = Name | IgnoreCase, int filterSpec = All );
- QDir( const QDir & );
-
- virtual ~QDir();
-
- QDir &operator=( const QDir & );
- QDir &operator=( const QString &path );
-
- virtual void setPath( const QString &path );
- virtual QString path() const;
- virtual QString absPath() const;
- virtual QString canonicalPath() const;
-
- virtual QString dirName() const;
- virtual QString filePath( const QString &fileName,
- bool acceptAbsPath = TRUE ) const;
- virtual QString absFilePath( const QString &fileName,
- bool acceptAbsPath = TRUE ) const;
-
- static QString convertSeparators( const QString &pathName );
-
- virtual bool cd( const QString &dirName, bool acceptAbsPath = TRUE );
- virtual bool cdUp();
-
- QString nameFilter() const;
- virtual void setNameFilter( const QString &nameFilter );
- FilterSpec filter() const;
- virtual void setFilter( int filterSpec );
- SortSpec sorting() const;
- virtual void setSorting( int sortSpec );
-
- bool matchAllDirs() const;
- virtual void setMatchAllDirs( bool );
-
- uint count() const;
- QString operator[]( int ) const;
-
- virtual QStrList encodedEntryList( int filterSpec = DefaultFilter,
- int sortSpec = DefaultSort ) const;
- virtual QStrList encodedEntryList( const QString &nameFilter,
- int filterSpec = DefaultFilter,
- int sortSpec = DefaultSort ) const;
- virtual QStringList entryList( int filterSpec = DefaultFilter,
- int sortSpec = DefaultSort ) const;
- virtual QStringList entryList( const QString &nameFilter,
- int filterSpec = DefaultFilter,
- int sortSpec = DefaultSort ) const;
-
- virtual const QFileInfoList *entryInfoList( int filterSpec = DefaultFilter,
- int sortSpec = DefaultSort ) const;
- virtual const QFileInfoList *entryInfoList( const QString &nameFilter,
- int filterSpec = DefaultFilter,
- int sortSpec = DefaultSort ) const;
-
- static const QFileInfoList *drives();
-
- virtual bool mkdir( const QString &dirName,
- bool acceptAbsPath = TRUE ) const;
- virtual bool rmdir( const QString &dirName,
- bool acceptAbsPath = TRUE ) const;
-
- virtual bool isReadable() const;
- virtual bool exists() const;
- virtual bool isRoot() const;
-
- virtual bool isRelative() const;
- virtual void convertToAbs();
-
- virtual bool operator==( const QDir & ) const;
- virtual bool operator!=( const QDir & ) const;
-
- virtual bool remove( const QString &fileName,
- bool acceptAbsPath = TRUE );
- virtual bool rename( const QString &name, const QString &newName,
- bool acceptAbsPaths = TRUE );
- virtual bool exists( const QString &name,
- bool acceptAbsPath = TRUE );
-
- static char separator();
-
- static bool setCurrent( const QString &path );
- static QDir current();
- static QDir home();
- static QDir root();
- static QString currentDirPath();
- static QString homeDirPath();
- static QString rootDirPath();
-
- static bool match( const QStringList &filters, const QString &fileName );
- static bool match( const QString &filter, const QString &fileName );
- static QString cleanDirPath( const QString &dirPath );
- static bool isRelativePath( const QString &path );
-
-private:
- void init();
- virtual bool readDirEntries( const QString &nameFilter,
- int FilterSpec, int SortSpec );
-
- static void slashify ( QString &);
-
- QString dPath;
- QStringList *fList;
- QFileInfoList *fiList;
- QString nameFilt;
- FilterSpec filtS;
- SortSpec sortS;
- uint dirty : 1;
- uint allDirs : 1;
-};
-
-
-inline QString QDir::path() const
-{
- return dPath;
-}
-
-inline QString QDir::nameFilter() const
-{
- return nameFilt;
-}
-
-inline QDir::FilterSpec QDir::filter() const
-{
- return filtS;
-}
-
-inline QDir::SortSpec QDir::sorting() const
-{
- return sortS;
-}
-
-inline bool QDir::matchAllDirs() const
-{
- return allDirs;
-}
-
-inline bool QDir::operator!=( const QDir &d ) const
-{
- return !(*this == d);
-}
-
-
-struct QDirSortItem {
- QString filename_cache;
- QFileInfo* item;
-};
-
-#endif // QT_NO_DIR
-#endif // QDIR_H
diff --git a/qtools/qdir_unix.cpp b/qtools/qdir_unix.cpp
deleted file mode 100644
index 2257265..0000000
--- a/qtools/qdir_unix.cpp
+++ /dev/null
@@ -1,290 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QDirclass
-**
-** Created : 950628
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses for Unix/X11 or for Qt/Embedded may use this file in accordance
-** with the Qt Commercial License Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qglobal.h"
-
-#include "qdir.h"
-#ifndef QT_NO_DIR
-
-#include "qfileinfo.h"
-#include "qfiledefs_p.h"
-#include "qregexp.h"
-#include "qstringlist.h"
-#include <stdlib.h>
-#include <ctype.h>
-
-extern QStringList qt_makeFilterList( const QString &filter );
-
-extern int qt_cmp_si_sortSpec;
-
-#if defined(Q_C_CALLBACKS)
-extern "C" {
-#endif
-
-extern int qt_cmp_si( const void *, const void * );
-
-#if defined(Q_C_CALLBACKS)
-}
-#endif
-
-
-void QDir::slashify( QString& )
-{
-}
-
-QString QDir::homeDirPath()
-{
- QString d;
- d = QFile::decodeName(getenv("HOME"));
- slashify( d );
- if ( d.isNull() )
- d = rootDirPath();
- return d;
-}
-
-QString QDir::canonicalPath() const
-{
- QString r;
-
- char cur[PATH_MAX];
- char tmp[PATH_MAX];
- if (GETCWD( cur, PATH_MAX )) {
- if ( CHDIR(QFile::encodeName(dPath)) >= 0 ) {
- if (GETCWD( tmp, PATH_MAX )) {
- r = QFile::decodeName(tmp);
- }
- (void)CHDIR( cur );
- }
- }
-
- slashify( r );
- return r;
-}
-
-bool QDir::mkdir( const QString &dirName, bool acceptAbsPath ) const
-{
- return MKDIR( QFile::encodeName(filePath(dirName,acceptAbsPath)), 0777 )
- == 0;
-}
-
-bool QDir::rmdir( const QString &dirName, bool acceptAbsPath ) const
-{
- return RMDIR( QFile::encodeName(filePath(dirName,acceptAbsPath)) ) == 0;
-}
-
-bool QDir::isReadable() const
-{
- return ACCESS( QFile::encodeName(dPath), R_OK | X_OK ) == 0;
-}
-
-bool QDir::isRoot() const
-{
- return dPath == QString::fromLatin1("/");
-}
-
-bool QDir::rename( const QString &name, const QString &newName,
- bool acceptAbsPaths )
-{
- if ( name.isEmpty() || newName.isEmpty() ) {
-#if defined(CHECK_NULL)
- qWarning( "QDir::rename: Empty or null file name(s)" );
-#endif
- return FALSE;
- }
- QString fn1 = filePath( name, acceptAbsPaths );
- QString fn2 = filePath( newName, acceptAbsPaths );
- return ::rename( QFile::encodeName(fn1),
- QFile::encodeName(fn2) ) == 0;
-}
-
-bool QDir::setCurrent( const QString &path )
-{
- int r;
- r = CHDIR( QFile::encodeName(path) );
- return r >= 0;
-}
-
-QString QDir::currentDirPath()
-{
- QString result;
-
- STATBUF st;
- if ( STAT( ".", &st ) == 0 ) {
- char currentName[PATH_MAX];
- if ( GETCWD( currentName, PATH_MAX ) != 0 )
- result = QFile::decodeName(currentName);
-#if defined(DEBUG)
- if ( result.isNull() )
- qWarning( "QDir::currentDirPath: getcwd() failed" );
-#endif
- } else {
-#if defined(DEBUG)
- qWarning( "QDir::currentDirPath: stat(\".\") failed" );
-#endif
- }
- slashify( result );
- return result;
-}
-
-QString QDir::rootDirPath()
-{
- QString d = QString::fromLatin1( "/" );
- return d;
-}
-
-bool QDir::isRelativePath( const QString &path )
-{
- int len = path.length();
- if ( len == 0 )
- return TRUE;
- return path[0] != '/';
-}
-
-bool QDir::readDirEntries( const QString &nameFilter,
- int filterSpec, int sortSpec )
-{
- int i;
- if ( !fList ) {
- fList = new QStringList;
- CHECK_PTR( fList );
- fiList = new QFileInfoList;
- CHECK_PTR( fiList );
- fiList->setAutoDelete( TRUE );
- } else {
- fList->clear();
- fiList->clear();
- }
-
- QStringList filters = qt_makeFilterList( nameFilter );
-
- bool doDirs = (filterSpec & Dirs) != 0;
- bool doFiles = (filterSpec & Files) != 0;
- bool noSymLinks = (filterSpec & NoSymLinks) != 0;
- bool doReadable = (filterSpec & Readable) != 0;
- bool doWritable = (filterSpec & Writable) != 0;
- bool doExecable = (filterSpec & Executable) != 0;
- bool doHidden = (filterSpec & Hidden) != 0;
-
-#if defined(_OS_OS2EMX_)
- //QRegExp wc( nameFilter, FALSE, TRUE ); // wild card, case insensitive
-#else
- //QRegExp wc( nameFilter, TRUE, TRUE ); // wild card, case sensitive
-#endif
- QFileInfo fi;
- DIR *dir;
- dirent *file;
-
- dir = opendir( QFile::encodeName(dPath) );
- if ( !dir ) {
-#if defined(CHECK_NULL)
- qWarning( "QDir::readDirEntries: Cannot read the directory: %s",
- QFile::encodeName(dPath).data() );
-#endif
- return FALSE;
- }
-
- while ( (file = readdir(dir)) ) {
- QString fn = QFile::decodeName(file->d_name);
- fi.setFile( *this, fn );
- if ( !match( filters, fn ) && !(allDirs && fi.isDir()) )
- continue;
- if ( (doDirs && fi.isDir()) || (doFiles && fi.isFile()) ) {
- if ( noSymLinks && fi.isSymLink() )
- continue;
- if ( (filterSpec & RWEMask) != 0 )
- if ( (doReadable && !fi.isReadable()) ||
- (doWritable && !fi.isWritable()) ||
- (doExecable && !fi.isExecutable()) )
- continue;
- if ( !doHidden && fn[0] == '.' &&
- fn != QString::fromLatin1(".")
- && fn != QString::fromLatin1("..") )
- continue;
- fiList->append( new QFileInfo( fi ) );
- }
- }
- if ( closedir(dir) != 0 ) {
-#if defined(CHECK_NULL)
- qWarning( "QDir::readDirEntries: Cannot close the directory: %s",
- dPath.local8Bit().data() );
-#endif
- }
-
- // Sort...
- if(fiList->count()) {
- QDirSortItem* si= new QDirSortItem[fiList->count()];
- QFileInfo* itm;
- i=0;
- for (itm = fiList->first(); itm; itm = fiList->next())
- si[i++].item = itm;
- qt_cmp_si_sortSpec = sortSpec;
- qsort( si, i, sizeof(si[0]), qt_cmp_si );
- // put them back in the list
- fiList->setAutoDelete( FALSE );
- fiList->clear();
- int j;
- for ( j=0; j<i; j++ ) {
- fiList->append( si[j].item );
- fList->append( si[j].item->fileName() );
- }
- delete [] si;
- fiList->setAutoDelete( TRUE );
- }
-
- if ( filterSpec == (FilterSpec)filtS && sortSpec == (SortSpec)sortS &&
- nameFilter == nameFilt )
- dirty = FALSE;
- else
- dirty = TRUE;
- return TRUE;
-}
-
-const QFileInfoList * QDir::drives()
-{
- // at most one instance of QFileInfoList is leaked, and this variable
- // points to that list
- static QFileInfoList * knownMemoryLeak = 0;
-
- if ( !knownMemoryLeak ) {
- knownMemoryLeak = new QFileInfoList;
- // non-win32 versions both use just one root directory
- knownMemoryLeak->append( new QFileInfo( rootDirPath() ) );
- }
-
- return knownMemoryLeak;
-}
-#endif //QT_NO_DIR
diff --git a/qtools/qdir_win32.cpp b/qtools/qdir_win32.cpp
deleted file mode 100644
index 324ff24..0000000
--- a/qtools/qdir_win32.cpp
+++ /dev/null
@@ -1,485 +0,0 @@
-/******************************************************************************
- *
- *
- *
- * Copyright (C) 1997-2001 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.
- *
- * Based on qdir_unix.cpp
- *
- * Copyright (C) 1992-2000 Trolltech AS.
- */
-
-
-#include "qglobal.h"
-
-#include "qdir.h"
-#ifndef QT_NO_DIR
-
-
-#include "qfileinfo.h"
-#include "qfiledefs_p.h"
-#include "qregexp.h"
-#include "qstringlist.h"
-#include <stdlib.h>
-#include <ctype.h>
-#if defined(_OS_WIN32_)
-#if defined(_CC_BOOL_DEF_)
-#undef bool
-#include <windows.h>
-#define bool int
-#else
-#include <windows.h>
-#endif
-#endif
-#if defined(_OS_OS2EMX_)
-extern Q_UINT32 DosQueryCurrentDisk(Q_UINT32*,Q_UINT32*);
-#define NO_ERROR 0
-#endif
-
-extern QStringList qt_makeFilterList( const QString &filter );
-
-extern int qt_cmp_si_sortSpec;
-
-#if defined(Q_C_CALLBACKS)
-extern "C" {
-#endif
-
-extern int qt_cmp_si( const void *, const void * );
-
-#if defined(Q_C_CALLBACKS)
-}
-#endif
-
-static QString p_getenv( QString name )
-{
- DWORD len = GetEnvironmentVariableW( ( LPCWSTR ) qt_winTchar ( name, TRUE ), NULL, 0 );
- if ( len == 0 )
- return QString::null;
- /* ansi: we allocate too much memory, but this shouldn't be the problem here ... */
- LPWSTR buf = (LPWSTR)new WCHAR[ len ];
- len = GetEnvironmentVariableW ( ( LPCWSTR ) qt_winTchar ( name, TRUE ), buf, len );
- if ( len == 0 )
- {
- delete[] buf;
- return QString::null;
- }
- QString ret = qt_winQString ( buf );
- delete[] buf;
- return ret;
-}
-
-
-void QDir::slashify( QString& n )
-{
- for ( int i=0; i<(int)n.length(); i++ )
- {
- if ( n[i] == '\\' )
- n[i] = '/';
- }
-}
-
-QString QDir::homeDirPath()
-{
- QString d = p_getenv ( "HOME" );
- if ( d.isNull () ) {
- d = p_getenv ( "USERPROFILE" );
- if ( d.isNull () ) {
- QString homeDrive = p_getenv ( "HOMEDRIVE" );
- QString homePath = p_getenv ( "HOMEPATH" );
- if ( !homeDrive.isNull () && !homePath.isNull () ) {
- d = homeDrive + homePath;
- } else {
- d = rootDirPath ();
- }
- }
- }
- slashify( d );
- return d;
-}
-
-QString QDir::canonicalPath() const
-{
- QString r;
-
- char cur[PATH_MAX];
- char tmp[PATH_MAX];
- GETCWD( cur, PATH_MAX );
- if ( CHDIR(QFile::encodeName(dPath)) >= 0 ) {
- GETCWD( tmp, PATH_MAX );
- r = QFile::decodeName(tmp);
- }
- CHDIR( cur );
-
- slashify( r );
- return r;
-}
-
-bool QDir::mkdir( const QString &dirName, bool acceptAbsPath ) const
-{
-#if defined(__CYGWIN32_)
- return MKDIR( QFile::encodeName(filePath(dirName,acceptAbsPath)), 0777 ) == 0;
-#else
- return _wmkdir( ( LPCWSTR ) filePath( dirName, acceptAbsPath ).ucs2() ) == 0;
-#endif
-}
-
-bool QDir::rmdir( const QString &dirName, bool acceptAbsPath ) const
-{
-#if defined(__CYGWIN32_)
- return RMDIR( QFile::encodeName(filePath(dirName,acceptAbsPath)) ) == 0;
-#else
- return _wrmdir( ( LPCWSTR ) filePath( dirName, acceptAbsPath ).ucs2() ) == 0;
-#endif
-}
-
-bool QDir::isReadable() const
-{
- QString path = dPath;
- if ( ( path[ 0 ] == '\\' ) || ( path[ 0 ] == '/' ) )
- path = rootDirPath() + path;
-#if defined(__CYGWIN32_)
- return ACCESS( QFile::encodeName(dPath), R_OK ) == 0;
-#else
- return ( _waccess( (wchar_t*) path.ucs2(), R_OK ) == 0 );
-#endif
-}
-
-bool QDir::isRoot() const
-{
- QString path = dPath;
- slashify( path );
- return path == rootDirPath ();
-}
-
-bool QDir::rename( const QString &name, const QString &newName,
- bool acceptAbsPaths )
-{
- if ( name.isEmpty() || newName.isEmpty() ) {
-#if defined(CHECK_NULL)
- qWarning( "QDir::rename: Empty or null file name(s)" );
-#endif
- return FALSE;
- }
- QString fn1 = filePath( name, acceptAbsPaths );
- QString fn2 = filePath( newName, acceptAbsPaths );
-#if defined(__CYGWIN32_)
- return ::rename( QFile::encodeName(fn1),
- QFile::encodeName(fn2) ) == 0;
-#else
- return MoveFileW( ( LPCWSTR ) fn1.ucs2(), ( LPCWSTR ) fn2.ucs2() ) != 0;
-#endif
-}
-
-bool QDir::setCurrent( const QString &path )
-{
-#if defined(__CYGWIN32_)
- int r;
- r = CHDIR( QFile::encodeName(path) );
- return r >= 0;
-#else
- if ( !QDir( path ).exists() )
- return false;
- return ( SetCurrentDirectoryW( ( LPCWSTR ) path.ucs2() ) >= 0 );
-#endif
-}
-
-QString QDir::currentDirPath()
-{
- QString result;
-
-#if defined(__CYGWIN32_)
-
- STATBUF st;
- if ( STAT( ".", &st ) == 0 ) {
- char currentName[PATH_MAX];
- if ( GETCWD( currentName, PATH_MAX ) != 0 )
- result = QFile::decodeName(currentName);
-#if defined(DEBUG)
- if ( result.isNull() )
- qWarning( "QDir::currentDirPath: getcwd() failed" );
-#endif
- } else {
-#if defined(DEBUG)
- qWarning( "QDir::currentDirPath: stat(\".\") failed" );
-#endif
- }
-
-#else
-
- DWORD size = 0;
- WCHAR currentName[ PATH_MAX ];
- size = ::GetCurrentDirectoryW( PATH_MAX, currentName );
- if ( size != 0 ) {
- if ( size > PATH_MAX ) {
- WCHAR * newCurrentName = new WCHAR[ size ];
- if ( ::GetCurrentDirectoryW( PATH_MAX, newCurrentName ) != 0 )
- result = QString::fromUcs2( ( ushort* ) newCurrentName );
- delete [] newCurrentName;
- } else {
- result = QString::fromUcs2( ( ushort* ) currentName );
- }
- }
-
- if ( result.length() >= 2 && result[ 1 ] == ':' )
- result[ 0 ] = result.at( 0 ).upper(); // Force uppercase drive letters.
-#endif
- slashify( result );
- return result;
-}
-
-QString QDir::rootDirPath()
-{
- QString d = p_getenv ( "SystemDrive" );
- if ( d.isNull () )
- d = QString::fromLatin1( "c:" ); // not "c:\\" !
- slashify ( d );
- return d;
-}
-
-bool QDir::isRelativePath( const QString &path )
-{
- if ( path.isEmpty() )
- return TRUE;
- int p = 0;
- if ( path[ 0 ].isLetter() && path[ 1 ] == ':' )
- p = 2; // we have checked the first 2.
- return ( ( path[ p ] != '/' ) && ( path[ p ] != '\\' ) );
-}
-
-#undef IS_SUBDIR
-#undef IS_RDONLY
-#undef IS_ARCH
-#undef IS_HIDDEN
-#undef IS_SYSTEM
-#undef FF_GETFIRST
-#undef FF_GETNEXT
-#undef FF_ERROR
-
-#if defined(_OS_WIN32_)
-#define IS_SUBDIR FILE_ATTRIBUTE_DIRECTORY
-#define IS_RDONLY FILE_ATTRIBUTE_READONLY
-#define IS_ARCH FILE_ATTRIBUTE_ARCHIVE
-#define IS_HIDDEN FILE_ATTRIBUTE_HIDDEN
-#define IS_SYSTEM FILE_ATTRIBUTE_SYSTEM
-#define FF_GETFIRST FindFirstFile
-#define FF_GETNEXT FindNextFile
-#define FF_ERROR INVALID_HANDLE_VALUE
-#else
-#define IS_SUBDIR _A_SUBDIR
-#define IS_RDONLY _A_RDONLY
-#define IS_ARCH _A_ARCH
-#define IS_HIDDEN _A_HIDDEN
-#define IS_SYSTEM _A_SYSTEM
-#define FF_GETFIRST _findfirst
-#define FF_GETNEXT _findnext
-#define FF_ERROR -1
-#endif
-
-
-bool QDir::readDirEntries( const QString &nameFilter,
- int filterSpec, int sortSpec )
-{
- int i;
- if ( !fList ) {
- fList = new QStringList;
- CHECK_PTR( fList );
- fiList = new QFileInfoList;
- CHECK_PTR( fiList );
- fiList->setAutoDelete( TRUE );
- } else {
- fList->clear();
- fiList->clear();
- }
-
- QStringList filters = qt_makeFilterList( nameFilter );
-
- bool doDirs = (filterSpec & Dirs) != 0;
- bool doFiles = (filterSpec & Files) != 0;
- bool noSymLinks = (filterSpec & NoSymLinks) != 0;
- bool doReadable = (filterSpec & Readable) != 0;
- bool doWritable = (filterSpec & Writable) != 0;
- bool doExecable = (filterSpec & Executable) != 0;
- bool doHidden = (filterSpec & Hidden) != 0;
- // show hidden files if the user asks explicitly for e.g. .*
- if ( !doHidden && !nameFilter.isEmpty() && nameFilter[0] == '.' )
- doHidden = TRUE;
- bool doModified = (filterSpec & Modified) != 0;
- bool doSystem = (filterSpec & System) != 0;
-
- QRegExp wc( nameFilter.data(), FALSE, TRUE ); // wild card, case insensitive
- bool first = TRUE;
- QString p = dPath.copy();
- int plen = p.length();
-#if defined(_OS_WIN32_)
- HANDLE ff;
- WIN32_FIND_DATAW finfo;
-#else
- long ff;
- _finddata_t finfo;
-#endif
- QFileInfo fi;
- if ( plen == 0 )
- {
-#if defined(CHECK_NULL)
- warning( "QDir::readDirEntries: No directory name specified" );
-#endif
- return FALSE;
- }
- if ( p.at(plen-1) != '/' && p.at(plen-1) != '\\' )
- p += '/';
- p += "*.*";
-
-#if defined(__CYGWIN32_)
- ff = FF_GETFIRST( p.data(), &finfo );
-#else
- ff = FindFirstFileW ( ( LPCWSTR ) p.ucs2(), &finfo );
-#endif
- if ( ff == FF_ERROR )
- {
-#if defined(DEBUG)
- warning( "QDir::readDirEntries: Cannot read the directory: %s",
- (const char *)dPath.utf8() );
-#endif
- return FALSE;
- }
-
- while ( TRUE )
- {
- if ( first )
- first = FALSE;
- else
- {
-#if defined(__CYGWIN32_)
- if ( FF_GETNEXT(ff,&finfo) == -1 )
- break;
-#else
- //if ( !FF_GETNEXT(ff,&finfo) )
- // break;
- if (!FindNextFileW(ff, &finfo ))
- break;
-#endif
- }
-#if defined(__CYGWIN32_)
- int attrib = finfo.attrib;
-#else
- int attrib = finfo.dwFileAttributes;
-#endif
- bool isDir = (attrib & IS_SUBDIR) != 0;
- bool isFile = !isDir;
- bool isSymLink = FALSE;
- bool isReadable = TRUE;
- bool isWritable = (attrib & IS_RDONLY) == 0;
- bool isExecable = FALSE;
- bool isModified = (attrib & IS_ARCH) != 0;
- bool isHidden = (attrib & IS_HIDDEN) != 0;
- bool isSystem = (attrib & IS_SYSTEM) != 0;
-
-#if defined(__CYGWIN32_)
- const char *fname = finfo.name;
-#else
- //const char *fname = finfo.cFileName;
- QString fname = QString::fromUcs2( ( const unsigned short* ) finfo.cFileName);
-#endif
- if ( wc.match(fname.utf8()) == -1 && !(allDirs && isDir) )
- continue;
-
- QString name = fname;
- if ( doExecable )
- {
- QString ext = name.right(4).lower();
- if ( ext == ".exe" || ext == ".com" || ext == ".bat" ||
- ext == ".pif" || ext == ".cmd" )
- isExecable = TRUE;
- }
-
- if ( (doDirs && isDir) || (doFiles && isFile) )
- {
- if ( noSymLinks && isSymLink )
- continue;
- if ( (filterSpec & RWEMask) != 0 )
- if ( (doReadable && !isReadable) ||
- (doWritable && !isWritable) ||
- (doExecable && !isExecable) )
- continue;
- if ( doModified && !isModified )
- continue;
- if ( !doHidden && isHidden )
- continue;
- if ( !doSystem && isSystem )
- continue;
- fi.setFile( *this, name );
- fiList->append( new QFileInfo( fi ) );
- }
- }
-#if defined(__CYGWIN32_)
- _findclose( ff );
-#else
- FindClose( ff );
-#endif
-
- // Sort...
- QDirSortItem* si= new QDirSortItem[fiList->count()];
- QFileInfo* itm;
- i=0;
- for (itm = fiList->first(); itm; itm = fiList->next())
- si[i++].item = itm;
- qt_cmp_si_sortSpec = sortSpec;
- qsort( si, i, sizeof(si[0]), qt_cmp_si );
- // put them back in the list
- fiList->setAutoDelete( FALSE );
- fiList->clear();
- int j;
- for ( j=0; j<i; j++ ) {
- fiList->append( si[j].item );
- fList->append( si[j].item->fileName() );
- }
- delete [] si;
- fiList->setAutoDelete( TRUE );
-
- if ( filterSpec == (FilterSpec)filtS && sortSpec == (SortSpec)sortS &&
- nameFilter == nameFilt )
- dirty = FALSE;
- else
- dirty = TRUE;
- return TRUE;
-}
-
-const QFileInfoList * QDir::drives()
-{
- // at most one instance of QFileInfoList is leaked, and this variable
- // points to that list
- static QFileInfoList * knownMemoryLeak = 0;
-
- if ( !knownMemoryLeak ) {
- knownMemoryLeak = new QFileInfoList;
-
-#if defined(_OS_WIN32_)
- Q_UINT32 driveBits = (Q_UINT32) GetLogicalDrives() & 0x3ffffff;
-#elif defined(_OS_OS2EMX_)
- Q_UINT32 driveBits, cur;
- if (DosQueryCurrentDisk(&cur,&driveBits) != NO_ERROR)
- exit(1);
- driveBits &= 0x3ffffff;
-#endif
- char driveName[4];
- qstrcpy( driveName, "a:/" );
- while( driveBits ) {
- if ( driveBits & 1 )
- knownMemoryLeak->append( new QFileInfo( driveName ) );
- driveName[0]++;
- driveBits = driveBits >> 1;
- }
- }
-
- return knownMemoryLeak;
-}
-#endif //QT_NO_DIR
diff --git a/qtools/qfeatures.h b/qtools/qfeatures.h
deleted file mode 100644
index 1042ce6..0000000
--- a/qtools/qfeatures.h
+++ /dev/null
@@ -1,978 +0,0 @@
-/****************************************************************************
-**
-**
-** Global feature selection
-**
-** Created : 000417
-**
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QFEATURES_H
-#define QFEATURES_H
-
-/*! \page features....html
- ...
-*/
-
-// Qt ships with a number of pre-defined configurations. If none suit
-// your needs, define QCONFIG_LOCAL and create a "qconfig-local.h" file.
-//
-// Note that disabling some features will produce a libqt that is not
-// compatible with other libqt builds. Such modifications are only
-// supported on Qt/Embedded where reducing the library size is important
-// and where the application-suite is often a fixed set.
-//
-#if defined(QCONFIG_LOCAL)
-#include <qconfig-local.h>
-#elif defined(QCONFIG_MINIMAL)
-#include <qconfig-minimal.h>
-#elif defined(QCONFIG_SMALL)
-#include <qconfig-small.h>
-#elif defined(QCONFIG_MEDIUM)
-#include <qconfig-medium.h>
-#elif defined(QCONFIG_LARGE)
-#include <qconfig-large.h>
-#else // everything...
-#include <qconfig.h>
-#endif
-
-
-// Data structures
-/*!
- QStringList
-*/
-//#define QT_NO_STRINGLIST
-
-#if defined(QT_NO_IMAGE_SMOOTHSCALE)
-/*!
- QIconSet
-*/
-# define QT_NO_ICONSET
-#endif
-
-// File I/O
-#if defined(QT_NO_STRINGLIST)
- /*!
- QDir
- */
-# define QT_NO_DIR
-#endif
-
-/*!
- Palettes
-*/
-//#define QT_NO_PALETTE
-
-/*!
- QTextStream
-*/
-//#define QT_NO_TEXTSTREAM
-/*!
- QDataStream
-*/
-//#define QT_NO_DATASTREAM
-
-/*!
- Dynamic module linking
-*/
-//#define QT_NO_PLUGIN
-
-
-// Images
-/*!
- BMP image I/O
- <p>The Windows Bitmap (BMP) image format is common on MS-Windows.
- <p>This is an uncompressed image format
- offering few advantages over PNG or JPEG.
-*/
-#if defined(QT_NO_DATASTREAM)
-# define QT_NO_IMAGEIO_BMP
-#endif
-/*!
- PPM image I/O
- <p>The Portable PixMap (PPM) image format is common on Unix.
- <p>This is an uncompressed image format
- offering few advantages over PNG or JPEG.
-*/
-//#define QT_NO_IMAGEIO_PPM
-/*!
- XBM image I/O
- <p>The X11 BitMap (XBM) image format is common on X11.
- <p>This is an uncompressed monochrome image format.
- Qt uses this format for some internal images (eg. mouse cursors).
-*/
-//#define QT_NO_IMAGEIO_XBM
-/*!
- XPM image I/O
- <p>The X11 PixMap (XPM) image format is common on X11.
- <p>This is an uncompressed image format.
- XPM images have the small advantage that they can be trivially
- included in source files as they are C code.
- Qt uses this format for some internal images (eg. QMessageBox icons).
-*/
-#if defined(QT_NO_TEXTSTREAM)
-# define QT_NO_IMAGEIO_XPM
-#endif
-/*!
- PNG image I/O
- <p>The Portable Network Graphics (PNG) is a compressed image format.
- <p>See <a href=http://www.libpng.org/pub/png/>The PNG Home Site</a> for
- details of the format.
-*/
-//#define QT_NO_IMAGEIO_PNG
-/*!
- MNG image I/O
- <p>The Multiple-image Network Graphics (MNG) is a compressed animation format.
- <p>See <a href=http://www.libpng.org/pub/mng/>The MNG Home Site</a> for
- details of the format.
-*/
-//#define QT_NO_IMAGEIO_MNG
-/*!
- JPEG image I/O
- <p>The Joint Photographic Experts Group (JPEG) is a compressed lossy image format that gives high compression
- for real-world and photo-realistic images.
-*/
-//#define QT_NO_IMAGEIO_JPEG
-
-/*!
- Asynchronous I/O
- <p>Allows push-driven data processing.
-*/
-//#define QT_NO_ASYNC_IO
-/*!
- Asynchronous image I/O
- <p>Allows push-driven images.
-*/
-//#define QT_NO_ASYNC_IMAGE_IO
-#if defined(QT_NO_ASYNC_IO) || defined(QT_NO_ASYNC_IMAGE_IO)
- /*!
- Animated images
- <p>This includes animated GIFs.
- <p><b>Note: this currently also requires <tt>QT_BUILTIN_GIF_READER</tt> to
- be defined when building Qt.</b>
- */
-# define QT_NO_MOVIE
-#endif
-
-// Fonts
-/*!
- TrueType font files
- <p>Scalable font format common on MS-Windows and becoming common on Unix.
- <p>Only supported on Qt/Embedded.
-*/
-//#define QT_NO_TRUETYPE
-/*!
- BDF font files
- <p>The Bitmap Distribution Format (BDF) font file format, common
- on Unix.
- <p>Only supported on Qt/Embedded.
-*/
-#if defined(QT_NO_TEXTSTREAM) || defined(QT_NO_STRINGLIST)
-# define QT_NO_BDF
-#endif
-/*!
- QFontDatabase
-*/
-#if defined(QT_NO_STRINGLIST)
-# define QT_NO_FONTDATABASE
-#endif
-
-// Internationalization
-
-/*!
- QObject::tr()
-*/
-#if defined(QT_NO_DATASTREAM)
-# define QT_NO_TRANSLATION
-#endif
-
-/*!
- QTextCodec class and subclasses
-*/
-//#define QT_NO_TEXTCODEC
-
-#if defined(QT_NO_TEXTCODEC)
- /*!
- QTextCodec classes
- <p>This includes some large conversion tables.
- */
-# define QT_NO_CODECS
-#endif
-#if defined(QT_LITE_UNICODE)
- /*!
- Unicode property tables
- <p>These include some large tables.
- */
-# define QT_NO_UNICODETABLES
-#endif
-
-/*!
- MIME
-*/
-#if defined(QT_NO_DIR)
-# define QT_NO_MIME
-#endif
-#if defined(QT_NO_MIME) || defined(QT_NO_TEXTSTREAM) || defined(QT_NO_DRAWUTIL) || defined(QT_NO_IMAGE_SMOOTHSCALE)
- /*!
- RichText (HTML) display
- */
-# define QT_NO_RICHTEXT
-#endif
-
-/*!
- XML
-*/
-#if defined(QT_NO_STRINGLIST) || defined(QT_NO_TEXTSTREAM) || defined(QT_NO_TEXTCODEC)
-# define QT_NO_XML
-#endif
-
-/*!
- Document Object Model
-*/
-#if defined(QT_NO_XML) || defined(QT_NO_MIME)
-# define QT_NO_DOM
-#endif
-
-// Sound
-/*!
- Playing sounds
-*/
-//#define QT_NO_SOUND
-
-/*!
- Properties
-*/
-#if defined(QT_NO_STRINGLIST) || defined(QT_NO_ICONSET)
-# define QT_NO_PROPERTIES
-#endif
-
-
-
-// Networking
-
-/*!
- Network support
-*/
-//#define QT_NO_NETWORK
-
-#if defined(QT_NO_NETWORK) || defined(QT_NO_STRINGLIST) || defined(QT_NO_TEXTSTREAM)
- /*!
- DNS
- */
-# define QT_NO_DNS
-#endif
-/*!
- Network file access
-*/
-#if defined(QT_NO_NETWORK) || defined(QT_NO_DIR) || defined(QT_NO_STRINGLIST)
-# define QT_NO_NETWORKPROTOCOL
-#endif
-#if defined(QT_NO_NETWORKPROTOCOL) || defined(QT_NO_DNS)
- /*!
- FTP file access
- */
-# define QT_NO_NETWORKPROTOCOL_FTP
- /*!
- HTTP file access
- */
-# define QT_NO_NETWORKPROTOCOL_HTTP
-#endif
-
-/*!
- External process invocation.
-*/
-//#define QT_NO_PROCESS
-
-
-// Qt/Embedded-specific
-
-#if defined(QT_NO_NETWORK)
- /*!
- Multi-process support.
- */
-# define QT_NO_QWS_MULTIPROCESS
-#endif
-
-#if defined(QT_NO_QWS_MULTIPROCESS) || defined(QT_NO_DATASTREAM)
- /*!
- Palmtop Communication Protocol
- */
-# define QT_NO_COP
-#endif
-
-/*!
- Console keyboard support
-*/
-//#define QT_NO_QWS_KEYBOARD
-
-/*!
- Visible cursor
-*/
-#if defined(QT_NO_CURSOR)
-# define QT_NO_QWS_CURSOR
-#endif
-
-/*!
- Alpha-blended cursor
-*/
-//#define QT_NO_QWS_ALPHA_CURSOR
-/*!
- Mach64 acceleration
-*/
-//#define QT_NO_QWS_MACH64
-/*!
- Voodoo3 acceleration
-*/
-//#define QT_NO_QWS_VOODOO3
-/*!
- Matrox MGA acceleration (Millennium/Millennium II/Mystique/G200/G400)
-*/
-//#define QT_NO_QWS_MATROX
-/*!
- Virtual frame buffer
-*/
-
-//#define QT_NO_QWS_VFB
-/*!
- Transformed frame buffer
-*/
-//#define QT_NO_QWS_TRANSFORMED
-#if defined(QT_NO_NETWORK)
-/*!
- Remote frame buffer (VNC)
-*/
-# ifndef QT_NO_QWS_VNC
-# define QT_NO_QWS_VNC
-# endif
-#endif
-/*!
- 1-bit monochrome
-*/
-//#define QT_NO_QWS_DEPTH_1
-/*!
- 4-bit grayscale
-*/
-//#define QT_NO_QWS_DEPTH_4
-/*!
- 4-bit VGA
-*/
-//#define QT_NO_QWS_VGA_16
-/*!
- SVGALib Support
- Not implemented yet
-*/
-#define QT_NO_QWS_SVGALIB
-/*!
- 8-bit grayscale
-*/
-#define QT_NO_QWS_DEPTH_8GRAYSCALE
-/*!
- 8-bit color
-*/
-//#define QT_NO_QWS_DEPTH_8
-/*!
- 15 or 16-bit color (define QT_QWS_DEPTH16_RGB as 555 for 15-bit)
-*/
-//#define QT_NO_QWS_DEPTH_16
-/*!
- 24-bit color
-*/
-//#define QT_NO_QWS_DEPTH_24
-/*!
- 32-bit color
-*/
-//#define QT_NO_QWS_DEPTH_32
-
-/*!
- Window Manager
-*/
-//#define QT_NO_QWS_MANAGER
-
-/*!
- Window Manager Styles
-*/
-#define QT_NO_QWS_KDE2_WM_STYLE
-#if defined( QT_NO_QWS_MANAGER ) || defined( QT_NO_IMAGEIO_XPM )
-# define QT_NO_QWS_AQUA_WM_STYLE
-# define QT_NO_QWS_BEOS_WM_STYLE
-# define QT_NO_QWS_KDE_WM_STYLE
-# define QT_NO_QWS_QPE_WM_STYLE
-# define QT_NO_QWS_WINDOWS_WM_STYLE
-#endif
-
-/*!
- Saving of fonts
-*/
-//#define QT_NO_QWS_SAVEFONTS
-
-/*!
- Favour code size over graphics speed
- <p>Smaller, slower code will be used for drawing operations.
- <p>Only supported on Qt/Embedded.
-*/
-//#define QT_NO_QWS_GFX_SPEED
-
-/*!
- Qt/Embedded window system properties.
-*/
-//#define QT_NO_QWS_PROPERTIES
-
-#if defined(QT_NO_QWS_PROPERTIES) || defined(QT_NO_MIME)
- /*!
- Cut and paste
- */
-# define QT_NO_CLIPBOARD
-#endif
-
-#if defined(QT_NO_MIME) || defined(QT_NO_QWS_PROPERTIES)
- /*!
- Drag and drop
- */
-# define QT_NO_DRAGANDDROP
-#endif
-
-#if defined(QT_NO_PROPERTIES)
- /*!
- SQL
- */
-# define QT_NO_SQL
-#endif
-
-#if defined(QT_NO_CLIPBOARD) || defined(QT_NO_MIME) || defined(_WS_QWS_)
- /*!
- Cut and paste of complex data types (non-text)
- Not yet implemented for QWS.
- */
-# define QT_NO_MIMECLIPBOARD
-#endif
-
-
-/*!
- Drawing utility functions
-*/
-//#define QT_NO_DRAWUTIL
-/*!
- TrueColor QImage
-*/
-//#define QT_NO_IMAGE_TRUECOLOR
-/*!
- Smooth QImage scaling
-*/
-//#define QT_NO_IMAGE_SMOOTHSCALE
-/*!
- Image file text strings
-*/
-#if defined(QT_NO_STRINGLIST)
-# define QT_NO_IMAGE_TEXT
-#endif
-
-#if defined(QT_NO_IMAGE_TRUECOLOR)
- /*!
- 16-bit QImage
- */
-# define QT_NO_IMAGE_16_BIT
-#endif
-/*!
- Cursors
-*/
-//#define QT_NO_CURSOR
-
-// Painting
-/*!
- Named colors
-*/
-//#define QT_NO_COLORNAMES
-/*!
- Scaling and rotation
-*/
-//#define QT_NO_TRANSFORMATIONS
-
-/*!
- Printing
-*/
-#if defined(QT_NO_TEXTSTREAM)
-# define QT_NO_PRINTER
-#endif
-
-/*!
- QPicture
-*/
-#if defined(QT_NO_DATASTREAM)
-# define QT_NO_PICTURE
-#endif
-
-// Layout
-/*!
- Automatic widget layout
-*/
-//#define QT_NO_LAYOUT
-
-// Widgets
-#if defined(QT_NO_DRAWUTIL) || defined(QT_NO_PALETTE)
-/*!
- QStyle
-*/
-# define QT_NO_STYLE
-#endif
-
-
-/*!
- Dialogs
-*/
-//#define QT_NO_DIALOG
-/*!
- Semi-modal dialogs
-*/
-//#define QT_NO_SEMIMODAL
-/*!
- Framed widgets
-*/
-//#define QT_NO_FRAME
-
-/*!
- Special widget effects (fading, scrolling)
-*/
-//#define QT_NO_EFFECTS
-
-
-/*!
- QLabel
-*/
-#ifdef QT_NO_FRAME
-# define QT_NO_LABEL
-#endif
-
-/*!
- Toolbars
-*/
-#ifdef QT_NO_LAYOUT
-# define QT_NO_TOOLBAR
-#endif
-
-/*!
- Buttons
-*/
-#if defined(QT_NO_BUTTON) || defined(QT_NO_STYLE)
-/*!
- Check-boxes
-*/
-# define QT_NO_CHECKBOX
-/*!
- Radio-buttons
-*/
-# define QT_NO_RADIOBUTTON
-#endif
-#if defined(QT_NO_BUTTON) || defined(QT_NO_TOOLBAR) || defined(QT_NO_ICONSET)
-/*!
- Tool-buttons
-*/
-# define QT_NO_TOOLBUTTON
-#endif
-/*!
- Grid layout widgets
-*/
-#ifdef QT_NO_FRAME
-# define QT_NO_GRID
-#endif
-/*!
- Group boxes
-*/
-#ifdef QT_NO_FRAME
-# define QT_NO_GROUPBOX
-#endif
-#if defined(QT_NO_GROUPBOX)
-/*!
- Button groups
-*/
-# define QT_NO_BUTTONGROUP
-/*!
- Horizontal group boxes
-*/
-# define QT_NO_HGROUPBOX
-#endif
-#if defined(QT_NO_HGROUPBOX)
-/*!
- Vertical group boxes
-*/
-# define QT_NO_VGROUPBOX
-#endif
-#if defined(QT_NO_BUTTONGROUP)
-/*!
- Horizontal button groups
-*/
-# define QT_NO_HBUTTONGROUP
-#endif
-#if defined(QT_NO_HBUTTONGROUP)
-/*!
- Vertical button groups
-*/
-# define QT_NO_VBUTTONGROUP
-#endif
-/*!
- Horizontal box layout widgets
-*/
-#ifdef QT_NO_FRAME
-# define QT_NO_HBOX
-#endif
-#if defined(QT_NO_HBOX)
-/*!
- Vertical box layout widgets
-*/
-# define QT_NO_VBOX
-#endif
-/*!
- Single-line edits
-*/
-#if defined(QT_NO_PALETTE)
-# define QT_NO_LINEEDIT
-#endif
-#if defined(QT_NO_TOOLBAR)
-/*!
- Main-windows
-*/
-# define QT_NO_MAINWINDOW
-#endif
-#if defined(QT_NO_ICONSET)
-/*!
- Menu-like widgets
-*/
-# define QT_NO_MENUDATA
-#endif
-#if defined(QT_NO_MENUDATA)
-/*!
- Popup-menus
-*/
-# define QT_NO_POPUPMENU
-/*!
- Menu bars
-*/
-# define QT_NO_MENUBAR
-#endif
-#if defined(QT_NO_BUTTON) || defined(QT_NO_ICONSET) || defined(QT_NO_POPUPMENU)
-/*!
- Push-buttons
-*/
-# define QT_NO_PUSHBUTTON
-#endif
-/*!
- Progress bars
-*/
-#ifdef QT_NO_FRAME
-# define QT_NO_PROGRESSBAR
-#endif
-/*!
- Range-control widgets
-*/
-//#define QT_NO_RANGECONTROL
-#if defined(QT_NO_RANGECONTROL) || defined(QT_NO_STYLE)
-/*!
- Scroll bars
-*/
-# define QT_NO_SCROLLBAR
-/*!
- Sliders
-*/
-# define QT_NO_SLIDER
-/*!
- Spin boxes
-*/
-# define QT_NO_SPINBOX
-/*!
- Dials
-*/
-# define QT_NO_DIAL
-#endif
-
-
-#if defined(QT_NO_SCROLLBAR) || defined(QT_NO_FRAME)
-/*!
- Scrollable view widgets
-*/
-# define QT_NO_SCROLLVIEW
-#endif
-#if defined(QT_NO_SCROLLVIEW)
-/*!
- QCanvas
-*/
-# define QT_NO_CANVAS
-/*!
- QIconView
-*/
-# define QT_NO_ICONVIEW
-#endif
-
-#if defined(QT_NO_SCROLLBAR)
-/*!
- Table-like widgets
-*/
-# define QT_NO_TABLEVIEW
-#endif
-#if defined(QT_NO_TABLEVIEW)
-/*!
- Multi-line edits
-*/
-# define QT_NO_MULTILINEEDIT
-#endif
-
-/*!
- Splitters
-*/
-#ifdef QT_NO_FRAME
-# define QT_NO_SPLITTER
-#endif
-/*!
- Status bars
-*/
-#ifdef QT_NO_LAYOUT
-# define QT_NO_STATUSBAR
-#endif
-/*!
- Tab-bars
-*/
-#if defined(QT_NO_ICONSET)
-# define QT_NO_TABBAR
-#endif
-#if defined(QT_NO_TABBAR)
-/*!
- Tab widgets
-*/
-# define QT_NO_TABWIDGET
-#endif
-/*!
- Tool tips
-*/
-#if defined( QT_NO_LABEL ) || defined( QT_NO_PALETTE )
-# define QT_NO_TOOLTIP
-#endif
-/*!
- Input validators
-*/
-//#define QT_NO_VALIDATOR
-/*!
- "What's this" help
-*/
-#if defined( QT_NO_TOOLTIP )
-# define QT_NO_WHATSTHIS
-#endif
-/*!
- Widget stacks
-*/
-#ifdef QT_NO_FRAME
-# define QT_NO_WIDGETSTACK
-#endif
-
-#if defined(QT_NO_RICHTEXT) || defined(QT_NO_SCROLLVIEW)
- /*!
- QTextView
- */
-# define QT_NO_TEXTVIEW
-#endif
-
-#if defined(QT_NO_TEXTVIEW)
- /*!
- QTextBrowser
- */
-# define QT_NO_TEXTBROWSER
-#endif
-
-#if defined(QT_NO_STYLE)
- /*!
- Windows style
- */
-# define QT_NO_STYLE_WINDOWS
- /*!
- Motif style
- */
-# define QT_NO_STYLE_MOTIF
-#endif
-
-#if defined(QT_NO_STYLE_MOTIF)
- /*!
- Motif-plus style
- */
-# define QT_NO_STYLE_MOTIFPLUS
-#endif
-
-
-#if defined(QT_NO_SCROLLVIEW) || defined(QT_NO_STRINGLIST)
- /*!
- QListBox
- */
-# define QT_NO_LISTBOX
-#endif
-
-/*!
- QAccel
-*/
-//#define QT_NO_ACCEL
-
-/*!
- QSizeGrip
-*/
-#ifdef QT_NO_PALETTE
-# define QT_NO_SIZEGRIP
-#endif
-/*!
- QHeader
-*/
-#ifdef QT_NO_ICONSET
-# define QT_NO_HEADER
-#endif
-/*!
- QWorkSpace
-*/
-#ifdef QT_NO_FRAME
-# define QT_NO_WORKSPACE
-#endif
-/*!
- QLCDNumber
-*/
-#ifdef QT_NO_FRAME
-# define QT_NO_LCDNUMBER
-#endif
-/*!
- QAction
-*/
-//#define QT_NO_ACTION
-
-#if defined(QT_NO_HEADER)
- /*!
- QTable
- */
-# define QT_NO_TABLE
-#endif
-
-#if defined(QT_NO_LISTBOX)
- /*!
- QComboBox
- */
-# define QT_NO_COMBOBOX
-#endif
-
-#if defined(QT_NO_HEADER) || defined(QT_NO_SCROLLVIEW)
- /*!
- QListView
- */
-# define QT_NO_LISTVIEW
-#endif
-
-#if defined(QT_NO_STYLE_WINDOWS)
- /*!
- Compact Windows style
- */
-# define QT_NO_STYLE_COMPACT
-#endif
-
-#if defined(QT_NO_STYLE_MOTIF) || defined(QT_NO_TRANSFORMATIONS)
- /*!
- CDE style
- */
-# define QT_NO_STYLE_CDE
- /*!
- SGI style
- */
-# define QT_NO_STYLE_SGI
-#endif
-#if defined(QT_NO_STYLE_WINDOWS)
- /*!
- Platinum style
- */
-# define QT_NO_STYLE_PLATINUM
-#endif
-
-/*!
- QColorDialog
-*/
-#if defined(QT_NO_LAYOUT) || defined(QT_NO_LABEL) || defined(QT_NO_PUSHBUTTON) || defined(QT_NO_DIALOG)
-# define QT_NO_COLORDIALOG
-#endif
-#if defined(QT_NO_DIALOG)
-/*!
- QMessageBox
-*/
-# define QT_NO_MESSAGEBOX
-#endif
-#if defined(QT_NO_DIALOG) || defined(QT_NO_TABBAR)
-/*!
- QTabDialog
-*/
-#define QT_NO_TABDIALOG
-#endif
-
-#if defined(QT_NO_DIALOG)
-/*!
- QWizard
-*/
-# define QT_NO_WIZARD
-#endif
-
-#if defined(QT_NO_DIALOG) || defined(QT_NO_LISTVIEW) || defined(QT_NO_NETWORKPROTOCOL) || defined(QT_NO_COMBOBOX) || defined(QT_NO_DIR) || defined(QT_NO_MESSAGEBOX) || defined(QT_NO_SEMIMODAL)
- /*!
- QFileDialog
- */
-# define QT_NO_FILEDIALOG
-#endif
-
-#if defined(QT_NO_DIALOG) || defined(QT_NO_FONTDATABASE) || defined(QT_NO_COMBOBOX)
- /*!
- QFontDialog
- */
-# define QT_NO_FONTDIALOG
-#endif
-
-#if defined(QT_NO_DIALOG) || defined(QT_NO_LISTVIEW) || defined(QT_NO_PRINTER) || defined(QT_NO_COMBOBOX) || defined(QT_NO_DIR) || defined(QT_NO_LAYOUT) || defined(QT_NO_LABEL)
- /*!
- QPrintDialog
- */
-# define QT_NO_PRINTDIALOG
-#endif
-
-#if defined(QT_NO_SEMIMODAL)
- /*!
- QProgressDialog
- */
-# define QT_NO_PROGRESSDIALOG
-#endif
-#if defined(QT_NO_DIALOG) || defined(QT_NO_COMBOBOX)
- /*!
- QInputDialog
- */
-# define QT_NO_INPUTDIALOG
-#endif
-
-#if defined(QT_NO_STRINGLIST)
- /*!
- Session management support
- */
-# define QT_NO_SESSIONMANAGER
-#endif
-
-#endif // QFEATURES_H
diff --git a/qtools/qfile.cpp b/qtools/qfile.cpp
deleted file mode 100644
index 7939160..0000000
--- a/qtools/qfile.cpp
+++ /dev/null
@@ -1,550 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QFile class
-**
-** Created : 930812
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qglobal.h"
-#if defined(_OS_WIN32_)
-#ifdef UNICODE
-#ifndef _UNICODE
-#define _UNICODE
-#endif
-#endif
-#endif
-
-#include "qfile.h"
-#include "qfiledefs_p.h"
-
-extern bool qt_file_access( const QString& fn, int t );
-
-// NOT REVISED
-/*!
- \class QFile qfile.h
- \brief The QFile class is an I/O device that operates on files.
-
- \ingroup io
-
- QFile is an I/O device for reading and writing binary and text files. A
- QFile may be used by itself (readBlock and writeBlock) or by more
- conveniently using QDataStream or QTextStream.
-
- Here is a code fragment that uses QTextStream to read a text
- file line by line. It prints each line with a line number.
- \code
- QFile f("file.txt");
- if ( f.open(IO_ReadOnly) ) { // file opened successfully
- QTextStream t( &f ); // use a text stream
- QString s;
- int n = 1;
- while ( !t.eof() ) { // until end of file...
- s = t.readLine(); // line of text excluding '\n'
- printf( "%3d: %s\n", n++, (const char *)s );
- }
- f.close();
- }
- \endcode
-
- The QFileInfo class holds detailed information about a file, such as
- access permissions, file dates and file types.
-
- The QDir class manages directories and lists of file names.
-
- \sa QDataStream, QTextStream
-*/
-
-
-/*!
- Constructs a QFile with no name.
-*/
-
-QFile::QFile()
-{
- init();
-}
-
-/*!
- Constructs a QFile with a file name \e name.
- \sa setName()
-*/
-
-QFile::QFile( const QString &name )
- : fn(name)
-{
- init();
-}
-
-
-/*!
- Destructs a QFile. Calls close().
-*/
-
-QFile::~QFile()
-{
- close();
-}
-
-
-/*!
- \internal
- Initialize internal data.
-*/
-
-void QFile::init()
-{
- setFlags( IO_Direct );
- setStatus( IO_Ok );
- fh = 0;
- fd = 0;
- length = 0;
- ioIndex = 0;
- ext_f = FALSE; // not an external file handle
-}
-
-
-/*!
- \fn QString QFile::name() const
- Returns the name set by setName().
- \sa setName(), QFileInfo::fileName()
-*/
-
-/*!
- Sets the name of the file. The name can include an absolute directory
- path or it can be a name or a path relative to the current directory.
-
- Do not call this function if the file has already been opened.
-
- Note that if the name is relative QFile does not associate it with the
- current directory. If you change directory before calling open(), open
- uses the new current directory.
-
- Example:
- \code
- QFile f;
- QDir::setCurrent( "/tmp" );
- f.setName( "readme.txt" );
- QDir::setCurrent( "/home" );
- f.open( IO_ReadOnly ); // opens "/home/readme.txt" under UNIX
- \endcode
-
- Also note that the directory separator '/' works for all operating
- systems supported by Qt.
-
- \sa name(), QFileInfo, QDir
-*/
-
-void QFile::setName( const QString &name )
-{
- if ( isOpen() ) {
-#if defined(CHECK_STATE)
- qWarning( "QFile::setName: File is open" );
-#endif
- close();
- }
- fn = name;
-}
-
-/*!
- Returns TRUE if this file exists, otherwise FALSE.
- \sa name()
-*/
-
-bool QFile::exists() const
-{
- return qt_file_access( fn, F_OK );
-}
-
-/*!
- Returns TRUE if the file given by \e fileName exists, otherwise FALSE.
-*/
-
-bool QFile::exists( const QString &fileName )
-{
- return qt_file_access( fileName, F_OK );
-}
-
-
-/*!
- Removes the file specified by the file name currently set.
- Returns TRUE if successful, otherwise FALSE.
-
- The file is closed before it is removed.
-*/
-
-bool QFile::remove()
-{
- close();
- return remove( fn );
-}
-
-#if defined(_OS_MAC_) || defined(_OS_MSDOS_) || defined(_OS_WIN32_) || defined(_OS_OS2_) || defined(_OS_CYGWIN_)
-# define HAS_TEXT_FILEMODE // has translate/text filemode
-#endif
-#if defined(O_NONBLOCK)
-# define HAS_ASYNC_FILEMODE
-# define OPEN_ASYNC O_NONBLOCK
-#elif defined(O_NDELAY)
-# define HAS_ASYNC_FILEMODE
-# define OPEN_ASYNC O_NDELAY
-#endif
-
-/*!
- Flushes the file buffer to the disk.
-
- close() also flushes the file buffer.
-*/
-
-void QFile::flush()
-{
- if ( isOpen() && fh ) // can only flush open/buffered
- fflush( fh ); // file
-}
-
-/*!
- Returns TRUE if the end of file has been reached, otherwise FALSE.
- \sa size()
-*/
-
-bool QFile::atEnd() const
-{
- if ( !isOpen() ) {
-#if defined(CHECK_STATE)
- qWarning( "QFile::atEnd: File is not open" );
-#endif
- return FALSE;
- }
- if ( isDirectAccess() && !isTranslated() ) {
- if ( at() < length )
- return FALSE;
- }
- return QIODevice::atEnd();
-}
-
-/*!
- Reads a line of text.
-
- Reads bytes from the file until end-of-line is reached, or up to \a
- maxlen bytes, and returns the number of bytes read, or -1 in case of
- error. The terminating newline is not stripped.
-
- This function is efficient only for buffered files. Avoid
- readLine() for files that have been opened with the \c IO_Raw
- flag.
-
- \sa readBlock(), QTextStream::readLine()
-*/
-
-int QFile::readLine( char *p, uint maxlen )
-{
- if ( maxlen == 0 ) // application bug?
- return 0;
-#if defined(CHECK_STATE)
- CHECK_PTR( p );
- if ( !isOpen() ) { // file not open
- qWarning( "QFile::readLine: File not open" );
- return -1;
- }
- if ( !isReadable() ) { // reading not permitted
- qWarning( "QFile::readLine: Read operation not permitted" );
- return -1;
- }
-#endif
- int nread; // number of bytes read
- if ( isRaw() ) { // raw file
- nread = QIODevice::readLine( p, maxlen );
- } else { // buffered file
- p = fgets( p, maxlen, fh );
- if ( p ) {
- nread = qstrlen( p );
- ioIndex += nread;
- } else {
- nread = -1;
- setStatus(IO_ReadError);
- }
- }
- return nread;
-}
-
-
-/*!
- Reads a line of text.
-
- Reads bytes from the file until end-of-line is reached, or up to \a
- maxlen bytes, and returns the number of bytes read, or -1 in case of
- error. The terminating newline is not stripped.
-
- This function is efficient only for buffered files. Avoid
- readLine() for files that have been opened with the \c IO_Raw
- flag.
-
- Note that the string is read as plain Latin1 bytes, not Unicode.
-
- \sa readBlock(), QTextStream::readLine()
-*/
-
-int QFile::readLine( QString& s, uint maxlen )
-{
- QByteArray ba(maxlen);
- int l = readLine(ba.data(),maxlen);
- if ( l >= 0 ) {
- ba.truncate(l);
- s = QString(ba);
- }
- return l;
-}
-
-
-/*!
- Reads a single byte/character from the file.
-
- Returns the byte/character read, or -1 if the end of the file has been
- reached.
-
- \sa putch(), ungetch()
-*/
-
-int QFile::getch()
-{
-#if defined(CHECK_STATE)
- if ( !isOpen() ) { // file not open
- qWarning( "QFile::getch: File not open" );
- return EOF;
- }
- if ( !isReadable() ) { // reading not permitted
- qWarning( "QFile::getch: Read operation not permitted" );
- return EOF;
- }
-#endif
-
- int ch;
-
- if ( !ungetchBuffer.isEmpty() ) {
- int len = ungetchBuffer.length();
- ch = ungetchBuffer[ len-1 ];
- ungetchBuffer.truncate( len - 1 );
- return ch;
- }
-
- if ( isRaw() ) { // raw file (inefficient)
- char buf[1];
- ch = readBlock( buf, 1 ) == 1 ? buf[0] : EOF;
- } else { // buffered file
- if ( (ch = getc( fh )) != EOF )
- ioIndex++;
- else
- setStatus(IO_ReadError);
- }
- return ch;
-}
-
-/*!
- \fn int QFile::writeBlock( const QByteArray& data )
- \reimp
- \internal
- Should be removed in 3.0
-*/
-
-/*!
- Writes the character \e ch to the file.
-
- Returns \e ch, or -1 if some error occurred.
-
- \sa getch(), ungetch()
-*/
-
-int QFile::putch( int ch )
-{
-#if defined(CHECK_STATE)
- if ( !isOpen() ) { // file not open
- qWarning( "QFile::putch: File not open" );
- return EOF;
- }
- if ( !isWritable() ) { // writing not permitted
- qWarning( "QFile::putch: Write operation not permitted" );
- return EOF;
- }
-#endif
- if ( isRaw() ) { // raw file (inefficient)
- char buf[1];
- buf[0] = ch;
- ch = writeBlock( buf, 1 ) == 1 ? ch : EOF;
- } else { // buffered file
- if ( (ch = putc( ch, fh )) != EOF ) {
- ioIndex++;
- if ( ioIndex > length ) // update file length
- length = ioIndex;
- } else {
- setStatus(IO_WriteError);
- }
- }
- return ch;
-}
-
-/*!
- Puts the character \e ch back into the file and decrements the index if it
- is not zero.
-
- This function is normally called to "undo" a getch() operation.
-
- Returns \e ch, or -1 if some error occurred.
-
- \sa getch(), putch()
-*/
-
-int QFile::ungetch( int ch )
-{
-#if defined(CHECK_STATE)
- if ( !isOpen() ) { // file not open
- qWarning( "QFile::ungetch: File not open" );
- return EOF;
- }
- if ( !isReadable() ) { // reading not permitted
- qWarning( "QFile::ungetch: Read operation not permitted" );
- return EOF;
- }
-#endif
- if ( ch == EOF ) // cannot unget EOF
- return ch;
-
- if ( isSequentialAccess() && !fh) {
- // pipe or similar => we cannot ungetch, so do it manually
- ungetchBuffer +=ch;
- return ch;
- }
-
- if ( isRaw() ) { // raw file (very inefficient)
- char buf[1];
- at( ioIndex-1 );
- buf[0] = ch;
- if ( writeBlock(buf, 1) == 1 )
- at ( ioIndex-1 );
- else
- ch = EOF;
- } else { // buffered file
- if ( (ch = ungetc(ch, fh)) != EOF )
- ioIndex--;
- else
- setStatus( IO_ReadError );
- }
- return ch;
-}
-
-
-static QCString locale_encoder( const QString &fileName )
-{
- return fileName.local8Bit();
-}
-
-
-static QFile::EncoderFn encoder = locale_encoder;
-
-/*!
- When you use QFile, QFileInfo, and QDir to access the filesystem
- with Qt, you can use Unicode filenames. On Unix, these filenames
- are converted to an 8-bit encoding. If you want to do your own
- file I/O on Unix, you should convert the filename using this
- function. On Windows NT, Unicode filenames are supported directly
- in the filesystem and this function should be avoided. On Windows 95,
- non-Latin1 locales are not supported at this time.
-
- By default, this function converts to the local 8-bit encoding
- determined by the user's locale. This is sufficient for
- filenames that the user chooses. Filenames hard-coded into the
- application should only use 7-bit ASCII filename characters.
-
- The conversion scheme can be changed using setEncodingFunction().
- This might be useful if you wish to give the user an option to
- store in filenames in UTF-8, etc., but beware that such filenames
- would probably then be unrecognizable when seen by other programs.
-
- \sa decodeName()
-*/
-
-QCString QFile::encodeName( const QString &fileName )
-{
- return (*encoder)(fileName);
-}
-
-/*!
- \typedef QFile::EncoderFn
-
- This is used by QFile::setEncodingFunction().
-*/
-
-/*!
- Sets the function for encoding Unicode filenames.
- The default encodes in the locale-specific 8-bit encoding.
-
- \sa encodeName()
-*/
-void QFile::setEncodingFunction( EncoderFn f )
-{
- encoder = f;
-}
-
-static
-QString locale_decoder( const QCString &localFileName )
-{
- return QString::fromLocal8Bit(localFileName);
-}
-
-static QFile::DecoderFn decoder = locale_decoder;
-
-/*!
- This does the reverse of QFile::encodeName().
-
- \sa setDecodingFunction()
-*/
-QString QFile::decodeName( const QCString &localFileName )
-{
- return (*decoder)(localFileName);
-}
-
-/*!
- \typedef QFile::DecoderFn
-
- This is used by QFile::setDecodingFunction().
-*/
-
-/*!
- Sets the function for decoding 8-bit filenames.
- The default uses the locale-specific 8-bit encoding.
-
- \sa encodeName(), decodeName()
-*/
-
-void QFile::setDecodingFunction( DecoderFn f )
-{
- decoder = f;
-}
diff --git a/qtools/qfile.h b/qtools/qfile.h
deleted file mode 100644
index a447d2f..0000000
--- a/qtools/qfile.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QFile class
-**
-** Created : 930831
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QFILE_H
-#define QFILE_H
-
-#ifndef QT_H
-#include "qiodevice.h"
-#include "qstring.h"
-#include <stdio.h>
-#endif // QT_H
-
-class QDir;
-
-
-class Q_EXPORT QFile : public QIODevice // file I/O device class
-{
-public:
- QFile();
- QFile( const QString &name );
- virtual ~QFile();
-
- QString name() const;
- void setName( const QString &name );
-
- typedef QCString (*EncoderFn)( const QString &fileName );
- typedef QString (*DecoderFn)( const QCString &localfileName );
- static QCString encodeName( const QString &fileName );
- static QString decodeName( const QCString &localFileName );
- static void setEncodingFunction( EncoderFn );
- static void setDecodingFunction( DecoderFn );
-
- bool exists() const;
- static bool exists( const QString &fileName );
-
- bool remove();
- static bool remove( const QString &fileName );
-
- bool open( int );
- bool open( int, FILE * );
- bool open( int, int );
- void close();
- void flush();
-
- uint size() const;
- int at() const;
- bool at( int );
- bool atEnd() const;
-
- int readBlock( char *data, uint len );
- int writeBlock( const char *data, uint len );
- int writeBlock( const QByteArray& data )
- { return QIODevice::writeBlock(data); }
- int readLine( char *data, uint maxlen );
- int readLine( QString &, uint maxlen );
-
- int getch();
- int putch( int );
- int ungetch( int );
-
- int handle() const;
-
- int64 pos() const;
- int64 toEnd();
- bool seek(int64 pos);
-
-protected:
- QString fn;
- FILE *fh;
- int fd;
- int length;
- bool ext_f;
- void * d;
-
-private:
- void init();
- QCString ungetchBuffer;
-
-private: // Disabled copy constructor and operator=
-#if defined(Q_DISABLE_COPY)
- QFile( const QFile & );
- QFile &operator=( const QFile & );
-#endif
-};
-
-
-inline QString QFile::name() const
-{ return fn; }
-
-inline int QFile::at() const
-{ return ioIndex; }
-
-
-#endif // QFILE_H
diff --git a/qtools/qfile_unix.cpp b/qtools/qfile_unix.cpp
deleted file mode 100644
index dd41c4e..0000000
--- a/qtools/qfile_unix.cpp
+++ /dev/null
@@ -1,669 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QFileInfo class
-**
-** Created : 950628
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses for Unix/X11 or for Qt/Embedded may use this file in accordance
-** with the Qt Commercial License Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qglobal.h"
-
-#include "qfile.h"
-#include "qfiledefs_p.h"
-
-#if (defined(_OS_MAC_) && (!defined(_OS_UNIX_))) || defined(_OS_MSDOS_) || defined(_OS_WIN32_) || defined(_OS_OS2_) || defined(_OS_CYGWIN_)
-# define HAS_TEXT_FILEMODE // has translate/text filemode
-#endif
-#if defined(O_NONBLOCK)
-# define HAS_ASYNC_FILEMODE
-# define OPEN_ASYNC O_NONBLOCK
-#elif defined(O_NDELAY)
-# define HAS_ASYNC_FILEMODE
-# define OPEN_ASYNC O_NDELAY
-#endif
-
-bool qt_file_access( const QString& fn, int t )
-{
- if ( fn.isEmpty() )
- return FALSE;
- return ACCESS( QFile::encodeName(fn), t ) == 0;
-}
-
-/*!
- Removes the file \a fileName.
- Returns TRUE if successful, otherwise FALSE.
-*/
-
-bool QFile::remove( const QString &fileName )
-{
- if ( fileName.isEmpty() ) {
-#if defined(CHECK_NULL)
- qWarning( "QFile::remove: Empty or null file name" );
-#endif
- return FALSE;
- }
- return unlink( QFile::encodeName(fileName) ) == 0;
- // unlink more common in UNIX
-}
-
-#if defined(O_NONBLOCK)
-# define HAS_ASYNC_FILEMODE
-# define OPEN_ASYNC O_NONBLOCK
-#elif defined(O_NDELAY)
-# define HAS_ASYNC_FILEMODE
-# define OPEN_ASYNC O_NDELAY
-#endif
-
-/*!
- Opens the file specified by the file name currently set, using the mode \e m.
- Returns TRUE if successful, otherwise FALSE.
-
- The mode parameter \e m must be a combination of the following flags:
- <ul>
- <li>\c IO_Raw specified raw (non-buffered) file access.
- <li>\c IO_ReadOnly opens the file in read-only mode.
- <li>\c IO_WriteOnly opens the file in write-only mode (and truncates).
- <li>\c IO_ReadWrite opens the file in read/write mode, equivalent to
- \c (IO_ReadOnly|IO_WriteOnly).
- <li>\c IO_Append opens the file in append mode. This mode is very useful
- when you want to write something to a log file. The file index is set to
- the end of the file. Note that the result is undefined if you position the
- file index manually using at() in append mode.
- <li>\c IO_Truncate truncates the file.
- <li>\c IO_Translate enables carriage returns and linefeed translation
- for text files under MS-DOS, Windows and OS/2.
- </ul>
-
- The raw access mode is best when I/O is block-operated using 4kB block size
- or greater. Buffered access works better when reading small portions of
- data at a time.
-
- <strong>Important:</strong> When working with buffered files, data may
- not be written to the file at once. Call \link flush() flush\endlink
- to make sure the data is really written.
-
- \warning We have experienced problems with some C libraries when a buffered
- file is opened for both reading and writing. If a read operation takes place
- immediately after a write operation, the read buffer contains garbage data.
- Worse, the same garbage is written to the file. Calling flush() before
- readBlock() solved this problem.
-
- If the file does not exist and \c IO_WriteOnly or \c IO_ReadWrite is
- specified, it is created.
-
- Example:
- \code
- QFile f1( "/tmp/data.bin" );
- QFile f2( "readme.txt" );
- f1.open( IO_Raw | IO_ReadWrite | IO_Append );
- f2.open( IO_ReadOnly | IO_Translate );
- \endcode
-
- \sa name(), close(), isOpen(), flush()
-*/
-
-bool QFile::open( int m )
-{
- if ( isOpen() ) { // file already open
-#if defined(CHECK_STATE)
- qWarning( "QFile::open: File already open" );
-#endif
- return FALSE;
- }
- if ( fn.isNull() ) { // no file name defined
-#if defined(CHECK_NULL)
- qWarning( "QFile::open: No file name specified" );
-#endif
- return FALSE;
- }
- init(); // reset params
- setMode( m );
- if ( !(isReadable() || isWritable()) ) {
-#if defined(CHECK_RANGE)
- qWarning( "QFile::open: File access not specified" );
-#endif
- return FALSE;
- }
- bool ok = TRUE;
- STATBUF st;
- if ( isRaw() ) { // raw file I/O
- int oflags = OPEN_RDONLY;
- if ( isReadable() && isWritable() )
- oflags = OPEN_RDWR;
- else if ( isWritable() )
- oflags = OPEN_WRONLY;
- if ( flags() & IO_Append ) { // append to end of file?
- if ( flags() & IO_Truncate )
- oflags |= (OPEN_CREAT | OPEN_TRUNC);
- else
- oflags |= (OPEN_APPEND | OPEN_CREAT);
- setFlags( flags() | IO_WriteOnly ); // append implies write
- } else if ( isWritable() ) { // create/trunc if writable
- if ( flags() & IO_Truncate )
- oflags |= (OPEN_CREAT | OPEN_TRUNC);
- else
- oflags |= OPEN_CREAT;
- }
-#if defined(HAS_TEXT_FILEMODE)
- if ( isTranslated() )
-#ifdef __CYGWIN__
- /* Do nothing, allowing the Cygwin mount mode to take effect. */;
-#else
- oflags |= OPEN_TEXT;
-#endif
- else
- oflags |= OPEN_BINARY;
-#endif
-#if defined(HAS_ASYNC_FILEMODE)
- if ( isAsynchronous() )
- oflags |= OPEN_ASYNC;
-#endif
- fd = OPEN( QFile::encodeName(fn), oflags, 0666 );
-
- if ( fd != -1 ) { // open successful
- FSTAT( fd, &st ); // get the stat for later usage
- } else {
- ok = FALSE;
- }
- } else { // buffered file I/O
- QCString perm;
- char perm2[4];
- bool try_create = FALSE;
- if ( flags() & IO_Append ) { // append to end of file?
- setFlags( flags() | IO_WriteOnly ); // append implies write
- perm = isReadable() ? "a+" : "a";
- } else {
- if ( isReadWrite() ) {
- if ( flags() & IO_Truncate ) {
- perm = "w+";
- } else {
- perm = "r+";
- try_create = TRUE; // try to create if not exists
- }
- } else if ( isReadable() ) {
- perm = "r";
- } else if ( isWritable() ) {
- perm = "w";
- }
- }
- qstrcpy( perm2, perm );
-#if defined(HAS_TEXT_FILEMODE)
- if ( isTranslated() )
-#ifdef __CYGWIN__
- /* Do nothing, allowing the Cygwin mount mode to take effect. */;
-#else
- strcat( perm2, "t" );
-#endif
- else
- strcat( perm2, "b" );
-#endif
- while (1) { // At most twice
-
- fh = fopen( QFile::encodeName(fn), perm2 );
-
- if ( !fh && try_create ) {
- perm2[0] = 'w'; // try "w+" instead of "r+"
- try_create = FALSE;
- } else {
- break;
- }
- }
- if ( fh ) {
- FSTAT( FILENO(fh), &st ); // get the stat for later usage
- } else {
- ok = FALSE;
- }
- }
- if ( ok ) {
- setState( IO_Open );
- // on successful open the file stat was got; now test what type
- // of file we have
- if ( (st.st_mode & STAT_MASK) != STAT_REG ) {
- // non-seekable
- setType( IO_Sequential );
- length = INT_MAX;
- ioIndex = (flags() & IO_Append) == 0 ? 0 : length;
- } else {
- length = (int)st.st_size;
- ioIndex = (flags() & IO_Append) == 0 ? 0 : length;
- if ( !(flags()&IO_Truncate) && length == 0 && isReadable() ) {
- // try if you can read from it (if you can, it's a sequential
- // device; e.g. a file in the /proc filesystem)
- int c = getch();
- if ( c != -1 ) {
- ungetch(c);
- setType( IO_Sequential );
- length = INT_MAX;
- }
- }
- }
- } else {
- init();
- if ( errno == EMFILE ) // no more file handles/descrs
- setStatus( IO_ResourceError );
- else
- setStatus( IO_OpenError );
- }
- return ok;
-}
-
-/*!
- Opens a file in the mode \e m using an existing file handle \e f.
- Returns TRUE if successful, otherwise FALSE.
-
- Example:
- \code
- #include <stdio.h>
-
- void printError( const char* msg )
- {
- QFile f;
- f.open( IO_WriteOnly, stderr );
- f.writeBlock( msg, qstrlen(msg) ); // write to stderr
- f.close();
- }
- \endcode
-
- When a QFile is opened using this function, close() does not actually
- close the file, only flushes it.
-
- \warning If \e f is \c stdin, \c stdout, \c stderr, you may not
- be able to seek. See QIODevice::isSequentialAccess() for more
- information.
-
- \sa close()
-*/
-
-bool QFile::open( int m, FILE *f )
-{
- if ( isOpen() ) {
-#if defined(CHECK_RANGE)
- qWarning( "QFile::open: File already open" );
-#endif
- return FALSE;
- }
- init();
- setMode( m &~IO_Raw );
- setState( IO_Open );
- fh = f;
- ext_f = TRUE;
- STATBUF st;
- FSTAT( FILENO(fh), &st );
- ioIndex = (int)ftell( fh );
- if ( (st.st_mode & STAT_MASK) != STAT_REG || f == stdin ) { //stdin is non seekable
- // non-seekable
- setType( IO_Sequential );
- length = INT_MAX;
- } else {
- length = (int)st.st_size;
- if ( !(flags()&IO_Truncate) && length == 0 && isReadable() ) {
- // try if you can read from it (if you can, it's a sequential
- // device; e.g. a file in the /proc filesystem)
- int c = getch();
- if ( c != -1 ) {
- ungetch(c);
- setType( IO_Sequential );
- length = INT_MAX;
- }
- }
- }
- return TRUE;
-}
-
-/*!
- Opens a file in the mode \e m using an existing file descriptor \e f.
- Returns TRUE if successful, otherwise FALSE.
-
- When a QFile is opened using this function, close() does not actually
- close the file.
-
- \warning If \e f is one of 0 (stdin), 1 (stdout) or 2 (stderr), you may not
- be able to seek. size() is set to \c INT_MAX (in limits.h).
-
- \sa close()
-*/
-
-
-bool QFile::open( int m, int f )
-{
- if ( isOpen() ) {
-#if defined(CHECK_RANGE)
- qWarning( "QFile::open: File already open" );
-#endif
- return FALSE;
- }
- init();
- setMode( m |IO_Raw );
- setState( IO_Open );
- fd = f;
- ext_f = TRUE;
- STATBUF st;
- FSTAT( fd, &st );
- ioIndex = (int)LSEEK(fd, 0, SEEK_CUR);
- if ( (st.st_mode & STAT_MASK) != STAT_REG || f == 0 ) { // stdin is not seekable...
- // non-seekable
- setType( IO_Sequential );
- length = INT_MAX;
- } else {
- length = (int)st.st_size;
- if ( length == 0 && isReadable() ) {
- // try if you can read from it (if you can, it's a sequential
- // device; e.g. a file in the /proc filesystem)
- int c = getch();
- if ( c != -1 ) {
- ungetch(c);
- setType( IO_Sequential );
- length = INT_MAX;
- }
- resetStatus();
- }
- }
- return TRUE;
-}
-
-/*!
- Returns the file size.
- \sa at()
-*/
-
-uint QFile::size() const
-{
- STATBUF st;
- if ( isOpen() ) {
- FSTAT( fh ? FILENO(fh) : fd, &st );
- } else {
- STAT( QFile::encodeName(fn), &st );
- }
- return (uint)st.st_size;
-}
-
-/*!
- \fn int QFile::at() const
- Returns the file index.
- \sa size()
-*/
-
-/*!
- Sets the file index to \e pos. Returns TRUE if successful, otherwise FALSE.
-
- Example:
- \code
- QFile f( "data.bin" );
- f.open( IO_ReadOnly ); // index set to 0
- f.at( 100 ); // set index to 100
- f.at( f.at()+50 ); // set index to 150
- f.at( f.size()-80 ); // set index to 80 before EOF
- f.close();
- \endcode
-
- \warning The result is undefined if the file was \link open() opened\endlink
- using the \c IO_Append specifier.
-
- \sa size(), open()
-*/
-
-bool QFile::at( int pos )
-{
- if ( !isOpen() ) {
-#if defined(CHECK_STATE)
- qWarning( "QFile::at: File is not open" );
-#endif
- return FALSE;
- }
- bool ok;
- if ( isRaw() ) { // raw file
- pos = (int)LSEEK(fd, pos, SEEK_SET);
- ok = pos != -1;
- } else { // buffered file
- ok = fseek(fh, pos, SEEK_SET) == 0;
- }
- if ( ok )
- ioIndex = pos;
-#if defined(CHECK_RANGE)
- else
- qWarning( "QFile::at: Cannot set file position %d", pos );
-#endif
- return ok;
-}
-
-/*!
- Reads at most \e len bytes from the file into \e p and returns the
- number of bytes actually read.
-
- Returns -1 if a serious error occurred.
-
- \warning We have experienced problems with some C libraries when a buffered
- file is opened for both reading and writing. If a read operation takes place
- immediately after a write operation, the read buffer contains garbage data.
- Worse, the same garbage is written to the file. Calling flush() before
- readBlock() solved this problem.
-
- \sa writeBlock()
-*/
-
-int QFile::readBlock( char *p, uint len )
-{
-#if defined(CHECK_NULL)
- if ( !p )
- qWarning( "QFile::readBlock: Null pointer error" );
-#endif
-#if defined(CHECK_STATE)
- if ( !isOpen() ) { // file not open
- qWarning( "QFile::readBlock: File not open" );
- return -1;
- }
- if ( !isReadable() ) { // reading not permitted
- qWarning( "QFile::readBlock: Read operation not permitted" );
- return -1;
- }
-#endif
- int nread = 0; // number of bytes read
- if ( !ungetchBuffer.isEmpty() ) {
- // need to add these to the returned string.
- int l = ungetchBuffer.length();
- while( nread < l ) {
- *p = ungetchBuffer[ l - nread - 1 ];
- p++;
- nread++;
- }
- ungetchBuffer.truncate( l - nread );
- }
-
- if ( nread < (int)len ) {
- if ( isRaw() ) { // raw file
- nread += (int)READ( fd, p, len-nread );
- if ( len && nread <= 0 ) {
- nread = 0;
- setStatus(IO_ReadError);
- }
- } else { // buffered file
- nread += (int)fread( p, 1, len-nread, fh );
- if ( (uint)nread != len ) {
- if ( ferror( fh ) || nread==0 )
- setStatus(IO_ReadError);
- }
- }
- }
- ioIndex += nread;
- return nread;
-}
-
-/*! \overload int writeBlock( const QByteArray& data )
-*/
-
-/*! \reimp
-
- Writes \e len bytes from \e p to the file and returns the number of
- bytes actually written.
-
- Returns -1 if a serious error occurred.
-
- \warning When working with buffered files, data may not be written
- to the file at once. Call flush() to make sure the data is really
- written.
-
- \sa readBlock()
-*/
-
-int QFile::writeBlock( const char *p, uint len )
-{
-#if defined(CHECK_NULL)
- if ( p == 0 && len != 0 )
- qWarning( "QFile::writeBlock: Null pointer error" );
-#endif
-#if defined(CHECK_STATE)
- if ( !isOpen() ) { // file not open
- qWarning( "QFile::writeBlock: File not open" );
- return -1;
- }
- if ( !isWritable() ) { // writing not permitted
- qWarning( "QFile::writeBlock: Write operation not permitted" );
- return -1;
- }
-#endif
- if (p==0) return 0;
- int nwritten; // number of bytes written
- if ( isRaw() ) // raw file
- nwritten = (int)WRITE( fd, p, len );
- else // buffered file
- nwritten = (int)fwrite( p, 1, len, fh );
- if ( nwritten != (int)len ) { // write error
- if ( errno == ENOSPC ) // disk is full
- setStatus( IO_ResourceError );
- else
- setStatus( IO_WriteError );
- if ( isRaw() ) // recalc file position
- ioIndex = (int)LSEEK( fd, 0, SEEK_CUR );
- else
- ioIndex = fseek( fh, 0, SEEK_CUR );
- } else {
- ioIndex += nwritten;
- }
- if ( ioIndex > length ) // update file length
- length = ioIndex;
- return nwritten;
-}
-
-/*!
- Returns the file handle of the file.
-
- This is a small positive integer, suitable for use with C library
- functions such as fdopen() and fcntl(), as well as with QSocketNotifier.
-
- If the file is not open or there is an error, handle() returns -1.
-
- \sa QSocketNotifier
-*/
-
-int QFile::handle() const
-{
- if ( !isOpen() )
- return -1;
- else if ( fh )
- return FILENO( fh );
- else
- return fd;
-}
-
-/*!
- Closes an open file.
-
- The file is not closed if it was opened with an existing file handle.
- If the existing file handle is a \c FILE*, the file is flushed.
- If the existing file handle is an \c int file descriptor, nothing
- is done to the file.
-
- Some "write-behind" filesystems may report an unspecified error on
- closing the file. These errors only indicate that something may
- have gone wrong since the previous open(). In such a case status()
- reports IO_UnspecifiedError after close(), otherwise IO_Ok.
-
- \sa open(), flush()
-*/
-
-
-void QFile::close()
-{
- bool ok = FALSE;
- if ( isOpen() ) { // file is not open
- if ( fh ) { // buffered file
- if ( ext_f )
- ok = fflush( fh ) != -1; // flush instead of closing
- else
- ok = fclose( fh ) != -1;
- } else { // raw file
- if ( ext_f )
- ok = TRUE; // cannot close
- else
- ok = CLOSE( fd ) != -1;
- }
- init(); // restore internal state
- }
- if (!ok)
- setStatus (IO_UnspecifiedError);
-
- return;
-}
-
-int64 QFile::pos() const
-{
- if (isOpen())
- {
- // TODO: support 64 bit size
- return ftell( fh );
- }
- return -1;
-}
-
-int64 QFile::toEnd()
-{
- if (isOpen())
- {
- // TODO: support 64 bit size
- if (fseek( fh, 0, SEEK_END )!=-1)
- {
- return ftell( fh );
- }
- }
- return -1;
-}
-
-bool QFile::seek( int64 pos )
-{
- if (isOpen())
- {
- // TODO: support 64 bit size
- return fseek( fh, (long)pos, SEEK_SET )!=-1;
- }
- return FALSE;
-}
-
diff --git a/qtools/qfile_win32.cpp b/qtools/qfile_win32.cpp
deleted file mode 100644
index e0b1d88..0000000
--- a/qtools/qfile_win32.cpp
+++ /dev/null
@@ -1,678 +0,0 @@
-/******************************************************************************
- *
- *
- *
- * Copyright (C) 1997-2001 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.
- *
- * Based on qfile_unix.cpp
- *
- * Copyright (C) 1992-2000 Trolltech AS.
- */
-
-#include "qglobal.h"
-
-#include "qfile.h"
-#include "qfiledefs_p.h"
-
-#if defined(_OS_MAC_) || defined(_OS_MSDOS_) || defined(_OS_WIN32_) || defined(_OS_OS2_)
-# define HAS_TEXT_FILEMODE // has translate/text filemode
-#endif
-#if defined(O_NONBLOCK)
-# define HAS_ASYNC_FILEMODE
-# define OPEN_ASYNC O_NONBLOCK
-#elif defined(O_NDELAY)
-# define HAS_ASYNC_FILEMODE
-# define OPEN_ASYNC O_NDELAY
-#endif
-
-static void reslashify( QString& n )
-{
- for ( int i=0; i<(int)n.length(); i++ )
- {
- if ( n[i] == '/' )
- n[i] = '\\';
- }
-}
-
-bool qt_file_access( const QString& fn, int t )
-{
- if ( fn.isEmpty() )
- return FALSE;
-#if defined(__CYGWIN32_)
- return ACCESS( QFile::encodeName(fn), t ) == 0;
-#else
- QString str = fn;
- reslashify(str);
- return ( _waccess( (wchar_t*) str.ucs2(), t ) == 0 );
-#endif
-}
-
-/*!
- Removes the file \a fileName.
- Returns TRUE if successful, otherwise FALSE.
-*/
-
-bool QFile::remove( const QString &fileName )
-{
- if ( fileName.isEmpty() ) {
-#if defined(CHECK_NULL)
- qWarning( "QFile::remove: Empty or null file name" );
-#endif
- return FALSE;
- }
-#if defined(__CYGWIN32_)
- // unlink more common in UNIX
- return ::remove( QFile::encodeName(fileName) ) == 0;
-#else
- QString str = fileName;
- reslashify(str);
- return ( _wunlink( (wchar_t*) str.ucs2() ) == 0 );
-#endif
-}
-
-#if defined(O_NONBLOCK)
-# define HAS_ASYNC_FILEMODE
-# define OPEN_ASYNC O_NONBLOCK
-#elif defined(O_NDELAY)
-# define HAS_ASYNC_FILEMODE
-# define OPEN_ASYNC O_NDELAY
-#endif
-
-/*!
- Opens the file specified by the file name currently set, using the mode \e m.
- Returns TRUE if successful, otherwise FALSE.
-
- The mode parameter \e m must be a combination of the following flags:
- <ul>
- <li>\c IO_Raw specified raw (non-buffered) file access.
- <li>\c IO_ReadOnly opens the file in read-only mode.
- <li>\c IO_WriteOnly opens the file in write-only mode (and truncates).
- <li>\c IO_ReadWrite opens the file in read/write mode, equivalent to
- \c (IO_ReadOnly|IO_WriteOnly).
- <li>\c IO_Append opens the file in append mode. This mode is very useful
- when you want to write something to a log file. The file index is set to
- the end of the file. Note that the result is undefined if you position the
- file index manually using at() in append mode.
- <li>\c IO_Truncate truncates the file.
- <li>\c IO_Translate enables carriage returns and linefeed translation
- for text files under MS-DOS, Windows and OS/2.
- </ul>
-
- The raw access mode is best when I/O is block-operated using 4kB block size
- or greater. Buffered access works better when reading small portions of
- data at a time.
-
- <strong>Important:</strong> When working with buffered files, data may
- not be written to the file at once. Call \link flush() flush\endlink
- to make sure the data is really written.
-
- \warning We have experienced problems with some C libraries when a buffered
- file is opened for both reading and writing. If a read operation takes place
- immediately after a write operation, the read buffer contains garbage data.
- Worse, the same garbage is written to the file. Calling flush() before
- readBlock() solved this problem.
-
- If the file does not exist and \c IO_WriteOnly or \c IO_ReadWrite is
- specified, it is created.
-
- Example:
- \code
- QFile f1( "/tmp/data.bin" );
- QFile f2( "readme.txt" );
- f1.open( IO_Raw | IO_ReadWrite | IO_Append );
- f2.open( IO_ReadOnly | IO_Translate );
- \endcode
-
- \sa name(), close(), isOpen(), flush()
-*/
-
-bool QFile::open( int m )
-{
- if ( isOpen() ) { // file already open
-#if defined(CHECK_STATE)
- qWarning( "QFile::open: File already open" );
-#endif
- return FALSE;
- }
- if ( fn.isNull() ) { // no file name defined
-#if defined(CHECK_NULL)
- qWarning( "QFile::open: No file name specified" );
-#endif
- return FALSE;
- }
- init(); // reset params
- setMode( m );
- if ( !(isReadable() || isWritable()) ) {
-#if defined(CHECK_RANGE)
- qWarning( "QFile::open: File access not specified" );
-#endif
- return FALSE;
- }
- bool ok = TRUE;
- STATBUF st;
- if ( isRaw() ) { // raw file I/O
- int oflags = OPEN_RDONLY;
- if ( isReadable() && isWritable() )
- oflags = OPEN_RDWR;
- else if ( isWritable() )
- oflags = OPEN_WRONLY;
- if ( flags() & IO_Append ) { // append to end of file?
- if ( flags() & IO_Truncate )
- oflags |= (OPEN_CREAT | OPEN_TRUNC);
- else
- oflags |= (OPEN_APPEND | OPEN_CREAT);
- setFlags( flags() | IO_WriteOnly ); // append implies write
- } else if ( isWritable() ) { // create/trunc if writable
- if ( flags() & IO_Truncate )
- oflags |= (OPEN_CREAT | OPEN_TRUNC);
- else
- oflags |= OPEN_CREAT;
- }
-#if defined(HAS_TEXT_FILEMODE)
- if ( isTranslated() )
- oflags |= OPEN_TEXT;
- else
- oflags |= OPEN_BINARY;
-#endif
-#if defined(HAS_ASYNC_FILEMODE)
- if ( isAsynchronous() )
- oflags |= OPEN_ASYNC;
-#endif
-
-
-#if defined(__CYGWIN32_)
- fd = OPEN( QFile::encodeName(fn), oflags, 0666 );
-#else
- QString str = fn;
- reslashify(str);
- fd = _wopen( (wchar_t*) str.ucs2(), oflags, 0666 );
-#endif
-
- if ( fd != -1 ) { // open successful
- FSTAT( fd, &st ); // get the stat for later usage
- } else {
- ok = FALSE;
- }
- } else { // buffered file I/O
- QCString perm;
- char perm2[4];
- bool try_create = FALSE;
- if ( flags() & IO_Append ) { // append to end of file?
- setFlags( flags() | IO_WriteOnly ); // append implies write
- perm = isReadable() ? "a+" : "a";
- } else {
- if ( isReadWrite() ) {
- if ( flags() & IO_Truncate ) {
- perm = "w+";
- } else {
- perm = "r+";
- try_create = TRUE; // try to create if not exists
- }
- } else if ( isReadable() ) {
- perm = "r";
- } else if ( isWritable() ) {
- perm = "w";
- }
- }
- qstrcpy( perm2, perm );
- if ( isTranslated() )
- strcat( perm2, "t" );
- else
- strcat( perm2, "b" );
- while (1) { // At most twice
-
-#if defined(__CYGWIN32_)
- fh = fopen( QFile::encodeName(fn), perm2 );
-#else
- QString str = fn;
- QString prm( perm2 );
- reslashify(str);
- fh = _wfopen( (wchar_t*) str.ucs2(), (wchar_t*) prm.ucs2() );
-#endif
-
- if ( !fh && try_create ) {
- perm2[0] = 'w'; // try "w+" instead of "r+"
- try_create = FALSE;
- } else {
- break;
- }
- }
- if ( fh ) {
- FSTAT( FILENO(fh), &st ); // get the stat for later usage
- } else {
- ok = FALSE;
- }
- }
- if ( ok ) {
- setState( IO_Open );
- // on successful open the file stat was got; now test what type
- // of file we have
- if ( (st.st_mode & STAT_MASK) != STAT_REG ) {
- // non-seekable
- setType( IO_Sequential );
- length = INT_MAX;
- ioIndex = (flags() & IO_Append) == 0 ? 0 : length;
- } else {
- length = (int)st.st_size;
- ioIndex = (flags() & IO_Append) == 0 ? 0 : length;
- if ( !(flags()&IO_Truncate) && length == 0 && isReadable() ) {
- // try if you can read from it (if you can, it's a sequential
- // device; e.g. a file in the /proc filesystem)
- int c = getch();
- if ( c != -1 ) {
- ungetch(c);
- setType( IO_Sequential );
- length = INT_MAX;
- }
- }
- }
- } else {
- init();
- if ( errno == EMFILE ) // no more file handles/descrs
- setStatus( IO_ResourceError );
- else
- setStatus( IO_OpenError );
- }
- return ok;
-}
-
-/*!
- Opens a file in the mode \e m using an existing file handle \e f.
- Returns TRUE if successful, otherwise FALSE.
-
- Example:
- \code
- #include <stdio.h>
-
- void printError( const char* msg )
- {
- QFile f;
- f.open( IO_WriteOnly, stderr );
- f.writeBlock( msg, qstrlen(msg) ); // write to stderr
- f.close();
- }
- \endcode
-
- When a QFile is opened using this function, close() does not actually
- close the file, only flushes it.
-
- \warning If \e f is \c stdin, \c stdout, \c stderr, you may not
- be able to seek. See QIODevice::isSequentialAccess() for more
- information.
-
- \sa close()
-*/
-
-bool QFile::open( int m, FILE *f )
-{
- if ( isOpen() ) {
-#if defined(CHECK_RANGE)
- qWarning( "QFile::open: File already open" );
-#endif
- return FALSE;
- }
- init();
- setMode( m &~IO_Raw );
- setState( IO_Open );
- fh = f;
- ext_f = TRUE;
- STATBUF st;
- FSTAT( FILENO(fh), &st );
- ioIndex = (int)ftell( fh );
- if ( (st.st_mode & STAT_MASK) != STAT_REG ) {
- // non-seekable
- setType( IO_Sequential );
- length = INT_MAX;
- } else {
- length = (int)st.st_size;
- if ( (flags() & !IO_Truncate) && length == 0 && isReadable() ) {
- // try if you can read from it (if you can, it's a sequential
- // device; e.g. a file in the /proc filesystem)
- int c = getch();
- if ( c != -1 ) {
- ungetch(c);
- setType( IO_Sequential );
- length = INT_MAX;
- }
- }
- }
- return TRUE;
-}
-
-/*!
- Opens a file in the mode \e m using an existing file descriptor \e f.
- Returns TRUE if successful, otherwise FALSE.
-
- When a QFile is opened using this function, close() does not actually
- close the file.
-
- \warning If \e f is one of 0 (stdin), 1 (stdout) or 2 (stderr), you may not
- be able to seek. size() is set to \c INT_MAX (in limits.h).
-
- \sa close()
-*/
-
-
-bool QFile::open( int m, int f )
-{
- if ( isOpen() ) {
-#if defined(CHECK_RANGE)
- qWarning( "QFile::open: File already open" );
-#endif
- return FALSE;
- }
- init();
- setMode( m |IO_Raw );
- setState( IO_Open );
- fd = f;
- ext_f = TRUE;
- STATBUF st;
- FSTAT( fd, &st );
- ioIndex = (int)LSEEK(fd, 0, SEEK_CUR);
- if ( (st.st_mode & STAT_MASK) != STAT_REG ) {
- // non-seekable
- setType( IO_Sequential );
- length = INT_MAX;
- } else {
- length = (int)st.st_size;
- if ( length == 0 && isReadable() ) {
- // try if you can read from it (if you can, it's a sequential
- // device; e.g. a file in the /proc filesystem)
- int c = getch();
- if ( c != -1 ) {
- ungetch(c);
- setType( IO_Sequential );
- length = INT_MAX;
- }
- }
- }
- return TRUE;
-}
-
-/*!
- Returns the file size.
- \sa at()
-*/
-
-uint QFile::size() const
-{
- STATBUF st;
- if ( isOpen() ) {
- FSTAT( fh ? FILENO(fh) : fd, &st );
- return st.st_size;
- } else {
-#if defined(__CYGWIN32_)
- STAT( QFile::encodeName(fn), &st );
-#else
- QString str = fn;
- reslashify(str);
-#ifdef QT_LARGEFILE_SUPPORT
- if ( _wstati64( (wchar_t*) str.ucs2(), &st ) != -1 ) {
-#else
- if ( _wstat( (wchar_t*) str.ucs2(), &st ) != -1 ) {
-#endif
-#endif
- return st.st_size;
- }
- }
- return 0;
-}
-
-/*!
- \fn int QFile::at() const
- Returns the file index.
- \sa size()
-*/
-
-/*!
- Sets the file index to \e pos. Returns TRUE if successful, otherwise FALSE.
-
- Example:
- \code
- QFile f( "data.bin" );
- f.open( IO_ReadOnly ); // index set to 0
- f.at( 100 ); // set index to 100
- f.at( f.at()+50 ); // set index to 150
- f.at( f.size()-80 ); // set index to 80 before EOF
- f.close();
- \endcode
-
- \warning The result is undefined if the file was \link open() opened\endlink
- using the \c IO_Append specifier.
-
- \sa size(), open()
-*/
-
-bool QFile::at( int pos )
-{
- if ( !isOpen() ) {
-#if defined(CHECK_STATE)
- qWarning( "QFile::at: File is not open" );
-#endif
- return FALSE;
- }
- bool ok;
- if ( isRaw() ) { // raw file
- pos = (int)LSEEK(fd, pos, SEEK_SET);
- ok = pos != -1;
- } else { // buffered file
- ok = fseek(fh, pos, SEEK_SET) == 0;
- }
- if ( ok )
- ioIndex = pos;
-#if defined(CHECK_RANGE)
- else
- qWarning( "QFile::at: Cannot set file position %d", pos );
-#endif
- return ok;
-}
-
-/*!
- Reads at most \e len bytes from the file into \e p and returns the
- number of bytes actually read.
-
- Returns -1 if a serious error occurred.
-
- \warning We have experienced problems with some C libraries when a buffered
- file is opened for both reading and writing. If a read operation takes place
- immediately after a write operation, the read buffer contains garbage data.
- Worse, the same garbage is written to the file. Calling flush() before
- readBlock() solved this problem.
-
- \sa writeBlock()
-*/
-
-int QFile::readBlock( char *p, uint len )
-{
-#if defined(CHECK_NULL)
- if ( !p )
- qWarning( "QFile::readBlock: Null pointer error" );
-#endif
-#if defined(CHECK_STATE)
- if ( !isOpen() ) { // file not open
- qWarning( "QFile::readBlock: File not open" );
- return -1;
- }
- if ( !isReadable() ) { // reading not permitted
- qWarning( "QFile::readBlock: Read operation not permitted" );
- return -1;
- }
-#endif
- int nread; // number of bytes read
- if ( isRaw() ) { // raw file
- nread = READ( fd, p, len );
- if ( len && nread <= 0 ) {
- nread = 0;
- setStatus(IO_ReadError);
- }
- } else { // buffered file
- nread = (int)fread( p, 1, len, fh );
- if ( (uint)nread != len ) {
- if ( ferror( fh ) || nread==0 )
- setStatus(IO_ReadError);
- }
- }
- ioIndex += nread;
- return nread;
-}
-
-/*! \overload int writeBlock( const QByteArray& data )
-*/
-
-/*! \reimp
-
- Writes \e len bytes from \e p to the file and returns the number of
- bytes actually written.
-
- Returns -1 if a serious error occurred.
-
- \warning When working with buffered files, data may not be written
- to the file at once. Call flush() to make sure the data is really
- written.
-
- \sa readBlock()
-*/
-
-int QFile::writeBlock( const char *p, uint len )
-{
-#if defined(CHECK_NULL)
- if ( p == 0 && len != 0 )
- qWarning( "QFile::writeBlock: Null pointer error" );
-#endif
-#if defined(CHECK_STATE)
- if ( !isOpen() ) { // file not open
- qWarning( "QFile::writeBlock: File not open" );
- return -1;
- }
- if ( !isWritable() ) { // writing not permitted
- qWarning( "QFile::writeBlock: Write operation not permitted" );
- return -1;
- }
-#endif
- int nwritten; // number of bytes written
- if ( isRaw() ) // raw file
- nwritten = WRITE( fd, p, len );
- else // buffered file
- nwritten = (int)fwrite( p, 1, len, fh );
- if ( nwritten != (int)len ) { // write error
- if ( errno == ENOSPC ) // disk is full
- setStatus( IO_ResourceError );
- else
- setStatus( IO_WriteError );
- if ( isRaw() ) // recalc file position
- ioIndex = (int)LSEEK( fd, 0, SEEK_CUR );
- else
- ioIndex = fseek( fh, 0, SEEK_CUR );
- } else {
- ioIndex += nwritten;
- }
- if ( ioIndex > length ) // update file length
- length = ioIndex;
- return nwritten;
-}
-
-/*!
- Returns the file handle of the file.
-
- This is a small positive integer, suitable for use with C library
- functions such as fdopen() and fcntl(), as well as with QSocketNotifier.
-
- If the file is not open or there is an error, handle() returns -1.
-
- \sa QSocketNotifier
-*/
-
-int QFile::handle() const
-{
- if ( !isOpen() )
- return -1;
- else if ( fh )
- return FILENO( fh );
- else
- return fd;
-}
-
-/*!
- Closes an open file.
-
- The file is not closed if it was opened with an existing file handle.
- If the existing file handle is a \c FILE*, the file is flushed.
- If the existing file handle is an \c int file descriptor, nothing
- is done to the file.
-
- Some "write-behind" filesystems may report an unspecified error on
- closing the file. These errors only indicate that something may
- have gone wrong since the previous open(). In such a case status()
- reports IO_UnspecifiedError after close(), otherwise IO_Ok.
-
- \sa open(), flush()
-*/
-
-
-void QFile::close()
-{
- bool ok = FALSE;
- if ( isOpen() ) { // file is not open
- if ( fh ) { // buffered file
- if ( ext_f )
- ok = fflush( fh ) != -1; // flush instead of closing
- else
- ok = fclose( fh ) != -1;
- } else { // raw file
- if ( ext_f )
- ok = TRUE; // cannot close
- else
- ok = CLOSE( fd ) != -1;
- }
- init(); // restore internal state
- }
- if (!ok)
- setStatus (IO_UnspecifiedError);
-
- return;
-}
-
-int64 QFile::pos() const
-{
- if (isOpen())
- {
- // TODO: support 64 bit size
- return ftell( fh );
- }
- return -1;
-}
-
-int64 QFile::toEnd()
-{
- if (isOpen())
- {
- // TODO: support 64 bit size
- if (fseek( fh, 0, SEEK_END )!=-1)
- {
- return ftell( fh );
- }
- }
- return -1;
-}
-
-bool QFile::seek( int64 pos )
-{
- if (isOpen())
- {
- // TODO: support 64 bit size
- return fseek( fh, pos, SEEK_SET )!=-1;
- }
- return FALSE;
-}
-
-
-
diff --git a/qtools/qfiledefs_p.h b/qtools/qfiledefs_p.h
deleted file mode 100644
index 5a7cfe2..0000000
--- a/qtools/qfiledefs_p.h
+++ /dev/null
@@ -1,268 +0,0 @@
-/****************************************************************************
-**
-**
-** Common macros and system include files for QFile, QFileInfo and QDir.
-**
-** Created : 930812
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QFILEDEFS_P_H
-#define QFILEDEFS_P_H
-
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience
-// of qfile.cpp, qfileinfo.cpp and qdir.cpp.
-// This header file may change from version to version without notice,
-// or even be removed.
-//
-//
-#if defined(_CC_MWERKS_)
-# include <stdlib.h>
-# include <stat.h>
-#elif !defined(_OS_MAC_)
-# include <sys/types.h>
-# include <sys/stat.h>
-#elif defined(_OS_MAC_)
-# include <sys/types.h>
-# include <sys/stat.h>
-# define _OS_UNIX_
-#endif
-#include <fcntl.h>
-#include <errno.h>
-#if defined(_OS_UNIX_)
-# include <dirent.h>
-# include <unistd.h>
-#endif
-#if defined(_OS_MSDOS_) || defined(_OS_WIN32_) || defined(_OS_OS2_)
-# define _OS_FATFS_
-# if defined(__CYGWIN32__)
-# include <dirent.h>
-# include <unistd.h>
-# if !defined(_OS_UNIX_)
-# define _OS_UNIX_
-# endif
-# else
-# include <io.h>
-# if !defined(_CC_MWERKS_)
-# include <dos.h>
-# endif
-# include <direct.h>
-# endif
-#endif
-#include <limits.h>
-
-
-#if !defined(PATH_MAX)
-#if defined( MAXPATHLEN )
-#define PATH_MAX MAXPATHLEN
-#else
-#define PATH_MAX 1024
-#endif
-#endif
-
-
-#undef STATBUF
-#undef STAT
-#undef STAT_REG
-#undef STAT_DIR
-#undef STAT_LNK
-#undef STAT_MASK
-#undef FILENO
-#undef OPEN
-#undef CLOSE
-#undef LSEEK
-#undef READ
-#undef WRITE
-#undef ACCESS
-#undef GETCWD
-#undef CHDIR
-#undef MKDIR
-#undef RMDIR
-#undef OPEN_RDONLY
-#undef OPEN_WRONLY
-#undef OPEN_CREAT
-#undef OPEN_TRUNC
-#undef OPEN_APPEND
-#undef OPEN_TEXT
-#undef OPEN_BINARY
-
-
-#if defined(_CC_MSVC_) || defined(_CC_SYM_)
-
-# define STATBUF struct _stat // non-ANSI defs
-# define STATBUF4TSTAT struct _stat // non-ANSI defs
-# define STAT ::_stat
-# define FSTAT ::_fstat
-# define STAT_REG _S_IFREG
-# define STAT_DIR _S_IFDIR
-# define STAT_MASK _S_IFMT
-# if defined(_S_IFLNK)
-# define STAT_LNK _S_IFLNK
-# endif
-# define FILENO _fileno
-# define OPEN ::_open
-# define CLOSE ::_close
-# define LSEEK ::_lseek
-# define READ ::_read
-# define WRITE ::_write
-# define ACCESS ::_access
-# define GETCWD ::_getcwd
-# define CHDIR ::_chdir
-# define MKDIR ::_mkdir
-# define RMDIR ::_rmdir
-# define OPEN_RDONLY _O_RDONLY
-# define OPEN_WRONLY _O_WRONLY
-# define OPEN_RDWR _O_RDWR
-# define OPEN_CREAT _O_CREAT
-# define OPEN_TRUNC _O_TRUNC
-# define OPEN_APPEND _O_APPEND
-# if defined(O_TEXT)
-# define OPEN_TEXT _O_TEXT
-# define OPEN_BINARY _O_BINARY
-# endif
-
-#elif defined(_CC_BOR_) && __BORLANDC__ >= 0x550
-
-# define STATBUF struct stat // non-ANSI defs
-# define STATBUF4TSTAT struct _stat // non-ANSI defs
-# define STAT ::stat
-# define FSTAT ::fstat
-# define STAT_REG _S_IFREG
-# define STAT_DIR _S_IFDIR
-# define STAT_MASK _S_IFMT
-# if defined(_S_IFLNK)
-# define STAT_LNK _S_IFLNK
-# endif
-# define FILENO _fileno
-# define OPEN ::open
-# define CLOSE ::_close
-# define LSEEK ::_lseek
-# define READ ::_read
-# define WRITE ::_write
-# define ACCESS ::_access
-# define GETCWD ::_getcwd
-# define CHDIR ::chdir
-# define MKDIR ::_mkdir
-# define RMDIR ::_rmdir
-# define OPEN_RDONLY _O_RDONLY
-# define OPEN_WRONLY _O_WRONLY
-# define OPEN_RDWR _O_RDWR
-# define OPEN_CREAT _O_CREAT
-# define OPEN_TRUNC _O_TRUNC
-# define OPEN_APPEND _O_APPEND
-# if defined(O_TEXT)
-# define OPEN_TEXT _O_TEXT
-# define OPEN_BINARY _O_BINARY
-# endif
-
-#else // all other systems
-
-#ifdef __MINGW32__
-# define STATBUF struct _stat
-# define STATBUF4TSTAT struct _stat
-# define STAT _stat
-# define FSTAT _fstat
-#else
-# define STATBUF struct stat
-# define STATBUF4TSTAT struct stat
-# define STAT ::stat
-# define FSTAT ::fstat
-#endif
-# define STAT_REG S_IFREG
-# define STAT_DIR S_IFDIR
-# define STAT_MASK S_IFMT
-# if defined(S_IFLNK)
-# define STAT_LNK S_IFLNK
-# endif
-# define FILENO fileno
-# define OPEN ::open
-# define CLOSE ::close
-# define LSEEK ::lseek
-# define READ ::read
-# define WRITE ::write
-# define ACCESS ::access
-# if defined(_OS_OS2EMX_)
-# define GETCWD ::_getcwd2
-# define CHDIR ::_chdir2
-# else
-# define GETCWD ::getcwd
-# define CHDIR ::chdir
-# endif
-# define MKDIR ::mkdir
-# define RMDIR ::rmdir
-# define OPEN_RDONLY O_RDONLY
-# define OPEN_WRONLY O_WRONLY
-# define OPEN_RDWR O_RDWR
-# define OPEN_CREAT O_CREAT
-# define OPEN_TRUNC O_TRUNC
-# define OPEN_APPEND O_APPEND
-# if defined(O_TEXT)
-# define OPEN_TEXT O_TEXT
-# define OPEN_BINARY O_BINARY
-# endif
-#endif
-
-#if defined(_CC_MWERKS_)
-#undef mkdir
-#undef MKDIR
-#define MKDIR _mkdir
-#undef rmdir
-#undef RMDIR
-#define RMDIR _rmdir
-#endif
-
-
-#if defined(_OS_FATFS_)
-# define F_OK 0
-# define X_OK 1
-# define W_OK 2
-# define R_OK 4
-#endif
-
-#if defined(_OS_MAC_) && !defined(_OS_UNIX_)
-# define F_OK 0
-# define X_OK 1
-# define W_OK 2
-# define R_OK 4
-#endif
-
-struct QFileInfoCache
-{
- STATBUF st;
- bool isSymLink;
-};
-
-#endif
diff --git a/qtools/qfileinfo.cpp b/qtools/qfileinfo.cpp
deleted file mode 100644
index 5053b76..0000000
--- a/qtools/qfileinfo.cpp
+++ /dev/null
@@ -1,458 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QFileInfo class
-**
-** Created : 950628
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qglobal.h"
-
-#include "qfileinfo.h"
-#include "qfiledefs_p.h"
-#include "qdatetime.h"
-#include "qdir.h"
-
-extern bool qt_file_access( const QString& fn, int t );
-
-// NOT REVISED
-/*!
- \class QFileInfo qfileinfo.h
- \brief The QFileInfo class provides system-independent file information.
-
- \ingroup io
-
- QFileInfo provides information about a file's name and position (path) in
- the file system, its access rights and whether it is a directory or a
- symbolic link. Its size and last modified/read times are also available.
-
- To speed up performance QFileInfo caches information about the file. Since
- files can be changed by other users or programs, or even by other parts of
- the same program there is a function that refreshes the file information;
- refresh(). If you would rather like a QFileInfo to access the file system
- every time you request information from it, you can call the function
- setCaching( FALSE ).
-
- A QFileInfo can point to a file using either a relative or an absolute
- file path. Absolute file paths begin with the directory separator
- ('/') or a drive specification (not applicable to UNIX).
- Relative file names begin with a directory name or a file name and specify
- a path relative to the current directory. An example of
- an absolute path is the string "/tmp/quartz". A relative path might look like
- "src/fatlib". You can use the function isRelative() to check if a QFileInfo
- is using a relative or an absolute file path. You can call the function
- convertToAbs() to convert a relative QFileInfo to an absolute one.
-
- If you need to read and traverse directories, see the QDir class.
-*/
-
-
-/*!
- Constructs a new empty QFileInfo.
-*/
-
-QFileInfo::QFileInfo()
-{
- fic = 0;
- cache = TRUE;
-}
-
-/*!
- Constructs a new QFileInfo that gives information about the given file.
- The string given can be an absolute or a relative file path.
-
- \sa bool setFile(QString ), isRelative(), QDir::setCurrent(),
- QDir::isRelativePath()
-*/
-
-QFileInfo::QFileInfo( const QString &file )
-{
- fn = file;
- slashify( fn );
- fic = 0;
- cache = TRUE;
-}
-
-/*!
- Constructs a new QFileInfo that gives information about \e file.
-
- If the file has a relative path, the QFileInfo will also have one.
-
- \sa isRelative()
-*/
-
-QFileInfo::QFileInfo( const QFile &file )
-{
- fn = file.name();
- slashify( fn );
- fic = 0;
- cache = TRUE;
-}
-
-/*!
- Constructs a new QFileInfo that gives information about the file
- named \e fileName in the directory \e d.
-
- If the directory has a relative path, the QFileInfo will also have one.
-
- \sa isRelative()
-*/
-#ifndef QT_NO_DIR
-QFileInfo::QFileInfo( const QDir &d, const QString &fileName )
-{
- fn = d.filePath( fileName );
- slashify( fn );
- fic = 0;
- cache = TRUE;
-}
-#endif
-/*!
- Constructs a new QFileInfo that is a copy of \e fi.
-*/
-
-QFileInfo::QFileInfo( const QFileInfo &fi )
-{
- fn = fi.fn;
- if ( fi.fic ) {
- fic = new QFileInfoCache;
- *fic = *fi.fic;
- } else {
- fic = 0;
- }
- cache = fi.cache;
-}
-
-/*!
- Destructs the QFileInfo.
-*/
-
-QFileInfo::~QFileInfo()
-{
- delete fic;
-}
-
-
-/*!
- Makes a copy of \e fi and assigns it to this QFileInfo.
-*/
-
-QFileInfo &QFileInfo::operator=( const QFileInfo &fi )
-{
- fn = fi.fn;
- if ( !fi.fic ) {
- delete fic;
- fic = 0;
- } else {
- if ( !fic ) {
- fic = new QFileInfoCache;
- CHECK_PTR( fic );
- }
- *fic = *fi.fic;
- }
- cache = fi.cache;
- return *this;
-}
-
-
-/*!
- Sets the file to obtain information about.
-
- The string given can be an absolute or a relative file path. Absolute file
- paths begin with the directory separator (e.g. '/' under UNIX) or a drive
- specification (not applicable to UNIX). Relative file names begin with a
- directory name or a file name and specify a path relative to the current
- directory.
-
- Example:
- \code
- #include <qfileinfo.h>
- #include <qdir.h>
-
- void test()
- {
- QString absolute = "/liver/aorta";
- QString relative = "liver/aorta";
- QFileInfo fi1( absolute );
- QFileInfo fi2( relative );
-
- QDir::setCurrent( QDir::rootDirPath() );
- // fi1 and fi2 now point to the same file
-
- QDir::setCurrent( "/tmp" );
- // fi1 now points to "/liver/aorta",
- // while fi2 points to "/tmp/liver/aorta"
- }
- \endcode
-
- \sa isRelative(), QDir::setCurrent(), QDir::isRelativePath()
-*/
-
-void QFileInfo::setFile( const QString &file )
-{
- fn = file;
- slashify( fn );
- delete fic;
- fic = 0;
-}
-
-/*!
- Sets the file to obtain information about.
-
- If the file has a relative path, the QFileInfo will also have one.
-
- \sa isRelative()
-*/
-
-void QFileInfo::setFile( const QFile &file )
-{
- fn = file.name();
- slashify( fn );
- delete fic;
- fic = 0;
-}
-
-/*!
- Sets the file to obtains information about to \e fileName in the
- directory \e d.
-
- If the directory has a relative path, the QFileInfo will also have one.
-
- \sa isRelative()
-*/
-#ifndef QT_NO_DIR
-void QFileInfo::setFile( const QDir &d, const QString &fileName )
-{
- fn = d.filePath( fileName );
- slashify( fn );
- delete fic;
- fic = 0;
-}
-#endif
-
-/*!
- Returns TRUE if the file pointed to exists, otherwise FALSE.
-*/
-
-bool QFileInfo::exists() const
-{
- return qt_file_access( fn, F_OK );
-}
-
-/*!
- Refresh the information about the file, i.e. read in information from the
- file system the next time a cached property is fetched.
-
- \sa setCaching()
-*/
-
-void QFileInfo::refresh() const
-{
- QFileInfo *that = (QFileInfo*)this; // Mutable function
- delete that->fic;
- that->fic = 0;
-}
-
-/*!
- \fn bool QFileInfo::caching() const
- Returns TRUE if caching is enabled.
- \sa setCaching(), refresh()
-*/
-
-/*!
- Enables caching of file information if \e enable is TRUE, or disables it
- if \e enable is FALSE.
-
- When caching is enabled, QFileInfo reads the file information the first
- time
-
- Caching is enabled by default.
-
- \sa refresh(), caching()
-*/
-
-void QFileInfo::setCaching( bool enable )
-{
- if ( cache == enable )
- return;
- cache = enable;
- if ( cache ) {
- delete fic;
- fic = 0;
- }
-}
-
-
-/*!
- Returns the name, i.e. the file name including the path (which can be
- absolute or relative).
-
- \sa isRelative(), absFilePath()
-*/
-
-QString QFileInfo::filePath() const
-{
- return fn;
-}
-
-/*!
- Returns the base name of the file.
-
- The base name consists of all characters in the file name up to (but not
- including) the first '.' character. The path is not included.
-
- Example:
- \code
- QFileInfo fi( "/tmp/abdomen.lower" );
- QString base = fi.baseName(); // base = "abdomen"
- \endcode
-
- \sa fileName(), extension()
-*/
-
-QString QFileInfo::baseName() const
-{
- QString tmp = fileName();
- int pos = tmp.find( '.' );
- if ( pos == -1 )
- return tmp;
- else
- return tmp.left( pos );
-}
-
-/*!
- Returns the extension name of the file.
-
- If \a complete is TRUE (the default), extension() returns the string
- of all characters in the file name after (but not including) the
- first '.' character. For a file named "archive.tar.gz" this
- returns "tar.gz".
-
- If \a complete is FALSE, extension() returns the string of all
- characters in the file name after (but not including) the last '.'
- character. For a file named "archive.tar.gz" this returns "gz".
-
- Example:
- \code
- QFileInfo fi( "lex.yy.c" );
- QString ext = fi.extension(); // ext = "yy.c"
- QString ext = fi.extension( FALSE ); // ext = "c"
- \endcode
-
- \sa fileName(), baseName()
-
-*/
-
-QString QFileInfo::extension( bool complete ) const
-{
- QString s = fileName();
- int pos = complete ? s.find( '.' ) : s.findRev( '.' );
- if ( pos < 0 )
- return QString::fromLatin1( "" );
- else
- return s.right( s.length() - pos - 1 );
-}
-
-/*!
- Returns the directory path of the file.
-
- If the QFileInfo is relative and \e absPath is FALSE, the QDir will be
- relative, otherwise it will be absolute.
-
- \sa dirPath(), filePath(), fileName(), isRelative()
-*/
-#ifndef QT_NO_DIR
-QDir QFileInfo::dir( bool absPath ) const
-{
- return QDir( dirPath(absPath) );
-}
-#endif
-
-
-/*!
- Returns TRUE if the file is readable.
- \sa isWritable(), isExecutable(), permission()
-*/
-
-bool QFileInfo::isReadable() const
-{
- return qt_file_access( fn, R_OK );
-}
-
-/*!
- Returns TRUE if the file is writable.
- \sa isReadable(), isExecutable(), permission()
-*/
-
-bool QFileInfo::isWritable() const
-{
- return qt_file_access( fn, W_OK );
-}
-
-/*!
- Returns TRUE if the file is executable.
- \sa isReadable(), isWritable(), permission()
-*/
-
-bool QFileInfo::isExecutable() const
-{
- return qt_file_access( fn, X_OK );
-}
-
-
-/*!
- Returns TRUE if the file path name is relative to the current directory,
- FALSE if the path is absolute (e.g. under UNIX a path is relative if it
- does not start with a '/').
-
- According to Einstein this function should always return TRUE.
-*/
-#ifndef QT_NO_DIR
-bool QFileInfo::isRelative() const
-{
- return QDir::isRelativePath( fn );
-}
-
-/*!
- Converts the file path name to an absolute path.
-
- If it is already absolute nothing is done.
-
- \sa filePath(), isRelative()
-*/
-
-bool QFileInfo::convertToAbs()
-{
- if ( isRelative() )
- fn = absFilePath();
- return QDir::isRelativePath( fn );
-}
-#endif
diff --git a/qtools/qfileinfo.h b/qtools/qfileinfo.h
deleted file mode 100644
index 76ef8c2..0000000
--- a/qtools/qfileinfo.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QFileInfo class
-**
-** Created : 950628
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QFILEINFO_H
-#define QFILEINFO_H
-
-#ifndef QT_H
-#include "qfile.h"
-#include "qdatetime.h"
-#endif // QT_H
-
-
-class QDir;
-struct QFileInfoCache;
-
-
-class Q_EXPORT QFileInfo // file information class
-{
-public:
- enum PermissionSpec {
- ReadUser = 0400, WriteUser = 0200, ExeUser = 0100,
- ReadGroup = 0040, WriteGroup = 0020, ExeGroup = 0010,
- ReadOther = 0004, WriteOther = 0002, ExeOther = 0001 };
-
- QFileInfo();
- QFileInfo( const QString &file );
- QFileInfo( const QFile & );
-#ifndef QT_NO_DIR
- QFileInfo( const QDir &, const QString &fileName );
-#endif
- QFileInfo( const QFileInfo & );
- ~QFileInfo();
-
- QFileInfo &operator=( const QFileInfo & );
-
- void setFile( const QString &file );
- void setFile( const QFile & );
-#ifndef QT_NO_DIR
- void setFile( const QDir &, const QString &fileName );
-#endif
- bool exists() const;
- void refresh() const;
- bool caching() const;
- void setCaching( bool );
-
- QString filePath() const;
- QString fileName() const;
-#ifndef QT_NO_DIR //###
- QString absFilePath() const;
-#endif
- QString baseName() const;
- QString extension( bool complete = TRUE ) const;
-
-#ifndef QT_NO_DIR //###
- QString dirPath( bool absPath = FALSE ) const;
-#endif
-#ifndef QT_NO_DIR
- QDir dir( bool absPath = FALSE ) const;
-#endif
- bool isReadable() const;
- bool isWritable() const;
- bool isExecutable() const;
-
-#ifndef QT_NO_DIR //###
- bool isRelative() const;
- bool convertToAbs();
-#endif
-
- bool isFile() const;
- bool isDir() const;
- bool isSymLink() const;
-
- QString readLink() const;
-
- QString owner() const;
- uint ownerId() const;
- QString group() const;
- uint groupId() const;
-
- bool permission( int permissionSpec ) const;
-
- uint size() const;
-
- QDateTime lastModified() const;
- QDateTime lastRead() const;
-
-private:
- void doStat() const;
- static void slashify( QString & );
- static void makeAbs( QString & );
-
- QString fn;
- QFileInfoCache *fic;
- bool cache;
-};
-
-
-inline bool QFileInfo::caching() const
-{
- return cache;
-}
-
-
-#endif // QFILEINFO_H
diff --git a/qtools/qfileinfo_unix.cpp b/qtools/qfileinfo_unix.cpp
deleted file mode 100644
index f2b438c..0000000
--- a/qtools/qfileinfo_unix.cpp
+++ /dev/null
@@ -1,425 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QFileInfo class
-**
-** Created : 950628
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses for Unix/X11 or for Qt/Embedded may use this file in accordance
-** with the Qt Commercial License Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qglobal.h"
-
-#if defined(_OS_SUN_)
-#define readlink _qt_hide_readlink
-#endif
-
-#include <pwd.h>
-#include <grp.h>
-
-#include "qfileinfo.h"
-#include "qfiledefs_p.h"
-#include "qdatetime.h"
-#include "qdir.h"
-
-#if defined(_OS_SUN_)
-#undef readlink
-extern "C" int readlink( const char *, void *, uint );
-#endif
-
-
-void QFileInfo::slashify( QString& )
-{
- return;
-}
-
-
-void QFileInfo::makeAbs( QString & )
-{
- return;
-}
-
-extern bool qt_file_access( const QString& fn, int t );
-
-/*!
- Returns TRUE if we are pointing to a real file.
- \sa isDir(), isSymLink()
-*/
-bool QFileInfo::isFile() const
-{
- if ( !fic || !cache )
- doStat();
- return fic ? (fic->st.st_mode & STAT_MASK) == STAT_REG : FALSE;
-}
-
-/*!
- Returns TRUE if we are pointing to a directory or a symbolic link to
- a directory.
- \sa isFile(), isSymLink()
-*/
-
-bool QFileInfo::isDir() const
-{
- if ( !fic || !cache )
- doStat();
- return fic ? (fic->st.st_mode & STAT_MASK) == STAT_DIR : FALSE;
-}
-
-/*!
- Returns TRUE if we are pointing to a symbolic link.
- \sa isFile(), isDir(), readLink()
-*/
-
-bool QFileInfo::isSymLink() const
-{
- if ( !fic || !cache )
- doStat();
- return fic ? fic->isSymLink : FALSE;
-}
-
-
-/*!
- Returns the name a symlink points to, or a null QString if the
- object does not refer to a symbolic link.
-
- This name may not represent an existing file; it is only a string.
- QFileInfo::exists() returns TRUE if the symlink points to an
- existing file.
-
- \sa exists(), isSymLink(), isDir(), isFile()
-*/
-
-QString QFileInfo::readLink() const
-{
- QString r;
-
-#if defined(_OS_UNIX_) && !defined(_OS_OS2EMX_)
- char s[PATH_MAX+1];
- if ( !isSymLink() )
- return QString();
- int len = (int)readlink( QFile::encodeName(fn).data(), s, PATH_MAX );
- if ( len >= 0 ) {
- s[len] = '\0';
- r = QFile::decodeName(s);
- }
-#endif
-
- return r;
-}
-
-static const uint nobodyID = (uint) -2;
-
-/*!
- Returns the owner of the file.
-
- On systems where files do not have owners this function returns 0.
-
- Note that this function can be time-consuming under UNIX. (in the order
- of milliseconds on a 486 DX2/66 running Linux).
-
- \sa ownerId(), group(), groupId()
-*/
-
-QString QFileInfo::owner() const
-{
- passwd *pw = getpwuid( ownerId() );
- if ( pw )
- return QFile::decodeName( pw->pw_name );
- return QString::null;
-}
-
-/*!
- Returns the id of the owner of the file.
-
- On systems where files do not have owners this function returns ((uint) -2).
-
- \sa owner(), group(), groupId()
-*/
-
-uint QFileInfo::ownerId() const
-{
- if ( !fic || !cache )
- doStat();
- if ( fic )
- return fic->st.st_uid;
- return nobodyID;
-}
-
-/*!
- Returns the group the file belongs to.
-
- On systems where files do not have groups this function always
- returns 0.
-
- Note that this function can be time-consuming under UNIX (in the order of
- milliseconds on a 486 DX2/66 running Linux).
-
- \sa groupId(), owner(), ownerId()
-*/
-
-QString QFileInfo::group() const
-{
- struct group *gr = getgrgid( groupId() );
- if ( gr )
- return QFile::decodeName( gr->gr_name );
- return QString::null;
-}
-
-/*!
- Returns the id of the group the file belongs to.
-
- On systems where files do not have groups this function always
- returns ((uind) -2).
-
- \sa group(), owner(), ownerId()
-*/
-
-uint QFileInfo::groupId() const
-{
- if ( !fic || !cache )
- doStat();
- if ( fic )
- return fic->st.st_gid;
- return nobodyID;
-}
-
-
-/*!
- \fn bool QFileInfo::permission( int permissionSpec ) const
-
- Tests for file permissions. The \e permissionSpec argument can be several
- flags of type PermissionSpec or'ed together to check for permission
- combinations.
-
- On systems where files do not have permissions this function always
- returns TRUE.
-
- Example:
- \code
- QFileInfo fi( "/tmp/tonsils" );
- if ( fi.permission( QFileInfo::WriteUser | QFileInfo::ReadGroup ) )
- qWarning( "Tonsils can be changed by me, and the group can read them.");
- if ( fi.permission( QFileInfo::WriteGroup | QFileInfo::WriteOther ) )
- qWarning( "Danger! Tonsils can be changed by the group or others!" );
- \endcode
-
- \sa isReadable(), isWritable(), isExecutable()
-*/
-
-bool QFileInfo::permission( int permissionSpec ) const
-{
- if ( !fic || !cache )
- doStat();
- if ( fic ) {
- uint mask = 0;
- if ( permissionSpec & ReadUser)
- mask |= S_IRUSR;
- if ( permissionSpec & WriteUser)
- mask |= S_IWUSR;
- if ( permissionSpec & ExeUser)
- mask |= S_IXUSR;
- if ( permissionSpec & ReadGroup)
- mask |= S_IRGRP;
- if ( permissionSpec & WriteGroup)
- mask |= S_IWGRP;
- if ( permissionSpec & ExeGroup)
- mask |= S_IXGRP;
- if ( permissionSpec & ReadOther)
- mask |= S_IROTH;
- if ( permissionSpec & WriteOther)
- mask |= S_IWOTH;
- if ( permissionSpec & ExeOther)
- mask |= S_IXOTH;
- if ( mask ) {
- return (fic->st.st_mode & mask) == mask;
- } else {
-#if defined(CHECK_NULL)
- qWarning( "QFileInfo::permission: permissionSpec is 0" );
-#endif
- return TRUE;
- }
- } else {
- return FALSE;
- }
-}
-
-/*!
- Returns the file size in bytes, or 0 if the file does not exist if the size
- cannot be fetched.
-*/
-
-uint QFileInfo::size() const
-{
- if ( !fic || !cache )
- doStat();
- if ( fic )
- return (uint)fic->st.st_size;
- else
- return 0;
-}
-
-
-/*!
- Returns the date and time when the file was last modified.
- \sa lastRead()
-*/
-
-QDateTime QFileInfo::lastModified() const
-{
- QDateTime dt;
- if ( !fic || !cache )
- doStat();
- if ( fic )
- dt.setTime_t( (uint)fic->st.st_mtime );
- return dt;
-}
-
-/*!
- Returns the date and time when the file was last read (accessed).
-
- On systems that do not support last read times, the modification time is
- returned.
-
- \sa lastModified()
-*/
-
-QDateTime QFileInfo::lastRead() const
-{
- QDateTime dt;
- if ( !fic || !cache )
- doStat();
- if ( fic )
- dt.setTime_t( (uint)fic->st.st_atime );
- return dt;
-}
-
-
-void QFileInfo::doStat() const
-{
- QFileInfo *that = ((QFileInfo*)this); // mutable function
- if ( !that->fic )
- that->fic = new QFileInfoCache;
- STATBUF *b = &that->fic->st;
- that->fic->isSymLink = FALSE;
-
-#if defined(_OS_UNIX_) && defined(S_IFLNK)
- if ( ::lstat(QFile::encodeName(fn),b) == 0 ) {
- if ( S_ISLNK( b->st_mode ) )
- that->fic->isSymLink = TRUE;
- else
- return;
- }
-#endif
- int r;
-
- r = STAT( QFile::encodeName(fn), b );
-
- if ( r != 0 ) {
- delete that->fic;
- that->fic = 0;
- }
-}
-
-/*!
- Returns the directory path of the file.
-
- If \e absPath is TRUE an absolute path is always returned.
-
- \sa dir(), filePath(), fileName(), isRelative()
-*/
-#ifndef QT_NO_DIR
-QString QFileInfo::dirPath( bool absPath ) const
-{
- QString s;
- if ( absPath )
- s = absFilePath();
- else
- s = fn;
- int pos = s.findRev( '/' );
- if ( pos == -1 ) {
- return QString::fromLatin1(".");
- } else {
- if ( pos == 0 )
- return QString::fromLatin1( "/" );
- return s.left( pos );
- }
-}
-#endif
-/*!
- Returns the name of the file, the file path is not included.
-
- Example:
- \code
- QFileInfo fi( "/tmp/abdomen.lower" );
- QString name = fi.fileName(); // name = "abdomen.lower"
- \endcode
-
- \sa isRelative(), filePath(), baseName(), extension()
-*/
-
-QString QFileInfo::fileName() const
-{
- int p = fn.findRev( '/' );
- if ( p == -1 ) {
- return fn;
- } else {
- return fn.mid(p+1);
- }
-}
-
-/*!
- Returns the absolute path name.
-
- The absolute path name is the file name including the absolute path. If
- the QFileInfo is absolute (i.e. not relative) this function will return
- the same string as filePath().
-
- Note that this function can be time-consuming under UNIX. (in the order
- of milliseconds on a 486 DX2/66 running Linux).
-
- \sa isRelative(), filePath()
-*/
-#ifndef QT_NO_DIR
-QString QFileInfo::absFilePath() const
-{
- if ( QDir::isRelativePath(fn) ) {
- QString tmp = QDir::currentDirPath();
- tmp += '/';
- tmp += fn;
- makeAbs( tmp );
- return QDir::cleanDirPath( tmp );
- } else {
- QString tmp = fn;
- makeAbs( tmp );
- return QDir::cleanDirPath( tmp );
- }
-
-}
-#endif
diff --git a/qtools/qfileinfo_win32.cpp b/qtools/qfileinfo_win32.cpp
deleted file mode 100644
index 1061fae..0000000
--- a/qtools/qfileinfo_win32.cpp
+++ /dev/null
@@ -1,357 +0,0 @@
-/******************************************************************************
- *
- *
- *
- * Copyright (C) 1997-2001 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.
- *
- * Based on qfileinfo_unix.cpp
- *
- * Copyright (C) 1992-2000 Trolltech AS.
- */
-
-#include "qglobal.h"
-
-#include "qfileinfo.h"
-#include "qfiledefs_p.h"
-#include "qdatetime.h"
-#include "qdir.h"
-
-static void reslashify( QString& n )
-{
- for ( int i=0; i<(int)n.length(); i++ )
- {
- if ( n[i] == '/' )
- n[i] = '\\';
- }
-}
-
-void QFileInfo::slashify( QString& n )
-{
- for ( int i=0; i<(int)n.length(); i++ )
- {
- if ( n[i] == '\\' )
- n[i] = '/';
- }
-}
-
-void QFileInfo::makeAbs( QString & )
-{
- // TODO: what to do here?
- return;
-}
-
-extern bool qt_file_access( const QString& fn, int t );
-
-/*!
- Returns TRUE if we are pointing to a real file.
- \sa isDir(), isSymLink()
-*/
-bool QFileInfo::isFile() const
-{
- if ( !fic || !cache )
- doStat();
- return fic ? (fic->st.st_mode & STAT_MASK) == STAT_REG : FALSE;
-}
-
-/*!
- Returns TRUE if we are pointing to a directory or a symbolic link to
- a directory.
- \sa isFile(), isSymLink()
-*/
-
-bool QFileInfo::isDir() const
-{
- if ( !fic || !cache )
- doStat();
- return fic ? (fic->st.st_mode & STAT_MASK) == STAT_DIR : FALSE;
-}
-
-/*!
- Returns TRUE if we are pointing to a symbolic link.
- \sa isFile(), isDir(), readLink()
-*/
-
-bool QFileInfo::isSymLink() const
-{
- if ( !fic || !cache )
- doStat();
- return fic ? fic->isSymLink : FALSE;
-}
-
-
-/*!
- Returns the name a symlink points to, or a null QString if the
- object does not refer to a symbolic link.
-
- This name may not represent an existing file; it is only a string.
- QFileInfo::exists() returns TRUE if the symlink points to an
- existing file.
-
- \sa exists(), isSymLink(), isDir(), isFile()
-*/
-
-QString QFileInfo::readLink() const
-{
- QString r;
- return r;
-}
-
-static const uint nobodyID = (uint) -2;
-
-/*!
- Returns the owner of the file.
-
- On systems where files do not have owners this function returns
- a null string.
-
- Note that this function can be time-consuming under UNIX. (in the order
- of milliseconds on a 486 DX2/66 running Linux).
-
- \sa ownerId(), group(), groupId()
-*/
-
-QString QFileInfo::owner() const
-{
- return QString::null;
-}
-
-/*!
- Returns the id of the owner of the file.
-
- On systems where files do not have owners this function returns ((uint) -2).
-
- \sa owner(), group(), groupId()
-*/
-
-uint QFileInfo::ownerId() const
-{
- return (uint)-2;
-}
-
-/*!
- Returns the group the file belongs to.
-
- On systems where files do not have groups this function always
- returns 0.
-
- Note that this function can be time-consuming under UNIX (in the order of
- milliseconds on a 486 DX2/66 running Linux).
-
- \sa groupId(), owner(), ownerId()
-*/
-
-QString QFileInfo::group() const
-{
- return QString::null;
-}
-
-/*!
- Returns the id of the group the file belongs to.
-
- On systems where files do not have groups this function always
- returns ((uind) -2).
-
- \sa group(), owner(), ownerId()
-*/
-
-uint QFileInfo::groupId() const
-{
- return (uint)-2;
-}
-
-
-/*!
- \fn bool QFileInfo::permission( int permissionSpec ) const
-
- Tests for file permissions. The \e permissionSpec argument can be several
- flags of type PermissionSpec or'ed together to check for permission
- combinations.
-
- On systems where files do not have permissions this function always
- returns TRUE.
-
- Example:
- \code
- QFileInfo fi( "/tmp/tonsils" );
- if ( fi.permission( QFileInfo::WriteUser | QFileInfo::ReadGroup ) )
- qWarning( "Tonsils can be changed by me, and the group can read them.");
- if ( fi.permission( QFileInfo::WriteGroup | QFileInfo::WriteOther ) )
- qWarning( "Danger! Tonsils can be changed by the group or others!" );
- \endcode
-
- \sa isReadable(), isWritable(), isExecutable()
-*/
-
-bool QFileInfo::permission( int permissionSpec ) const
-{
- return TRUE;
-}
-
-/*!
- Returns the file size in bytes, or 0 if the file does not exist if the size
- cannot be fetched.
-*/
-
-uint QFileInfo::size() const
-{
- if ( !fic || !cache )
- doStat();
- if ( fic )
- return (uint)fic->st.st_size;
- else
- return 0;
-}
-
-
-/*!
- Returns the date and time when the file was last modified.
- \sa lastRead()
-*/
-
-QDateTime QFileInfo::lastModified() const
-{
- QDateTime dt;
- if ( !fic || !cache )
- doStat();
- if ( fic )
- dt.setTime_t( fic->st.st_mtime );
- return dt;
-}
-
-/*!
- Returns the date and time when the file was last read (accessed).
-
- On systems that do not support last read times, the modification time is
- returned.
-
- \sa lastModified()
-*/
-
-QDateTime QFileInfo::lastRead() const
-{
- QDateTime dt;
- if ( !fic || !cache )
- doStat();
- if ( fic )
- dt.setTime_t( fic->st.st_atime );
- return dt;
-}
-
-
-void QFileInfo::doStat() const
-{
- QFileInfo *that = ((QFileInfo*)this); // mutable function
- if ( !that->fic )
- that->fic = new QFileInfoCache;
- STATBUF *b = &that->fic->st;
- that->fic->isSymLink = FALSE;
-
-#if defined(__CYGWIN32_)
- int r;
-
- r = STAT( QFile::encodeName(fn), b );
-
- if ( r != 0 ) {
- delete that->fic;
- that->fic = 0;
- }
-#else
- QString file = fn;
- file = QDir::cleanDirPath(file);
- reslashify(file);
-#ifdef QT_LARGEFILE_SUPPORT
- if ( _wstati64( (wchar_t*) file.ucs2(), b ) == -1 ) {
-#else
- if ( _wstat( (wchar_t*) file.ucs2(), b ) == -1 ) {
-#endif
- delete that->fic;
- that->fic = 0;
- }
-#endif
-}
-
-/*!
- Returns the directory path of the file.
-
- If \e absPath is TRUE an absolute path is always returned.
-
- \sa dir(), filePath(), fileName(), isRelative()
-*/
-#ifndef QT_NO_DIR
-QString QFileInfo::dirPath( bool absPath ) const
-{
- QString s;
- if ( absPath )
- s = absFilePath();
- else
- s = fn;
- int pos = s.findRev( '/' );
- if ( pos == -1 ) {
- return QString::fromLatin1(".");
- } else {
- if ( pos == 0 )
- return QString::fromLatin1( "/" );
- return s.left( pos );
- }
-}
-#endif
-/*!
- Returns the name of the file, the file path is not included.
-
- Example:
- \code
- QFileInfo fi( "/tmp/abdomen.lower" );
- QString name = fi.fileName(); // name = "abdomen.lower"
- \endcode
-
- \sa isRelative(), filePath(), baseName(), extension()
-*/
-
-QString QFileInfo::fileName() const
-{
- int p = fn.findRev( '/' );
- if ( p == -1 ) {
- return fn;
- } else {
- return fn.mid(p+1);
- }
-}
-
-/*!
- Returns the absolute path name.
-
- The absolute path name is the file name including the absolute path. If
- the QFileInfo is absolute (i.e. not relative) this function will return
- the same string as filePath().
-
- Note that this function can be time-consuming under UNIX. (in the order
- of milliseconds on a 486 DX2/66 running Linux).
-
- \sa isRelative(), filePath()
-*/
-#ifndef QT_NO_DIR
-QString QFileInfo::absFilePath() const
-{
- if ( QDir::isRelativePath(fn) ) {
- QString tmp = QDir::currentDirPath();
- tmp += '/';
- tmp += fn;
- makeAbs( tmp );
- return QDir::cleanDirPath( tmp );
- } else {
- QString tmp = fn;
- makeAbs( tmp );
- return QDir::cleanDirPath( tmp );
- }
-
-}
-#endif
diff --git a/qtools/qgarray.cpp b/qtools/qgarray.cpp
deleted file mode 100644
index 2607a26..0000000
--- a/qtools/qgarray.cpp
+++ /dev/null
@@ -1,747 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QGArray class
-**
-** Created : 930906
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#define QGARRAY_CPP
-#include "qgarray.h"
-#include "qstring.h"
-#include <stdlib.h>
-
-#define USE_MALLOC // comment to use new/delete
-
-#undef NEW
-#undef DELETE
-
-#if defined(USE_MALLOC)
-#define NEW(type,size) ((type*)malloc(size*sizeof(type)))
-#define DELETE(array) (free((char*)array))
-#else
-#define NEW(type,size) (new type[size])
-#define DELETE(array) (delete[] array)
-#define DONT_USE_REALLOC // comment to use realloc()
-#endif
-
-
-// NOT REVISED
-/*!
- \class QShared qshared.h
- \brief The QShared struct is internally used for implementing shared classes.
-
- It only contains a reference count and member functions to increment and
- decrement it.
-
- Shared classes normally have internal classes that inherit QShared and
- add the shared data.
-
- \sa \link shclass.html Shared Classes\endlink
-*/
-
-
-/*!
- \class QGArray qgarray.h
- \brief The QGArray class is an internal class for implementing the QArray class.
-
- QGArray is a strictly internal class that acts as base class for the
- QArray template array.
-
- It contains an array of bytes and has no notion of an array element.
-*/
-
-
-/*!
- \internal
- Constructs a null array.
-*/
-
-QGArray::QGArray()
-{
- shd = newData();
- CHECK_PTR( shd );
-}
-
-/*!
- \internal
- Dummy constructor; does not allocate any data.
-
- This constructor does not initialize any array data so subclasses
- must do it. The intention is to make the code more efficient.
-*/
-
-QGArray::QGArray( int, int )
-{
-}
-
-/*!
- \internal
- Constructs an array with room for \e size bytes.
-*/
-
-QGArray::QGArray( int size )
-{
- if ( size < 0 ) {
-#if defined(CHECK_RANGE)
- qWarning( "QGArray: Cannot allocate array with negative length" );
-#endif
- size = 0;
- }
- shd = newData();
- CHECK_PTR( shd );
- if ( size == 0 ) // zero length
- return;
- shd->data = NEW(char,size);
- CHECK_PTR( shd->data );
- shd->len = size;
-}
-
-/*!
- \internal
- Constructs a shallow copy of \e a.
-*/
-
-QGArray::QGArray( const QGArray &a )
-{
- shd = a.shd;
- shd->ref();
-}
-
-/*!
- \internal
- Dereferences the array data and deletes it if this was the last
- reference.
-*/
-
-QGArray::~QGArray()
-{
- if ( shd && shd->deref() ) { // delete when last reference
- if ( shd->data ) // is lost
- DELETE(shd->data);
- deleteData( shd );
- }
-}
-
-
-/*!
- \fn QGArray &QGArray::operator=( const QGArray &a )
- \internal
- Assigns a shallow copy of \e a to this array and returns a reference to
- this array. Equivalent to assign().
-*/
-
-/*!
- \fn void QGArray::detach()
- \internal
- Detaches this array from shared array data.
-*/
-
-/*!
- \fn char *QGArray::data() const
- \internal
- Returns a pointer to the actual array data.
-*/
-
-/*!
- \fn uint QGArray::nrefs() const
- \internal
- Returns the reference count.
-*/
-
-/*!
- \fn uint QGArray::size() const
- \internal
- Returns the size of the array, in bytes.
-*/
-
-
-/*!
- \internal
- Returns TRUE if this array is equal to \e a, otherwise FALSE.
- The comparison is bitwise, of course.
-*/
-
-bool QGArray::isEqual( const QGArray &a ) const
-{
- if ( size() != a.size() ) // different size
- return FALSE;
- if ( data() == a.data() ) // has same data
- return TRUE;
- return (size() ? memcmp( data(), a.data(), size() ) : 0) == 0;
-}
-
-
-/*!
- \internal
- Resizes the array to \e newsize bytes.
-*/
-
-bool QGArray::resize( uint newsize )
-{
- if ( newsize == shd->len ) // nothing to do
- return TRUE;
- if ( newsize == 0 ) { // remove array
- duplicate( 0, 0 );
- return TRUE;
- }
- if ( shd->data ) { // existing data
-#if defined(DONT_USE_REALLOC)
- char *newdata = NEW(char,newsize); // manual realloc
- memcpy( newdata, shd->data, QMIN(shd->len,newsize) );
- DELETE(shd->data);
- shd->data = newdata;
-#else
- shd->data = (char *)realloc( shd->data, newsize );
-#endif
- } else {
- shd->data = NEW(char,newsize);
- }
- CHECK_PTR( shd->data );
- if ( !shd->data ) // no memory
- return FALSE;
- shd->len = newsize;
- return TRUE;
-}
-
-/*!
- \internal
- Fills the array with the repeated occurrences of \e d, which is
- \e sz bytes long.
- If \e len is specified as different from -1, then the array will be
- resized to \e len*sz before it is filled.
-
- Returns TRUE if successful, or FALSE if the memory cannot be allocated
- (only when \e len != -1).
-
- \sa resize()
-*/
-
-bool QGArray::fill( const char *d, int len, uint sz )
-{
- if ( len < 0 )
- len = shd->len/sz; // default: use array length
- else if ( !resize( len*sz ) )
- return FALSE;
- if ( sz == 1 ) // 8 bit elements
- memset( data(), *d, len );
- else if ( sz == 4 ) { // 32 bit elements
- Q_INT32 *x = (Q_INT32*)data();
- Q_INT32 v = *((Q_INT32*)d);
- while ( len-- )
- *x++ = v;
- } else if ( sz == 2 ) { // 16 bit elements
- Q_INT16 *x = (Q_INT16*)data();
- Q_INT16 v = *((Q_INT16*)d);
- while ( len-- )
- *x++ = v;
- } else { // any other size elements
- char *x = data();
- while ( len-- ) { // more complicated
- memcpy( x, d, sz );
- x += sz;
- }
- }
- return TRUE;
-}
-
-/*!
- \internal
- Shallow copy. Dereference the current array and references the data
- contained in \e a instead. Returns a reference to this array.
- \sa operator=()
-*/
-
-QGArray &QGArray::assign( const QGArray &a )
-{
- a.shd->ref(); // avoid 'a = a'
- if ( shd->deref() ) { // delete when last reference
- if ( shd->data ) // is lost
- DELETE(shd->data);
- deleteData( shd );
- }
- shd = a.shd;
- return *this;
-}
-
-/*!
- \internal
- Shallow copy. Dereference the current array and references the
- array data \e d, which contains \e len bytes.
- Returns a reference to this array.
-
- Do not delete \e d later, because QGArray takes care of that.
-*/
-
-QGArray &QGArray::assign( const char *d, uint len )
-{
- if ( shd->count > 1 ) { // disconnect this
- shd->count--;
- shd = newData();
- CHECK_PTR( shd );
- } else {
- if ( shd->data )
- DELETE(shd->data);
- }
- shd->data = (char *)d;
- shd->len = len;
- return *this;
-}
-
-/*!
- \internal
- Deep copy. Dereference the current array and obtains a copy of the data
- contained in \e a instead. Returns a reference to this array.
- \sa assign(), operator=()
-*/
-
-QGArray &QGArray::duplicate( const QGArray &a )
-{
- if ( a.shd == shd ) { // a.duplicate(a) !
- if ( shd->count > 1 ) {
- shd->count--;
- array_data *n = newData();
- CHECK_PTR( n );
- if ( (n->len=shd->len) ) {
- n->data = NEW(char,n->len);
- CHECK_PTR( n->data );
- if ( n->data )
- memcpy( n->data, shd->data, n->len );
- } else {
- n->data = 0;
- }
- shd = n;
- }
- return *this;
- }
- char *oldptr = 0;
- if ( shd->count > 1 ) { // disconnect this
- shd->count--;
- shd = newData();
- CHECK_PTR( shd );
- } else { // delete after copy was made
- oldptr = shd->data;
- }
- if ( a.shd->len ) { // duplicate data
- shd->data = NEW(char,a.shd->len);
- CHECK_PTR( shd->data );
- if ( shd->data )
- memcpy( shd->data, a.shd->data, a.shd->len );
- } else {
- shd->data = 0;
- }
- shd->len = a.shd->len;
- if ( oldptr )
- DELETE(oldptr);
- return *this;
-}
-
-/*!
- \internal
- Deep copy. Dereferences the current array and obtains a copy of the
- array data \e d instead. Returns a reference to this array.
- \sa assign(), operator=()
-*/
-
-QGArray &QGArray::duplicate( const char *d, uint len )
-{
- char *data;
- if ( d == 0 || len == 0 ) {
- data = 0;
- len = 0;
- } else {
- if ( shd->count == 1 && shd->len == len ) {
- memcpy( shd->data, d, len ); // use same buffer
- return *this;
- }
- data = NEW(char,len);
- CHECK_PTR( data );
- memcpy( data, d, len );
- }
- if ( shd->count > 1 ) { // detach
- shd->count--;
- shd = newData();
- CHECK_PTR( shd );
- } else { // just a single reference
- if ( shd->data )
- DELETE(shd->data);
- }
- shd->data = data;
- shd->len = len;
- return *this;
-}
-
-/*!
- \internal
- Resizes this array to \e len bytes and copies the \e len bytes at
- address \e into it.
-
- \warning This function disregards the reference count mechanism. If
- other QGArrays reference the same data as this, all will be updated.
-*/
-
-void QGArray::store( const char *d, uint len )
-{ // store, but not deref
- resize( len );
- memcpy( shd->data, d, len );
-}
-
-
-/*!
- \fn array_data *QGArray::sharedBlock() const
- \internal
- Returns a pointer to the shared array block.
-
- \warning
-
- Do not use this function. Using it is begging for trouble. We dare
- not remove it, for fear of breaking code, but we \e strongly
- discourage new use of it.
-*/
-
-/*!
- \fn void QGArray::setSharedBlock( array_data *p )
- \internal
- Sets the shared array block to \e p.
-
- \warning
-
- Do not use this function. Using it is begging for trouble. We dare
- not remove it, for fear of breaking code, but we \e strongly
- discourage new use of it.
-*/
-
-
-/*!
- \internal
- Sets raw data and returns a reference to the array.
-
- Dereferences the current array and sets the new array data to \e d and
- the new array size to \e len. Do not attempt to resize or re-assign the
- array data when raw data has been set.
- Call resetRawData(d,len) to reset the array.
-
- Setting raw data is useful because it set QArray data without allocating
- memory or copying data.
-
- Example of intended use:
- \code
- static uchar bindata[] = { 231, 1, 44, ... };
- QByteArray a;
- a.setRawData( bindata, sizeof(bindata) ); // a points to bindata
- QDataStream s( a, IO_ReadOnly ); // open on a's data
- s >> <something>; // read raw bindata
- s.close();
- a.resetRawData( bindata, sizeof(bindata) ); // finished
- \endcode
-
- Example of misuse (do not do this):
- \code
- static uchar bindata[] = { 231, 1, 44, ... };
- QByteArray a, b;
- a.setRawData( bindata, sizeof(bindata) ); // a points to bindata
- a.resize( 8 ); // will crash
- b = a; // will crash
- a[2] = 123; // might crash
- // forget to resetRawData - will crash
- \endcode
-
- \warning If you do not call resetRawData(), QGArray will attempt to
- deallocate or reallocate the raw data, which might not be too good.
- Be careful.
-*/
-
-QGArray &QGArray::setRawData( const char *d, uint len )
-{
- duplicate( 0, 0 ); // set null data
- shd->data = (char *)d;
- shd->len = len;
- return *this;
-}
-
-/*!
- \internal
- Resets raw data.
-
- The arguments must be the data and length that were passed to
- setRawData(). This is for consistency checking.
-*/
-
-void QGArray::resetRawData( const char *d, uint len )
-{
- if ( d != shd->data || len != shd->len ) {
-#if defined(CHECK_STATE)
- qWarning( "QGArray::resetRawData: Inconsistent arguments" );
-#endif
- return;
- }
- shd->data = 0;
- shd->len = 0;
-}
-
-
-/*!
- \internal
- Finds the first occurrence of \e d in the array from position \e index,
- where \e sz is the size of the \e d element.
-
- Note that \e index is given in units of \e sz, not bytes.
-
- This function only compares whole cells, not bytes.
-*/
-
-int QGArray::find( const char *d, uint index, uint sz ) const
-{
- index *= sz;
- if ( index >= shd->len ) {
-#if defined(CHECK_RANGE)
- qWarning( "QGArray::find: Index %d out of range", index/sz );
-#endif
- return -1;
- }
- uint i;
- uint ii;
- switch ( sz ) {
- case 1: { // 8 bit elements
- char *x = data() + index;
- char v = *d;
- for ( i=index; i<shd->len; i++ ) {
- if ( *x++ == v )
- break;
- }
- ii = i;
- }
- break;
- case 2: { // 16 bit elements
- Q_INT16 *x = (Q_INT16*)(data() + index);
- Q_INT16 v = *((Q_INT16*)d);
- for ( i=index; i<shd->len; i+=2 ) {
- if ( *x++ == v )
- break;
- }
- ii = i/2;
- }
- break;
- case 4: { // 32 bit elements
- Q_INT32 *x = (Q_INT32*)(data() + index);
- Q_INT32 v = *((Q_INT32*)d);
- for ( i=index; i<shd->len; i+=4 ) {
- if ( *x++ == v )
- break;
- }
- ii = i/4;
- }
- break;
- default: { // any size elements
- for ( i=index; i<shd->len; i+=sz ) {
- if ( memcmp( d, &shd->data[i], sz ) == 0 )
- break;
- }
- ii = i/sz;
- }
- break;
- }
- return i<shd->len ? (int)ii : -1;
-}
-
-/*!
- \internal
- Returns the number of occurrences of \e d in the array, where \e sz is
- the size of the \e d element.
-
- This function only compares whole cells, not bytes.
-*/
-
-int QGArray::contains( const char *d, uint sz ) const
-{
- uint i = shd->len;
- int count = 0;
- switch ( sz ) {
- case 1: { // 8 bit elements
- char *x = data();
- char v = *d;
- while ( i-- ) {
- if ( *x++ == v )
- count++;
- }
- }
- break;
- case 2: { // 16 bit elements
- Q_INT16 *x = (Q_INT16*)data();
- Q_INT16 v = *((Q_INT16*)d);
- i /= 2;
- while ( i-- ) {
- if ( *x++ == v )
- count++;
- }
- }
- break;
- case 4: { // 32 bit elements
- Q_INT32 *x = (Q_INT32*)data();
- Q_INT32 v = *((Q_INT32*)d);
- i /= 4;
- while ( i-- ) {
- if ( *x++ == v )
- count++;
- }
- }
- break;
- default: { // any size elements
- for ( i=0; i<shd->len; i+=sz ) {
- if ( memcmp(d, &shd->data[i], sz) == 0 )
- count++;
- }
- }
- break;
- }
- return count;
-}
-
-static int cmp_item_size = 0;
-
-#if defined(Q_C_CALLBACKS)
-extern "C" {
-#endif
-
-static int cmp_arr( const void *n1, const void *n2 )
-{
- return ( n1 && n2 ) ? memcmp( n1, n2, cmp_item_size )
- : (int)((intptr_t)n1 - (intptr_t)n2);
- // Qt 3.0: Add a virtual compareItems() method and call that instead
-}
-
-#if defined(Q_C_CALLBACKS)
-}
-#endif
-
-/*!
- \internal
-
- Sort the array.
-*/
-
-void QGArray::sort( uint sz )
-{
- int numItems = size() / sz;
- if ( numItems < 2 )
- return;
- cmp_item_size = sz;
- qsort( shd->data, numItems, sz, cmp_arr );
-}
-
-/*!
- \internal
-
- Binary search; assumes sorted array
-*/
-
-int QGArray::bsearch( const char *d, uint sz ) const
-{
- int numItems = size() / sz;
- if ( !numItems )
- return -1;
- cmp_item_size = sz;
- char* r = (char*)::bsearch( d, shd->data, numItems, sz, cmp_arr );
- if ( !r )
- return -1;
- while( (r >= shd->data + sz) && (cmp_arr( r - sz, d ) == 0) )
- r -= sz; // search to first of equal elements; bsearch is undef
- return (int)(( r - shd->data ) / sz);
-}
-
-
-/*!
- \fn char *QGArray::at( uint index ) const
- \internal
- Returns a pointer to the byte at offset \e index in the array.
-*/
-
-/*!
- \internal
- Expand the array if necessary, and copies (the first part of) its
- contents from the \e index*zx bytes at \e d.
-
- Returns TRUE if the operation succeeds, FALSE if it runs out of
- memory.
-
- \warning This function disregards the reference count mechanism. If
- other QGArrays reference the same data as this, all will be changed.
-*/
-
-bool QGArray::setExpand( uint index, const char *d, uint sz )
-{
- index *= sz;
- if ( index >= shd->len ) {
- if ( !resize( index+sz ) ) // no memory
- return FALSE;
- }
- memcpy( data() + index, d, sz );
- return TRUE;
-}
-
-
-/*!
- \internal
- Prints a warning message if at() or [] is given a bad index.
-*/
-
-void QGArray::msg_index( uint index )
-{
-#if defined(CHECK_RANGE)
- qWarning( "QGArray::at: Absolute index %d out of range", index );
-#else
- Q_UNUSED( index )
-#endif
-}
-
-
-/*!
- \internal
- Returns a new shared array block.
-*/
-
-QGArray::array_data * QGArray::newData()
-{
- return new array_data;
-}
-
-
-/*!
- \internal
- Deletes the shared array block.
-*/
-
-void QGArray::deleteData( array_data *p )
-{
- delete p;
- p = 0;
-}
diff --git a/qtools/qgarray.h b/qtools/qgarray.h
deleted file mode 100644
index 12c463b..0000000
--- a/qtools/qgarray.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QGArray class
-**
-** Created : 930906
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QGARRAY_H
-#define QGARRAY_H
-
-#ifndef QT_H
-#include "qshared.h"
-#endif // QT_H
-
-
-class Q_EXPORT QGArray // generic array
-{
-friend class QBuffer;
-public:
- //### DO NOT USE THIS. IT IS PUBLIC BUT DO NOT USE IT IN NEW CODE.
- struct array_data : public QShared { // shared array
- array_data() { data=0; len=0; }
- char *data; // actual array data
- uint len;
- };
- QGArray();
-protected:
- QGArray( int, int ); // dummy; does not alloc
- QGArray( int size ); // allocate 'size' bytes
- QGArray( const QGArray &a ); // shallow copy
- virtual ~QGArray();
-
- QGArray &operator=( const QGArray &a ) { return assign( a ); }
-
- virtual void detach() { duplicate(*this); }
-
- char *data() const { return shd->data; }
- uint nrefs() const { return shd->count; }
- uint size() const { return shd->len; }
- bool isEqual( const QGArray &a ) const;
-
- bool resize( uint newsize );
-
- bool fill( const char *d, int len, uint sz );
-
- QGArray &assign( const QGArray &a );
- QGArray &assign( const char *d, uint len );
- QGArray &duplicate( const QGArray &a );
- QGArray &duplicate( const char *d, uint len );
- void store( const char *d, uint len );
-
- array_data *sharedBlock() const { return shd; }
- void setSharedBlock( array_data *p ) { shd=(array_data*)p; }
-
- QGArray &setRawData( const char *d, uint len );
- void resetRawData( const char *d, uint len );
-
- int find( const char *d, uint index, uint sz ) const;
- int contains( const char *d, uint sz ) const;
-
- void sort( uint sz );
- int bsearch( const char *d, uint sz ) const;
-
- char *at( uint index ) const;
-
- bool setExpand( uint index, const char *d, uint sz );
-
-protected:
- virtual array_data *newData();
- virtual void deleteData( array_data *p );
-
-private:
- static void msg_index( uint );
- array_data *shd;
-};
-
-
-inline char *QGArray::at( uint index ) const
-{
-#if defined(CHECK_RANGE)
- if ( index >= size() ) {
- msg_index( index );
- index = 0;
- }
-#endif
- return &shd->data[index];
-}
-
-
-#endif // QGARRAY_H
diff --git a/qtools/qgdict.cpp b/qtools/qgdict.cpp
deleted file mode 100644
index a3db8de..0000000
--- a/qtools/qgdict.cpp
+++ /dev/null
@@ -1,1217 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QGDict and QGDictIterator classes
-**
-** Created : 920529
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qgdict.h"
-#include "qinternallist.h"
-#include "qstring.h"
-#include "qdatastream.h"
-#include <ctype.h>
-
-// NOT REVISED
-/*!
- \class QGDict qgdict.h
- \brief The QGDict class is an internal class for implementing QDict template classes.
-
- QGDict is a strictly internal class that acts as a base class for the
- \link collection.html collection classes\endlink QDict and QIntDict.
-
- QGDict has some virtual functions that can be reimplemented to customize
- the subclasses.
- <ul>
- <li> read() reads a collection/dictionary item from a QDataStream.
- <li> write() writes a collection/dictionary item to a QDataStream.
- </ul>
- Normally, you do not have to reimplement any of these functions.
-*/
-
-static const int op_find = 0;
-static const int op_insert = 1;
-static const int op_replace = 2;
-
-
-class QGDItList : public QInternalList<QGDictIterator>
-{
-public:
- QGDItList() : QInternalList<QGDictIterator>() {}
- QGDItList( const QGDItList &list ) : QInternalList<QGDictIterator>(list) {}
- ~QGDItList() { clear(); }
- QGDItList &operator=(const QGDItList &list)
- { return (QGDItList&)QInternalList<QGDictIterator>::operator=(list); }
-};
-
-
-/*****************************************************************************
- Default implementation of special and virtual functions
- *****************************************************************************/
-
-/*!
- \internal
- Returns the hash key for \e key, when key is a string.
-*/
-
-int QGDict::hashKeyString( const QCString &key )
-{
- return hashKeyAscii(key.data());
-}
-
-/*!
- \internal
- Returns the hash key for \a key, which is a C string.
-*/
-
-int QGDict::hashKeyAscii( const char *key )
-{
-#if defined(CHECK_NULL)
- if ( key == 0 )
- {
- qWarning( "QGDict::hashAsciiKey: Invalid null key" );
- return 0;
- }
-#endif
- const char *k = key;
- uint h=0;
- uint g;
- if ( cases ) { // case sensitive
- while ( *k ) {
- h = (h<<4) + *k++;
- if ( (g = h & 0xf0000000) )
- h ^= g >> 24;
- h &= ~g;
- }
- } else { // case insensitive
- while ( *k ) {
- h = (h<<4) + tolower(*k);
- if ( (g = h & 0xf0000000) )
- h ^= g >> 24;
- h &= ~g;
- k++;
- }
- }
- int index = h;
- if ( index < 0 ) // adjust index to table size
- index = -index;
- return index;
-}
-
-#if 0
-int QGDict::hashKeyAscii( const char *key )
-{
-#if defined(CHECK_NULL)
- if ( key == 0 )
- {
- qWarning( "QGDict::hashAsciiKey: Invalid null key" );
- return 0;
- }
-#endif
- unsigned int hash = 5381;
- int c;
- // use djb2 by Dan Bernstein
- if (cases)
- {
- while ((c=*key++)) hash = ((hash<<5)+hash)+c;
- }
- else
- {
- while ((c=*key++)) hash = ((hash<<5)+hash)+tolower(c);
- }
- int index = hash;
- return index<0 ? -index : index;
-}
-#endif
-
-#ifndef QT_NO_DATASTREAM
-
-/*!
- Reads a collection/dictionary item from the stream \e s and returns a
- reference to the stream.
-
- The default implementation sets \e item to 0.
-
- \sa write()
-*/
-
-QDataStream& QGDict::read( QDataStream &s, QCollection::Item &item )
-{
- item = 0;
- return s;
-}
-
-/*!
- Writes a collection/dictionary item to the stream \e s and returns a
- reference to the stream.
-
- \sa read()
-*/
-
-QDataStream& QGDict::write( QDataStream &s, QCollection::Item ) const
-{
- return s;
-}
-#endif //QT_NO_DATASTREAM
-
-/*****************************************************************************
- QGDict member functions
- *****************************************************************************/
-
-/*!
- \internal
- Constructs a dictionary.
-*/
-
-QGDict::QGDict( uint len, KeyType kt, bool caseSensitive, bool copyKeys )
-{
- init( len, kt, caseSensitive, copyKeys );
-}
-
-
-void QGDict::init( uint len, KeyType kt, bool caseSensitive, bool copyKeys )
-{
- vec = new QBaseBucket *[vlen = len]; // allocate hash table
- CHECK_PTR( vec );
- memset( (char*)vec, 0, vlen*sizeof(QBaseBucket*) );
- numItems = 0;
- iterators = 0;
- // The caseSensitive and copyKey options don't make sense for
- // all dict types.
- switch ( (keytype = (uint)kt) ) {
- case StringKey:
- cases = caseSensitive;
- copyk = FALSE;
- break;
- case AsciiKey:
- cases = caseSensitive;
- copyk = copyKeys;
- break;
- default:
- cases = FALSE;
- copyk = FALSE;
- break;
- }
-}
-
-
-/*!
- \internal
- Constructs a copy of \e dict.
-*/
-
-QGDict::QGDict( const QGDict & dict )
- : QCollection( dict )
-{
- init( dict.vlen, (KeyType)dict.keytype, dict.cases, dict.copyk );
- QGDictIterator it( dict );
- while ( it.get() ) { // copy from other dict
- switch ( keytype ) {
- case StringKey:
- look_string( it.getKeyString(), it.get(), op_insert );
- break;
- case AsciiKey:
- look_ascii( it.getKeyAscii(), it.get(), op_insert );
- break;
- case IntKey:
- look_int( it.getKeyInt(), it.get(), op_insert );
- break;
- case PtrKey:
- look_ptr( it.getKeyPtr(), it.get(), op_insert );
- break;
- }
- ++it;
- }
-}
-
-
-/*!
- \internal
- Removes all items from the dictionary and destroys it.
-*/
-
-QGDict::~QGDict()
-{
- clear(); // delete everything
- delete [] vec;
- if ( !iterators ) // no iterators for this dict
- return;
- QGDictIterator *i = iterators->first();
- while ( i ) { // notify all iterators that
- i->dict = 0; // this dict is deleted
- i = iterators->next();
- }
- delete iterators;
-}
-
-
-/*!
- \internal
- Assigns \e dict to this dictionary.
-*/
-
-QGDict &QGDict::operator=( const QGDict &dict )
-{
- clear();
- QGDictIterator it( dict );
- while ( it.get() ) { // copy from other dict
- switch ( keytype ) {
- case StringKey:
- look_string( it.getKeyString(), it.get(), op_insert );
- break;
- case AsciiKey:
- look_ascii( it.getKeyAscii(), it.get(), op_insert );
- break;
- case IntKey:
- look_int( it.getKeyInt(), it.get(), op_insert );
- break;
- case PtrKey:
- look_ptr( it.getKeyPtr(), it.get(), op_insert );
- break;
- }
- ++it;
- }
- return *this;
-}
-
-
-/*! \fn QCollection::Item QGDictIterator::get() const
-
- \internal
-*/
-
-
-/*! \fn QCString QGDictIterator::getKeyString() const
-
- \internal
-*/
-
-
-/*! \fn const char * QGDictIterator::getKeyAscii() const
-
- \internal
-*/
-
-
-/*! \fn void * QGDictIterator::getKeyPtr() const
-
- \internal
-*/
-
-
-/*! \fn long QGDictIterator::getKeyInt() const
-
- \internal
-*/
-
-
-/*!
- \fn uint QGDict::count() const
- \internal
- Returns the number of items in the dictionary.
-*/
-
-/*!
- \fn uint QGDict::size() const
- \internal
- Returns the size of the hash array.
-*/
-
-
-/*!
- \internal
- The do-it-all function; op is one of op_find, op_insert, op_replace
-*/
-
-QCollection::Item QGDict::look_string( const QCString &key, QCollection::Item d, int op )
-{
- QCStringBucket *n;
- int index = hashKeyString(key) % vlen;
- if ( op == op_find ) { // find
- if ( cases ) {
- for ( n=(QCStringBucket*)vec[index]; n;
- n=(QCStringBucket*)n->getNext() ) {
- if ( key == n->getKey() )
- return n->getData(); // item found
- }
- } else {
- QCString k = key.lower();
- for ( n=(QCStringBucket*)vec[index]; n;
- n=(QCStringBucket*)n->getNext() ) {
- if ( k == n->getKey().lower() )
- return n->getData(); // item found
- }
- }
- return 0; // not found
- }
- if ( op == op_replace ) { // replace
- if ( vec[index] != 0 ) // maybe something there
- remove_string( key );
- }
- // op_insert or op_replace
- n = new QCStringBucket(key,newItem(d),vec[index]);
- CHECK_PTR( n );
-#if defined(CHECK_NULL)
- if ( n->getData() == 0 )
- qWarning( "QDict: Cannot insert null item" );
-#endif
- vec[index] = n;
- numItems++;
- return n->getData();
-}
-
-
-/*! \internal */
-
-QCollection::Item QGDict::look_ascii( const char *key, QCollection::Item d, int op )
-{
- QAsciiBucket *n;
- int index = hashKeyAscii(key) % vlen;
- if ( op == op_find ) { // find
- if ( cases ) {
- for ( n=(QAsciiBucket*)vec[index]; n;
- n=(QAsciiBucket*)n->getNext() ) {
- if ( qstrcmp(n->getKey(),key) == 0 )
- return n->getData(); // item found
- }
- } else {
- for ( n=(QAsciiBucket*)vec[index]; n;
- n=(QAsciiBucket*)n->getNext() ) {
- if ( qstricmp(n->getKey(),key) == 0 )
- return n->getData(); // item found
- }
- }
- return 0; // not found
- }
- if ( op == op_replace ) { // replace
- if ( vec[index] != 0 ) // maybe something there
- remove_ascii( key );
- }
- // op_insert or op_replace
- n = new QAsciiBucket(copyk ? qstrdup(key) : key,newItem(d),vec[index]);
- CHECK_PTR( n );
-#if defined(CHECK_NULL)
- if ( n->getData() == 0 )
- qWarning( "QAsciiDict: Cannot insert null item" );
-#endif
- vec[index] = n;
- numItems++;
- return n->getData();
-}
-
-
-/*! \internal */
-
-QCollection::Item QGDict::look_int( long key, QCollection::Item d, int op )
-{
- QIntBucket *n;
- int index = (int)((ulong)key % vlen); // simple hash
- if ( op == op_find ) { // find
- for ( n=(QIntBucket*)vec[index]; n;
- n=(QIntBucket*)n->getNext() ) {
- if ( n->getKey() == key )
- return n->getData(); // item found
- }
- return 0; // not found
- }
- if ( op == op_replace ) { // replace
- if ( vec[index] != 0 ) // maybe something there
- remove_int( key );
- }
- // op_insert or op_replace
- n = new QIntBucket(key,newItem(d),vec[index]);
- CHECK_PTR( n );
-#if defined(CHECK_NULL)
- if ( n->getData() == 0 )
- qWarning( "QIntDict: Cannot insert null item" );
-#endif
- vec[index] = n;
- numItems++;
- return n->getData();
-}
-
-
-/*! \internal */
-
-QCollection::Item QGDict::look_ptr( void *key, QCollection::Item d, int op )
-{
- QPtrBucket *n;
- int index = (int)((uintptr_t)key % vlen); // simple hash
- if ( op == op_find ) { // find
- for ( n=(QPtrBucket*)vec[index]; n;
- n=(QPtrBucket*)n->getNext() ) {
- if ( n->getKey() == key )
- return n->getData(); // item found
- }
- return 0; // not found
- }
- if ( op == op_replace ) { // replace
- if ( vec[index] != 0 ) // maybe something there
- remove_ptr( key );
- }
- // op_insert or op_replace
- n = new QPtrBucket(key,newItem(d),vec[index]);
- CHECK_PTR( n );
-#if defined(CHECK_NULL)
- if ( n->getData() == 0 )
- qWarning( "QPtrDict: Cannot insert null item" );
-#endif
- vec[index] = n;
- numItems++;
- return n->getData();
-}
-
-
-/*!
- \internal
- Changes the size of the hashtable.
- The contents of the dictionary are preserved,
- but all iterators on the dictionary become invalid.
-*/
-void QGDict::resize( uint newsize )
-{
- // Save old information
- QBaseBucket **old_vec = vec;
- uint old_vlen = vlen;
- bool old_copyk = copyk;
-
- vec = new QBaseBucket *[vlen = newsize];
- CHECK_PTR( vec );
- memset( (char*)vec, 0, vlen*sizeof(QBaseBucket*) );
- numItems = 0;
- copyk = FALSE;
-
- // Reinsert every item from vec, deleting vec as we go
- for ( uint index = 0; index < old_vlen; index++ ) {
- switch ( keytype ) {
- case StringKey:
- {
- QCStringBucket *n=(QCStringBucket *)old_vec[index];
- while ( n ) {
- look_string( n->getKey(), n->getData(), op_insert );
- QCStringBucket *t=(QCStringBucket *)n->getNext();
- delete n;
- n = t;
- }
- }
- break;
- case AsciiKey:
- {
- QAsciiBucket *n=(QAsciiBucket *)old_vec[index];
- while ( n ) {
- look_ascii( n->getKey(), n->getData(), op_insert );
- QAsciiBucket *t=(QAsciiBucket *)n->getNext();
- delete n;
- n = t;
- }
- }
- break;
- case IntKey:
- {
- QIntBucket *n=(QIntBucket *)old_vec[index];
- while ( n ) {
- look_int( n->getKey(), n->getData(), op_insert );
- QIntBucket *t=(QIntBucket *)n->getNext();
- delete n;
- n = t;
- }
- }
- break;
- case PtrKey:
- {
- QPtrBucket *n=(QPtrBucket *)old_vec[index];
- while ( n ) {
- look_ptr( n->getKey(), n->getData(), op_insert );
- QPtrBucket *t=(QPtrBucket *)n->getNext();
- delete n;
- n = t;
- }
- }
- break;
- }
- }
- delete [] old_vec;
-
- // Restore state
- copyk = old_copyk;
-
- // Invalidate all iterators, since order is lost
- if ( iterators && iterators->count() ) {
- QGDictIterator *i = iterators->first();
- while ( i ) {
- i->toFirst();
- i = iterators->next();
- }
- }
-}
-
-/*!
- \internal
- Unlinks the bucket with the specified key (and specified data pointer,
- if it is set).
-*/
-
-void QGDict::unlink_common( int index, QBaseBucket *node, QBaseBucket *prev )
-{
- if ( iterators && iterators->count() ) { // update iterators
- QGDictIterator *i = iterators->first();
- while ( i ) { // invalidate all iterators
- if ( i->curNode == node ) // referring to pending node
- i->operator++();
- i = iterators->next();
- }
- }
- if ( prev ) // unlink node
- prev->setNext( node->getNext() );
- else
- vec[index] = node->getNext();
- numItems--;
-}
-
-QCStringBucket *QGDict::unlink_string( const QCString &key, QCollection::Item d )
-{
- if ( numItems == 0 ) // nothing in dictionary
- return 0;
- QCStringBucket *n;
- QCStringBucket *prev = 0;
- int index = hashKeyString(key) % vlen;
- if ( cases ) {
- for ( n=(QCStringBucket*)vec[index]; n;
- n=(QCStringBucket*)n->getNext() ) {
- bool found = (key == n->getKey());
- if ( found && d )
- found = (n->getData() == d);
- if ( found ) {
- unlink_common(index,n,prev);
- return n;
- }
- prev = n;
- }
- } else {
- QCString k = key.lower();
- for ( n=(QCStringBucket*)vec[index]; n;
- n=(QCStringBucket*)n->getNext() ) {
- bool found = (k == n->getKey().lower());
- if ( found && d )
- found = (n->getData() == d);
- if ( found ) {
- unlink_common(index,n,prev);
- return n;
- }
- prev = n;
- }
- }
- return 0;
-}
-
-QAsciiBucket *QGDict::unlink_ascii( const char *key, QCollection::Item d )
-{
- if ( numItems == 0 ) // nothing in dictionary
- return 0;
- QAsciiBucket *n;
- QAsciiBucket *prev = 0;
- int index = hashKeyAscii(key) % vlen;
- for ( n=(QAsciiBucket *)vec[index]; n; n=(QAsciiBucket *)n->getNext() ) {
- bool found = (cases ? qstrcmp(n->getKey(),key)
- : qstricmp(n->getKey(),key)) == 0;
- if ( found && d )
- found = (n->getData() == d);
- if ( found ) {
- unlink_common(index,n,prev);
- return n;
- }
- prev = n;
- }
- return 0;
-}
-
-QIntBucket *QGDict::unlink_int( long key, QCollection::Item d )
-{
- if ( numItems == 0 ) // nothing in dictionary
- return 0;
- QIntBucket *n;
- QIntBucket *prev = 0;
- int index = (int)((ulong)key % vlen);
- for ( n=(QIntBucket *)vec[index]; n; n=(QIntBucket *)n->getNext() ) {
- bool found = (n->getKey() == key);
- if ( found && d )
- found = (n->getData() == d);
- if ( found ) {
- unlink_common(index,n,prev);
- return n;
- }
- prev = n;
- }
- return 0;
-}
-
-QPtrBucket *QGDict::unlink_ptr( void *key, QCollection::Item d )
-{
- if ( numItems == 0 ) // nothing in dictionary
- return 0;
- QPtrBucket *n;
- QPtrBucket *prev = 0;
- int index = (int)((uintptr_t)key % vlen);
- for ( n=(QPtrBucket *)vec[index]; n; n=(QPtrBucket *)n->getNext() ) {
- bool found = (n->getKey() == key);
- if ( found && d )
- found = (n->getData() == d);
- if ( found ) {
- unlink_common(index,n,prev);
- return n;
- }
- prev = n;
- }
- return 0;
-}
-
-
-/*!
- \internal
- Removes the item with the specified key. If item is non-null,
- the remove will match the \a item as well (used to remove an
- item when several items have the same key).
-*/
-
-bool QGDict::remove_string( const QCString &key, QCollection::Item item )
-{
- QCStringBucket *n = unlink_string( key, item );
- if ( n ) {
- deleteItem( n->getData() );
- delete n;
- return TRUE;
- } else {
- return FALSE;
- }
-}
-
-
-/*! \internal */
-
-bool QGDict::remove_ascii( const char *key, QCollection::Item item )
-{
- QAsciiBucket *n = unlink_ascii( key, item );
- if ( n ) {
- if ( copyk )
- delete [] (char *)n->getKey();
- deleteItem( n->getData() );
- delete n;
- }
- return n != 0;
-}
-
-
-/*! \internal */
-
-bool QGDict::remove_int( long key, QCollection::Item item )
-{
- QIntBucket *n = unlink_int( key, item );
- if ( n ) {
- deleteItem( n->getData() );
- delete n;
- }
- return n != 0;
-}
-
-
-/*! \internal */
-
-bool QGDict::remove_ptr( void *key, QCollection::Item item )
-{
- QPtrBucket *n = unlink_ptr( key, item );
- if ( n ) {
- deleteItem( n->getData() );
- delete n;
- }
- return n != 0;
-}
-
-
-/*! \internal */
-
-QCollection::Item QGDict::take_string( const QCString &key )
-{
- QCStringBucket *n = unlink_string( key );
- Item d;
- if ( n ) {
- d = n->getData();
- delete n;
- } else {
- d = 0;
- }
- return d;
-}
-
-
-/*! \internal */
-
-QCollection::Item QGDict::take_ascii( const char *key )
-{
- QAsciiBucket *n = unlink_ascii( key );
- Item d;
- if ( n ) {
- if ( copyk )
- delete [] (char *)n->getKey();
- d = n->getData();
- delete n;
- } else {
- d = 0;
- }
- return d;
-}
-
-
-/*! \internal */
-
-QCollection::Item QGDict::take_int( long key )
-{
- QIntBucket *n = unlink_int( key );
- Item d;
- if ( n ) {
- d = n->getData();
- delete n;
- } else {
- d = 0;
- }
- return d;
-}
-
-
-/*! \internal */
-
-QCollection::Item QGDict::take_ptr( void *key )
-{
- QPtrBucket *n = unlink_ptr( key );
- Item d;
- if ( n ) {
- d = n->getData();
- delete n;
- } else {
- d = 0;
- }
- return d;
-}
-
-
-/*!
- \internal
- Removes all items from the dictionary.
-*/
-
-void QGDict::clear()
-{
- if ( !numItems )
- return;
- numItems = 0; // disable remove() function
- for ( uint j=0; j<vlen; j++ ) { // destroy hash table
- if ( vec[j] ) {
- switch ( keytype ) {
- case StringKey:
- {
- QCStringBucket *n=(QCStringBucket *)vec[j];
- while ( n ) {
- QCStringBucket *next = (QCStringBucket*)n->getNext();
- deleteItem( n->getData() );
- delete n;
- n = next;
- }
- }
- break;
- case AsciiKey:
- {
- QAsciiBucket *n=(QAsciiBucket *)vec[j];
- while ( n ) {
- QAsciiBucket *next = (QAsciiBucket*)n->getNext();
- if ( copyk )
- delete [] (char *)n->getKey();
- deleteItem( n->getData() );
- delete n;
- n = next;
- }
- }
- break;
- case IntKey:
- {
- QIntBucket *n=(QIntBucket *)vec[j];
- while ( n ) {
- QIntBucket *next = (QIntBucket*)n->getNext();
- deleteItem( n->getData() );
- delete n;
- n = next;
- }
- }
- break;
- case PtrKey:
- {
- QPtrBucket *n=(QPtrBucket *)vec[j];
- while ( n ) {
- QPtrBucket *next = (QPtrBucket*)n->getNext();
- deleteItem( n->getData() );
- delete n;
- n = next;
- }
- }
- break;
- }
- vec[j] = 0; // detach list of buckets
- }
- }
- if ( iterators && iterators->count() ) { // invalidate all iterators
- QGDictIterator *i = iterators->first();
- while ( i ) {
- i->curNode = 0;
- i = iterators->next();
- }
- }
-}
-
-
-/*!
- \internal
- Outputs debug statistics.
-*/
-
-void QGDict::statistics() const
-{
-#if defined(DEBUG)
- QCString line;
- line.fill( '-', 60 );
- double real, ideal;
- qDebug( "%s",line.data() );
- qDebug( "DICTIONARY STATISTICS:" );
- if ( count() == 0 ) {
- qDebug( "Empty!" );
- qDebug( "%s", line.data() );
- return;
- }
- real = 0.0;
- ideal = (float)count()/(2.0*size())*(count()+2.0*size()-1);
- uint i = 0;
- while ( i<size() ) {
- QBaseBucket *n = vec[i];
- int b = 0;
- while ( n ) { // count number of buckets
- b++;
- n = n->getNext();
- }
- real = real + (double)b * ((double)b+1.0)/2.0;
- char buf[80], *pbuf;
- if ( b > 78 )
- b = 78;
- pbuf = buf;
- while ( b-- )
- *pbuf++ = '*';
- *pbuf = '\0';
- qDebug( "%s", buf );
- i++;
- }
- qDebug( "Array size = %d", size() );
- qDebug( "# items = %d", count() );
- qDebug( "Real dist = %g", real );
- qDebug( "Rand dist = %g", ideal );
- qDebug( "Real/Rand = %g", real/ideal );
- qDebug( "%s",line.data() );
-#endif // DEBUG
-}
-
-
-/*****************************************************************************
- QGDict stream functions
- *****************************************************************************/
-#ifndef QT_NO_DATASTREAM
-QDataStream &operator>>( QDataStream &s, QGDict &dict )
-{
- return dict.read( s );
-}
-
-QDataStream &operator<<( QDataStream &s, const QGDict &dict )
-{
- return dict.write( s );
-}
-
-#if defined(_CC_DEC_) && defined(__alpha) && (__DECCXX_VER >= 50190001)
-#pragma message disable narrowptr
-#endif
-
-/*!
- \internal
- Reads a dictionary from the stream \e s.
-*/
-
-QDataStream &QGDict::read( QDataStream &s )
-{
- uint num;
- s >> num; // read number of items
- clear(); // clear dict
- while ( num-- ) { // read all items
- Item d;
- switch ( keytype ) {
- case StringKey:
- {
- QCString k;
- s >> k;
- read( s, d );
- look_string( k, d, op_insert );
- }
- break;
- case AsciiKey:
- {
- char *k;
- s >> k;
- read( s, d );
- look_ascii( k, d, op_insert );
- if ( copyk )
- delete [] k;
- }
- break;
- case IntKey:
- {
- Q_UINT32 k;
- s >> k;
- read( s, d );
- look_int( k, d, op_insert );
- }
- break;
- case PtrKey:
- {
- Q_UINT32 k;
- s >> k;
- read( s, d );
- // ### cannot insert 0 - this renders the thing
- // useless since all pointers are written as 0,
- // but hey, serializing pointers? can it be done
- // at all, ever?
- if ( k )
- look_ptr( (void *)(uintptr_t)k, d, op_insert );
- }
- break;
- }
- }
- return s;
-}
-
-/*!
- \internal
- Writes the dictionary to the stream \e s.
-*/
-
-QDataStream& QGDict::write( QDataStream &s ) const
-{
- s << count(); // write number of items
- uint i = 0;
- while ( i<size() ) {
- QBaseBucket *n = vec[i];
- while ( n ) { // write all buckets
- switch ( keytype ) {
- case StringKey:
- s << ((QCStringBucket*)n)->getKey();
- break;
- case AsciiKey:
- s << ((QAsciiBucket*)n)->getKey();
- break;
- case IntKey:
- s << (Q_UINT32)((QIntBucket*)n)->getKey();
- break;
- case PtrKey:
- s << (Q_UINT32)0; // ### cannot serialize a pointer
- break;
- }
- write( s, n->getData() ); // write data
- n = n->getNext();
- }
- i++;
- }
- return s;
-}
-#endif //QT_NO_DATASTREAM
-
-/*****************************************************************************
- QGDictIterator member functions
- *****************************************************************************/
-
-/*!
- \class QGDictIterator qgdict.h
- \brief An internal class for implementing QDictIterator and QIntDictIterator.
-
- QGDictIterator is a strictly internal class that does the heavy work for
- QDictIterator and QIntDictIterator.
-*/
-
-/*!
- \internal
- Constructs an iterator that operates on the dictionary \e d.
-*/
-
-QGDictIterator::QGDictIterator( const QGDict &d )
-{
- dict = (QGDict *)&d; // get reference to dict
- toFirst(); // set to first node
- if ( !dict->iterators ) {
- dict->iterators = new QGDItList; // create iterator list
- CHECK_PTR( dict->iterators );
- }
- dict->iterators->append( this ); // attach iterator to dict
-}
-
-/*!
- \internal
- Constructs a copy of the iterator \e it.
-*/
-
-QGDictIterator::QGDictIterator( const QGDictIterator &it )
-{
- dict = it.dict;
- curNode = it.curNode;
- curIndex = it.curIndex;
- if ( dict )
- dict->iterators->append( this ); // attach iterator to dict
-}
-
-/*!
- \internal
- Assigns a copy of the iterator \e it and returns a reference to this
- iterator.
-*/
-
-QGDictIterator &QGDictIterator::operator=( const QGDictIterator &it )
-{
- if ( dict ) // detach from old dict
- dict->iterators->removeRef( this );
- dict = it.dict;
- curNode = it.curNode;
- curIndex = it.curIndex;
- if ( dict )
- dict->iterators->append( this ); // attach to new list
- return *this;
-}
-
-/*!
- \internal
- Destroys the iterator.
-*/
-
-QGDictIterator::~QGDictIterator()
-{
- if ( dict ) // detach iterator from dict
- dict->iterators->removeRef( this );
-}
-
-
-/*!
- \internal
- Sets the iterator to point to the first item in the dictionary.
-*/
-
-QCollection::Item QGDictIterator::toFirst()
-{
- if ( !dict ) {
-#if defined(CHECK_NULL)
- qWarning( "QGDictIterator::toFirst: Dictionary has been deleted" );
-#endif
- return 0;
- }
- if ( dict->count() == 0 ) { // empty dictionary
- curNode = 0;
- return 0;
- }
- uint i = 0;
- QBaseBucket **v = dict->vec;
- while ( !(*v++) )
- i++;
- curNode = dict->vec[i];
- curIndex = i;
- return curNode->getData();
-}
-
-
-/*!
- \internal
- Moves to the next item (postfix).
-*/
-
-QCollection::Item QGDictIterator::operator()()
-{
- if ( !dict ) {
-#if defined(CHECK_NULL)
- qWarning( "QGDictIterator::operator(): Dictionary has been deleted" );
-#endif
- return 0;
- }
- if ( !curNode )
- return 0;
- QCollection::Item d = curNode->getData();
- this->operator++();
- return d;
-}
-
-/*!
- \internal
- Moves to the next item (prefix).
-*/
-
-QCollection::Item QGDictIterator::operator++()
-{
- if ( !dict ) {
-#if defined(CHECK_NULL)
- qWarning( "QGDictIterator::operator++: Dictionary has been deleted" );
-#endif
- return 0;
- }
- if ( !curNode )
- return 0;
- curNode = curNode->getNext();
- if ( !curNode ) { // no next bucket
- uint i = curIndex + 1; // look from next vec element
- QBaseBucket **v = &dict->vec[i];
- while ( i < dict->size() && !(*v++) )
- i++;
- if ( i == dict->size() ) { // nothing found
- curNode = 0;
- return 0;
- }
- curNode = dict->vec[i];
- curIndex = i;
- }
- return curNode->getData();
-}
-
-/*!
- \internal
- Moves \e jumps positions forward.
-*/
-
-QCollection::Item QGDictIterator::operator+=( uint jumps )
-{
- while ( curNode && jumps-- )
- operator++();
- return curNode ? curNode->getData() : 0;
-}
diff --git a/qtools/qgdict.h b/qtools/qgdict.h
deleted file mode 100644
index cf023fd..0000000
--- a/qtools/qgdict.h
+++ /dev/null
@@ -1,222 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QGDict and QGDictIterator classes
-**
-** Created : 920529
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QGDICT_H
-#define QGDICT_H
-
-#ifndef QT_H
-#include "qcollection.h"
-#include "qcstring.h"
-#endif // QT_H
-
-class QGDictIterator;
-class QGDItList;
-
-
-class QBaseBucket // internal dict node
-{
-public:
- QCollection::Item getData() { return data; }
- QCollection::Item setData( QCollection::Item d ) { return data = d; }
- QBaseBucket *getNext() { return next; }
- void setNext( QBaseBucket *n) { next = n; }
-protected:
- QBaseBucket( QCollection::Item d, QBaseBucket *n ) : data(d), next(n) {}
- QCollection::Item data;
- QBaseBucket *next;
-};
-
-class QCStringBucket : public QBaseBucket
-{
-public:
- QCStringBucket( const QCString &k, QCollection::Item d, QBaseBucket *n )
- : QBaseBucket(d,n), key(k) {}
- const QCString &getKey() const { return key; }
-private:
- QCString key;
-};
-
-class QAsciiBucket : public QBaseBucket
-{
-public:
- QAsciiBucket( const char *k, QCollection::Item d, QBaseBucket *n )
- : QBaseBucket(d,n), key(k) {}
- const char *getKey() const { return key; }
-private:
- const char *key;
-};
-
-class QIntBucket : public QBaseBucket
-{
-public:
- QIntBucket( intptr_t k, QCollection::Item d, QBaseBucket *n )
- : QBaseBucket(d,n), key(k) {}
- intptr_t getKey() const { return key; }
-private:
- intptr_t key;
-};
-
-class QPtrBucket : public QBaseBucket
-{
-public:
- QPtrBucket( void *k, QCollection::Item d, QBaseBucket *n )
- : QBaseBucket(d,n), key(k) {}
- void *getKey() const { return key; }
-private:
- void *key;
-};
-
-
-class Q_EXPORT QGDict : public QCollection // generic dictionary class
-{
-public:
- uint count() const { return numItems; }
- uint size() const { return vlen; }
- QCollection::Item look_string( const QCString& key, QCollection::Item,
- int );
- QCollection::Item look_ascii( const char *key, QCollection::Item, int );
- QCollection::Item look_int( long key, QCollection::Item, int );
- QCollection::Item look_ptr( void *key, QCollection::Item, int );
-#ifndef QT_NO_DATASTREAM
- QDataStream &read( QDataStream & );
- QDataStream &write( QDataStream & ) const;
-#endif
-protected:
- enum KeyType { StringKey, AsciiKey, IntKey, PtrKey };
-
- QGDict( uint len, KeyType kt, bool cs, bool ck );
- QGDict( const QGDict & );
- ~QGDict();
-
- QGDict &operator=( const QGDict & );
-
- bool remove_string( const QCString &key, QCollection::Item item=0 );
- bool remove_ascii( const char *key, QCollection::Item item=0 );
- bool remove_int( long key, QCollection::Item item=0 );
- bool remove_ptr( void *key, QCollection::Item item=0 );
- QCollection::Item take_string( const QCString &key );
- QCollection::Item take_ascii( const char *key );
- QCollection::Item take_int( long key );
- QCollection::Item take_ptr( void *key );
-
- void clear();
- void resize( uint );
-
- int hashKeyString( const QCString & );
- int hashKeyAscii( const char * );
-
- void statistics() const;
-
-#ifndef QT_NO_DATASTREAM
- virtual QDataStream &read( QDataStream &, QCollection::Item & );
- virtual QDataStream &write( QDataStream &, QCollection::Item ) const;
-#endif
-private:
- QBaseBucket **vec;
- uint vlen;
- uint numItems;
- uint keytype : 2;
- uint cases : 1;
- uint copyk : 1;
- QGDItList *iterators;
- void unlink_common( int, QBaseBucket *, QBaseBucket * );
- QCStringBucket *unlink_string( const QCString &,
- QCollection::Item item = 0 );
- QAsciiBucket *unlink_ascii( const char *, QCollection::Item item = 0 );
- QIntBucket *unlink_int( long, QCollection::Item item = 0 );
- QPtrBucket *unlink_ptr( void *, QCollection::Item item = 0 );
- void init( uint, KeyType, bool, bool );
- friend class QGDictIterator;
-};
-
-
-class Q_EXPORT QGDictIterator // generic dictionary iterator
-{
-friend class QGDict;
-public:
- QGDictIterator( const QGDict & );
- QGDictIterator( const QGDictIterator & );
- QGDictIterator &operator=( const QGDictIterator & );
- ~QGDictIterator();
-
- QCollection::Item toFirst();
-
- QCollection::Item get() const;
- QCString getKeyString() const;
- const char *getKeyAscii() const;
- intptr_t getKeyInt() const;
- void *getKeyPtr() const;
-
- QCollection::Item operator()();
- QCollection::Item operator++();
- QCollection::Item operator+=(uint);
-
-protected:
- QGDict *dict;
-
-private:
- QBaseBucket *curNode;
- uint curIndex;
-};
-
-inline QCollection::Item QGDictIterator::get() const
-{
- return curNode ? curNode->getData() : 0;
-}
-
-inline QCString QGDictIterator::getKeyString() const
-{
- return curNode ? ((QCStringBucket*)curNode)->getKey() : QCString();
-}
-
-inline const char *QGDictIterator::getKeyAscii() const
-{
- return curNode ? ((QAsciiBucket*)curNode)->getKey() : 0;
-}
-
-inline intptr_t QGDictIterator::getKeyInt() const
-{
- return curNode ? ((QIntBucket*)curNode)->getKey() : 0;
-}
-
-inline void *QGDictIterator::getKeyPtr() const
-{
- return curNode ? ((QPtrBucket*)curNode)->getKey() : 0;
-}
-
-
-#endif // QGDICT_H
diff --git a/qtools/qgeneric.h b/qtools/qgeneric.h
deleted file mode 100644
index c2892a0..0000000
--- a/qtools/qgeneric.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/****************************************************************************
-**
-**
-** Macros for pasting tokens; utilized by our generic classes
-**
-** Created : 920529
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QGENERIC_H
-#define QGENERIC_H
-
-#error "do not include qgeneric.h any more"
-
-#endif // QGENERIC_H
diff --git a/qtools/qglist.cpp b/qtools/qglist.cpp
deleted file mode 100644
index 878aa04..0000000
--- a/qtools/qglist.cpp
+++ /dev/null
@@ -1,1203 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QGList and QGListIterator classes
-**
-** Created : 920624
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qglist.h"
-#include "qdatastream.h"
-
-
-// NOT REVISED
-/*!
- \class QLNode qglist.h
- \brief The QLNode class is an internal class for the QList template collection.
-
- QLNode is a doubly linked list node; it has three pointers:
- <ol>
- <li> Pointer to the previous node.
- <li> Pointer to the next node.
- <li> Pointer to the actual data.
- </ol>
-
- Sometimes it might be practical to have direct access to the list nodes
- in a QList, but it is seldom required.
-
- \warning Be very careful if you want to access the list nodes. The heap
- can easily get corrupted if you make a mistake.
-
- \sa QList::currentNode(), QList::removeNode(), QList::takeNode()
-*/
-
-/*!
- \fn QCollection::Item QLNode::getData()
- Returns a pointer (\c void*) to the actual data in the list node.
-*/
-
-
-/*!
- \class QGList qglist.h
- \brief The QGList class is an internal class for implementing Qt collection classes.
-
- QGList is a strictly internal class that acts as a base class for several
- \link collection.html collection classes\endlink; QList, QQueue and
- QStack.
-
- QGList has some virtual functions that can be reimplemented to customize
- the subclasses.
- <ul>
- <li> compareItems() compares two collection/list items.
- <li> read() reads a collection/list item from a QDataStream.
- <li> write() writes a collection/list item to a QDataStream.
- </ul>
- Normally, you do not have to reimplement any of these functions.
- If you still want to reimplement them, see the QStrList class (qstrlist.h),
- which is a good example.
-*/
-
-
-/*****************************************************************************
- Default implementation of virtual functions
- *****************************************************************************/
-
-/*!
- This virtual function compares two list items.
-
- Returns:
- <ul>
- <li> 0 if \e item1 == \e item2
- <li> non-zero if \e item1 != \e item2
- </ul>
-
- This function returns \e int rather than \e bool so that
- reimplementations can return three values and use it to sort by:
-
- <ul>
- <li> 0 if \e item1 == \e item2
- <li> \> 0 (positive integer) if \e item1 \> \e item2
- <li> \< 0 (negative integer) if \e item1 \< \e item2
- </ul>
-
- The QList::inSort() function requires that compareItems() is implemented
- as described here.
-
- This function should not modify the list because some const functions
- call compareItems().
-
- The default implementation compares the pointers:
- \code
-
- \endcode
-*/
-
-int QGList::compareItems( QCollection::Item item1, QCollection::Item item2 )
-{
- return item1 != item2; // compare pointers
-}
-
-#ifndef QT_NO_DATASTREAM
-/*!
- Reads a collection/list item from the stream \a s and returns a reference
- to the stream.
-
- The default implementation sets \a item to 0.
-
- \sa write()
-*/
-
-QDataStream &QGList::read( QDataStream &s, QCollection::Item &item )
-{
- item = 0;
- return s;
-}
-
-/*!
- Writes a collection/list item to the stream \a s and returns a reference
- to the stream.
-
- The default implementation does nothing.
-
- \sa read()
-*/
-
-QDataStream &QGList::write( QDataStream &s, QCollection::Item ) const
-{
- return s;
-}
-#endif // QT_NO_DATASTREAM
-
-/*****************************************************************************
- QGList member functions
- *****************************************************************************/
-
-/*!
- \internal
- Constructs an empty list.
-*/
-
-QGList::QGList()
-{
- firstNode = lastNode = curNode = 0; // initialize list
- numNodes = 0;
- curIndex = -1;
- iterators = 0; // initialize iterator list
-}
-
-/*!
- \internal
- Constructs a copy of \e list.
-*/
-
-QGList::QGList( const QGList & list )
- : QCollection( list )
-{
- firstNode = lastNode = curNode = 0; // initialize list
- numNodes = 0;
- curIndex = -1;
- iterators = 0; // initialize iterator list
- QLNode *n = list.firstNode;
- while ( n ) { // copy all items from list
- append( n->data );
- n = n->next;
- }
-}
-
-/*!
- \internal
- Removes all items from the list and destroys the list.
-*/
-
-QGList::~QGList()
-{
- clear();
- if ( !iterators ) // no iterators for this list
- return;
- QGListIterator *i = (QGListIterator*)iterators->first();
- while ( i ) { // notify all iterators that
- i->list = 0; // this list is deleted
- i->curNode = 0;
- i = (QGListIterator*)iterators->next();
- }
- delete iterators;
-}
-
-
-/*!
- \internal
- Assigns \e list to this list.
-*/
-
-QGList& QGList::operator=( const QGList &list )
-{
- clear();
- if ( list.count() > 0 ) {
- QLNode *n = list.firstNode;
- while ( n ) { // copy all items from list
- append( n->data );
- n = n->next;
- }
- curNode = firstNode;
- curIndex = 0;
- }
- return *this;
-}
-
-/*!
- Compares this list with \a list. Returns TRUE if the lists
- contain the same data, else FALSE.
-*/
-
-bool QGList::operator==( const QGList &list ) const
-{
- if ( count() != list.count() )
- return FALSE;
-
- if ( count() == 0 )
- return TRUE;
-
- QLNode *n1 = firstNode;
- QLNode *n2 = list.firstNode;
- while ( n1 && n2 ) {
- // should be mutable
- if ( ( (QGList*)this )->compareItems( n1->data, n2->data ) != 0 )
- return FALSE;
- n1 = n1->next;
- n2 = n2->next;
- }
-
- return TRUE;
-}
-
-/*!
- \fn uint QGList::count() const
- \internal
- Returns the number of items in the list.
-*/
-
-
-/*!
- \internal
- Returns the node at position \e index. Sets this node to current.
-*/
-
-QLNode *QGList::locate( uint index )
-{
- if ( index == (uint)curIndex ) // current node ?
- return curNode;
- if ( !curNode && firstNode ) { // set current node
- curNode = firstNode;
- curIndex = 0;
- }
- QLNode *node;
- int distance = index - curIndex; // node distance to cur node
- bool forward; // direction to traverse
-
- if ( index >= numNodes ) {
-#if defined(CHECK_RANGE)
- qWarning( "QGList::locate: Index %d out of range", index );
-#endif
- return 0;
- }
-
- if ( distance < 0 )
- distance = -distance;
- if ( (uint)distance < index && (uint)distance < numNodes - index ) {
- node = curNode; // start from current node
- forward = index > (uint)curIndex;
- } else if ( index < numNodes - index ) { // start from first node
- node = firstNode;
- distance = index;
- forward = TRUE;
- } else { // start from last node
- node = lastNode;
- distance = numNodes - index - 1;
- if ( distance < 0 )
- distance = 0;
- forward = FALSE;
- }
- if ( forward ) { // now run through nodes
- while ( distance-- )
- node = node->next;
- } else {
- while ( distance-- )
- node = node->prev;
- }
- curIndex = index; // must update index
- return curNode = node;
-}
-
-
-/*!
- \internal
- Inserts an item at its sorted position in the list.
-*/
-
-void QGList::inSort( QCollection::Item d )
-{
- int index = 0;
- QLNode *n = firstNode;
- while ( n && compareItems(n->data,d) < 0 ){ // find position in list
- n = n->next;
- index++;
- }
- insertAt( index, d );
-}
-
-
-/*!
- \internal
- Inserts an item at the start of the list.
-*/
-
-void QGList::prepend( QCollection::Item d )
-{
- QLNode *n = new QLNode( newItem(d) );
- CHECK_PTR( n );
- n->prev = 0;
- if ( (n->next = firstNode) ) // list is not empty
- firstNode->prev = n;
- else // initialize list
- lastNode = n;
- firstNode = curNode = n; // curNode affected
- numNodes++;
- curIndex = 0;
-}
-
-
-/*!
- \internal
- Inserts an item at the end of the list.
-*/
-
-void QGList::append( QCollection::Item d )
-{
- QLNode *n = new QLNode( newItem(d) );
- CHECK_PTR( n );
- n->next = 0;
- if ( (n->prev = lastNode) ) // list is not empty
- lastNode->next = n;
- else // initialize list
- firstNode = n;
- lastNode = curNode = n; // curNode affected
- curIndex = numNodes;
- numNodes++;
-}
-
-
-/*!
- \internal
- Inserts an item at position \e index in the list.
-*/
-
-bool QGList::insertAt( uint index, QCollection::Item d )
-{
- if ( index == 0 ) { // insert at head of list
- prepend( d );
- return TRUE;
- } else if ( index == numNodes ) { // append at tail of list
- append( d );
- return TRUE;
- }
- QLNode *nextNode = locate( index );
- if ( !nextNode ) // illegal position
- return FALSE;
- QLNode *prevNode = nextNode->prev;
- QLNode *n = new QLNode( newItem(d) );
- CHECK_PTR( n );
- nextNode->prev = n;
- prevNode->next = n;
- n->prev = prevNode; // link new node into list
- n->next = nextNode;
- curNode = n; // curIndex set by locate()
- numNodes++;
- return TRUE;
-}
-
-
-/*!
- \internal
- Relinks node \e n and makes it the first node in the list.
-*/
-
-void QGList::relinkNode( QLNode *n )
-{
- if ( n == firstNode ) // already first
- return;
- curNode = n;
- unlink();
- n->prev = 0;
- if ( (n->next = firstNode) ) // list is not empty
- firstNode->prev = n;
- else // initialize list
- lastNode = n;
- firstNode = curNode = n; // curNode affected
- numNodes++;
- curIndex = 0;
-}
-
-
-/*!
- \internal
- Unlinks the current list node and returns a pointer to this node.
-*/
-
-QLNode *QGList::unlink()
-{
- if ( curNode == 0 ) // null current node
- return 0;
- QLNode *n = curNode; // unlink this node
- if ( n == firstNode ) { // removing first node ?
- if ( (firstNode = n->next) ) {
- firstNode->prev = 0;
- } else {
- lastNode = curNode = 0; // list becomes empty
- curIndex = -1;
- }
- } else {
- if ( n == lastNode ) { // removing last node ?
- lastNode = n->prev;
- lastNode->next = 0;
- } else { // neither last nor first node
- n->prev->next = n->next;
- n->next->prev = n->prev;
- }
- }
- if ( n->next ) { // change current node
- curNode = n->next;
- } else if ( n->prev ) {
- curNode = n->prev;
- curIndex--;
- }
- if ( iterators && iterators->count() ) { // update iterators
- QGListIterator *i = (QGListIterator*)iterators->first();
- while ( i ) { // fix all iterators that
- if ( i->curNode == n ) // refers to pending node
- i->curNode = curNode;
- i = (QGListIterator*)iterators->next();
- }
- }
- numNodes--;
- return n;
-}
-
-
-/*!
- \internal
- Removes the node \e n from the list.
-*/
-
-bool QGList::removeNode( QLNode *n )
-{
-#if defined(CHECK_NULL)
- if ( n == 0 || (n->prev && n->prev->next != n) ||
- (n->next && n->next->prev != n) ) {
- qWarning( "QGList::removeNode: Corrupted node" );
- return FALSE;
- }
-#endif
- curNode = n;
- unlink(); // unlink node
- deleteItem( n->data ); // deallocate this node
- delete n;
- curNode = firstNode;
- curIndex = curNode ? 0 : -1;
- return TRUE;
-}
-
-/*!
- \internal
- Removes the item \e d from the list. Uses compareItems() to find the item.
-*/
-
-bool QGList::remove( QCollection::Item d )
-{
- if ( d ) { // find the item
- if ( find(d) == -1 )
- return FALSE;
- }
- QLNode *n = unlink(); // unlink node
- if ( !n )
- return FALSE;
- deleteItem( n->data ); // deallocate this node
- delete n;
- return TRUE;
-}
-
-/*!
- \internal
- Removes the item \e d from the list.
-*/
-
-bool QGList::removeRef( QCollection::Item d )
-{
- if ( d ) { // find the item
- if ( findRef(d) == -1 )
- return FALSE;
- }
- QLNode *n = unlink(); // unlink node
- if ( !n )
- return FALSE;
- deleteItem( n->data ); // deallocate this node
- delete n;
- return TRUE;
-}
-
-/*!
- \fn bool QGList::removeFirst()
- \internal
- Removes the first item in the list.
-*/
-
-/*!
- \fn bool QGList::removeLast()
- \internal
- Removes the last item in the list.
-*/
-
-/*!
- \internal
- Removes the item at position \e index from the list.
-*/
-
-bool QGList::removeAt( uint index )
-{
- if ( !locate(index) )
- return FALSE;
- QLNode *n = unlink(); // unlink node
- if ( !n )
- return FALSE;
- deleteItem( n->data ); // deallocate this node
- delete n;
- return TRUE;
-}
-
-
-/*!
- \internal
- Takes the node \e n out of the list.
-*/
-
-QCollection::Item QGList::takeNode( QLNode *n )
-{
-#if defined(CHECK_NULL)
- if ( n == 0 || (n->prev && n->prev->next != n) ||
- (n->next && n->next->prev != n) ) {
- qWarning( "QGList::takeNode: Corrupted node" );
- return 0;
- }
-#endif
- curNode = n;
- unlink(); // unlink node
- Item d = n->data;
- delete n; // delete the node, not data
- curNode = firstNode;
- curIndex = curNode ? 0 : -1;
- return d;
-}
-
-/*!
- \internal
- Takes the current item out of the list.
-*/
-
-QCollection::Item QGList::take()
-{
- QLNode *n = unlink(); // unlink node
- Item d = n ? n->data : 0;
- delete n; // delete node, keep contents
- return d;
-}
-
-/*!
- \internal
- Takes the item at position \e index out of the list.
-*/
-
-QCollection::Item QGList::takeAt( uint index )
-{
- if ( !locate(index) )
- return 0;
- QLNode *n = unlink(); // unlink node
- Item d = n ? n->data : 0;
- delete n; // delete node, keep contents
- return d;
-}
-
-/*!
- \internal
- Takes the first item out of the list.
-*/
-
-QCollection::Item QGList::takeFirst()
-{
- first();
- QLNode *n = unlink(); // unlink node
- Item d = n ? n->data : 0;
- delete n;
- return d;
-}
-
-/*!
- \internal
- Takes the last item out of the list.
-*/
-
-QCollection::Item QGList::takeLast()
-{
- last();
- QLNode *n = unlink(); // unlink node
- Item d = n ? n->data : 0;
- delete n;
- return d;
-}
-
-
-/*!
- \internal
- Removes all items from the list.
-*/
-
-void QGList::clear()
-{
- QLNode *n = firstNode;
-
- firstNode = lastNode = curNode = 0; // initialize list
- numNodes = 0;
- curIndex = -1;
-
- if ( iterators && iterators->count() ) {
- QGListIterator *i = (QGListIterator*)iterators->first();
- while ( i ) { // notify all iterators that
- i->curNode = 0; // this list is empty
- i = (QGListIterator*)iterators->next();
- }
- }
-
- QLNode *prevNode;
- while ( n ) { // for all nodes ...
- deleteItem( n->data ); // deallocate data
- prevNode = n;
- n = n->next;
- delete prevNode; // deallocate node
- }
-}
-
-
-/*!
- \internal
- Finds an item in the list.
-*/
-
-int QGList::findRef( QCollection::Item d, bool fromStart )
-{
- QLNode *n;
- int index;
- if ( fromStart ) { // start from first node
- n = firstNode;
- index = 0;
- } else { // start from current node
- n = curNode;
- index = curIndex;
- }
- while ( n && n->data != d ) { // find exact match
- n = n->next;
- index++;
- }
- curNode = n;
- curIndex = n ? index : -1;
- return curIndex; // return position of item
-}
-
-/*!
- \internal
- Finds an item in the list. Uses compareItems().
-*/
-
-int QGList::find( QCollection::Item d, bool fromStart )
-{
- QLNode *n;
- int index;
- if ( fromStart ) { // start from first node
- n = firstNode;
- index = 0;
- } else { // start from current node
- n = curNode;
- index = curIndex;
- }
- while ( n && compareItems(n->data,d) ){ // find equal match
- n = n->next;
- index++;
- }
- curNode = n;
- curIndex = n ? index : -1;
- return curIndex; // return position of item
-}
-
-
-/*!
- \internal
- Counts the number an item occurs in the list.
-*/
-
-uint QGList::containsRef( QCollection::Item d ) const
-{
- QLNode *n = firstNode;
- uint count = 0;
- while ( n ) { // for all nodes...
- if ( n->data == d ) // count # exact matches
- count++;
- n = n->next;
- }
- return count;
-}
-
-/*!
- \internal
- Counts the number an item occurs in the list. Uses compareItems().
-*/
-
-uint QGList::contains( QCollection::Item d ) const
-{
- QLNode *n = firstNode;
- uint count = 0;
- QGList *that = (QGList*)this; // mutable for compareItems()
- while ( n ) { // for all nodes...
- if ( !that->compareItems(n->data,d) ) // count # equal matches
- count++;
- n = n->next;
- }
- return count;
-}
-
-
-/*!
- \fn QCollection::Item QGList::at( uint index )
- \internal
- Sets the item at position \e index to the current item.
-*/
-
-/*!
- \fn int QGList::at() const
- \internal
- Returns the current index.
-*/
-
-/*!
- \fn QLNode *QGList::currentNode() const
- \internal
- Returns the current node.
-*/
-
-/*!
- \fn QCollection::Item QGList::get() const
- \internal
- Returns the current item.
-*/
-
-/*!
- \fn QCollection::Item QGList::cfirst() const
- \internal
- Returns the first item in the list.
-*/
-
-/*!
- \fn QCollection::Item QGList::clast() const
- \internal
- Returns the last item in the list.
-*/
-
-
-/*!
- \internal
- Returns the first list item. Sets this to current.
-*/
-
-QCollection::Item QGList::first()
-{
- if ( firstNode ) {
- curIndex = 0;
- return (curNode=firstNode)->data;
- }
- return 0;
-}
-
-/*!
- \internal
- Returns the last list item. Sets this to current.
-*/
-
-QCollection::Item QGList::last()
-{
- if ( lastNode ) {
- curIndex = numNodes-1;
- return (curNode=lastNode)->data;
- }
- return 0;
-}
-
-/*!
- \internal
- Returns the next list item (after current). Sets this to current.
-*/
-
-QCollection::Item QGList::next()
-{
- if ( curNode ) {
- if ( curNode->next ) {
- curIndex++;
- curNode = curNode->next;
- return curNode->data;
- }
- curIndex = -1;
- curNode = 0;
- }
- return 0;
-}
-
-/*!
- \internal
- Returns the previous list item (before current). Sets this to current.
-*/
-
-QCollection::Item QGList::prev()
-{
- if ( curNode ) {
- if ( curNode->prev ) {
- curIndex--;
- curNode = curNode->prev;
- return curNode->data;
- }
- curIndex = -1;
- curNode = 0;
- }
- return 0;
-}
-
-
-void QGList::heapSortPushDown( QCollection::Item* heap, int first, int last )
-{
- int r = first;
- while( r <= last/2 ) {
- // Node r has only one child ?
- if ( last == 2*r ) {
- // Need for swapping ?
- if ( compareItems( heap[r], heap[ 2*r ] ) > 0 ) {
- QCollection::Item tmp = heap[r];
- heap[ r ] = heap[ 2*r ];
- heap[ 2*r ] = tmp;
- }
- // That's it ...
- r = last;
- } else {
- // Node has two children
- if ( compareItems( heap[r], heap[ 2*r ] ) > 0 &&
- compareItems( heap[ 2*r ], heap[ 2*r+1 ] ) <= 0 ) {
- // Swap with left child
- QCollection::Item tmp = heap[r];
- heap[ r ] = heap[ 2*r ];
- heap[ 2*r ] = tmp;
- r *= 2;
- } else if ( compareItems( heap[r], heap[ 2*r+1 ] ) > 0 &&
- compareItems( heap[ 2*r+1 ], heap[ 2*r ] ) < 0 ) {
- // Swap with right child
- QCollection::Item tmp = heap[r];
- heap[ r ] = heap[ 2*r+1 ];
- heap[ 2*r+1 ] = tmp;
- r = 2*r+1;
- } else {
- // We are done
- r = last;
- }
- }
- }
-}
-
-
-/*! Sorts the list by the result of the virtual compareItems() function.
-
- The Heap-Sort algorithm is used for sorting. It sorts n items with
- O(n*log n) compares. This is the asymptotic optimal solution of the
- sorting problem.
-*/
-
-void QGList::sort()
-{
- uint n = count();
- if ( n < 2 )
- return;
-
- // Create the heap
- QCollection::Item* realheap = new QCollection::Item[ n ];
- // Wow, what a fake. But I want the heap to be indexed as 1...n
- QCollection::Item* heap = realheap - 1;
- int size = 0;
- QLNode* insert = firstNode;
- for( ; insert != 0; insert = insert->next ) {
- heap[++size] = insert->data;
- int i = size;
- while( i > 1 && compareItems( heap[i], heap[ i / 2 ] ) < 0 ) {
- QCollection::Item tmp = heap[ i ];
- heap[ i ] = heap[ i/2 ];
- heap[ i/2 ] = tmp;
- i /= 2;
- }
- }
-
- insert = firstNode;
- // Now do the sorting
- for ( int i = n; i > 0; i-- ) {
- insert->data = heap[1];
- insert = insert->next;
- if ( i > 1 ) {
- heap[1] = heap[i];
- heapSortPushDown( heap, 1, i - 1 );
- }
- }
-
- delete [] realheap;
-}
-
-
-/*****************************************************************************
- QGList stream functions
- *****************************************************************************/
-
-#ifndef QT_NO_DATASTREAM
-QDataStream &operator>>( QDataStream &s, QGList &list )
-{ // read list
- return list.read( s );
-}
-
-QDataStream &operator<<( QDataStream &s, const QGList &list )
-{ // write list
- return list.write( s );
-}
-
-/*!
- \internal
- Reads a list from the stream \e s.
-*/
-
-QDataStream &QGList::read( QDataStream &s )
-{
- uint num;
- s >> num; // read number of items
- clear(); // clear list
- while ( num-- ) { // read all items
- Item d;
- read( s, d );
- CHECK_PTR( d );
- if ( !d ) // no memory
- break;
- QLNode *n = new QLNode( d );
- CHECK_PTR( n );
- if ( !n ) // no memory
- break;
- n->next = 0;
- if ( (n->prev = lastNode) ) // list is not empty
- lastNode->next = n;
- else // initialize list
- firstNode = n;
- lastNode = n;
- numNodes++;
- }
- curNode = firstNode;
- curIndex = curNode ? 0 : -1;
- return s;
-}
-
-/*!
- \internal
- Writes the list to the stream \e s.
-*/
-
-QDataStream &QGList::write( QDataStream &s ) const
-{
- s << count(); // write number of items
- QLNode *n = firstNode;
- while ( n ) { // write all items
- write( s, n->data );
- n = n->next;
- }
- return s;
-}
-
-#endif // QT_NO_DATASTREAM
-
-/*****************************************************************************
- QGListIterator member functions
- *****************************************************************************/
-
-/*!
- \class QGListIterator qglist.h
- \brief The QGListIterator class is an internal class for implementing QListIterator.
-
- QGListIterator is a strictly internal class that does the heavy work for
- QListIterator.
-*/
-
-/*!
- \internal
- Constructs an iterator that operates on the list \e l.
-*/
-
-QGListIterator::QGListIterator( const QGList &l )
-{
- list = (QGList *)&l; // get reference to list
- curNode = list->firstNode; // set to first node
- if ( !list->iterators ) {
- list->iterators = new QGList; // create iterator list
- CHECK_PTR( list->iterators );
- }
- list->iterators->append( this ); // attach iterator to list
-}
-
-/*!
- \internal
- Constructs a copy of the iterator \e it.
-*/
-
-QGListIterator::QGListIterator( const QGListIterator &it )
-{
- list = it.list;
- curNode = it.curNode;
- if ( list )
- list->iterators->append( this ); // attach iterator to list
-}
-
-/*!
- \internal
- Assigns a copy of the iterator \e it and returns a reference to this
- iterator.
-*/
-
-QGListIterator &QGListIterator::operator=( const QGListIterator &it )
-{
- if ( list ) // detach from old list
- list->iterators->removeRef( this );
- list = it.list;
- curNode = it.curNode;
- if ( list )
- list->iterators->append( this ); // attach to new list
- return *this;
-}
-
-/*!
- \internal
- Destroys the iterator.
-*/
-
-QGListIterator::~QGListIterator()
-{
- if ( list ) // detach iterator from list
- list->iterators->removeRef(this);
-}
-
-
-/*!
- \fn bool QGListIterator::atFirst() const
- \internal
- Returns TRUE if the iterator points to the first item, otherwise FALSE.
-*/
-
-/*!
- \fn bool QGListIterator::atLast() const
- \internal
- Returns TRUE if the iterator points to the last item, otherwise FALSE.
-*/
-
-
-/*!
- \internal
- Sets the list iterator to point to the first item in the list.
-*/
-
-QCollection::Item QGListIterator::toFirst()
-{
- if ( !list ) {
-#if defined(CHECK_NULL)
- qWarning( "QGListIterator::toFirst: List has been deleted" );
-#endif
- return 0;
- }
- return list->firstNode ? (curNode = list->firstNode)->getData() : 0;
-}
-
-/*!
- \internal
- Sets the list iterator to point to the last item in the list.
-*/
-
-QCollection::Item QGListIterator::toLast()
-{
- if ( !list ) {
-#if defined(CHECK_NULL)
- qWarning( "QGListIterator::toLast: List has been deleted" );
-#endif
- return 0;
- }
- return list->lastNode ? (curNode = list->lastNode)->getData() : 0;
-}
-
-
-/*!
- \fn QCollection::Item QGListIterator::get() const
- \internal
- Returns the iterator item.
-*/
-
-
-/*!
- \internal
- Moves to the next item (postfix).
-*/
-
-QCollection::Item QGListIterator::operator()()
-{
- if ( !curNode )
- return 0;
- QCollection::Item d = curNode->getData();
- curNode = curNode->next;
- return d;
-}
-
-/*!
- \internal
- Moves to the next item (prefix).
-*/
-
-QCollection::Item QGListIterator::operator++()
-{
- if ( !curNode )
- return 0;
- curNode = curNode->next;
- return curNode ? curNode->getData() : 0;
-}
-
-/*!
- \internal
- Moves \e jumps positions forward.
-*/
-
-QCollection::Item QGListIterator::operator+=( uint jumps )
-{
- while ( curNode && jumps-- )
- curNode = curNode->next;
- return curNode ? curNode->getData() : 0;
-}
-
-/*!
- \internal
- Moves to the previous item (prefix).
-*/
-
-QCollection::Item QGListIterator::operator--()
-{
- if ( !curNode )
- return 0;
- curNode = curNode->prev;
- return curNode ? curNode->getData() : 0;
-}
-
-/*!
- \internal
- Moves \e jumps positions backward.
-*/
-
-QCollection::Item QGListIterator::operator-=( uint jumps )
-{
- while ( curNode && jumps-- )
- curNode = curNode->prev;
- return curNode ? curNode->getData() : 0;
-}
diff --git a/qtools/qglist.h b/qtools/qglist.h
deleted file mode 100644
index 0f30594..0000000
--- a/qtools/qglist.h
+++ /dev/null
@@ -1,254 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QGList and QGListIterator classes
-**
-** Created : 920624
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QGLIST_H
-#define QGLIST_H
-
-#ifndef QT_H
-#include "qcollection.h"
-#endif // QT_H
-
-
-/*****************************************************************************
- QLNode class (internal doubly linked list node)
- *****************************************************************************/
-
-class Q_EXPORT QLNode
-{
-friend class QGList;
-friend class QGListIterator;
-public:
- QCollection::Item getData() { return data; }
-private:
- QCollection::Item data;
- QLNode *prev;
- QLNode *next;
- QLNode( QCollection::Item d ) { data = d; }
-};
-
-
-/*****************************************************************************
- QGList class
- *****************************************************************************/
-
-class Q_EXPORT QGList : public QCollection // doubly linked generic list
-{
-friend class QGListIterator;
-public:
- uint count() const; // return number of nodes
-
-#ifndef QT_NO_DATASTREAM
- QDataStream &read( QDataStream & ); // read list from stream
- QDataStream &write( QDataStream & ) const; // write list to stream
-#endif
-protected:
- QGList(); // create empty list
- QGList( const QGList & ); // make copy of other list
- virtual ~QGList();
-
- QGList &operator=( const QGList & ); // assign from other list
- bool operator==( const QGList& ) const;
-
- void inSort( QCollection::Item ); // add item sorted in list
- void append( QCollection::Item ); // add item at end of list
- bool insertAt( uint index, QCollection::Item ); // add item at i'th position
- void relinkNode( QLNode * ); // relink as first item
- bool removeNode( QLNode * ); // remove node
- bool remove( QCollection::Item = 0 ); // remove item (0=current)
- bool removeRef( QCollection::Item = 0 ); // remove item (0=current)
- bool removeFirst(); // remove first item
- bool removeLast(); // remove last item
- bool removeAt( uint index ); // remove item at i'th position
- QCollection::Item takeNode( QLNode * ); // take out node
- QCollection::Item take(); // take out current item
- QCollection::Item takeAt( uint index ); // take out item at i'th pos
- QCollection::Item takeFirst(); // take out first item
- QCollection::Item takeLast(); // take out last item
-
- void sort(); // sort all items;
- void clear(); // remove all items
-
- int findRef( QCollection::Item, bool = TRUE ); // find exact item in list
- int find( QCollection::Item, bool = TRUE ); // find equal item in list
-
- uint containsRef( QCollection::Item ) const; // get number of exact matches
- uint contains( QCollection::Item ) const; // get number of equal matches
-
- QCollection::Item at( uint index ); // access item at i'th pos
- int at() const; // get current index
- QLNode *currentNode() const; // get current node
-
- QCollection::Item get() const; // get current item
-
- QCollection::Item cfirst() const; // get ptr to first list item
- QCollection::Item clast() const; // get ptr to last list item
- QCollection::Item first(); // set first item in list curr
- QCollection::Item last(); // set last item in list curr
- QCollection::Item next(); // set next item in list curr
- QCollection::Item prev(); // set prev item in list curr
-
- virtual int compareItems( QCollection::Item, QCollection::Item );
-
-#ifndef QT_NO_DATASTREAM
- virtual QDataStream &read( QDataStream &, QCollection::Item & );
- virtual QDataStream &write( QDataStream &, QCollection::Item ) const;
-#endif
-private:
- void prepend( QCollection::Item ); // add item at start of list
-
- void heapSortPushDown( QCollection::Item* heap, int first, int last );
-
- QLNode *firstNode; // first node
- QLNode *lastNode; // last node
- QLNode *curNode; // current node
- int curIndex; // current index
- uint numNodes; // number of nodes
- QGList *iterators; // list of iterators
-
- QLNode *locate( uint ); // get node at i'th pos
- QLNode *unlink(); // unlink node
-};
-
-
-inline uint QGList::count() const
-{
- return numNodes;
-}
-
-inline bool QGList::removeFirst()
-{
- first();
- return remove();
-}
-
-inline bool QGList::removeLast()
-{
- last();
- return remove();
-}
-
-inline int QGList::at() const
-{
- return curIndex;
-}
-
-inline QCollection::Item QGList::at( uint index )
-{
- QLNode *n = locate( index );
- return n ? n->data : 0;
-}
-
-inline QLNode *QGList::currentNode() const
-{
- return curNode;
-}
-
-inline QCollection::Item QGList::get() const
-{
- return curNode ? curNode->data : 0;
-}
-
-inline QCollection::Item QGList::cfirst() const
-{
- return firstNode ? firstNode->data : 0;
-}
-
-inline QCollection::Item QGList::clast() const
-{
- return lastNode ? lastNode->data : 0;
-}
-
-
-/*****************************************************************************
- QGList stream functions
- *****************************************************************************/
-
-#ifndef QT_NO_DATASTREAM
-Q_EXPORT QDataStream &operator>>( QDataStream &, QGList & );
-Q_EXPORT QDataStream &operator<<( QDataStream &, const QGList & );
-#endif
-
-/*****************************************************************************
- QGListIterator class
- *****************************************************************************/
-
-class Q_EXPORT QGListIterator // QGList iterator
-{
-friend class QGList;
-protected:
- QGListIterator( const QGList & );
- QGListIterator( const QGListIterator & );
- QGListIterator &operator=( const QGListIterator & );
- ~QGListIterator();
-
- bool atFirst() const; // test if at first item
- bool atLast() const; // test if at last item
- QCollection::Item toFirst(); // move to first item
- QCollection::Item toLast(); // move to last item
-
- QCollection::Item get() const; // get current item
- QCollection::Item operator()(); // get current and move to next
- QCollection::Item operator++(); // move to next item (prefix)
- QCollection::Item operator+=(uint); // move n positions forward
- QCollection::Item operator--(); // move to prev item (prefix)
- QCollection::Item operator-=(uint); // move n positions backward
-
-protected:
- QGList *list; // reference to list
-
-private:
- QLNode *curNode; // current node in list
-};
-
-
-inline bool QGListIterator::atFirst() const
-{
- return curNode == list->firstNode;
-}
-
-inline bool QGListIterator::atLast() const
-{
- return curNode == list->lastNode;
-}
-
-inline QCollection::Item QGListIterator::get() const
-{
- return curNode ? curNode->data : 0;
-}
-
-
-#endif // QGLIST_H
diff --git a/qtools/qglobal.cpp b/qtools/qglobal.cpp
deleted file mode 100644
index 444cb3b..0000000
--- a/qtools/qglobal.cpp
+++ /dev/null
@@ -1,685 +0,0 @@
-/****************************************************************************
-**
-**
-** Global functions
-**
-** Created : 920604
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qglobal.h"
-#include "qasciidict.h"
-#include "qstring.h"
-#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
-
-// NOT REVISED
-
-/*!
- \relates QApplication
- Returns the Qt version number for the library, typically "1.30"
- or "2.1.0".
-*/
-
-const char *qVersion()
-{
- return QT_VERSION_STR;
-}
-
-
-/*****************************************************************************
- System detection routines
- *****************************************************************************/
-
-static bool si_alreadyDone = FALSE;
-static int si_wordSize;
-static bool si_bigEndian;
-
-/*!
- \relates QApplication
- Obtains information about the system.
-
- The system's word size in bits (typically 32) is returned in \e *wordSize.
- The \e *bigEndian is set to TRUE if this is a big-endian machine,
- or to FALSE if this is a little-endian machine.
-
- This function calls qFatal() with a message if the computer is truly weird
- (i.e. different endianess for 16 bit and 32 bit integers).
-*/
-
-bool qSysInfo( int *wordSize, bool *bigEndian )
-{
-#if defined(CHECK_NULL)
- ASSERT( wordSize != 0 );
- ASSERT( bigEndian != 0 );
-#endif
-
- if ( si_alreadyDone ) { // run it only once
- *wordSize = si_wordSize;
- *bigEndian = si_bigEndian;
- return TRUE;
- }
- si_alreadyDone = TRUE;
-
- si_wordSize = 0;
- uint n = (uint)(~0);
- while ( n ) { // detect word size
- si_wordSize++;
- n /= 2;
- }
- *wordSize = si_wordSize;
-
- if ( *wordSize != 64 &&
- *wordSize != 32 &&
- *wordSize != 16 ) { // word size: 16, 32 or 64
-#if defined(CHECK_RANGE)
- qFatal( "qSysInfo: Unsupported system word size %d", *wordSize );
-#endif
- return FALSE;
- }
- if ( sizeof(Q_INT8) != 1 || sizeof(Q_INT16) != 2 || sizeof(Q_INT32) != 4 ||
- sizeof(float) != 4 || sizeof(double) != 8 ) {
-#if defined(CHECK_RANGE)
- qFatal( "qSysInfo: Unsupported system data type size" );
-#endif
- return FALSE;
- }
-
- bool be16, be32; // determine byte ordering
- short ns = 0x1234;
- int nl = 0x12345678;
-
- unsigned char *p = (unsigned char *)(&ns); // 16-bit integer
- be16 = *p == 0x12;
-
- p = (unsigned char *)(&nl); // 32-bit integer
- if ( p[0] == 0x12 && p[1] == 0x34 && p[2] == 0x56 && p[3] == 0x78 )
- be32 = TRUE;
- else
- if ( p[0] == 0x78 && p[1] == 0x56 && p[2] == 0x34 && p[3] == 0x12 )
- be32 = FALSE;
- else
- be32 = !be16;
-
- if ( be16 != be32 ) { // strange machine!
-#if defined(CHECK_RANGE)
- qFatal( "qSysInfo: Inconsistent system byte order" );
-#endif
- return FALSE;
- }
-
- *bigEndian = si_bigEndian = be32;
- return TRUE;
-}
-
-
-/*****************************************************************************
- Debug output routines
- *****************************************************************************/
-
-/*!
- \fn void qDebug( const char *msg, ... )
-
- \relates QApplication
- Prints a debug message, or calls the message handler (if it has been
- installed).
-
- This function takes a format string and a list of arguments, similar to
- the C printf() function.
-
- Example:
- \code
- qDebug( "my window handle = %x", myWidget->id() );
- \endcode
-
- Under X11, the text is printed to stderr. Under Windows, the text is
- sent to the debugger.
-
- \warning The internal buffer is limited to 8196 bytes (including the
- 0-terminator).
-
- \sa qWarning(), qFatal(), qInstallMsgHandler(),
- \link debug.html Debugging\endlink
-*/
-
-/*!
- \fn void qWarning( const char *msg, ... )
-
- \relates QApplication
- Prints a warning message, or calls the message handler (if it has been
- installed).
-
- This function takes a format string and a list of arguments, similar to
- the C printf() function.
-
- Example:
- \code
- void f( int c )
- {
- if ( c > 200 )
- qWarning( "f: bad argument, c == %d", c );
- }
- \endcode
-
- Under X11, the text is printed to stderr. Under Windows, the text is
- sent to the debugger.
-
- \warning The internal buffer is limited to 8196 bytes (including the
- 0-terminator).
-
- \sa qDebug(), qFatal(), qInstallMsgHandler(),
- \link debug.html Debugging\endlink
-*/
-
-/*!
- \fn void qFatal( const char *msg, ... )
-
- \relates QApplication
- Prints a fatal error message and exits, or calls the message handler (if it
- has been installed).
-
- This function takes a format string and a list of arguments, similar to
- the C printf() function.
-
- Example:
- \code
- int divide( int a, int b )
- {
- if ( b == 0 ) // program error
- qFatal( "divide: cannot divide by zero" );
- return a/b;
- }
- \endcode
-
- Under X11, the text is printed to stderr. Under Windows, the text is
- sent to the debugger.
-
- \warning The internal buffer is limited to 8196 bytes (including the
- 0-terminator).
-
- \sa qDebug(), qWarning(), qInstallMsgHandler(),
- \link debug.html Debugging\endlink
-*/
-
-
-static msg_handler handler = 0; // pointer to debug handler
-
-
-#ifdef _OS_MAC_
-
-static FILE * mac_debug=0;
-
-void qDebug( const char *msg, ... )
-{
- mac_debug=fopen( "debug.txt", "a+" );
- if(mac_debug) {
- char buf[8196];
- va_list ap;
- va_start( ap, msg ); // use variable arg list
- if ( handler ) {
- vsprintf( buf, msg, ap );
- va_end( ap );
- (*handler)( QtDebugMsg, buf );
- } else {
- vfprintf( mac_debug, msg, ap );
- va_end( ap );
- fprintf( mac_debug, "\n" ); // add newline
- fflush( mac_debug );
- }
- fclose(mac_debug);
- } else {
- exit(0);
- }
-}
-
-// copied... this looks really bad.
-void debug( const char *msg, ... )
-{
- mac_debug=fopen( "debug.txt", "a+" );
- if(mac_debug) {
- char buf[8196];
- va_list ap;
- va_start( ap, msg ); // use variable arg list
- if ( handler ) {
- vsprintf( buf, msg, ap );
- va_end( ap );
- (*handler)( QtDebugMsg, buf );
- } else {
- vfprintf( mac_debug, msg, ap );
- va_end( ap );
- fprintf( mac_debug, "\n" ); // add newline
- fflush( mac_debug );
- }
- fclose(mac_debug);
- }
-}
-
-void qWarning( const char *msg, ... )
-{
- mac_debug=fopen( "debug.txt", "a+" );
- if(mac_debug) {
- char buf[8196];
- va_list ap;
- va_start( ap, msg ); // use variable arg list
- if ( handler ) {
- vsprintf( buf, msg, ap );
- va_end( ap );
- (*handler)( QtDebugMsg, buf );
- } else {
- vfprintf( mac_debug, msg, ap );
- va_end( ap );
- fprintf( mac_debug, "\n" ); // add newline
- fflush( mac_debug );
- }
- fclose(mac_debug);
- }
-}
-
-// copied... this looks really bad.
-void warning( const char *msg, ... )
-{
- mac_debug=fopen( "debug.txt", "a+" );
- if(mac_debug) {
- char buf[8196];
- va_list ap;
- va_start( ap, msg ); // use variable arg list
- if ( handler ) {
- vsprintf( buf, msg, ap );
- va_end( ap );
- (*handler)( QtDebugMsg, buf );
- } else {
- vfprintf( mac_debug, msg, ap );
- va_end( ap );
- fprintf( mac_debug, "\n" ); // add newline
- fflush( mac_debug );
- }
- fclose(mac_debug);
- }
-}
-
-void qFatal( const char *msg, ... )
-{
- mac_debug=fopen( "debug.txt", "a+");
- if(mac_debug) {
- char buf[8196];
- va_list ap;
- va_start( ap, msg ); // use variable arg list
- if ( handler ) {
- vsprintf( buf, msg, ap );
- va_end( ap );
- (*handler)( QtDebugMsg, buf );
- } else {
- vfprintf( mac_debug, msg, ap );
- va_end( ap );
- fprintf( mac_debug, "\n" ); // add newline
- fflush( mac_debug );
- }
- fclose(mac_debug);
- }
- exit(0);
-}
-
-// copied... this looks really bad.
-void fatal( const char *msg, ... )
-{
- mac_debug=fopen( "debug.txt", "a+" );
- if(mac_debug) {
- char buf[8196];
- va_list ap;
- va_start( ap, msg ); // use variable arg list
- if ( handler ) {
- vsprintf( buf, msg, ap );
- va_end( ap );
- (*handler)( QtDebugMsg, buf );
- } else {
- vfprintf( mac_debug, msg, ap );
- va_end( ap );
- fprintf( mac_debug, "\n" ); // add newline
- fflush( mac_debug );
- }
- fclose(mac_debug);
- }
- exit(0);
-}
-
-#else
-
-void qDebug( const char *msg, ... )
-{
- char buf[8196];
- va_list ap;
- va_start( ap, msg ); // use variable arg list
- if ( handler ) {
- vsprintf( buf, msg, ap ); // ### vsnprintf would be great here
- va_end( ap );
- (*handler)( QtDebugMsg, buf );
- } else {
- vfprintf( stderr, msg, ap );
- va_end( ap );
- fprintf( stderr, "\n" ); // add newline
- }
-}
-
-// copied... this looks really bad.
-void debug( const char *msg, ... )
-{
- char buf[8196];
- va_list ap;
- va_start( ap, msg ); // use variable arg list
- if ( handler ) {
- vsprintf( buf, msg, ap );
- va_end( ap );
- (*handler)( QtDebugMsg, buf );
- } else {
- vfprintf( stderr, msg, ap );
- va_end( ap );
- fprintf( stderr, "\n" ); // add newline
- }
-}
-
-void qWarning( const char *msg, ... )
-{
- char buf[8196];
- va_list ap;
- va_start( ap, msg ); // use variable arg list
- if ( handler ) {
- vsprintf( buf, msg, ap );
- va_end( ap );
- (*handler)( QtWarningMsg, buf );
- } else {
- vfprintf( stderr, msg, ap );
- va_end( ap );
- fprintf( stderr, "\n" ); // add newline
- }
-}
-
-
-// again, copied
-void warning( const char *msg, ... )
-{
- char buf[8196];
- va_list ap;
- va_start( ap, msg ); // use variable arg list
- if ( handler ) {
- vsprintf( buf, msg, ap );
- va_end( ap );
- (*handler)( QtWarningMsg, buf );
- } else {
- vfprintf( stderr, msg, ap );
- va_end( ap );
- fprintf( stderr, "\n" ); // add newline
- }
-}
-
-void qFatal( const char *msg, ... )
-{
- char buf[8196];
- va_list ap;
- va_start( ap, msg ); // use variable arg list
- if ( handler ) {
- vsprintf( buf, msg, ap );
- va_end( ap );
- (*handler)( QtFatalMsg, buf );
- } else {
- vfprintf( stderr, msg, ap );
- va_end( ap );
- fprintf( stderr, "\n" ); // add newline
-#if defined(_OS_UNIX_) && defined(DEBUG)
- abort(); // trap; generates core dump
-#else
- exit( 1 ); // goodbye cruel world
-#endif
- }
-}
-
-// yet again, copied
-void fatal( const char *msg, ... )
-{
- char buf[8196];
- va_list ap;
- va_start( ap, msg ); // use variable arg list
- if ( handler ) {
- vsprintf( buf, msg, ap );
- va_end( ap );
- (*handler)( QtFatalMsg, buf );
- } else {
- vfprintf( stderr, msg, ap );
- va_end( ap );
- fprintf( stderr, "\n" ); // add newline
-#if defined(_OS_UNIX_) && defined(DEBUG)
- abort(); // trap; generates core dump
-#else
- exit( 1 ); // goodbye cruel world
-#endif
- }
-}
-
-#endif
-
-
-/*!
- \fn void ASSERT( bool test )
- \relates QApplication
- Prints a warning message containing the source code file name and line number
- if \e test is FALSE.
-
- This is really a macro defined in qglobal.h.
-
- ASSERT is useful for testing required conditions in your program.
-
- Example:
- \code
- //
- // File: div.cpp
- //
-
- #include <qglobal.h>
-
- int divide( int a, int b )
- {
- ASSERT( b != 0 ); // this is line 9
- return a/b;
- }
- \endcode
-
- If \c b is zero, the ASSERT statement will output the following message
- using the qWarning() function:
- \code
- ASSERT: "b == 0" in div.cpp (9)
- \endcode
-
- \sa qWarning(), \link debug.html Debugging\endlink
-*/
-
-
-/*!
- \fn void CHECK_PTR( void *p )
- \relates QApplication
- If \e p is null, a fatal messages says that the program ran out of memory
- and exits. If \e p is not null, nothing happens.
-
- This is really a macro defined in qglobal.h.
-
- Example:
- \code
- int *a;
- CHECK_PTR( a = new int[80] ); // never do this!
- // do this instead:
- a = new int[80];
- CHECK_PTR( a ); // this is fine
- \endcode
-
- \sa qFatal(), \link debug.html Debugging\endlink
-*/
-
-
-//
-// The CHECK_PTR macro calls this function to check if an allocation went ok.
-//
-
-bool qt_check_pointer( bool c, const char *n, int l )
-{
- if ( c )
- qFatal( "In file %s, line %d: Out of memory", n, l );
- return TRUE;
-}
-
-
-static bool firstObsoleteWarning(const char *obj, const char *oldfunc )
-{
- static QAsciiDict<int> *obsoleteDict = 0;
- if ( !obsoleteDict ) { // first time func is called
- obsoleteDict = new QAsciiDict<int>;
-#if defined(DEBUG)
- qDebug(
- "You are using obsolete functions in the Qt library. Call the function\n"
- "qSuppressObsoleteWarnings() to suppress obsolete warnings.\n"
- );
-#endif
- }
- QCString s( obj );
- s += "::";
- s += oldfunc;
- if ( obsoleteDict->find(s.data()) == 0 ) {
- obsoleteDict->insert( s.data(), (int*)1 ); // anything different from 0
- return TRUE;
- }
- return FALSE;
-}
-
-static bool suppressObsolete = FALSE;
-
-void qSuppressObsoleteWarnings( bool suppress )
-{
- suppressObsolete = suppress;
-}
-
-void qObsolete( const char *obj, const char *oldfunc, const char *newfunc )
-{
- if ( suppressObsolete )
- return;
- if ( !firstObsoleteWarning(obj, oldfunc) )
- return;
- if ( obj )
- qDebug( "%s::%s: This function is obsolete, use %s instead.",
- obj, oldfunc, newfunc );
- else
- qDebug( "%s: This function is obsolete, use %s instead.",
- oldfunc, newfunc );
-}
-
-void qObsolete( const char *obj, const char *oldfunc )
-{
- if ( suppressObsolete )
- return;
- if ( !firstObsoleteWarning(obj, oldfunc) )
- return;
- if ( obj )
- qDebug( "%s::%s: This function is obsolete.", obj, oldfunc );
- else
- qDebug( "%s: This function is obsolete.", oldfunc );
-}
-
-void qObsolete( const char *message )
-{
- if ( suppressObsolete )
- return;
- if ( !firstObsoleteWarning( "Qt", message) )
- return;
- qDebug( "%s", message );
-}
-
-
-/*!
- \relates QApplication
- Installs a Qt message handler. Returns a pointer to the message handler
- previously defined.
-
- The message handler is a function that prints out debug messages,
- warnings and fatal error messages. The Qt library (debug version)
- contains hundreds of warning messages that are printed when internal
- errors (usually invalid function arguments) occur. If you implement
- your own message handler, you get total control of these messages.
-
- The default message handler prints the message to the standard output
- under X11 or to the debugger under Windows. If it is a fatal message,
- the application aborts immediately.
-
- Only one message handler can be defined, since this is usually done on
- an application-wide basis to control debug output.
-
- To restore the message handler, call \c qInstallMsgHandler(0).
-
- Example:
- \code
- #include <qapplication.h>
- #include <stdio.h>
- #include <stdlib.h>
-
- void myMessageOutput( QtMsgType type, const char *msg )
- {
- switch ( type ) {
- case QtDebugMsg:
- fprintf( stderr, "Debug: %s\n", msg );
- break;
- case QtWarningMsg:
- fprintf( stderr, "Warning: %s\n", msg );
- break;
- case QtFatalMsg:
- fprintf( stderr, "Fatal: %s\n", msg );
- abort(); // dump core on purpose
- }
- }
-
- int main( int argc, char **argv )
- {
- qInstallMsgHandler( myMessageOutput );
- QApplication a( argc, argv );
- ...
- return a.exec();
- }
- \endcode
-
- \sa qDebug(), qWarning(), qFatal(), \link debug.html Debugging\endlink
-*/
-
-msg_handler qInstallMsgHandler( msg_handler h )
-{
- msg_handler old = handler;
- handler = h;
- return old;
-}
-
-
-#ifdef _WS_WIN_
-bool qt_winunicode=FALSE;
-#endif
diff --git a/qtools/qglobal.h b/qtools/qglobal.h
deleted file mode 100644
index 0deef5d..0000000
--- a/qtools/qglobal.h
+++ /dev/null
@@ -1,626 +0,0 @@
-/****************************************************************************
-**
-**
-** Global type declarations and definitions
-**
-** Created : 920529
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QGLOBAL_H
-#define QGLOBAL_H
-
-
-#define QT_VERSION 223
-#define QT_VERSION_STR "2.2.3"
-
-
-//
-// The operating system, must be one of: (_OS_x_)
-//
-// MAC - Macintosh
-// MSDOS - MS-DOS and Windows
-// OS2 - OS/2
-// OS2EMX - XFree86 on OS/2 (not PM)
-// WIN32 - Win32 (Windows 95/98 and Windows NT)
-// SUN - SunOS
-// SOLARIS - Sun Solaris
-// HPUX - HP-UX
-// ULTRIX - DEC Ultrix
-// LINUX - Linux
-// FREEBSD - FreeBSD
-// NETBSD - NetBSD
-// OPENBSD - OpenBSD
-// IRIX - SGI Irix
-// OSF - OSF Unix
-// BSDI - BSDI Unix
-// SCO - SCO of some sort
-// AIX - AIX Unix
-// UNIXWARE - SCO UnixWare
-// GNU - GNU Hurd
-// DGUX - DG Unix
-// UNIX - Any UNIX bsd/sysv system
-//
-
-#if defined(__APPLE__) || defined(macintosh)
-#define _OS_MAC_
-# ifdef MAC_OS_X_VERSION_MIN_REQUIRED
-# undef MAC_OS_X_VERSION_MIN_REQUIRED
-# endif
-# define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_3
-#elif defined(MSDOS) || defined(_MSDOS) || defined(__MSDOS__)
-#define _OS_MSDOS_
-#elif defined(OS2) || defined(_OS2) || defined(__OS2__)
-#if defined(__EMX__)
-#define _OS_OS2EMX_
-#else
-#define _OS_OS2_
-#endif
-#elif defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__)
-#define _OS_WIN32_
-#elif defined(__MWERKS__) && defined(__INTEL__)
-#define _OS_WIN32_
-#elif defined(sun) || defined(__sun) || defined(__sun__)
-#if defined(__SVR4)
-#define _OS_SOLARIS_
-#else
-#define _OS_SUN_
-#endif
-#elif defined(hpux) || defined(__hpux) || defined(__hpux__)
-#define _OS_HPUX_
-#elif defined(ultrix) || defined(__ultrix) || defined(__ultrix__)
-#define _OS_ULTRIX_
-#elif defined(reliantunix)
-#define _OS_RELIANTUNIX_
-#elif defined(linux) || defined(__linux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
-#define _OS_LINUX_
-#elif defined(__FreeBSD__)
-#define _OS_FREEBSD_
-#elif defined(__NetBSD__)
-#define _OS_NETBSD_
-#elif defined(__OpenBSD__)
-#define _OS_OPENBSD_
-#elif defined(sgi) || defined(__sgi)
-#define _OS_IRIX_
-#elif defined(__osf__)
-#define _OS_OSF_
-#elif defined(bsdi) || defined(__bsdi__)
-#define _OS_BSDI_
-#elif defined(_AIX)
-#define _OS_AIX_
-#elif defined(__Lynx__)
-#define _OS_LYNXOS_
-#elif defined(_UNIXWARE)
-#define _OS_UNIXWARE_
-#elif defined(DGUX)
-#define _OS_DGUX_
-#elif defined(__QNX__)
-#define _OS_QNX_
-#elif defined(_SCO_DS) || defined(M_UNIX) || defined(M_XENIX)
-#define _OS_SCO_
-#elif defined(sco) || defined(_UNIXWARE7)
-#define _OS_UNIXWARE7_
-#elif !defined(_SCO_DS) && defined(__USLC__) && defined(__SCO_VERSION__)
-#define _OS_UNIXWARE7_
-#elif defined(__CYGWIN__)
-#define _OS_CYGWIN_
-#elif defined(__BEOS__)
-#define _OS_BEOS_
-#elif defined(__MINT__)
-#define _OS_MINT_
-#else
-#error "Qt has not been ported to this OS - talk to qt-bugs@trolltech.com"
-#endif
-
-#if defined(_OS_MAC_) || defined(_OS_MSDOS_) || defined(_OS_OS2_) || defined(_OS_WIN32_)
-#undef _OS_UNIX_
-#elif !defined(_OS_UNIX_)
-#define _OS_UNIX_
-// QT_CLEAN_NAMESPACE is not defined by default; it would break too
-// much code.
-#if !defined(QT_CLEAN_NAMESPACE) && !defined(UNIX)
-// ### remove 3.0
-#define UNIX
-#endif
-#endif
-
-
-//
-// The compiler, must be one of: (_CC_x_)
-//
-// SYM - Symantec C++ for both PC and Macintosh
-// MPW - MPW C++
-// MWERKS - Metrowerks CodeWarrior
-// MSVC - Microsoft Visual C/C++
-// BOR - Borland/Turbo C++
-// WAT - Watcom C++
-// GNU - GNU C++
-// COMEAU - Comeau C++
-// EDG - Edison Design Group C++
-// OC - CenterLine C++
-// SUN - Sun C++
-// DEC - DEC C++
-// HP - HPUX C++
-// USLC - SCO UnixWare7 C++
-// CDS - Reliant C++
-// KAI - KAI C++
-//
-
-
-// Should be sorted most-authoritative to least-authoritative
-
-#if defined(__SC__)
-#define _CC_SYM_
-#elif defined( __KCC )
-#define _CC_KAI_
-#define _CC_EDG_
-#define Q_HAS_BOOL_TYPE
-#elif defined(applec)
-#define _CC_MPW_
-#elif defined(__MWERKS__)
-#define _CC_MWERKS_
-#define Q_HAS_BOOL_TYPE
-#elif defined(_MSC_VER)
-#define _CC_MSVC_
-#elif defined(__BORLANDC__) || defined(__TURBOC__)
-#define _CC_BOR_
-#elif defined(__WATCOMC__)
-#define _CC_WAT_
-#define Q_HAS_BOOL_TYPE
-#elif defined(__GNUC__)
-#define _CC_GNU_
-#if __GNUC__ == 2 && __GNUC_MINOR__ <= 7
-#define Q_FULL_TEMPLATE_INSTANTIATION
-#define Q_TEMPLATE_NEEDS_CLASS_DECLARATION
-#define Q_TEMPLATE_NEEDS_EXPLICIT_CONVERSION
-#define Q_SPURIOUS_NON_VOID_WARNING
-#endif
-#if __GNUC__ == 2 && __GNUC_MINOR__ >= 95
-#define Q_DELETING_VOID_UNDEFINED
-#endif
-#if (defined(__arm__) || defined(__ARMEL__)) && !defined(QT_MOC_CPP)
-#define Q_PACKED __attribute__ ((packed))
-#endif
-#elif defined(__xlC__)
-#define _CC_XLC_
-#define Q_FULL_TEMPLATE_INSTANTIATION
-#if __xlC__ >= 0x400
-#define Q_HAS_BOOL_TYPE
-#endif
-#if __xlC__ <= 0x0306
-#define Q_TEMPLATE_NEEDS_EXPLICIT_CONVERSION
-#endif
-#elif defined(como40)
-#define _CC_EDG_
-#define _CC_COMEAU_
-#define Q_HAS_BOOL_TYPE
-#define Q_C_CALLBACKS
-#elif defined(__USLC__)
-#define _CC_USLC_
-#ifdef __EDG__ // UnixWare7
-#define Q_HAS_BOOL_TYPE
-#endif
-#elif defined(__DECCXX)
-#define _CC_DEC_
-#if __DECCXX_VER >= 60060005
-#define Q_HAS_BOOL_TYPE
-#endif
-#elif defined(__EDG) || defined(__EDG__)
-// one observed on SGI DCC, the other documented
-#define _CC_EDG_
-#elif defined(OBJECTCENTER) || defined(CENTERLINE_CLPP)
-#define _CC_OC_
-#if defined(_BOOL)
-#define Q_HAS_BOOL_TYPE
-#endif
-#elif defined(__SUNPRO_CC)
-#define _CC_SUN_
-#if __SUNPRO_CC >= 0x500
-#define Q_HAS_BOOL_TYPE
-#define Q_C_CALLBACKS
-#endif
-#elif defined(__CDS__)
-#define _CC_CDS_
-#define Q_HAS_BOOL_TYPE
-#elif defined(_OS_HPUX_)
-// this test is from aCC online help
-#if defined(__HP_aCC) || __cplusplus >= 199707L
-// this is the aCC
-#define _CC_HP_ACC_
-#define Q_HAS_BOOL_TYPE
-#else
-// this is the CC
-#define _CC_HP_
-#define Q_FULL_TEMPLATE_INSTANTIATION
-#define Q_TEMPLATE_NEEDS_EXPLICIT_CONVERSION
-#endif // __HP_aCC
-#else
-#error "Qt has not been tested with this compiler - talk to qt-bugs@trolltech.com"
-#endif
-
-// detect Microsoft compiler version
-#ifdef _CC_MSVC_
-#if _MSC_VER >= 1400
-#define _CC_V2005
-#elif _MSC_VER >= 1310
-#define _CC_V2003
-#elif _MSC_VER > 1300
-#define _CC_V2002
-#else
-#define _CC_V1998
-#endif
-#endif
-
-#ifndef Q_PACKED
-#define Q_PACKED
-#endif
-
-// Window system setting
-
-#if defined(_OS_MAC_)
-#define _WS_MAC_
-#elif defined(_OS_MSDOS_)
-#define _WS_WIN16_
-#error "Qt requires Win32 and does not work with Windows 3.x"
-#elif defined(_WIN32_X11_)
-#define _WS_X11_
-#elif defined(_OS_WIN32_)
-#define _WS_WIN32_
-#elif defined(_OS_OS2_)
-#error "Qt does not work with OS/2 Presentation Manager or Workplace Shell"
-#elif defined(_OS_UNIX_)
-#ifdef QWS
-#define _WS_QWS_
-#else
-#define _WS_X11_
-#endif
-#endif
-
-#if defined(_WS_WIN16_) || defined(_WS_WIN32_)
-#define _WS_WIN_
-#endif
-
-
-//
-// Some classes do not permit copies to be made of an object.
-// These classes contains a private copy constructor and operator=
-// to disable copying (the compiler gives an error message).
-// Undefine Q_DISABLE_COPY to turn off this checking.
-//
-
-#define Q_DISABLE_COPY
-
-
-//
-// Useful type definitions for Qt
-//
-
-#if defined(bool)
-#define Q_HAS_BOOL_TYPE
-#elif __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 6)
-#define Q_HAS_BOOL_TYPE
-#elif _MSC_VER >= 1100 || __BORLANDC__ >= 0x500
-#define Q_HAS_BOOL_TYPE
-#elif defined(sgi) && defined(_BOOL)
-#define Q_HAS_BOOL_TYPE
-#endif
-
-#if (QT_VERSION >= 300)
-#error "Use an enum for bool"
-#endif
-
-#if !defined(Q_HAS_BOOL_TYPE)
-#if defined(_CC_MSVC_)
-#define _CC_BOOL_DEF_
-#define bool int
-#else
-typedef int bool;
-#endif
-#endif
-
-typedef unsigned char uchar;
-typedef unsigned short ushort;
-typedef unsigned uint;
-typedef unsigned long ulong;
-typedef char *pchar;
-typedef uchar *puchar;
-typedef const char *pcchar;
-#if defined(_OS_WIN32_) && !defined(_CC_GNU_)
-typedef __int64 int64;
-typedef unsigned __int64 uint64;
-#else
-#if !defined(_OS_AIX_) || !defined(_H_INTTYPES)
-typedef long long int64;
-#endif
-typedef unsigned long long uint64;
-#endif
-
-
-//
-// Constant bool values
-//
-
-#ifndef TRUE
-const bool FALSE = 0;
-const bool TRUE = !0;
-#endif
-
-
-#if defined(_CC_MSVC_)
-// Workaround for static const members.
-#define QT_STATIC_CONST static
-#define QT_STATIC_CONST_IMPL
-#else
-#define QT_STATIC_CONST static const
-#define QT_STATIC_CONST_IMPL const
-#endif
-
-
-
-//
-// Utility macros and inline functions
-//
-
-#define QMAX(a,b) ((a) > (b) ? (a) : (b))
-#define QMIN(a,b) ((a) < (b) ? (a) : (b))
-#define QABS(a) ((a) >= 0 ? (a) : -(a))
-
-inline int qRound( double d )
-{
- return d > 0.0 ? int(d+0.5) : int(d-0.5);
-}
-
-
-//
-// Size-dependent types (architecture-dependent byte order)
-//
-
-// QT_CLEAN_NAMESPACE is not defined by default; it would break too
-// much code.
-#if !defined(QT_CLEAN_NAMESPACE)
-typedef signed char INT8; // 8 bit signed
-typedef unsigned char UINT8; // 8 bit unsigned
-typedef short INT16; // 16 bit signed
-typedef unsigned short UINT16; // 16 bit unsigned
-typedef int INT32; // 32 bit signed
-typedef unsigned int UINT32; // 32 bit unsigned
-#endif
-
-typedef signed char Q_INT8; // 8 bit signed
-typedef unsigned char Q_UINT8; // 8 bit unsigned
-typedef short Q_INT16; // 16 bit signed
-typedef unsigned short Q_UINT16; // 16 bit unsigned
-typedef int Q_INT32; // 32 bit signed
-typedef unsigned int Q_UINT32; // 32 bit unsigned
-typedef long Q_INT64; // up to 64 bit signed
-typedef unsigned long Q_UINT64; // up to 64 bit unsigned
-
-//
-// Data stream functions is provided by many classes (defined in qdatastream.h)
-//
-
-class QDataStream;
-
-
-
-#ifdef _WS_WIN_
-extern bool qt_winunicode;
-#endif
-
-#ifndef QT_H
-#include <qfeatures.h>
-#endif // QT_H
-
-//
-// Create Qt DLL if QT_DLL is defined (Windows only)
-//
-
-#if defined(_OS_WIN32_)
-#if defined(QT_NODLL)
-#undef QT_MAKEDLL
-#undef QT_DLL
-#endif
-#ifdef QT_DLL
-#if defined(QT_MAKEDLL) /* create a Qt DLL library */
-#undef QT_DLL
-#define Q_EXPORT __declspec(dllexport)
-#define Q_TEMPLATEDLL
-#undef Q_DISABLE_COPY /* avoid unresolved externals */
-#endif
-#endif
-#if defined(QT_DLL) /* use a Qt DLL library */
-#define Q_EXPORT __declspec(dllimport)
-#define Q_TEMPLATEDLL
-#undef Q_DISABLE_COPY /* avoid unresolved externals */
-#endif
-#else // ! _OS_WIN32_
-#undef QT_MAKEDLL /* ignore these for other platforms */
-#undef QT_DLL
-#endif
-
-#ifndef Q_EXPORT
-#define Q_EXPORT
-#endif
-
-//
-// System information
-//
-
-Q_EXPORT const char *qVersion();
-Q_EXPORT bool qSysInfo( int *wordSize, bool *bigEndian );
-
-
-//
-// Debugging and error handling
-//
-
-#if !defined(NO_CHECK)
-#define CHECK_STATE // check state of objects etc.
-#define CHECK_RANGE // check range of indexes etc.
-#define CHECK_NULL // check null pointers
-#define CHECK_MATH // check math functions
-#endif
-
-#if !defined(NO_DEBUG) && !defined(DEBUG)
-#define DEBUG // display debug messages
-#endif
-
-//
-// Avoid some particularly useless warnings from some stupid compilers.
-// To get ALL C++ compiler warnings, define CC_WARNINGS or comment out
-// the line "#define Q_NO_WARNINGS"
-//
-
-#if !defined(CC_WARNINGS)
-#define Q_NO_WARNINGS
-#endif
-#if defined(Q_NO_WARNINGS)
-#if defined(_CC_MSVC_)
-#pragma warning(disable: 4244)
-#pragma warning(disable: 4275)
-#pragma warning(disable: 4514)
-#pragma warning(disable: 4097)
-#pragma warning(disable: 4706)
-#elif defined(_CC_BOR_)
-#pragma option -w-inl
-#pragma option -w-aus
-#pragma warn -inl
-#pragma warn -pia
-#pragma warn -ccc
-#pragma warn -rch
-#pragma warn -sig
-#elif defined(_CC_MWERKS_)
-#pragma warn_possunwant off
-#endif
-#endif // Q_NO_WARNINGS
-
-//
-// Avoid dead code
-//
-
-#if defined(_CC_EDG_) || defined(_CC_WAT_)
-#define Q_NO_DEAD_CODE
-#endif
-
-//
-// Use to avoid "unused parameter" warnings
-//
-
-#define Q_UNUSED(x) x=x;
-#define Q_CONST_UNUSED(x) (void)x;
-
-Q_EXPORT void qDebug( const char *, ... ) // print debug message
-#if defined(_CC_GNU_) && !defined(__INSURE__)
- __attribute__ ((format (printf, 1, 2)))
-#endif
-;
-
-Q_EXPORT void qWarning( const char *, ... ) // print warning message
-#if defined(_CC_GNU_) && !defined(__INSURE__)
- __attribute__ ((format (printf, 1, 2)))
-#endif
-;
-
-Q_EXPORT void qFatal( const char *, ... ) // print fatal message and exit
-#if defined(_CC_GNU_)
- __attribute__ ((format (printf, 1, 2)))
-#endif
-;
-
-
-// QT_CLEAN_NAMESPACE is not defined by default; it would break too
-// much code.
-#if !defined(QT_CLEAN_NAMESPACE)
-// in that case, also define the old ones...
-
-Q_EXPORT void debug( const char *, ... ) // print debug message
-#if defined(_CC_GNU_) && !defined(__INSURE__)
- __attribute__ ((format (printf, 1, 2)))
-#endif
-;
-
-Q_EXPORT void warning( const char *, ... ) // print warning message
-#if defined(_CC_GNU_) && !defined(__INSURE__)
- __attribute__ ((format (printf, 1, 2)))
-#endif
-;
-
-Q_EXPORT void fatal( const char *, ... ) // print fatal message and exit
-#if defined(_CC_GNU_) && !defined(__INSURE__)
- __attribute__ ((format (printf, 1, 2)))
-#endif
-;
-
-// okay, that was debug()/warning()/fatal()
-#endif
-
-#if !defined(ASSERT)
-#if defined(CHECK_STATE)
-#if defined(QT_FATAL_ASSERT)
-#define ASSERT(x) if ( !(x) )\
- qFatal("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__)
-#else
-#define ASSERT(x) if ( !(x) )\
- qWarning("ASSERT: \"%s\" in %s (%d)",#x,__FILE__,__LINE__)
-#endif
-#else
-#define ASSERT(x)
-#endif
-#endif
-
-Q_EXPORT bool qt_check_pointer( bool c, const char *, int );
-
-#if defined(CHECK_NULL)
-#define CHECK_PTR(p) (qt_check_pointer((p)==0,__FILE__,__LINE__))
-#else
-#define CHECK_PTR(p)
-#endif
-
-enum QtMsgType { QtDebugMsg, QtWarningMsg, QtFatalMsg };
-
-typedef void (*msg_handler)(QtMsgType, const char *);
-Q_EXPORT msg_handler qInstallMsgHandler( msg_handler );
-
-
-Q_EXPORT void qSuppressObsoleteWarnings( bool = TRUE );
-
-#if !defined(QT_REJECT_OBSOLETE)
-#define QT_OBSOLETE
-Q_EXPORT void qObsolete( const char *obj, const char *oldfunc,
- const char *newfunc );
-Q_EXPORT void qObsolete( const char *obj, const char *oldfunc );
-Q_EXPORT void qObsolete( const char *message );
-#endif
-
-// DvH: added to avoid warnings on recent gcc versions
-#define Q_DELETING_VOID_UNDEFINED
-
-#endif // QGLOBAL_H
diff --git a/qtools/qgstring.cpp b/qtools/qgstring.cpp
deleted file mode 100644
index 8b15675..0000000
--- a/qtools/qgstring.cpp
+++ /dev/null
@@ -1,258 +0,0 @@
-/******************************************************************************
- *
- * Copyright (C) 1997-2004 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 <stdio.h>
-#include "qgstring.h"
-
-#include <assert.h>
-
-#define BLOCK_SIZE 64
-#define ROUND_SIZE(x) ((x)+BLOCK_SIZE-1)&~(BLOCK_SIZE-1)
-
-#define DBG_STR(x) do { } while(0)
-//#define DBG_STR(x) printf x
-
-QGString::QGString() // make null string
- : m_data(0), m_len(0), m_memSize(0)
-{
- DBG_STR(("%p: QGString::QGString() %d:%s\n",this,m_len,m_data?m_data:"<none>"));
-}
-
-QGString::QGString(uint size)
-{
- if (size==0)
- {
- m_data=0;
- m_len=0;
- }
- else
- {
- m_memSize = ROUND_SIZE(size+1);
- m_data = (char*)malloc(m_memSize);
- memset(m_data,' ',size);
- m_data[size]='\0';
- m_len=size;
- }
- DBG_STR(("%p: QGString::QGString(uint size=%d) %d:%s\n",
- this,size,m_len,m_data?m_data:"<none>"));
-}
-
-QGString::QGString( const QGString &s )
-{
- if (s.m_memSize==0)
- {
- m_data = 0;
- m_len = 0;
- m_memSize = 0;
- }
- else
- {
- m_data = (char *)malloc(s.m_memSize);
- m_len = s.m_len;
- m_memSize = s.m_memSize;
- qstrcpy(m_data,s.m_data);
- }
- DBG_STR(("%p: QGString::QGString(const QGString &) %d:%s\n",this,m_len,m_data?m_data:"<none>"));
-}
-
-QGString::QGString( const char *str )
-{
- if (str==0)
- {
- m_data=0;
- m_len=0;
- m_memSize=0;
- }
- else
- {
- m_len = qstrlen(str);
- m_memSize = ROUND_SIZE(m_len+1);
- assert(m_memSize>=m_len+1);
- m_data = (char *)malloc(m_memSize);
- qstrcpy(m_data,str);
- }
- DBG_STR(("%p: QGString::QGString(const char *) %d:%s\n",this,m_len,m_data?m_data:"<none>"));
-}
-
-QGString::~QGString()
-{
- free(m_data);
- m_data=0;
- DBG_STR(("%p: QGString::~QGString() %d:%s\n",this,m_len,m_data?m_data:"<none>"));
-}
-
-bool QGString::resize( uint newlen )
-{
- m_len = 0;
- if (newlen==0)
- {
- if (m_data) { free(m_data); m_data=0; }
- m_memSize=0;
- DBG_STR(("%p: 1.QGString::resize() %d:%s\n",this,m_len,m_data?m_data:"<none>"));
- return TRUE;
- }
- m_memSize = ROUND_SIZE(newlen+1);
- assert(m_memSize>=newlen+1);
- if (m_data==0)
- {
- m_data = (char *)malloc(m_memSize);
- }
- else
- {
- m_data = (char *)realloc(m_data,m_memSize);
- }
- if (m_data==0)
- {
- DBG_STR(("%p: 2.QGString::resize() %d:%s\n",this,m_len,m_data?m_data:"<none>"));
- return FALSE;
- }
- m_data[newlen]='\0';
- m_len = qstrlen(m_data);
- DBG_STR(("%p: 3.QGString::resize() %d:%s\n",this,m_len,m_data?m_data:"<none>"));
- return TRUE;
-}
-
-bool QGString::enlarge( uint newlen )
-{
- if (newlen==0)
- {
- if (m_data) { free(m_data); m_data=0; }
- m_memSize=0;
- m_len=0;
- return TRUE;
- }
- uint newMemSize = ROUND_SIZE(newlen+1);
- if (newMemSize==m_memSize) return TRUE;
- m_memSize = newMemSize;
- if (m_data==0)
- {
- m_data = (char *)malloc(m_memSize);
- }
- else
- {
- m_data = (char *)realloc(m_data,m_memSize);
- }
- if (m_data==0)
- {
- return FALSE;
- }
- m_data[newlen-1]='\0';
- if (m_len>newlen) m_len=newlen;
- return TRUE;
-}
-
-void QGString::setLen( uint newlen )
-{
- m_len = newlen<=m_memSize ? newlen : m_memSize;
-}
-
-QGString &QGString::operator=( const QGString &s )
-{
- if (m_data) free(m_data);
- if (s.m_memSize==0) // null string
- {
- m_data = 0;
- m_len = 0;
- m_memSize = 0;
- }
- else
- {
- m_len = s.m_len;
- m_memSize = s.m_memSize;
- m_data = (char*)malloc(m_memSize);
- qstrcpy(m_data,s.m_data);
- }
- DBG_STR(("%p: QGString::operator=(const QGString &%p) %d:%s\n",
- this,&s,m_len,m_data?m_data:"<none>"));
- return *this;
-}
-
-QGString &QGString::operator=( const char *str )
-{
- if (m_data) free(m_data);
- if (str==0) // null string
- {
- m_data = 0;
- m_len = 0;
- m_memSize = 0;
- }
- else
- {
- m_len = qstrlen(str);
- m_memSize = ROUND_SIZE(m_len+1);
- assert(m_memSize>=m_len+1);
- m_data = (char*)malloc(m_memSize);
- qstrcpy(m_data,str);
- }
- DBG_STR(("%p: QGString::operator=(const char *) %d:%s\n",this,m_len,m_data?m_data:"<none>"));
- return *this;
-}
-
-QGString &QGString::operator+=( const QGString &s )
-{
- if (s.m_memSize==0) return *this;
- uint len1 = length();
- uint len2 = s.length();
- uint memSize = ROUND_SIZE(len1 + len2 + 1);
- assert(memSize>=len1+len2+1);
- char *newData = memSize!=m_memSize ? (char*)realloc( m_data, memSize ) : m_data;
- m_memSize = memSize;
- if (newData)
- {
- m_data = newData;
- memcpy( m_data + len1, s, len2 + 1 );
- }
- m_len = len1+len2;
- DBG_STR(("%p: QGString::operator+=(const QGString &) %d:%s\n",this,m_len,m_data?m_data:"<none>"));
- return *this;
-}
-
-QGString &QGString::operator+=( const char *str )
-{
- if (!str) return *this;
- uint len1 = length();
- uint len2 = qstrlen(str);
- uint memSize = ROUND_SIZE(len1 + len2 + 1);
- assert(memSize>=len1+len2+1);
- char *newData = memSize!=m_memSize ? (char *)realloc( m_data, memSize ) : m_data;
- m_memSize = memSize;
- if (newData)
- {
- m_data = newData;
- memcpy( m_data + len1, str, len2 + 1 );
- }
- m_len+=len2;
- DBG_STR(("%p: QGString::operator+=(const char *) %d:%s\n",this,m_len,m_data?m_data:"<none>"));
- return *this;
-}
-
-QGString &QGString::operator+=( char c )
-{
- uint len = m_len;
- uint memSize = ROUND_SIZE(len+2);
- assert(memSize>=len+2);
- char *newData = memSize!=m_memSize ? (char *)realloc( m_data, memSize ) : m_data;
- m_memSize = memSize;
- if (newData)
- {
- m_data = newData;
- m_data[len] = c;
- m_data[len+1] = '\0';
- }
- m_len++;
- DBG_STR(("%p: QGString::operator+=(char s) %d:%s\n",this,m_len,m_data?m_data:"<none>"));
- return *this;
-}
-
diff --git a/qtools/qgstring.h b/qtools/qgstring.h
deleted file mode 100644
index 0af1045..0000000
--- a/qtools/qgstring.h
+++ /dev/null
@@ -1,139 +0,0 @@
-#ifndef QGSTRING_H
-#define QGSTRING_H
-
-#include <stdlib.h>
-#include <string.h>
-
-#if defined(_OS_SUN_) && defined(_CC_GNU_)
-#include <strings.h>
-#endif
-
-#include "qcstring.h"
-
-/*****************************************************************************
- Fixes and workarounds for some platforms
- *****************************************************************************/
-
-/** This is an alternative implementation of QCString.
- */
-class QGString
-{
- public:
- QGString(); // make null string
- QGString(uint size);
- QGString( const QGString &s );
- QGString( const char *str );
- ~QGString() ;
-
- bool resize( uint newlen );
- bool enlarge( uint newlen );
- void setLen( uint newlen );
-
- QGString &operator=( const QGString &s );
- QGString &operator=( const char *str );
- QGString &operator+=( const QGString &s );
- QGString &operator+=( const char *str );
- QGString &operator+=( char c );
-
- bool isNull() const { return m_data==0; }
- bool isEmpty() const { return m_len==0; }
- uint length() const { return m_len; }
- uint size() const { return m_memSize; }
- char * data() const { return m_data; }
- bool truncate( uint pos ) { return resize(pos+1); }
- operator const char *() const { return (const char *)data(); }
- char &at( uint index ) const { return m_data[index]; }
- char &operator[]( uint i ) const { return at(i); }
-
- private:
- char * m_data;
- uint m_len;
- uint m_memSize;
-};
-
-/*****************************************************************************
- QGString non-member operators
- *****************************************************************************/
-
-Q_EXPORT inline bool operator==( const QGString &s1, const QGString &s2 )
-{ return qstrcmp(s1.data(),s2.data()) == 0; }
-
-Q_EXPORT inline bool operator==( const QGString &s1, const char *s2 )
-{ return qstrcmp(s1.data(),s2) == 0; }
-
-Q_EXPORT inline bool operator==( const char *s1, const QGString &s2 )
-{ return qstrcmp(s1,s2.data()) == 0; }
-
-Q_EXPORT inline bool operator!=( const QGString &s1, const QGString &s2 )
-{ return qstrcmp(s1.data(),s2.data()) != 0; }
-
-Q_EXPORT inline bool operator!=( const QGString &s1, const char *s2 )
-{ return qstrcmp(s1.data(),s2) != 0; }
-
-Q_EXPORT inline bool operator!=( const char *s1, const QGString &s2 )
-{ return qstrcmp(s1,s2.data()) != 0; }
-
-Q_EXPORT inline bool operator<( const QGString &s1, const QGString& s2 )
-{ return qstrcmp(s1.data(),s2.data()) < 0; }
-
-Q_EXPORT inline bool operator<( const QGString &s1, const char *s2 )
-{ return qstrcmp(s1.data(),s2) < 0; }
-
-Q_EXPORT inline bool operator<( const char *s1, const QGString &s2 )
-{ return qstrcmp(s1,s2.data()) < 0; }
-
-Q_EXPORT inline bool operator<=( const QGString &s1, const char *s2 )
-{ return qstrcmp(s1.data(),s2) <= 0; }
-
-Q_EXPORT inline bool operator<=( const char *s1, const QGString &s2 )
-{ return qstrcmp(s1,s2.data()) <= 0; }
-
-Q_EXPORT inline bool operator>( const QGString &s1, const char *s2 )
-{ return qstrcmp(s1.data(),s2) > 0; }
-
-Q_EXPORT inline bool operator>( const char *s1, const QGString &s2 )
-{ return qstrcmp(s1,s2.data()) > 0; }
-
-Q_EXPORT inline bool operator>=( const QGString &s1, const char *s2 )
-{ return qstrcmp(s1.data(),s2) >= 0; }
-
-Q_EXPORT inline bool operator>=( const char *s1, const QGString &s2 )
-{ return qstrcmp(s1,s2.data()) >= 0; }
-
-Q_EXPORT inline QGString operator+( const QGString &s1, const QGString &s2 )
-{
- QGString tmp( s1.data() );
- tmp += s2;
- return tmp;
-}
-
-Q_EXPORT inline QGString operator+( const QGString &s1, const char *s2 )
-{
- QGString tmp( s1.data() );
- tmp += s2;
- return tmp;
-}
-
-Q_EXPORT inline QGString operator+( const char *s1, const QGString &s2 )
-{
- QGString tmp( s1 );
- tmp += s2;
- return tmp;
-}
-
-Q_EXPORT inline QGString operator+( const QGString &s1, char c2 )
-{
- QGString tmp( s1.data() );
- tmp += c2;
- return tmp;
-}
-
-Q_EXPORT inline QGString operator+( char c1, const QGString &s2 )
-{
- QGString tmp;
- tmp += c1;
- tmp += s2;
- return tmp;
-}
-
-#endif // QGSTRING_H
diff --git a/qtools/qintdict.doc b/qtools/qintdict.doc
deleted file mode 100644
index 90625da..0000000
--- a/qtools/qintdict.doc
+++ /dev/null
@@ -1,475 +0,0 @@
-/****************************************************************************
-**
-**
-** QIntDict and QIntDictIterator class documentation
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-
-/*****************************************************************************
- QIntDict documentation
- *****************************************************************************/
-
-/*!
- \class QIntDict qintdict.h
- \brief The QIntDict class is a template class that provides a dictionary based on \c long keys.
-
- \ingroup collection
- \ingroup tools
-
- QIntDict is implemented as a template class. Define a
- template instance QIntDict\<X\> to create a dictionary that operates on
- pointers to X, or X*.
-
- A dictionary is a collection that associates an item with a key.
- The key is used for inserting and looking up an item. QIntDict has
- \c long keys.
-
- The dictionary has very fast insertion and lookup.
-
- Example:
- \code
- #include <qintdict.h>
- #include <stdio.h>
-
- void main()
- {
- QIntDict<char> dict; // maps long ==> char*
-
- dict.insert( 33, "France" );
- dict.insert( 7, "Russia" );
- dict.insert( 49, "Norway" );
-
- printf( "%s\n", dict[49] );
- printf( "%s\n", dict[33] );
- printf( "%s\n", dict[7] );
-
- if ( !dict[39] )
- printf( "39 not defined\n" );
- }
- \endcode
-
- Program output:
- \code
- Norway
- France
- Russia
- 39 not defined
- \endcode
-
- The dictionary in our example maps \c long keys to \c char* items.
- QIntDict implements the \link operator[] [] operator\endlink to lookup
- an item.
-
- QIntDict is implemented by QGDict as a hash array with a fixed number of
- entries. Each array entry points to a singly linked list of buckets, in
- which the dictionary items are stored.
-
- When an item is inserted with a key, the key is converted (hashed) to
- an integer index into the hash array using the \c mod operation. The
- item is inserted before the first bucket in the list of buckets.
-
- Looking up an item is normally very fast. The key is again hashed to an
- array index. Then QIntDict scans the list of buckets and returns the item
- found or null if the item was not found. You cannot insert null pointers
- into a dictionary.
-
- The size of the hash array is very important. In order to get good
- performance, you should use a suitably large \link primes.html prime
- number\endlink. Suitable means equal to or larger than the maximum
- expected number of dictionary items.
-
- Items with equal keys are allowed. When inserting two items with the
- same key, only the last inserted item will be visible (last in, first out)
- until it is removed.
-
- Example:
- \code
- #include <qintdict.h>
- #include <stdio.h>
-
- void main()
- {
- QIntDict<char> dict; // maps long ==> char*
-
- dict.insert( 7, "Russia" );
- dict.insert( 7, "USSR" );
-
- printf( "%s\n", dict[7] );
- dict.remove( 7 ); // Gorbie was here
- printf( "%s\n", dict[7] );
- }
- \endcode
-
- Program output:
- \code
- USSR
- Russia
- \endcode
-
- The QIntDictIterator class can traverse the dictionary contents, but only
- in an arbitrary order. Multiple iterators may independently traverse the
- same dictionary.
-
- Calling setAutoDelete(TRUE) for a dictionary tells it to delete items
- that are removed . The default is to not delete items when they are
- removed.
-
- When inserting an item into a dictionary, only the pointer is copied, not
- the item itself. This is called a shallow copy. It is possible to make the
- dictionary copy all of the item's data (known as a deep copy) when an
- item is inserted. insert() calls the virtual function
- QCollection::newItem() for the item to be inserted.
- Inherit a dictionary and reimplement it if you want deep copies.
-
- When removing a dictionary item, the virtual function
- QCollection::deleteItem() is called. QIntDict's default implementation
- is to delete the item if auto-deletion is enabled.
-
- \sa QIntDictIterator, QDict, QAsciiDict, QPtrDict,
- \link collection.html Collection Classes\endlink
-*/
-
-
-/*!
- \fn QIntDict::QIntDict( int size )
- Constructs a dictionary using an internal hash array with the size
- \e size.
-
- Setting \e size to a suitably large \link primes.html prime number\endlink
- (equal to or greater than the expected number of entries) makes the hash
- distribution better and hence the lookup faster.
-*/
-
-/*!
- \fn QIntDict::QIntDict( const QIntDict<type> &dict )
- Constructs a copy of \e dict.
-
- Each item in \e dict are inserted into this dictionary.
- Only the pointers are copied (shallow copy).
-*/
-
-/*!
- \fn QIntDict::~QIntDict()
- Removes all items from the dictionary and destroys it.
-
- All iterators that access this dictionary will be reset.
-
- \sa setAutoDelete()
-*/
-
-/*!
- \fn QIntDict<type> &QIntDict::operator=(const QIntDict<type> &dict)
- Assigns \e dict to this dictionary and returns a reference to this
- dictionary.
-
- This dictionary is first cleared, then each item in \e dict is inserted
- into this dictionary.
- Only the pointers are copied (shallow copy), unless newItem() has been
- reimplemented.
-*/
-
-/*!
- \fn uint QIntDict::count() const
- Returns the number of items in the dictionary.
- \sa isEmpty()
-*/
-
-/*!
- \fn uint QIntDict::size() const
- Returns the size of the internal hash array (as specified in the
- constructor).
- \sa count()
-*/
-
-/*!
- \fn void QIntDict::resize( uint newsize )
- Changes the size of the hashtable the \a newsize.
- The contents of the dictionary are preserved,
- but all iterators on the dictionary become invalid.
-*/
-
-/*!
- \fn bool QIntDict::isEmpty() const
- Returns TRUE if the dictionary is empty, i.e. count() == 0. Returns FALSE
- otherwise.
- \sa count()
-*/
-
-/*!
- \fn void QIntDict::insert( long key, const type *item )
- Inserts the \e key with the \e item into the dictionary.
-
- The key does not have to be a unique dictionary key. If multiple items
- are inserted with the same key, only the last item will be visible.
-
- Null items are not allowed.
-
- \sa replace()
-*/
-
-/*!
- \fn void QIntDict::replace( long key, const type *item )
- Replaces an item which has a key equal to \e key with \e item.
-
- If the item does not already exist, it will be inserted.
-
- Null items are not allowed.
-
- Equivalent to:
- \code
- QIntDict<char> dict;
- ...
- if ( dict.find(key) )
- dict.remove( key );
- dict.insert( key, item );
- \endcode
-
- If there are two or more items with equal keys, then the last inserted
- of these will be replaced.
-
- \sa insert()
-*/
-
-/*!
- \fn bool QIntDict::remove( long key )
- Removes the item associated with \e key from the dictionary.
- Returns TRUE if successful, or FALSE if the key does not exist in the
- dictionary.
-
- If there are two or more items with equal keys, then the last inserted
- of these will be removed.
-
- The removed item is deleted if \link QCollection::setAutoDelete()
- auto-deletion\endlink is enabled.
-
- All dictionary iterators that refer to the removed item will be set to
- point to the next item in the dictionary traversing order.
-
- \sa take(), clear(), setAutoDelete()
-*/
-
-/*!
- \fn type *QIntDict::take( long key )
- Takes the item associated with \e key out of the dictionary without
- deleting it (even if \link QCollection::setAutoDelete()
- auto-deletion\endlink is enabled).
-
- If there are two or more items with equal keys, then the last inserted
- of these will be taken.
-
- Returns a pointer to the item taken out, or null if the key does not
- exist in the dictionary.
-
- All dictionary iterators that refer to the taken item will be set to
- point to the next item in the dictionary traversing order.
-
- \sa remove(), clear(), setAutoDelete()
-*/
-
-/*!
- \fn void QIntDict::clear()
- Removes all items from the dictionary.
-
- The removed items are deleted if \link QCollection::setAutoDelete()
- auto-deletion\endlink is enabled.
-
- All dictionary iterators that access this dictionary will be reset.
-
- \sa remove(), take(), setAutoDelete()
-*/
-
-/*!
- \fn type *QIntDict::find( long key ) const
- Returns the item associated with \e key, or null if the key does not
- exist in the dictionary.
-
- This function uses an internal hashing algorithm to optimize lookup.
-
- If there are two or more items with equal keys, then the last inserted
- of these will be found.
-
- Equivalent to the [] operator.
-
- \sa operator[]()
-*/
-
-/*!
- \fn type *QIntDict::operator[]( long key ) const
- Returns the item associated with \e key, or null if the key does not
- exist in the dictionary.
-
- This function uses an internal hashing algorithm to optimize lookup.
-
- If there are two or more items with equal keys, then the last inserted
- of these will be found.
-
- Equivalent to the find() function.
-
- \sa find()
-*/
-
-/*!
- \fn void QIntDict::statistics() const
- Debugging-only function that prints out the dictionary distribution
- using qDebug().
-*/
-
-
-/*****************************************************************************
- QIntDictIterator documentation
- *****************************************************************************/
-
-/*!
- \class QIntDictIterator qintdict.h
- \brief The QIntDictIterator class provides an iterator for QIntDict collections.
-
- \ingroup collection
- \ingroup tools
-
- QIntDictIterator is implemented as a template class.
- Define a template instance QIntDictIterator\<X\> to create a
- dictionary iterator that operates on QIntDict\<X\> (dictionary of X*).
-
- Example:
- \code
- #include <qintdict.h>
- #include <stdio.h>
-
- void main()
- {
- QIntDict<char> dict; // maps long ==> char*
-
- dict.insert( 33, "France" );
- dict.insert( 7, "Russia" );
- dict.insert( 49, "Norway" );
-
- QIntDictIterator<char> it( dict ); // iterator for dict
-
- while ( it.current() ) {
- printf( "%d -> %s\n", it.currentKey(), it.current() );
- ++it;
- }
- }
- \endcode
-
- Program output:
- \code
- 7 -> Russia
- 49 -> Norway
- 33 -> France
- \endcode
-
- Note that the traversal order is arbitrary, you are not guaranteed the
- order above.
-
- Multiple iterators may independently traverse the same dictionary.
- A QIntDict knows about all iterators that are operating on the dictionary.
- When an item is removed from the dictionary, QIntDict update all
- iterators that are referring the removed item to point to the next item
- in the traversing order.
-
- \sa QIntDict, \link collection.html Collection Classes\endlink
-*/
-
-/*!
- \fn QIntDictIterator::QIntDictIterator( const QIntDict<type> &dict )
- Constructs an iterator for \e dict. The current iterator item is
- set to point on the first item in the \e dict.
-*/
-
-/*!
- \fn QIntDictIterator::~QIntDictIterator()
- Destroys the iterator.
-*/
-
-/*!
- \fn uint QIntDictIterator::count() const
- Returns the number of items in the dictionary this iterator operates on.
- \sa isEmpty()
-*/
-
-/*!
- \fn bool QIntDictIterator::isEmpty() const
- Returns TRUE if the dictionary is empty, i.e. count() == 0. Returns FALSE
- otherwise.
- \sa count()
-*/
-
-/*!
- \fn type *QIntDictIterator::toFirst()
- Sets the current iterator item to point to the first item in the
- dictionary and returns a pointer to the item.
- If the dictionary is empty it sets the current item to null and
- returns null.
-*/
-
-/*!
- \fn QIntDictIterator::operator type *() const
- Cast operator. Returns a pointer to the current iterator item.
- Same as current().
-*/
-
-/*!
- \fn type *QIntDictIterator::current() const
- Returns a pointer to the current iterator item.
-*/
-
-/*!
- \fn long QIntDictIterator::currentKey() const
- Returns the key for the current iterator item.
-*/
-
-/*!
- \fn type *QIntDictIterator::operator()()
- Makes the succeeding item current and returns the original current item.
-
- If the current iterator item was the last item in the dictionary or if it
- was null, null is returned.
-*/
-
-/*!
- \fn type *QIntDictIterator::operator++()
- Prefix ++ makes the succeeding item current and returns the new current
- item.
-
- If the current iterator item was the last item in the dictionary or if it
- was null, null is returned.
-*/
-
-/*!
- \fn type *QIntDictIterator::operator+=( uint jump )
- Sets the current item to the item \e jump positions after the current item,
- and returns a pointer to that item.
-
- If that item is beyond the last item or if the dictionary is empty,
- it sets the current item to null and returns null.
-*/
diff --git a/qtools/qintdict.h b/qtools/qintdict.h
deleted file mode 100644
index 0606ec8..0000000
--- a/qtools/qintdict.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QIntDict template class
-**
-** Created : 940624
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QINTDICT_H
-#define QINTDICT_H
-
-#ifndef QT_H
-#include "qgdict.h"
-#endif // QT_H
-
-
-template<class type> class Q_EXPORT QIntDict : public QGDict
-{
-public:
- QIntDict(uint size=17) : QGDict(size,IntKey,0,0) {}
- QIntDict( const QIntDict<type> &d ) : QGDict(d) {}
- ~QIntDict() { clear(); }
- QIntDict<type> &operator=(const QIntDict<type> &d)
- { return (QIntDict<type>&)QGDict::operator=(d); }
- uint count() const { return QGDict::count(); }
- uint size() const { return QGDict::size(); }
- bool isEmpty() const { return QGDict::count() == 0; }
- void insert( long k, const type *d )
- { QGDict::look_int(k,(Item)d,1); }
- void replace( long k, const type *d )
- { QGDict::look_int(k,(Item)d,2); }
- bool remove( long k ) { return QGDict::remove_int(k); }
- type *take( long k ) { return (type*)QGDict::take_int(k); }
- type *find( long k ) const
- { return (type *)((QGDict*)this)->QGDict::look_int(k,0,0); }
- type *operator[]( long k ) const
- { return (type *)((QGDict*)this)->QGDict::look_int(k,0,0); }
- void clear() { QGDict::clear(); }
- void resize( uint n ) { QGDict::resize(n); }
- void statistics() const { QGDict::statistics(); }
-private:
- void deleteItem( Item d );
-};
-
-#if defined(Q_DELETING_VOID_UNDEFINED)
-template<> inline void QIntDict<void>::deleteItem( QCollection::Item )
-{
-}
-#endif
-
-template<class type> inline void QIntDict<type>::deleteItem( QCollection::Item d )
-{
- if ( del_item ) delete (type *)d;
-}
-
-template<class type> class Q_EXPORT QIntDictIterator : public QGDictIterator
-{
-public:
- QIntDictIterator(const QIntDict<type> &d) :QGDictIterator((QGDict &)d) {}
- ~QIntDictIterator() {}
- uint count() const { return dict->count(); }
- bool isEmpty() const { return dict->count() == 0; }
- type *toFirst() { return (type *)QGDictIterator::toFirst(); }
- operator type *() const { return (type *)QGDictIterator::get(); }
- type *current() const { return (type *)QGDictIterator::get(); }
- long currentKey() const { return QGDictIterator::getKeyInt(); }
- type *operator()() { return (type *)QGDictIterator::operator()(); }
- type *operator++() { return (type *)QGDictIterator::operator++(); }
- type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j);}
-};
-
-
-#endif // QINTDICT_H
diff --git a/qtools/qinternallist.h b/qtools/qinternallist.h
deleted file mode 100644
index b1cc64e..0000000
--- a/qtools/qinternallist.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QList template/macro class
-**
-** Created : 920701
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QINTERNALLIST_H
-#define QINTERNALLIST_H
-
-#ifndef QT_H
-#include "qglist.h"
-#endif // QT_H
-
-
-template<class type> class Q_EXPORT QInternalList : public QGList
-{
-public:
- QInternalList() {}
- QInternalList( const QInternalList<type> &l ) : QGList(l) {}
- ~QInternalList() { clear(); }
- QInternalList<type> &operator=(const QInternalList<type> &l)
- { return (QInternalList<type>&)QGList::operator=(l); }
- bool operator==( const QInternalList<type> &list ) const
- { return QGList::operator==( list ); }
- uint count() const { return QGList::count(); }
- bool isEmpty() const { return QGList::count() == 0; }
- bool insert( uint i, const type *d){ return QGList::insertAt(i,(QCollection::Item)d); }
- void inSort( const type *d ) { QGList::inSort((QCollection::Item)d); }
- void prepend( const type *d ) { QGList::insertAt(0,(QCollection::Item)d); }
- void append( const type *d ) { QGList::append((QCollection::Item)d); }
- bool remove( uint i ) { return QGList::removeAt(i); }
- bool remove() { return QGList::remove((QCollection::Item)0); }
- bool remove( const type *d ) { return QGList::remove((QCollection::Item)d); }
- bool removeRef( const type *d ) { return QGList::removeRef((QCollection::Item)d); }
- void removeNode( QLNode *n ) { QGList::removeNode(n); }
- bool removeFirst() { return QGList::removeFirst(); }
- bool removeLast() { return QGList::removeLast(); }
- type *take( uint i ) { return (type *)QGList::takeAt(i); }
- type *take() { return (type *)QGList::take(); }
- type *takeNode( QLNode *n ) { return (type *)QGList::takeNode(n); }
- void clear() { QGList::clear(); }
- void sort() { QGList::sort(); }
- int find( const type *d ) { return QGList::find((QCollection::Item)d); }
- int findNext( const type *d ) { return QGList::find((QCollection::Item)d,FALSE); }
- int findRef( const type *d ) { return QGList::findRef((QCollection::Item)d); }
- int findNextRef( const type *d ){ return QGList::findRef((QCollection::Item)d,FALSE);}
- uint contains( const type *d ) const { return QGList::contains((QCollection::Item)d); }
- uint containsRef( const type *d ) const
- { return QGList::containsRef((QCollection::Item)d); }
- type *at( uint i ) { return (type *)QGList::at(i); }
- int at() const { return QGList::at(); }
- type *current() const { return (type *)QGList::get(); }
- QLNode *currentNode() const { return QGList::currentNode(); }
- type *getFirst() const { return (type *)QGList::cfirst(); }
- type *getLast() const { return (type *)QGList::clast(); }
- type *first() { return (type *)QGList::first(); }
- type *last() { return (type *)QGList::last(); }
- type *next() { return (type *)QGList::next(); }
- type *prev() { return (type *)QGList::prev(); }
-private:
- void deleteItem( QCollection::Item d );
-};
-
-#if defined(Q_DELETING_VOID_UNDEFINED)
-template<> inline void QInternalList<void>::deleteItem( QCollection::Item )
-{
-}
-#endif
-
-template<class type> inline void QInternalList<type>::deleteItem( QCollection::Item d )
-{
- if ( del_item ) delete (type *)d;
-}
-
-
-template<class type> class Q_EXPORT QInternalListIterator : public QGListIterator
-{
-public:
- QInternalListIterator(const QInternalList<type> &l) :QGListIterator((QGList &)l) {}
- ~QInternalListIterator() {}
- uint count() const { return list->count(); }
- bool isEmpty() const { return list->count() == 0; }
- bool atFirst() const { return QGListIterator::atFirst(); }
- bool atLast() const { return QGListIterator::atLast(); }
- type *toFirst() { return (type *)QGListIterator::toFirst(); }
- type *toLast() { return (type *)QGListIterator::toLast(); }
- operator type *() const { return (type *)QGListIterator::get(); }
- type *operator*() { return (type *)QGListIterator::get(); }
-
- // No good, since QList<char> (ie. QStrList fails...
- //
- // MSVC++ gives warning
- // Sunpro C++ 4.1 gives error
- // type *operator->() { return (type *)QGListIterator::get(); }
-
- type *current() const { return (type *)QGListIterator::get(); }
- type *operator()() { return (type *)QGListIterator::operator()();}
- type *operator++() { return (type *)QGListIterator::operator++(); }
- type *operator+=(uint j) { return (type *)QGListIterator::operator+=(j);}
- type *operator--() { return (type *)QGListIterator::operator--(); }
- type *operator-=(uint j) { return (type *)QGListIterator::operator-=(j);}
- QInternalListIterator<type>& operator=(const QInternalListIterator<type>&it)
- { QGListIterator::operator=(it); return *this; }
-};
-
-
-#endif // QINTERNALLIST_H
diff --git a/qtools/qiodevice.cpp b/qtools/qiodevice.cpp
deleted file mode 100644
index b52475c..0000000
--- a/qtools/qiodevice.cpp
+++ /dev/null
@@ -1,638 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QIODevice class
-**
-** Created : 940913
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qiodevice.h"
-
-// NOT REVISED
-/*!
- \class QIODevice qiodevice.h
-
- \brief The QIODevice class is the base class of I/O devices.
-
- \ingroup io
-
- An I/O device represents a medium that one can read bytes from
- and/or write bytes to. The QIODevice class is the abstract
- superclass of all such devices; classes like QFile, QBuffer and
- QSocket inherit QIODevice and implement virtual functions like
- write() appropriately.
-
- While applications sometimes use QIODevice directly, mostly it is
- better to go through QTextStream and QDataStream, which provide
- stream operations on any QIODevice subclass. QTextStream provides
- text-oriented stream functionality (for human-readable ASCII files,
- for example), while QDataStream deals with binary data in a totally
- platform-independent manner.
-
- The public member functions in QIODevice roughly fall into two
- groups: The action functions and the state access functions. The
- most important action functions are: <ul>
-
- <li> open() opens a device for reading and/or writing, depending on
- the argument to open().
-
- <li> close() closes the device and tidies up.
-
- <li> readBlock() reads a block of data from the device.
-
- <li> writeBlock() writes a block of data to the device.
-
- <li> readLine() reads a line (of text, usually) from the device.
-
- <li> flush() ensures that all buffered data are written to the real device.
-
- </ul>There are also some other, less used, action functions: <ul>
-
- <li> getch() reads a single character.
-
- <li> ungetch() forgets the last call to getch(), if possible.
-
- <li> putch() writes a single character.
-
- <li> size() returns the size of the device, if there is one.
-
- <li> at() returns the current read/write pointer, if there is one
- for this device, or it moves the pointer.
-
- <li> atEnd() says whether there is more to read, if that is a
- meaningful question for this device.
-
- <li> reset() moves the read/write pointer to the start of the
- device, if that is possible for this device.
-
- </ul>The state access are all "get" functions. The QIODevice subclass
- calls setState() to update the state, and simple access functions
- tell the user of the device what the device's state is. Here are
- the settings, and their associated access functions: <ul>
-
- <li> Access type. Some devices are direct access (it is possible to
- read/write anywhere) while others are sequential. QIODevice
- provides the access functions isDirectAccess(), isSequentialAccess()
- and isCombinedAccess() to tell users what a given I/O device
- supports.
-
- <li> Buffering. Some devices are accessed in raw mode while others
- are buffered. Buffering usually provides greater efficiency,
- particularly for small read/write operations. isBuffered() tells
- the user whether a given device is buffered. (This can often be set
- by the application in the call to open().)
-
- <li> Synchronicity. Synchronous devices work there and then, for
- example files. When you read from a file, the file delivers its
- data right away. Others, such as a socket connected to a HTTP
- server, may not deliver the data until seconds after you ask to read
- it. isSynchronous() and isAsynchronous() tells the user how this
- device operates.
-
- <li> CR/LF translation. For simplicity, applications often like to
- see just a single CR/LF style, and QIODevice subclasses can provide
- that. isTranslated() returns TRUE if this object translates CR/LF
- to just LF. (This can often be set by the application in the call
- to open().)
-
- <li> Accessibility. Some files cannot be written, for example.
- isReadable(), isWritable and isReadWrite() tells the application
- whether it can read from and write to a given device. (This can
- often be set by the application in the call to open().)
-
- <li> Finally, isOpen() returns TRUE if the device is open. This can
- quite obviously be set using open() :)
-
- </ul>
-
- QIODevice provides numerous pure virtual functions you need to
- implement when subclassing it. Here is a skeleton subclass with all
- the members you are certain to need, and some it's likely that you
- will need:
-
- \code
- class YourDevice : public QIODevice
- {
- public:
- YourDevice();
- ~YourDevice();
-
- bool open( int mode );
- void close();
- void flush();
-
- uint size() const;
- int at() const; // not a pure virtual function
- bool at( int ); // not a pure virtual function
- bool atEnd() const; // not a pure virtual function
-
- int readBlock( char *data, uint maxlen );
- int writeBlock( const char *data, uint len );
- int readLine( char *data, uint maxlen );
-
- int getch();
- int putch( int );
- int ungetch( int );
- };
- \endcode
-
- The three non-pure virtual functions can be ignored if your device
- is sequential (e.g. an RS-232 port).
-
- \sa QDataStream, QTextStream
-*/
-
-
-/*!
- Constructs an I/O device.
-*/
-
-QIODevice::QIODevice()
-{
- ioMode = 0; // initial mode
- ioSt = IO_Ok;
- ioIndex = 0;
-}
-
-/*!
- Destructs the I/O device.
-*/
-
-QIODevice::~QIODevice()
-{
-}
-
-
-/*!
- \fn int QIODevice::flags() const
- Returns the current I/O device flags setting.
-
- Flags consists of mode flags and state flags.
-
- \sa mode(), state()
-*/
-
-/*!
- \fn int QIODevice::mode() const
- Returns bits OR'ed together that specify the current operation mode.
-
- These are the flags that were given to the open() function.
-
- The flags are: \c IO_ReadOnly, \c IO_WriteOnly, \c IO_ReadWrite,
- \c IO_Append, \c IO_Truncate and \c IO_Translate.
-*/
-
-/*!
- \fn int QIODevice::state() const
- Returns bits OR'ed together that specify the current state.
-
- The flags are: \c IO_Open.
-
- Subclasses may define more flags.
-*/
-
-/*!
- \fn bool QIODevice::isDirectAccess() const
- Returns TRUE if the I/O device is a direct access (not sequential) device,
- otherwise FALSE.
- \sa isSequentialAccess()
-*/
-
-/*!
- \fn bool QIODevice::isSequentialAccess() const
- Returns TRUE if the I/O device is a sequential access (not direct) device,
- otherwise FALSE. Operations involving size() and at(int) are not valid
- on sequential devices.
- \sa isDirectAccess()
-*/
-
-/*!
- \fn bool QIODevice::isCombinedAccess() const
- Returns TRUE if the I/O device is a combined access (both direct and
- sequential) device, otherwise FALSE.
-
- This access method is currently not in use.
-*/
-
-/*!
- \fn bool QIODevice::isBuffered() const
- Returns TRUE if the I/O device is a buffered (not raw) device, otherwise
- FALSE.
- \sa isRaw()
-*/
-
-/*!
- \fn bool QIODevice::isRaw() const
- Returns TRUE if the I/O device is a raw (not buffered) device, otherwise
- FALSE.
- \sa isBuffered()
-*/
-
-/*!
- \fn bool QIODevice::isSynchronous() const
- Returns TRUE if the I/O device is a synchronous device, otherwise
- FALSE.
- \sa isAsynchronous()
-*/
-
-/*!
- \fn bool QIODevice::isAsynchronous() const
- Returns TRUE if the I/O device is a asynchronous device, otherwise
- FALSE.
-
- This mode is currently not in use.
-
- \sa isSynchronous()
-*/
-
-/*!
- \fn bool QIODevice::isTranslated() const
- Returns TRUE if the I/O device translates carriage-return and linefeed
- characters.
-
- A QFile is translated if it is opened with the \c IO_Translate mode
- flag.
-*/
-
-/*!
- \fn bool QIODevice::isReadable() const
- Returns TRUE if the I/O device was opened using \c IO_ReadOnly or
- \c IO_ReadWrite mode.
- \sa isWritable(), isReadWrite()
-*/
-
-/*!
- \fn bool QIODevice::isWritable() const
- Returns TRUE if the I/O device was opened using \c IO_WriteOnly or
- \c IO_ReadWrite mode.
- \sa isReadable(), isReadWrite()
-*/
-
-/*!
- \fn bool QIODevice::isReadWrite() const
- Returns TRUE if the I/O device was opened using \c IO_ReadWrite mode.
- \sa isReadable(), isWritable()
-*/
-
-/*!
- \fn bool QIODevice::isInactive() const
- Returns TRUE if the I/O device state is 0, i.e. the device is not open.
- \sa isOpen()
-*/
-
-/*!
- \fn bool QIODevice::isOpen() const
- Returns TRUE if the I/O device state has been opened, otherwise FALSE.
- \sa isInactive()
-*/
-
-
-/*!
- \fn int QIODevice::status() const
- Returns the I/O device status.
-
- The I/O device status returns an error code. If open() returns FALSE
- or readBlock() or writeBlock() return -1, this function can be called to
- get the reason why the operation did not succeed.
-
- The status codes are:
- <ul>
- <li>\c IO_Ok The operation was successful.
- <li>\c IO_ReadError Could not read from the device.
- <li>\c IO_WriteError Could not write to the device.
- <li>\c IO_FatalError A fatal unrecoverable error occurred.
- <li>\c IO_OpenError Could not open the device.
- <li>\c IO_ConnectError Could not connect to the device.
- <li>\c IO_AbortError The operation was unexpectedly aborted.
- <li>\c IO_TimeOutError The operation timed out.
- <li>\c IO_OnCloseError An unspecified error happened on close.
- </ul>
-
- \sa resetStatus()
-*/
-
-/*!
- \fn void QIODevice::resetStatus()
-
- Sets the I/O device status to \c IO_Ok.
-
- \sa status()
-*/
-
-
-/*!
- \fn void QIODevice::setFlags( int f )
- \internal
- Used by subclasses to set the device flags.
-*/
-
-/*!
- \internal
- Used by subclasses to set the device type.
-*/
-
-void QIODevice::setType( int t )
-{
-#if defined(CHECK_RANGE)
- if ( (t & IO_TypeMask) != t )
- qWarning( "QIODevice::setType: Specified type out of range" );
-#endif
- ioMode &= ~IO_TypeMask; // reset type bits
- ioMode |= t;
-}
-
-/*!
- \internal
- Used by subclasses to set the device mode.
-*/
-
-void QIODevice::setMode( int m )
-{
-#if defined(CHECK_RANGE)
- if ( (m & IO_ModeMask) != m )
- qWarning( "QIODevice::setMode: Specified mode out of range" );
-#endif
- ioMode &= ~IO_ModeMask; // reset mode bits
- ioMode |= m;
-}
-
-/*!
- \internal
- Used by subclasses to set the device state.
-*/
-
-void QIODevice::setState( int s )
-{
-#if defined(CHECK_RANGE)
- if ( ((uint)s & IO_StateMask) != (uint)s )
- qWarning( "QIODevice::setState: Specified state out of range" );
-#endif
- ioMode &= ~IO_StateMask; // reset state bits
- ioMode |= (uint)s;
-}
-
-/*!
- \internal
- Used by subclasses to set the device status (not state).
-*/
-
-void QIODevice::setStatus( int s )
-{
- ioSt = s;
-}
-
-
-/*!
- \fn bool QIODevice::open( int mode )
- Opens the I/O device using the specified \e mode.
- Returns TRUE if successful, or FALSE if the device could not be opened.
-
- The mode parameter \e m must be a combination of the following flags.
- <ul>
- <li>\c IO_Raw specified raw (unbuffered) file access.
- <li>\c IO_ReadOnly opens a file in read-only mode.
- <li>\c IO_WriteOnly opens a file in write-only mode.
- <li>\c IO_ReadWrite opens a file in read/write mode.
- <li>\c IO_Append sets the file index to the end of the file.
- <li>\c IO_Truncate truncates the file.
- <li>\c IO_Translate enables carriage returns and linefeed translation
- for text files under MS-DOS, Window, OS/2 and Macintosh. On Unix systems
- this flag has no effect. Use with caution as it will also transform every linefeed
- written to the file into a CRLF pair. This is likely to corrupt your file when
- writing binary data to it. Cannot be combined with \c IO_Raw.
- </ul>
-
- This virtual function must be reimplemented by all subclasses.
-
- \sa close()
-*/
-
-/*!
- \fn void QIODevice::close()
- Closes the I/O device.
-
- This virtual function must be reimplemented by all subclasses.
-
- \sa open()
-*/
-
-/*!
- \fn void QIODevice::flush()
-
- Flushes an open I/O device.
-
- This virtual function must be reimplemented by all subclasses.
-*/
-
-
-/*!
- \fn uint QIODevice::size() const
- Virtual function that returns the size of the I/O device.
- \sa at()
-*/
-
-/*!
- Virtual function that returns the current I/O device index.
-
- This index is the data read/write head of the I/O device.
-
- \sa size()
-*/
-
-int QIODevice::at() const
-{
- return ioIndex;
-}
-
-/*!
- Virtual function that sets the I/O device index to \e pos.
- \sa size()
-*/
-
-bool QIODevice::at( int pos )
-{
-#if defined(CHECK_RANGE)
- if ( (uint)pos > size() ) {
- qWarning( "QIODevice::at: Index %d out of range", pos );
- return FALSE;
- }
-#endif
- ioIndex = pos;
- return TRUE;
-}
-
-/*!
- Virtual function that returns TRUE if the I/O device index is at the
- end of the input.
-*/
-
-bool QIODevice::atEnd() const
-{
- if ( isSequentialAccess() || isTranslated() ) {
- QIODevice* that = (QIODevice*)this;
- int c = that->getch();
- bool result = c < 0;
- that->ungetch(c);
- return result;
- } else {
- return at() == (int)size();
- }
-}
-
-/*!
- \fn bool QIODevice::reset()
- Sets the device index to 0.
- \sa at()
-*/
-
-
-/*!
- \fn int QIODevice::readBlock( char *data, uint maxlen )
- Reads at most \e maxlen bytes from the I/O device into \e data and
- returns the number of bytes actually read.
-
- This virtual function must be reimplemented by all subclasses.
-
- \sa writeBlock()
-*/
-
-/*!
- This convenience function returns all of the remaining data in the
- device. Note that this only works for direct access devices, such
- as QFile.
-
- \sa isDirectAccess()
-*/
-QByteArray QIODevice::readAll()
-{
- int n = size()-at();
- QByteArray ba(size()-at());
- char* c = ba.data();
- while ( n ) {
- int r = readBlock( c, n );
- if ( r < 0 )
- return QByteArray();
- n -= r;
- c += r;
- }
- return ba;
-}
-
-/*!
- \fn int QIODevice::writeBlock( const char *data, uint len )
- Writes \e len bytes from \e p to the I/O device and returns the number of
- bytes actually written.
-
- This virtual function must be reimplemented by all subclasses.
-
- \sa readBlock()
-*/
-
-/*!
- This convenience function is the same as calling
- writeBlock( data.data(), data.size() ).
-*/
-int QIODevice::writeBlock( const QByteArray& data )
-{
- return writeBlock( data.data(), data.size() );
-}
-
-/*!
- Reads a line of text, up to \e maxlen bytes including a terminating
- \0. If there is a newline at the end if the line, it is not stripped.
-
- Returns the number of bytes read, or -1 in case of error.
-
- This virtual function can be reimplemented much more efficiently by
- the most subclasses.
-
- \sa readBlock(), QTextStream::readLine()
-*/
-
-int QIODevice::readLine( char *data, uint maxlen )
-{
- if ( maxlen == 0 ) // application bug?
- return 0;
- int pos = at(); // get current position
- int s = (int)size(); // size of I/O device
- char *p = data;
- if ( pos >= s )
- return 0;
- while ( pos++ < s && --maxlen ) { // read one byte at a time
- readBlock( p, 1 );
- if ( *p++ == '\n' ) // end of line
- break;
- }
- *p++ = '\0';
- return (int)((intptr_t)p - (intptr_t)data);
-}
-
-
-/*!
- \fn int QIODevice::getch()
-
- Reads a single byte/character from the I/O device.
-
- Returns the byte/character read, or -1 if the end of the I/O device has been
- reached.
-
- This virtual function must be reimplemented by all subclasses.
-
- \sa putch(), ungetch()
-*/
-
-/*!
- \fn int QIODevice::putch( int ch )
-
- Writes the character \e ch to the I/O device.
-
- Returns \e ch, or -1 if some error occurred.
-
- This virtual function must be reimplemented by all subclasses.
-
- \sa getch(), ungetch()
-*/
-
-/*!
- \fn int QIODevice::ungetch( int ch )
-
- Puts the character \e ch back into the I/O device and decrements the
- index if it is not zero.
-
- This function is normally called to "undo" a getch() operation.
-
- Returns \e ch, or -1 if some error occurred.
-
- This virtual function must be reimplemented by all subclasses.
-
- \sa getch(), putch()
-*/
diff --git a/qtools/qiodevice.h b/qtools/qiodevice.h
deleted file mode 100644
index 1c54217..0000000
--- a/qtools/qiodevice.h
+++ /dev/null
@@ -1,155 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QIODevice class
-**
-** Created : 940913
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QIODEVICE_H
-#define QIODEVICE_H
-
-#ifndef QT_H
-#include "qglobal.h"
-#include "qcstring.h"
-#endif // QT_H
-
-
-// IO device access types
-
-#define IO_Direct 0x0100 // direct access device
-#define IO_Sequential 0x0200 // sequential access device
-#define IO_Combined 0x0300 // combined direct/sequential
-#define IO_TypeMask 0x0f00
-
-// IO handling modes
-
-#define IO_Raw 0x0040 // raw access (not buffered)
-#define IO_Async 0x0080 // asynchronous mode
-
-// IO device open modes
-
-#define IO_ReadOnly 0x0001 // readable device
-#define IO_WriteOnly 0x0002 // writable device
-#define IO_ReadWrite 0x0003 // read+write device
-#define IO_Append 0x0004 // append
-#define IO_Truncate 0x0008 // truncate device
-#define IO_Translate 0x0010 // translate CR+LF
-#define IO_ModeMask 0x00ff
-
-// IO device state
-
-#define IO_Open 0x1000 // device is open
-#define IO_StateMask 0xf000
-
-
-// IO device status
-
-#define IO_Ok 0
-#define IO_ReadError 1 // read error
-#define IO_WriteError 2 // write error
-#define IO_FatalError 3 // fatal unrecoverable error
-#define IO_ResourceError 4 // resource limitation
-#define IO_OpenError 5 // cannot open device
-#define IO_ConnectError 5 // cannot connect to device
-#define IO_AbortError 6 // abort error
-#define IO_TimeOutError 7 // time out
-#define IO_UnspecifiedError 8 // unspecified error
-
-class Q_EXPORT QIODevice // IO device class
-{
-public:
- QIODevice();
- virtual ~QIODevice();
-
- int flags() const { return ioMode; }
- int mode() const { return ioMode & IO_ModeMask; }
- int state() const { return ioMode & IO_StateMask; }
-
- bool isDirectAccess() const { return ((ioMode & IO_Direct) == IO_Direct); }
- bool isSequentialAccess() const { return ((ioMode & IO_Sequential) == IO_Sequential); }
- bool isCombinedAccess() const { return ((ioMode & IO_Combined) == IO_Combined); }
- bool isBuffered() const { return ((ioMode & IO_Raw) != IO_Raw); }
- bool isRaw() const { return ((ioMode & IO_Raw) == IO_Raw); }
- bool isSynchronous() const { return ((ioMode & IO_Async) != IO_Async); }
- bool isAsynchronous() const { return ((ioMode & IO_Async) == IO_Async); }
- bool isTranslated() const { return ((ioMode & IO_Translate) == IO_Translate); }
- bool isReadable() const { return ((ioMode & IO_ReadOnly) == IO_ReadOnly); }
- bool isWritable() const { return ((ioMode & IO_WriteOnly) == IO_WriteOnly); }
- bool isReadWrite() const { return ((ioMode & IO_ReadWrite) == IO_ReadWrite); }
- bool isInactive() const { return state() == 0; }
- bool isOpen() const { return state() == IO_Open; }
-
- int status() const { return ioSt; }
- void resetStatus() { ioSt = IO_Ok; }
-
- virtual bool open( int mode ) = 0;
- virtual void close() = 0;
- virtual void flush() = 0;
-
- virtual uint size() const = 0;
- virtual int at() const;
- virtual bool at( int );
- virtual bool atEnd() const;
- bool reset() { return at(0); }
-
- virtual int readBlock( char *data, uint maxlen ) = 0;
- virtual int writeBlock( const char *data, uint len ) = 0;
- virtual int readLine( char *data, uint maxlen );
- int writeBlock( const QByteArray& data );
- QByteArray readAll();
-
- virtual int getch() = 0;
- virtual int putch( int ) = 0;
- virtual int ungetch( int ) = 0;
-
-protected:
- void setFlags( int f ) { ioMode = f; }
- void setType( int );
- void setMode( int );
- void setState( int );
- void setStatus( int );
- int ioIndex;
-
-private:
- int ioMode;
- int ioSt;
-
-private: // Disabled copy constructor and operator=
-#if defined(Q_DISABLE_COPY)
- QIODevice( const QIODevice & );
- QIODevice &operator=( const QIODevice & );
-#endif
-};
-
-
-#endif // QIODEVICE_H
diff --git a/qtools/qlist.doc b/qtools/qlist.doc
deleted file mode 100644
index d28d662..0000000
--- a/qtools/qlist.doc
+++ /dev/null
@@ -1,1035 +0,0 @@
-/****************************************************************************
-**
-**
-** QList and QListIterator class documentation
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-
-/*****************************************************************************
- QList documentation
- *****************************************************************************/
-
-/*!
- \class QList qlist.h
- \brief The QList class is a template class that provides doubly linked lists.
-
- \ingroup collection
- \ingroup tools
-
- In Qt 2.0 QList is only implemented as a template class. Define a
- template instance QList\<X\> to create a list that operates on pointers
- to X, or X*.
-
- Example:
- \code
- #include <qlist.h>
- #include <qstring.h>
- #include <stdio.h>
-
- class Employee
- {
- public:
- Employee( const QString& name, int salary ) { n=name; s=salary; }
- QString name() const { return n; }
- int salary() const { return s; }
- private:
- QString n;
- int s;
- };
-
- void main()
- {
- QList<Employee> list; // list of pointers to Employee
- list.setAutoDelete( TRUE ); // delete items when they are removed
-
- list.append( new Employee("Bill", 50000) );
- list.append( new Employee("Steve",80000) );
- list.append( new Employee("Ron", 60000) );
-
- Employee *emp;
- for ( emp=list.first(); emp != 0; emp=list.next() )
- printf( "%s earns %d\n", emp->name().latin1(), emp->salary() );
- }
- \endcode
-
- Program output:
- \code
- Bill earns 50000
- Steve earns 80000
- Ron earns 60000
- \endcode
-
- The list class is indexable and has a \link at() current index\endlink
- and a \link current() current item\endlink. The first item corresponds
- to index 0. The current index is -1 if the current item is null.
-
- QList has several member functions for traversing the list, but using
- a QListIterator can be more practical. Multiple list iterators may
- traverse the same list, independent of each other and independent of
- the current list item.
-
- In the example above, we make the call setAutoDelete(TRUE).
- Enabling auto-deletion tells the list to delete items that are removed
- from the list. The default is to not delete items when they are
- removed, but that would cause a memory leak in our example since we have
- no other references to the list items.
-
- List items are stored as \c void* in an internal QLNode, which also
- holds pointers to the next and previous list items. The functions
- currentNode(), removeNode() and takeNode() operate directly on the
- QLNode, but they should be used with care.
-
- When inserting an item into a list, only the pointer is copied, not the
- item itself. This is called a shallow copy. It is possible to make the
- list copy all of the item's data (known as a deep copy) when an item is
- inserted. insert(), inSort() and append() call the virtual function
- QCollection::newItem() for the item to be inserted.
- Inherit a list and reimplement it if you want deep copies.
-
- When removing an item from a list, the virtual function
- QCollection::deleteItem() is called. QList's default implementation
- is to delete the item if auto-deletion is enabled.
-
- The virtual function QGList::compareItems() can be reimplemented to
- compare two list items. This function is called from all list functions
- that need to compare list items, for instance remove(const type*).
- If you only want to deal with pointers, there are functions that
- compare pointers instead, for instance removeRef(const type*).
- These functions are somewhat faster than those that call compareItems().
-
- The QStrList class in qstrlist.h is a list of \c char*. QStrList is
- a good example of a list that reimplements newItem(), deleteItem() and
- compareItems()
-
- \sa QListIterator, \link collection.html Collection Classes\endlink
-*/
-
-
-/*!
- \fn QList::QList()
- Constructs an empty list.
-*/
-
-/*!
- \fn QList::QList( const QList<type> &list )
- Constructs a copy of \e list.
-
- Each item in \e list is \link append() appended\endlink to this list.
- Only the pointers are copied (shallow copy).
-*/
-
-/*!
- \fn QList::~QList()
- Removes all items from the list and destroys the list.
-
- All list iterators that access this list will be reset.
-
- \sa setAutoDelete()
-*/
-
-/*!
- \fn QList<type> &QList::operator=(const QList<type> &list)
- Assigns \e list to this list and returns a reference to this list.
-
- This list is first cleared, then each item in \e list is
- \link append() appended\endlink to this list. Only the pointers are copied
- (shallow copy), unless newItem() has been reimplemented().
-*/
-
-/*!
- \fn bool QList::operator==(const QList<type> &list ) const
-
- Compares this list with \a list. Returns TRUE if the lists
- contain the same data, else FALSE.
-*/
-
-/*!
- \fn uint QList::count() const
- Returns the number of items in the list.
- \sa isEmpty()
-*/
-
-/*!
- \fn void QList::sort()
-
- Sorts the list by the result of the virtual compareItems() function.
-
- The Heap-Sort algorithm is used for sorting. It sorts n items with
- O(n*log n) compares. This is the asymptotic optimal solution of the
- sorting problem.
-
- If the items in your list support operator< and operator== then you
- might be better off with QSortedList since it implements the
- compareItems() function for you using these two operators.
-
- \sa inSort()
-*/
-
-/*!
- \fn bool QList::isEmpty() const
- Returns TRUE if the list is empty, i.e. count() == 0. Returns FALSE
- otherwise.
- \sa count()
-*/
-
-/*!
- \fn bool QList::insert( uint index, const type *item )
- Inserts the \e item at the position \e index in the list.
-
- Returns TRUE if successful, or FALSE if \e index is out of range.
- The valid range is <code>0 .. count()</code> inclusive.
- The item is appended if \e index == count().
-
- The inserted item becomes the current list item.
-
- The \e item must not be a null pointer.
-
- \sa append(), current()
-*/
-
-/*!
- \fn void QList::inSort( const type *item )
- Inserts the \e item at its sorted position in the list.
-
- The sort order depends on the virtual QGList::compareItems() function.
- All items must be inserted with inSort() to maintain the sorting order.
-
- The inserted item becomes the current list item.
-
- The \e item must not be a null pointer.
-
- Please note that inSort is slow. If you want to insert lots of items
- in a list and sort after inserting then you should use sort().
- inSort() takes up to O(n) compares. That means inserting n items in
- your list will need O(n^2) compares while sort() only needs O(n*logn)
- for the same task. So you inSort() only if you already have a pre-sorted
- list and want to insert only few additional items.
-
- \sa insert(), QGList::compareItems(), current(), sort()
-*/
-
-/*!
- \fn void QList::append( const type *item )
- Inserts the \e item at the end of the list.
-
- The inserted item becomes the current list item.
- This is equivalent to \c insert(count(),item).
-
-
- The \e item must not be a null pointer.
-
- \sa insert(), current(), prepend()
-*/
-
-/*!
- \fn void QList::prepend( const type *item )
-
- Inserts the \e item at the start of the list.
-
- The inserted item becomes the current list item.
- This is equivalent to \c insert(0,item).
-
- The \e item must not be a null pointer.
-
- \sa append(), insert(), current()
-*/
-
-/*!
- \fn bool QList::remove( uint index )
- Removes the item at position \e index in the list.
-
- Returns TRUE if successful, or FALSE if \e index is out of range.
- The valid range is <code>0 .. (count() - 1)</code> inclusive.
-
- The removed item is deleted if \link QCollection::setAutoDelete()
- auto-deletion\endlink is enabled.
-
- The item after the removed item becomes the new current list item if
- the removed item is not the last item in the list. If the last item
- is removed, the new last item becomes the current item in Qt 2.x.
- In 3.0, the current item will be set to null. The current item is
- set to null if the list becomes empty.
-
- All list iterators that refer to the removed item will be set to point
- to the new current item.
-
- \sa take(), clear(), setAutoDelete(), current() removeRef()
-*/
-
-/*!
- \fn bool QList::remove()
- Removes the current list item.
-
- Returns TRUE if successful, or FALSE if the current item is null.
-
- The removed item is deleted if \link QCollection::setAutoDelete()
- auto-deletion\endlink is enabled.
-
- The item after the removed item becomes the new current list item if
- the removed item is not the last item in the list. If the last item
- is removed, the new last item becomes the current item in Qt 2.x.
- In 3.0, the current item will be set to null. The current item is
- set to null if the list becomes empty.
-
- All list iterators that refer to the removed item will be set to point
- to the new current item.
-
- \sa take(), clear(), setAutoDelete(), current() removeRef()
-*/
-
-/*!
- \fn bool QList::remove( const type *item )
- Removes the first occurrence of \e item from the list.
-
- Returns TRUE if successful, or FALSE if the item could not be found in the
- list.
-
- The removed item is deleted if \link QCollection::setAutoDelete()
- auto-deletion\endlink is enabled.
-
- The compareItems() function is called when searching for the item
- in the list. If compareItems() is not reimplemented, it is more
- efficient to call removeRef().
-
- The item after the removed item becomes the new current list item if
- the removed item is not the last item in the list. If the last item
- is removed, the new last item becomes the current item in Qt 2.x.
- In 3.0, the current item will be set to null. The current item is
- set to null if the list becomes empty.
-
- All list iterators that refer to the removed item will be set to point
- to the new current item.
-
- \sa removeRef(), take(), clear(), setAutoDelete(), compareItems(), current()
-*/
-
-/*!
- \fn bool QList::removeRef( const type *item )
- Removes the first occurrence of \e item from the list.
-
- Returns TRUE if successful, or FALSE if the item cannot be found in the
- list.
-
- The removed item is deleted if \link QCollection::setAutoDelete()
- auto-deletion\endlink is enabled.
-
- The list is scanned until the pointer \e item is found. It is removed
- if it is found.
-
- Equivalent to:
- \code
- if ( list.findRef(item) != -1 )
- list.remove();
- \endcode
-
- The item after the removed item becomes the new current list item if
- the removed item is not the last item in the list. If the last item
- is removed, the new last item becomes the current item in Qt 2.x.
- In 3.0, the current item will be set to null. The current item is
- set to null if the list becomes empty.
-
- All list iterators that refer to the removed item will be set to point
- to the new current item.
-
- \sa remove(), clear(), setAutoDelete(), current()
-*/
-
-/*!
- \fn void QList::removeNode( QLNode *node )
- Removes the \e node from the list.
-
- This node must exist in the list, otherwise the program may crash.
-
- The removed item is deleted if \link QCollection::setAutoDelete()
- auto-deletion\endlink is enabled.
-
- The first item in the list will become the new current list item.
- The current item is set to null if the list becomes empty.
-
- All list iterators that refer to the removed item will be set to point to
- the item succeeding this item, or the preceding item if the removed item
- was the last item.
-
- \warning Do not call this function unless you are an expert.
-
- \sa takeNode(), currentNode() remove() removeRef()
-*/
-
-/*!
- \fn bool QList::removeFirst()
- Removes the first item from the list.
- Returns TRUE if successful, or FALSE if the list is empty.
-
- The removed item is deleted if \link QCollection::setAutoDelete()
- auto-deletion\endlink is enabled.
-
- The first item in the list becomes the new current list item.
- The current item is set to null if the list becomes empty.
-
- All list iterators that refer to the removed item will be set to point
- to the new current item.
-
- \sa removeLast(), setAutoDelete(), current() remove()
-*/
-
-/*!
- \fn bool QList::removeLast()
- Removes the last item from the list.
- Returns TRUE if successful, or FALSE if the list is empty.
-
- The removed item is deleted if \link QCollection::setAutoDelete()
- auto-deletion\endlink is enabled.
-
- The last item in the list becomes the new current list item.
- The current item is set to null if the list becomes empty.
-
- All list iterators that refer to the removed item will be set to point
- to the new current item.
-
- \sa removeFirst(), setAutoDelete(), current()
-*/
-
-/*!
- \fn type *QList::take( uint index )
- Takes the item at position \e index out of the list without
- deleting it (even if \link QCollection::setAutoDelete()
- auto-deletion\endlink is enabled).
-
- Returns a pointer to the item taken out of the list, or null if
- the index is out of range.
- The valid range is <code>0 .. (count() - 1)</code> inclusive.
-
- The item after the taken item becomes the new current list item if
- the taken item is not the last item in the list. If the last item
- is taken, the new last item becomes the current item in Qt 2.x. In
- 3.0, the current item will be set to null. The current item is set
- to null if the list becomes empty.
-
- All list iterators that refer to the taken item will be set to point to
- the new current item.
-
- \sa remove(), clear(), current()
-*/
-
-/*!
- \fn type *QList::take()
- Takes the current item out of the list without deleting it (even if
- \link QCollection::setAutoDelete() auto-deletion\endlink is enabled).
- Returns a pointer to the item taken out of the list, or null if
- the current item is null.
-
- The item after the taken item becomes the new current list item if
- the taken item is not the last item in the list. If the last item
- is taken, the new last item becomes the current item in Qt 2.x. In
- 3.0, the current item will be set to null. The current item is set
- to null if the list becomes empty.
-
- All list iterators that refer to the taken item will be set to point to
- the new current item.
-
- \sa remove(), clear(), current()
-*/
-
-/*!
- \fn type *QList::takeNode( QLNode *node )
- Takes the \e node out of the list without deleting its item (even if
- \link QCollection::setAutoDelete() auto-deletion\endlink is enabled).
- Returns a pointer to the item taken out of the list.
-
- This node must exist in the list, otherwise the program may crash.
-
- The first item in the list becomes the new current list item.
-
- All list iterators that refer to the taken item will be set to point to
- the item succeeding this item, or the preceding item if the taken item
- was the last item.
-
- \warning Do not call this function unless you are an expert.
-
- \sa removeNode(), currentNode()
-*/
-
-/*!
- \fn void QList::clear()
- Removes all items from the list.
-
- The removed items are deleted if \link QCollection::setAutoDelete()
- auto-deletion\endlink is enabled.
-
- All list iterators that access this list will be reset.
-
- \sa remove(), take(), setAutoDelete()
-*/
-
-/*!
- \fn int QList::find( const type *item )
- Finds the first occurrence of \e item in the list.
-
- If the item is found, the list sets the current item to point to
- the found item and returns the index of this item.
- If the item is not found, the list sets the current item to null,
- the current index to -1 and returns -1.
-
- The compareItems() function is called when searching for the item
- in the list. If compareItems() is not reimplemented, it is more
- efficient to call findRef().
-
- \sa findNext(), findRef(), compareItems(), current()
-*/
-
-/*!
- \fn int QList::findNext( const type *item )
- Finds the next occurrence of \e item in the list, starting from
- the current list item.
-
- If the item is found, the list sets the current item to point to
- the found item and returns the index of this item.
- If the item is not found, the list sets the current item to null,
- the current index to -1 and returns -1.
-
- The compareItems() function is called when searching for the item
- in the list. If compareItems() is not reimplemented, it is more
- efficient to call findNextRef().
-
- \sa find(), findNextRef(), compareItems(), current()
-*/
-
-/*!
- \fn int QList::findRef( const type *item )
- Finds the first occurrence of \e item in the list.
-
- If the item is found, the list sets the current item to point to
- the found item and returns the index of this item.
- If the item is not found, the list sets the current item to null,
- the current index to -1 and returns -1.
-
- Calling this function is must faster than find(), because find()
- compares \e item with each list item using compareItems().
- This function only compares the pointers.
-
- \sa findNextRef(), find(), current()
-*/
-
-/*!
- \fn int QList::findNextRef( const type *item )
- Finds the next occurrence of \e item in the list, starting from the
- current list item.
-
- If the item is found, the list sets the current item to point to
- the found item and returns the index of this item.
- If the item is not found, the list sets the current item to null,
- the current index to -1 and returns -1.
-
- Calling this function is must faster than findNext(), because findNext()
- compares \e item with each list item using compareItems().
- This function only compares the pointers.
-
- \sa findRef(), findNext(), current()
-*/
-
-/*!
- \fn uint QList::contains( const type *item ) const
- Counts and returns the number of occurrences of \e item in the list.
-
- The compareItems() function is called when looking for the \e item
- in the list. If compareItems() is not reimplemented, it is more
- efficient to call containsRef().
-
- Does not affect the current list item.
-
- \sa containsRef(), compareItems()
-*/
-
-/*!
- \fn uint QList::containsRef( const type *item ) const
- Counts and returns the number of occurrences of \e item in the list.
-
- Calling this function is must faster than contains(), because contains()
- compares \e item with each list item using compareItems().
- This function only compares the pointers.
-
- Does not affect the current list item.
-
- \sa contains()
-*/
-
-/*!
- \fn type *QList::at( uint index )
- Returns a pointer to the item at position \e index in the list, or
- null if the index is out of range.
-
- Sets the current list item to this item if \e index is valid.
- The valid range is <code>0 .. (count() - 1)</code> inclusive.
-
- This function is very efficient. It starts scanning from the first
- item, last item or current item, whichever is closest to \e index.
-
- \sa current()
-*/
-
-/*!
- \fn int QList::at() const
- Returns the index of the current list item. The returned value is -1
- if the current item is null.
- \sa current()
-*/
-
-/*!
- \fn type *QList::current() const
- Returns a pointer to the current list item. The current item may be
- null (implies that the current index is -1).
- \sa at()
-*/
-
-/*!
- \fn QLNode *QList::currentNode() const
- Returns a pointer to the current list node.
-
- The node can be kept and removed later using removeNode().
- The advantage is that the item can be removed directly without
- searching the list.
-
- \warning Do not call this function unless you are an expert.
-
- \sa removeNode(), takeNode(), current()
-*/
-
-/*!
- \fn type *QList::getFirst() const
- Returns a pointer to the first item in the list, or null if the
- list is empty.
-
- Does not affect the current list item.
-
- \sa first(), getLast()
-*/
-
-/*!
- \fn type *QList::getLast() const
- Returns a pointer to the last item in the list, or null if the
- list is empty.
-
- Does not affect the current list item.
-
- \sa last(), getFirst()
-*/
-
-/*!
- \fn type *QList::first()
- Returns a pointer to the first item in the list and makes this the
- current list item, or null if the list is empty.
- \sa getFirst(), last(), next(), prev(), current()
-*/
-
-/*!
- \fn type *QList::last()
- Returns a pointer to the last item in the list and makes this the
- current list item, or null if the list is empty.
- \sa getLast(), first(), next(), prev(), current()
-*/
-
-/*!
- \fn type *QList::next()
- Returns a pointer to the item succeeding the current item.
- Returns null if the current item is null or equal to the last item.
-
- Makes the succeeding item current. If the current item before this
- function call was the last item, the current item will be set to null.
- If the current item was null, this function does nothing.
-
- \sa first(), last(), prev(), current()
-*/
-
-/*!
- \fn type *QList::prev()
- Returns a pointer to the item preceding the current item.
- Returns null if the current item is null or equal to the first item.
-
- Makes the preceding item current. If the current item before this
- function call was the first item, the current item will be set to null.
- If the current item was null, this function does nothing.
-
- \sa first(), last(), next(), current()
-*/
-
-/*****************************************************************************
- QListIterator documentation
- *****************************************************************************/
-
-/*!
- \class QListIterator qlist.h
- \brief The QListIterator class provides an iterator for QList collections.
-
- \ingroup collection
- \ingroup tools
-
- Define a template instance QListIterator\<X\> to create a list iterator
- that operates on QList\<X\> (list of X*).
-
- Example:
- \code
- #include <qlist.h>
- #include <qstring.h>
- #include <stdio.h>
-
- class Employee
- {
- public:
- Employee( const char *name, int salary ) { n=name; s=salary; }
- const char *name() const { return n; }
- int salary() const { return s; }
- private:
- QString n;
- int s;
- };
-
- void main()
- {
- QList<Employee> list; // list of pointers to Employee
- list.setAutoDelete( TRUE ); // delete items when they are removed
-
- list.append( new Employee("Bill", 50000) );
- list.append( new Employee("Steve",80000) );
- list.append( new Employee("Ron", 60000) );
-
- QListIterator<Employee> it(list); // iterator for employee list
- for ( ; it.current(); ++it ) {
- Employee *emp = it.current();
- printf( "%s earns %d\n", emp->name().latin1(), emp->salary() );
- }
- }
- \endcode
-
- Program output:
- \code
- Bill earns 50000
- Steve earns 80000
- Ron earns 60000
- \endcode
-
- Although QList has member functions to traverse the doubly linked list
- structure, using a list iterator is a much more robust way of traversing
- the list, because multiple list iterators can operate on the same list,
- independent of each other and independent of the QList's current item.
- An iterator has its own current list item and can get the next and
- previous list items. It can only traverse the list, never modify it.
-
- A QList knows about all list iterators that are operating on the list.
- When an item is removed from the list, the list update all iterators
- that are pointing the removed item to point to the new current list item.
-
- Example:
- \code
- #include <qlist.h>
- #include <qstring.h>
- #include <stdio.h>
-
- class Employee
- {
- ... // same as above
- };
-
- void main()
- {
- QList<Employee> list; // list of pointers to Employee
- list.setAutoDelete( TRUE ); // delete items when they are removed
-
- list.append( new Employee("Bill", 50000) );
- list.append( new Employee("Steve",80000) );
- list.append( new Employee("Ron", 60000) );
-
- QListIterator<Employee> it(list);
-
- list.at( 1 ); // current list item: "Steve"
- it.toLast(); // it: "Ron"
- --it; // it: "Steve"
-
- // Now, both the list and the iterator are referring the same item
-
- list.remove();
- printf( "%s\n", it.current()->name().latin1() );
- }
- \endcode
-
- Program output:
- \code
- Ron
- \endcode
-
- \sa QList, \link collection.html collection classes\endlink
-*/
-
-/*!
- \fn QListIterator::QListIterator( const QList<type> &list )
- Constructs an iterator for \e list. The current iterator item is
- set to point on the first item in the \e list.
-*/
-
-/*!
- \fn QListIterator::~QListIterator()
- Destroys the iterator.
-*/
-
-/*!
- \fn uint QListIterator::count() const
- Returns the number of items in the list this iterator operates on.
- \sa isEmpty()
-*/
-
-/*!
- \fn bool QListIterator::isEmpty() const
- Returns TRUE if the list is empty, i.e. count() == 0, otherwise FALSE.
- \sa count()
-*/
-
-/*!
- \fn bool QListIterator::atFirst() const
- Returns TRUE if the current iterator item is the first list item, otherwise
- FALSE.
- \sa toFirst(), atLast()
-*/
-
-/*!
- \fn bool QListIterator::atLast() const
- Returns TRUE if the current iterator item is the last list item, otherwise
- FALSE.
- \sa toLast(), atFirst()
-*/
-
-/*!
- \fn type *QListIterator::toFirst()
- Sets the current iterator item to point to the first list item and returns
- a pointer to the item. Sets the current item to null and returns null
- if the list is empty.
- \sa toLast(), atFirst()
-*/
-
-/*!
- \fn type *QListIterator::toLast()
- Sets the current iterator item to point to the last list item and returns
- a pointer to the item. Sets the current item to null and returns null
- if the list is empty.
- \sa toFirst(), atLast()
-*/
-
-/*!
- \fn QListIterator::operator type *() const
- Cast operator. Returns a pointer to the current iterator item.
- Same as current().
-*/
-
-/*!
- \fn type *QListIterator::operator*()
- Asterisk operator. Returns a pointer to the current iterator item.
- Same as current().
-*/
-
-/*!
- \fn type *QListIterator::current() const
- Returns a pointer to the current iterator item.
-*/
-
-/*!
- \fn type *QListIterator::operator()()
- Makes the succeeding item current and returns the original current item.
-
- If the current iterator item was the last item in the list or if it was
- null, null is returned.
-*/
-
-/*!
- \fn char *QStrListIterator::operator()()
- Makes the succeeding item current and returns the original current item.
-
- If the current iterator item was the last item in the list or if it was
- null, null is returned.
-*/
-
-/*!
- \fn type *QListIterator::operator++()
- Prefix ++ makes the succeeding item current and returns the new current
- item.
-
- If the current iterator item was the last item in the list or if it was
- null, null is returned.
-*/
-
-/*!
- \fn type *QListIterator::operator+=( uint jump )
- Sets the current item to the item \e jump positions after the current item,
- and returns a pointer to that item.
-
- If that item is beyond the last item or if the dictionary is empty,
- it sets the current item to null and returns null
-*/
-
-/*!
- \fn type *QListIterator::operator--()
- Prefix -- makes the preceding item current and returns the new current
- item.
-
- If the current iterator item was the first item in the list or if it was
- null, null is returned.
-*/
-
-/*!
- \fn type *QListIterator::operator-=( uint jump )
- Returns the item \e jump positions before the current item, or null if
- it is beyond the first item. Makes this the current item.
-*/
-
-/*!
- \fn QListIterator<type>& QListIterator::operator=( const QListIterator<type> &it )
- Assignment. Makes a copy of the iterator \a it and returns a reference
- to this iterator.
-*/
-
-
-/*****************************************************************************
- QStrList documentation
- *****************************************************************************/
-
-//typedef QList<char> QStrList
-
-/*!
- \class QStrList qstrlist.h
- \brief The QStrList class provides a doubly linked list of \c char*.
-
- \ingroup collection
- \ingroup tools
-
- This class is a QList\<char\> instance (a list of char*).
-
- QStrList can make deep or shallow copies of the strings that are inserted.
-
- A deep copy means to allocate space for the string and then copy the string
- data into it. A shallow copy is just a copy of the pointer value and not
- the string data.
-
- The disadvantage with shallow copies is that since a pointer can only
- be deleted once, the program must put all strings in a central place and
- know when it is safe to delete them (i.e. when the strings are no longer
- referenced by other parts of the program). This can make the program
- more complex. The advantage of shallow copies is that shallow copies
- consume far less memory than deep copies. It is also much faster
- to copy a pointer (typically 4 or 8 bytes) than to copy string data.
-
- A QStrList that operates on deep copies will by default turn on
- auto-deletion (see setAutoDelete()). Thus, by default, QStrList will
- deallocate any string copies it allocates.
-
- The virtual compareItems() function is reimplemented and does a case
- sensitive string comparison. The inSort() function will insert
- strings in a sorted order.
-
- The QStrListIterator class is an iterator for QStrList.
-*/
-
-/*!
- \fn QStrList::QStrList( bool deepCopies )
- Constructs an empty list of strings. Will make deep copies of all inserted
- strings if \e deepCopies is TRUE, or uses shallow copies if \e deepCopies
- is FALSE.
-*/
-
-/*!
- \fn QStrList::QStrList( const QStrList &list )
- Constructs a copy of \e list.
-
- If \e list has deep copies, this list will also get deep copies.
- Only the pointers are copied (shallow copy) if the other list does not
- use deep copies.
-*/
-
-/*!
- \fn QStrList::~QStrList()
- Destroys the list. All strings are removed.
-*/
-
-/*!
- \fn QStrList& QStrList::operator=( const QStrList& list )
- Assigns \e list to this list and returns a reference to this list.
-
- If \e list has deep copies, this list will also get deep copies.
- Only the pointers are copied (shallow copy) if the other list does not
- use deep copies.
-*/
-
-
-/*****************************************************************************
- QStrIList documentation
- *****************************************************************************/
-
-/*!
- \class QStrIList qstrlist.h
- \brief The QStrIList class provides a doubly linked list of \c char* with
-case insensitive compare.
-
- \ingroup collection
- \ingroup tools
-
- This class is a QList\<char\> instance (a list of char*).
-
- QStrIList is similar to QStrList except that it is case insensitive.
- The virtual compareItems() function is reimplemented and does a
- case insensitive string comparison.
- The inSort() function will insert strings in a sorted order.
-
- The QStrListIterator class is an iterator for QStrList.
-*/
-
-/*!
- \fn QStrIList::QStrIList( bool deepCopies )
- Constructs a list of strings. Will make deep copies of all inserted
- strings if \e deepCopies is TRUE, or uses shallow copies if \e deepCopies
- is FALSE.
-*/
-
-/*!
- \fn QStrIList::~QStrIList()
- Destroys the list. All strings are removed.
-*/
-
-
-/*****************************************************************************
- QStrListIterator documentation
- *****************************************************************************/
-
-/*!
- \class QStrListIterator qstrlist.h
- \brief The QStrListIterator class is an iterator for the QStrList and QStrIList classes.
-
- \ingroup tools
-
- This class is a QListIterator\<char\> instance.
- It can traverse the strings in the QStrList and QStrIList classes.
-*/
diff --git a/qtools/qlist.h b/qtools/qlist.h
deleted file mode 100644
index eaaa674..0000000
--- a/qtools/qlist.h
+++ /dev/null
@@ -1,158 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QList template/macro class
-**
-** Created : 920701
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-/* This is a stripped version of the original QList, which has been renamed to
- QInternalList. This implementation doesn't expose the current node and index,
- nor direct access to the list nodes.
- This makes it possible to have more constant methods. It also provides
- a typesafe method to compare elements called compareValues() and a typesafe
- methods to create and delete elements called newValue() and deleteValue().
- */
-
-#ifndef QLIST_H
-#define QLIST_H
-
-#ifndef QT_H
-#include "qglist.h"
-#endif // QT_H
-
-
-template<class type> class Q_EXPORT QList : private QGList
-{
-public:
- QList() {}
- QList( const QList<type> &l ) : QGList(l) {}
- ~QList() { clear(); }
- QList<type> &operator=(const QList<type> &l)
- { return (QList<type>&)QGList::operator=(l); }
- bool operator==( const QList<type> &list ) const
- { return QGList::operator==( list ); }
-
- // capacity
- uint count() const { return QGList::count(); }
- bool isEmpty() const { return QGList::count() == 0; }
-
- // modifiers add
- bool insert( uint i, const type *d){ return QGList::insertAt(i,(QCollection::Item)d); }
- void inSort( const type *d ) { QGList::inSort((QCollection::Item)d); }
- void prepend( const type *d ) { QGList::insertAt(0,(QCollection::Item)d); }
- void append( const type *d ) { QGList::append((QCollection::Item)d); }
-
- // modifiers remove
- bool remove( uint i ) { return QGList::removeAt(i); }
- bool remove( const type *d ) { return QGList::remove((QCollection::Item)d); }
- bool removeRef( const type *d ) { return QGList::removeRef((QCollection::Item)d); }
- bool removeFirst() { return QGList::removeFirst(); }
- bool removeLast() { return QGList::removeLast(); }
- type *take( uint i ) { return (type *)QGList::takeAt(i); }
- void clear() { QGList::clear(); }
-
- // operations
- void sort() { QGList::sort(); }
-
- // search
- int find( const type *d ) const { return const_cast<QList<type>*>(this)->QGList::find((QCollection::Item)d); }
- int findRef( const type *d ) const { return const_cast<QList<type>*>(this)->QGList::findRef((QCollection::Item)d); }
- uint contains( const type *d ) const { return QGList::contains((QCollection::Item)d); }
- uint containsRef( const type *d ) const { return QGList::containsRef((QCollection::Item)d); }
-
- // element access
- type *at( uint i ) const { return (type *)const_cast<QList<type>*>(this)->QGList::at(i); }
- type *getFirst() const { return (type *)QGList::cfirst(); }
- type *getLast() const { return (type *)QGList::clast(); }
-
- // ownership
- void setAutoDelete( bool enable ) { QGList::setAutoDelete(enable); }
- bool autoDelete() const { return QGList::autoDelete(); }
-
-private:
- // new to be reimplemented methods
- virtual int compareValues(const type *t1,const type *t2) const
- { return const_cast<QList<type>*>(this)->QGList::compareItems((QCollection::Item)t1,(QCollection::Item)t2); }
- virtual type *newValue(type *item) const
- { return item; }
- virtual void deleteValue(type *item) const
- { if (del_item) delete item; }
-
- // reimplemented methods
- virtual Item newItem( Item item)
- { return (Item)newValue((type*)item); }
- virtual void deleteItem( QCollection::Item item )
- { deleteValue((type *)item); }
- virtual int compareItems(QCollection::Item i1,QCollection::Item i2)
- { return compareValues((const type*)i1,(const type*)i2); }
-};
-
-#if defined(Q_DELETING_VOID_UNDEFINED)
-template<> inline void QList<void>::deleteValue(void *) const
-{
-}
-#endif
-
-
-template<class type> class Q_EXPORT QListIterator : public QGListIterator
-{
-public:
- QListIterator(const QList<type> &l) :QGListIterator((QGList &)l) {}
- ~QListIterator() {}
- uint count() const { return list->count(); }
- bool isEmpty() const { return list->count() == 0; }
- bool atFirst() const { return QGListIterator::atFirst(); }
- bool atLast() const { return QGListIterator::atLast(); }
- type *toFirst() { return (type *)QGListIterator::toFirst(); }
- type *toLast() { return (type *)QGListIterator::toLast(); }
- operator type *() const { return (type *)QGListIterator::get(); }
- type *operator*() { return (type *)QGListIterator::get(); }
-
- // No good, since QList<char> (ie. QStrList fails...
- //
- // MSVC++ gives warning
- // Sunpro C++ 4.1 gives error
- // type *operator->() { return (type *)QGListIterator::get(); }
-
- type *current() const { return (type *)QGListIterator::get(); }
- type *operator()() { return (type *)QGListIterator::operator()();}
- type *operator++() { return (type *)QGListIterator::operator++(); }
- type *operator+=(uint j) { return (type *)QGListIterator::operator+=(j);}
- type *operator--() { return (type *)QGListIterator::operator--(); }
- type *operator-=(uint j) { return (type *)QGListIterator::operator-=(j);}
- QListIterator<type>& operator=(const QListIterator<type>&it)
- { QGListIterator::operator=(it); return *this; }
-};
-
-
-#endif // QLIST_H
diff --git a/qtools/qmap.cpp b/qtools/qmap.cpp
deleted file mode 100644
index 1d2510a..0000000
--- a/qtools/qmap.cpp
+++ /dev/null
@@ -1,254 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QMap
-**
-** Created : 990406
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qmap.h"
-
-typedef QMapNodeBase* NodePtr;
-typedef QMapNodeBase Node;
-
-
-void QMapPrivateBase::rotateLeft( NodePtr x, NodePtr& root)
-{
- NodePtr y = x->right;
- x->right = y->left;
- if (y->left !=0)
- y->left->parent = x;
- y->parent = x->parent;
- if (x == root)
- root = y;
- else if (x == x->parent->left)
- x->parent->left = y;
- else
- x->parent->right = y;
- y->left = x;
- x->parent = y;
-}
-
-
-void QMapPrivateBase::rotateRight( NodePtr x, NodePtr& root )
-{
- NodePtr y = x->left;
- x->left = y->right;
- if (y->right != 0)
- y->right->parent = x;
- y->parent = x->parent;
- if (x == root)
- root = y;
- else if (x == x->parent->right)
- x->parent->right = y;
- else
- x->parent->left = y;
- y->right = x;
- x->parent = y;
-}
-
-
-void QMapPrivateBase::rebalance( NodePtr x, NodePtr& root)
-{
- x->color = Node::Red;
- while ( x != root && x->parent->color == Node::Red ) {
- if ( x->parent == x->parent->parent->left ) {
- NodePtr y = x->parent->parent->right;
- if (y && y->color == Node::Red) {
- x->parent->color = Node::Black;
- y->color = Node::Black;
- x->parent->parent->color = Node::Red;
- x = x->parent->parent;
- } else {
- if (x == x->parent->right) {
- x = x->parent;
- rotateLeft( x, root );
- }
- x->parent->color = Node::Black;
- x->parent->parent->color = Node::Red;
- rotateRight (x->parent->parent, root );
- }
- } else {
- NodePtr y = x->parent->parent->left;
- if ( y && y->color == Node::Red ) {
- x->parent->color = Node::Black;
- y->color = Node::Black;
- x->parent->parent->color = Node::Red;
- x = x->parent->parent;
- } else {
- if (x == x->parent->left) {
- x = x->parent;
- rotateRight( x, root );
- }
- x->parent->color = Node::Black;
- x->parent->parent->color = Node::Red;
- rotateLeft( x->parent->parent, root );
- }
- }
- }
- root->color = Node::Black;
-}
-
-
-NodePtr QMapPrivateBase::removeAndRebalance( NodePtr z, NodePtr& root,
- NodePtr& leftmost,
- NodePtr& rightmost )
-{
- NodePtr y = z;
- NodePtr x;
- NodePtr x_parent;
- if (y->left == 0) {
- x = y->right;
- } else {
- if (y->right == 0)
- x = y->left;
- else
- {
- y = y->right;
- while (y->left != 0)
- y = y->left;
- x = y->right;
- }
- }
- if (y != z) {
- z->left->parent = y;
- y->left = z->left;
- if (y != z->right) {
- x_parent = y->parent;
- if (x)
- x->parent = y->parent;
- y->parent->left = x;
- y->right = z->right;
- z->right->parent = y;
- } else {
- x_parent = y;
- }
- if (root == z)
- root = y;
- else if (z->parent->left == z)
- z->parent->left = y;
- else
- z->parent->right = y;
- y->parent = z->parent;
- // Swap the colors
- Node::Color c = y->color;
- y->color = z->color;
- z->color = c;
- y = z;
- } else {
- x_parent = y->parent;
- if (x)
- x->parent = y->parent;
- if (root == z)
- root = x;
- else if (z->parent->left == z)
- z->parent->left = x;
- else
- z->parent->right = x;
- if ( leftmost == z ) {
- if (z->right == 0)
- leftmost = z->parent;
- else
- leftmost = x->minimum();
- }
- if (rightmost == z) {
- if (z->left == 0)
- rightmost = z->parent;
- else
- rightmost = x->maximum();
- }
- }
- if (y->color != Node::Red) {
- while (x != root && (x == 0 || x->color == Node::Black)) {
- if (x == x_parent->left) {
- NodePtr w = x_parent->right;
- if (w->color == Node::Red) {
- w->color = Node::Black;
- x_parent->color = Node::Red;
- rotateLeft(x_parent, root);
- w = x_parent->right;
- }
- if ((w->left == 0 || w->left->color == Node::Black) &&
- (w->right == 0 || w->right->color == Node::Black)) {
- w->color = Node::Red;
- x = x_parent;
- x_parent = x_parent->parent;
- } else {
- if (w->right == 0 || w->right->color == Node::Black) {
- if (w->left)
- w->left->color = Node::Black;
- w->color = Node::Red;
- rotateRight(w, root);
- w = x_parent->right;
- }
- w->color = x_parent->color;
- x_parent->color = Node::Black;
- if (w->right)
- w->right->color = Node::Black;
- rotateLeft(x_parent, root);
- break;
- }
- } else {
- NodePtr w = x_parent->left;
- if (w->color == Node::Red) {
- w->color = Node::Black;
- x_parent->color = Node::Red;
- rotateRight(x_parent, root);
- w = x_parent->left;
- }
- if ((w->right == 0 || w->right->color == Node::Black) &&
- (w->left == 0 || w->left->color == Node::Black)) {
- w->color = Node::Red;
- x = x_parent;
- x_parent = x_parent->parent;
- } else {
- if (w->left == 0 || w->left->color == Node::Black) {
- if (w->right)
- w->right->color = Node::Black;
- w->color = Node::Red;
- rotateLeft(w, root);
- w = x_parent->left;
- }
- w->color = x_parent->color;
- x_parent->color = Node::Black;
- if (w->left)
- w->left->color = Node::Black;
- rotateRight(x_parent, root);
- break;
- }
- }
- }
- if (x)
- x->color = Node::Black;
- }
- return y;
-}
diff --git a/qtools/qmap.h b/qtools/qmap.h
deleted file mode 100644
index 0031e0d..0000000
--- a/qtools/qmap.h
+++ /dev/null
@@ -1,607 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QMap class
-**
-** Created : 990406
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QMAP_H
-#define QMAP_H
-
-#ifndef QT_H
-#include "qshared.h"
-#include "qdatastream.h"
-#endif // QT_H
-
-
-struct QMapNodeBase
-{
- enum Color { Red, Black };
-
- QMapNodeBase* left;
- QMapNodeBase* right;
- QMapNodeBase* parent;
-
- Color color;
-
- QMapNodeBase* minimum() {
- QMapNodeBase* x = this;
- while ( x->left )
- x = x->left;
- return x;
- }
-
- QMapNodeBase* maximum() {
- QMapNodeBase* x = this;
- while ( x->right )
- x = x->right;
- return x;
- }
-};
-
-
-template <class K, class T>
-struct QMapNode : public QMapNodeBase
-{
- QMapNode( const K& _key, const T& _data ) { data = _data; key = _key; }
- QMapNode( const K& _key ) { key = _key; }
- QMapNode( const QMapNode<K,T>& _n ) { key = _n.key; data = _n.data; }
- QMapNode() { }
- T data;
- K key;
-};
-
-
-template<class K, class T>
-class Q_EXPORT QMapIterator
-{
- public:
- /**
- * Typedefs
- */
- typedef QMapNode< K, T >* NodePtr;
-
- /**
- * Variables
- */
- QMapNode<K,T>* node;
-
- /**
- * Functions
- */
- QMapIterator() : node( 0 ) {}
- QMapIterator( QMapNode<K,T>* p ) : node( p ) {}
- QMapIterator( const QMapIterator<K,T>& it ) : node( it.node ) {}
- QMapIterator &operator=(const QMapIterator &it) = default;
-
- bool operator==( const QMapIterator<K,T>& it ) const { return node == it.node; }
- bool operator!=( const QMapIterator<K,T>& it ) const { return node != it.node; }
- T& operator*() { return node->data; }
- const T& operator*() const { return node->data; }
-
- // Cannot have this - some compilers are too stupid
- //T* operator->() const { return &(node->data); }
-
- const K& key() const { return node->key; }
- T& data() { return node->data; }
- const T& data() const { return node->data; }
-
-private:
- int inc() {
- QMapNodeBase* tmp = node;
- if ( tmp->right ) {
- tmp = tmp->right;
- while ( tmp->left )
- tmp = tmp->left;
- } else {
- QMapNodeBase* y = tmp->parent;
- while (tmp == y->right) {
- tmp = y;
- y = y->parent;
- }
- if (tmp->right != y)
- tmp = y;
- }
- node = (NodePtr)tmp;
- return 0;
- }
-
- int dec() {
- QMapNodeBase* tmp = node;
- if (tmp->color == QMapNodeBase::Red &&
- tmp->parent->parent == tmp ) {
- tmp = tmp->right;
- } else if (tmp->left != 0) {
- QMapNodeBase* y = tmp->left;
- while ( y->right )
- y = y->right;
- tmp = y;
- } else {
- QMapNodeBase* y = tmp->parent;
- while (tmp == y->left) {
- tmp = y;
- y = y->parent;
- }
- tmp = y;
- }
- node = (NodePtr)tmp;
- return 0;
- }
-
-public:
- QMapIterator<K,T>& operator++() {
- inc();
- return *this;
- }
-
- QMapIterator<K,T> operator++(int) {
- QMapIterator<K,T> tmp = *this;
- inc();
- return tmp;
- }
-
- QMapIterator<K,T>& operator--() {
- dec();
- return *this;
- }
-
- QMapIterator<K,T> operator--(int) {
- QMapIterator<K,T> tmp = *this;
- dec();
- return tmp;
- }
-};
-
-template<class K, class T>
-class Q_EXPORT QMapConstIterator
-{
- public:
- /**
- * Typedefs
- */
- typedef QMapNode< K, T >* NodePtr;
-
- /**
- * Variables
- */
- QMapNode<K,T>* node;
-
- /**
- * Functions
- */
- QMapConstIterator() : node( 0 ) {}
- QMapConstIterator( QMapNode<K,T>* p ) : node( p ) {}
- QMapConstIterator( const QMapConstIterator<K,T>& it ) : node( it.node ) {}
- QMapConstIterator( const QMapIterator<K,T>& it ) : node( it.node ) {}
-
- bool operator==( const QMapConstIterator<K,T>& it ) const { return node == it.node; }
- bool operator!=( const QMapConstIterator<K,T>& it ) const { return node != it.node; }
- const T& operator*() const { return node->data; }
-
- // Cannot have this - some compilers are too stupid
- //const T* operator->() const { return &(node->data); }
-
- const K& key() const { return node->key; }
- const T& data() const { return node->data; }
-
-private:
- int inc() {
- QMapNodeBase* tmp = node;
- if ( tmp->right ) {
- tmp = tmp->right;
- while ( tmp->left )
- tmp = tmp->left;
- } else {
- QMapNodeBase* y = tmp->parent;
- while (tmp == y->right) {
- tmp = y;
- y = y->parent;
- }
- if (tmp->right != y)
- tmp = y;
- }
- node = (NodePtr)tmp;
- return 0;
- }
-
- int dec() {
- QMapNodeBase* tmp = node;
- if (tmp->color == QMapNodeBase::Red &&
- tmp->parent->parent == tmp ) {
- tmp = tmp->right;
- } else if (tmp->left != 0) {
- QMapNodeBase* y = tmp->left;
- while ( y->right )
- y = y->right;
- tmp = y;
- } else {
- QMapNodeBase* y = tmp->parent;
- while (tmp == y->left) {
- tmp = y;
- y = y->parent;
- }
- tmp = y;
- }
- node = (NodePtr)tmp;
- return 0;
- }
-
-public:
- QMapConstIterator<K,T>& operator++() {
- inc();
- return *this;
- }
-
- QMapConstIterator<K,T> operator++(int) {
- QMapConstIterator<K,T> tmp = *this;
- inc();
- return tmp;
- }
-
- QMapConstIterator<K,T>& operator--() {
- dec();
- return *this;
- }
-
- QMapConstIterator<K,T> operator--(int) {
- QMapConstIterator<K,T> tmp = *this;
- dec();
- return tmp;
- }
-};
-
-
-class Q_EXPORT QMapPrivateBase : public QShared
-{
-public:
- QMapPrivateBase() {
- node_count = 0;
- }
- QMapPrivateBase( const QMapPrivateBase* _map) {
- node_count = _map->node_count;
- }
-
- /**
- * Implementations of basic tree algorithms
- */
- void rotateLeft( QMapNodeBase* x, QMapNodeBase*& root);
- void rotateRight( QMapNodeBase* x, QMapNodeBase*& root );
- void rebalance( QMapNodeBase* x, QMapNodeBase*& root );
- QMapNodeBase* removeAndRebalance( QMapNodeBase* z, QMapNodeBase*& root,
- QMapNodeBase*& leftmost,
- QMapNodeBase*& rightmost );
-
- /**
- * Variables
- */
- int node_count;
-};
-
-
-template <class Key, class T>
-class QMapPrivate : public QMapPrivateBase
-{
-public:
- /**
- * Typedefs
- */
- typedef QMapIterator< Key, T > Iterator;
- typedef QMapConstIterator< Key, T > ConstIterator;
- typedef QMapNode< Key, T > Node;
- typedef QMapNode< Key, T >* NodePtr;
-
- /**
- * Functions
- */
- QMapPrivate() {
- header = new Node;
- header->color = QMapNodeBase::Red; // Mark the header
- header->parent = 0;
- header->left = header->right = header;
- }
- QMapPrivate( const QMapPrivate< Key, T >* _map ) : QMapPrivateBase( _map ) {
- header = new Node;
- header->color = QMapNodeBase::Red; // Mark the header
- if ( _map->header->parent == 0 ) {
- header->parent = 0;
- header->left = header->right = header;
- } else {
- header->parent = copy( (NodePtr)(_map->header->parent) );
- header->parent->parent = header;
- header->left = header->parent->minimum();
- header->right = header->parent->maximum();
- }
- }
- ~QMapPrivate() { clear(); delete header; }
-
- NodePtr copy( NodePtr p ) {
- if ( !p )
- return 0;
- NodePtr n = new Node( *p );
- n->color = p->color;
- if ( p->left ) {
- n->left = copy( (NodePtr)(p->left) );
- n->left->parent = n;
- } else {
- n->left = 0;
- }
- if ( p->right ) {
- n->right = copy( (NodePtr)(p->right) );
- n->right->parent = n;
- } else {
- n->right = 0;
- }
- return n;
- }
-
- void clear() {
- clear( (NodePtr)(header->parent) );
- header->color = QMapNodeBase::Red;
- header->parent = 0;
- header->left = header->right = header;
- node_count = 0;
- }
-
- void clear( NodePtr p ) {
- while ( p != 0 ) {
- clear( (NodePtr)p->right );
- NodePtr y = (NodePtr)p->left;
- delete p;
- p = y;
- }
- }
-
- Iterator begin() { return Iterator( (NodePtr)(header->left ) ); }
- Iterator end() { return Iterator( header ); }
- ConstIterator begin() const { return ConstIterator( (NodePtr)(header->left ) ); }
- ConstIterator end() const { return ConstIterator( header ); }
-
- ConstIterator find(const Key& k) const {
- QMapNodeBase* y = header; // Last node
- QMapNodeBase* x = header->parent; // Root node.
-
- while ( x != 0 ) {
- // If as k <= key(x) go left
- if ( !( key(x) < k ) ) {
- y = x;
- x = x->left;
- } else {
- x = x->right;
- }
- }
-
- // Was k bigger/smaller then the biggest/smallest
- // element of the tree ? Return end()
- if ( y == header || k < key(y) )
- return ConstIterator( header );
- return ConstIterator( (NodePtr)y );
- }
-
- void remove( Iterator it ) {
- NodePtr del = (NodePtr) removeAndRebalance( it.node, header->parent, header->left, header->right );
- delete del;
- --node_count;
- }
-
-#ifdef QT_QMAP_DEBUG
- void inorder( QMapNodeBase* x = 0, int level = 0 ){
- if ( !x )
- x = header->parent;
- if ( x->left )
- inorder( x->left, level + 1 );
- //cout << level << " Key=" << key(x) << " Value=" << ((NodePtr)x)->data << endl;
- if ( x->right )
- inorder( x->right, level + 1 );
- }
-#endif
-
- Iterator insertMulti(const Key& v){
- QMapNodeBase* y = header;
- QMapNodeBase* x = header->parent;
- while (x != 0){
- y = x;
- x = ( v < key(x) ) ? x->left : x->right;
- }
- return insert(x, y, v);
- }
-
- Iterator insertSingle( const Key& k ) {
- // Search correct position in the tree
- QMapNodeBase* y = header;
- QMapNodeBase* x = header->parent;
- bool result = TRUE;
- while ( x != 0 ) {
- result = ( k < key(x) );
- y = x;
- x = result ? x->left : x->right;
- }
- // Get iterator on the last not empty one
- Iterator j( (NodePtr)y );
- if ( result ) {
- // Smaller then the leftmost one ?
- if ( j == begin() ) {
- return insert(x, y, k );
- } else {
- // Perhaps daddy is the right one ?
- --j;
- }
- }
- // Really bigger ?
- if ( (j.node->key) < k )
- return insert(x, y, k );
- // We are going to replace a node
- return j;
- }
-
- Iterator insert( QMapNodeBase* x, QMapNodeBase* y, const Key& k ) {
- NodePtr z = new Node( k );
- if (y == header || x != 0 || k < key(y) ) {
- y->left = z; // also makes leftmost = z when y == header
- if ( y == header ) {
- header->parent = z;
- header->right = z;
- } else if ( y == header->left )
- header->left = z; // maintain leftmost pointing to min node
- } else {
- y->right = z;
- if ( y == header->right )
- header->right = z; // maintain rightmost pointing to max node
- }
- z->parent = y;
- z->left = 0;
- z->right = 0;
- rebalance( z, header->parent );
- ++node_count;
- return Iterator(z);
- }
-
-protected:
- /**
- * Helpers
- */
- const Key& key( QMapNodeBase* b ) const { return ((NodePtr)b)->key; }
-
- /**
- * Variables
- */
- NodePtr header;
-};
-
-
-template<class Key, class T>
-class Q_EXPORT QMap
-{
-public:
- /**
- * Typedefs
- */
- typedef QMapIterator< Key, T > Iterator;
- typedef QMapConstIterator< Key, T > ConstIterator;
- typedef T ValueType;
- typedef QMapPrivate< Key, T > Priv;
-
- /**
- * API
- */
- QMap() { sh = new QMapPrivate< Key, T >; }
- QMap( const QMap<Key,T>& m ) { sh = m.sh; sh->ref(); }
- ~QMap() { if ( sh->deref() ) delete sh; }
-
- QMap<Key,T>& operator= ( const QMap<Key,T>& m )
- { m.sh->ref(); if ( sh->deref() ) delete sh; sh = m.sh; return *this; }
-
- Iterator begin() { detach(); return sh->begin(); }
- Iterator end() { detach(); return sh->end(); }
- ConstIterator begin() const { return ((const Priv*)sh)->begin(); }
- ConstIterator end() const { return ((const Priv*)sh)->end(); }
-
- Iterator find ( const Key& k )
- { detach(); return Iterator( sh->find( k ).node ); }
- ConstIterator find ( const Key& k ) const
- { return sh->find( k ); }
- T& operator[] ( const Key& k ) {
- detach(); QMapNode<Key,T>* p = sh->find( k ).node;
- if ( p != sh->end().node ) return p->data;
- return insert( k, T() ).data(); }
- const T& operator[] ( const Key& k ) const
- { return sh->find( k ).data(); }
- bool contains ( const Key& k ) const
- { return find( k ) != end(); }
- //{ return sh->find( k ) != ((const Priv*)sh)->end(); }
-
- uint count() const { return sh->node_count; }
-
- bool isEmpty() const { return sh->node_count == 0; }
-
- Iterator insert( const Key& key, const T& value ) {
- detach();
- Iterator it = sh->insertSingle( key );
- it.data() = value;
- return it;
- }
-
- void remove( Iterator it ) { detach(); sh->remove( it ); }
- void remove( const Key& k ) {
- detach();
- Iterator it( sh->find( k ).node );
- if ( it != end() )
- sh->remove( it );
- }
-
- Iterator replace( const Key& k, const T& v ) {
- remove( k );
- return insert( k, v );
- }
-
- void clear() { if ( sh->count == 1 ) sh->clear(); else { sh->deref(); sh = new QMapPrivate<Key,T>; } }
-
-#if defined(Q_FULL_TEMPLATE_INSTANTIATION)
- bool operator==( const QMap<Key,T>& ) const { return FALSE; }
-#endif
-
-protected:
- /**
- * Helpers
- */
- void detach() { if ( sh->count > 1 ) { sh->deref(); sh = new QMapPrivate<Key,T>( sh ); } }
-
- Priv* sh;
-};
-
-
-#ifndef QT_NO_DATASTREAM
-template<class Key, class T>
-inline QDataStream& operator>>( QDataStream& s, QMap<Key,T>& m ) {
- m.clear();
- Q_UINT32 c;
- s >> c;
- for( Q_UINT32 i = 0; i < c; ++i ) {
- Key k; T t;
- s >> k >> t;
- m.insert( k, t );
- }
- return s;
-}
-
-
-template<class Key, class T>
-inline QDataStream& operator<<( QDataStream& s, const QMap<Key,T>& m ) {
- s << (Q_UINT32)m.count();
- QMapConstIterator<Key,T> it = m.begin();
- for( ; it != m.end(); ++it )
- s << it.key() << it.data();
- return s;
-}
-#endif
-
-#endif // QMAP_H
diff --git a/qtools/qmodules.h b/qtools/qmodules.h
deleted file mode 100644
index 08f0baf..0000000
--- a/qtools/qmodules.h
+++ /dev/null
@@ -1,11 +0,0 @@
-// These modules are licensed to you
-#define QT_MODULE_TOOLS
-#define QT_MODULE_KERNEL
-#define QT_MODULE_WIDGETS
-#define QT_MODULE_DIALOGS
-#define QT_MODULE_ICONVIEW
-#define QT_MODULE_WORKSPACE
-#define QT_MODULE_NETWORK
-#define QT_MODULE_CANVAS
-#define QT_MODULE_TABLE
-#define QT_MODULE_XML
diff --git a/qtools/qptrdict.doc b/qtools/qptrdict.doc
deleted file mode 100644
index 633536c..0000000
--- a/qtools/qptrdict.doc
+++ /dev/null
@@ -1,486 +0,0 @@
-/****************************************************************************
-**
-**
-** QPtrDict and QPtrDictIterator class documentation
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-
-/*****************************************************************************
- QPtrDict documentation
- *****************************************************************************/
-
-/*!
- \class QPtrDict qptrdict.h
- \brief The QPtrDict class is a template class that provides a dictionary based on \c void* keys.
-
- \ingroup collection
- \ingroup tools
-
- QPtrDict is implemented as a template class. Define a
- template instance QPtrDict\<X\> to create a dictionary that operates on
- pointers to X, or X*.
-
- A dictionary is a collection that associates an item with a key.
- The key is used for inserting and looking up an item. QPtrDict has
- \c void* keys.
-
- The dictionary has very fast insertion and lookup.
-
- Example:
- \code
- #include <qptrdict.h>
- #include <stdio.h>
-
- void main()
- {
- int *a = new int[12];
- int *b = new int[10];
- int *c = new int[18];
- int *d = new int[13];
-
- QPtrDict<char> dict; // maps void* -> char*
-
- dict.insert( a, "a is int[12]" ); // describe pointers
- dict.insert( b, "b is int[10]" );
- dict.insert( c, "c is int[18]" );
-
- printf( "%s\n", dict[a] ); // print descriptions
- printf( "%s\n", dict[b] );
- printf( "%s\n", dict[c] );
-
- if ( !dict[d] )
- printf( "d not in dictionary\n" );
- }
- \endcode
-
- Program output:
- \code
- a is int[12]
- b is int[10]
- c is int[18]
- d not in dictionary
- \endcode
-
- The dictionary in our example maps \c int* keys to \c char* items.
- QPtrDict implements the \link operator[] [] operator\endlink to lookup
- an item.
-
- QPtrDict is implemented by QGDict as a hash array with a fixed number of
- entries. Each array entry points to a singly linked list of buckets, in
- which the dictionary items are stored.
-
- When an item is inserted with a key, the key is converted (hashed) to
- an integer index into the hash array using the \c mod operation. The
- item is inserted before the first bucket in the list of buckets.
-
- Looking up an item is normally very fast. The key is again hashed to an
- array index. Then QPtrDict scans the list of buckets and returns the item
- found or null if the item was not found. You cannot insert null pointers
- into a dictionary.
-
- The size of the hash array is very important. In order to get good
- performance, you should use a suitably large \link primes.html prime
- number\endlink. Suitable means equal to or larger than the maximum
- expected number of dictionary items.
-
- Items with equal keys are allowed. When inserting two items with the
- same key, only the last inserted item will be visible (last in, first out)
- until it is removed.
-
- Example:
- \code
- #include <qptrdict.h>
- #include <stdio.h>
-
- void main()
- {
- QPtrDict<char> dict; // maps char* ==> char*
-
- double *ptr = new double[28];
- dict.insert( ptr, "first" );
- dict.insert( ptr, "second" );
-
- printf( "%s\n", dict[ptr] );
- dict.remove( ptr );
- printf( "%s\n", dict[ptr] );
- }
- \endcode
-
- Program output:
- \code
- second
- first
- \endcode
-
- The QPtrDictIterator class can traverse the dictionary contents, but only
- in an arbitrary order. Multiple iterators may independently traverse the
- same dictionary.
-
- Calling setAutoDelete(TRUE) for a dictionary tells it to delete items
- that are removed . The default is to not delete items when they are
- removed.
-
- When inserting an item into a dictionary, only the pointer is copied, not
- the item itself. This is called a shallow copy. It is possible to make the
- dictionary copy all of the item's data (known as a deep copy) when an
- item is inserted. insert() calls the virtual function
- QCollection::newItem() for the item to be inserted.
- Inherit a dictionary and reimplement it if you want deep copies.
-
- When removing a dictionary item, the virtual function
- QCollection::deleteItem() is called. QPtrDict's default implementation
- is to delete the item if auto-deletion is enabled.
-
- \sa QPtrDictIterator, QDict, QAsciiDict, QIntDict,
- \link collection.html Collection Classes\endlink
-*/
-
-
-/*!
- \fn QPtrDict::QPtrDict( int size )
- Constructs a dictionary using an internal hash array with the size
- \e size.
-
- Setting \e size to a suitably large \link primes.html prime number\endlink
- (equal to or greater than the expected number of entries) makes the hash
- distribution better and hence the lookup faster.
-*/
-
-/*!
- \fn QPtrDict::QPtrDict( const QPtrDict<type> &dict )
- Constructs a copy of \e dict.
-
- Each item in \e dict are inserted into this dictionary.
- Only the pointers are copied (shallow copy).
-*/
-
-/*!
- \fn QPtrDict::~QPtrDict()
- Removes all items from the dictionary and destroys it.
-
- All iterators that access this dictionary will be reset.
-
- \sa setAutoDelete()
-*/
-
-/*!
- \fn QPtrDict<type> &QPtrDict::operator=(const QPtrDict<type> &dict)
- Assigns \e dict to this dictionary and returns a reference to this
- dictionary.
-
- This dictionary is first cleared, then each item in \e dict is inserted
- into this dictionary.
- Only the pointers are copied (shallow copy), unless newItem() has been
- reimplemented().
-*/
-
-/*!
- \fn uint QPtrDict::count() const
- Returns the number of items in the dictionary.
- \sa isEmpty()
-*/
-
-/*!
- \fn uint QPtrDict::size() const
- Returns the size of the internal hash array (as specified in the
- constructor).
- \sa count()
-*/
-
-/*!
- \fn void QPtrDict::resize( uint newsize )
- Changes the size of the hashtable the \a newsize.
- The contents of the dictionary are preserved,
- but all iterators on the dictionary become invalid.
-*/
-
-/*!
- \fn bool QPtrDict::isEmpty() const
- Returns TRUE if the dictionary is empty, i.e. count() == 0. Returns FALSE
- otherwise.
- \sa count()
-*/
-
-/*!
- \fn void QPtrDict::insert( void *key, const type *item )
- Inserts the \e key with the \e item into the dictionary.
-
- The key does not have to be a unique dictionary key. If multiple items
- are inserted with the same key, only the last item will be visible.
-
- Null items are not allowed.
-
- \sa replace()
-*/
-
-/*!
- \fn void QPtrDict::replace( void *key, const type *item )
- Replaces an item which has a key equal to \e key with \e item.
-
- If the item does not already exist, it will be inserted.
-
- Null items are not allowed.
-
- Equivalent to:
- \code
- QPtrDict<char> dict;
- ...
- if ( dict.find(key) )
- dict.remove( key );
- dict.insert( key, item );
- \endcode
-
- If there are two or more items with equal keys, then the last inserted
- of these will be replaced.
-
- \sa insert()
-*/
-
-/*!
- \fn bool QPtrDict::remove( void *key )
- Removes the item associated with \e key from the dictionary.
- Returns TRUE if successful, or FALSE if the key does not exist in the
- dictionary.
-
- If there are two or more items with equal keys, then the last inserted
- of these will be removed.
-
- The removed item is deleted if \link QCollection::setAutoDelete()
- auto-deletion\endlink is enabled.
-
- All dictionary iterators that refer to the removed item will be set to
- point to the next item in the dictionary traversing order.
-
- \sa take(), clear(), setAutoDelete()
-*/
-
-/*!
- \fn type *QPtrDict::take( void *key )
- Takes the item associated with \e key out of the dictionary without
- deleting it (even if \link QCollection::setAutoDelete()
- auto-deletion\endlink is enabled).
-
- If there are two or more items with equal keys, then the last inserted
- of these will be taken.
-
- Returns a pointer to the item taken out, or null if the key does not
- exist in the dictionary.
-
- All dictionary iterators that refer to the taken item will be set to
- point to the next item in the dictionary traversing order.
-
- \sa remove(), clear(), setAutoDelete()
-*/
-
-/*!
- \fn void QPtrDict::clear()
- Removes all items from the dictionary.
-
- The removed items are deleted if \link QCollection::setAutoDelete()
- auto-deletion\endlink is enabled.
-
- All dictionary iterators that access this dictionary will be reset.
-
- \sa remove(), take(), setAutoDelete()
-*/
-
-/*!
- \fn type *QPtrDict::find( void *key ) const
- Returns the item associated with \e key, or null if the key does not
- exist in the dictionary.
-
- This function uses an internal hashing algorithm to optimize lookup.
-
- If there are two or more items with equal keys, then the last inserted
- of these will be found.
-
- Equivalent to the [] operator.
-
- \sa operator[]()
-*/
-
-/*!
- \fn type *QPtrDict::operator[]( void *key ) const
- Returns the item associated with \e key, or null if the key does not
- exist in the dictionary.
-
- This function uses an internal hashing algorithm to optimize lookup.
-
- If there are two or more items with equal keys, then the last inserted
- of these will be found.
-
- Equivalent to the find() function.
-
- \sa find()
-*/
-
-/*!
- \fn void QPtrDict::statistics() const
- Debugging-only function that prints out the dictionary distribution
- using qDebug().
-*/
-
-
-/*****************************************************************************
- QPtrDictIterator documentation
- *****************************************************************************/
-
-/*!
- \class QPtrDictIterator qptrdict.h
- \brief The QPtrDictIterator class provides an iterator for QPtrDict collections.
-
- \ingroup collection
- \ingroup tools
-
- QPtrDictIterator is implemented as a template class.
- Define a template instance QPtrDictIterator\<X\> to create a
- dictionary iterator that operates on QPtrDict\<X\> (dictionary of X*).
-
- Example:
- \code
- #include <qptrdict.h>
- #include <stdio.h>
-
- void main()
- {
- int *a = new int[12];
- int *b = new int[10];
- int *c = new int[18];
- int *d = new int[13];
-
- QPtrDict<char> dict; // maps void* -> char*
-
- dict.insert( a, "a is int[12]" ); // describe pointers
- dict.insert( b, "b is int[10]" );
- dict.insert( c, "c is int[18]" );
-
- QPtrDictIterator<char> it( dict ); // iterator for dict
-
- while ( it.current() ) {
- printf( "%x -> %s\n", it.currentKey(), it.current() );
- ++it;
- }
- }
- \endcode
-
- Program output:
- \code
- 804a788 -> a is int[12]
- 804a7f0 -> c is int[18]
- 804a7c0 -> b is int[10]
- \endcode
-
- Note that the traversal order is arbitrary, you are not guaranteed the
- order above.
-
- Multiple iterators may independently traverse the same dictionary.
- A QPtrDict knows about all iterators that are operating on the dictionary.
- When an item is removed from the dictionary, QPtrDict update all
- iterators that are referring the removed item to point to the next item
- in the traversing order.
-
- \sa QPtrDict, \link collection.html Collection Classes\endlink
-*/
-
-/*!
- \fn QPtrDictIterator::QPtrDictIterator( const QPtrDict<type> &dict )
- Constructs an iterator for \e dict. The current iterator item is
- set to point on the first item in the \e dict.
-*/
-
-/*!
- \fn QPtrDictIterator::~QPtrDictIterator()
- Destroys the iterator.
-*/
-
-/*!
- \fn uint QPtrDictIterator::count() const
- Returns the number of items in the dictionary this iterator operates on.
- \sa isEmpty()
-*/
-
-/*!
- \fn bool QPtrDictIterator::isEmpty() const
- Returns TRUE if the dictionary is empty, i.e. count() == 0. Returns FALSE
- otherwise.
- \sa count()
-*/
-
-/*!
- \fn type *QPtrDictIterator::toFirst()
- Sets the current iterator item to point to the first item in the
- dictionary and returns a pointer to the item.
- If the dictionary is empty it sets the current item to null and
- returns null.
-*/
-
-/*!
- \fn QPtrDictIterator::operator type *() const
- Cast operator. Returns a pointer to the current iterator item.
- Same as current().
-*/
-
-/*!
- \fn type *QPtrDictIterator::current() const
- Returns a pointer to the current iterator item.
-*/
-
-/*!
- \fn void *QPtrDictIterator::currentKey() const
- Returns the key for the current iterator item.
-*/
-
-/*!
- \fn type *QPtrDictIterator::operator()()
- Makes the succeeding item current and returns the original current item.
-
- If the current iterator item was the last item in the dictionary or if it
- was null, null is returned.
-*/
-
-/*!
- \fn type *QPtrDictIterator::operator++()
- Prefix ++ makes the succeeding item current and returns the new current
- item.
-
- If the current iterator item was the last item in the dictionary or if it
- was null, null is returned.
-*/
-
-/*!
- \fn type *QPtrDictIterator::operator+=( uint jump )
- Sets the current item to the item \e jump positions after the current item,
- and returns a pointer to that item.
-
- If that item is beyond the last item or if the dictionary is empty,
- it sets the current item to null and returns null.
-*/
diff --git a/qtools/qptrdict.h b/qtools/qptrdict.h
deleted file mode 100644
index df8bcb4..0000000
--- a/qtools/qptrdict.h
+++ /dev/null
@@ -1,103 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QPtrDict template class
-**
-** Created : 970415
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QPTRDICT_H
-#define QPTRDICT_H
-
-#ifndef QT_H
-#include "qgdict.h"
-#endif // QT_H
-
-
-template<class type> class Q_EXPORT QPtrDict : public QGDict
-{
-public:
- QPtrDict(uint size=17) : QGDict(size,PtrKey,0,0) {}
- QPtrDict( const QPtrDict<type> &d ) : QGDict(d) {}
- ~QPtrDict() { clear(); }
- QPtrDict<type> &operator=(const QPtrDict<type> &d)
- { return (QPtrDict<type>&)QGDict::operator=(d); }
- uint count() const { return QGDict::count(); }
- uint size() const { return QGDict::size(); }
- bool isEmpty() const { return QGDict::count() == 0; }
- void insert( void *k, const type *d )
- { QGDict::look_ptr(k,(Item)d,1); }
- void replace( void *k, const type *d )
- { QGDict::look_ptr(k,(Item)d,2); }
- bool remove( void *k ) { return QGDict::remove_ptr(k); }
- type *take( void *k ) { return (type*)QGDict::take_ptr(k); }
- type *find( void *k ) const
- { return (type *)((QGDict*)this)->QGDict::look_ptr(k,0,0); }
- type *operator[]( void *k ) const
- { return (type *)((QGDict*)this)->QGDict::look_ptr(k,0,0); }
- void clear() { QGDict::clear(); }
- void resize( uint n ) { QGDict::resize(n); }
- void statistics() const { QGDict::statistics(); }
-private:
- void deleteItem( Item d );
-};
-
-#if defined(Q_DELETING_VOID_UNDEFINED)
-template<> inline void QPtrDict<void>::deleteItem( QCollection::Item )
-{
-}
-#endif
-
-template<class type> inline void QPtrDict<type>::deleteItem( QCollection::Item d )
-{
- if ( del_item ) delete (type *)d;
-}
-
-
-template<class type> class Q_EXPORT QPtrDictIterator : public QGDictIterator
-{
-public:
- QPtrDictIterator(const QPtrDict<type> &d) :QGDictIterator((QGDict &)d) {}
- ~QPtrDictIterator() {}
- uint count() const { return dict->count(); }
- bool isEmpty() const { return dict->count() == 0; }
- type *toFirst() { return (type *)QGDictIterator::toFirst(); }
- operator type *() const { return (type *)QGDictIterator::get(); }
- type *current() const { return (type *)QGDictIterator::get(); }
- void *currentKey() const { return QGDictIterator::getKeyPtr(); }
- type *operator()() { return (type *)QGDictIterator::operator()(); }
- type *operator++() { return (type *)QGDictIterator::operator++(); }
- type *operator+=(uint j) { return (type *)QGDictIterator::operator+=(j);}
-};
-
-
-#endif // QPTRDICT_H
diff --git a/qtools/qqueue.h b/qtools/qqueue.h
deleted file mode 100644
index 94bc130..0000000
--- a/qtools/qqueue.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QQueue template/macro class
-**
-** Created : 920917
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QQUEUE_H
-#define QQUEUE_H
-
-#ifndef QT_H
-#include "qglist.h"
-#endif // QT_H
-
-
-template<class type> class QQueue : private QGList
-{
-public:
- QQueue() {}
- QQueue( const QQueue<type> &q ) : QGList(q) {}
- ~QQueue() { clear(); }
- QQueue<type>& operator=(const QQueue<type> &q)
- { return (QQueue<type>&)QGList::operator=(q); }
- bool autoDelete() const { return QCollection::autoDelete(); }
- void setAutoDelete( bool del ) { QCollection::setAutoDelete(del); }
- uint count() const { return QGList::count(); }
- bool isEmpty() const { return QGList::count() == 0; }
- void enqueue( const type *d ) { QGList::append(Item(d)); }
- type *dequeue() { return (type *)QGList::takeFirst();}
- bool remove() { return QGList::removeFirst(); }
- void clear() { QGList::clear(); }
- type *head() const { return (type *)QGList::cfirst(); }
- operator type *() const { return (type *)QGList::cfirst(); }
- type *current() const { return (type *)QGList::cfirst(); }
-private:
- void deleteItem( Item d ) { if ( del_item ) delete (type *)d; }
-};
-
-
-#endif // QQUEUE_H
diff --git a/qtools/qregexp.cpp b/qtools/qregexp.cpp
deleted file mode 100644
index 8709858..0000000
--- a/qtools/qregexp.cpp
+++ /dev/null
@@ -1,1093 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QRegExp class
-**
-** Created : 950126
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qregexp.h"
-#include <ctype.h>
-#include <stdlib.h>
-
-// NOT REVISED
-/*!
- \class QRegExp qregexp.h
- \ingroup tools
- \ingroup misc
- \brief The QRegExp class provides pattern matching using regular
- expressions or wildcards.
-
- QRegExp knows these regexp primitives:
- <ul plain>
- <li><dfn>c</dfn> matches the character 'c'
- <li><dfn>.</dfn> matches any character
- <li><dfn>^</dfn> matches start of input
- <li><dfn>$</dfn> matches end of input
- <li><dfn>[]</dfn> matches a defined set of characters - see below.
- <li><dfn>a*</dfn> matches a sequence of zero or more a's
- <li><dfn>a+</dfn> matches a sequence of one or more a's
- <li><dfn>a?</dfn> matches an optional a
- <li><dfn>\c</dfn> escape code for matching special characters such
- as \, [, *, +, . etc.
- <li><dfn>\t</dfn> matches the TAB character (9)
- <li><dfn>\n</dfn> matches newline (10)
- <li><dfn>\r</dfn> matches return (13)
- <li><dfn>\s</dfn> matches a white space (defined as any character
- for which QChar::isSpace() returns TRUE. This includes at least
- ASCII characters 9 (TAB), 10 (LF), 11 (VT), 12(FF), 13 (CR) and 32
- (Space)).
- <li><dfn>\d</dfn> matches a digit (defined as any character for
- which QChar::isDigit() returns TRUE. This includes at least ASCII
- characters '0'-'9').
- <li><dfn>\x1f6b</dfn> matches the character with unicode point U1f6b
- (hexadecimal 1f6b). \x0012 will match the ASCII/Latin1 character
- 0x12 (18 decimal, 12 hexadecimal).
- <li><dfn>\022</dfn> matches the ASCII/Latin1 character 022 (18
- decimal, 22 octal).
- </ul>
-
- In wildcard mode, it only knows four primitives:
- <ul plain>
- <li><dfn>c</dfn> matches the character 'c'
- <li><dfn>?</dfn> matches any character
- <li><dfn>*</dfn> matches any sequence of characters
- <li><dfn>[]</dfn> matches a defined set of characters - see below.
- </ul>
-
- QRegExp supports Unicode both in the pattern strings and in the
- strings to be matched.
-
- When writing regular expressions in C++ code, remember that C++
- processes \ characters. So in order to match e.g. a "." character,
- you must write "\\." in C++ source, not "\.".
-
- A character set matches a defined set of characters. For example,
- [BSD] matches any of 'B', 'D' and 'S'. Within a character set, the
- special characters '.', '*', '?', '^', '$', '+' and '[' lose their
- special meanings. The following special characters apply:
- <ul plain>
- <li><dfn>^</dfn> When placed first in the list, changes the
- character set to match any character \e not in the list. To include
- the character '^' itself in the set, escape it or place it anywhere
- but first.
- <li><dfn>-</dfn> Defines a range of characters. To include the
- character '-' itself in the set, escape it or place it last.
- <li><dfn>]</dfn> Ends the character set definition. To include the
- character ']' itself in the set, escape it or place it first (but
- after the negation operator '^', if present)
- </ul>
- Thus, [a-zA-Z0-9.] matches upper and lower case ASCII letters,
- digits and dot; and [^\s] matches everything except white space.
-
- \bug Case insensitive matching is not supported for non-ASCII/Latin1
- (non-8bit) characters. Any character with a non-zero QChar.row() is
- matched case sensitively even if the QRegExp is in case insensitive
- mode.
-
- \note In Qt 3.0, the language of regular expressions will contain
- five more special characters, namely '(', ')', '{', '|' and '}'. To
- ease porting, it's a good idea to escape these characters with a
- backslash in all the regular expressions you'll write from now on.
-*/
-
-
-//
-// The regexp pattern is internally represented as an array of uints,
-// each element containing an 16-bit character or a 32-bit code
-// (listed below). User-defined character classes (e.g. [a-zA-Z])
-// are encoded as this:
-// uint no: 1 2 3 ...
-// value: CCL | n from | to from | to
-//
-// where n is the (16-bit) number of following range definitions and
-// from and to define the ranges inclusive. from <= to is always true,
-// otherwise it is a built-in charclass (Pxx, eg \s - PWS). Single
-// characters in the class are coded as from==to. Negated classes
-// (e.g. [^a-z]) use CCN instead of CCL.
-
-const uint END = 0x00000000;
-const uint PWS = 0x10010000; // predef charclass: whitespace (\s)
-const uint PDG = 0x10020000; // predef charclass: digit (\d)
-const uint CCL = 0x20010000; // character class []
-const uint CCN = 0x20020000; // neg character class [^]
-const uint CHR = 0x40000000; // character
-const uint BOL = 0x80010000; // beginning of line ^
-const uint EOL = 0x80020000; // end of line $
-const uint BOW = 0x80030000; // beginning of word \<
-const uint EOW = 0x80040000; // end of word \>
-const uint ANY = 0x80050000; // any character .
-const uint CLO = 0x80070000; // Kleene closure *
-const uint OPT = 0x80080000; // Optional closure ?
-
-const uint MCC = 0x20000000; // character class bitmask
-const uint MCD = 0xffff0000; // code mask
-const uint MVL = 0x0000ffff; // value mask
-
-//
-// QRegExp::error codes (internal)
-//
-
-const int PatOk = 0; // pattern ok
-const int PatNull = 1; // no pattern defined
-const int PatSyntax = 2; // pattern syntax error
-const int PatOverflow = 4; // pattern too long
-
-
-/*****************************************************************************
- QRegExp member functions
- *****************************************************************************/
-
-/*!
- Constructs an empty regular expression.
-*/
-
-QRegExp::QRegExp()
-{
- rxdata = 0;
- cs = TRUE;
- wc = FALSE;
- error = PatOk;
-}
-
-/*!
- Constructs a regular expression.
-
- \arg \e pattern is the regular expression pattern string.
- \arg \e caseSensitive specifies whether or not to use case sensitive
- matching.
- \arg \e wildcard specifies whether the pattern string should be used for
- wildcard matching (also called globbing expression), normally used for
- matching file names.
-
- \sa setWildcard()
-*/
-
-QRegExp::QRegExp( const QCString &pattern, bool caseSensitive, bool wildcard )
-{
- rxstring = pattern;
- rxdata = 0;
- cs = caseSensitive;
- wc = wildcard;
- compile();
-}
-
-/*!
- Constructs a regular expression which is a copy of \e r.
- \sa operator=(const QRegExp&)
-*/
-
-QRegExp::QRegExp( const QRegExp &r )
-{
- rxstring = r.pattern();
- rxdata = 0;
- cs = r.caseSensitive();
- wc = r.wildcard();
- compile();
-}
-
-/*!
- Destructs the regular expression and cleans up its internal data.
-*/
-
-QRegExp::~QRegExp()
-{
- if ( rxdata ) // Avoid purify complaints
- delete [] rxdata;
-}
-
-/*!
- Copies the regexp \e r and returns a reference to this regexp.
- The case sensitivity and wildcard options are copied, as well.
-*/
-
-QRegExp &QRegExp::operator=( const QRegExp &r )
-{
- rxstring = r.rxstring;
- cs = r.cs;
- wc = r.wc;
- compile();
- return *this;
-}
-
-/*!
- \obsolete
- Consider using setPattern() instead of this method.
-
- Sets the pattern string to \e pattern and returns a reference to this regexp.
- The case sensitivity or wildcard options do not change.
-*/
-
-QRegExp &QRegExp::operator=( const QCString &pattern )
-{
- rxstring = pattern;
- compile();
- return *this;
-}
-
-
-/*!
- Returns TRUE if this regexp is equal to \e r.
-
- Two regexp objects are equal if they have equal pattern strings,
- case sensitivity options and wildcard options.
-*/
-
-bool QRegExp::operator==( const QRegExp &r ) const
-{
- return rxstring == r.rxstring && cs == r.cs && wc == r.wc;
-}
-
-/*!
- \fn bool QRegExp::operator!=( const QRegExp &r ) const
-
- Returns TRUE if this regexp is \e not equal to \e r.
-
- \sa operator==()
-*/
-
-/*!
- \fn bool QRegExp::isEmpty() const
- Returns TRUE if the regexp is empty.
-*/
-
-/*!
- \fn bool QRegExp::isValid() const
- Returns TRUE if the regexp is valid, or FALSE if it is invalid.
-
- The pattern "[a-z" is an example of an invalid pattern, since it lacks a
- closing bracket.
-*/
-
-
-/*!
- \fn bool QRegExp::wildcard() const
- Returns TRUE if wildcard mode is on, otherwise FALSE. \sa setWildcard().
-*/
-
-/*!
- Sets the wildcard option for the regular expression. The default
- is FALSE.
-
- Setting \e wildcard to TRUE makes it convenient to match filenames
- instead of plain text.
-
- For example, "qr*.cpp" matches the string "qregexp.cpp" in wildcard mode,
- but not "qicpp" (which would be matched in normal mode).
-
- \sa wildcard()
-*/
-
-void QRegExp::setWildcard( bool wildcard )
-{
- if ( wildcard != wc ) {
- wc = wildcard;
- compile();
- }
-}
-
-/*!
- \fn bool QRegExp::caseSensitive() const
-
- Returns TRUE if case sensitivity is enabled, otherwise FALSE. The
- default is TRUE.
-
- \sa setCaseSensitive()
-*/
-
-/*!
- Enables or disables case sensitive matching.
-
- In case sensitive mode, "a.e" matches "axe" but not "Axe".
-
- See also: caseSensitive()
-*/
-
-void QRegExp::setCaseSensitive( bool enable )
-{
- if ( cs != enable ) {
- cs = enable;
- compile();
- }
-}
-
-
-/*!
- \fn QCString QRegExp::pattern() const
- Returns the pattern string of the regexp.
-*/
-
-
-/*!
- \fn void QRegExp::setPattern(const QCString & pattern)
- Sets the pattern string to \a pattern and returns a reference to this regexp.
- The case sensitivity or wildcard options do not change.
-*/
-
-static inline bool iswordchar( int x )
-{
- return isalnum(x) || x == '_'; //# Only 8-bit support
-}
-
-
-/*!
- \internal
- Match character class
-*/
-
-static bool matchcharclass( uint *rxd, char c )
-{
- uint *d = rxd;
- uint clcode = *d & MCD;
- bool neg = clcode == CCN;
- if ( clcode != CCL && clcode != CCN)
- qWarning("QRegExp: Internal error, please report to qt-bugs@trolltech.com");
- uint numFields = *d & MVL;
- uint cval = (unsigned char)c; //(((uint)(c.row())) << 8) | ((uint)c.cell());
- bool found = FALSE;
- for ( int i = 0; i < (int)numFields; i++ ) {
- d++;
- if ( *d == PWS && isspace(c) ) {
- found = TRUE;
- break;
- }
- if ( *d == PDG && isdigit(c) ) {
- found = TRUE;
- break;
- }
- else {
- uint from = ( *d & MCD ) >> 16;
- uint to = *d & MVL;
- if ( (cval >= from) && (cval <= to) ) {
- found = TRUE;
- break;
- }
- }
- }
- return neg ? !found : found;
-}
-
-
-
-/*
- Internal: Recursively match string.
-*/
-
-static int matchstring( uint *rxd, const char *str, uint strlength,
- const char *bol, bool cs )
-{
- const char *p = str;
- const char *start = p;
- uint pl = strlength;
- uint *d = rxd;
-
- //### in all cases here: handle pl == 0! (don't read past strlen)
- while ( *d ) {
- if ( *d & CHR ) { // match char
- if ( !pl )
- return -1;
- char c = *d;
- if ( !cs /*&& !c.row()*/ ) { // case insensitive, #Only 8bit
- if ( tolower(*p) != c )
- return -1;
- p++;
- pl--;
- } else { // case insensitive
- if ( *p != c )
- return -1;
- p++;
- pl--;
- }
- d++;
- }
- else if ( *d & MCC ) { // match char class
- if ( !pl )
- return -1;
- if ( !matchcharclass( d, *p ) )
- return -1;
- p++;
- pl--;
- d += (*d & MVL) + 1;
- }
- else switch ( *d++ ) {
- case PWS: // match whitespace
- if ( !pl || !isspace(*p) )
- return -1;
- p++;
- pl--;
- break;
- case PDG: // match digits
- if ( !pl || !isdigit(*p) )
- return -1;
- p++;
- pl--;
- break;
- case ANY: // match anything
- if ( !pl )
- return -1;
- p++;
- pl--;
- break;
- case BOL: // match beginning of line
- if ( p != bol )
- return -1;
- break;
- case EOL: // match end of line
- if ( pl )
- return -1;
- break;
- case BOW: // match beginning of word
- if ( !iswordchar(*p) || (p > bol && iswordchar(*(p-1)) ) )
- return -1;
- break;
- case EOW: // match end of word
- if ( iswordchar(*p) || p == bol || !iswordchar(*(p-1)) )
- return -1;
- break;
- case CLO: // Kleene closure
- {
- const char *first_p = p;
- if ( *d & CHR ) { // match char
- char c = *d;
- if ( !cs /*&& !c.row()*/ ) { // case insensitive, #only 8bit
- while ( pl /*&& !p->row()*/ && tolower(*p)==c ) {
- p++;
- pl--;
- }
- }
- else { // case sensitive
- while ( pl && *p == c ) {
- p++;
- pl--;
- }
- }
- d++;
- }
- else if ( *d & MCC ) { // match char class
- while( pl && matchcharclass( d, *p ) ) {
- p++;
- pl--;
- }
- d += (*d & MVL) + 1;
- }
- else if ( *d == PWS ) {
- while ( pl && isspace(*p) ) {
- p++;
- pl--;
- }
- d++;
- }
- else if ( *d == PDG ) {
- while ( pl && isdigit(*p) ) {
- p++;
- pl--;
- }
- d++;
- }
- else if ( *d == ANY ) {
- p += pl;
- pl = 0;
- d++;
- }
- else {
- return -1; // error
- }
- d++; // skip CLO's END
- while ( p >= first_p ) { // go backwards
- int end = matchstring( d, p, pl, bol, cs );
- if ( end >= 0 )
- return ( (int)(p - start) ) + end;
- if ( !p )
- return -1;
- --p;
- ++pl;
- }
- }
- return -1;
- case OPT: // optional closure
- {
- const char *first_p = p;
- if ( *d & CHR ) { // match char
- char c = *d;
- if ( !cs /*&& !c.row()*/ ) { // case insensitive, #only 8bit
- if ( pl && /*!p->row() &&*/ tolower(*p) == c ) {
- p++;
- pl--;
- }
- }
- else { // case sensitive
- if ( pl && *p == c ) {
- p++;
- pl--;
- }
- }
- d++;
- }
- else if ( *d & MCC ) { // match char class
- if ( pl && matchcharclass( d, *p ) ) {
- p++;
- pl--;
- }
- d += (*d & MVL) + 1;
- }
- else if ( *d == PWS ) {
- if ( pl && isspace(*p) ) {
- p++;
- pl--;
- }
- d++;
- }
- else if ( *d == PDG ) {
- if ( pl && isdigit(*p) ) {
- p++;
- pl--;
- }
- d++;
- }
- else if ( *d == ANY ) {
- if ( pl ) {
- p++;
- pl--;
- }
- d++;
- }
- else {
- return -1; // error
- }
- d++; // skip OPT's END
- while ( p >= first_p ) { // go backwards
- int end = matchstring( d, p, pl, bol, cs );
- if ( end >= 0 )
- return ( (int)(p - start) ) + end;
- if ( !p )
- return -1;
- --p;
- ++pl;
- }
- }
- return -1;
-
- default: // error
- return -1;
- }
- }
- return (int)(p - start);
-}
-
-
-/*!
- \internal
- Recursively match string.
-*/
-
-// This is obsolete now, but since it is protected (not private), it
-// is still implemented on the off-chance that somebody has made a
-// class derived from QRegExp and calls this directly.
-// Qt 3.0: Remove this?
-
-#if 0
-const char *QRegExp::matchstr( uint *rxd, const QChar *str, uint strlength,
- const QChar *bol ) const
-{
- int len = matchstring( rxd, str, strlength, bol, cs );
- if ( len < 0 )
- return 0;
- return str + len;
-}
-#endif
-
-/*!
- Attempts to match in \e str, starting from position \e index.
- Returns the position of the match, or -1 if there was no match.
-
- If \e len is not a null pointer, the length of the match is stored in
- \e *len.
-
- If \e indexIsStart is TRUE (the default), the position \e index in
- the string will match the start-of-input primitive (^) in the
- regexp, if present. Otherwise, position 0 in \e str will match.
-
- Example:
- \code
- QRegExp r("[0-9]*\\.[0-9]+"); // matches floating point
- int len;
- r.match("pi = 3.1416", 0, &len); // returns 5, len == 6
- \endcode
-
- \note In Qt 3.0, this function will be replaced by find().
-*/
-
-int QRegExp::match( const QCString &str, int index, int *len,
- bool indexIsStart ) const
-{
- if ( !isValid() || isEmpty() )
- return -1;
- if ( str.length() < (uint)index )
- return -1;
- const char *start = str.data();
- const char *p = start + index;
- uint pl = str.length() - index;
- uint *d = rxdata;
- int ep = -1;
-
- if ( *d == BOL ) { // match from beginning of line
- ep = matchstring( d, p, pl, indexIsStart ? p : start, cs );
- } else {
- if ( *d & CHR ) {
- char c = *d;
- if ( !cs /*&& !c.row()*/ ) { // case sensitive, # only 8bit
- while ( pl && ( /*p->row() ||*/ tolower(*p) != c ) ) {
- p++;
- pl--;
- }
- } else { // case insensitive
- while ( pl && *p != c ) {
- p++;
- pl--;
- }
- }
- }
- while( 1 ) { // regular match
- ep = matchstring( d, p, pl, indexIsStart ? start+index : start, cs );
- if ( ep >= 0 )
- break;
- if ( !pl )
- break;
- p++;
- pl--;
- }
- }
- if ( len )
- *len = ep >= 0 ? ep : 0; // No match -> 0, for historical reasons
- return ep >= 0 ? (int)(p - start) : -1; // return index;
-}
-
-/*! \fn int QRegExp::find( const QCString& str, int index )
-
- Attempts to match in \e str, starting from position \e index.
- Returns the position of the match, or -1 if there was no match.
-
- \sa match()
-*/
-
-//
-// Translate wildcard pattern to standard regexp pattern.
-// Ex: *.cpp ==> ^.*\.cpp$
-//
-
-static QCString wc2rx( const QCString &pattern )
-{
- int patlen = (int)pattern.length();
- QCString wcpattern("^");
-
- char c;
- for( int i = 0; i < patlen; i++ ) {
- c = pattern[i];
- switch ( (char)c ) {
- case '*': // '*' ==> '.*'
- wcpattern += '.';
- break;
- case '?': // '?' ==> '.'
- c = '.';
- break;
- case '.': // quote special regexp chars
- case '+':
- case '\\':
- case '$':
- case '^':
- wcpattern += '\\';
- break;
- case '[':
- if ( (char)pattern[i+1] == '^' ) { // don't quote '^' after '['
- wcpattern += '[';
- c = pattern[i+1];
- i++;
- }
- break;
- }
- wcpattern += c;
-
- }
- wcpattern += '$';
- return wcpattern; // return new regexp pattern
-}
-
-
-//
-// Internal: Get char value and increment pointer.
-//
-
-static uint char_val( const char **str, uint *strlength ) // get char value
-{
- const char *p = *str;
- uint pl = *strlength;
- uint len = 1;
- uint v = 0;
- if ( (char)*p == '\\' ) { // escaped code
- p++;
- pl--;
- if ( !pl ) { // it is just a '\'
- (*str)++;
- (*strlength)--;
- return '\\';
- }
- len++; // length at least 2
- int i;
- char c;
- char ch = tolower((char)*p);
- switch ( ch ) {
- case 'b': v = '\b'; break; // bell
- case 'f': v = '\f'; break; // form feed
- case 'n': v = '\n'; break; // newline
- case 'r': v = '\r'; break; // return
- case 't': v = '\t'; break; // tab
- case 's': v = PWS; break; // whitespace charclass
- case 'd': v = PDG; break; // digit charclass
- case '<': v = BOW; break; // word beginning matcher
- case '>': v = EOW; break; // word ending matcher
-
- case 'x': { // hex code
- p++;
- pl--;
- for ( i = 0; (i < 4) && pl; i++ ) { //up to 4 hex digits
- c = tolower((char)*p);
- bool a = ( c >= 'a' && c <= 'f' );
- if ( (c >= '0' && c <= '9') || a ) {
- v <<= 4;
- v += a ? 10 + c - 'a' : c - '0';
- len++;
- }
- else {
- break;
- }
- p++;
- pl--;
- }
- }
- break;
-
- default: {
- if ( ch >= '0' && ch <= '7' ) { //octal code
- len--;
- for ( i = 0; (i < 3) && pl; i++ ) { // up to 3 oct digits
- c = (char)*p;
- if ( c >= '0' && c <= '7' ) {
- v <<= 3;
- v += c - '0';
- len++;
- }
- else {
- break;
- }
- p++;
- pl--;
- }
- }
- else { // not an octal number
- v = (uint)*p; //(((uint)(p->row())) << 8) | ((uint)p->cell());
- }
- }
- }
- } else {
- v = (uint)*p; //(((uint)(p->row())) << 8) | ((uint)p->cell());
- }
- *str += len;
- *strlength -= len;
- return v;
-}
-
-
-#if 0 //defined(DEBUG)
-static uint *dump( uint *p )
-{
- while ( *p != END ) {
- if ( *p & CHR ) {
- uchar uc = (uchar)*p;
- char c = (char)uc;
- uint u = (uint)uc; //(((uint)(uc.row())) << 8) | ((uint)uc.cell());
- qDebug( "\tCHR\tU%04x (%c)", u, (c ? c : ' '));
- p++;
- }
- else if ( *p & MCC ) {
- uint clcode = *p & MCD;
- uint numFields = *p & MVL;
- if ( clcode == CCL )
- qDebug( "\tCCL\t%i", numFields );
- else if ( clcode == CCN )
- qDebug( "\tCCN\t%i", numFields );
- else
- qDebug("coding error!");
- for ( int i = 0; i < (int)numFields; i++ ) {
- p++;
- if ( *p == PWS )
- qDebug( "\t\tPWS" );
- else if ( *p == PDG )
- qDebug( "\t\tPDG" );
- else {
- uint from = ( *p & MCD ) >> 16;
- uint to = *p & MVL;
- char fc = (char)from;
- char tc = (char)to;
- qDebug( "\t\tU%04x (%c) - U%04x (%c)", from,
- (fc ? fc : ' '), to, (tc ? tc : ' ') );
- }
- }
- p++;
- }
- else switch ( *p++ ) {
- case PWS:
- qDebug( "\tPWS" );
- break;
- case PDG:
- qDebug( "\tPDG" );
- break;
- case BOL:
- qDebug( "\tBOL" );
- break;
- case EOL:
- qDebug( "\tEOL" );
- break;
- case BOW:
- qDebug( "\tBOW" );
- break;
- case EOW:
- qDebug( "\tEOW" );
- break;
- case ANY:
- qDebug( "\tANY" );
- break;
- case CLO:
- qDebug( "\tCLO" );
- p = dump( p );
- break;
- case OPT:
- qDebug( "\tOPT" );
- p = dump( p );
- break;
- }
- }
- qDebug( "\tEND" );
- return p+1;
-}
-#endif // DEBUG
-
-
-
-/*!
- \internal
- Compiles the regular expression and stores the result in rxdata.
- The 'error' flag is set to non-zero if an error is detected.
- NOTE! This function is not reentrant!
-*/
-
-void QRegExp::compile()
-{
- const int maxlen = 1024; // max length of regexp array
- uint rxarray[ maxlen ]; // tmp regexp array
-
- if ( rxdata ) { // delete old data
- delete [] rxdata;
- rxdata = 0;
- }
- if ( rxstring.isEmpty() ) { // no regexp pattern set
- error = PatNull;
- return;
- }
-
- error = PatOk; // assume pattern is ok
-
- QCString pattern;
- if ( wc )
- pattern = wc2rx(rxstring);
- else
- pattern = rxstring;
- const char *start = pattern.data(); // pattern pointer
- const char *p = start; // pattern pointer
- uint pl = pattern.length();
- uint *d = rxarray; // data pointer
- uint *prev_d = 0;
-
-#define GEN(x) *d++ = (x)
-
- while ( pl ) {
- char ch = (char)*p;
- switch ( ch ) {
-
- case '^': // beginning of line
- prev_d = d;
- GEN( p == start ? BOL : (CHR | ch) );
- p++;
- pl--;
- break;
-
- case '$': // end of line
- prev_d = d;
- GEN( pl == 1 ? EOL : (CHR | ch) );
- p++;
- pl--;
- break;
-
- case '.': // any char
- prev_d = d;
- GEN( ANY );
- p++;
- pl--;
- break;
-
- case '[': // character class
- {
- prev_d = d;
- p++;
- pl--;
- if ( !pl ) {
- error = PatSyntax;
- return;
- }
- bool firstIsEscaped = ( (char)*p == '\\' );
- uint cch = char_val( &p, &pl );
- if ( cch == '^' && !firstIsEscaped ) { // negate!
- GEN( CCN );
- if ( !pl ) {
- error = PatSyntax;
- return;
- }
- cch = char_val( &p, &pl );
- } else {
- GEN( CCL );
- }
- uint numFields = 0;
- while ( pl ) {
- if ((pl>2) && ((char)*p == '-') && ((char)*(p+1) != ']')) {
- // Found a range
- char_val( &p, &pl ); // Read the '-'
- uint cch2 = char_val( &p, &pl ); // Read the range end
- if ( cch > cch2 ) { // swap start and stop
- int tmp = cch;
- cch = cch2;
- cch2 = tmp;
- }
- GEN( (cch << 16) | cch2 ); // from < to
- numFields++;
- }
- else {
- // Found a single character
- if ( cch & MCD ) // It's a code; will not be mistaken
- GEN( cch ); // for a range, since from > to
- else
- GEN( (cch << 16) | cch ); // from == to range
- numFields++;
- }
- if ( d >= rxarray + maxlen ) { // pattern too long
- error = PatOverflow;
- return;
- }
- if ( !pl ) { // At least ']' should be left
- error = PatSyntax;
- return;
- }
- bool nextIsEscaped = ( (char)*p == '\\' );
- cch = char_val( &p, &pl );
- if ( cch == (uint)']' && !nextIsEscaped )
- break;
- if ( !pl ) { // End, should have seen ']'
- error = PatSyntax;
- return;
- }
- }
- *prev_d |= numFields; // Store number of fields
- }
- break;
-
- case '*': // Kleene closure, or
- case '+': // positive closure, or
- case '?': // optional closure
- {
- if ( prev_d == 0 ) { // no previous expression
- error = PatSyntax; // empty closure
- return;
- }
- switch ( *prev_d ) { // test if invalid closure
- case BOL:
- case BOW:
- case EOW:
- case CLO:
- case OPT:
- error = PatSyntax;
- return;
- }
- int ddiff = (int)(d - prev_d);
- if ( *p == '+' ) { // convert to Kleene closure
- if ( d + ddiff >= rxarray + maxlen ) {
- error = PatOverflow; // pattern too long
- return;
- }
- memcpy( d, prev_d, ddiff*sizeof(uint) );
- d += ddiff;
- prev_d += ddiff;
- }
- memmove( prev_d+1, prev_d, ddiff*sizeof(uint) );
- *prev_d = ch == '?' ? OPT : CLO;
- d++;
- GEN( END );
- p++;
- pl--;
- }
- break;
-
- default:
- {
- prev_d = d;
- uint cv = char_val( &p, &pl );
- if ( cv & MCD ) { // It's a code
- GEN( cv );
- }
- else {
- if ( !cs && cv <= 0xff ) // #only 8bit support
- cv = tolower( cv );
- GEN( CHR | cv );
- }
- }
- }
- if ( d >= rxarray + maxlen ) { // oops!
- error = PatOverflow; // pattern too long
- return;
- }
- }
- GEN( END );
- int len = (int)(d - rxarray);
- rxdata = new uint[ len ]; // copy from rxarray to rxdata
- CHECK_PTR( rxdata );
- memcpy( rxdata, rxarray, len*sizeof(uint) );
-#if defined(DEBUG)
- //dump( rxdata ); // uncomment this line for debugging
-#endif
-}
diff --git a/qtools/qregexp.h b/qtools/qregexp.h
deleted file mode 100644
index 4bb0230..0000000
--- a/qtools/qregexp.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QRegExp class
-**
-** Created : 950126
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QREGEXP_H
-#define QREGEXP_H
-
-#ifndef QT_H
-#include "qcstring.h"
-#endif // QT_H
-
-
-class Q_EXPORT QRegExp
-{
-public:
- QRegExp();
- QRegExp( const QCString &, bool caseSensitive=TRUE, bool wildcard=FALSE );
- QRegExp( const QRegExp & );
- ~QRegExp();
- QRegExp &operator=( const QRegExp & );
- QRegExp &operator=( const QCString &pattern );
-
- bool operator==( const QRegExp & ) const;
- bool operator!=( const QRegExp &r ) const
- { return !(this->operator==(r)); }
-
- bool isEmpty() const { return rxdata == 0; }
- bool isValid() const { return error == 0; }
-
- bool caseSensitive() const { return cs; }
- void setCaseSensitive( bool );
-
- bool wildcard() const { return wc; }
- void setWildcard( bool );
-
- QCString pattern() const { return rxstring; }
- // ### in Qt 3.0, provide a real implementation
- void setPattern( const QCString& pattern )
- { operator=( pattern ); }
-
- int match( const QCString &str, int index=0, int *len=0,
- bool indexIsStart = TRUE ) const;
- int find( const QCString& str, int index )
- { return match( str, index ); }
-
-protected:
- void compile();
- const char *matchstr( uint *, const char *, uint, const char * ) const;
-
-private:
- QCString rxstring; // regular expression pattern
- uint *rxdata; // compiled regexp pattern
- int error; // error status
- bool cs; // case sensitive
- bool wc; // wildcard
-};
-
-
-#endif // QREGEXP_H
diff --git a/qtools/qshared.h b/qtools/qshared.h
deleted file mode 100644
index 58ad6fc..0000000
--- a/qtools/qshared.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QShared struct
-**
-** Created : 940112
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QSHARED_H
-#define QSHARED_H
-
-#ifndef QT_H
-#include "qglobal.h"
-#endif // QT_H
-
-#include <atomic>
-
-
-struct QShared
-{
- QShared() : count(1) { }
- void ref() { count++; }
- bool deref() { return !--count; }
- std::atomic_uint count;
-};
-
-
-#endif // QSHARED_H
diff --git a/qtools/qsortedlist.doc b/qtools/qsortedlist.doc
deleted file mode 100644
index 6f16f19..0000000
--- a/qtools/qsortedlist.doc
+++ /dev/null
@@ -1,94 +0,0 @@
-/****************************************************************************
-**
-**
-** QSortedList documentation
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-
-/*****************************************************************************
- QSortedList documentation
- *****************************************************************************/
-
-/*!
- \class QSortedList qsortedlist.h
- \brief The QSortedList class provides a list sorted by operator< and operator==
-
- \ingroup collection
- \ingroup tools
-
- If you want to sort a QList you have to reimplement the
- QGList::compareItems() method. If the elements of your list support
- operator<() and operator==() then you can use QSortedList instead.
- Its compareItems() calls operator<() and operator==() and returns an
- appropriate result.
-
- Otherwise, this is as QList.
-
- \sa QList, \link collection.html Collection Classes\endlink
-*/
-
-
-/*!
- \fn QSortedList::QSortedList()
- Constructs an empty list.
-*/
-
-/*!
- \fn QSortedList::QSortedList( const QSortedList<type> &list )
- Constructs a copy of \e list.
-
- Each item in \e list is copied to this new list.
-*/
-
-/*!
- \fn QSortedList::~QSortedList()
- Removes all items from the list and destroys the list.
-
- All list iterators that access this list will be reset.
-*/
-
-/*!
- \fn QSortedList<type>& QSortedList::operator=(const QSortedList<type>& list)
- Assigns \e list to this list and returns a reference to this list.
-
- This list is first cleared, then each item in \e list is
- appended to this list. Only the pointers are copied
- (shallow copy), unless newItem() has been reimplemented().
-*/
-
-/*!
- \fn int QSortedList::compareItems( QCollection::Item s1, QCollection::Item s2 )
-
- \reimp
-
- This reimplementation uses operator< and operator== to compare.
-*/
diff --git a/qtools/qsortedlist.h b/qtools/qsortedlist.h
deleted file mode 100644
index aeadd90..0000000
--- a/qtools/qsortedlist.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QList template/macro class
-**
-** Created : 920701
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QSORTEDLIST_H
-#define QSORTEDLIST_H
-
-#ifndef QT_H
-#include "qlist.h"
-#endif // QT_H
-
-
-template<class type> class Q_EXPORT QSortedList : public QList<type>
-{
-public:
- QSortedList() {}
- QSortedList( const QSortedList<type> &l ) : QList<type>(l) {}
- ~QSortedList() { clear(); }
- QSortedList<type> &operator=(const QSortedList<type> &l)
- { return (QSortedList<type>&)QList<type>::operator=(l); }
-
- virtual int compareItems( QCollection::Item s1, QCollection::Item s2 )
- { if ( *((type*)s1) == *((type*)s2) ) return 0; return ( *((type*)s1) < *((type*)s2) ? -1 : 1 ); }
-};
-
-#endif
diff --git a/qtools/qstack.doc b/qtools/qstack.doc
deleted file mode 100644
index ece1e2a..0000000
--- a/qtools/qstack.doc
+++ /dev/null
@@ -1,135 +0,0 @@
-/****************************************************************************
-**
-**
-** QStack class documentation
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-
-/*****************************************************************************
- QStack documentation
- *****************************************************************************/
-
-/*!
- \class QStack qstack.h
- \brief The QStack class is a template class that provides a stack.
-
- \ingroup collection
- \ingroup tools
-
- QStack is implemented as a template class. Define a template
- instance QStack\<X\> to create a stack that operates on pointers to
- X, or X*.
-
- A stack is a Last In, First Out (LIFO) structure. Items are added to
- the top of the stack with push() and retrieved from the top
- with pop().
-
- \sa \link collection.html Collection Classes\endlink
-*/
-
-/*! \fn QStack::QStack ()
- Creates and empty stack.
-*/
-
-/*! \fn QStack::QStack (const QStack<type>& s)
- Creates a stack by making a shallow copy of another stack.
-*/
-
-/*! \fn QStack::~QStack ()
- Destroys the stack. All items will be deleted if autoDelete() is TRUE.
-*/
-
-/*! \fn QStack<type>& QStack::operator= (const QStack<type>& s)
- Sets the contents of this stack by making a shallow copy of another stack.
- Elements currently in this stack will be deleted if autoDelete() is TRUE.
-*/
-
-/*! \fn bool QStack::isEmpty () const
- Returns TRUE is the stack contains no elements to be \link pop() popped\endlink.
-*/
-
-/*! \fn void QStack::push (const type* d)
- Adds an element to the top of the stack. Last in, first out.
-*/
-
-/*! \fn type* QStack::pop ()
- Removes the top item from the stack and returns it.
-*/
-
-/*! \fn bool QStack::remove ()
- Removes the top item from the stack and deletes it if
- autoDelete() is TRUE. Returns TRUE if there was an item to pop.
-
- \sa clear()
-*/
-
-/*! \fn void QStack::clear()
- Removes all items from the stack, deleting them if
- autoDelete() is TRUE.
-
- \sa remove()
-*/
-
-/*! \fn uint QStack::count() const
- Returns the number of items in the stack.
-
- \sa isEmpty()
-*/
-
-/*! \fn type* QStack::top () const
- Returns a reference to the top item on the stack (most recently pushed).
- The stack is not changed.
-*/
-
-/*! \fn QStack::operator type* ()const
- Returns a reference to the top item on the stack (most recently pushed).
- The stack is not changed.
-*/
-
-/*! \fn type* QStack::current () const
- Returns a reference to the top item on the stack (most recently pushed).
- The stack is not changed.
-*/
-
-/*! \fn bool QStack::autoDelete() const
-
- The same as QCollection::autoDelete().
-
- \sa setAutoDelete()
-*/
-
-/*! \fn void QStack::setAutoDelete( bool enable )
-
- The same as QCollection::setAutoDelete().
-
- \sa autoDelete()
-*/
diff --git a/qtools/qstack.h b/qtools/qstack.h
deleted file mode 100644
index c84d8d2..0000000
--- a/qtools/qstack.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QStack template/macro class
-**
-** Created : 920917
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QSTACK_H
-#define QSTACK_H
-
-#ifndef QT_H
-#include "qglist.h"
-#endif // QT_H
-
-
-template<class type> class QStack : private QGList
-{
-public:
- QStack() {}
- QStack( const QStack<type> &s ) : QGList(s) {}
- ~QStack() { clear(); }
- QStack<type> &operator=(const QStack<type> &s)
- { return (QStack<type>&)QGList::operator=(s); }
- bool autoDelete() const { return QCollection::autoDelete(); }
- void setAutoDelete( bool del ) { QCollection::setAutoDelete(del); }
- uint count() const { return QGList::count(); }
- bool isEmpty() const { return QGList::count() == 0; }
- void push( const type *d ) { QGList::insertAt(0,Item(d)); }
- type *pop() { return (type *)QGList::takeFirst(); }
- bool remove() { return QGList::removeFirst(); }
- void clear() { QGList::clear(); }
- type *bottom() const { return (type *)QGList::clast(); }
- type *top() const { return (type *)QGList::cfirst(); }
- operator type *() const { return (type *)QGList::cfirst(); }
- type *current() const { return (type *)QGList::cfirst(); }
-private:
- void deleteItem( Item d ) { if ( del_item ) delete (type *)d; }
-};
-
-
-#endif // QSTACK_H
diff --git a/qtools/qstring.cpp b/qtools/qstring.cpp
deleted file mode 100644
index 3d57839..0000000
--- a/qtools/qstring.cpp
+++ /dev/null
@@ -1,15426 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of the QString class and related Unicode functions
-**
-** Created : 920722
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-// Don't define it while compiling this module, or USERS of Qt will
-// not be able to link.
-#ifdef QT_NO_CAST_ASCII
-#undef QT_NO_CAST_ASCII
-#endif
-
-#include "qstring.h"
-#include "qregexp.h"
-#include "qdatastream.h"
-#include "qtextcodec.h"
-#include "qstack.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <limits.h>
-
-
-/* -------------------------------------------------------------------------
- * unicode information
- * these tables are generated from the unicode reference file
- * ftp://ftp.unicode.org/Public/3.0-Update/UnicodeData-3.0.0.html
- *
- * Lars Knoll <knoll@mpi-hd.mpg.de>
- * -------------------------------------------------------------------------
- */
-
-/* Perl script to generate (run perl -x tools/qstring.cpp)
-
-#!perl
-
-sub numberize
-{
- my(%r, $n, $id);
- for $id ( @_ ) {
- $id="" if $id eq "EMPTY";
- $r{$id}=$n++;
- }
- return %r;
-}
-
-
-# Code to integer mappings...
-#
-%category_code = numberize(qw{
- EMPTY
- Mn Mc Me
- Nd Nl No
- Zs Zl Zp
- Cc Cf Cs Co Cn
-
- Lu Ll Lt Lm Lo
- Pc Pd Ps Pe Pi Pf Po
- Sm Sc Sk So
-});
-%bidi_category_code = numberize(qw{
- L R EN ES ET AN CS B S WS ON LRE LRO AL RLE RLO PDF NSM BN});
-%character_decomposition_tag = numberize(qw{
- <single> <canonical> <font> <noBreak> <initial> <medial>
- <final> <isolated> <circle> <super> <sub> <vertical>
- <wide> <narrow> <small> <square> <compat> <fraction>
-});
-%mirrored_code = numberize(qw{N Y});
-
-%joining_code = numberize(qw{U D R C});
-
-# Read data into hashes...
-#
-open IN, "UnicodeData.txt";
-$position = 1;
-while (<IN>) {
- @fields = split /;/;
- $code = shift @fields;
- for $n (qw{
- name category combining_class bidi_category
- character_decomposition decimal_digit_value digit_value
- numeric_value mirrored oldname comment
- uppercase lowercase titlecase})
- {
- $id = shift @fields;
- $codes = "${n}_code";
- if ( defined %$codes && defined $$codes{$id} ) {
- $id = $$codes{$id};
- }
- ${$n}{$code}=$id;
- }
- $decomp = $character_decomposition{$code};
- if ( length $decomp == 0 ) {
- $decomp = "<single>";
- }
- if (substr($decomp, 0, 1) ne '<') {
- $decomp = "<canonical> " . $decomp;
- }
- @fields = split(" ", $decomp);
- $tag = shift @fields;
- $tag = $character_decomposition_tag{$tag};
- $decomp = join( ", 0x", @fields );
- $decomp = "0x".$decomp;
- $decomposition{$code} = $decomp;
- $decomposition_tag{$code} = $tag;
- $decomposition_pos{$code} = $position;
- $len = scalar(@fields);
- $decomposition_len{$code} = $len;
-
-# we use canonical decompositions longer than 1 char
-# and all arabic ligatures for the ligature table
- if(($len > 1 and $tag == 1) or ($tag > 3 and $tag < 8)) {
-# ligature to add...
- $start = shift @fields;
- $ligature{$start} = $ligature{$start}." ".$code;
- }
-
-# adjust position
- if($len != 0) {
- $position += $len + 3;
- }
-
-
-}
-
-open IN2, "ArabicShaping.txt";
-$position = 1;
-while (<IN2>) {
- @fields = split /;/;
- $code = shift @fields;
- $dummy = shift @fields;
- $join = shift @fields;
- $join =~ s/ //g;
- $join = $joining_code{$join};
- $joining{$code}=$join;
-}
-
-# Build pages...
-#
-$rowtable_txt =
- "static const Q_UINT8 * const unicode_info[256] = {";
-for $row ( 0..255 ) {
- $nonzero=0;
- $txt = "";
- for $cell ( 0..255 ) {
- $code = sprintf("%02X%02X",$row,$cell);
- $info = $category{$code};
- $info = 0 if !defined $info;
- $txt .= "\n " if $cell%8 == 0;
- $txt .= "$info, ";
- }
- $therow = $row{$txt};
- if ( !defined $therow ) {
- $size+=256;
- $therow = "ui_".sprintf("%02X",$row);
- $rowtext{$therow} =
- "static const Q_UINT8 ${therow}[] = {$txt\n};\n\n";
- $row{$txt}=$therow;
- }
- $rowtable_txt .= "\n " if $row%8 == 0;
- $rowtable_txt .= "$therow, ";
-}
-
-print "// START OF GENERATED DATA\n\n";
-print "#ifndef QT_NO_UNICODETABLES\n\n";
-
-# Print pages...
-#
-for $r ( sort keys %rowtext ) {
- print $rowtext{$r};
-}
-print "$rowtable_txt\n};\n";
-$size += 256*4;
-print "// $size bytes\n\n";
-
-# Build decomposition tables
-#
-$rowtable_txt =
- "static const Q_UINT16 * const decomposition_info[256] = {";
-$table_txt =
- "static const Q_UINT16 decomposition_map[] = {\n 0,\n";
-for $row ( 0..255 ) {
- $nonzero=0;
- $txt = "";
- for $cell ( 0..255 ) {
- $code = sprintf("%02X%02X",$row,$cell);
- $txt .= "\n " if $cell%8 == 0;
- if( $decomposition_tag{$code} != 0 ) {
- $txt .= " $decomposition_pos{$code},";
- $table_txt .= " $decomposition_tag{$code},";
- $table_txt .= " 0x$code,";
- $table_txt .= " $decomposition{$code}, 0,\n";
- $size += 2 * $decomposition_len{$code} + 6;
- } else {
- $txt .= " 0,";
- }
- }
- $therow = $row{$txt};
- if ( !defined $therow ) {
- $size+=512;
- $therow = "di_".sprintf("%02X",$row);
- $dec_rowtext{$therow} =
- "static const Q_UINT16 ${therow}[] = {$txt\n};\n\n";
- $row{$txt}=$therow;
- }
- $rowtable_txt .= "\n " if $row%8 == 0;
- $rowtable_txt .= "$therow, ";
-}
-
-# Print decomposition tables
-#
-print "$table_txt\n};\n\n";
-for $r ( sort keys %dec_rowtext ) {
- print $dec_rowtext{$r};
-}
-print "$rowtable_txt\n};\n";
-$size += 256*4;
-print "// $size bytes\n\n";
-
-
-# build ligature tables
-#
-$size = 0;
-$position = 1;
-$rowtable_txt =
- "static const Q_UINT16 * const ligature_info[256] = {";
-$table_txt =
- "static const Q_UINT16 ligature_map[] = {\n 0,\n";
-for $lig_row ( 0..255 ) {
- $nonzero=0;
- $txt = "";
- for $cell ( 0..255 ) {
- $code = sprintf("%02X%02X",$lig_row,$cell);
- $txt .= "\n " if $cell%8 == 0;
- if( defined $ligature{$code} ) {
- $txt .= " $position,";
- @ligature = split(" ", $ligature{$code});
-# we need to sort ligatures according to their length.
-# long ones have to come first!
- @ligature_sort = sort { $decomposition_len{$b} <=> $decomposition_len{$a} } @ligature;
-# now replace each code by it's position in
-# the decomposition map.
- undef(@lig_pos);
- for $n (@ligature_sort) {
- push(@lig_pos, $decomposition_pos{$n});
- }
-# debug info
- if( 0 ) {
- print "ligatures: $ligature{$code}\n";
- $sort = join(" ", @ligature_sort);
- print "sorted : $sort\n";
- }
- $lig = join(", ", @lig_pos);
- $table_txt .= " $lig, 0,\n";
- $size += 2 * scalar(@ligature) + 2;
- $position += scalar(@ligature) + 1;
- } else {
- $txt .= " 0,";
- }
- }
- $therow = $lig_row{$txt};
- if ( !defined $therow ) {
- $size+=512;
- $therow = "li_".sprintf("%02X",$lig_row);
- $lig_rowtext{$therow} =
- "static const Q_UINT16 ${therow}[] = {$txt\n};\n\n";
- $lig_row{$txt}=$therow;
- }
- $rowtable_txt .= "\n " if $lig_row%8 == 0;
- $rowtable_txt .= "$therow, ";
-}
-
-# Print ligature tables
-#
-print "$table_txt\n};\n\n";
-for $r ( sort keys %lig_rowtext ) {
- print $lig_rowtext{$r};
-}
-print "$rowtable_txt\n};\n";
-$size += 256*4;
-print "// $size bytes\n\n";
-
-
-
-# Build direction/joining/mirrored pages...
-#
-$rowtable_txt =
- "static const Q_UINT8 * const direction_info[256] = {";
-for $dir_row ( 0..255 ) {
- $nonzero=0;
- $txt = "";
- for $cell ( 0..255 ) {
- $code = sprintf("%02X%02X",$dir_row,$cell);
- $dir = $bidi_category{$code};
- $dir = 0 if !defined $dir;
- $join = $joining{$code};
- $join = 0 if !defined $join;
- $mirr = $mirrored{$code};
- $mirr = 0 if !defined $mirr;
- $info = $dir + 32*$join + 128*$mirr;
- $txt .= "\n " if $cell%8 == 0;
- $txt .= "$info, ";
- }
- $therow = $dir_row{$txt};
- if ( !defined $therow ) {
- $size+=256;
- $therow = "dir_".sprintf("%02X",$dir_row);
- $dir_rowtext{$therow} =
- "static const Q_UINT8 ${therow}[] = {$txt\n};\n\n";
- $dir_row{$txt}=$therow;
- }
- $rowtable_txt .= "\n " if $dir_row%8 == 0;
- $rowtable_txt .= "$therow, ";
-}
-
-# Print pages...
-#
-for $r ( sort keys %dir_rowtext ) {
- print $dir_rowtext{$r};
-}
-print "$rowtable_txt\n};\n";
-$size += 256*4;
-print "// $size bytes\n\n";
-
-
-
-print "#endif\n\n";
-print "// END OF GENERATED DATA\n\n";
-
-
-__END__
-
-*/
-
-
-// START OF GENERATED DATA
-
-static const Q_UINT8 ui_00[] = {
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 7, 26, 26, 26, 28, 26, 26, 26,
- 22, 23, 26, 27, 26, 21, 26, 26,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 26, 26, 27, 27, 27, 26,
- 26, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 22, 26, 23, 29, 20,
- 29, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 22, 27, 23, 27, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 7, 26, 28, 28, 28, 28, 30, 30,
- 29, 30, 16, 24, 27, 21, 30, 29,
- 30, 27, 6, 6, 29, 16, 30, 26,
- 29, 6, 16, 25, 6, 6, 6, 26,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 27,
- 15, 15, 15, 15, 15, 15, 15, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 27,
- 16, 16, 16, 16, 16, 16, 16, 16,
-};
-
-#ifndef QT_NO_UNICODETABLES
-
-static const Q_UINT8 ui_01[] = {
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 16, 15, 16, 15, 16, 15, 16, 15,
- 16, 15, 16, 15, 16, 15, 16, 15,
- 16, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 15, 16, 15, 16, 15, 16, 16,
- 16, 15, 15, 16, 15, 16, 15, 15,
- 16, 15, 15, 15, 16, 16, 15, 15,
- 15, 15, 16, 15, 15, 16, 15, 15,
- 15, 16, 16, 16, 15, 15, 16, 15,
- 15, 16, 15, 16, 15, 16, 15, 15,
- 16, 15, 16, 16, 15, 16, 15, 15,
- 16, 15, 15, 15, 16, 15, 16, 15,
- 15, 16, 16, 19, 15, 16, 16, 16,
- 19, 19, 19, 19, 15, 17, 16, 15,
- 17, 16, 15, 17, 16, 15, 16, 15,
- 16, 15, 16, 15, 16, 15, 16, 15,
- 16, 15, 16, 15, 16, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 16, 15, 17, 16, 15, 16, 15, 15,
- 15, 16, 15, 16, 15, 16, 15, 16,
-};
-
-static const Q_UINT8 ui_02[] = {
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 0, 0, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 0, 0,
- 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 29, 29, 18, 18, 18, 18, 18,
- 18, 18, 29, 29, 29, 29, 29, 29,
- 29, 29, 29, 29, 29, 29, 29, 29,
- 18, 18, 29, 29, 29, 29, 29, 29,
- 29, 29, 29, 29, 29, 29, 29, 29,
- 18, 18, 18, 18, 18, 29, 29, 29,
- 29, 29, 29, 29, 29, 29, 18, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_03[] = {
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 29, 29, 0, 0,
- 0, 0, 18, 0, 0, 0, 26, 0,
- 0, 0, 0, 0, 29, 29, 15, 26,
- 15, 15, 15, 0, 15, 0, 15, 15,
- 16, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 0, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 0,
- 16, 16, 15, 15, 15, 16, 16, 16,
- 0, 0, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 16, 16, 16, 16, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_04[] = {
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 30, 1, 1, 1, 1, 0,
- 3, 3, 0, 0, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 15, 16, 15, 16, 0, 0, 15,
- 16, 0, 0, 15, 16, 0, 0, 0,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 0, 0,
- 15, 16, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_05[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 0,
- 0, 18, 26, 26, 26, 26, 26, 26,
- 0, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 0, 26, 21, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 0, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 0, 1, 1, 1, 26, 1,
- 26, 1, 1, 26, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 0, 0, 0, 0, 0,
- 19, 19, 19, 26, 26, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_06[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 26, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 26, 0, 0, 0, 26,
- 0, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 0, 0, 0, 0, 0,
- 18, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 26, 26, 26, 26, 0, 0,
- 1, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 26, 19, 1, 1,
- 1, 1, 1, 1, 1, 3, 3, 1,
- 1, 1, 1, 1, 1, 18, 18, 1,
- 1, 30, 1, 1, 1, 1, 0, 0,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 19, 19, 19, 30, 30, 0,
-};
-
-static const Q_UINT8 ui_07[] = {
- 26, 26, 26, 26, 26, 26, 26, 26,
- 26, 26, 26, 26, 26, 26, 0, 11,
- 19, 1, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_08[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_09[] = {
- 0, 1, 1, 2, 0, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 0, 0, 1, 19, 2, 2,
- 2, 1, 1, 1, 1, 1, 1, 1,
- 1, 2, 2, 2, 2, 1, 0, 0,
- 19, 1, 1, 1, 1, 0, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 1, 1, 26, 26, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 26, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 2, 2, 0, 19, 19, 19,
- 19, 19, 19, 19, 19, 0, 0, 19,
- 19, 0, 0, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 0, 19, 19, 19, 19, 19, 19,
- 19, 0, 19, 0, 0, 0, 19, 19,
- 19, 19, 0, 0, 1, 0, 2, 2,
- 2, 1, 1, 1, 1, 0, 0, 2,
- 2, 0, 0, 2, 2, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 2,
- 0, 0, 0, 0, 19, 19, 0, 19,
- 19, 19, 1, 1, 0, 0, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 19, 19, 28, 28, 6, 6, 6, 6,
- 6, 6, 30, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_0A[] = {
- 0, 0, 1, 0, 0, 19, 19, 19,
- 19, 19, 19, 0, 0, 0, 0, 19,
- 19, 0, 0, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 0, 19, 19, 19, 19, 19, 19,
- 19, 0, 19, 19, 0, 19, 19, 0,
- 19, 19, 0, 0, 1, 0, 2, 2,
- 2, 1, 1, 0, 0, 0, 0, 1,
- 1, 0, 0, 1, 1, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 19, 19, 19, 19, 0, 19, 0,
- 0, 0, 0, 0, 0, 0, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 1, 1, 19, 19, 19, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1, 1, 2, 0, 19, 19, 19,
- 19, 19, 19, 19, 0, 19, 0, 19,
- 19, 19, 0, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 0, 19, 19, 19, 19, 19, 19,
- 19, 0, 19, 19, 0, 19, 19, 19,
- 19, 19, 0, 0, 1, 19, 2, 2,
- 2, 1, 1, 1, 1, 1, 0, 1,
- 1, 2, 0, 2, 2, 1, 0, 0,
- 19, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 19, 0, 0, 0, 0, 0, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_0B[] = {
- 0, 1, 2, 2, 0, 19, 19, 19,
- 19, 19, 19, 19, 19, 0, 0, 19,
- 19, 0, 0, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 0, 19, 19, 19, 19, 19, 19,
- 19, 0, 19, 19, 0, 0, 19, 19,
- 19, 19, 0, 0, 1, 19, 2, 1,
- 2, 1, 1, 1, 0, 0, 0, 2,
- 2, 0, 0, 2, 2, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 1, 2,
- 0, 0, 0, 0, 19, 19, 0, 19,
- 19, 19, 0, 0, 0, 0, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 30, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1, 2, 0, 19, 19, 19,
- 19, 19, 19, 0, 0, 0, 19, 19,
- 19, 0, 19, 19, 19, 19, 0, 0,
- 0, 19, 19, 0, 19, 0, 19, 19,
- 0, 0, 0, 19, 19, 0, 0, 0,
- 19, 19, 19, 0, 0, 0, 19, 19,
- 19, 19, 19, 19, 19, 19, 0, 19,
- 19, 19, 0, 0, 0, 0, 2, 2,
- 1, 2, 2, 0, 0, 0, 2, 2,
- 2, 0, 2, 2, 2, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 2,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 6, 6, 6, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_0C[] = {
- 0, 2, 2, 2, 0, 19, 19, 19,
- 19, 19, 19, 19, 19, 0, 19, 19,
- 19, 0, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 0, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 0, 19, 19, 19,
- 19, 19, 0, 0, 0, 0, 1, 1,
- 1, 2, 2, 2, 2, 0, 1, 1,
- 1, 0, 1, 1, 1, 1, 0, 0,
- 0, 0, 0, 0, 0, 1, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 19, 19, 0, 0, 0, 0, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 2, 2, 0, 19, 19, 19,
- 19, 19, 19, 19, 19, 0, 19, 19,
- 19, 0, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 0, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 0, 19, 19, 19,
- 19, 19, 0, 0, 0, 0, 2, 1,
- 2, 2, 2, 2, 2, 0, 1, 2,
- 2, 0, 2, 2, 1, 1, 0, 0,
- 0, 0, 0, 0, 0, 2, 2, 0,
- 0, 0, 0, 0, 0, 0, 19, 0,
- 19, 19, 0, 0, 0, 0, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_0D[] = {
- 0, 0, 2, 2, 0, 19, 19, 19,
- 19, 19, 19, 19, 19, 0, 19, 19,
- 19, 0, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 0, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 0, 0, 0, 0, 2, 2,
- 2, 1, 1, 1, 0, 0, 2, 2,
- 2, 0, 2, 2, 2, 1, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 2,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 19, 19, 0, 0, 0, 0, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 2, 2, 0, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 0,
- 0, 0, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 0, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 0, 19, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 0,
- 0, 0, 1, 0, 0, 0, 0, 2,
- 2, 2, 1, 1, 1, 0, 1, 0,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 2, 2, 26, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_0E[] = {
- 0, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 1, 19, 19, 1, 1, 1, 1,
- 1, 1, 1, 0, 0, 0, 0, 28,
- 19, 19, 19, 19, 19, 19, 18, 1,
- 1, 1, 1, 1, 1, 1, 1, 26,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 26, 26, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 19, 19, 0, 19, 0, 0, 19,
- 19, 0, 19, 0, 0, 19, 0, 0,
- 0, 0, 0, 0, 19, 19, 19, 19,
- 0, 19, 19, 19, 19, 19, 19, 19,
- 0, 19, 19, 19, 0, 19, 0, 19,
- 0, 0, 19, 19, 0, 19, 19, 19,
- 19, 1, 19, 19, 1, 1, 1, 1,
- 1, 1, 0, 1, 1, 19, 0, 0,
- 19, 19, 19, 19, 19, 0, 18, 0,
- 1, 1, 1, 1, 1, 1, 0, 0,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 0, 0, 19, 19, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_0F[] = {
- 19, 30, 30, 30, 26, 26, 26, 26,
- 26, 26, 26, 26, 26, 26, 26, 26,
- 26, 26, 26, 30, 30, 30, 30, 30,
- 1, 1, 30, 30, 30, 30, 30, 30,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 30, 1, 30, 1,
- 30, 1, 22, 23, 22, 23, 2, 2,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 0, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 0, 0, 0, 0, 0,
- 0, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 2,
- 1, 1, 1, 1, 1, 26, 1, 1,
- 19, 19, 19, 19, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 0, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 0, 30, 30,
- 30, 30, 30, 30, 30, 30, 1, 30,
- 30, 30, 30, 30, 30, 0, 0, 30,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_10[] = {
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 0, 19, 19, 19, 19, 19,
- 0, 19, 19, 0, 2, 1, 1, 1,
- 1, 2, 1, 0, 0, 0, 1, 1,
- 2, 1, 0, 0, 0, 0, 0, 0,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 26, 26, 26, 26, 26, 26,
- 19, 19, 19, 19, 19, 19, 2, 2,
- 1, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 0,
- 0, 0, 0, 26, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_11[] = {
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 0, 0, 0, 0, 0, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 0, 0, 0, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_12[] = {
- 19, 19, 19, 19, 19, 19, 19, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 0,
- 19, 0, 19, 19, 19, 19, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 0,
- 19, 0, 19, 19, 19, 19, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 0,
- 19, 0, 19, 19, 19, 19, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 0,
- 19, 0, 19, 19, 19, 19, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 0,
- 19, 0, 19, 19, 19, 19, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 0,
- 19, 19, 19, 19, 19, 19, 19, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
-};
-
-static const Q_UINT8 ui_13[] = {
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 0,
- 19, 0, 19, 19, 19, 19, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 0, 0, 0, 0, 0,
- 0, 26, 26, 26, 26, 26, 26, 26,
- 26, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_14[] = {
- 0, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
-};
-
-static const Q_UINT8 ui_15[] = {
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
-};
-
-static const Q_UINT8 ui_16[] = {
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 26, 26, 19,
- 19, 19, 19, 19, 19, 19, 19, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 7, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 22, 23, 0, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 26, 26, 26, 6, 6,
- 6, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_17[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 2, 2, 2, 1,
- 1, 1, 1, 1, 1, 1, 2, 2,
- 2, 2, 2, 2, 2, 2, 1, 2,
- 2, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 26, 26, 26, 26,
- 26, 26, 26, 28, 26, 0, 0, 0,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_18[] = {
- 26, 26, 26, 26, 26, 26, 21, 26,
- 26, 26, 26, 11, 11, 11, 11, 0,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 0, 0, 0, 0, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 18, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 1, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_1E[] = {
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 16, 16,
- 16, 16, 16, 16, 0, 0, 0, 0,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 15, 16, 15, 16, 15, 16,
- 15, 16, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_1F[] = {
- 16, 16, 16, 16, 16, 16, 16, 16,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 16, 16, 16, 16, 16, 16, 0, 0,
- 15, 15, 15, 15, 15, 15, 0, 0,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 16, 16, 16, 16, 16, 16, 0, 0,
- 15, 15, 15, 15, 15, 15, 0, 0,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 0, 15, 0, 15, 0, 15, 0, 15,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 0, 0,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 16, 16, 16, 16, 16, 0, 16, 16,
- 15, 15, 15, 15, 17, 29, 16, 29,
- 29, 29, 16, 16, 16, 0, 16, 16,
- 15, 15, 15, 15, 17, 29, 29, 29,
- 16, 16, 16, 16, 0, 0, 16, 16,
- 15, 15, 15, 15, 0, 29, 29, 29,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 15, 15, 15, 15, 15, 29, 29, 29,
- 0, 0, 16, 16, 16, 0, 16, 16,
- 15, 15, 15, 15, 17, 29, 29, 0,
-};
-
-static const Q_UINT8 ui_20[] = {
- 7, 7, 7, 7, 7, 7, 7, 7,
- 7, 7, 7, 7, 11, 11, 11, 11,
- 21, 21, 21, 21, 21, 21, 26, 26,
- 24, 25, 22, 24, 24, 25, 22, 24,
- 26, 26, 26, 26, 26, 26, 26, 26,
- 8, 9, 11, 11, 11, 11, 11, 7,
- 26, 26, 26, 26, 26, 26, 26, 26,
- 26, 24, 25, 26, 26, 26, 26, 20,
- 20, 26, 26, 26, 27, 22, 23, 0,
- 26, 26, 26, 26, 26, 26, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 11, 11, 11, 11, 11, 11,
- 6, 0, 0, 0, 6, 6, 6, 6,
- 6, 6, 27, 27, 27, 22, 23, 16,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 27, 27, 27, 22, 23, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 28, 28, 28, 28, 28, 28, 28, 28,
- 28, 28, 28, 28, 28, 28, 28, 28,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 3, 3, 3,
- 3, 1, 3, 3, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_21[] = {
- 30, 30, 15, 30, 30, 30, 30, 15,
- 30, 30, 16, 15, 15, 15, 16, 16,
- 15, 15, 15, 16, 30, 15, 30, 30,
- 30, 15, 15, 15, 15, 15, 30, 30,
- 30, 30, 30, 30, 15, 30, 15, 30,
- 15, 30, 15, 15, 15, 15, 30, 16,
- 15, 15, 30, 15, 16, 19, 19, 19,
- 19, 16, 30, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 5, 5, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 27, 27, 27, 27, 27, 30, 30, 30,
- 30, 30, 27, 27, 30, 30, 30, 30,
- 27, 30, 30, 27, 30, 30, 27, 30,
- 30, 30, 30, 30, 30, 30, 27, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 27, 27,
- 30, 30, 27, 30, 27, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_22[] = {
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 27, 27, 27, 27, 27, 27,
- 27, 27, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_23[] = {
- 30, 30, 30, 30, 30, 30, 30, 30,
- 27, 27, 27, 27, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 27, 27, 30, 30, 30, 30, 30, 30,
- 30, 22, 23, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 0, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_24[] = {
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 6, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_25[] = {
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 27,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 27, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_26[] = {
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 0, 0, 0, 0,
- 0, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 27,
- 30, 30, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_27[] = {
- 0, 30, 30, 30, 30, 0, 30, 30,
- 30, 30, 0, 0, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 0, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 0, 30, 0, 30,
- 30, 30, 30, 0, 0, 0, 30, 0,
- 30, 30, 30, 30, 30, 30, 30, 0,
- 0, 30, 30, 30, 30, 30, 30, 30,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 6, 6, 30, 0, 0, 0,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 0, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_28[] = {
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
-};
-
-static const Q_UINT8 ui_2E[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 0, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_2F[] = {
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_30[] = {
- 7, 26, 26, 26, 30, 18, 19, 5,
- 22, 23, 22, 23, 22, 23, 22, 23,
- 22, 23, 30, 30, 22, 23, 22, 23,
- 22, 23, 22, 23, 21, 22, 23, 23,
- 30, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 1, 1, 1, 1, 1, 1,
- 21, 18, 18, 18, 18, 18, 30, 30,
- 5, 5, 5, 0, 0, 0, 30, 30,
- 0, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 0, 0, 0,
- 0, 1, 1, 29, 29, 18, 18, 0,
- 0, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 20, 18, 18, 18, 0,
-};
-
-static const Q_UINT8 ui_31[] = {
- 0, 0, 0, 0, 0, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 0, 0, 0,
- 0, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 0,
- 30, 30, 6, 6, 6, 6, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_32[] = {
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 0, 0, 0,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 0, 0, 0, 30,
- 6, 6, 6, 6, 6, 6, 6, 6,
- 6, 6, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 0, 0, 0, 0,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 0,
-};
-
-static const Q_UINT8 ui_33[] = {
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 0,
- 0, 0, 0, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 0, 0,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 0,
-};
-
-static const Q_UINT8 ui_34[] = {
- 19, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_4D[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 19, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_9F[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 19, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_A4[] = {
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 0, 0, 0,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 0, 0, 30, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 30, 30, 30, 0, 30, 30, 30,
- 30, 30, 30, 30, 30, 30, 30, 30,
- 30, 0, 30, 30, 30, 0, 30, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_D7[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 19, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_D8[] = {
- 12, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_DB[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 12,
- 12, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 12,
-};
-
-static const Q_UINT8 ui_DF[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 12,
-};
-
-static const Q_UINT8 ui_E0[] = {
- 13, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_F8[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 13,
-};
-
-static const Q_UINT8 ui_FA[] = {
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_FB[] = {
- 16, 16, 16, 16, 16, 16, 16, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 16, 16, 16, 16, 16,
- 0, 0, 0, 0, 0, 19, 1, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 27, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 0,
- 19, 19, 19, 19, 19, 0, 19, 0,
- 19, 19, 0, 19, 19, 0, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
-};
-
-static const Q_UINT8 ui_FD[] = {
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 22, 23,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 0, 0, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 ui_FE[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 26, 21, 21, 20, 20, 22, 23, 22,
- 23, 22, 23, 22, 23, 22, 23, 22,
- 23, 22, 23, 22, 23, 0, 0, 0,
- 0, 26, 26, 26, 26, 20, 20, 20,
- 26, 26, 26, 0, 26, 26, 26, 26,
- 21, 22, 23, 22, 23, 22, 23, 26,
- 26, 26, 27, 21, 27, 27, 27, 0,
- 26, 28, 26, 26, 0, 0, 0, 0,
- 19, 19, 19, 0, 19, 0, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 0, 0, 11,
-};
-
-static const Q_UINT8 ui_FF[] = {
- 0, 26, 26, 26, 28, 26, 26, 26,
- 22, 23, 26, 27, 26, 21, 26, 26,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 26, 26, 27, 27, 27, 26,
- 26, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 15, 15, 15, 15, 15,
- 15, 15, 15, 22, 26, 23, 29, 20,
- 29, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 16, 16, 16, 16, 16,
- 16, 16, 16, 22, 27, 23, 27, 0,
- 0, 26, 22, 23, 26, 20, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 18, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 18, 18,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 19,
- 19, 19, 19, 19, 19, 19, 19, 0,
- 0, 0, 19, 19, 19, 19, 19, 19,
- 0, 0, 19, 19, 19, 19, 19, 19,
- 0, 0, 19, 19, 19, 19, 19, 19,
- 0, 0, 19, 19, 19, 0, 0, 0,
- 28, 28, 27, 29, 30, 28, 28, 0,
- 30, 27, 27, 27, 27, 30, 30, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 11, 11, 11, 30, 30, 0, 0,
-};
-
-static const Q_UINT8 * const unicode_info[256] = {
- ui_00, ui_01, ui_02, ui_03, ui_04, ui_05, ui_06, ui_07,
- ui_08, ui_09, ui_0A, ui_0B, ui_0C, ui_0D, ui_0E, ui_0F,
- ui_10, ui_11, ui_12, ui_13, ui_14, ui_15, ui_16, ui_17,
- ui_18, ui_08, ui_08, ui_08, ui_08, ui_08, ui_1E, ui_1F,
- ui_20, ui_21, ui_22, ui_23, ui_24, ui_25, ui_26, ui_27,
- ui_28, ui_08, ui_08, ui_08, ui_08, ui_08, ui_2E, ui_2F,
- ui_30, ui_31, ui_32, ui_33, ui_34, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_4D, ui_34, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_9F,
- ui_15, ui_15, ui_15, ui_15, ui_A4, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_34, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_D7,
- ui_D8, ui_08, ui_08, ui_DB, ui_D8, ui_08, ui_08, ui_DF,
- ui_E0, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08,
- ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08, ui_08,
- ui_F8, ui_15, ui_FA, ui_FB, ui_15, ui_FD, ui_FE, ui_FF,
-};
-// 15616 bytes
-
-static const Q_UINT16 decomposition_map [] = {
- 0,
- 3, 0x00A0, 0x0020, 0,
- 16, 0x00A8, 0x0020, 0x0308, 0,
- 9, 0x00AA, 0x0061, 0,
- 16, 0x00AF, 0x0020, 0x0304, 0,
- 9, 0x00B2, 0x0032, 0,
- 9, 0x00B3, 0x0033, 0,
- 16, 0x00B4, 0x0020, 0x0301, 0,
- 16, 0x00B5, 0x03BC, 0,
- 16, 0x00B8, 0x0020, 0x0327, 0,
- 9, 0x00B9, 0x0031, 0,
- 9, 0x00BA, 0x006F, 0,
- 17, 0x00BC, 0x0031, 0x2044, 0x0034, 0,
- 17, 0x00BD, 0x0031, 0x2044, 0x0032, 0,
- 17, 0x00BE, 0x0033, 0x2044, 0x0034, 0,
- 1, 0x00C0, 0x0041, 0x0300, 0,
- 1, 0x00C1, 0x0041, 0x0301, 0,
- 1, 0x00C2, 0x0041, 0x0302, 0,
- 1, 0x00C3, 0x0041, 0x0303, 0,
- 1, 0x00C4, 0x0041, 0x0308, 0,
- 1, 0x00C5, 0x0041, 0x030A, 0,
- 1, 0x00C7, 0x0043, 0x0327, 0,
- 1, 0x00C8, 0x0045, 0x0300, 0,
- 1, 0x00C9, 0x0045, 0x0301, 0,
- 1, 0x00CA, 0x0045, 0x0302, 0,
- 1, 0x00CB, 0x0045, 0x0308, 0,
- 1, 0x00CC, 0x0049, 0x0300, 0,
- 1, 0x00CD, 0x0049, 0x0301, 0,
- 1, 0x00CE, 0x0049, 0x0302, 0,
- 1, 0x00CF, 0x0049, 0x0308, 0,
- 1, 0x00D1, 0x004E, 0x0303, 0,
- 1, 0x00D2, 0x004F, 0x0300, 0,
- 1, 0x00D3, 0x004F, 0x0301, 0,
- 1, 0x00D4, 0x004F, 0x0302, 0,
- 1, 0x00D5, 0x004F, 0x0303, 0,
- 1, 0x00D6, 0x004F, 0x0308, 0,
- 1, 0x00D9, 0x0055, 0x0300, 0,
- 1, 0x00DA, 0x0055, 0x0301, 0,
- 1, 0x00DB, 0x0055, 0x0302, 0,
- 1, 0x00DC, 0x0055, 0x0308, 0,
- 1, 0x00DD, 0x0059, 0x0301, 0,
- 1, 0x00E0, 0x0061, 0x0300, 0,
- 1, 0x00E1, 0x0061, 0x0301, 0,
- 1, 0x00E2, 0x0061, 0x0302, 0,
- 1, 0x00E3, 0x0061, 0x0303, 0,
- 1, 0x00E4, 0x0061, 0x0308, 0,
- 1, 0x00E5, 0x0061, 0x030A, 0,
- 1, 0x00E7, 0x0063, 0x0327, 0,
- 1, 0x00E8, 0x0065, 0x0300, 0,
- 1, 0x00E9, 0x0065, 0x0301, 0,
- 1, 0x00EA, 0x0065, 0x0302, 0,
- 1, 0x00EB, 0x0065, 0x0308, 0,
- 1, 0x00EC, 0x0069, 0x0300, 0,
- 1, 0x00ED, 0x0069, 0x0301, 0,
- 1, 0x00EE, 0x0069, 0x0302, 0,
- 1, 0x00EF, 0x0069, 0x0308, 0,
- 1, 0x00F1, 0x006E, 0x0303, 0,
- 1, 0x00F2, 0x006F, 0x0300, 0,
- 1, 0x00F3, 0x006F, 0x0301, 0,
- 1, 0x00F4, 0x006F, 0x0302, 0,
- 1, 0x00F5, 0x006F, 0x0303, 0,
- 1, 0x00F6, 0x006F, 0x0308, 0,
- 1, 0x00F9, 0x0075, 0x0300, 0,
- 1, 0x00FA, 0x0075, 0x0301, 0,
- 1, 0x00FB, 0x0075, 0x0302, 0,
- 1, 0x00FC, 0x0075, 0x0308, 0,
- 1, 0x00FD, 0x0079, 0x0301, 0,
- 1, 0x00FF, 0x0079, 0x0308, 0,
- 1, 0x0100, 0x0041, 0x0304, 0,
- 1, 0x0101, 0x0061, 0x0304, 0,
- 1, 0x0102, 0x0041, 0x0306, 0,
- 1, 0x0103, 0x0061, 0x0306, 0,
- 1, 0x0104, 0x0041, 0x0328, 0,
- 1, 0x0105, 0x0061, 0x0328, 0,
- 1, 0x0106, 0x0043, 0x0301, 0,
- 1, 0x0107, 0x0063, 0x0301, 0,
- 1, 0x0108, 0x0043, 0x0302, 0,
- 1, 0x0109, 0x0063, 0x0302, 0,
- 1, 0x010A, 0x0043, 0x0307, 0,
- 1, 0x010B, 0x0063, 0x0307, 0,
- 1, 0x010C, 0x0043, 0x030C, 0,
- 1, 0x010D, 0x0063, 0x030C, 0,
- 1, 0x010E, 0x0044, 0x030C, 0,
- 1, 0x010F, 0x0064, 0x030C, 0,
- 1, 0x0112, 0x0045, 0x0304, 0,
- 1, 0x0113, 0x0065, 0x0304, 0,
- 1, 0x0114, 0x0045, 0x0306, 0,
- 1, 0x0115, 0x0065, 0x0306, 0,
- 1, 0x0116, 0x0045, 0x0307, 0,
- 1, 0x0117, 0x0065, 0x0307, 0,
- 1, 0x0118, 0x0045, 0x0328, 0,
- 1, 0x0119, 0x0065, 0x0328, 0,
- 1, 0x011A, 0x0045, 0x030C, 0,
- 1, 0x011B, 0x0065, 0x030C, 0,
- 1, 0x011C, 0x0047, 0x0302, 0,
- 1, 0x011D, 0x0067, 0x0302, 0,
- 1, 0x011E, 0x0047, 0x0306, 0,
- 1, 0x011F, 0x0067, 0x0306, 0,
- 1, 0x0120, 0x0047, 0x0307, 0,
- 1, 0x0121, 0x0067, 0x0307, 0,
- 1, 0x0122, 0x0047, 0x0327, 0,
- 1, 0x0123, 0x0067, 0x0327, 0,
- 1, 0x0124, 0x0048, 0x0302, 0,
- 1, 0x0125, 0x0068, 0x0302, 0,
- 1, 0x0128, 0x0049, 0x0303, 0,
- 1, 0x0129, 0x0069, 0x0303, 0,
- 1, 0x012A, 0x0049, 0x0304, 0,
- 1, 0x012B, 0x0069, 0x0304, 0,
- 1, 0x012C, 0x0049, 0x0306, 0,
- 1, 0x012D, 0x0069, 0x0306, 0,
- 1, 0x012E, 0x0049, 0x0328, 0,
- 1, 0x012F, 0x0069, 0x0328, 0,
- 1, 0x0130, 0x0049, 0x0307, 0,
- 16, 0x0132, 0x0049, 0x004A, 0,
- 16, 0x0133, 0x0069, 0x006A, 0,
- 1, 0x0134, 0x004A, 0x0302, 0,
- 1, 0x0135, 0x006A, 0x0302, 0,
- 1, 0x0136, 0x004B, 0x0327, 0,
- 1, 0x0137, 0x006B, 0x0327, 0,
- 1, 0x0139, 0x004C, 0x0301, 0,
- 1, 0x013A, 0x006C, 0x0301, 0,
- 1, 0x013B, 0x004C, 0x0327, 0,
- 1, 0x013C, 0x006C, 0x0327, 0,
- 1, 0x013D, 0x004C, 0x030C, 0,
- 1, 0x013E, 0x006C, 0x030C, 0,
- 16, 0x013F, 0x004C, 0x00B7, 0,
- 16, 0x0140, 0x006C, 0x00B7, 0,
- 1, 0x0143, 0x004E, 0x0301, 0,
- 1, 0x0144, 0x006E, 0x0301, 0,
- 1, 0x0145, 0x004E, 0x0327, 0,
- 1, 0x0146, 0x006E, 0x0327, 0,
- 1, 0x0147, 0x004E, 0x030C, 0,
- 1, 0x0148, 0x006E, 0x030C, 0,
- 16, 0x0149, 0x02BC, 0x006E, 0,
- 1, 0x014C, 0x004F, 0x0304, 0,
- 1, 0x014D, 0x006F, 0x0304, 0,
- 1, 0x014E, 0x004F, 0x0306, 0,
- 1, 0x014F, 0x006F, 0x0306, 0,
- 1, 0x0150, 0x004F, 0x030B, 0,
- 1, 0x0151, 0x006F, 0x030B, 0,
- 1, 0x0154, 0x0052, 0x0301, 0,
- 1, 0x0155, 0x0072, 0x0301, 0,
- 1, 0x0156, 0x0052, 0x0327, 0,
- 1, 0x0157, 0x0072, 0x0327, 0,
- 1, 0x0158, 0x0052, 0x030C, 0,
- 1, 0x0159, 0x0072, 0x030C, 0,
- 1, 0x015A, 0x0053, 0x0301, 0,
- 1, 0x015B, 0x0073, 0x0301, 0,
- 1, 0x015C, 0x0053, 0x0302, 0,
- 1, 0x015D, 0x0073, 0x0302, 0,
- 1, 0x015E, 0x0053, 0x0327, 0,
- 1, 0x015F, 0x0073, 0x0327, 0,
- 1, 0x0160, 0x0053, 0x030C, 0,
- 1, 0x0161, 0x0073, 0x030C, 0,
- 1, 0x0162, 0x0054, 0x0327, 0,
- 1, 0x0163, 0x0074, 0x0327, 0,
- 1, 0x0164, 0x0054, 0x030C, 0,
- 1, 0x0165, 0x0074, 0x030C, 0,
- 1, 0x0168, 0x0055, 0x0303, 0,
- 1, 0x0169, 0x0075, 0x0303, 0,
- 1, 0x016A, 0x0055, 0x0304, 0,
- 1, 0x016B, 0x0075, 0x0304, 0,
- 1, 0x016C, 0x0055, 0x0306, 0,
- 1, 0x016D, 0x0075, 0x0306, 0,
- 1, 0x016E, 0x0055, 0x030A, 0,
- 1, 0x016F, 0x0075, 0x030A, 0,
- 1, 0x0170, 0x0055, 0x030B, 0,
- 1, 0x0171, 0x0075, 0x030B, 0,
- 1, 0x0172, 0x0055, 0x0328, 0,
- 1, 0x0173, 0x0075, 0x0328, 0,
- 1, 0x0174, 0x0057, 0x0302, 0,
- 1, 0x0175, 0x0077, 0x0302, 0,
- 1, 0x0176, 0x0059, 0x0302, 0,
- 1, 0x0177, 0x0079, 0x0302, 0,
- 1, 0x0178, 0x0059, 0x0308, 0,
- 1, 0x0179, 0x005A, 0x0301, 0,
- 1, 0x017A, 0x007A, 0x0301, 0,
- 1, 0x017B, 0x005A, 0x0307, 0,
- 1, 0x017C, 0x007A, 0x0307, 0,
- 1, 0x017D, 0x005A, 0x030C, 0,
- 1, 0x017E, 0x007A, 0x030C, 0,
- 16, 0x017F, 0x0073, 0,
- 1, 0x01A0, 0x004F, 0x031B, 0,
- 1, 0x01A1, 0x006F, 0x031B, 0,
- 1, 0x01AF, 0x0055, 0x031B, 0,
- 1, 0x01B0, 0x0075, 0x031B, 0,
- 16, 0x01C4, 0x0044, 0x017D, 0,
- 16, 0x01C5, 0x0044, 0x017E, 0,
- 16, 0x01C6, 0x0064, 0x017E, 0,
- 16, 0x01C7, 0x004C, 0x004A, 0,
- 16, 0x01C8, 0x004C, 0x006A, 0,
- 16, 0x01C9, 0x006C, 0x006A, 0,
- 16, 0x01CA, 0x004E, 0x004A, 0,
- 16, 0x01CB, 0x004E, 0x006A, 0,
- 16, 0x01CC, 0x006E, 0x006A, 0,
- 1, 0x01CD, 0x0041, 0x030C, 0,
- 1, 0x01CE, 0x0061, 0x030C, 0,
- 1, 0x01CF, 0x0049, 0x030C, 0,
- 1, 0x01D0, 0x0069, 0x030C, 0,
- 1, 0x01D1, 0x004F, 0x030C, 0,
- 1, 0x01D2, 0x006F, 0x030C, 0,
- 1, 0x01D3, 0x0055, 0x030C, 0,
- 1, 0x01D4, 0x0075, 0x030C, 0,
- 1, 0x01D5, 0x00DC, 0x0304, 0,
- 1, 0x01D6, 0x00FC, 0x0304, 0,
- 1, 0x01D7, 0x00DC, 0x0301, 0,
- 1, 0x01D8, 0x00FC, 0x0301, 0,
- 1, 0x01D9, 0x00DC, 0x030C, 0,
- 1, 0x01DA, 0x00FC, 0x030C, 0,
- 1, 0x01DB, 0x00DC, 0x0300, 0,
- 1, 0x01DC, 0x00FC, 0x0300, 0,
- 1, 0x01DE, 0x00C4, 0x0304, 0,
- 1, 0x01DF, 0x00E4, 0x0304, 0,
- 1, 0x01E0, 0x0226, 0x0304, 0,
- 1, 0x01E1, 0x0227, 0x0304, 0,
- 1, 0x01E2, 0x00C6, 0x0304, 0,
- 1, 0x01E3, 0x00E6, 0x0304, 0,
- 1, 0x01E6, 0x0047, 0x030C, 0,
- 1, 0x01E7, 0x0067, 0x030C, 0,
- 1, 0x01E8, 0x004B, 0x030C, 0,
- 1, 0x01E9, 0x006B, 0x030C, 0,
- 1, 0x01EA, 0x004F, 0x0328, 0,
- 1, 0x01EB, 0x006F, 0x0328, 0,
- 1, 0x01EC, 0x01EA, 0x0304, 0,
- 1, 0x01ED, 0x01EB, 0x0304, 0,
- 1, 0x01EE, 0x01B7, 0x030C, 0,
- 1, 0x01EF, 0x0292, 0x030C, 0,
- 1, 0x01F0, 0x006A, 0x030C, 0,
- 16, 0x01F1, 0x0044, 0x005A, 0,
- 16, 0x01F2, 0x0044, 0x007A, 0,
- 16, 0x01F3, 0x0064, 0x007A, 0,
- 1, 0x01F4, 0x0047, 0x0301, 0,
- 1, 0x01F5, 0x0067, 0x0301, 0,
- 1, 0x01F8, 0x004E, 0x0300, 0,
- 1, 0x01F9, 0x006E, 0x0300, 0,
- 1, 0x01FA, 0x00C5, 0x0301, 0,
- 1, 0x01FB, 0x00E5, 0x0301, 0,
- 1, 0x01FC, 0x00C6, 0x0301, 0,
- 1, 0x01FD, 0x00E6, 0x0301, 0,
- 1, 0x01FE, 0x00D8, 0x0301, 0,
- 1, 0x01FF, 0x00F8, 0x0301, 0,
- 1, 0x0200, 0x0041, 0x030F, 0,
- 1, 0x0201, 0x0061, 0x030F, 0,
- 1, 0x0202, 0x0041, 0x0311, 0,
- 1, 0x0203, 0x0061, 0x0311, 0,
- 1, 0x0204, 0x0045, 0x030F, 0,
- 1, 0x0205, 0x0065, 0x030F, 0,
- 1, 0x0206, 0x0045, 0x0311, 0,
- 1, 0x0207, 0x0065, 0x0311, 0,
- 1, 0x0208, 0x0049, 0x030F, 0,
- 1, 0x0209, 0x0069, 0x030F, 0,
- 1, 0x020A, 0x0049, 0x0311, 0,
- 1, 0x020B, 0x0069, 0x0311, 0,
- 1, 0x020C, 0x004F, 0x030F, 0,
- 1, 0x020D, 0x006F, 0x030F, 0,
- 1, 0x020E, 0x004F, 0x0311, 0,
- 1, 0x020F, 0x006F, 0x0311, 0,
- 1, 0x0210, 0x0052, 0x030F, 0,
- 1, 0x0211, 0x0072, 0x030F, 0,
- 1, 0x0212, 0x0052, 0x0311, 0,
- 1, 0x0213, 0x0072, 0x0311, 0,
- 1, 0x0214, 0x0055, 0x030F, 0,
- 1, 0x0215, 0x0075, 0x030F, 0,
- 1, 0x0216, 0x0055, 0x0311, 0,
- 1, 0x0217, 0x0075, 0x0311, 0,
- 1, 0x0218, 0x0053, 0x0326, 0,
- 1, 0x0219, 0x0073, 0x0326, 0,
- 1, 0x021A, 0x0054, 0x0326, 0,
- 1, 0x021B, 0x0074, 0x0326, 0,
- 1, 0x021E, 0x0048, 0x030C, 0,
- 1, 0x021F, 0x0068, 0x030C, 0,
- 1, 0x0226, 0x0041, 0x0307, 0,
- 1, 0x0227, 0x0061, 0x0307, 0,
- 1, 0x0228, 0x0045, 0x0327, 0,
- 1, 0x0229, 0x0065, 0x0327, 0,
- 1, 0x022A, 0x00D6, 0x0304, 0,
- 1, 0x022B, 0x00F6, 0x0304, 0,
- 1, 0x022C, 0x00D5, 0x0304, 0,
- 1, 0x022D, 0x00F5, 0x0304, 0,
- 1, 0x022E, 0x004F, 0x0307, 0,
- 1, 0x022F, 0x006F, 0x0307, 0,
- 1, 0x0230, 0x022E, 0x0304, 0,
- 1, 0x0231, 0x022F, 0x0304, 0,
- 1, 0x0232, 0x0059, 0x0304, 0,
- 1, 0x0233, 0x0079, 0x0304, 0,
- 9, 0x02B0, 0x0068, 0,
- 9, 0x02B1, 0x0266, 0,
- 9, 0x02B2, 0x006A, 0,
- 9, 0x02B3, 0x0072, 0,
- 9, 0x02B4, 0x0279, 0,
- 9, 0x02B5, 0x027B, 0,
- 9, 0x02B6, 0x0281, 0,
- 9, 0x02B7, 0x0077, 0,
- 9, 0x02B8, 0x0079, 0,
- 16, 0x02D8, 0x0020, 0x0306, 0,
- 16, 0x02D9, 0x0020, 0x0307, 0,
- 16, 0x02DA, 0x0020, 0x030A, 0,
- 16, 0x02DB, 0x0020, 0x0328, 0,
- 16, 0x02DC, 0x0020, 0x0303, 0,
- 16, 0x02DD, 0x0020, 0x030B, 0,
- 9, 0x02E0, 0x0263, 0,
- 9, 0x02E1, 0x006C, 0,
- 9, 0x02E2, 0x0073, 0,
- 9, 0x02E3, 0x0078, 0,
- 9, 0x02E4, 0x0295, 0,
- 1, 0x0340, 0x0300, 0,
- 1, 0x0341, 0x0301, 0,
- 1, 0x0343, 0x0313, 0,
- 1, 0x0344, 0x0308, 0x0301, 0,
- 1, 0x0374, 0x02B9, 0,
- 16, 0x037A, 0x0020, 0x0345, 0,
- 1, 0x037E, 0x003B, 0,
- 16, 0x0384, 0x0020, 0x0301, 0,
- 1, 0x0385, 0x00A8, 0x0301, 0,
- 1, 0x0386, 0x0391, 0x0301, 0,
- 1, 0x0387, 0x00B7, 0,
- 1, 0x0388, 0x0395, 0x0301, 0,
- 1, 0x0389, 0x0397, 0x0301, 0,
- 1, 0x038A, 0x0399, 0x0301, 0,
- 1, 0x038C, 0x039F, 0x0301, 0,
- 1, 0x038E, 0x03A5, 0x0301, 0,
- 1, 0x038F, 0x03A9, 0x0301, 0,
- 1, 0x0390, 0x03CA, 0x0301, 0,
- 1, 0x03AA, 0x0399, 0x0308, 0,
- 1, 0x03AB, 0x03A5, 0x0308, 0,
- 1, 0x03AC, 0x03B1, 0x0301, 0,
- 1, 0x03AD, 0x03B5, 0x0301, 0,
- 1, 0x03AE, 0x03B7, 0x0301, 0,
- 1, 0x03AF, 0x03B9, 0x0301, 0,
- 1, 0x03B0, 0x03CB, 0x0301, 0,
- 1, 0x03CA, 0x03B9, 0x0308, 0,
- 1, 0x03CB, 0x03C5, 0x0308, 0,
- 1, 0x03CC, 0x03BF, 0x0301, 0,
- 1, 0x03CD, 0x03C5, 0x0301, 0,
- 1, 0x03CE, 0x03C9, 0x0301, 0,
- 16, 0x03D0, 0x03B2, 0,
- 16, 0x03D1, 0x03B8, 0,
- 16, 0x03D2, 0x03A5, 0,
- 1, 0x03D3, 0x03D2, 0x0301, 0,
- 1, 0x03D4, 0x03D2, 0x0308, 0,
- 16, 0x03D5, 0x03C6, 0,
- 16, 0x03D6, 0x03C0, 0,
- 16, 0x03F0, 0x03BA, 0,
- 16, 0x03F1, 0x03C1, 0,
- 16, 0x03F2, 0x03C2, 0,
- 1, 0x0400, 0x0415, 0x0300, 0,
- 1, 0x0401, 0x0415, 0x0308, 0,
- 1, 0x0403, 0x0413, 0x0301, 0,
- 1, 0x0407, 0x0406, 0x0308, 0,
- 1, 0x040C, 0x041A, 0x0301, 0,
- 1, 0x040D, 0x0418, 0x0300, 0,
- 1, 0x040E, 0x0423, 0x0306, 0,
- 1, 0x0419, 0x0418, 0x0306, 0,
- 1, 0x0439, 0x0438, 0x0306, 0,
- 1, 0x0450, 0x0435, 0x0300, 0,
- 1, 0x0451, 0x0435, 0x0308, 0,
- 1, 0x0453, 0x0433, 0x0301, 0,
- 1, 0x0457, 0x0456, 0x0308, 0,
- 1, 0x045C, 0x043A, 0x0301, 0,
- 1, 0x045D, 0x0438, 0x0300, 0,
- 1, 0x045E, 0x0443, 0x0306, 0,
- 1, 0x0476, 0x0474, 0x030F, 0,
- 1, 0x0477, 0x0475, 0x030F, 0,
- 1, 0x04C1, 0x0416, 0x0306, 0,
- 1, 0x04C2, 0x0436, 0x0306, 0,
- 1, 0x04D0, 0x0410, 0x0306, 0,
- 1, 0x04D1, 0x0430, 0x0306, 0,
- 1, 0x04D2, 0x0410, 0x0308, 0,
- 1, 0x04D3, 0x0430, 0x0308, 0,
- 1, 0x04D6, 0x0415, 0x0306, 0,
- 1, 0x04D7, 0x0435, 0x0306, 0,
- 1, 0x04DA, 0x04D8, 0x0308, 0,
- 1, 0x04DB, 0x04D9, 0x0308, 0,
- 1, 0x04DC, 0x0416, 0x0308, 0,
- 1, 0x04DD, 0x0436, 0x0308, 0,
- 1, 0x04DE, 0x0417, 0x0308, 0,
- 1, 0x04DF, 0x0437, 0x0308, 0,
- 1, 0x04E2, 0x0418, 0x0304, 0,
- 1, 0x04E3, 0x0438, 0x0304, 0,
- 1, 0x04E4, 0x0418, 0x0308, 0,
- 1, 0x04E5, 0x0438, 0x0308, 0,
- 1, 0x04E6, 0x041E, 0x0308, 0,
- 1, 0x04E7, 0x043E, 0x0308, 0,
- 1, 0x04EA, 0x04E8, 0x0308, 0,
- 1, 0x04EB, 0x04E9, 0x0308, 0,
- 1, 0x04EC, 0x042D, 0x0308, 0,
- 1, 0x04ED, 0x044D, 0x0308, 0,
- 1, 0x04EE, 0x0423, 0x0304, 0,
- 1, 0x04EF, 0x0443, 0x0304, 0,
- 1, 0x04F0, 0x0423, 0x0308, 0,
- 1, 0x04F1, 0x0443, 0x0308, 0,
- 1, 0x04F2, 0x0423, 0x030B, 0,
- 1, 0x04F3, 0x0443, 0x030B, 0,
- 1, 0x04F4, 0x0427, 0x0308, 0,
- 1, 0x04F5, 0x0447, 0x0308, 0,
- 1, 0x04F8, 0x042B, 0x0308, 0,
- 1, 0x04F9, 0x044B, 0x0308, 0,
- 16, 0x0587, 0x0565, 0x0582, 0,
- 1, 0x0622, 0x0627, 0x0653, 0,
- 1, 0x0623, 0x0627, 0x0654, 0,
- 1, 0x0624, 0x0648, 0x0654, 0,
- 1, 0x0625, 0x0627, 0x0655, 0,
- 1, 0x0626, 0x064A, 0x0654, 0,
- 16, 0x0675, 0x0627, 0x0674, 0,
- 16, 0x0676, 0x0648, 0x0674, 0,
- 16, 0x0677, 0x06C7, 0x0674, 0,
- 16, 0x0678, 0x064A, 0x0674, 0,
- 1, 0x06C0, 0x06D5, 0x0654, 0,
- 1, 0x06C2, 0x06C1, 0x0654, 0,
- 1, 0x06D3, 0x06D2, 0x0654, 0,
- 1, 0x0929, 0x0928, 0x093C, 0,
- 1, 0x0931, 0x0930, 0x093C, 0,
- 1, 0x0934, 0x0933, 0x093C, 0,
- 1, 0x0958, 0x0915, 0x093C, 0,
- 1, 0x0959, 0x0916, 0x093C, 0,
- 1, 0x095A, 0x0917, 0x093C, 0,
- 1, 0x095B, 0x091C, 0x093C, 0,
- 1, 0x095C, 0x0921, 0x093C, 0,
- 1, 0x095D, 0x0922, 0x093C, 0,
- 1, 0x095E, 0x092B, 0x093C, 0,
- 1, 0x095F, 0x092F, 0x093C, 0,
- 1, 0x09CB, 0x09C7, 0x09BE, 0,
- 1, 0x09CC, 0x09C7, 0x09D7, 0,
- 1, 0x09DC, 0x09A1, 0x09BC, 0,
- 1, 0x09DD, 0x09A2, 0x09BC, 0,
- 1, 0x09DF, 0x09AF, 0x09BC, 0,
- 1, 0x0A33, 0x0A32, 0x0A3C, 0,
- 1, 0x0A36, 0x0A38, 0x0A3C, 0,
- 1, 0x0A59, 0x0A16, 0x0A3C, 0,
- 1, 0x0A5A, 0x0A17, 0x0A3C, 0,
- 1, 0x0A5B, 0x0A1C, 0x0A3C, 0,
- 1, 0x0A5E, 0x0A2B, 0x0A3C, 0,
- 1, 0x0B48, 0x0B47, 0x0B56, 0,
- 1, 0x0B4B, 0x0B47, 0x0B3E, 0,
- 1, 0x0B4C, 0x0B47, 0x0B57, 0,
- 1, 0x0B5C, 0x0B21, 0x0B3C, 0,
- 1, 0x0B5D, 0x0B22, 0x0B3C, 0,
- 1, 0x0B94, 0x0B92, 0x0BD7, 0,
- 1, 0x0BCA, 0x0BC6, 0x0BBE, 0,
- 1, 0x0BCB, 0x0BC7, 0x0BBE, 0,
- 1, 0x0BCC, 0x0BC6, 0x0BD7, 0,
- 1, 0x0C48, 0x0C46, 0x0C56, 0,
- 1, 0x0CC0, 0x0CBF, 0x0CD5, 0,
- 1, 0x0CC7, 0x0CC6, 0x0CD5, 0,
- 1, 0x0CC8, 0x0CC6, 0x0CD6, 0,
- 1, 0x0CCA, 0x0CC6, 0x0CC2, 0,
- 1, 0x0CCB, 0x0CCA, 0x0CD5, 0,
- 1, 0x0D4A, 0x0D46, 0x0D3E, 0,
- 1, 0x0D4B, 0x0D47, 0x0D3E, 0,
- 1, 0x0D4C, 0x0D46, 0x0D57, 0,
- 1, 0x0DDA, 0x0DD9, 0x0DCA, 0,
- 1, 0x0DDC, 0x0DD9, 0x0DCF, 0,
- 1, 0x0DDD, 0x0DDC, 0x0DCA, 0,
- 1, 0x0DDE, 0x0DD9, 0x0DDF, 0,
- 16, 0x0E33, 0x0E4D, 0x0E32, 0,
- 16, 0x0EB3, 0x0ECD, 0x0EB2, 0,
- 16, 0x0EDC, 0x0EAB, 0x0E99, 0,
- 16, 0x0EDD, 0x0EAB, 0x0EA1, 0,
- 3, 0x0F0C, 0x0F0B, 0,
- 1, 0x0F43, 0x0F42, 0x0FB7, 0,
- 1, 0x0F4D, 0x0F4C, 0x0FB7, 0,
- 1, 0x0F52, 0x0F51, 0x0FB7, 0,
- 1, 0x0F57, 0x0F56, 0x0FB7, 0,
- 1, 0x0F5C, 0x0F5B, 0x0FB7, 0,
- 1, 0x0F69, 0x0F40, 0x0FB5, 0,
- 1, 0x0F73, 0x0F71, 0x0F72, 0,
- 1, 0x0F75, 0x0F71, 0x0F74, 0,
- 1, 0x0F76, 0x0FB2, 0x0F80, 0,
- 16, 0x0F77, 0x0FB2, 0x0F81, 0,
- 1, 0x0F78, 0x0FB3, 0x0F80, 0,
- 16, 0x0F79, 0x0FB3, 0x0F81, 0,
- 1, 0x0F81, 0x0F71, 0x0F80, 0,
- 1, 0x0F93, 0x0F92, 0x0FB7, 0,
- 1, 0x0F9D, 0x0F9C, 0x0FB7, 0,
- 1, 0x0FA2, 0x0FA1, 0x0FB7, 0,
- 1, 0x0FA7, 0x0FA6, 0x0FB7, 0,
- 1, 0x0FAC, 0x0FAB, 0x0FB7, 0,
- 1, 0x0FB9, 0x0F90, 0x0FB5, 0,
- 1, 0x1026, 0x1025, 0x102E, 0,
- 1, 0x1E00, 0x0041, 0x0325, 0,
- 1, 0x1E01, 0x0061, 0x0325, 0,
- 1, 0x1E02, 0x0042, 0x0307, 0,
- 1, 0x1E03, 0x0062, 0x0307, 0,
- 1, 0x1E04, 0x0042, 0x0323, 0,
- 1, 0x1E05, 0x0062, 0x0323, 0,
- 1, 0x1E06, 0x0042, 0x0331, 0,
- 1, 0x1E07, 0x0062, 0x0331, 0,
- 1, 0x1E08, 0x00C7, 0x0301, 0,
- 1, 0x1E09, 0x00E7, 0x0301, 0,
- 1, 0x1E0A, 0x0044, 0x0307, 0,
- 1, 0x1E0B, 0x0064, 0x0307, 0,
- 1, 0x1E0C, 0x0044, 0x0323, 0,
- 1, 0x1E0D, 0x0064, 0x0323, 0,
- 1, 0x1E0E, 0x0044, 0x0331, 0,
- 1, 0x1E0F, 0x0064, 0x0331, 0,
- 1, 0x1E10, 0x0044, 0x0327, 0,
- 1, 0x1E11, 0x0064, 0x0327, 0,
- 1, 0x1E12, 0x0044, 0x032D, 0,
- 1, 0x1E13, 0x0064, 0x032D, 0,
- 1, 0x1E14, 0x0112, 0x0300, 0,
- 1, 0x1E15, 0x0113, 0x0300, 0,
- 1, 0x1E16, 0x0112, 0x0301, 0,
- 1, 0x1E17, 0x0113, 0x0301, 0,
- 1, 0x1E18, 0x0045, 0x032D, 0,
- 1, 0x1E19, 0x0065, 0x032D, 0,
- 1, 0x1E1A, 0x0045, 0x0330, 0,
- 1, 0x1E1B, 0x0065, 0x0330, 0,
- 1, 0x1E1C, 0x0228, 0x0306, 0,
- 1, 0x1E1D, 0x0229, 0x0306, 0,
- 1, 0x1E1E, 0x0046, 0x0307, 0,
- 1, 0x1E1F, 0x0066, 0x0307, 0,
- 1, 0x1E20, 0x0047, 0x0304, 0,
- 1, 0x1E21, 0x0067, 0x0304, 0,
- 1, 0x1E22, 0x0048, 0x0307, 0,
- 1, 0x1E23, 0x0068, 0x0307, 0,
- 1, 0x1E24, 0x0048, 0x0323, 0,
- 1, 0x1E25, 0x0068, 0x0323, 0,
- 1, 0x1E26, 0x0048, 0x0308, 0,
- 1, 0x1E27, 0x0068, 0x0308, 0,
- 1, 0x1E28, 0x0048, 0x0327, 0,
- 1, 0x1E29, 0x0068, 0x0327, 0,
- 1, 0x1E2A, 0x0048, 0x032E, 0,
- 1, 0x1E2B, 0x0068, 0x032E, 0,
- 1, 0x1E2C, 0x0049, 0x0330, 0,
- 1, 0x1E2D, 0x0069, 0x0330, 0,
- 1, 0x1E2E, 0x00CF, 0x0301, 0,
- 1, 0x1E2F, 0x00EF, 0x0301, 0,
- 1, 0x1E30, 0x004B, 0x0301, 0,
- 1, 0x1E31, 0x006B, 0x0301, 0,
- 1, 0x1E32, 0x004B, 0x0323, 0,
- 1, 0x1E33, 0x006B, 0x0323, 0,
- 1, 0x1E34, 0x004B, 0x0331, 0,
- 1, 0x1E35, 0x006B, 0x0331, 0,
- 1, 0x1E36, 0x004C, 0x0323, 0,
- 1, 0x1E37, 0x006C, 0x0323, 0,
- 1, 0x1E38, 0x1E36, 0x0304, 0,
- 1, 0x1E39, 0x1E37, 0x0304, 0,
- 1, 0x1E3A, 0x004C, 0x0331, 0,
- 1, 0x1E3B, 0x006C, 0x0331, 0,
- 1, 0x1E3C, 0x004C, 0x032D, 0,
- 1, 0x1E3D, 0x006C, 0x032D, 0,
- 1, 0x1E3E, 0x004D, 0x0301, 0,
- 1, 0x1E3F, 0x006D, 0x0301, 0,
- 1, 0x1E40, 0x004D, 0x0307, 0,
- 1, 0x1E41, 0x006D, 0x0307, 0,
- 1, 0x1E42, 0x004D, 0x0323, 0,
- 1, 0x1E43, 0x006D, 0x0323, 0,
- 1, 0x1E44, 0x004E, 0x0307, 0,
- 1, 0x1E45, 0x006E, 0x0307, 0,
- 1, 0x1E46, 0x004E, 0x0323, 0,
- 1, 0x1E47, 0x006E, 0x0323, 0,
- 1, 0x1E48, 0x004E, 0x0331, 0,
- 1, 0x1E49, 0x006E, 0x0331, 0,
- 1, 0x1E4A, 0x004E, 0x032D, 0,
- 1, 0x1E4B, 0x006E, 0x032D, 0,
- 1, 0x1E4C, 0x00D5, 0x0301, 0,
- 1, 0x1E4D, 0x00F5, 0x0301, 0,
- 1, 0x1E4E, 0x00D5, 0x0308, 0,
- 1, 0x1E4F, 0x00F5, 0x0308, 0,
- 1, 0x1E50, 0x014C, 0x0300, 0,
- 1, 0x1E51, 0x014D, 0x0300, 0,
- 1, 0x1E52, 0x014C, 0x0301, 0,
- 1, 0x1E53, 0x014D, 0x0301, 0,
- 1, 0x1E54, 0x0050, 0x0301, 0,
- 1, 0x1E55, 0x0070, 0x0301, 0,
- 1, 0x1E56, 0x0050, 0x0307, 0,
- 1, 0x1E57, 0x0070, 0x0307, 0,
- 1, 0x1E58, 0x0052, 0x0307, 0,
- 1, 0x1E59, 0x0072, 0x0307, 0,
- 1, 0x1E5A, 0x0052, 0x0323, 0,
- 1, 0x1E5B, 0x0072, 0x0323, 0,
- 1, 0x1E5C, 0x1E5A, 0x0304, 0,
- 1, 0x1E5D, 0x1E5B, 0x0304, 0,
- 1, 0x1E5E, 0x0052, 0x0331, 0,
- 1, 0x1E5F, 0x0072, 0x0331, 0,
- 1, 0x1E60, 0x0053, 0x0307, 0,
- 1, 0x1E61, 0x0073, 0x0307, 0,
- 1, 0x1E62, 0x0053, 0x0323, 0,
- 1, 0x1E63, 0x0073, 0x0323, 0,
- 1, 0x1E64, 0x015A, 0x0307, 0,
- 1, 0x1E65, 0x015B, 0x0307, 0,
- 1, 0x1E66, 0x0160, 0x0307, 0,
- 1, 0x1E67, 0x0161, 0x0307, 0,
- 1, 0x1E68, 0x1E62, 0x0307, 0,
- 1, 0x1E69, 0x1E63, 0x0307, 0,
- 1, 0x1E6A, 0x0054, 0x0307, 0,
- 1, 0x1E6B, 0x0074, 0x0307, 0,
- 1, 0x1E6C, 0x0054, 0x0323, 0,
- 1, 0x1E6D, 0x0074, 0x0323, 0,
- 1, 0x1E6E, 0x0054, 0x0331, 0,
- 1, 0x1E6F, 0x0074, 0x0331, 0,
- 1, 0x1E70, 0x0054, 0x032D, 0,
- 1, 0x1E71, 0x0074, 0x032D, 0,
- 1, 0x1E72, 0x0055, 0x0324, 0,
- 1, 0x1E73, 0x0075, 0x0324, 0,
- 1, 0x1E74, 0x0055, 0x0330, 0,
- 1, 0x1E75, 0x0075, 0x0330, 0,
- 1, 0x1E76, 0x0055, 0x032D, 0,
- 1, 0x1E77, 0x0075, 0x032D, 0,
- 1, 0x1E78, 0x0168, 0x0301, 0,
- 1, 0x1E79, 0x0169, 0x0301, 0,
- 1, 0x1E7A, 0x016A, 0x0308, 0,
- 1, 0x1E7B, 0x016B, 0x0308, 0,
- 1, 0x1E7C, 0x0056, 0x0303, 0,
- 1, 0x1E7D, 0x0076, 0x0303, 0,
- 1, 0x1E7E, 0x0056, 0x0323, 0,
- 1, 0x1E7F, 0x0076, 0x0323, 0,
- 1, 0x1E80, 0x0057, 0x0300, 0,
- 1, 0x1E81, 0x0077, 0x0300, 0,
- 1, 0x1E82, 0x0057, 0x0301, 0,
- 1, 0x1E83, 0x0077, 0x0301, 0,
- 1, 0x1E84, 0x0057, 0x0308, 0,
- 1, 0x1E85, 0x0077, 0x0308, 0,
- 1, 0x1E86, 0x0057, 0x0307, 0,
- 1, 0x1E87, 0x0077, 0x0307, 0,
- 1, 0x1E88, 0x0057, 0x0323, 0,
- 1, 0x1E89, 0x0077, 0x0323, 0,
- 1, 0x1E8A, 0x0058, 0x0307, 0,
- 1, 0x1E8B, 0x0078, 0x0307, 0,
- 1, 0x1E8C, 0x0058, 0x0308, 0,
- 1, 0x1E8D, 0x0078, 0x0308, 0,
- 1, 0x1E8E, 0x0059, 0x0307, 0,
- 1, 0x1E8F, 0x0079, 0x0307, 0,
- 1, 0x1E90, 0x005A, 0x0302, 0,
- 1, 0x1E91, 0x007A, 0x0302, 0,
- 1, 0x1E92, 0x005A, 0x0323, 0,
- 1, 0x1E93, 0x007A, 0x0323, 0,
- 1, 0x1E94, 0x005A, 0x0331, 0,
- 1, 0x1E95, 0x007A, 0x0331, 0,
- 1, 0x1E96, 0x0068, 0x0331, 0,
- 1, 0x1E97, 0x0074, 0x0308, 0,
- 1, 0x1E98, 0x0077, 0x030A, 0,
- 1, 0x1E99, 0x0079, 0x030A, 0,
- 16, 0x1E9A, 0x0061, 0x02BE, 0,
- 1, 0x1E9B, 0x017F, 0x0307, 0,
- 1, 0x1EA0, 0x0041, 0x0323, 0,
- 1, 0x1EA1, 0x0061, 0x0323, 0,
- 1, 0x1EA2, 0x0041, 0x0309, 0,
- 1, 0x1EA3, 0x0061, 0x0309, 0,
- 1, 0x1EA4, 0x00C2, 0x0301, 0,
- 1, 0x1EA5, 0x00E2, 0x0301, 0,
- 1, 0x1EA6, 0x00C2, 0x0300, 0,
- 1, 0x1EA7, 0x00E2, 0x0300, 0,
- 1, 0x1EA8, 0x00C2, 0x0309, 0,
- 1, 0x1EA9, 0x00E2, 0x0309, 0,
- 1, 0x1EAA, 0x00C2, 0x0303, 0,
- 1, 0x1EAB, 0x00E2, 0x0303, 0,
- 1, 0x1EAC, 0x1EA0, 0x0302, 0,
- 1, 0x1EAD, 0x1EA1, 0x0302, 0,
- 1, 0x1EAE, 0x0102, 0x0301, 0,
- 1, 0x1EAF, 0x0103, 0x0301, 0,
- 1, 0x1EB0, 0x0102, 0x0300, 0,
- 1, 0x1EB1, 0x0103, 0x0300, 0,
- 1, 0x1EB2, 0x0102, 0x0309, 0,
- 1, 0x1EB3, 0x0103, 0x0309, 0,
- 1, 0x1EB4, 0x0102, 0x0303, 0,
- 1, 0x1EB5, 0x0103, 0x0303, 0,
- 1, 0x1EB6, 0x1EA0, 0x0306, 0,
- 1, 0x1EB7, 0x1EA1, 0x0306, 0,
- 1, 0x1EB8, 0x0045, 0x0323, 0,
- 1, 0x1EB9, 0x0065, 0x0323, 0,
- 1, 0x1EBA, 0x0045, 0x0309, 0,
- 1, 0x1EBB, 0x0065, 0x0309, 0,
- 1, 0x1EBC, 0x0045, 0x0303, 0,
- 1, 0x1EBD, 0x0065, 0x0303, 0,
- 1, 0x1EBE, 0x00CA, 0x0301, 0,
- 1, 0x1EBF, 0x00EA, 0x0301, 0,
- 1, 0x1EC0, 0x00CA, 0x0300, 0,
- 1, 0x1EC1, 0x00EA, 0x0300, 0,
- 1, 0x1EC2, 0x00CA, 0x0309, 0,
- 1, 0x1EC3, 0x00EA, 0x0309, 0,
- 1, 0x1EC4, 0x00CA, 0x0303, 0,
- 1, 0x1EC5, 0x00EA, 0x0303, 0,
- 1, 0x1EC6, 0x1EB8, 0x0302, 0,
- 1, 0x1EC7, 0x1EB9, 0x0302, 0,
- 1, 0x1EC8, 0x0049, 0x0309, 0,
- 1, 0x1EC9, 0x0069, 0x0309, 0,
- 1, 0x1ECA, 0x0049, 0x0323, 0,
- 1, 0x1ECB, 0x0069, 0x0323, 0,
- 1, 0x1ECC, 0x004F, 0x0323, 0,
- 1, 0x1ECD, 0x006F, 0x0323, 0,
- 1, 0x1ECE, 0x004F, 0x0309, 0,
- 1, 0x1ECF, 0x006F, 0x0309, 0,
- 1, 0x1ED0, 0x00D4, 0x0301, 0,
- 1, 0x1ED1, 0x00F4, 0x0301, 0,
- 1, 0x1ED2, 0x00D4, 0x0300, 0,
- 1, 0x1ED3, 0x00F4, 0x0300, 0,
- 1, 0x1ED4, 0x00D4, 0x0309, 0,
- 1, 0x1ED5, 0x00F4, 0x0309, 0,
- 1, 0x1ED6, 0x00D4, 0x0303, 0,
- 1, 0x1ED7, 0x00F4, 0x0303, 0,
- 1, 0x1ED8, 0x1ECC, 0x0302, 0,
- 1, 0x1ED9, 0x1ECD, 0x0302, 0,
- 1, 0x1EDA, 0x01A0, 0x0301, 0,
- 1, 0x1EDB, 0x01A1, 0x0301, 0,
- 1, 0x1EDC, 0x01A0, 0x0300, 0,
- 1, 0x1EDD, 0x01A1, 0x0300, 0,
- 1, 0x1EDE, 0x01A0, 0x0309, 0,
- 1, 0x1EDF, 0x01A1, 0x0309, 0,
- 1, 0x1EE0, 0x01A0, 0x0303, 0,
- 1, 0x1EE1, 0x01A1, 0x0303, 0,
- 1, 0x1EE2, 0x01A0, 0x0323, 0,
- 1, 0x1EE3, 0x01A1, 0x0323, 0,
- 1, 0x1EE4, 0x0055, 0x0323, 0,
- 1, 0x1EE5, 0x0075, 0x0323, 0,
- 1, 0x1EE6, 0x0055, 0x0309, 0,
- 1, 0x1EE7, 0x0075, 0x0309, 0,
- 1, 0x1EE8, 0x01AF, 0x0301, 0,
- 1, 0x1EE9, 0x01B0, 0x0301, 0,
- 1, 0x1EEA, 0x01AF, 0x0300, 0,
- 1, 0x1EEB, 0x01B0, 0x0300, 0,
- 1, 0x1EEC, 0x01AF, 0x0309, 0,
- 1, 0x1EED, 0x01B0, 0x0309, 0,
- 1, 0x1EEE, 0x01AF, 0x0303, 0,
- 1, 0x1EEF, 0x01B0, 0x0303, 0,
- 1, 0x1EF0, 0x01AF, 0x0323, 0,
- 1, 0x1EF1, 0x01B0, 0x0323, 0,
- 1, 0x1EF2, 0x0059, 0x0300, 0,
- 1, 0x1EF3, 0x0079, 0x0300, 0,
- 1, 0x1EF4, 0x0059, 0x0323, 0,
- 1, 0x1EF5, 0x0079, 0x0323, 0,
- 1, 0x1EF6, 0x0059, 0x0309, 0,
- 1, 0x1EF7, 0x0079, 0x0309, 0,
- 1, 0x1EF8, 0x0059, 0x0303, 0,
- 1, 0x1EF9, 0x0079, 0x0303, 0,
- 1, 0x1F00, 0x03B1, 0x0313, 0,
- 1, 0x1F01, 0x03B1, 0x0314, 0,
- 1, 0x1F02, 0x1F00, 0x0300, 0,
- 1, 0x1F03, 0x1F01, 0x0300, 0,
- 1, 0x1F04, 0x1F00, 0x0301, 0,
- 1, 0x1F05, 0x1F01, 0x0301, 0,
- 1, 0x1F06, 0x1F00, 0x0342, 0,
- 1, 0x1F07, 0x1F01, 0x0342, 0,
- 1, 0x1F08, 0x0391, 0x0313, 0,
- 1, 0x1F09, 0x0391, 0x0314, 0,
- 1, 0x1F0A, 0x1F08, 0x0300, 0,
- 1, 0x1F0B, 0x1F09, 0x0300, 0,
- 1, 0x1F0C, 0x1F08, 0x0301, 0,
- 1, 0x1F0D, 0x1F09, 0x0301, 0,
- 1, 0x1F0E, 0x1F08, 0x0342, 0,
- 1, 0x1F0F, 0x1F09, 0x0342, 0,
- 1, 0x1F10, 0x03B5, 0x0313, 0,
- 1, 0x1F11, 0x03B5, 0x0314, 0,
- 1, 0x1F12, 0x1F10, 0x0300, 0,
- 1, 0x1F13, 0x1F11, 0x0300, 0,
- 1, 0x1F14, 0x1F10, 0x0301, 0,
- 1, 0x1F15, 0x1F11, 0x0301, 0,
- 1, 0x1F18, 0x0395, 0x0313, 0,
- 1, 0x1F19, 0x0395, 0x0314, 0,
- 1, 0x1F1A, 0x1F18, 0x0300, 0,
- 1, 0x1F1B, 0x1F19, 0x0300, 0,
- 1, 0x1F1C, 0x1F18, 0x0301, 0,
- 1, 0x1F1D, 0x1F19, 0x0301, 0,
- 1, 0x1F20, 0x03B7, 0x0313, 0,
- 1, 0x1F21, 0x03B7, 0x0314, 0,
- 1, 0x1F22, 0x1F20, 0x0300, 0,
- 1, 0x1F23, 0x1F21, 0x0300, 0,
- 1, 0x1F24, 0x1F20, 0x0301, 0,
- 1, 0x1F25, 0x1F21, 0x0301, 0,
- 1, 0x1F26, 0x1F20, 0x0342, 0,
- 1, 0x1F27, 0x1F21, 0x0342, 0,
- 1, 0x1F28, 0x0397, 0x0313, 0,
- 1, 0x1F29, 0x0397, 0x0314, 0,
- 1, 0x1F2A, 0x1F28, 0x0300, 0,
- 1, 0x1F2B, 0x1F29, 0x0300, 0,
- 1, 0x1F2C, 0x1F28, 0x0301, 0,
- 1, 0x1F2D, 0x1F29, 0x0301, 0,
- 1, 0x1F2E, 0x1F28, 0x0342, 0,
- 1, 0x1F2F, 0x1F29, 0x0342, 0,
- 1, 0x1F30, 0x03B9, 0x0313, 0,
- 1, 0x1F31, 0x03B9, 0x0314, 0,
- 1, 0x1F32, 0x1F30, 0x0300, 0,
- 1, 0x1F33, 0x1F31, 0x0300, 0,
- 1, 0x1F34, 0x1F30, 0x0301, 0,
- 1, 0x1F35, 0x1F31, 0x0301, 0,
- 1, 0x1F36, 0x1F30, 0x0342, 0,
- 1, 0x1F37, 0x1F31, 0x0342, 0,
- 1, 0x1F38, 0x0399, 0x0313, 0,
- 1, 0x1F39, 0x0399, 0x0314, 0,
- 1, 0x1F3A, 0x1F38, 0x0300, 0,
- 1, 0x1F3B, 0x1F39, 0x0300, 0,
- 1, 0x1F3C, 0x1F38, 0x0301, 0,
- 1, 0x1F3D, 0x1F39, 0x0301, 0,
- 1, 0x1F3E, 0x1F38, 0x0342, 0,
- 1, 0x1F3F, 0x1F39, 0x0342, 0,
- 1, 0x1F40, 0x03BF, 0x0313, 0,
- 1, 0x1F41, 0x03BF, 0x0314, 0,
- 1, 0x1F42, 0x1F40, 0x0300, 0,
- 1, 0x1F43, 0x1F41, 0x0300, 0,
- 1, 0x1F44, 0x1F40, 0x0301, 0,
- 1, 0x1F45, 0x1F41, 0x0301, 0,
- 1, 0x1F48, 0x039F, 0x0313, 0,
- 1, 0x1F49, 0x039F, 0x0314, 0,
- 1, 0x1F4A, 0x1F48, 0x0300, 0,
- 1, 0x1F4B, 0x1F49, 0x0300, 0,
- 1, 0x1F4C, 0x1F48, 0x0301, 0,
- 1, 0x1F4D, 0x1F49, 0x0301, 0,
- 1, 0x1F50, 0x03C5, 0x0313, 0,
- 1, 0x1F51, 0x03C5, 0x0314, 0,
- 1, 0x1F52, 0x1F50, 0x0300, 0,
- 1, 0x1F53, 0x1F51, 0x0300, 0,
- 1, 0x1F54, 0x1F50, 0x0301, 0,
- 1, 0x1F55, 0x1F51, 0x0301, 0,
- 1, 0x1F56, 0x1F50, 0x0342, 0,
- 1, 0x1F57, 0x1F51, 0x0342, 0,
- 1, 0x1F59, 0x03A5, 0x0314, 0,
- 1, 0x1F5B, 0x1F59, 0x0300, 0,
- 1, 0x1F5D, 0x1F59, 0x0301, 0,
- 1, 0x1F5F, 0x1F59, 0x0342, 0,
- 1, 0x1F60, 0x03C9, 0x0313, 0,
- 1, 0x1F61, 0x03C9, 0x0314, 0,
- 1, 0x1F62, 0x1F60, 0x0300, 0,
- 1, 0x1F63, 0x1F61, 0x0300, 0,
- 1, 0x1F64, 0x1F60, 0x0301, 0,
- 1, 0x1F65, 0x1F61, 0x0301, 0,
- 1, 0x1F66, 0x1F60, 0x0342, 0,
- 1, 0x1F67, 0x1F61, 0x0342, 0,
- 1, 0x1F68, 0x03A9, 0x0313, 0,
- 1, 0x1F69, 0x03A9, 0x0314, 0,
- 1, 0x1F6A, 0x1F68, 0x0300, 0,
- 1, 0x1F6B, 0x1F69, 0x0300, 0,
- 1, 0x1F6C, 0x1F68, 0x0301, 0,
- 1, 0x1F6D, 0x1F69, 0x0301, 0,
- 1, 0x1F6E, 0x1F68, 0x0342, 0,
- 1, 0x1F6F, 0x1F69, 0x0342, 0,
- 1, 0x1F70, 0x03B1, 0x0300, 0,
- 1, 0x1F71, 0x03AC, 0,
- 1, 0x1F72, 0x03B5, 0x0300, 0,
- 1, 0x1F73, 0x03AD, 0,
- 1, 0x1F74, 0x03B7, 0x0300, 0,
- 1, 0x1F75, 0x03AE, 0,
- 1, 0x1F76, 0x03B9, 0x0300, 0,
- 1, 0x1F77, 0x03AF, 0,
- 1, 0x1F78, 0x03BF, 0x0300, 0,
- 1, 0x1F79, 0x03CC, 0,
- 1, 0x1F7A, 0x03C5, 0x0300, 0,
- 1, 0x1F7B, 0x03CD, 0,
- 1, 0x1F7C, 0x03C9, 0x0300, 0,
- 1, 0x1F7D, 0x03CE, 0,
- 1, 0x1F80, 0x1F00, 0x0345, 0,
- 1, 0x1F81, 0x1F01, 0x0345, 0,
- 1, 0x1F82, 0x1F02, 0x0345, 0,
- 1, 0x1F83, 0x1F03, 0x0345, 0,
- 1, 0x1F84, 0x1F04, 0x0345, 0,
- 1, 0x1F85, 0x1F05, 0x0345, 0,
- 1, 0x1F86, 0x1F06, 0x0345, 0,
- 1, 0x1F87, 0x1F07, 0x0345, 0,
- 1, 0x1F88, 0x1F08, 0x0345, 0,
- 1, 0x1F89, 0x1F09, 0x0345, 0,
- 1, 0x1F8A, 0x1F0A, 0x0345, 0,
- 1, 0x1F8B, 0x1F0B, 0x0345, 0,
- 1, 0x1F8C, 0x1F0C, 0x0345, 0,
- 1, 0x1F8D, 0x1F0D, 0x0345, 0,
- 1, 0x1F8E, 0x1F0E, 0x0345, 0,
- 1, 0x1F8F, 0x1F0F, 0x0345, 0,
- 1, 0x1F90, 0x1F20, 0x0345, 0,
- 1, 0x1F91, 0x1F21, 0x0345, 0,
- 1, 0x1F92, 0x1F22, 0x0345, 0,
- 1, 0x1F93, 0x1F23, 0x0345, 0,
- 1, 0x1F94, 0x1F24, 0x0345, 0,
- 1, 0x1F95, 0x1F25, 0x0345, 0,
- 1, 0x1F96, 0x1F26, 0x0345, 0,
- 1, 0x1F97, 0x1F27, 0x0345, 0,
- 1, 0x1F98, 0x1F28, 0x0345, 0,
- 1, 0x1F99, 0x1F29, 0x0345, 0,
- 1, 0x1F9A, 0x1F2A, 0x0345, 0,
- 1, 0x1F9B, 0x1F2B, 0x0345, 0,
- 1, 0x1F9C, 0x1F2C, 0x0345, 0,
- 1, 0x1F9D, 0x1F2D, 0x0345, 0,
- 1, 0x1F9E, 0x1F2E, 0x0345, 0,
- 1, 0x1F9F, 0x1F2F, 0x0345, 0,
- 1, 0x1FA0, 0x1F60, 0x0345, 0,
- 1, 0x1FA1, 0x1F61, 0x0345, 0,
- 1, 0x1FA2, 0x1F62, 0x0345, 0,
- 1, 0x1FA3, 0x1F63, 0x0345, 0,
- 1, 0x1FA4, 0x1F64, 0x0345, 0,
- 1, 0x1FA5, 0x1F65, 0x0345, 0,
- 1, 0x1FA6, 0x1F66, 0x0345, 0,
- 1, 0x1FA7, 0x1F67, 0x0345, 0,
- 1, 0x1FA8, 0x1F68, 0x0345, 0,
- 1, 0x1FA9, 0x1F69, 0x0345, 0,
- 1, 0x1FAA, 0x1F6A, 0x0345, 0,
- 1, 0x1FAB, 0x1F6B, 0x0345, 0,
- 1, 0x1FAC, 0x1F6C, 0x0345, 0,
- 1, 0x1FAD, 0x1F6D, 0x0345, 0,
- 1, 0x1FAE, 0x1F6E, 0x0345, 0,
- 1, 0x1FAF, 0x1F6F, 0x0345, 0,
- 1, 0x1FB0, 0x03B1, 0x0306, 0,
- 1, 0x1FB1, 0x03B1, 0x0304, 0,
- 1, 0x1FB2, 0x1F70, 0x0345, 0,
- 1, 0x1FB3, 0x03B1, 0x0345, 0,
- 1, 0x1FB4, 0x03AC, 0x0345, 0,
- 1, 0x1FB6, 0x03B1, 0x0342, 0,
- 1, 0x1FB7, 0x1FB6, 0x0345, 0,
- 1, 0x1FB8, 0x0391, 0x0306, 0,
- 1, 0x1FB9, 0x0391, 0x0304, 0,
- 1, 0x1FBA, 0x0391, 0x0300, 0,
- 1, 0x1FBB, 0x0386, 0,
- 1, 0x1FBC, 0x0391, 0x0345, 0,
- 16, 0x1FBD, 0x0020, 0x0313, 0,
- 1, 0x1FBE, 0x03B9, 0,
- 16, 0x1FBF, 0x0020, 0x0313, 0,
- 16, 0x1FC0, 0x0020, 0x0342, 0,
- 1, 0x1FC1, 0x00A8, 0x0342, 0,
- 1, 0x1FC2, 0x1F74, 0x0345, 0,
- 1, 0x1FC3, 0x03B7, 0x0345, 0,
- 1, 0x1FC4, 0x03AE, 0x0345, 0,
- 1, 0x1FC6, 0x03B7, 0x0342, 0,
- 1, 0x1FC7, 0x1FC6, 0x0345, 0,
- 1, 0x1FC8, 0x0395, 0x0300, 0,
- 1, 0x1FC9, 0x0388, 0,
- 1, 0x1FCA, 0x0397, 0x0300, 0,
- 1, 0x1FCB, 0x0389, 0,
- 1, 0x1FCC, 0x0397, 0x0345, 0,
- 1, 0x1FCD, 0x1FBF, 0x0300, 0,
- 1, 0x1FCE, 0x1FBF, 0x0301, 0,
- 1, 0x1FCF, 0x1FBF, 0x0342, 0,
- 1, 0x1FD0, 0x03B9, 0x0306, 0,
- 1, 0x1FD1, 0x03B9, 0x0304, 0,
- 1, 0x1FD2, 0x03CA, 0x0300, 0,
- 1, 0x1FD3, 0x0390, 0,
- 1, 0x1FD6, 0x03B9, 0x0342, 0,
- 1, 0x1FD7, 0x03CA, 0x0342, 0,
- 1, 0x1FD8, 0x0399, 0x0306, 0,
- 1, 0x1FD9, 0x0399, 0x0304, 0,
- 1, 0x1FDA, 0x0399, 0x0300, 0,
- 1, 0x1FDB, 0x038A, 0,
- 1, 0x1FDD, 0x1FFE, 0x0300, 0,
- 1, 0x1FDE, 0x1FFE, 0x0301, 0,
- 1, 0x1FDF, 0x1FFE, 0x0342, 0,
- 1, 0x1FE0, 0x03C5, 0x0306, 0,
- 1, 0x1FE1, 0x03C5, 0x0304, 0,
- 1, 0x1FE2, 0x03CB, 0x0300, 0,
- 1, 0x1FE3, 0x03B0, 0,
- 1, 0x1FE4, 0x03C1, 0x0313, 0,
- 1, 0x1FE5, 0x03C1, 0x0314, 0,
- 1, 0x1FE6, 0x03C5, 0x0342, 0,
- 1, 0x1FE7, 0x03CB, 0x0342, 0,
- 1, 0x1FE8, 0x03A5, 0x0306, 0,
- 1, 0x1FE9, 0x03A5, 0x0304, 0,
- 1, 0x1FEA, 0x03A5, 0x0300, 0,
- 1, 0x1FEB, 0x038E, 0,
- 1, 0x1FEC, 0x03A1, 0x0314, 0,
- 1, 0x1FED, 0x00A8, 0x0300, 0,
- 1, 0x1FEE, 0x0385, 0,
- 1, 0x1FEF, 0x0060, 0,
- 1, 0x1FF2, 0x1F7C, 0x0345, 0,
- 1, 0x1FF3, 0x03C9, 0x0345, 0,
- 1, 0x1FF4, 0x03CE, 0x0345, 0,
- 1, 0x1FF6, 0x03C9, 0x0342, 0,
- 1, 0x1FF7, 0x1FF6, 0x0345, 0,
- 1, 0x1FF8, 0x039F, 0x0300, 0,
- 1, 0x1FF9, 0x038C, 0,
- 1, 0x1FFA, 0x03A9, 0x0300, 0,
- 1, 0x1FFB, 0x038F, 0,
- 1, 0x1FFC, 0x03A9, 0x0345, 0,
- 1, 0x1FFD, 0x00B4, 0,
- 16, 0x1FFE, 0x0020, 0x0314, 0,
- 1, 0x2000, 0x2002, 0,
- 1, 0x2001, 0x2003, 0,
- 16, 0x2002, 0x0020, 0,
- 16, 0x2003, 0x0020, 0,
- 16, 0x2004, 0x0020, 0,
- 16, 0x2005, 0x0020, 0,
- 16, 0x2006, 0x0020, 0,
- 3, 0x2007, 0x0020, 0,
- 16, 0x2008, 0x0020, 0,
- 16, 0x2009, 0x0020, 0,
- 16, 0x200A, 0x0020, 0,
- 3, 0x2011, 0x2010, 0,
- 16, 0x2017, 0x0020, 0x0333, 0,
- 16, 0x2024, 0x002E, 0,
- 16, 0x2025, 0x002E, 0x002E, 0,
- 16, 0x2026, 0x002E, 0x002E, 0x002E, 0,
- 3, 0x202F, 0x0020, 0,
- 16, 0x2033, 0x2032, 0x2032, 0,
- 16, 0x2034, 0x2032, 0x2032, 0x2032, 0,
- 16, 0x2036, 0x2035, 0x2035, 0,
- 16, 0x2037, 0x2035, 0x2035, 0x2035, 0,
- 16, 0x203C, 0x0021, 0x0021, 0,
- 16, 0x203E, 0x0020, 0x0305, 0,
- 16, 0x2048, 0x003F, 0x0021, 0,
- 16, 0x2049, 0x0021, 0x003F, 0,
- 9, 0x2070, 0x0030, 0,
- 9, 0x2074, 0x0034, 0,
- 9, 0x2075, 0x0035, 0,
- 9, 0x2076, 0x0036, 0,
- 9, 0x2077, 0x0037, 0,
- 9, 0x2078, 0x0038, 0,
- 9, 0x2079, 0x0039, 0,
- 9, 0x207A, 0x002B, 0,
- 9, 0x207B, 0x2212, 0,
- 9, 0x207C, 0x003D, 0,
- 9, 0x207D, 0x0028, 0,
- 9, 0x207E, 0x0029, 0,
- 9, 0x207F, 0x006E, 0,
- 10, 0x2080, 0x0030, 0,
- 10, 0x2081, 0x0031, 0,
- 10, 0x2082, 0x0032, 0,
- 10, 0x2083, 0x0033, 0,
- 10, 0x2084, 0x0034, 0,
- 10, 0x2085, 0x0035, 0,
- 10, 0x2086, 0x0036, 0,
- 10, 0x2087, 0x0037, 0,
- 10, 0x2088, 0x0038, 0,
- 10, 0x2089, 0x0039, 0,
- 10, 0x208A, 0x002B, 0,
- 10, 0x208B, 0x2212, 0,
- 10, 0x208C, 0x003D, 0,
- 10, 0x208D, 0x0028, 0,
- 10, 0x208E, 0x0029, 0,
- 16, 0x20A8, 0x0052, 0x0073, 0,
- 16, 0x2100, 0x0061, 0x002F, 0x0063, 0,
- 16, 0x2101, 0x0061, 0x002F, 0x0073, 0,
- 2, 0x2102, 0x0043, 0,
- 16, 0x2103, 0x00B0, 0x0043, 0,
- 16, 0x2105, 0x0063, 0x002F, 0x006F, 0,
- 16, 0x2106, 0x0063, 0x002F, 0x0075, 0,
- 16, 0x2107, 0x0190, 0,
- 16, 0x2109, 0x00B0, 0x0046, 0,
- 2, 0x210A, 0x0067, 0,
- 2, 0x210B, 0x0048, 0,
- 2, 0x210C, 0x0048, 0,
- 2, 0x210D, 0x0048, 0,
- 2, 0x210E, 0x0068, 0,
- 2, 0x210F, 0x0127, 0,
- 2, 0x2110, 0x0049, 0,
- 2, 0x2111, 0x0049, 0,
- 2, 0x2112, 0x004C, 0,
- 2, 0x2113, 0x006C, 0,
- 2, 0x2115, 0x004E, 0,
- 16, 0x2116, 0x004E, 0x006F, 0,
- 2, 0x2119, 0x0050, 0,
- 2, 0x211A, 0x0051, 0,
- 2, 0x211B, 0x0052, 0,
- 2, 0x211C, 0x0052, 0,
- 2, 0x211D, 0x0052, 0,
- 9, 0x2120, 0x0053, 0x004D, 0,
- 16, 0x2121, 0x0054, 0x0045, 0x004C, 0,
- 9, 0x2122, 0x0054, 0x004D, 0,
- 2, 0x2124, 0x005A, 0,
- 1, 0x2126, 0x03A9, 0,
- 2, 0x2128, 0x005A, 0,
- 1, 0x212A, 0x004B, 0,
- 1, 0x212B, 0x00C5, 0,
- 2, 0x212C, 0x0042, 0,
- 2, 0x212D, 0x0043, 0,
- 2, 0x212F, 0x0065, 0,
- 2, 0x2130, 0x0045, 0,
- 2, 0x2131, 0x0046, 0,
- 2, 0x2133, 0x004D, 0,
- 2, 0x2134, 0x006F, 0,
- 16, 0x2135, 0x05D0, 0,
- 16, 0x2136, 0x05D1, 0,
- 16, 0x2137, 0x05D2, 0,
- 16, 0x2138, 0x05D3, 0,
- 2, 0x2139, 0x0069, 0,
- 17, 0x2153, 0x0031, 0x2044, 0x0033, 0,
- 17, 0x2154, 0x0032, 0x2044, 0x0033, 0,
- 17, 0x2155, 0x0031, 0x2044, 0x0035, 0,
- 17, 0x2156, 0x0032, 0x2044, 0x0035, 0,
- 17, 0x2157, 0x0033, 0x2044, 0x0035, 0,
- 17, 0x2158, 0x0034, 0x2044, 0x0035, 0,
- 17, 0x2159, 0x0031, 0x2044, 0x0036, 0,
- 17, 0x215A, 0x0035, 0x2044, 0x0036, 0,
- 17, 0x215B, 0x0031, 0x2044, 0x0038, 0,
- 17, 0x215C, 0x0033, 0x2044, 0x0038, 0,
- 17, 0x215D, 0x0035, 0x2044, 0x0038, 0,
- 17, 0x215E, 0x0037, 0x2044, 0x0038, 0,
- 17, 0x215F, 0x0031, 0x2044, 0,
- 16, 0x2160, 0x0049, 0,
- 16, 0x2161, 0x0049, 0x0049, 0,
- 16, 0x2162, 0x0049, 0x0049, 0x0049, 0,
- 16, 0x2163, 0x0049, 0x0056, 0,
- 16, 0x2164, 0x0056, 0,
- 16, 0x2165, 0x0056, 0x0049, 0,
- 16, 0x2166, 0x0056, 0x0049, 0x0049, 0,
- 16, 0x2167, 0x0056, 0x0049, 0x0049, 0x0049, 0,
- 16, 0x2168, 0x0049, 0x0058, 0,
- 16, 0x2169, 0x0058, 0,
- 16, 0x216A, 0x0058, 0x0049, 0,
- 16, 0x216B, 0x0058, 0x0049, 0x0049, 0,
- 16, 0x216C, 0x004C, 0,
- 16, 0x216D, 0x0043, 0,
- 16, 0x216E, 0x0044, 0,
- 16, 0x216F, 0x004D, 0,
- 16, 0x2170, 0x0069, 0,
- 16, 0x2171, 0x0069, 0x0069, 0,
- 16, 0x2172, 0x0069, 0x0069, 0x0069, 0,
- 16, 0x2173, 0x0069, 0x0076, 0,
- 16, 0x2174, 0x0076, 0,
- 16, 0x2175, 0x0076, 0x0069, 0,
- 16, 0x2176, 0x0076, 0x0069, 0x0069, 0,
- 16, 0x2177, 0x0076, 0x0069, 0x0069, 0x0069, 0,
- 16, 0x2178, 0x0069, 0x0078, 0,
- 16, 0x2179, 0x0078, 0,
- 16, 0x217A, 0x0078, 0x0069, 0,
- 16, 0x217B, 0x0078, 0x0069, 0x0069, 0,
- 16, 0x217C, 0x006C, 0,
- 16, 0x217D, 0x0063, 0,
- 16, 0x217E, 0x0064, 0,
- 16, 0x217F, 0x006D, 0,
- 1, 0x219A, 0x2190, 0x0338, 0,
- 1, 0x219B, 0x2192, 0x0338, 0,
- 1, 0x21AE, 0x2194, 0x0338, 0,
- 1, 0x21CD, 0x21D0, 0x0338, 0,
- 1, 0x21CE, 0x21D4, 0x0338, 0,
- 1, 0x21CF, 0x21D2, 0x0338, 0,
- 1, 0x2204, 0x2203, 0x0338, 0,
- 1, 0x2209, 0x2208, 0x0338, 0,
- 1, 0x220C, 0x220B, 0x0338, 0,
- 1, 0x2224, 0x2223, 0x0338, 0,
- 1, 0x2226, 0x2225, 0x0338, 0,
- 16, 0x222C, 0x222B, 0x222B, 0,
- 16, 0x222D, 0x222B, 0x222B, 0x222B, 0,
- 16, 0x222F, 0x222E, 0x222E, 0,
- 16, 0x2230, 0x222E, 0x222E, 0x222E, 0,
- 1, 0x2241, 0x223C, 0x0338, 0,
- 1, 0x2244, 0x2243, 0x0338, 0,
- 1, 0x2247, 0x2245, 0x0338, 0,
- 1, 0x2249, 0x2248, 0x0338, 0,
- 1, 0x2260, 0x003D, 0x0338, 0,
- 1, 0x2262, 0x2261, 0x0338, 0,
- 1, 0x226D, 0x224D, 0x0338, 0,
- 1, 0x226E, 0x003C, 0x0338, 0,
- 1, 0x226F, 0x003E, 0x0338, 0,
- 1, 0x2270, 0x2264, 0x0338, 0,
- 1, 0x2271, 0x2265, 0x0338, 0,
- 1, 0x2274, 0x2272, 0x0338, 0,
- 1, 0x2275, 0x2273, 0x0338, 0,
- 1, 0x2278, 0x2276, 0x0338, 0,
- 1, 0x2279, 0x2277, 0x0338, 0,
- 1, 0x2280, 0x227A, 0x0338, 0,
- 1, 0x2281, 0x227B, 0x0338, 0,
- 1, 0x2284, 0x2282, 0x0338, 0,
- 1, 0x2285, 0x2283, 0x0338, 0,
- 1, 0x2288, 0x2286, 0x0338, 0,
- 1, 0x2289, 0x2287, 0x0338, 0,
- 1, 0x22AC, 0x22A2, 0x0338, 0,
- 1, 0x22AD, 0x22A8, 0x0338, 0,
- 1, 0x22AE, 0x22A9, 0x0338, 0,
- 1, 0x22AF, 0x22AB, 0x0338, 0,
- 1, 0x22E0, 0x227C, 0x0338, 0,
- 1, 0x22E1, 0x227D, 0x0338, 0,
- 1, 0x22E2, 0x2291, 0x0338, 0,
- 1, 0x22E3, 0x2292, 0x0338, 0,
- 1, 0x22EA, 0x22B2, 0x0338, 0,
- 1, 0x22EB, 0x22B3, 0x0338, 0,
- 1, 0x22EC, 0x22B4, 0x0338, 0,
- 1, 0x22ED, 0x22B5, 0x0338, 0,
- 1, 0x2329, 0x3008, 0,
- 1, 0x232A, 0x3009, 0,
- 8, 0x2460, 0x0031, 0,
- 8, 0x2461, 0x0032, 0,
- 8, 0x2462, 0x0033, 0,
- 8, 0x2463, 0x0034, 0,
- 8, 0x2464, 0x0035, 0,
- 8, 0x2465, 0x0036, 0,
- 8, 0x2466, 0x0037, 0,
- 8, 0x2467, 0x0038, 0,
- 8, 0x2468, 0x0039, 0,
- 8, 0x2469, 0x0031, 0x0030, 0,
- 8, 0x246A, 0x0031, 0x0031, 0,
- 8, 0x246B, 0x0031, 0x0032, 0,
- 8, 0x246C, 0x0031, 0x0033, 0,
- 8, 0x246D, 0x0031, 0x0034, 0,
- 8, 0x246E, 0x0031, 0x0035, 0,
- 8, 0x246F, 0x0031, 0x0036, 0,
- 8, 0x2470, 0x0031, 0x0037, 0,
- 8, 0x2471, 0x0031, 0x0038, 0,
- 8, 0x2472, 0x0031, 0x0039, 0,
- 8, 0x2473, 0x0032, 0x0030, 0,
- 16, 0x2474, 0x0028, 0x0031, 0x0029, 0,
- 16, 0x2475, 0x0028, 0x0032, 0x0029, 0,
- 16, 0x2476, 0x0028, 0x0033, 0x0029, 0,
- 16, 0x2477, 0x0028, 0x0034, 0x0029, 0,
- 16, 0x2478, 0x0028, 0x0035, 0x0029, 0,
- 16, 0x2479, 0x0028, 0x0036, 0x0029, 0,
- 16, 0x247A, 0x0028, 0x0037, 0x0029, 0,
- 16, 0x247B, 0x0028, 0x0038, 0x0029, 0,
- 16, 0x247C, 0x0028, 0x0039, 0x0029, 0,
- 16, 0x247D, 0x0028, 0x0031, 0x0030, 0x0029, 0,
- 16, 0x247E, 0x0028, 0x0031, 0x0031, 0x0029, 0,
- 16, 0x247F, 0x0028, 0x0031, 0x0032, 0x0029, 0,
- 16, 0x2480, 0x0028, 0x0031, 0x0033, 0x0029, 0,
- 16, 0x2481, 0x0028, 0x0031, 0x0034, 0x0029, 0,
- 16, 0x2482, 0x0028, 0x0031, 0x0035, 0x0029, 0,
- 16, 0x2483, 0x0028, 0x0031, 0x0036, 0x0029, 0,
- 16, 0x2484, 0x0028, 0x0031, 0x0037, 0x0029, 0,
- 16, 0x2485, 0x0028, 0x0031, 0x0038, 0x0029, 0,
- 16, 0x2486, 0x0028, 0x0031, 0x0039, 0x0029, 0,
- 16, 0x2487, 0x0028, 0x0032, 0x0030, 0x0029, 0,
- 16, 0x2488, 0x0031, 0x002E, 0,
- 16, 0x2489, 0x0032, 0x002E, 0,
- 16, 0x248A, 0x0033, 0x002E, 0,
- 16, 0x248B, 0x0034, 0x002E, 0,
- 16, 0x248C, 0x0035, 0x002E, 0,
- 16, 0x248D, 0x0036, 0x002E, 0,
- 16, 0x248E, 0x0037, 0x002E, 0,
- 16, 0x248F, 0x0038, 0x002E, 0,
- 16, 0x2490, 0x0039, 0x002E, 0,
- 16, 0x2491, 0x0031, 0x0030, 0x002E, 0,
- 16, 0x2492, 0x0031, 0x0031, 0x002E, 0,
- 16, 0x2493, 0x0031, 0x0032, 0x002E, 0,
- 16, 0x2494, 0x0031, 0x0033, 0x002E, 0,
- 16, 0x2495, 0x0031, 0x0034, 0x002E, 0,
- 16, 0x2496, 0x0031, 0x0035, 0x002E, 0,
- 16, 0x2497, 0x0031, 0x0036, 0x002E, 0,
- 16, 0x2498, 0x0031, 0x0037, 0x002E, 0,
- 16, 0x2499, 0x0031, 0x0038, 0x002E, 0,
- 16, 0x249A, 0x0031, 0x0039, 0x002E, 0,
- 16, 0x249B, 0x0032, 0x0030, 0x002E, 0,
- 16, 0x249C, 0x0028, 0x0061, 0x0029, 0,
- 16, 0x249D, 0x0028, 0x0062, 0x0029, 0,
- 16, 0x249E, 0x0028, 0x0063, 0x0029, 0,
- 16, 0x249F, 0x0028, 0x0064, 0x0029, 0,
- 16, 0x24A0, 0x0028, 0x0065, 0x0029, 0,
- 16, 0x24A1, 0x0028, 0x0066, 0x0029, 0,
- 16, 0x24A2, 0x0028, 0x0067, 0x0029, 0,
- 16, 0x24A3, 0x0028, 0x0068, 0x0029, 0,
- 16, 0x24A4, 0x0028, 0x0069, 0x0029, 0,
- 16, 0x24A5, 0x0028, 0x006A, 0x0029, 0,
- 16, 0x24A6, 0x0028, 0x006B, 0x0029, 0,
- 16, 0x24A7, 0x0028, 0x006C, 0x0029, 0,
- 16, 0x24A8, 0x0028, 0x006D, 0x0029, 0,
- 16, 0x24A9, 0x0028, 0x006E, 0x0029, 0,
- 16, 0x24AA, 0x0028, 0x006F, 0x0029, 0,
- 16, 0x24AB, 0x0028, 0x0070, 0x0029, 0,
- 16, 0x24AC, 0x0028, 0x0071, 0x0029, 0,
- 16, 0x24AD, 0x0028, 0x0072, 0x0029, 0,
- 16, 0x24AE, 0x0028, 0x0073, 0x0029, 0,
- 16, 0x24AF, 0x0028, 0x0074, 0x0029, 0,
- 16, 0x24B0, 0x0028, 0x0075, 0x0029, 0,
- 16, 0x24B1, 0x0028, 0x0076, 0x0029, 0,
- 16, 0x24B2, 0x0028, 0x0077, 0x0029, 0,
- 16, 0x24B3, 0x0028, 0x0078, 0x0029, 0,
- 16, 0x24B4, 0x0028, 0x0079, 0x0029, 0,
- 16, 0x24B5, 0x0028, 0x007A, 0x0029, 0,
- 8, 0x24B6, 0x0041, 0,
- 8, 0x24B7, 0x0042, 0,
- 8, 0x24B8, 0x0043, 0,
- 8, 0x24B9, 0x0044, 0,
- 8, 0x24BA, 0x0045, 0,
- 8, 0x24BB, 0x0046, 0,
- 8, 0x24BC, 0x0047, 0,
- 8, 0x24BD, 0x0048, 0,
- 8, 0x24BE, 0x0049, 0,
- 8, 0x24BF, 0x004A, 0,
- 8, 0x24C0, 0x004B, 0,
- 8, 0x24C1, 0x004C, 0,
- 8, 0x24C2, 0x004D, 0,
- 8, 0x24C3, 0x004E, 0,
- 8, 0x24C4, 0x004F, 0,
- 8, 0x24C5, 0x0050, 0,
- 8, 0x24C6, 0x0051, 0,
- 8, 0x24C7, 0x0052, 0,
- 8, 0x24C8, 0x0053, 0,
- 8, 0x24C9, 0x0054, 0,
- 8, 0x24CA, 0x0055, 0,
- 8, 0x24CB, 0x0056, 0,
- 8, 0x24CC, 0x0057, 0,
- 8, 0x24CD, 0x0058, 0,
- 8, 0x24CE, 0x0059, 0,
- 8, 0x24CF, 0x005A, 0,
- 8, 0x24D0, 0x0061, 0,
- 8, 0x24D1, 0x0062, 0,
- 8, 0x24D2, 0x0063, 0,
- 8, 0x24D3, 0x0064, 0,
- 8, 0x24D4, 0x0065, 0,
- 8, 0x24D5, 0x0066, 0,
- 8, 0x24D6, 0x0067, 0,
- 8, 0x24D7, 0x0068, 0,
- 8, 0x24D8, 0x0069, 0,
- 8, 0x24D9, 0x006A, 0,
- 8, 0x24DA, 0x006B, 0,
- 8, 0x24DB, 0x006C, 0,
- 8, 0x24DC, 0x006D, 0,
- 8, 0x24DD, 0x006E, 0,
- 8, 0x24DE, 0x006F, 0,
- 8, 0x24DF, 0x0070, 0,
- 8, 0x24E0, 0x0071, 0,
- 8, 0x24E1, 0x0072, 0,
- 8, 0x24E2, 0x0073, 0,
- 8, 0x24E3, 0x0074, 0,
- 8, 0x24E4, 0x0075, 0,
- 8, 0x24E5, 0x0076, 0,
- 8, 0x24E6, 0x0077, 0,
- 8, 0x24E7, 0x0078, 0,
- 8, 0x24E8, 0x0079, 0,
- 8, 0x24E9, 0x007A, 0,
- 8, 0x24EA, 0x0030, 0,
- 16, 0x2E9F, 0x6BCD, 0,
- 16, 0x2EF3, 0x9F9F, 0,
- 16, 0x2F00, 0x4E00, 0,
- 16, 0x2F01, 0x4E28, 0,
- 16, 0x2F02, 0x4E36, 0,
- 16, 0x2F03, 0x4E3F, 0,
- 16, 0x2F04, 0x4E59, 0,
- 16, 0x2F05, 0x4E85, 0,
- 16, 0x2F06, 0x4E8C, 0,
- 16, 0x2F07, 0x4EA0, 0,
- 16, 0x2F08, 0x4EBA, 0,
- 16, 0x2F09, 0x513F, 0,
- 16, 0x2F0A, 0x5165, 0,
- 16, 0x2F0B, 0x516B, 0,
- 16, 0x2F0C, 0x5182, 0,
- 16, 0x2F0D, 0x5196, 0,
- 16, 0x2F0E, 0x51AB, 0,
- 16, 0x2F0F, 0x51E0, 0,
- 16, 0x2F10, 0x51F5, 0,
- 16, 0x2F11, 0x5200, 0,
- 16, 0x2F12, 0x529B, 0,
- 16, 0x2F13, 0x52F9, 0,
- 16, 0x2F14, 0x5315, 0,
- 16, 0x2F15, 0x531A, 0,
- 16, 0x2F16, 0x5338, 0,
- 16, 0x2F17, 0x5341, 0,
- 16, 0x2F18, 0x535C, 0,
- 16, 0x2F19, 0x5369, 0,
- 16, 0x2F1A, 0x5382, 0,
- 16, 0x2F1B, 0x53B6, 0,
- 16, 0x2F1C, 0x53C8, 0,
- 16, 0x2F1D, 0x53E3, 0,
- 16, 0x2F1E, 0x56D7, 0,
- 16, 0x2F1F, 0x571F, 0,
- 16, 0x2F20, 0x58EB, 0,
- 16, 0x2F21, 0x5902, 0,
- 16, 0x2F22, 0x590A, 0,
- 16, 0x2F23, 0x5915, 0,
- 16, 0x2F24, 0x5927, 0,
- 16, 0x2F25, 0x5973, 0,
- 16, 0x2F26, 0x5B50, 0,
- 16, 0x2F27, 0x5B80, 0,
- 16, 0x2F28, 0x5BF8, 0,
- 16, 0x2F29, 0x5C0F, 0,
- 16, 0x2F2A, 0x5C22, 0,
- 16, 0x2F2B, 0x5C38, 0,
- 16, 0x2F2C, 0x5C6E, 0,
- 16, 0x2F2D, 0x5C71, 0,
- 16, 0x2F2E, 0x5DDB, 0,
- 16, 0x2F2F, 0x5DE5, 0,
- 16, 0x2F30, 0x5DF1, 0,
- 16, 0x2F31, 0x5DFE, 0,
- 16, 0x2F32, 0x5E72, 0,
- 16, 0x2F33, 0x5E7A, 0,
- 16, 0x2F34, 0x5E7F, 0,
- 16, 0x2F35, 0x5EF4, 0,
- 16, 0x2F36, 0x5EFE, 0,
- 16, 0x2F37, 0x5F0B, 0,
- 16, 0x2F38, 0x5F13, 0,
- 16, 0x2F39, 0x5F50, 0,
- 16, 0x2F3A, 0x5F61, 0,
- 16, 0x2F3B, 0x5F73, 0,
- 16, 0x2F3C, 0x5FC3, 0,
- 16, 0x2F3D, 0x6208, 0,
- 16, 0x2F3E, 0x6236, 0,
- 16, 0x2F3F, 0x624B, 0,
- 16, 0x2F40, 0x652F, 0,
- 16, 0x2F41, 0x6534, 0,
- 16, 0x2F42, 0x6587, 0,
- 16, 0x2F43, 0x6597, 0,
- 16, 0x2F44, 0x65A4, 0,
- 16, 0x2F45, 0x65B9, 0,
- 16, 0x2F46, 0x65E0, 0,
- 16, 0x2F47, 0x65E5, 0,
- 16, 0x2F48, 0x66F0, 0,
- 16, 0x2F49, 0x6708, 0,
- 16, 0x2F4A, 0x6728, 0,
- 16, 0x2F4B, 0x6B20, 0,
- 16, 0x2F4C, 0x6B62, 0,
- 16, 0x2F4D, 0x6B79, 0,
- 16, 0x2F4E, 0x6BB3, 0,
- 16, 0x2F4F, 0x6BCB, 0,
- 16, 0x2F50, 0x6BD4, 0,
- 16, 0x2F51, 0x6BDB, 0,
- 16, 0x2F52, 0x6C0F, 0,
- 16, 0x2F53, 0x6C14, 0,
- 16, 0x2F54, 0x6C34, 0,
- 16, 0x2F55, 0x706B, 0,
- 16, 0x2F56, 0x722A, 0,
- 16, 0x2F57, 0x7236, 0,
- 16, 0x2F58, 0x723B, 0,
- 16, 0x2F59, 0x723F, 0,
- 16, 0x2F5A, 0x7247, 0,
- 16, 0x2F5B, 0x7259, 0,
- 16, 0x2F5C, 0x725B, 0,
- 16, 0x2F5D, 0x72AC, 0,
- 16, 0x2F5E, 0x7384, 0,
- 16, 0x2F5F, 0x7389, 0,
- 16, 0x2F60, 0x74DC, 0,
- 16, 0x2F61, 0x74E6, 0,
- 16, 0x2F62, 0x7518, 0,
- 16, 0x2F63, 0x751F, 0,
- 16, 0x2F64, 0x7528, 0,
- 16, 0x2F65, 0x7530, 0,
- 16, 0x2F66, 0x758B, 0,
- 16, 0x2F67, 0x7592, 0,
- 16, 0x2F68, 0x7676, 0,
- 16, 0x2F69, 0x767D, 0,
- 16, 0x2F6A, 0x76AE, 0,
- 16, 0x2F6B, 0x76BF, 0,
- 16, 0x2F6C, 0x76EE, 0,
- 16, 0x2F6D, 0x77DB, 0,
- 16, 0x2F6E, 0x77E2, 0,
- 16, 0x2F6F, 0x77F3, 0,
- 16, 0x2F70, 0x793A, 0,
- 16, 0x2F71, 0x79B8, 0,
- 16, 0x2F72, 0x79BE, 0,
- 16, 0x2F73, 0x7A74, 0,
- 16, 0x2F74, 0x7ACB, 0,
- 16, 0x2F75, 0x7AF9, 0,
- 16, 0x2F76, 0x7C73, 0,
- 16, 0x2F77, 0x7CF8, 0,
- 16, 0x2F78, 0x7F36, 0,
- 16, 0x2F79, 0x7F51, 0,
- 16, 0x2F7A, 0x7F8A, 0,
- 16, 0x2F7B, 0x7FBD, 0,
- 16, 0x2F7C, 0x8001, 0,
- 16, 0x2F7D, 0x800C, 0,
- 16, 0x2F7E, 0x8012, 0,
- 16, 0x2F7F, 0x8033, 0,
- 16, 0x2F80, 0x807F, 0,
- 16, 0x2F81, 0x8089, 0,
- 16, 0x2F82, 0x81E3, 0,
- 16, 0x2F83, 0x81EA, 0,
- 16, 0x2F84, 0x81F3, 0,
- 16, 0x2F85, 0x81FC, 0,
- 16, 0x2F86, 0x820C, 0,
- 16, 0x2F87, 0x821B, 0,
- 16, 0x2F88, 0x821F, 0,
- 16, 0x2F89, 0x826E, 0,
- 16, 0x2F8A, 0x8272, 0,
- 16, 0x2F8B, 0x8278, 0,
- 16, 0x2F8C, 0x864D, 0,
- 16, 0x2F8D, 0x866B, 0,
- 16, 0x2F8E, 0x8840, 0,
- 16, 0x2F8F, 0x884C, 0,
- 16, 0x2F90, 0x8863, 0,
- 16, 0x2F91, 0x897E, 0,
- 16, 0x2F92, 0x898B, 0,
- 16, 0x2F93, 0x89D2, 0,
- 16, 0x2F94, 0x8A00, 0,
- 16, 0x2F95, 0x8C37, 0,
- 16, 0x2F96, 0x8C46, 0,
- 16, 0x2F97, 0x8C55, 0,
- 16, 0x2F98, 0x8C78, 0,
- 16, 0x2F99, 0x8C9D, 0,
- 16, 0x2F9A, 0x8D64, 0,
- 16, 0x2F9B, 0x8D70, 0,
- 16, 0x2F9C, 0x8DB3, 0,
- 16, 0x2F9D, 0x8EAB, 0,
- 16, 0x2F9E, 0x8ECA, 0,
- 16, 0x2F9F, 0x8F9B, 0,
- 16, 0x2FA0, 0x8FB0, 0,
- 16, 0x2FA1, 0x8FB5, 0,
- 16, 0x2FA2, 0x9091, 0,
- 16, 0x2FA3, 0x9149, 0,
- 16, 0x2FA4, 0x91C6, 0,
- 16, 0x2FA5, 0x91CC, 0,
- 16, 0x2FA6, 0x91D1, 0,
- 16, 0x2FA7, 0x9577, 0,
- 16, 0x2FA8, 0x9580, 0,
- 16, 0x2FA9, 0x961C, 0,
- 16, 0x2FAA, 0x96B6, 0,
- 16, 0x2FAB, 0x96B9, 0,
- 16, 0x2FAC, 0x96E8, 0,
- 16, 0x2FAD, 0x9751, 0,
- 16, 0x2FAE, 0x975E, 0,
- 16, 0x2FAF, 0x9762, 0,
- 16, 0x2FB0, 0x9769, 0,
- 16, 0x2FB1, 0x97CB, 0,
- 16, 0x2FB2, 0x97ED, 0,
- 16, 0x2FB3, 0x97F3, 0,
- 16, 0x2FB4, 0x9801, 0,
- 16, 0x2FB5, 0x98A8, 0,
- 16, 0x2FB6, 0x98DB, 0,
- 16, 0x2FB7, 0x98DF, 0,
- 16, 0x2FB8, 0x9996, 0,
- 16, 0x2FB9, 0x9999, 0,
- 16, 0x2FBA, 0x99AC, 0,
- 16, 0x2FBB, 0x9AA8, 0,
- 16, 0x2FBC, 0x9AD8, 0,
- 16, 0x2FBD, 0x9ADF, 0,
- 16, 0x2FBE, 0x9B25, 0,
- 16, 0x2FBF, 0x9B2F, 0,
- 16, 0x2FC0, 0x9B32, 0,
- 16, 0x2FC1, 0x9B3C, 0,
- 16, 0x2FC2, 0x9B5A, 0,
- 16, 0x2FC3, 0x9CE5, 0,
- 16, 0x2FC4, 0x9E75, 0,
- 16, 0x2FC5, 0x9E7F, 0,
- 16, 0x2FC6, 0x9EA5, 0,
- 16, 0x2FC7, 0x9EBB, 0,
- 16, 0x2FC8, 0x9EC3, 0,
- 16, 0x2FC9, 0x9ECD, 0,
- 16, 0x2FCA, 0x9ED1, 0,
- 16, 0x2FCB, 0x9EF9, 0,
- 16, 0x2FCC, 0x9EFD, 0,
- 16, 0x2FCD, 0x9F0E, 0,
- 16, 0x2FCE, 0x9F13, 0,
- 16, 0x2FCF, 0x9F20, 0,
- 16, 0x2FD0, 0x9F3B, 0,
- 16, 0x2FD1, 0x9F4A, 0,
- 16, 0x2FD2, 0x9F52, 0,
- 16, 0x2FD3, 0x9F8D, 0,
- 16, 0x2FD4, 0x9F9C, 0,
- 16, 0x2FD5, 0x9FA0, 0,
- 12, 0x3000, 0x0020, 0,
- 16, 0x3036, 0x3012, 0,
- 16, 0x3038, 0x5341, 0,
- 16, 0x3039, 0x5344, 0,
- 16, 0x303A, 0x5345, 0,
- 1, 0x304C, 0x304B, 0x3099, 0,
- 1, 0x304E, 0x304D, 0x3099, 0,
- 1, 0x3050, 0x304F, 0x3099, 0,
- 1, 0x3052, 0x3051, 0x3099, 0,
- 1, 0x3054, 0x3053, 0x3099, 0,
- 1, 0x3056, 0x3055, 0x3099, 0,
- 1, 0x3058, 0x3057, 0x3099, 0,
- 1, 0x305A, 0x3059, 0x3099, 0,
- 1, 0x305C, 0x305B, 0x3099, 0,
- 1, 0x305E, 0x305D, 0x3099, 0,
- 1, 0x3060, 0x305F, 0x3099, 0,
- 1, 0x3062, 0x3061, 0x3099, 0,
- 1, 0x3065, 0x3064, 0x3099, 0,
- 1, 0x3067, 0x3066, 0x3099, 0,
- 1, 0x3069, 0x3068, 0x3099, 0,
- 1, 0x3070, 0x306F, 0x3099, 0,
- 1, 0x3071, 0x306F, 0x309A, 0,
- 1, 0x3073, 0x3072, 0x3099, 0,
- 1, 0x3074, 0x3072, 0x309A, 0,
- 1, 0x3076, 0x3075, 0x3099, 0,
- 1, 0x3077, 0x3075, 0x309A, 0,
- 1, 0x3079, 0x3078, 0x3099, 0,
- 1, 0x307A, 0x3078, 0x309A, 0,
- 1, 0x307C, 0x307B, 0x3099, 0,
- 1, 0x307D, 0x307B, 0x309A, 0,
- 1, 0x3094, 0x3046, 0x3099, 0,
- 16, 0x309B, 0x0020, 0x3099, 0,
- 16, 0x309C, 0x0020, 0x309A, 0,
- 1, 0x309E, 0x309D, 0x3099, 0,
- 1, 0x30AC, 0x30AB, 0x3099, 0,
- 1, 0x30AE, 0x30AD, 0x3099, 0,
- 1, 0x30B0, 0x30AF, 0x3099, 0,
- 1, 0x30B2, 0x30B1, 0x3099, 0,
- 1, 0x30B4, 0x30B3, 0x3099, 0,
- 1, 0x30B6, 0x30B5, 0x3099, 0,
- 1, 0x30B8, 0x30B7, 0x3099, 0,
- 1, 0x30BA, 0x30B9, 0x3099, 0,
- 1, 0x30BC, 0x30BB, 0x3099, 0,
- 1, 0x30BE, 0x30BD, 0x3099, 0,
- 1, 0x30C0, 0x30BF, 0x3099, 0,
- 1, 0x30C2, 0x30C1, 0x3099, 0,
- 1, 0x30C5, 0x30C4, 0x3099, 0,
- 1, 0x30C7, 0x30C6, 0x3099, 0,
- 1, 0x30C9, 0x30C8, 0x3099, 0,
- 1, 0x30D0, 0x30CF, 0x3099, 0,
- 1, 0x30D1, 0x30CF, 0x309A, 0,
- 1, 0x30D3, 0x30D2, 0x3099, 0,
- 1, 0x30D4, 0x30D2, 0x309A, 0,
- 1, 0x30D6, 0x30D5, 0x3099, 0,
- 1, 0x30D7, 0x30D5, 0x309A, 0,
- 1, 0x30D9, 0x30D8, 0x3099, 0,
- 1, 0x30DA, 0x30D8, 0x309A, 0,
- 1, 0x30DC, 0x30DB, 0x3099, 0,
- 1, 0x30DD, 0x30DB, 0x309A, 0,
- 1, 0x30F4, 0x30A6, 0x3099, 0,
- 1, 0x30F7, 0x30EF, 0x3099, 0,
- 1, 0x30F8, 0x30F0, 0x3099, 0,
- 1, 0x30F9, 0x30F1, 0x3099, 0,
- 1, 0x30FA, 0x30F2, 0x3099, 0,
- 1, 0x30FE, 0x30FD, 0x3099, 0,
- 16, 0x3131, 0x1100, 0,
- 16, 0x3132, 0x1101, 0,
- 16, 0x3133, 0x11AA, 0,
- 16, 0x3134, 0x1102, 0,
- 16, 0x3135, 0x11AC, 0,
- 16, 0x3136, 0x11AD, 0,
- 16, 0x3137, 0x1103, 0,
- 16, 0x3138, 0x1104, 0,
- 16, 0x3139, 0x1105, 0,
- 16, 0x313A, 0x11B0, 0,
- 16, 0x313B, 0x11B1, 0,
- 16, 0x313C, 0x11B2, 0,
- 16, 0x313D, 0x11B3, 0,
- 16, 0x313E, 0x11B4, 0,
- 16, 0x313F, 0x11B5, 0,
- 16, 0x3140, 0x111A, 0,
- 16, 0x3141, 0x1106, 0,
- 16, 0x3142, 0x1107, 0,
- 16, 0x3143, 0x1108, 0,
- 16, 0x3144, 0x1121, 0,
- 16, 0x3145, 0x1109, 0,
- 16, 0x3146, 0x110A, 0,
- 16, 0x3147, 0x110B, 0,
- 16, 0x3148, 0x110C, 0,
- 16, 0x3149, 0x110D, 0,
- 16, 0x314A, 0x110E, 0,
- 16, 0x314B, 0x110F, 0,
- 16, 0x314C, 0x1110, 0,
- 16, 0x314D, 0x1111, 0,
- 16, 0x314E, 0x1112, 0,
- 16, 0x314F, 0x1161, 0,
- 16, 0x3150, 0x1162, 0,
- 16, 0x3151, 0x1163, 0,
- 16, 0x3152, 0x1164, 0,
- 16, 0x3153, 0x1165, 0,
- 16, 0x3154, 0x1166, 0,
- 16, 0x3155, 0x1167, 0,
- 16, 0x3156, 0x1168, 0,
- 16, 0x3157, 0x1169, 0,
- 16, 0x3158, 0x116A, 0,
- 16, 0x3159, 0x116B, 0,
- 16, 0x315A, 0x116C, 0,
- 16, 0x315B, 0x116D, 0,
- 16, 0x315C, 0x116E, 0,
- 16, 0x315D, 0x116F, 0,
- 16, 0x315E, 0x1170, 0,
- 16, 0x315F, 0x1171, 0,
- 16, 0x3160, 0x1172, 0,
- 16, 0x3161, 0x1173, 0,
- 16, 0x3162, 0x1174, 0,
- 16, 0x3163, 0x1175, 0,
- 16, 0x3164, 0x1160, 0,
- 16, 0x3165, 0x1114, 0,
- 16, 0x3166, 0x1115, 0,
- 16, 0x3167, 0x11C7, 0,
- 16, 0x3168, 0x11C8, 0,
- 16, 0x3169, 0x11CC, 0,
- 16, 0x316A, 0x11CE, 0,
- 16, 0x316B, 0x11D3, 0,
- 16, 0x316C, 0x11D7, 0,
- 16, 0x316D, 0x11D9, 0,
- 16, 0x316E, 0x111C, 0,
- 16, 0x316F, 0x11DD, 0,
- 16, 0x3170, 0x11DF, 0,
- 16, 0x3171, 0x111D, 0,
- 16, 0x3172, 0x111E, 0,
- 16, 0x3173, 0x1120, 0,
- 16, 0x3174, 0x1122, 0,
- 16, 0x3175, 0x1123, 0,
- 16, 0x3176, 0x1127, 0,
- 16, 0x3177, 0x1129, 0,
- 16, 0x3178, 0x112B, 0,
- 16, 0x3179, 0x112C, 0,
- 16, 0x317A, 0x112D, 0,
- 16, 0x317B, 0x112E, 0,
- 16, 0x317C, 0x112F, 0,
- 16, 0x317D, 0x1132, 0,
- 16, 0x317E, 0x1136, 0,
- 16, 0x317F, 0x1140, 0,
- 16, 0x3180, 0x1147, 0,
- 16, 0x3181, 0x114C, 0,
- 16, 0x3182, 0x11F1, 0,
- 16, 0x3183, 0x11F2, 0,
- 16, 0x3184, 0x1157, 0,
- 16, 0x3185, 0x1158, 0,
- 16, 0x3186, 0x1159, 0,
- 16, 0x3187, 0x1184, 0,
- 16, 0x3188, 0x1185, 0,
- 16, 0x3189, 0x1188, 0,
- 16, 0x318A, 0x1191, 0,
- 16, 0x318B, 0x1192, 0,
- 16, 0x318C, 0x1194, 0,
- 16, 0x318D, 0x119E, 0,
- 16, 0x318E, 0x11A1, 0,
- 9, 0x3192, 0x4E00, 0,
- 9, 0x3193, 0x4E8C, 0,
- 9, 0x3194, 0x4E09, 0,
- 9, 0x3195, 0x56DB, 0,
- 9, 0x3196, 0x4E0A, 0,
- 9, 0x3197, 0x4E2D, 0,
- 9, 0x3198, 0x4E0B, 0,
- 9, 0x3199, 0x7532, 0,
- 9, 0x319A, 0x4E59, 0,
- 9, 0x319B, 0x4E19, 0,
- 9, 0x319C, 0x4E01, 0,
- 9, 0x319D, 0x5929, 0,
- 9, 0x319E, 0x5730, 0,
- 9, 0x319F, 0x4EBA, 0,
- 16, 0x3200, 0x0028, 0x1100, 0x0029, 0,
- 16, 0x3201, 0x0028, 0x1102, 0x0029, 0,
- 16, 0x3202, 0x0028, 0x1103, 0x0029, 0,
- 16, 0x3203, 0x0028, 0x1105, 0x0029, 0,
- 16, 0x3204, 0x0028, 0x1106, 0x0029, 0,
- 16, 0x3205, 0x0028, 0x1107, 0x0029, 0,
- 16, 0x3206, 0x0028, 0x1109, 0x0029, 0,
- 16, 0x3207, 0x0028, 0x110B, 0x0029, 0,
- 16, 0x3208, 0x0028, 0x110C, 0x0029, 0,
- 16, 0x3209, 0x0028, 0x110E, 0x0029, 0,
- 16, 0x320A, 0x0028, 0x110F, 0x0029, 0,
- 16, 0x320B, 0x0028, 0x1110, 0x0029, 0,
- 16, 0x320C, 0x0028, 0x1111, 0x0029, 0,
- 16, 0x320D, 0x0028, 0x1112, 0x0029, 0,
- 16, 0x320E, 0x0028, 0x1100, 0x1161, 0x0029, 0,
- 16, 0x320F, 0x0028, 0x1102, 0x1161, 0x0029, 0,
- 16, 0x3210, 0x0028, 0x1103, 0x1161, 0x0029, 0,
- 16, 0x3211, 0x0028, 0x1105, 0x1161, 0x0029, 0,
- 16, 0x3212, 0x0028, 0x1106, 0x1161, 0x0029, 0,
- 16, 0x3213, 0x0028, 0x1107, 0x1161, 0x0029, 0,
- 16, 0x3214, 0x0028, 0x1109, 0x1161, 0x0029, 0,
- 16, 0x3215, 0x0028, 0x110B, 0x1161, 0x0029, 0,
- 16, 0x3216, 0x0028, 0x110C, 0x1161, 0x0029, 0,
- 16, 0x3217, 0x0028, 0x110E, 0x1161, 0x0029, 0,
- 16, 0x3218, 0x0028, 0x110F, 0x1161, 0x0029, 0,
- 16, 0x3219, 0x0028, 0x1110, 0x1161, 0x0029, 0,
- 16, 0x321A, 0x0028, 0x1111, 0x1161, 0x0029, 0,
- 16, 0x321B, 0x0028, 0x1112, 0x1161, 0x0029, 0,
- 16, 0x321C, 0x0028, 0x110C, 0x116E, 0x0029, 0,
- 16, 0x3220, 0x0028, 0x4E00, 0x0029, 0,
- 16, 0x3221, 0x0028, 0x4E8C, 0x0029, 0,
- 16, 0x3222, 0x0028, 0x4E09, 0x0029, 0,
- 16, 0x3223, 0x0028, 0x56DB, 0x0029, 0,
- 16, 0x3224, 0x0028, 0x4E94, 0x0029, 0,
- 16, 0x3225, 0x0028, 0x516D, 0x0029, 0,
- 16, 0x3226, 0x0028, 0x4E03, 0x0029, 0,
- 16, 0x3227, 0x0028, 0x516B, 0x0029, 0,
- 16, 0x3228, 0x0028, 0x4E5D, 0x0029, 0,
- 16, 0x3229, 0x0028, 0x5341, 0x0029, 0,
- 16, 0x322A, 0x0028, 0x6708, 0x0029, 0,
- 16, 0x322B, 0x0028, 0x706B, 0x0029, 0,
- 16, 0x322C, 0x0028, 0x6C34, 0x0029, 0,
- 16, 0x322D, 0x0028, 0x6728, 0x0029, 0,
- 16, 0x322E, 0x0028, 0x91D1, 0x0029, 0,
- 16, 0x322F, 0x0028, 0x571F, 0x0029, 0,
- 16, 0x3230, 0x0028, 0x65E5, 0x0029, 0,
- 16, 0x3231, 0x0028, 0x682A, 0x0029, 0,
- 16, 0x3232, 0x0028, 0x6709, 0x0029, 0,
- 16, 0x3233, 0x0028, 0x793E, 0x0029, 0,
- 16, 0x3234, 0x0028, 0x540D, 0x0029, 0,
- 16, 0x3235, 0x0028, 0x7279, 0x0029, 0,
- 16, 0x3236, 0x0028, 0x8CA1, 0x0029, 0,
- 16, 0x3237, 0x0028, 0x795D, 0x0029, 0,
- 16, 0x3238, 0x0028, 0x52B4, 0x0029, 0,
- 16, 0x3239, 0x0028, 0x4EE3, 0x0029, 0,
- 16, 0x323A, 0x0028, 0x547C, 0x0029, 0,
- 16, 0x323B, 0x0028, 0x5B66, 0x0029, 0,
- 16, 0x323C, 0x0028, 0x76E3, 0x0029, 0,
- 16, 0x323D, 0x0028, 0x4F01, 0x0029, 0,
- 16, 0x323E, 0x0028, 0x8CC7, 0x0029, 0,
- 16, 0x323F, 0x0028, 0x5354, 0x0029, 0,
- 16, 0x3240, 0x0028, 0x796D, 0x0029, 0,
- 16, 0x3241, 0x0028, 0x4F11, 0x0029, 0,
- 16, 0x3242, 0x0028, 0x81EA, 0x0029, 0,
- 16, 0x3243, 0x0028, 0x81F3, 0x0029, 0,
- 8, 0x3260, 0x1100, 0,
- 8, 0x3261, 0x1102, 0,
- 8, 0x3262, 0x1103, 0,
- 8, 0x3263, 0x1105, 0,
- 8, 0x3264, 0x1106, 0,
- 8, 0x3265, 0x1107, 0,
- 8, 0x3266, 0x1109, 0,
- 8, 0x3267, 0x110B, 0,
- 8, 0x3268, 0x110C, 0,
- 8, 0x3269, 0x110E, 0,
- 8, 0x326A, 0x110F, 0,
- 8, 0x326B, 0x1110, 0,
- 8, 0x326C, 0x1111, 0,
- 8, 0x326D, 0x1112, 0,
- 8, 0x326E, 0x1100, 0x1161, 0,
- 8, 0x326F, 0x1102, 0x1161, 0,
- 8, 0x3270, 0x1103, 0x1161, 0,
- 8, 0x3271, 0x1105, 0x1161, 0,
- 8, 0x3272, 0x1106, 0x1161, 0,
- 8, 0x3273, 0x1107, 0x1161, 0,
- 8, 0x3274, 0x1109, 0x1161, 0,
- 8, 0x3275, 0x110B, 0x1161, 0,
- 8, 0x3276, 0x110C, 0x1161, 0,
- 8, 0x3277, 0x110E, 0x1161, 0,
- 8, 0x3278, 0x110F, 0x1161, 0,
- 8, 0x3279, 0x1110, 0x1161, 0,
- 8, 0x327A, 0x1111, 0x1161, 0,
- 8, 0x327B, 0x1112, 0x1161, 0,
- 8, 0x3280, 0x4E00, 0,
- 8, 0x3281, 0x4E8C, 0,
- 8, 0x3282, 0x4E09, 0,
- 8, 0x3283, 0x56DB, 0,
- 8, 0x3284, 0x4E94, 0,
- 8, 0x3285, 0x516D, 0,
- 8, 0x3286, 0x4E03, 0,
- 8, 0x3287, 0x516B, 0,
- 8, 0x3288, 0x4E5D, 0,
- 8, 0x3289, 0x5341, 0,
- 8, 0x328A, 0x6708, 0,
- 8, 0x328B, 0x706B, 0,
- 8, 0x328C, 0x6C34, 0,
- 8, 0x328D, 0x6728, 0,
- 8, 0x328E, 0x91D1, 0,
- 8, 0x328F, 0x571F, 0,
- 8, 0x3290, 0x65E5, 0,
- 8, 0x3291, 0x682A, 0,
- 8, 0x3292, 0x6709, 0,
- 8, 0x3293, 0x793E, 0,
- 8, 0x3294, 0x540D, 0,
- 8, 0x3295, 0x7279, 0,
- 8, 0x3296, 0x8CA1, 0,
- 8, 0x3297, 0x795D, 0,
- 8, 0x3298, 0x52B4, 0,
- 8, 0x3299, 0x79D8, 0,
- 8, 0x329A, 0x7537, 0,
- 8, 0x329B, 0x5973, 0,
- 8, 0x329C, 0x9069, 0,
- 8, 0x329D, 0x512A, 0,
- 8, 0x329E, 0x5370, 0,
- 8, 0x329F, 0x6CE8, 0,
- 8, 0x32A0, 0x9805, 0,
- 8, 0x32A1, 0x4F11, 0,
- 8, 0x32A2, 0x5199, 0,
- 8, 0x32A3, 0x6B63, 0,
- 8, 0x32A4, 0x4E0A, 0,
- 8, 0x32A5, 0x4E2D, 0,
- 8, 0x32A6, 0x4E0B, 0,
- 8, 0x32A7, 0x5DE6, 0,
- 8, 0x32A8, 0x53F3, 0,
- 8, 0x32A9, 0x533B, 0,
- 8, 0x32AA, 0x5B97, 0,
- 8, 0x32AB, 0x5B66, 0,
- 8, 0x32AC, 0x76E3, 0,
- 8, 0x32AD, 0x4F01, 0,
- 8, 0x32AE, 0x8CC7, 0,
- 8, 0x32AF, 0x5354, 0,
- 8, 0x32B0, 0x591C, 0,
- 16, 0x32C0, 0x0031, 0x6708, 0,
- 16, 0x32C1, 0x0032, 0x6708, 0,
- 16, 0x32C2, 0x0033, 0x6708, 0,
- 16, 0x32C3, 0x0034, 0x6708, 0,
- 16, 0x32C4, 0x0035, 0x6708, 0,
- 16, 0x32C5, 0x0036, 0x6708, 0,
- 16, 0x32C6, 0x0037, 0x6708, 0,
- 16, 0x32C7, 0x0038, 0x6708, 0,
- 16, 0x32C8, 0x0039, 0x6708, 0,
- 16, 0x32C9, 0x0031, 0x0030, 0x6708, 0,
- 16, 0x32CA, 0x0031, 0x0031, 0x6708, 0,
- 16, 0x32CB, 0x0031, 0x0032, 0x6708, 0,
- 8, 0x32D0, 0x30A2, 0,
- 8, 0x32D1, 0x30A4, 0,
- 8, 0x32D2, 0x30A6, 0,
- 8, 0x32D3, 0x30A8, 0,
- 8, 0x32D4, 0x30AA, 0,
- 8, 0x32D5, 0x30AB, 0,
- 8, 0x32D6, 0x30AD, 0,
- 8, 0x32D7, 0x30AF, 0,
- 8, 0x32D8, 0x30B1, 0,
- 8, 0x32D9, 0x30B3, 0,
- 8, 0x32DA, 0x30B5, 0,
- 8, 0x32DB, 0x30B7, 0,
- 8, 0x32DC, 0x30B9, 0,
- 8, 0x32DD, 0x30BB, 0,
- 8, 0x32DE, 0x30BD, 0,
- 8, 0x32DF, 0x30BF, 0,
- 8, 0x32E0, 0x30C1, 0,
- 8, 0x32E1, 0x30C4, 0,
- 8, 0x32E2, 0x30C6, 0,
- 8, 0x32E3, 0x30C8, 0,
- 8, 0x32E4, 0x30CA, 0,
- 8, 0x32E5, 0x30CB, 0,
- 8, 0x32E6, 0x30CC, 0,
- 8, 0x32E7, 0x30CD, 0,
- 8, 0x32E8, 0x30CE, 0,
- 8, 0x32E9, 0x30CF, 0,
- 8, 0x32EA, 0x30D2, 0,
- 8, 0x32EB, 0x30D5, 0,
- 8, 0x32EC, 0x30D8, 0,
- 8, 0x32ED, 0x30DB, 0,
- 8, 0x32EE, 0x30DE, 0,
- 8, 0x32EF, 0x30DF, 0,
- 8, 0x32F0, 0x30E0, 0,
- 8, 0x32F1, 0x30E1, 0,
- 8, 0x32F2, 0x30E2, 0,
- 8, 0x32F3, 0x30E4, 0,
- 8, 0x32F4, 0x30E6, 0,
- 8, 0x32F5, 0x30E8, 0,
- 8, 0x32F6, 0x30E9, 0,
- 8, 0x32F7, 0x30EA, 0,
- 8, 0x32F8, 0x30EB, 0,
- 8, 0x32F9, 0x30EC, 0,
- 8, 0x32FA, 0x30ED, 0,
- 8, 0x32FB, 0x30EF, 0,
- 8, 0x32FC, 0x30F0, 0,
- 8, 0x32FD, 0x30F1, 0,
- 8, 0x32FE, 0x30F2, 0,
- 15, 0x3300, 0x30A2, 0x30D1, 0x30FC, 0x30C8, 0,
- 15, 0x3301, 0x30A2, 0x30EB, 0x30D5, 0x30A1, 0,
- 15, 0x3302, 0x30A2, 0x30F3, 0x30DA, 0x30A2, 0,
- 15, 0x3303, 0x30A2, 0x30FC, 0x30EB, 0,
- 15, 0x3304, 0x30A4, 0x30CB, 0x30F3, 0x30B0, 0,
- 15, 0x3305, 0x30A4, 0x30F3, 0x30C1, 0,
- 15, 0x3306, 0x30A6, 0x30A9, 0x30F3, 0,
- 15, 0x3307, 0x30A8, 0x30B9, 0x30AF, 0x30FC, 0x30C9, 0,
- 15, 0x3308, 0x30A8, 0x30FC, 0x30AB, 0x30FC, 0,
- 15, 0x3309, 0x30AA, 0x30F3, 0x30B9, 0,
- 15, 0x330A, 0x30AA, 0x30FC, 0x30E0, 0,
- 15, 0x330B, 0x30AB, 0x30A4, 0x30EA, 0,
- 15, 0x330C, 0x30AB, 0x30E9, 0x30C3, 0x30C8, 0,
- 15, 0x330D, 0x30AB, 0x30ED, 0x30EA, 0x30FC, 0,
- 15, 0x330E, 0x30AC, 0x30ED, 0x30F3, 0,
- 15, 0x330F, 0x30AC, 0x30F3, 0x30DE, 0,
- 15, 0x3310, 0x30AE, 0x30AC, 0,
- 15, 0x3311, 0x30AE, 0x30CB, 0x30FC, 0,
- 15, 0x3312, 0x30AD, 0x30E5, 0x30EA, 0x30FC, 0,
- 15, 0x3313, 0x30AE, 0x30EB, 0x30C0, 0x30FC, 0,
- 15, 0x3314, 0x30AD, 0x30ED, 0,
- 15, 0x3315, 0x30AD, 0x30ED, 0x30B0, 0x30E9, 0x30E0, 0,
- 15, 0x3316, 0x30AD, 0x30ED, 0x30E1, 0x30FC, 0x30C8, 0x30EB, 0,
- 15, 0x3317, 0x30AD, 0x30ED, 0x30EF, 0x30C3, 0x30C8, 0,
- 15, 0x3318, 0x30B0, 0x30E9, 0x30E0, 0,
- 15, 0x3319, 0x30B0, 0x30E9, 0x30E0, 0x30C8, 0x30F3, 0,
- 15, 0x331A, 0x30AF, 0x30EB, 0x30BC, 0x30A4, 0x30ED, 0,
- 15, 0x331B, 0x30AF, 0x30ED, 0x30FC, 0x30CD, 0,
- 15, 0x331C, 0x30B1, 0x30FC, 0x30B9, 0,
- 15, 0x331D, 0x30B3, 0x30EB, 0x30CA, 0,
- 15, 0x331E, 0x30B3, 0x30FC, 0x30DD, 0,
- 15, 0x331F, 0x30B5, 0x30A4, 0x30AF, 0x30EB, 0,
- 15, 0x3320, 0x30B5, 0x30F3, 0x30C1, 0x30FC, 0x30E0, 0,
- 15, 0x3321, 0x30B7, 0x30EA, 0x30F3, 0x30B0, 0,
- 15, 0x3322, 0x30BB, 0x30F3, 0x30C1, 0,
- 15, 0x3323, 0x30BB, 0x30F3, 0x30C8, 0,
- 15, 0x3324, 0x30C0, 0x30FC, 0x30B9, 0,
- 15, 0x3325, 0x30C7, 0x30B7, 0,
- 15, 0x3326, 0x30C9, 0x30EB, 0,
- 15, 0x3327, 0x30C8, 0x30F3, 0,
- 15, 0x3328, 0x30CA, 0x30CE, 0,
- 15, 0x3329, 0x30CE, 0x30C3, 0x30C8, 0,
- 15, 0x332A, 0x30CF, 0x30A4, 0x30C4, 0,
- 15, 0x332B, 0x30D1, 0x30FC, 0x30BB, 0x30F3, 0x30C8, 0,
- 15, 0x332C, 0x30D1, 0x30FC, 0x30C4, 0,
- 15, 0x332D, 0x30D0, 0x30FC, 0x30EC, 0x30EB, 0,
- 15, 0x332E, 0x30D4, 0x30A2, 0x30B9, 0x30C8, 0x30EB, 0,
- 15, 0x332F, 0x30D4, 0x30AF, 0x30EB, 0,
- 15, 0x3330, 0x30D4, 0x30B3, 0,
- 15, 0x3331, 0x30D3, 0x30EB, 0,
- 15, 0x3332, 0x30D5, 0x30A1, 0x30E9, 0x30C3, 0x30C9, 0,
- 15, 0x3333, 0x30D5, 0x30A3, 0x30FC, 0x30C8, 0,
- 15, 0x3334, 0x30D6, 0x30C3, 0x30B7, 0x30A7, 0x30EB, 0,
- 15, 0x3335, 0x30D5, 0x30E9, 0x30F3, 0,
- 15, 0x3336, 0x30D8, 0x30AF, 0x30BF, 0x30FC, 0x30EB, 0,
- 15, 0x3337, 0x30DA, 0x30BD, 0,
- 15, 0x3338, 0x30DA, 0x30CB, 0x30D2, 0,
- 15, 0x3339, 0x30D8, 0x30EB, 0x30C4, 0,
- 15, 0x333A, 0x30DA, 0x30F3, 0x30B9, 0,
- 15, 0x333B, 0x30DA, 0x30FC, 0x30B8, 0,
- 15, 0x333C, 0x30D9, 0x30FC, 0x30BF, 0,
- 15, 0x333D, 0x30DD, 0x30A4, 0x30F3, 0x30C8, 0,
- 15, 0x333E, 0x30DC, 0x30EB, 0x30C8, 0,
- 15, 0x333F, 0x30DB, 0x30F3, 0,
- 15, 0x3340, 0x30DD, 0x30F3, 0x30C9, 0,
- 15, 0x3341, 0x30DB, 0x30FC, 0x30EB, 0,
- 15, 0x3342, 0x30DB, 0x30FC, 0x30F3, 0,
- 15, 0x3343, 0x30DE, 0x30A4, 0x30AF, 0x30ED, 0,
- 15, 0x3344, 0x30DE, 0x30A4, 0x30EB, 0,
- 15, 0x3345, 0x30DE, 0x30C3, 0x30CF, 0,
- 15, 0x3346, 0x30DE, 0x30EB, 0x30AF, 0,
- 15, 0x3347, 0x30DE, 0x30F3, 0x30B7, 0x30E7, 0x30F3, 0,
- 15, 0x3348, 0x30DF, 0x30AF, 0x30ED, 0x30F3, 0,
- 15, 0x3349, 0x30DF, 0x30EA, 0,
- 15, 0x334A, 0x30DF, 0x30EA, 0x30D0, 0x30FC, 0x30EB, 0,
- 15, 0x334B, 0x30E1, 0x30AC, 0,
- 15, 0x334C, 0x30E1, 0x30AC, 0x30C8, 0x30F3, 0,
- 15, 0x334D, 0x30E1, 0x30FC, 0x30C8, 0x30EB, 0,
- 15, 0x334E, 0x30E4, 0x30FC, 0x30C9, 0,
- 15, 0x334F, 0x30E4, 0x30FC, 0x30EB, 0,
- 15, 0x3350, 0x30E6, 0x30A2, 0x30F3, 0,
- 15, 0x3351, 0x30EA, 0x30C3, 0x30C8, 0x30EB, 0,
- 15, 0x3352, 0x30EA, 0x30E9, 0,
- 15, 0x3353, 0x30EB, 0x30D4, 0x30FC, 0,
- 15, 0x3354, 0x30EB, 0x30FC, 0x30D6, 0x30EB, 0,
- 15, 0x3355, 0x30EC, 0x30E0, 0,
- 15, 0x3356, 0x30EC, 0x30F3, 0x30C8, 0x30B2, 0x30F3, 0,
- 15, 0x3357, 0x30EF, 0x30C3, 0x30C8, 0,
- 16, 0x3358, 0x0030, 0x70B9, 0,
- 16, 0x3359, 0x0031, 0x70B9, 0,
- 16, 0x335A, 0x0032, 0x70B9, 0,
- 16, 0x335B, 0x0033, 0x70B9, 0,
- 16, 0x335C, 0x0034, 0x70B9, 0,
- 16, 0x335D, 0x0035, 0x70B9, 0,
- 16, 0x335E, 0x0036, 0x70B9, 0,
- 16, 0x335F, 0x0037, 0x70B9, 0,
- 16, 0x3360, 0x0038, 0x70B9, 0,
- 16, 0x3361, 0x0039, 0x70B9, 0,
- 16, 0x3362, 0x0031, 0x0030, 0x70B9, 0,
- 16, 0x3363, 0x0031, 0x0031, 0x70B9, 0,
- 16, 0x3364, 0x0031, 0x0032, 0x70B9, 0,
- 16, 0x3365, 0x0031, 0x0033, 0x70B9, 0,
- 16, 0x3366, 0x0031, 0x0034, 0x70B9, 0,
- 16, 0x3367, 0x0031, 0x0035, 0x70B9, 0,
- 16, 0x3368, 0x0031, 0x0036, 0x70B9, 0,
- 16, 0x3369, 0x0031, 0x0037, 0x70B9, 0,
- 16, 0x336A, 0x0031, 0x0038, 0x70B9, 0,
- 16, 0x336B, 0x0031, 0x0039, 0x70B9, 0,
- 16, 0x336C, 0x0032, 0x0030, 0x70B9, 0,
- 16, 0x336D, 0x0032, 0x0031, 0x70B9, 0,
- 16, 0x336E, 0x0032, 0x0032, 0x70B9, 0,
- 16, 0x336F, 0x0032, 0x0033, 0x70B9, 0,
- 16, 0x3370, 0x0032, 0x0034, 0x70B9, 0,
- 15, 0x3371, 0x0068, 0x0050, 0x0061, 0,
- 15, 0x3372, 0x0064, 0x0061, 0,
- 15, 0x3373, 0x0041, 0x0055, 0,
- 15, 0x3374, 0x0062, 0x0061, 0x0072, 0,
- 15, 0x3375, 0x006F, 0x0056, 0,
- 15, 0x3376, 0x0070, 0x0063, 0,
- 15, 0x337B, 0x5E73, 0x6210, 0,
- 15, 0x337C, 0x662D, 0x548C, 0,
- 15, 0x337D, 0x5927, 0x6B63, 0,
- 15, 0x337E, 0x660E, 0x6CBB, 0,
- 15, 0x337F, 0x682A, 0x5F0F, 0x4F1A, 0x793E, 0,
- 15, 0x3380, 0x0070, 0x0041, 0,
- 15, 0x3381, 0x006E, 0x0041, 0,
- 15, 0x3382, 0x03BC, 0x0041, 0,
- 15, 0x3383, 0x006D, 0x0041, 0,
- 15, 0x3384, 0x006B, 0x0041, 0,
- 15, 0x3385, 0x004B, 0x0042, 0,
- 15, 0x3386, 0x004D, 0x0042, 0,
- 15, 0x3387, 0x0047, 0x0042, 0,
- 15, 0x3388, 0x0063, 0x0061, 0x006C, 0,
- 15, 0x3389, 0x006B, 0x0063, 0x0061, 0x006C, 0,
- 15, 0x338A, 0x0070, 0x0046, 0,
- 15, 0x338B, 0x006E, 0x0046, 0,
- 15, 0x338C, 0x03BC, 0x0046, 0,
- 15, 0x338D, 0x03BC, 0x0067, 0,
- 15, 0x338E, 0x006D, 0x0067, 0,
- 15, 0x338F, 0x006B, 0x0067, 0,
- 15, 0x3390, 0x0048, 0x007A, 0,
- 15, 0x3391, 0x006B, 0x0048, 0x007A, 0,
- 15, 0x3392, 0x004D, 0x0048, 0x007A, 0,
- 15, 0x3393, 0x0047, 0x0048, 0x007A, 0,
- 15, 0x3394, 0x0054, 0x0048, 0x007A, 0,
- 15, 0x3395, 0x03BC, 0x2113, 0,
- 15, 0x3396, 0x006D, 0x2113, 0,
- 15, 0x3397, 0x0064, 0x2113, 0,
- 15, 0x3398, 0x006B, 0x2113, 0,
- 15, 0x3399, 0x0066, 0x006D, 0,
- 15, 0x339A, 0x006E, 0x006D, 0,
- 15, 0x339B, 0x03BC, 0x006D, 0,
- 15, 0x339C, 0x006D, 0x006D, 0,
- 15, 0x339D, 0x0063, 0x006D, 0,
- 15, 0x339E, 0x006B, 0x006D, 0,
- 15, 0x339F, 0x006D, 0x006D, 0x00B2, 0,
- 15, 0x33A0, 0x0063, 0x006D, 0x00B2, 0,
- 15, 0x33A1, 0x006D, 0x00B2, 0,
- 15, 0x33A2, 0x006B, 0x006D, 0x00B2, 0,
- 15, 0x33A3, 0x006D, 0x006D, 0x00B3, 0,
- 15, 0x33A4, 0x0063, 0x006D, 0x00B3, 0,
- 15, 0x33A5, 0x006D, 0x00B3, 0,
- 15, 0x33A6, 0x006B, 0x006D, 0x00B3, 0,
- 15, 0x33A7, 0x006D, 0x2215, 0x0073, 0,
- 15, 0x33A8, 0x006D, 0x2215, 0x0073, 0x00B2, 0,
- 15, 0x33A9, 0x0050, 0x0061, 0,
- 15, 0x33AA, 0x006B, 0x0050, 0x0061, 0,
- 15, 0x33AB, 0x004D, 0x0050, 0x0061, 0,
- 15, 0x33AC, 0x0047, 0x0050, 0x0061, 0,
- 15, 0x33AD, 0x0072, 0x0061, 0x0064, 0,
- 15, 0x33AE, 0x0072, 0x0061, 0x0064, 0x2215, 0x0073, 0,
- 15, 0x33AF, 0x0072, 0x0061, 0x0064, 0x2215, 0x0073, 0x00B2, 0,
- 15, 0x33B0, 0x0070, 0x0073, 0,
- 15, 0x33B1, 0x006E, 0x0073, 0,
- 15, 0x33B2, 0x03BC, 0x0073, 0,
- 15, 0x33B3, 0x006D, 0x0073, 0,
- 15, 0x33B4, 0x0070, 0x0056, 0,
- 15, 0x33B5, 0x006E, 0x0056, 0,
- 15, 0x33B6, 0x03BC, 0x0056, 0,
- 15, 0x33B7, 0x006D, 0x0056, 0,
- 15, 0x33B8, 0x006B, 0x0056, 0,
- 15, 0x33B9, 0x004D, 0x0056, 0,
- 15, 0x33BA, 0x0070, 0x0057, 0,
- 15, 0x33BB, 0x006E, 0x0057, 0,
- 15, 0x33BC, 0x03BC, 0x0057, 0,
- 15, 0x33BD, 0x006D, 0x0057, 0,
- 15, 0x33BE, 0x006B, 0x0057, 0,
- 15, 0x33BF, 0x004D, 0x0057, 0,
- 15, 0x33C0, 0x006B, 0x03A9, 0,
- 15, 0x33C1, 0x004D, 0x03A9, 0,
- 15, 0x33C2, 0x0061, 0x002E, 0x006D, 0x002E, 0,
- 15, 0x33C3, 0x0042, 0x0071, 0,
- 15, 0x33C4, 0x0063, 0x0063, 0,
- 15, 0x33C5, 0x0063, 0x0064, 0,
- 15, 0x33C6, 0x0043, 0x2215, 0x006B, 0x0067, 0,
- 15, 0x33C7, 0x0043, 0x006F, 0x002E, 0,
- 15, 0x33C8, 0x0064, 0x0042, 0,
- 15, 0x33C9, 0x0047, 0x0079, 0,
- 15, 0x33CA, 0x0068, 0x0061, 0,
- 15, 0x33CB, 0x0048, 0x0050, 0,
- 15, 0x33CC, 0x0069, 0x006E, 0,
- 15, 0x33CD, 0x004B, 0x004B, 0,
- 15, 0x33CE, 0x004B, 0x004D, 0,
- 15, 0x33CF, 0x006B, 0x0074, 0,
- 15, 0x33D0, 0x006C, 0x006D, 0,
- 15, 0x33D1, 0x006C, 0x006E, 0,
- 15, 0x33D2, 0x006C, 0x006F, 0x0067, 0,
- 15, 0x33D3, 0x006C, 0x0078, 0,
- 15, 0x33D4, 0x006D, 0x0062, 0,
- 15, 0x33D5, 0x006D, 0x0069, 0x006C, 0,
- 15, 0x33D6, 0x006D, 0x006F, 0x006C, 0,
- 15, 0x33D7, 0x0050, 0x0048, 0,
- 15, 0x33D8, 0x0070, 0x002E, 0x006D, 0x002E, 0,
- 15, 0x33D9, 0x0050, 0x0050, 0x004D, 0,
- 15, 0x33DA, 0x0050, 0x0052, 0,
- 15, 0x33DB, 0x0073, 0x0072, 0,
- 15, 0x33DC, 0x0053, 0x0076, 0,
- 15, 0x33DD, 0x0057, 0x0062, 0,
- 16, 0x33E0, 0x0031, 0x65E5, 0,
- 16, 0x33E1, 0x0032, 0x65E5, 0,
- 16, 0x33E2, 0x0033, 0x65E5, 0,
- 16, 0x33E3, 0x0034, 0x65E5, 0,
- 16, 0x33E4, 0x0035, 0x65E5, 0,
- 16, 0x33E5, 0x0036, 0x65E5, 0,
- 16, 0x33E6, 0x0037, 0x65E5, 0,
- 16, 0x33E7, 0x0038, 0x65E5, 0,
- 16, 0x33E8, 0x0039, 0x65E5, 0,
- 16, 0x33E9, 0x0031, 0x0030, 0x65E5, 0,
- 16, 0x33EA, 0x0031, 0x0031, 0x65E5, 0,
- 16, 0x33EB, 0x0031, 0x0032, 0x65E5, 0,
- 16, 0x33EC, 0x0031, 0x0033, 0x65E5, 0,
- 16, 0x33ED, 0x0031, 0x0034, 0x65E5, 0,
- 16, 0x33EE, 0x0031, 0x0035, 0x65E5, 0,
- 16, 0x33EF, 0x0031, 0x0036, 0x65E5, 0,
- 16, 0x33F0, 0x0031, 0x0037, 0x65E5, 0,
- 16, 0x33F1, 0x0031, 0x0038, 0x65E5, 0,
- 16, 0x33F2, 0x0031, 0x0039, 0x65E5, 0,
- 16, 0x33F3, 0x0032, 0x0030, 0x65E5, 0,
- 16, 0x33F4, 0x0032, 0x0031, 0x65E5, 0,
- 16, 0x33F5, 0x0032, 0x0032, 0x65E5, 0,
- 16, 0x33F6, 0x0032, 0x0033, 0x65E5, 0,
- 16, 0x33F7, 0x0032, 0x0034, 0x65E5, 0,
- 16, 0x33F8, 0x0032, 0x0035, 0x65E5, 0,
- 16, 0x33F9, 0x0032, 0x0036, 0x65E5, 0,
- 16, 0x33FA, 0x0032, 0x0037, 0x65E5, 0,
- 16, 0x33FB, 0x0032, 0x0038, 0x65E5, 0,
- 16, 0x33FC, 0x0032, 0x0039, 0x65E5, 0,
- 16, 0x33FD, 0x0033, 0x0030, 0x65E5, 0,
- 16, 0x33FE, 0x0033, 0x0031, 0x65E5, 0,
- 1, 0xF900, 0x8C48, 0,
- 1, 0xF901, 0x66F4, 0,
- 1, 0xF902, 0x8ECA, 0,
- 1, 0xF903, 0x8CC8, 0,
- 1, 0xF904, 0x6ED1, 0,
- 1, 0xF905, 0x4E32, 0,
- 1, 0xF906, 0x53E5, 0,
- 1, 0xF907, 0x9F9C, 0,
- 1, 0xF908, 0x9F9C, 0,
- 1, 0xF909, 0x5951, 0,
- 1, 0xF90A, 0x91D1, 0,
- 1, 0xF90B, 0x5587, 0,
- 1, 0xF90C, 0x5948, 0,
- 1, 0xF90D, 0x61F6, 0,
- 1, 0xF90E, 0x7669, 0,
- 1, 0xF90F, 0x7F85, 0,
- 1, 0xF910, 0x863F, 0,
- 1, 0xF911, 0x87BA, 0,
- 1, 0xF912, 0x88F8, 0,
- 1, 0xF913, 0x908F, 0,
- 1, 0xF914, 0x6A02, 0,
- 1, 0xF915, 0x6D1B, 0,
- 1, 0xF916, 0x70D9, 0,
- 1, 0xF917, 0x73DE, 0,
- 1, 0xF918, 0x843D, 0,
- 1, 0xF919, 0x916A, 0,
- 1, 0xF91A, 0x99F1, 0,
- 1, 0xF91B, 0x4E82, 0,
- 1, 0xF91C, 0x5375, 0,
- 1, 0xF91D, 0x6B04, 0,
- 1, 0xF91E, 0x721B, 0,
- 1, 0xF91F, 0x862D, 0,
- 1, 0xF920, 0x9E1E, 0,
- 1, 0xF921, 0x5D50, 0,
- 1, 0xF922, 0x6FEB, 0,
- 1, 0xF923, 0x85CD, 0,
- 1, 0xF924, 0x8964, 0,
- 1, 0xF925, 0x62C9, 0,
- 1, 0xF926, 0x81D8, 0,
- 1, 0xF927, 0x881F, 0,
- 1, 0xF928, 0x5ECA, 0,
- 1, 0xF929, 0x6717, 0,
- 1, 0xF92A, 0x6D6A, 0,
- 1, 0xF92B, 0x72FC, 0,
- 1, 0xF92C, 0x90CE, 0,
- 1, 0xF92D, 0x4F86, 0,
- 1, 0xF92E, 0x51B7, 0,
- 1, 0xF92F, 0x52DE, 0,
- 1, 0xF930, 0x64C4, 0,
- 1, 0xF931, 0x6AD3, 0,
- 1, 0xF932, 0x7210, 0,
- 1, 0xF933, 0x76E7, 0,
- 1, 0xF934, 0x8001, 0,
- 1, 0xF935, 0x8606, 0,
- 1, 0xF936, 0x865C, 0,
- 1, 0xF937, 0x8DEF, 0,
- 1, 0xF938, 0x9732, 0,
- 1, 0xF939, 0x9B6F, 0,
- 1, 0xF93A, 0x9DFA, 0,
- 1, 0xF93B, 0x788C, 0,
- 1, 0xF93C, 0x797F, 0,
- 1, 0xF93D, 0x7DA0, 0,
- 1, 0xF93E, 0x83C9, 0,
- 1, 0xF93F, 0x9304, 0,
- 1, 0xF940, 0x9E7F, 0,
- 1, 0xF941, 0x8AD6, 0,
- 1, 0xF942, 0x58DF, 0,
- 1, 0xF943, 0x5F04, 0,
- 1, 0xF944, 0x7C60, 0,
- 1, 0xF945, 0x807E, 0,
- 1, 0xF946, 0x7262, 0,
- 1, 0xF947, 0x78CA, 0,
- 1, 0xF948, 0x8CC2, 0,
- 1, 0xF949, 0x96F7, 0,
- 1, 0xF94A, 0x58D8, 0,
- 1, 0xF94B, 0x5C62, 0,
- 1, 0xF94C, 0x6A13, 0,
- 1, 0xF94D, 0x6DDA, 0,
- 1, 0xF94E, 0x6F0F, 0,
- 1, 0xF94F, 0x7D2F, 0,
- 1, 0xF950, 0x7E37, 0,
- 1, 0xF951, 0x96FB, 0,
- 1, 0xF952, 0x52D2, 0,
- 1, 0xF953, 0x808B, 0,
- 1, 0xF954, 0x51DC, 0,
- 1, 0xF955, 0x51CC, 0,
- 1, 0xF956, 0x7A1C, 0,
- 1, 0xF957, 0x7DBE, 0,
- 1, 0xF958, 0x83F1, 0,
- 1, 0xF959, 0x9675, 0,
- 1, 0xF95A, 0x8B80, 0,
- 1, 0xF95B, 0x62CF, 0,
- 1, 0xF95C, 0x6A02, 0,
- 1, 0xF95D, 0x8AFE, 0,
- 1, 0xF95E, 0x4E39, 0,
- 1, 0xF95F, 0x5BE7, 0,
- 1, 0xF960, 0x6012, 0,
- 1, 0xF961, 0x7387, 0,
- 1, 0xF962, 0x7570, 0,
- 1, 0xF963, 0x5317, 0,
- 1, 0xF964, 0x78FB, 0,
- 1, 0xF965, 0x4FBF, 0,
- 1, 0xF966, 0x5FA9, 0,
- 1, 0xF967, 0x4E0D, 0,
- 1, 0xF968, 0x6CCC, 0,
- 1, 0xF969, 0x6578, 0,
- 1, 0xF96A, 0x7D22, 0,
- 1, 0xF96B, 0x53C3, 0,
- 1, 0xF96C, 0x585E, 0,
- 1, 0xF96D, 0x7701, 0,
- 1, 0xF96E, 0x8449, 0,
- 1, 0xF96F, 0x8AAA, 0,
- 1, 0xF970, 0x6BBA, 0,
- 1, 0xF971, 0x8FB0, 0,
- 1, 0xF972, 0x6C88, 0,
- 1, 0xF973, 0x62FE, 0,
- 1, 0xF974, 0x82E5, 0,
- 1, 0xF975, 0x63A0, 0,
- 1, 0xF976, 0x7565, 0,
- 1, 0xF977, 0x4EAE, 0,
- 1, 0xF978, 0x5169, 0,
- 1, 0xF979, 0x51C9, 0,
- 1, 0xF97A, 0x6881, 0,
- 1, 0xF97B, 0x7CE7, 0,
- 1, 0xF97C, 0x826F, 0,
- 1, 0xF97D, 0x8AD2, 0,
- 1, 0xF97E, 0x91CF, 0,
- 1, 0xF97F, 0x52F5, 0,
- 1, 0xF980, 0x5442, 0,
- 1, 0xF981, 0x5973, 0,
- 1, 0xF982, 0x5EEC, 0,
- 1, 0xF983, 0x65C5, 0,
- 1, 0xF984, 0x6FFE, 0,
- 1, 0xF985, 0x792A, 0,
- 1, 0xF986, 0x95AD, 0,
- 1, 0xF987, 0x9A6A, 0,
- 1, 0xF988, 0x9E97, 0,
- 1, 0xF989, 0x9ECE, 0,
- 1, 0xF98A, 0x529B, 0,
- 1, 0xF98B, 0x66C6, 0,
- 1, 0xF98C, 0x6B77, 0,
- 1, 0xF98D, 0x8F62, 0,
- 1, 0xF98E, 0x5E74, 0,
- 1, 0xF98F, 0x6190, 0,
- 1, 0xF990, 0x6200, 0,
- 1, 0xF991, 0x649A, 0,
- 1, 0xF992, 0x6F23, 0,
- 1, 0xF993, 0x7149, 0,
- 1, 0xF994, 0x7489, 0,
- 1, 0xF995, 0x79CA, 0,
- 1, 0xF996, 0x7DF4, 0,
- 1, 0xF997, 0x806F, 0,
- 1, 0xF998, 0x8F26, 0,
- 1, 0xF999, 0x84EE, 0,
- 1, 0xF99A, 0x9023, 0,
- 1, 0xF99B, 0x934A, 0,
- 1, 0xF99C, 0x5217, 0,
- 1, 0xF99D, 0x52A3, 0,
- 1, 0xF99E, 0x54BD, 0,
- 1, 0xF99F, 0x70C8, 0,
- 1, 0xF9A0, 0x88C2, 0,
- 1, 0xF9A1, 0x8AAA, 0,
- 1, 0xF9A2, 0x5EC9, 0,
- 1, 0xF9A3, 0x5FF5, 0,
- 1, 0xF9A4, 0x637B, 0,
- 1, 0xF9A5, 0x6BAE, 0,
- 1, 0xF9A6, 0x7C3E, 0,
- 1, 0xF9A7, 0x7375, 0,
- 1, 0xF9A8, 0x4EE4, 0,
- 1, 0xF9A9, 0x56F9, 0,
- 1, 0xF9AA, 0x5BE7, 0,
- 1, 0xF9AB, 0x5DBA, 0,
- 1, 0xF9AC, 0x601C, 0,
- 1, 0xF9AD, 0x73B2, 0,
- 1, 0xF9AE, 0x7469, 0,
- 1, 0xF9AF, 0x7F9A, 0,
- 1, 0xF9B0, 0x8046, 0,
- 1, 0xF9B1, 0x9234, 0,
- 1, 0xF9B2, 0x96F6, 0,
- 1, 0xF9B3, 0x9748, 0,
- 1, 0xF9B4, 0x9818, 0,
- 1, 0xF9B5, 0x4F8B, 0,
- 1, 0xF9B6, 0x79AE, 0,
- 1, 0xF9B7, 0x91B4, 0,
- 1, 0xF9B8, 0x96B8, 0,
- 1, 0xF9B9, 0x60E1, 0,
- 1, 0xF9BA, 0x4E86, 0,
- 1, 0xF9BB, 0x50DA, 0,
- 1, 0xF9BC, 0x5BEE, 0,
- 1, 0xF9BD, 0x5C3F, 0,
- 1, 0xF9BE, 0x6599, 0,
- 1, 0xF9BF, 0x6A02, 0,
- 1, 0xF9C0, 0x71CE, 0,
- 1, 0xF9C1, 0x7642, 0,
- 1, 0xF9C2, 0x84FC, 0,
- 1, 0xF9C3, 0x907C, 0,
- 1, 0xF9C4, 0x9F8D, 0,
- 1, 0xF9C5, 0x6688, 0,
- 1, 0xF9C6, 0x962E, 0,
- 1, 0xF9C7, 0x5289, 0,
- 1, 0xF9C8, 0x677B, 0,
- 1, 0xF9C9, 0x67F3, 0,
- 1, 0xF9CA, 0x6D41, 0,
- 1, 0xF9CB, 0x6E9C, 0,
- 1, 0xF9CC, 0x7409, 0,
- 1, 0xF9CD, 0x7559, 0,
- 1, 0xF9CE, 0x786B, 0,
- 1, 0xF9CF, 0x7D10, 0,
- 1, 0xF9D0, 0x985E, 0,
- 1, 0xF9D1, 0x516D, 0,
- 1, 0xF9D2, 0x622E, 0,
- 1, 0xF9D3, 0x9678, 0,
- 1, 0xF9D4, 0x502B, 0,
- 1, 0xF9D5, 0x5D19, 0,
- 1, 0xF9D6, 0x6DEA, 0,
- 1, 0xF9D7, 0x8F2A, 0,
- 1, 0xF9D8, 0x5F8B, 0,
- 1, 0xF9D9, 0x6144, 0,
- 1, 0xF9DA, 0x6817, 0,
- 1, 0xF9DB, 0x7387, 0,
- 1, 0xF9DC, 0x9686, 0,
- 1, 0xF9DD, 0x5229, 0,
- 1, 0xF9DE, 0x540F, 0,
- 1, 0xF9DF, 0x5C65, 0,
- 1, 0xF9E0, 0x6613, 0,
- 1, 0xF9E1, 0x674E, 0,
- 1, 0xF9E2, 0x68A8, 0,
- 1, 0xF9E3, 0x6CE5, 0,
- 1, 0xF9E4, 0x7406, 0,
- 1, 0xF9E5, 0x75E2, 0,
- 1, 0xF9E6, 0x7F79, 0,
- 1, 0xF9E7, 0x88CF, 0,
- 1, 0xF9E8, 0x88E1, 0,
- 1, 0xF9E9, 0x91CC, 0,
- 1, 0xF9EA, 0x96E2, 0,
- 1, 0xF9EB, 0x533F, 0,
- 1, 0xF9EC, 0x6EBA, 0,
- 1, 0xF9ED, 0x541D, 0,
- 1, 0xF9EE, 0x71D0, 0,
- 1, 0xF9EF, 0x7498, 0,
- 1, 0xF9F0, 0x85FA, 0,
- 1, 0xF9F1, 0x96A3, 0,
- 1, 0xF9F2, 0x9C57, 0,
- 1, 0xF9F3, 0x9E9F, 0,
- 1, 0xF9F4, 0x6797, 0,
- 1, 0xF9F5, 0x6DCB, 0,
- 1, 0xF9F6, 0x81E8, 0,
- 1, 0xF9F7, 0x7ACB, 0,
- 1, 0xF9F8, 0x7B20, 0,
- 1, 0xF9F9, 0x7C92, 0,
- 1, 0xF9FA, 0x72C0, 0,
- 1, 0xF9FB, 0x7099, 0,
- 1, 0xF9FC, 0x8B58, 0,
- 1, 0xF9FD, 0x4EC0, 0,
- 1, 0xF9FE, 0x8336, 0,
- 1, 0xF9FF, 0x523A, 0,
- 1, 0xFA00, 0x5207, 0,
- 1, 0xFA01, 0x5EA6, 0,
- 1, 0xFA02, 0x62D3, 0,
- 1, 0xFA03, 0x7CD6, 0,
- 1, 0xFA04, 0x5B85, 0,
- 1, 0xFA05, 0x6D1E, 0,
- 1, 0xFA06, 0x66B4, 0,
- 1, 0xFA07, 0x8F3B, 0,
- 1, 0xFA08, 0x884C, 0,
- 1, 0xFA09, 0x964D, 0,
- 1, 0xFA0A, 0x898B, 0,
- 1, 0xFA0B, 0x5ED3, 0,
- 1, 0xFA0C, 0x5140, 0,
- 1, 0xFA0D, 0x55C0, 0,
- 1, 0xFA10, 0x585A, 0,
- 1, 0xFA12, 0x6674, 0,
- 1, 0xFA15, 0x51DE, 0,
- 1, 0xFA16, 0x732A, 0,
- 1, 0xFA17, 0x76CA, 0,
- 1, 0xFA18, 0x793C, 0,
- 1, 0xFA19, 0x795E, 0,
- 1, 0xFA1A, 0x7965, 0,
- 1, 0xFA1B, 0x798F, 0,
- 1, 0xFA1C, 0x9756, 0,
- 1, 0xFA1D, 0x7CBE, 0,
- 1, 0xFA1E, 0x7FBD, 0,
- 1, 0xFA20, 0x8612, 0,
- 1, 0xFA22, 0x8AF8, 0,
- 1, 0xFA25, 0x9038, 0,
- 1, 0xFA26, 0x90FD, 0,
- 1, 0xFA2A, 0x98EF, 0,
- 1, 0xFA2B, 0x98FC, 0,
- 1, 0xFA2C, 0x9928, 0,
- 1, 0xFA2D, 0x9DB4, 0,
- 16, 0xFB00, 0x0066, 0x0066, 0,
- 16, 0xFB01, 0x0066, 0x0069, 0,
- 16, 0xFB02, 0x0066, 0x006C, 0,
- 16, 0xFB03, 0x0066, 0x0066, 0x0069, 0,
- 16, 0xFB04, 0x0066, 0x0066, 0x006C, 0,
- 16, 0xFB05, 0x017F, 0x0074, 0,
- 16, 0xFB06, 0x0073, 0x0074, 0,
- 16, 0xFB13, 0x0574, 0x0576, 0,
- 16, 0xFB14, 0x0574, 0x0565, 0,
- 16, 0xFB15, 0x0574, 0x056B, 0,
- 16, 0xFB16, 0x057E, 0x0576, 0,
- 16, 0xFB17, 0x0574, 0x056D, 0,
- 1, 0xFB1D, 0x05D9, 0x05B4, 0,
- 1, 0xFB1F, 0x05F2, 0x05B7, 0,
- 2, 0xFB20, 0x05E2, 0,
- 2, 0xFB21, 0x05D0, 0,
- 2, 0xFB22, 0x05D3, 0,
- 2, 0xFB23, 0x05D4, 0,
- 2, 0xFB24, 0x05DB, 0,
- 2, 0xFB25, 0x05DC, 0,
- 2, 0xFB26, 0x05DD, 0,
- 2, 0xFB27, 0x05E8, 0,
- 2, 0xFB28, 0x05EA, 0,
- 2, 0xFB29, 0x002B, 0,
- 1, 0xFB2A, 0x05E9, 0x05C1, 0,
- 1, 0xFB2B, 0x05E9, 0x05C2, 0,
- 1, 0xFB2C, 0xFB49, 0x05C1, 0,
- 1, 0xFB2D, 0xFB49, 0x05C2, 0,
- 1, 0xFB2E, 0x05D0, 0x05B7, 0,
- 1, 0xFB2F, 0x05D0, 0x05B8, 0,
- 1, 0xFB30, 0x05D0, 0x05BC, 0,
- 1, 0xFB31, 0x05D1, 0x05BC, 0,
- 1, 0xFB32, 0x05D2, 0x05BC, 0,
- 1, 0xFB33, 0x05D3, 0x05BC, 0,
- 1, 0xFB34, 0x05D4, 0x05BC, 0,
- 1, 0xFB35, 0x05D5, 0x05BC, 0,
- 1, 0xFB36, 0x05D6, 0x05BC, 0,
- 1, 0xFB38, 0x05D8, 0x05BC, 0,
- 1, 0xFB39, 0x05D9, 0x05BC, 0,
- 1, 0xFB3A, 0x05DA, 0x05BC, 0,
- 1, 0xFB3B, 0x05DB, 0x05BC, 0,
- 1, 0xFB3C, 0x05DC, 0x05BC, 0,
- 1, 0xFB3E, 0x05DE, 0x05BC, 0,
- 1, 0xFB40, 0x05E0, 0x05BC, 0,
- 1, 0xFB41, 0x05E1, 0x05BC, 0,
- 1, 0xFB43, 0x05E3, 0x05BC, 0,
- 1, 0xFB44, 0x05E4, 0x05BC, 0,
- 1, 0xFB46, 0x05E6, 0x05BC, 0,
- 1, 0xFB47, 0x05E7, 0x05BC, 0,
- 1, 0xFB48, 0x05E8, 0x05BC, 0,
- 1, 0xFB49, 0x05E9, 0x05BC, 0,
- 1, 0xFB4A, 0x05EA, 0x05BC, 0,
- 1, 0xFB4B, 0x05D5, 0x05B9, 0,
- 1, 0xFB4C, 0x05D1, 0x05BF, 0,
- 1, 0xFB4D, 0x05DB, 0x05BF, 0,
- 1, 0xFB4E, 0x05E4, 0x05BF, 0,
- 16, 0xFB4F, 0x05D0, 0x05DC, 0,
- 7, 0xFB50, 0x0671, 0,
- 6, 0xFB51, 0x0671, 0,
- 7, 0xFB52, 0x067B, 0,
- 6, 0xFB53, 0x067B, 0,
- 4, 0xFB54, 0x067B, 0,
- 5, 0xFB55, 0x067B, 0,
- 7, 0xFB56, 0x067E, 0,
- 6, 0xFB57, 0x067E, 0,
- 4, 0xFB58, 0x067E, 0,
- 5, 0xFB59, 0x067E, 0,
- 7, 0xFB5A, 0x0680, 0,
- 6, 0xFB5B, 0x0680, 0,
- 4, 0xFB5C, 0x0680, 0,
- 5, 0xFB5D, 0x0680, 0,
- 7, 0xFB5E, 0x067A, 0,
- 6, 0xFB5F, 0x067A, 0,
- 4, 0xFB60, 0x067A, 0,
- 5, 0xFB61, 0x067A, 0,
- 7, 0xFB62, 0x067F, 0,
- 6, 0xFB63, 0x067F, 0,
- 4, 0xFB64, 0x067F, 0,
- 5, 0xFB65, 0x067F, 0,
- 7, 0xFB66, 0x0679, 0,
- 6, 0xFB67, 0x0679, 0,
- 4, 0xFB68, 0x0679, 0,
- 5, 0xFB69, 0x0679, 0,
- 7, 0xFB6A, 0x06A4, 0,
- 6, 0xFB6B, 0x06A4, 0,
- 4, 0xFB6C, 0x06A4, 0,
- 5, 0xFB6D, 0x06A4, 0,
- 7, 0xFB6E, 0x06A6, 0,
- 6, 0xFB6F, 0x06A6, 0,
- 4, 0xFB70, 0x06A6, 0,
- 5, 0xFB71, 0x06A6, 0,
- 7, 0xFB72, 0x0684, 0,
- 6, 0xFB73, 0x0684, 0,
- 4, 0xFB74, 0x0684, 0,
- 5, 0xFB75, 0x0684, 0,
- 7, 0xFB76, 0x0683, 0,
- 6, 0xFB77, 0x0683, 0,
- 4, 0xFB78, 0x0683, 0,
- 5, 0xFB79, 0x0683, 0,
- 7, 0xFB7A, 0x0686, 0,
- 6, 0xFB7B, 0x0686, 0,
- 4, 0xFB7C, 0x0686, 0,
- 5, 0xFB7D, 0x0686, 0,
- 7, 0xFB7E, 0x0687, 0,
- 6, 0xFB7F, 0x0687, 0,
- 4, 0xFB80, 0x0687, 0,
- 5, 0xFB81, 0x0687, 0,
- 7, 0xFB82, 0x068D, 0,
- 6, 0xFB83, 0x068D, 0,
- 7, 0xFB84, 0x068C, 0,
- 6, 0xFB85, 0x068C, 0,
- 7, 0xFB86, 0x068E, 0,
- 6, 0xFB87, 0x068E, 0,
- 7, 0xFB88, 0x0688, 0,
- 6, 0xFB89, 0x0688, 0,
- 7, 0xFB8A, 0x0698, 0,
- 6, 0xFB8B, 0x0698, 0,
- 7, 0xFB8C, 0x0691, 0,
- 6, 0xFB8D, 0x0691, 0,
- 7, 0xFB8E, 0x06A9, 0,
- 6, 0xFB8F, 0x06A9, 0,
- 4, 0xFB90, 0x06A9, 0,
- 5, 0xFB91, 0x06A9, 0,
- 7, 0xFB92, 0x06AF, 0,
- 6, 0xFB93, 0x06AF, 0,
- 4, 0xFB94, 0x06AF, 0,
- 5, 0xFB95, 0x06AF, 0,
- 7, 0xFB96, 0x06B3, 0,
- 6, 0xFB97, 0x06B3, 0,
- 4, 0xFB98, 0x06B3, 0,
- 5, 0xFB99, 0x06B3, 0,
- 7, 0xFB9A, 0x06B1, 0,
- 6, 0xFB9B, 0x06B1, 0,
- 4, 0xFB9C, 0x06B1, 0,
- 5, 0xFB9D, 0x06B1, 0,
- 7, 0xFB9E, 0x06BA, 0,
- 6, 0xFB9F, 0x06BA, 0,
- 7, 0xFBA0, 0x06BB, 0,
- 6, 0xFBA1, 0x06BB, 0,
- 4, 0xFBA2, 0x06BB, 0,
- 5, 0xFBA3, 0x06BB, 0,
- 7, 0xFBA4, 0x06C0, 0,
- 6, 0xFBA5, 0x06C0, 0,
- 7, 0xFBA6, 0x06C1, 0,
- 6, 0xFBA7, 0x06C1, 0,
- 4, 0xFBA8, 0x06C1, 0,
- 5, 0xFBA9, 0x06C1, 0,
- 7, 0xFBAA, 0x06BE, 0,
- 6, 0xFBAB, 0x06BE, 0,
- 4, 0xFBAC, 0x06BE, 0,
- 5, 0xFBAD, 0x06BE, 0,
- 7, 0xFBAE, 0x06D2, 0,
- 6, 0xFBAF, 0x06D2, 0,
- 7, 0xFBB0, 0x06D3, 0,
- 6, 0xFBB1, 0x06D3, 0,
- 7, 0xFBD3, 0x06AD, 0,
- 6, 0xFBD4, 0x06AD, 0,
- 4, 0xFBD5, 0x06AD, 0,
- 5, 0xFBD6, 0x06AD, 0,
- 7, 0xFBD7, 0x06C7, 0,
- 6, 0xFBD8, 0x06C7, 0,
- 7, 0xFBD9, 0x06C6, 0,
- 6, 0xFBDA, 0x06C6, 0,
- 7, 0xFBDB, 0x06C8, 0,
- 6, 0xFBDC, 0x06C8, 0,
- 7, 0xFBDD, 0x0677, 0,
- 7, 0xFBDE, 0x06CB, 0,
- 6, 0xFBDF, 0x06CB, 0,
- 7, 0xFBE0, 0x06C5, 0,
- 6, 0xFBE1, 0x06C5, 0,
- 7, 0xFBE2, 0x06C9, 0,
- 6, 0xFBE3, 0x06C9, 0,
- 7, 0xFBE4, 0x06D0, 0,
- 6, 0xFBE5, 0x06D0, 0,
- 4, 0xFBE6, 0x06D0, 0,
- 5, 0xFBE7, 0x06D0, 0,
- 4, 0xFBE8, 0x0649, 0,
- 5, 0xFBE9, 0x0649, 0,
- 7, 0xFBEA, 0x0626, 0x0627, 0,
- 6, 0xFBEB, 0x0626, 0x0627, 0,
- 7, 0xFBEC, 0x0626, 0x06D5, 0,
- 6, 0xFBED, 0x0626, 0x06D5, 0,
- 7, 0xFBEE, 0x0626, 0x0648, 0,
- 6, 0xFBEF, 0x0626, 0x0648, 0,
- 7, 0xFBF0, 0x0626, 0x06C7, 0,
- 6, 0xFBF1, 0x0626, 0x06C7, 0,
- 7, 0xFBF2, 0x0626, 0x06C6, 0,
- 6, 0xFBF3, 0x0626, 0x06C6, 0,
- 7, 0xFBF4, 0x0626, 0x06C8, 0,
- 6, 0xFBF5, 0x0626, 0x06C8, 0,
- 7, 0xFBF6, 0x0626, 0x06D0, 0,
- 6, 0xFBF7, 0x0626, 0x06D0, 0,
- 4, 0xFBF8, 0x0626, 0x06D0, 0,
- 7, 0xFBF9, 0x0626, 0x0649, 0,
- 6, 0xFBFA, 0x0626, 0x0649, 0,
- 4, 0xFBFB, 0x0626, 0x0649, 0,
- 7, 0xFBFC, 0x06CC, 0,
- 6, 0xFBFD, 0x06CC, 0,
- 4, 0xFBFE, 0x06CC, 0,
- 5, 0xFBFF, 0x06CC, 0,
- 7, 0xFC00, 0x0626, 0x062C, 0,
- 7, 0xFC01, 0x0626, 0x062D, 0,
- 7, 0xFC02, 0x0626, 0x0645, 0,
- 7, 0xFC03, 0x0626, 0x0649, 0,
- 7, 0xFC04, 0x0626, 0x064A, 0,
- 7, 0xFC05, 0x0628, 0x062C, 0,
- 7, 0xFC06, 0x0628, 0x062D, 0,
- 7, 0xFC07, 0x0628, 0x062E, 0,
- 7, 0xFC08, 0x0628, 0x0645, 0,
- 7, 0xFC09, 0x0628, 0x0649, 0,
- 7, 0xFC0A, 0x0628, 0x064A, 0,
- 7, 0xFC0B, 0x062A, 0x062C, 0,
- 7, 0xFC0C, 0x062A, 0x062D, 0,
- 7, 0xFC0D, 0x062A, 0x062E, 0,
- 7, 0xFC0E, 0x062A, 0x0645, 0,
- 7, 0xFC0F, 0x062A, 0x0649, 0,
- 7, 0xFC10, 0x062A, 0x064A, 0,
- 7, 0xFC11, 0x062B, 0x062C, 0,
- 7, 0xFC12, 0x062B, 0x0645, 0,
- 7, 0xFC13, 0x062B, 0x0649, 0,
- 7, 0xFC14, 0x062B, 0x064A, 0,
- 7, 0xFC15, 0x062C, 0x062D, 0,
- 7, 0xFC16, 0x062C, 0x0645, 0,
- 7, 0xFC17, 0x062D, 0x062C, 0,
- 7, 0xFC18, 0x062D, 0x0645, 0,
- 7, 0xFC19, 0x062E, 0x062C, 0,
- 7, 0xFC1A, 0x062E, 0x062D, 0,
- 7, 0xFC1B, 0x062E, 0x0645, 0,
- 7, 0xFC1C, 0x0633, 0x062C, 0,
- 7, 0xFC1D, 0x0633, 0x062D, 0,
- 7, 0xFC1E, 0x0633, 0x062E, 0,
- 7, 0xFC1F, 0x0633, 0x0645, 0,
- 7, 0xFC20, 0x0635, 0x062D, 0,
- 7, 0xFC21, 0x0635, 0x0645, 0,
- 7, 0xFC22, 0x0636, 0x062C, 0,
- 7, 0xFC23, 0x0636, 0x062D, 0,
- 7, 0xFC24, 0x0636, 0x062E, 0,
- 7, 0xFC25, 0x0636, 0x0645, 0,
- 7, 0xFC26, 0x0637, 0x062D, 0,
- 7, 0xFC27, 0x0637, 0x0645, 0,
- 7, 0xFC28, 0x0638, 0x0645, 0,
- 7, 0xFC29, 0x0639, 0x062C, 0,
- 7, 0xFC2A, 0x0639, 0x0645, 0,
- 7, 0xFC2B, 0x063A, 0x062C, 0,
- 7, 0xFC2C, 0x063A, 0x0645, 0,
- 7, 0xFC2D, 0x0641, 0x062C, 0,
- 7, 0xFC2E, 0x0641, 0x062D, 0,
- 7, 0xFC2F, 0x0641, 0x062E, 0,
- 7, 0xFC30, 0x0641, 0x0645, 0,
- 7, 0xFC31, 0x0641, 0x0649, 0,
- 7, 0xFC32, 0x0641, 0x064A, 0,
- 7, 0xFC33, 0x0642, 0x062D, 0,
- 7, 0xFC34, 0x0642, 0x0645, 0,
- 7, 0xFC35, 0x0642, 0x0649, 0,
- 7, 0xFC36, 0x0642, 0x064A, 0,
- 7, 0xFC37, 0x0643, 0x0627, 0,
- 7, 0xFC38, 0x0643, 0x062C, 0,
- 7, 0xFC39, 0x0643, 0x062D, 0,
- 7, 0xFC3A, 0x0643, 0x062E, 0,
- 7, 0xFC3B, 0x0643, 0x0644, 0,
- 7, 0xFC3C, 0x0643, 0x0645, 0,
- 7, 0xFC3D, 0x0643, 0x0649, 0,
- 7, 0xFC3E, 0x0643, 0x064A, 0,
- 7, 0xFC3F, 0x0644, 0x062C, 0,
- 7, 0xFC40, 0x0644, 0x062D, 0,
- 7, 0xFC41, 0x0644, 0x062E, 0,
- 7, 0xFC42, 0x0644, 0x0645, 0,
- 7, 0xFC43, 0x0644, 0x0649, 0,
- 7, 0xFC44, 0x0644, 0x064A, 0,
- 7, 0xFC45, 0x0645, 0x062C, 0,
- 7, 0xFC46, 0x0645, 0x062D, 0,
- 7, 0xFC47, 0x0645, 0x062E, 0,
- 7, 0xFC48, 0x0645, 0x0645, 0,
- 7, 0xFC49, 0x0645, 0x0649, 0,
- 7, 0xFC4A, 0x0645, 0x064A, 0,
- 7, 0xFC4B, 0x0646, 0x062C, 0,
- 7, 0xFC4C, 0x0646, 0x062D, 0,
- 7, 0xFC4D, 0x0646, 0x062E, 0,
- 7, 0xFC4E, 0x0646, 0x0645, 0,
- 7, 0xFC4F, 0x0646, 0x0649, 0,
- 7, 0xFC50, 0x0646, 0x064A, 0,
- 7, 0xFC51, 0x0647, 0x062C, 0,
- 7, 0xFC52, 0x0647, 0x0645, 0,
- 7, 0xFC53, 0x0647, 0x0649, 0,
- 7, 0xFC54, 0x0647, 0x064A, 0,
- 7, 0xFC55, 0x064A, 0x062C, 0,
- 7, 0xFC56, 0x064A, 0x062D, 0,
- 7, 0xFC57, 0x064A, 0x062E, 0,
- 7, 0xFC58, 0x064A, 0x0645, 0,
- 7, 0xFC59, 0x064A, 0x0649, 0,
- 7, 0xFC5A, 0x064A, 0x064A, 0,
- 7, 0xFC5B, 0x0630, 0x0670, 0,
- 7, 0xFC5C, 0x0631, 0x0670, 0,
- 7, 0xFC5D, 0x0649, 0x0670, 0,
- 7, 0xFC5E, 0x0020, 0x064C, 0x0651, 0,
- 7, 0xFC5F, 0x0020, 0x064D, 0x0651, 0,
- 7, 0xFC60, 0x0020, 0x064E, 0x0651, 0,
- 7, 0xFC61, 0x0020, 0x064F, 0x0651, 0,
- 7, 0xFC62, 0x0020, 0x0650, 0x0651, 0,
- 7, 0xFC63, 0x0020, 0x0651, 0x0670, 0,
- 6, 0xFC64, 0x0626, 0x0631, 0,
- 6, 0xFC65, 0x0626, 0x0632, 0,
- 6, 0xFC66, 0x0626, 0x0645, 0,
- 6, 0xFC67, 0x0626, 0x0646, 0,
- 6, 0xFC68, 0x0626, 0x0649, 0,
- 6, 0xFC69, 0x0626, 0x064A, 0,
- 6, 0xFC6A, 0x0628, 0x0631, 0,
- 6, 0xFC6B, 0x0628, 0x0632, 0,
- 6, 0xFC6C, 0x0628, 0x0645, 0,
- 6, 0xFC6D, 0x0628, 0x0646, 0,
- 6, 0xFC6E, 0x0628, 0x0649, 0,
- 6, 0xFC6F, 0x0628, 0x064A, 0,
- 6, 0xFC70, 0x062A, 0x0631, 0,
- 6, 0xFC71, 0x062A, 0x0632, 0,
- 6, 0xFC72, 0x062A, 0x0645, 0,
- 6, 0xFC73, 0x062A, 0x0646, 0,
- 6, 0xFC74, 0x062A, 0x0649, 0,
- 6, 0xFC75, 0x062A, 0x064A, 0,
- 6, 0xFC76, 0x062B, 0x0631, 0,
- 6, 0xFC77, 0x062B, 0x0632, 0,
- 6, 0xFC78, 0x062B, 0x0645, 0,
- 6, 0xFC79, 0x062B, 0x0646, 0,
- 6, 0xFC7A, 0x062B, 0x0649, 0,
- 6, 0xFC7B, 0x062B, 0x064A, 0,
- 6, 0xFC7C, 0x0641, 0x0649, 0,
- 6, 0xFC7D, 0x0641, 0x064A, 0,
- 6, 0xFC7E, 0x0642, 0x0649, 0,
- 6, 0xFC7F, 0x0642, 0x064A, 0,
- 6, 0xFC80, 0x0643, 0x0627, 0,
- 6, 0xFC81, 0x0643, 0x0644, 0,
- 6, 0xFC82, 0x0643, 0x0645, 0,
- 6, 0xFC83, 0x0643, 0x0649, 0,
- 6, 0xFC84, 0x0643, 0x064A, 0,
- 6, 0xFC85, 0x0644, 0x0645, 0,
- 6, 0xFC86, 0x0644, 0x0649, 0,
- 6, 0xFC87, 0x0644, 0x064A, 0,
- 6, 0xFC88, 0x0645, 0x0627, 0,
- 6, 0xFC89, 0x0645, 0x0645, 0,
- 6, 0xFC8A, 0x0646, 0x0631, 0,
- 6, 0xFC8B, 0x0646, 0x0632, 0,
- 6, 0xFC8C, 0x0646, 0x0645, 0,
- 6, 0xFC8D, 0x0646, 0x0646, 0,
- 6, 0xFC8E, 0x0646, 0x0649, 0,
- 6, 0xFC8F, 0x0646, 0x064A, 0,
- 6, 0xFC90, 0x0649, 0x0670, 0,
- 6, 0xFC91, 0x064A, 0x0631, 0,
- 6, 0xFC92, 0x064A, 0x0632, 0,
- 6, 0xFC93, 0x064A, 0x0645, 0,
- 6, 0xFC94, 0x064A, 0x0646, 0,
- 6, 0xFC95, 0x064A, 0x0649, 0,
- 6, 0xFC96, 0x064A, 0x064A, 0,
- 4, 0xFC97, 0x0626, 0x062C, 0,
- 4, 0xFC98, 0x0626, 0x062D, 0,
- 4, 0xFC99, 0x0626, 0x062E, 0,
- 4, 0xFC9A, 0x0626, 0x0645, 0,
- 4, 0xFC9B, 0x0626, 0x0647, 0,
- 4, 0xFC9C, 0x0628, 0x062C, 0,
- 4, 0xFC9D, 0x0628, 0x062D, 0,
- 4, 0xFC9E, 0x0628, 0x062E, 0,
- 4, 0xFC9F, 0x0628, 0x0645, 0,
- 4, 0xFCA0, 0x0628, 0x0647, 0,
- 4, 0xFCA1, 0x062A, 0x062C, 0,
- 4, 0xFCA2, 0x062A, 0x062D, 0,
- 4, 0xFCA3, 0x062A, 0x062E, 0,
- 4, 0xFCA4, 0x062A, 0x0645, 0,
- 4, 0xFCA5, 0x062A, 0x0647, 0,
- 4, 0xFCA6, 0x062B, 0x0645, 0,
- 4, 0xFCA7, 0x062C, 0x062D, 0,
- 4, 0xFCA8, 0x062C, 0x0645, 0,
- 4, 0xFCA9, 0x062D, 0x062C, 0,
- 4, 0xFCAA, 0x062D, 0x0645, 0,
- 4, 0xFCAB, 0x062E, 0x062C, 0,
- 4, 0xFCAC, 0x062E, 0x0645, 0,
- 4, 0xFCAD, 0x0633, 0x062C, 0,
- 4, 0xFCAE, 0x0633, 0x062D, 0,
- 4, 0xFCAF, 0x0633, 0x062E, 0,
- 4, 0xFCB0, 0x0633, 0x0645, 0,
- 4, 0xFCB1, 0x0635, 0x062D, 0,
- 4, 0xFCB2, 0x0635, 0x062E, 0,
- 4, 0xFCB3, 0x0635, 0x0645, 0,
- 4, 0xFCB4, 0x0636, 0x062C, 0,
- 4, 0xFCB5, 0x0636, 0x062D, 0,
- 4, 0xFCB6, 0x0636, 0x062E, 0,
- 4, 0xFCB7, 0x0636, 0x0645, 0,
- 4, 0xFCB8, 0x0637, 0x062D, 0,
- 4, 0xFCB9, 0x0638, 0x0645, 0,
- 4, 0xFCBA, 0x0639, 0x062C, 0,
- 4, 0xFCBB, 0x0639, 0x0645, 0,
- 4, 0xFCBC, 0x063A, 0x062C, 0,
- 4, 0xFCBD, 0x063A, 0x0645, 0,
- 4, 0xFCBE, 0x0641, 0x062C, 0,
- 4, 0xFCBF, 0x0641, 0x062D, 0,
- 4, 0xFCC0, 0x0641, 0x062E, 0,
- 4, 0xFCC1, 0x0641, 0x0645, 0,
- 4, 0xFCC2, 0x0642, 0x062D, 0,
- 4, 0xFCC3, 0x0642, 0x0645, 0,
- 4, 0xFCC4, 0x0643, 0x062C, 0,
- 4, 0xFCC5, 0x0643, 0x062D, 0,
- 4, 0xFCC6, 0x0643, 0x062E, 0,
- 4, 0xFCC7, 0x0643, 0x0644, 0,
- 4, 0xFCC8, 0x0643, 0x0645, 0,
- 4, 0xFCC9, 0x0644, 0x062C, 0,
- 4, 0xFCCA, 0x0644, 0x062D, 0,
- 4, 0xFCCB, 0x0644, 0x062E, 0,
- 4, 0xFCCC, 0x0644, 0x0645, 0,
- 4, 0xFCCD, 0x0644, 0x0647, 0,
- 4, 0xFCCE, 0x0645, 0x062C, 0,
- 4, 0xFCCF, 0x0645, 0x062D, 0,
- 4, 0xFCD0, 0x0645, 0x062E, 0,
- 4, 0xFCD1, 0x0645, 0x0645, 0,
- 4, 0xFCD2, 0x0646, 0x062C, 0,
- 4, 0xFCD3, 0x0646, 0x062D, 0,
- 4, 0xFCD4, 0x0646, 0x062E, 0,
- 4, 0xFCD5, 0x0646, 0x0645, 0,
- 4, 0xFCD6, 0x0646, 0x0647, 0,
- 4, 0xFCD7, 0x0647, 0x062C, 0,
- 4, 0xFCD8, 0x0647, 0x0645, 0,
- 4, 0xFCD9, 0x0647, 0x0670, 0,
- 4, 0xFCDA, 0x064A, 0x062C, 0,
- 4, 0xFCDB, 0x064A, 0x062D, 0,
- 4, 0xFCDC, 0x064A, 0x062E, 0,
- 4, 0xFCDD, 0x064A, 0x0645, 0,
- 4, 0xFCDE, 0x064A, 0x0647, 0,
- 5, 0xFCDF, 0x0626, 0x0645, 0,
- 5, 0xFCE0, 0x0626, 0x0647, 0,
- 5, 0xFCE1, 0x0628, 0x0645, 0,
- 5, 0xFCE2, 0x0628, 0x0647, 0,
- 5, 0xFCE3, 0x062A, 0x0645, 0,
- 5, 0xFCE4, 0x062A, 0x0647, 0,
- 5, 0xFCE5, 0x062B, 0x0645, 0,
- 5, 0xFCE6, 0x062B, 0x0647, 0,
- 5, 0xFCE7, 0x0633, 0x0645, 0,
- 5, 0xFCE8, 0x0633, 0x0647, 0,
- 5, 0xFCE9, 0x0634, 0x0645, 0,
- 5, 0xFCEA, 0x0634, 0x0647, 0,
- 5, 0xFCEB, 0x0643, 0x0644, 0,
- 5, 0xFCEC, 0x0643, 0x0645, 0,
- 5, 0xFCED, 0x0644, 0x0645, 0,
- 5, 0xFCEE, 0x0646, 0x0645, 0,
- 5, 0xFCEF, 0x0646, 0x0647, 0,
- 5, 0xFCF0, 0x064A, 0x0645, 0,
- 5, 0xFCF1, 0x064A, 0x0647, 0,
- 5, 0xFCF2, 0x0640, 0x064E, 0x0651, 0,
- 5, 0xFCF3, 0x0640, 0x064F, 0x0651, 0,
- 5, 0xFCF4, 0x0640, 0x0650, 0x0651, 0,
- 7, 0xFCF5, 0x0637, 0x0649, 0,
- 7, 0xFCF6, 0x0637, 0x064A, 0,
- 7, 0xFCF7, 0x0639, 0x0649, 0,
- 7, 0xFCF8, 0x0639, 0x064A, 0,
- 7, 0xFCF9, 0x063A, 0x0649, 0,
- 7, 0xFCFA, 0x063A, 0x064A, 0,
- 7, 0xFCFB, 0x0633, 0x0649, 0,
- 7, 0xFCFC, 0x0633, 0x064A, 0,
- 7, 0xFCFD, 0x0634, 0x0649, 0,
- 7, 0xFCFE, 0x0634, 0x064A, 0,
- 7, 0xFCFF, 0x062D, 0x0649, 0,
- 7, 0xFD00, 0x062D, 0x064A, 0,
- 7, 0xFD01, 0x062C, 0x0649, 0,
- 7, 0xFD02, 0x062C, 0x064A, 0,
- 7, 0xFD03, 0x062E, 0x0649, 0,
- 7, 0xFD04, 0x062E, 0x064A, 0,
- 7, 0xFD05, 0x0635, 0x0649, 0,
- 7, 0xFD06, 0x0635, 0x064A, 0,
- 7, 0xFD07, 0x0636, 0x0649, 0,
- 7, 0xFD08, 0x0636, 0x064A, 0,
- 7, 0xFD09, 0x0634, 0x062C, 0,
- 7, 0xFD0A, 0x0634, 0x062D, 0,
- 7, 0xFD0B, 0x0634, 0x062E, 0,
- 7, 0xFD0C, 0x0634, 0x0645, 0,
- 7, 0xFD0D, 0x0634, 0x0631, 0,
- 7, 0xFD0E, 0x0633, 0x0631, 0,
- 7, 0xFD0F, 0x0635, 0x0631, 0,
- 7, 0xFD10, 0x0636, 0x0631, 0,
- 6, 0xFD11, 0x0637, 0x0649, 0,
- 6, 0xFD12, 0x0637, 0x064A, 0,
- 6, 0xFD13, 0x0639, 0x0649, 0,
- 6, 0xFD14, 0x0639, 0x064A, 0,
- 6, 0xFD15, 0x063A, 0x0649, 0,
- 6, 0xFD16, 0x063A, 0x064A, 0,
- 6, 0xFD17, 0x0633, 0x0649, 0,
- 6, 0xFD18, 0x0633, 0x064A, 0,
- 6, 0xFD19, 0x0634, 0x0649, 0,
- 6, 0xFD1A, 0x0634, 0x064A, 0,
- 6, 0xFD1B, 0x062D, 0x0649, 0,
- 6, 0xFD1C, 0x062D, 0x064A, 0,
- 6, 0xFD1D, 0x062C, 0x0649, 0,
- 6, 0xFD1E, 0x062C, 0x064A, 0,
- 6, 0xFD1F, 0x062E, 0x0649, 0,
- 6, 0xFD20, 0x062E, 0x064A, 0,
- 6, 0xFD21, 0x0635, 0x0649, 0,
- 6, 0xFD22, 0x0635, 0x064A, 0,
- 6, 0xFD23, 0x0636, 0x0649, 0,
- 6, 0xFD24, 0x0636, 0x064A, 0,
- 6, 0xFD25, 0x0634, 0x062C, 0,
- 6, 0xFD26, 0x0634, 0x062D, 0,
- 6, 0xFD27, 0x0634, 0x062E, 0,
- 6, 0xFD28, 0x0634, 0x0645, 0,
- 6, 0xFD29, 0x0634, 0x0631, 0,
- 6, 0xFD2A, 0x0633, 0x0631, 0,
- 6, 0xFD2B, 0x0635, 0x0631, 0,
- 6, 0xFD2C, 0x0636, 0x0631, 0,
- 4, 0xFD2D, 0x0634, 0x062C, 0,
- 4, 0xFD2E, 0x0634, 0x062D, 0,
- 4, 0xFD2F, 0x0634, 0x062E, 0,
- 4, 0xFD30, 0x0634, 0x0645, 0,
- 4, 0xFD31, 0x0633, 0x0647, 0,
- 4, 0xFD32, 0x0634, 0x0647, 0,
- 4, 0xFD33, 0x0637, 0x0645, 0,
- 5, 0xFD34, 0x0633, 0x062C, 0,
- 5, 0xFD35, 0x0633, 0x062D, 0,
- 5, 0xFD36, 0x0633, 0x062E, 0,
- 5, 0xFD37, 0x0634, 0x062C, 0,
- 5, 0xFD38, 0x0634, 0x062D, 0,
- 5, 0xFD39, 0x0634, 0x062E, 0,
- 5, 0xFD3A, 0x0637, 0x0645, 0,
- 5, 0xFD3B, 0x0638, 0x0645, 0,
- 6, 0xFD3C, 0x0627, 0x064B, 0,
- 7, 0xFD3D, 0x0627, 0x064B, 0,
- 4, 0xFD50, 0x062A, 0x062C, 0x0645, 0,
- 6, 0xFD51, 0x062A, 0x062D, 0x062C, 0,
- 4, 0xFD52, 0x062A, 0x062D, 0x062C, 0,
- 4, 0xFD53, 0x062A, 0x062D, 0x0645, 0,
- 4, 0xFD54, 0x062A, 0x062E, 0x0645, 0,
- 4, 0xFD55, 0x062A, 0x0645, 0x062C, 0,
- 4, 0xFD56, 0x062A, 0x0645, 0x062D, 0,
- 4, 0xFD57, 0x062A, 0x0645, 0x062E, 0,
- 6, 0xFD58, 0x062C, 0x0645, 0x062D, 0,
- 4, 0xFD59, 0x062C, 0x0645, 0x062D, 0,
- 6, 0xFD5A, 0x062D, 0x0645, 0x064A, 0,
- 6, 0xFD5B, 0x062D, 0x0645, 0x0649, 0,
- 4, 0xFD5C, 0x0633, 0x062D, 0x062C, 0,
- 4, 0xFD5D, 0x0633, 0x062C, 0x062D, 0,
- 6, 0xFD5E, 0x0633, 0x062C, 0x0649, 0,
- 6, 0xFD5F, 0x0633, 0x0645, 0x062D, 0,
- 4, 0xFD60, 0x0633, 0x0645, 0x062D, 0,
- 4, 0xFD61, 0x0633, 0x0645, 0x062C, 0,
- 6, 0xFD62, 0x0633, 0x0645, 0x0645, 0,
- 4, 0xFD63, 0x0633, 0x0645, 0x0645, 0,
- 6, 0xFD64, 0x0635, 0x062D, 0x062D, 0,
- 4, 0xFD65, 0x0635, 0x062D, 0x062D, 0,
- 6, 0xFD66, 0x0635, 0x0645, 0x0645, 0,
- 6, 0xFD67, 0x0634, 0x062D, 0x0645, 0,
- 4, 0xFD68, 0x0634, 0x062D, 0x0645, 0,
- 6, 0xFD69, 0x0634, 0x062C, 0x064A, 0,
- 6, 0xFD6A, 0x0634, 0x0645, 0x062E, 0,
- 4, 0xFD6B, 0x0634, 0x0645, 0x062E, 0,
- 6, 0xFD6C, 0x0634, 0x0645, 0x0645, 0,
- 4, 0xFD6D, 0x0634, 0x0645, 0x0645, 0,
- 6, 0xFD6E, 0x0636, 0x062D, 0x0649, 0,
- 6, 0xFD6F, 0x0636, 0x062E, 0x0645, 0,
- 4, 0xFD70, 0x0636, 0x062E, 0x0645, 0,
- 6, 0xFD71, 0x0637, 0x0645, 0x062D, 0,
- 4, 0xFD72, 0x0637, 0x0645, 0x062D, 0,
- 4, 0xFD73, 0x0637, 0x0645, 0x0645, 0,
- 6, 0xFD74, 0x0637, 0x0645, 0x064A, 0,
- 6, 0xFD75, 0x0639, 0x062C, 0x0645, 0,
- 6, 0xFD76, 0x0639, 0x0645, 0x0645, 0,
- 4, 0xFD77, 0x0639, 0x0645, 0x0645, 0,
- 6, 0xFD78, 0x0639, 0x0645, 0x0649, 0,
- 6, 0xFD79, 0x063A, 0x0645, 0x0645, 0,
- 6, 0xFD7A, 0x063A, 0x0645, 0x064A, 0,
- 6, 0xFD7B, 0x063A, 0x0645, 0x0649, 0,
- 6, 0xFD7C, 0x0641, 0x062E, 0x0645, 0,
- 4, 0xFD7D, 0x0641, 0x062E, 0x0645, 0,
- 6, 0xFD7E, 0x0642, 0x0645, 0x062D, 0,
- 6, 0xFD7F, 0x0642, 0x0645, 0x0645, 0,
- 6, 0xFD80, 0x0644, 0x062D, 0x0645, 0,
- 6, 0xFD81, 0x0644, 0x062D, 0x064A, 0,
- 6, 0xFD82, 0x0644, 0x062D, 0x0649, 0,
- 4, 0xFD83, 0x0644, 0x062C, 0x062C, 0,
- 6, 0xFD84, 0x0644, 0x062C, 0x062C, 0,
- 6, 0xFD85, 0x0644, 0x062E, 0x0645, 0,
- 4, 0xFD86, 0x0644, 0x062E, 0x0645, 0,
- 6, 0xFD87, 0x0644, 0x0645, 0x062D, 0,
- 4, 0xFD88, 0x0644, 0x0645, 0x062D, 0,
- 4, 0xFD89, 0x0645, 0x062D, 0x062C, 0,
- 4, 0xFD8A, 0x0645, 0x062D, 0x0645, 0,
- 6, 0xFD8B, 0x0645, 0x062D, 0x064A, 0,
- 4, 0xFD8C, 0x0645, 0x062C, 0x062D, 0,
- 4, 0xFD8D, 0x0645, 0x062C, 0x0645, 0,
- 4, 0xFD8E, 0x0645, 0x062E, 0x062C, 0,
- 4, 0xFD8F, 0x0645, 0x062E, 0x0645, 0,
- 4, 0xFD92, 0x0645, 0x062C, 0x062E, 0,
- 4, 0xFD93, 0x0647, 0x0645, 0x062C, 0,
- 4, 0xFD94, 0x0647, 0x0645, 0x0645, 0,
- 4, 0xFD95, 0x0646, 0x062D, 0x0645, 0,
- 6, 0xFD96, 0x0646, 0x062D, 0x0649, 0,
- 6, 0xFD97, 0x0646, 0x062C, 0x0645, 0,
- 4, 0xFD98, 0x0646, 0x062C, 0x0645, 0,
- 6, 0xFD99, 0x0646, 0x062C, 0x0649, 0,
- 6, 0xFD9A, 0x0646, 0x0645, 0x064A, 0,
- 6, 0xFD9B, 0x0646, 0x0645, 0x0649, 0,
- 6, 0xFD9C, 0x064A, 0x0645, 0x0645, 0,
- 4, 0xFD9D, 0x064A, 0x0645, 0x0645, 0,
- 6, 0xFD9E, 0x0628, 0x062E, 0x064A, 0,
- 6, 0xFD9F, 0x062A, 0x062C, 0x064A, 0,
- 6, 0xFDA0, 0x062A, 0x062C, 0x0649, 0,
- 6, 0xFDA1, 0x062A, 0x062E, 0x064A, 0,
- 6, 0xFDA2, 0x062A, 0x062E, 0x0649, 0,
- 6, 0xFDA3, 0x062A, 0x0645, 0x064A, 0,
- 6, 0xFDA4, 0x062A, 0x0645, 0x0649, 0,
- 6, 0xFDA5, 0x062C, 0x0645, 0x064A, 0,
- 6, 0xFDA6, 0x062C, 0x062D, 0x0649, 0,
- 6, 0xFDA7, 0x062C, 0x0645, 0x0649, 0,
- 6, 0xFDA8, 0x0633, 0x062E, 0x0649, 0,
- 6, 0xFDA9, 0x0635, 0x062D, 0x064A, 0,
- 6, 0xFDAA, 0x0634, 0x062D, 0x064A, 0,
- 6, 0xFDAB, 0x0636, 0x062D, 0x064A, 0,
- 6, 0xFDAC, 0x0644, 0x062C, 0x064A, 0,
- 6, 0xFDAD, 0x0644, 0x0645, 0x064A, 0,
- 6, 0xFDAE, 0x064A, 0x062D, 0x064A, 0,
- 6, 0xFDAF, 0x064A, 0x062C, 0x064A, 0,
- 6, 0xFDB0, 0x064A, 0x0645, 0x064A, 0,
- 6, 0xFDB1, 0x0645, 0x0645, 0x064A, 0,
- 6, 0xFDB2, 0x0642, 0x0645, 0x064A, 0,
- 6, 0xFDB3, 0x0646, 0x062D, 0x064A, 0,
- 4, 0xFDB4, 0x0642, 0x0645, 0x062D, 0,
- 4, 0xFDB5, 0x0644, 0x062D, 0x0645, 0,
- 6, 0xFDB6, 0x0639, 0x0645, 0x064A, 0,
- 6, 0xFDB7, 0x0643, 0x0645, 0x064A, 0,
- 4, 0xFDB8, 0x0646, 0x062C, 0x062D, 0,
- 6, 0xFDB9, 0x0645, 0x062E, 0x064A, 0,
- 4, 0xFDBA, 0x0644, 0x062C, 0x0645, 0,
- 6, 0xFDBB, 0x0643, 0x0645, 0x0645, 0,
- 6, 0xFDBC, 0x0644, 0x062C, 0x0645, 0,
- 6, 0xFDBD, 0x0646, 0x062C, 0x062D, 0,
- 6, 0xFDBE, 0x062C, 0x062D, 0x064A, 0,
- 6, 0xFDBF, 0x062D, 0x062C, 0x064A, 0,
- 6, 0xFDC0, 0x0645, 0x062C, 0x064A, 0,
- 6, 0xFDC1, 0x0641, 0x0645, 0x064A, 0,
- 6, 0xFDC2, 0x0628, 0x062D, 0x064A, 0,
- 4, 0xFDC3, 0x0643, 0x0645, 0x0645, 0,
- 4, 0xFDC4, 0x0639, 0x062C, 0x0645, 0,
- 4, 0xFDC5, 0x0635, 0x0645, 0x0645, 0,
- 6, 0xFDC6, 0x0633, 0x062E, 0x064A, 0,
- 6, 0xFDC7, 0x0646, 0x062C, 0x064A, 0,
- 7, 0xFDF0, 0x0635, 0x0644, 0x06D2, 0,
- 7, 0xFDF1, 0x0642, 0x0644, 0x06D2, 0,
- 7, 0xFDF2, 0x0627, 0x0644, 0x0644, 0x0647, 0,
- 7, 0xFDF3, 0x0627, 0x0643, 0x0628, 0x0631, 0,
- 7, 0xFDF4, 0x0645, 0x062D, 0x0645, 0x062F, 0,
- 7, 0xFDF5, 0x0635, 0x0644, 0x0639, 0x0645, 0,
- 7, 0xFDF6, 0x0631, 0x0633, 0x0648, 0x0644, 0,
- 7, 0xFDF7, 0x0639, 0x0644, 0x064A, 0x0647, 0,
- 7, 0xFDF8, 0x0648, 0x0633, 0x0644, 0x0645, 0,
- 7, 0xFDF9, 0x0635, 0x0644, 0x0649, 0,
- 7, 0xFDFA, 0x0635, 0x0644, 0x0649, 0x0020, 0x0627, 0x0644, 0x0644, 0x0647, 0x0020, 0x0639, 0x0644, 0x064A, 0x0647, 0x0020, 0x0648, 0x0633, 0x0644, 0x0645, 0,
- 7, 0xFDFB, 0x062C, 0x0644, 0x0020, 0x062C, 0x0644, 0x0627, 0x0644, 0x0647, 0,
- 11, 0xFE30, 0x2025, 0,
- 11, 0xFE31, 0x2014, 0,
- 11, 0xFE32, 0x2013, 0,
- 11, 0xFE33, 0x005F, 0,
- 11, 0xFE34, 0x005F, 0,
- 11, 0xFE35, 0x0028, 0,
- 11, 0xFE36, 0x0029, 0,
- 11, 0xFE37, 0x007B, 0,
- 11, 0xFE38, 0x007D, 0,
- 11, 0xFE39, 0x3014, 0,
- 11, 0xFE3A, 0x3015, 0,
- 11, 0xFE3B, 0x3010, 0,
- 11, 0xFE3C, 0x3011, 0,
- 11, 0xFE3D, 0x300A, 0,
- 11, 0xFE3E, 0x300B, 0,
- 11, 0xFE3F, 0x3008, 0,
- 11, 0xFE40, 0x3009, 0,
- 11, 0xFE41, 0x300C, 0,
- 11, 0xFE42, 0x300D, 0,
- 11, 0xFE43, 0x300E, 0,
- 11, 0xFE44, 0x300F, 0,
- 16, 0xFE49, 0x203E, 0,
- 16, 0xFE4A, 0x203E, 0,
- 16, 0xFE4B, 0x203E, 0,
- 16, 0xFE4C, 0x203E, 0,
- 16, 0xFE4D, 0x005F, 0,
- 16, 0xFE4E, 0x005F, 0,
- 16, 0xFE4F, 0x005F, 0,
- 14, 0xFE50, 0x002C, 0,
- 14, 0xFE51, 0x3001, 0,
- 14, 0xFE52, 0x002E, 0,
- 14, 0xFE54, 0x003B, 0,
- 14, 0xFE55, 0x003A, 0,
- 14, 0xFE56, 0x003F, 0,
- 14, 0xFE57, 0x0021, 0,
- 14, 0xFE58, 0x2014, 0,
- 14, 0xFE59, 0x0028, 0,
- 14, 0xFE5A, 0x0029, 0,
- 14, 0xFE5B, 0x007B, 0,
- 14, 0xFE5C, 0x007D, 0,
- 14, 0xFE5D, 0x3014, 0,
- 14, 0xFE5E, 0x3015, 0,
- 14, 0xFE5F, 0x0023, 0,
- 14, 0xFE60, 0x0026, 0,
- 14, 0xFE61, 0x002A, 0,
- 14, 0xFE62, 0x002B, 0,
- 14, 0xFE63, 0x002D, 0,
- 14, 0xFE64, 0x003C, 0,
- 14, 0xFE65, 0x003E, 0,
- 14, 0xFE66, 0x003D, 0,
- 14, 0xFE68, 0x005C, 0,
- 14, 0xFE69, 0x0024, 0,
- 14, 0xFE6A, 0x0025, 0,
- 14, 0xFE6B, 0x0040, 0,
- 7, 0xFE70, 0x0020, 0x064B, 0,
- 5, 0xFE71, 0x0640, 0x064B, 0,
- 7, 0xFE72, 0x0020, 0x064C, 0,
- 7, 0xFE74, 0x0020, 0x064D, 0,
- 7, 0xFE76, 0x0020, 0x064E, 0,
- 5, 0xFE77, 0x0640, 0x064E, 0,
- 7, 0xFE78, 0x0020, 0x064F, 0,
- 5, 0xFE79, 0x0640, 0x064F, 0,
- 7, 0xFE7A, 0x0020, 0x0650, 0,
- 5, 0xFE7B, 0x0640, 0x0650, 0,
- 7, 0xFE7C, 0x0020, 0x0651, 0,
- 5, 0xFE7D, 0x0640, 0x0651, 0,
- 7, 0xFE7E, 0x0020, 0x0652, 0,
- 5, 0xFE7F, 0x0640, 0x0652, 0,
- 7, 0xFE80, 0x0621, 0,
- 7, 0xFE81, 0x0622, 0,
- 6, 0xFE82, 0x0622, 0,
- 7, 0xFE83, 0x0623, 0,
- 6, 0xFE84, 0x0623, 0,
- 7, 0xFE85, 0x0624, 0,
- 6, 0xFE86, 0x0624, 0,
- 7, 0xFE87, 0x0625, 0,
- 6, 0xFE88, 0x0625, 0,
- 7, 0xFE89, 0x0626, 0,
- 6, 0xFE8A, 0x0626, 0,
- 4, 0xFE8B, 0x0626, 0,
- 5, 0xFE8C, 0x0626, 0,
- 7, 0xFE8D, 0x0627, 0,
- 6, 0xFE8E, 0x0627, 0,
- 7, 0xFE8F, 0x0628, 0,
- 6, 0xFE90, 0x0628, 0,
- 4, 0xFE91, 0x0628, 0,
- 5, 0xFE92, 0x0628, 0,
- 7, 0xFE93, 0x0629, 0,
- 6, 0xFE94, 0x0629, 0,
- 7, 0xFE95, 0x062A, 0,
- 6, 0xFE96, 0x062A, 0,
- 4, 0xFE97, 0x062A, 0,
- 5, 0xFE98, 0x062A, 0,
- 7, 0xFE99, 0x062B, 0,
- 6, 0xFE9A, 0x062B, 0,
- 4, 0xFE9B, 0x062B, 0,
- 5, 0xFE9C, 0x062B, 0,
- 7, 0xFE9D, 0x062C, 0,
- 6, 0xFE9E, 0x062C, 0,
- 4, 0xFE9F, 0x062C, 0,
- 5, 0xFEA0, 0x062C, 0,
- 7, 0xFEA1, 0x062D, 0,
- 6, 0xFEA2, 0x062D, 0,
- 4, 0xFEA3, 0x062D, 0,
- 5, 0xFEA4, 0x062D, 0,
- 7, 0xFEA5, 0x062E, 0,
- 6, 0xFEA6, 0x062E, 0,
- 4, 0xFEA7, 0x062E, 0,
- 5, 0xFEA8, 0x062E, 0,
- 7, 0xFEA9, 0x062F, 0,
- 6, 0xFEAA, 0x062F, 0,
- 7, 0xFEAB, 0x0630, 0,
- 6, 0xFEAC, 0x0630, 0,
- 7, 0xFEAD, 0x0631, 0,
- 6, 0xFEAE, 0x0631, 0,
- 7, 0xFEAF, 0x0632, 0,
- 6, 0xFEB0, 0x0632, 0,
- 7, 0xFEB1, 0x0633, 0,
- 6, 0xFEB2, 0x0633, 0,
- 4, 0xFEB3, 0x0633, 0,
- 5, 0xFEB4, 0x0633, 0,
- 7, 0xFEB5, 0x0634, 0,
- 6, 0xFEB6, 0x0634, 0,
- 4, 0xFEB7, 0x0634, 0,
- 5, 0xFEB8, 0x0634, 0,
- 7, 0xFEB9, 0x0635, 0,
- 6, 0xFEBA, 0x0635, 0,
- 4, 0xFEBB, 0x0635, 0,
- 5, 0xFEBC, 0x0635, 0,
- 7, 0xFEBD, 0x0636, 0,
- 6, 0xFEBE, 0x0636, 0,
- 4, 0xFEBF, 0x0636, 0,
- 5, 0xFEC0, 0x0636, 0,
- 7, 0xFEC1, 0x0637, 0,
- 6, 0xFEC2, 0x0637, 0,
- 4, 0xFEC3, 0x0637, 0,
- 5, 0xFEC4, 0x0637, 0,
- 7, 0xFEC5, 0x0638, 0,
- 6, 0xFEC6, 0x0638, 0,
- 4, 0xFEC7, 0x0638, 0,
- 5, 0xFEC8, 0x0638, 0,
- 7, 0xFEC9, 0x0639, 0,
- 6, 0xFECA, 0x0639, 0,
- 4, 0xFECB, 0x0639, 0,
- 5, 0xFECC, 0x0639, 0,
- 7, 0xFECD, 0x063A, 0,
- 6, 0xFECE, 0x063A, 0,
- 4, 0xFECF, 0x063A, 0,
- 5, 0xFED0, 0x063A, 0,
- 7, 0xFED1, 0x0641, 0,
- 6, 0xFED2, 0x0641, 0,
- 4, 0xFED3, 0x0641, 0,
- 5, 0xFED4, 0x0641, 0,
- 7, 0xFED5, 0x0642, 0,
- 6, 0xFED6, 0x0642, 0,
- 4, 0xFED7, 0x0642, 0,
- 5, 0xFED8, 0x0642, 0,
- 7, 0xFED9, 0x0643, 0,
- 6, 0xFEDA, 0x0643, 0,
- 4, 0xFEDB, 0x0643, 0,
- 5, 0xFEDC, 0x0643, 0,
- 7, 0xFEDD, 0x0644, 0,
- 6, 0xFEDE, 0x0644, 0,
- 4, 0xFEDF, 0x0644, 0,
- 5, 0xFEE0, 0x0644, 0,
- 7, 0xFEE1, 0x0645, 0,
- 6, 0xFEE2, 0x0645, 0,
- 4, 0xFEE3, 0x0645, 0,
- 5, 0xFEE4, 0x0645, 0,
- 7, 0xFEE5, 0x0646, 0,
- 6, 0xFEE6, 0x0646, 0,
- 4, 0xFEE7, 0x0646, 0,
- 5, 0xFEE8, 0x0646, 0,
- 7, 0xFEE9, 0x0647, 0,
- 6, 0xFEEA, 0x0647, 0,
- 4, 0xFEEB, 0x0647, 0,
- 5, 0xFEEC, 0x0647, 0,
- 7, 0xFEED, 0x0648, 0,
- 6, 0xFEEE, 0x0648, 0,
- 7, 0xFEEF, 0x0649, 0,
- 6, 0xFEF0, 0x0649, 0,
- 7, 0xFEF1, 0x064A, 0,
- 6, 0xFEF2, 0x064A, 0,
- 4, 0xFEF3, 0x064A, 0,
- 5, 0xFEF4, 0x064A, 0,
- 7, 0xFEF5, 0x0644, 0x0622, 0,
- 6, 0xFEF6, 0x0644, 0x0622, 0,
- 7, 0xFEF7, 0x0644, 0x0623, 0,
- 6, 0xFEF8, 0x0644, 0x0623, 0,
- 7, 0xFEF9, 0x0644, 0x0625, 0,
- 6, 0xFEFA, 0x0644, 0x0625, 0,
- 7, 0xFEFB, 0x0644, 0x0627, 0,
- 6, 0xFEFC, 0x0644, 0x0627, 0,
- 12, 0xFF01, 0x0021, 0,
- 12, 0xFF02, 0x0022, 0,
- 12, 0xFF03, 0x0023, 0,
- 12, 0xFF04, 0x0024, 0,
- 12, 0xFF05, 0x0025, 0,
- 12, 0xFF06, 0x0026, 0,
- 12, 0xFF07, 0x0027, 0,
- 12, 0xFF08, 0x0028, 0,
- 12, 0xFF09, 0x0029, 0,
- 12, 0xFF0A, 0x002A, 0,
- 12, 0xFF0B, 0x002B, 0,
- 12, 0xFF0C, 0x002C, 0,
- 12, 0xFF0D, 0x002D, 0,
- 12, 0xFF0E, 0x002E, 0,
- 12, 0xFF0F, 0x002F, 0,
- 12, 0xFF10, 0x0030, 0,
- 12, 0xFF11, 0x0031, 0,
- 12, 0xFF12, 0x0032, 0,
- 12, 0xFF13, 0x0033, 0,
- 12, 0xFF14, 0x0034, 0,
- 12, 0xFF15, 0x0035, 0,
- 12, 0xFF16, 0x0036, 0,
- 12, 0xFF17, 0x0037, 0,
- 12, 0xFF18, 0x0038, 0,
- 12, 0xFF19, 0x0039, 0,
- 12, 0xFF1A, 0x003A, 0,
- 12, 0xFF1B, 0x003B, 0,
- 12, 0xFF1C, 0x003C, 0,
- 12, 0xFF1D, 0x003D, 0,
- 12, 0xFF1E, 0x003E, 0,
- 12, 0xFF1F, 0x003F, 0,
- 12, 0xFF20, 0x0040, 0,
- 12, 0xFF21, 0x0041, 0,
- 12, 0xFF22, 0x0042, 0,
- 12, 0xFF23, 0x0043, 0,
- 12, 0xFF24, 0x0044, 0,
- 12, 0xFF25, 0x0045, 0,
- 12, 0xFF26, 0x0046, 0,
- 12, 0xFF27, 0x0047, 0,
- 12, 0xFF28, 0x0048, 0,
- 12, 0xFF29, 0x0049, 0,
- 12, 0xFF2A, 0x004A, 0,
- 12, 0xFF2B, 0x004B, 0,
- 12, 0xFF2C, 0x004C, 0,
- 12, 0xFF2D, 0x004D, 0,
- 12, 0xFF2E, 0x004E, 0,
- 12, 0xFF2F, 0x004F, 0,
- 12, 0xFF30, 0x0050, 0,
- 12, 0xFF31, 0x0051, 0,
- 12, 0xFF32, 0x0052, 0,
- 12, 0xFF33, 0x0053, 0,
- 12, 0xFF34, 0x0054, 0,
- 12, 0xFF35, 0x0055, 0,
- 12, 0xFF36, 0x0056, 0,
- 12, 0xFF37, 0x0057, 0,
- 12, 0xFF38, 0x0058, 0,
- 12, 0xFF39, 0x0059, 0,
- 12, 0xFF3A, 0x005A, 0,
- 12, 0xFF3B, 0x005B, 0,
- 12, 0xFF3C, 0x005C, 0,
- 12, 0xFF3D, 0x005D, 0,
- 12, 0xFF3E, 0x005E, 0,
- 12, 0xFF3F, 0x005F, 0,
- 12, 0xFF40, 0x0060, 0,
- 12, 0xFF41, 0x0061, 0,
- 12, 0xFF42, 0x0062, 0,
- 12, 0xFF43, 0x0063, 0,
- 12, 0xFF44, 0x0064, 0,
- 12, 0xFF45, 0x0065, 0,
- 12, 0xFF46, 0x0066, 0,
- 12, 0xFF47, 0x0067, 0,
- 12, 0xFF48, 0x0068, 0,
- 12, 0xFF49, 0x0069, 0,
- 12, 0xFF4A, 0x006A, 0,
- 12, 0xFF4B, 0x006B, 0,
- 12, 0xFF4C, 0x006C, 0,
- 12, 0xFF4D, 0x006D, 0,
- 12, 0xFF4E, 0x006E, 0,
- 12, 0xFF4F, 0x006F, 0,
- 12, 0xFF50, 0x0070, 0,
- 12, 0xFF51, 0x0071, 0,
- 12, 0xFF52, 0x0072, 0,
- 12, 0xFF53, 0x0073, 0,
- 12, 0xFF54, 0x0074, 0,
- 12, 0xFF55, 0x0075, 0,
- 12, 0xFF56, 0x0076, 0,
- 12, 0xFF57, 0x0077, 0,
- 12, 0xFF58, 0x0078, 0,
- 12, 0xFF59, 0x0079, 0,
- 12, 0xFF5A, 0x007A, 0,
- 12, 0xFF5B, 0x007B, 0,
- 12, 0xFF5C, 0x007C, 0,
- 12, 0xFF5D, 0x007D, 0,
- 12, 0xFF5E, 0x007E, 0,
- 13, 0xFF61, 0x3002, 0,
- 13, 0xFF62, 0x300C, 0,
- 13, 0xFF63, 0x300D, 0,
- 13, 0xFF64, 0x3001, 0,
- 13, 0xFF65, 0x30FB, 0,
- 13, 0xFF66, 0x30F2, 0,
- 13, 0xFF67, 0x30A1, 0,
- 13, 0xFF68, 0x30A3, 0,
- 13, 0xFF69, 0x30A5, 0,
- 13, 0xFF6A, 0x30A7, 0,
- 13, 0xFF6B, 0x30A9, 0,
- 13, 0xFF6C, 0x30E3, 0,
- 13, 0xFF6D, 0x30E5, 0,
- 13, 0xFF6E, 0x30E7, 0,
- 13, 0xFF6F, 0x30C3, 0,
- 13, 0xFF70, 0x30FC, 0,
- 13, 0xFF71, 0x30A2, 0,
- 13, 0xFF72, 0x30A4, 0,
- 13, 0xFF73, 0x30A6, 0,
- 13, 0xFF74, 0x30A8, 0,
- 13, 0xFF75, 0x30AA, 0,
- 13, 0xFF76, 0x30AB, 0,
- 13, 0xFF77, 0x30AD, 0,
- 13, 0xFF78, 0x30AF, 0,
- 13, 0xFF79, 0x30B1, 0,
- 13, 0xFF7A, 0x30B3, 0,
- 13, 0xFF7B, 0x30B5, 0,
- 13, 0xFF7C, 0x30B7, 0,
- 13, 0xFF7D, 0x30B9, 0,
- 13, 0xFF7E, 0x30BB, 0,
- 13, 0xFF7F, 0x30BD, 0,
- 13, 0xFF80, 0x30BF, 0,
- 13, 0xFF81, 0x30C1, 0,
- 13, 0xFF82, 0x30C4, 0,
- 13, 0xFF83, 0x30C6, 0,
- 13, 0xFF84, 0x30C8, 0,
- 13, 0xFF85, 0x30CA, 0,
- 13, 0xFF86, 0x30CB, 0,
- 13, 0xFF87, 0x30CC, 0,
- 13, 0xFF88, 0x30CD, 0,
- 13, 0xFF89, 0x30CE, 0,
- 13, 0xFF8A, 0x30CF, 0,
- 13, 0xFF8B, 0x30D2, 0,
- 13, 0xFF8C, 0x30D5, 0,
- 13, 0xFF8D, 0x30D8, 0,
- 13, 0xFF8E, 0x30DB, 0,
- 13, 0xFF8F, 0x30DE, 0,
- 13, 0xFF90, 0x30DF, 0,
- 13, 0xFF91, 0x30E0, 0,
- 13, 0xFF92, 0x30E1, 0,
- 13, 0xFF93, 0x30E2, 0,
- 13, 0xFF94, 0x30E4, 0,
- 13, 0xFF95, 0x30E6, 0,
- 13, 0xFF96, 0x30E8, 0,
- 13, 0xFF97, 0x30E9, 0,
- 13, 0xFF98, 0x30EA, 0,
- 13, 0xFF99, 0x30EB, 0,
- 13, 0xFF9A, 0x30EC, 0,
- 13, 0xFF9B, 0x30ED, 0,
- 13, 0xFF9C, 0x30EF, 0,
- 13, 0xFF9D, 0x30F3, 0,
- 13, 0xFF9E, 0x3099, 0,
- 13, 0xFF9F, 0x309A, 0,
- 13, 0xFFA0, 0x3164, 0,
- 13, 0xFFA1, 0x3131, 0,
- 13, 0xFFA2, 0x3132, 0,
- 13, 0xFFA3, 0x3133, 0,
- 13, 0xFFA4, 0x3134, 0,
- 13, 0xFFA5, 0x3135, 0,
- 13, 0xFFA6, 0x3136, 0,
- 13, 0xFFA7, 0x3137, 0,
- 13, 0xFFA8, 0x3138, 0,
- 13, 0xFFA9, 0x3139, 0,
- 13, 0xFFAA, 0x313A, 0,
- 13, 0xFFAB, 0x313B, 0,
- 13, 0xFFAC, 0x313C, 0,
- 13, 0xFFAD, 0x313D, 0,
- 13, 0xFFAE, 0x313E, 0,
- 13, 0xFFAF, 0x313F, 0,
- 13, 0xFFB0, 0x3140, 0,
- 13, 0xFFB1, 0x3141, 0,
- 13, 0xFFB2, 0x3142, 0,
- 13, 0xFFB3, 0x3143, 0,
- 13, 0xFFB4, 0x3144, 0,
- 13, 0xFFB5, 0x3145, 0,
- 13, 0xFFB6, 0x3146, 0,
- 13, 0xFFB7, 0x3147, 0,
- 13, 0xFFB8, 0x3148, 0,
- 13, 0xFFB9, 0x3149, 0,
- 13, 0xFFBA, 0x314A, 0,
- 13, 0xFFBB, 0x314B, 0,
- 13, 0xFFBC, 0x314C, 0,
- 13, 0xFFBD, 0x314D, 0,
- 13, 0xFFBE, 0x314E, 0,
- 13, 0xFFC2, 0x314F, 0,
- 13, 0xFFC3, 0x3150, 0,
- 13, 0xFFC4, 0x3151, 0,
- 13, 0xFFC5, 0x3152, 0,
- 13, 0xFFC6, 0x3153, 0,
- 13, 0xFFC7, 0x3154, 0,
- 13, 0xFFCA, 0x3155, 0,
- 13, 0xFFCB, 0x3156, 0,
- 13, 0xFFCC, 0x3157, 0,
- 13, 0xFFCD, 0x3158, 0,
- 13, 0xFFCE, 0x3159, 0,
- 13, 0xFFCF, 0x315A, 0,
- 13, 0xFFD2, 0x315B, 0,
- 13, 0xFFD3, 0x315C, 0,
- 13, 0xFFD4, 0x315D, 0,
- 13, 0xFFD5, 0x315E, 0,
- 13, 0xFFD6, 0x315F, 0,
- 13, 0xFFD7, 0x3160, 0,
- 13, 0xFFDA, 0x3161, 0,
- 13, 0xFFDB, 0x3162, 0,
- 13, 0xFFDC, 0x3163, 0,
- 12, 0xFFE0, 0x00A2, 0,
- 12, 0xFFE1, 0x00A3, 0,
- 12, 0xFFE2, 0x00AC, 0,
- 12, 0xFFE3, 0x00AF, 0,
- 12, 0xFFE4, 0x00A6, 0,
- 12, 0xFFE5, 0x00A5, 0,
- 12, 0xFFE6, 0x20A9, 0,
- 13, 0xFFE8, 0x2502, 0,
- 13, 0xFFE9, 0x2190, 0,
- 13, 0xFFEA, 0x2191, 0,
- 13, 0xFFEB, 0x2192, 0,
- 13, 0xFFEC, 0x2193, 0,
- 13, 0xFFED, 0x25A0, 0,
- 13, 0xFFEE, 0x25CB, 0,
-
-};
-
-static const Q_UINT16 di_00[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0,
- 5, 0, 10, 0, 0, 0, 0, 14,
- 0, 0, 19, 23, 27, 32, 0, 0,
- 36, 41, 45, 0, 49, 55, 61, 0,
- 67, 72, 77, 82, 87, 92, 0, 97,
- 102, 107, 112, 117, 122, 127, 132, 137,
- 0, 142, 147, 152, 157, 162, 167, 0,
- 0, 172, 177, 182, 187, 192, 0, 0,
- 197, 202, 207, 212, 217, 222, 0, 227,
- 232, 237, 242, 247, 252, 257, 262, 267,
- 0, 272, 277, 282, 287, 292, 297, 0,
- 0, 302, 307, 312, 317, 322, 0, 327,
-};
-
-static const Q_UINT16 di_01[] = {
- 332, 337, 342, 347, 352, 357, 362, 367,
- 372, 377, 382, 387, 392, 397, 402, 407,
- 0, 0, 412, 417, 422, 427, 432, 437,
- 442, 447, 452, 457, 462, 467, 472, 477,
- 482, 487, 492, 497, 502, 507, 0, 0,
- 512, 517, 522, 527, 532, 537, 542, 547,
- 552, 0, 557, 562, 567, 572, 577, 582,
- 0, 587, 592, 597, 602, 607, 612, 617,
- 622, 0, 0, 627, 632, 637, 642, 647,
- 652, 657, 0, 0, 662, 667, 672, 677,
- 682, 687, 0, 0, 692, 697, 702, 707,
- 712, 717, 722, 727, 732, 737, 742, 747,
- 752, 757, 762, 767, 772, 777, 0, 0,
- 782, 787, 792, 797, 802, 807, 812, 817,
- 822, 827, 832, 837, 842, 847, 852, 857,
- 862, 867, 872, 877, 882, 887, 892, 897,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 901, 906, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 911,
- 916, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 921, 926, 931, 936,
- 941, 946, 951, 956, 961, 966, 971, 976,
- 981, 986, 991, 996, 1001, 1006, 1011, 1016,
- 1021, 1026, 1031, 1036, 1041, 0, 1046, 1051,
- 1056, 1061, 1066, 1071, 0, 0, 1076, 1081,
- 1086, 1091, 1096, 1101, 1106, 1111, 1116, 1121,
- 1126, 1131, 1136, 1141, 1146, 1151, 0, 0,
- 1156, 1161, 1166, 1171, 1176, 1181, 1186, 1191,
-};
-
-static const Q_UINT16 di_02[] = {
- 1196, 1201, 1206, 1211, 1216, 1221, 1226, 1231,
- 1236, 1241, 1246, 1251, 1256, 1261, 1266, 1271,
- 1276, 1281, 1286, 1291, 1296, 1301, 1306, 1311,
- 1316, 1321, 1326, 1331, 0, 0, 1336, 1341,
- 0, 0, 0, 0, 0, 0, 1346, 1351,
- 1356, 1361, 1366, 1371, 1376, 1381, 1386, 1391,
- 1396, 1401, 1406, 1411, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1416, 1420, 1424, 1428, 1432, 1436, 1440, 1444,
- 1448, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1452, 1457, 1462, 1467, 1472, 1477, 0, 0,
- 1482, 1486, 1490, 1494, 1498, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_03[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1502, 1506, 0, 1510, 1514, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1519, 0, 0, 0,
- 0, 0, 1523, 0, 0, 0, 1528, 0,
- 0, 0, 0, 0, 1532, 1537, 1542, 1547,
- 1551, 1556, 1561, 0, 1566, 0, 1571, 1576,
- 1581, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1586, 1591, 1596, 1601, 1606, 1611,
- 1616, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1621, 1626, 1631, 1636, 1641, 0,
- 1646, 1650, 1654, 1658, 1663, 1668, 1672, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1676, 1680, 1684, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_04[] = {
- 1688, 1693, 0, 1698, 0, 0, 0, 1703,
- 0, 0, 0, 0, 1708, 1713, 1718, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1723, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1728, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1733, 1738, 0, 1743, 0, 0, 0, 1748,
- 0, 0, 0, 0, 1753, 1758, 1763, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1768, 1773,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1778, 1783, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1788, 1793, 1798, 1803, 0, 0, 1808, 1813,
- 0, 0, 1818, 1823, 1828, 1833, 1838, 1843,
- 0, 0, 1848, 1853, 1858, 1863, 1868, 1873,
- 0, 0, 1878, 1883, 1888, 1893, 1898, 1903,
- 1908, 1913, 1918, 1923, 1928, 1933, 0, 0,
- 1938, 1943, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_05[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1948,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_06[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1953, 1958, 1963, 1968, 1973, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1978, 1983, 1988,
- 1993, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1998, 0, 2003, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 2008, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_07[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_09[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 2013, 0, 0, 0, 0, 0, 0,
- 0, 2018, 0, 0, 2023, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 2028, 2033, 2038, 2043, 2048, 2053, 2058, 2063,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 2068, 2073, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 2078, 2083, 0, 2088,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_0A[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 2093, 0, 0, 2098, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 2103, 2108, 2113, 0, 0, 2118, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_0B[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 2123, 0, 0, 2128, 2133, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 2138, 2143, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 2148, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 2153, 2158, 2163, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_0C[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 2168, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 2173, 0, 0, 0, 0, 0, 0, 2178,
- 2183, 0, 2188, 2193, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_0D[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 2198, 2203, 2208, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 2213, 0, 2218, 2223, 2228, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_0E[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 2233, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 2238, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 2243, 2248, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_0F[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 2253, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 2257, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 2262, 0, 0,
- 0, 0, 2267, 0, 0, 0, 0, 2272,
- 0, 0, 0, 0, 2277, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 2282, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 2287, 0, 2292, 2297, 2302,
- 2307, 2312, 0, 0, 0, 0, 0, 0,
- 0, 2317, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 2322, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 2327, 0, 0,
- 0, 0, 2332, 0, 0, 0, 0, 2337,
- 0, 0, 0, 0, 2342, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 2347, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_10[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 2352, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_1E[] = {
- 2357, 2362, 2367, 2372, 2377, 2382, 2387, 2392,
- 2397, 2402, 2407, 2412, 2417, 2422, 2427, 2432,
- 2437, 2442, 2447, 2452, 2457, 2462, 2467, 2472,
- 2477, 2482, 2487, 2492, 2497, 2502, 2507, 2512,
- 2517, 2522, 2527, 2532, 2537, 2542, 2547, 2552,
- 2557, 2562, 2567, 2572, 2577, 2582, 2587, 2592,
- 2597, 2602, 2607, 2612, 2617, 2622, 2627, 2632,
- 2637, 2642, 2647, 2652, 2657, 2662, 2667, 2672,
- 2677, 2682, 2687, 2692, 2697, 2702, 2707, 2712,
- 2717, 2722, 2727, 2732, 2737, 2742, 2747, 2752,
- 2757, 2762, 2767, 2772, 2777, 2782, 2787, 2792,
- 2797, 2802, 2807, 2812, 2817, 2822, 2827, 2832,
- 2837, 2842, 2847, 2852, 2857, 2862, 2867, 2872,
- 2877, 2882, 2887, 2892, 2897, 2902, 2907, 2912,
- 2917, 2922, 2927, 2932, 2937, 2942, 2947, 2952,
- 2957, 2962, 2967, 2972, 2977, 2982, 2987, 2992,
- 2997, 3002, 3007, 3012, 3017, 3022, 3027, 3032,
- 3037, 3042, 3047, 3052, 3057, 3062, 3067, 3072,
- 3077, 3082, 3087, 3092, 3097, 3102, 3107, 3112,
- 3117, 3122, 3127, 3132, 0, 0, 0, 0,
- 3137, 3142, 3147, 3152, 3157, 3162, 3167, 3172,
- 3177, 3182, 3187, 3192, 3197, 3202, 3207, 3212,
- 3217, 3222, 3227, 3232, 3237, 3242, 3247, 3252,
- 3257, 3262, 3267, 3272, 3277, 3282, 3287, 3292,
- 3297, 3302, 3307, 3312, 3317, 3322, 3327, 3332,
- 3337, 3342, 3347, 3352, 3357, 3362, 3367, 3372,
- 3377, 3382, 3387, 3392, 3397, 3402, 3407, 3412,
- 3417, 3422, 3427, 3432, 3437, 3442, 3447, 3452,
- 3457, 3462, 3467, 3472, 3477, 3482, 3487, 3492,
- 3497, 3502, 3507, 3512, 3517, 3522, 3527, 3532,
- 3537, 3542, 3547, 3552, 3557, 3562, 3567, 3572,
- 3577, 3582, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_1F[] = {
- 3587, 3592, 3597, 3602, 3607, 3612, 3617, 3622,
- 3627, 3632, 3637, 3642, 3647, 3652, 3657, 3662,
- 3667, 3672, 3677, 3682, 3687, 3692, 0, 0,
- 3697, 3702, 3707, 3712, 3717, 3722, 0, 0,
- 3727, 3732, 3737, 3742, 3747, 3752, 3757, 3762,
- 3767, 3772, 3777, 3782, 3787, 3792, 3797, 3802,
- 3807, 3812, 3817, 3822, 3827, 3832, 3837, 3842,
- 3847, 3852, 3857, 3862, 3867, 3872, 3877, 3882,
- 3887, 3892, 3897, 3902, 3907, 3912, 0, 0,
- 3917, 3922, 3927, 3932, 3937, 3942, 0, 0,
- 3947, 3952, 3957, 3962, 3967, 3972, 3977, 3982,
- 0, 3987, 0, 3992, 0, 3997, 0, 4002,
- 4007, 4012, 4017, 4022, 4027, 4032, 4037, 4042,
- 4047, 4052, 4057, 4062, 4067, 4072, 4077, 4082,
- 4087, 4092, 4096, 4101, 4105, 4110, 4114, 4119,
- 4123, 4128, 4132, 4137, 4141, 4146, 0, 0,
- 4150, 4155, 4160, 4165, 4170, 4175, 4180, 4185,
- 4190, 4195, 4200, 4205, 4210, 4215, 4220, 4225,
- 4230, 4235, 4240, 4245, 4250, 4255, 4260, 4265,
- 4270, 4275, 4280, 4285, 4290, 4295, 4300, 4305,
- 4310, 4315, 4320, 4325, 4330, 4335, 4340, 4345,
- 4350, 4355, 4360, 4365, 4370, 4375, 4380, 4385,
- 4390, 4395, 4400, 4405, 4410, 0, 4415, 4420,
- 4425, 4430, 4435, 4440, 4444, 4449, 4454, 4458,
- 4463, 4468, 4473, 4478, 4483, 0, 4488, 4493,
- 4498, 4503, 4507, 4512, 4516, 4521, 4526, 4531,
- 4536, 4541, 4546, 4551, 0, 0, 4555, 4560,
- 4565, 4570, 4575, 4580, 0, 4584, 4589, 4594,
- 4599, 4604, 4609, 4614, 4618, 4623, 4628, 4633,
- 4638, 4643, 4648, 4653, 4657, 4662, 4667, 4671,
- 0, 0, 4675, 4680, 4685, 0, 4690, 4695,
- 4700, 4705, 4709, 4714, 4718, 4723, 4727, 0,
-};
-
-static const Q_UINT16 di_20[] = {
- 4732, 4736, 4740, 4744, 4748, 4752, 4756, 4760,
- 4764, 4768, 4772, 0, 0, 0, 0, 0,
- 0, 4776, 0, 0, 0, 0, 0, 4780,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 4785, 4789, 4794, 0,
- 0, 0, 0, 0, 0, 0, 0, 4800,
- 0, 0, 0, 4804, 4809, 0, 4815, 4820,
- 0, 0, 0, 0, 4826, 0, 4831, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 4836, 4841, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 4846, 0, 0, 0, 4850, 4854, 4858, 4862,
- 4866, 4870, 4874, 4878, 4882, 4886, 4890, 4894,
- 4898, 4902, 4906, 4910, 4914, 4918, 4922, 4926,
- 4930, 4934, 4938, 4942, 4946, 4950, 4954, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 4958, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_21[] = {
- 4963, 4969, 4975, 4979, 0, 4984, 4990, 4996,
- 0, 5000, 5005, 5009, 5013, 5017, 5021, 5025,
- 5029, 5033, 5037, 5041, 0, 5045, 5049, 0,
- 0, 5054, 5058, 5062, 5066, 5070, 0, 0,
- 5074, 5079, 5085, 0, 5090, 0, 5094, 0,
- 5098, 0, 5102, 5106, 5110, 5114, 0, 5118,
- 5122, 5126, 0, 5130, 5134, 5138, 5142, 5146,
- 5150, 5154, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 5158, 5164, 5170, 5176, 5182,
- 5188, 5194, 5200, 5206, 5212, 5218, 5224, 5230,
- 5235, 5239, 5244, 5250, 5255, 5259, 5264, 5270,
- 5277, 5282, 5286, 5291, 5297, 5301, 5305, 5309,
- 5313, 5317, 5322, 5328, 5333, 5337, 5342, 5348,
- 5355, 5360, 5364, 5369, 5375, 5379, 5383, 5387,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 5391, 5396, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 5401, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 5406, 5411, 5416,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_22[] = {
- 0, 0, 0, 0, 5421, 0, 0, 0,
- 0, 5426, 0, 0, 5431, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 5436, 0, 5441, 0,
- 0, 0, 0, 0, 5446, 5451, 0, 5457,
- 5462, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 5468, 0, 0, 5473, 0, 0, 5478,
- 0, 5483, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 5488, 0, 5493, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 5498, 5503, 5508,
- 5513, 5518, 0, 0, 5523, 5528, 0, 0,
- 5533, 5538, 0, 0, 0, 0, 0, 0,
- 5543, 5548, 0, 0, 5553, 5558, 0, 0,
- 5563, 5568, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 5573, 5578, 5583, 5588,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 5593, 5598, 5603, 5608, 0, 0, 0, 0,
- 0, 0, 5613, 5618, 5623, 5628, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_23[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 5633, 5637, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_24[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 5641, 5645, 5649, 5653, 5657, 5661, 5665, 5669,
- 5673, 5677, 5682, 5687, 5692, 5697, 5702, 5707,
- 5712, 5717, 5722, 5727, 5732, 5738, 5744, 5750,
- 5756, 5762, 5768, 5774, 5780, 5786, 5793, 5800,
- 5807, 5814, 5821, 5828, 5835, 5842, 5849, 5856,
- 5863, 5868, 5873, 5878, 5883, 5888, 5893, 5898,
- 5903, 5908, 5914, 5920, 5926, 5932, 5938, 5944,
- 5950, 5956, 5962, 5968, 5974, 5980, 5986, 5992,
- 5998, 6004, 6010, 6016, 6022, 6028, 6034, 6040,
- 6046, 6052, 6058, 6064, 6070, 6076, 6082, 6088,
- 6094, 6100, 6106, 6112, 6118, 6124, 6130, 6134,
- 6138, 6142, 6146, 6150, 6154, 6158, 6162, 6166,
- 6170, 6174, 6178, 6182, 6186, 6190, 6194, 6198,
- 6202, 6206, 6210, 6214, 6218, 6222, 6226, 6230,
- 6234, 6238, 6242, 6246, 6250, 6254, 6258, 6262,
- 6266, 6270, 6274, 6278, 6282, 6286, 6290, 6294,
- 6298, 6302, 6306, 6310, 6314, 6318, 6322, 6326,
- 6330, 6334, 6338, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_2E[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 6342,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 6346, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_2F[] = {
- 6350, 6354, 6358, 6362, 6366, 6370, 6374, 6378,
- 6382, 6386, 6390, 6394, 6398, 6402, 6406, 6410,
- 6414, 6418, 6422, 6426, 6430, 6434, 6438, 6442,
- 6446, 6450, 6454, 6458, 6462, 6466, 6470, 6474,
- 6478, 6482, 6486, 6490, 6494, 6498, 6502, 6506,
- 6510, 6514, 6518, 6522, 6526, 6530, 6534, 6538,
- 6542, 6546, 6550, 6554, 6558, 6562, 6566, 6570,
- 6574, 6578, 6582, 6586, 6590, 6594, 6598, 6602,
- 6606, 6610, 6614, 6618, 6622, 6626, 6630, 6634,
- 6638, 6642, 6646, 6650, 6654, 6658, 6662, 6666,
- 6670, 6674, 6678, 6682, 6686, 6690, 6694, 6698,
- 6702, 6706, 6710, 6714, 6718, 6722, 6726, 6730,
- 6734, 6738, 6742, 6746, 6750, 6754, 6758, 6762,
- 6766, 6770, 6774, 6778, 6782, 6786, 6790, 6794,
- 6798, 6802, 6806, 6810, 6814, 6818, 6822, 6826,
- 6830, 6834, 6838, 6842, 6846, 6850, 6854, 6858,
- 6862, 6866, 6870, 6874, 6878, 6882, 6886, 6890,
- 6894, 6898, 6902, 6906, 6910, 6914, 6918, 6922,
- 6926, 6930, 6934, 6938, 6942, 6946, 6950, 6954,
- 6958, 6962, 6966, 6970, 6974, 6978, 6982, 6986,
- 6990, 6994, 6998, 7002, 7006, 7010, 7014, 7018,
- 7022, 7026, 7030, 7034, 7038, 7042, 7046, 7050,
- 7054, 7058, 7062, 7066, 7070, 7074, 7078, 7082,
- 7086, 7090, 7094, 7098, 7102, 7106, 7110, 7114,
- 7118, 7122, 7126, 7130, 7134, 7138, 7142, 7146,
- 7150, 7154, 7158, 7162, 7166, 7170, 7174, 7178,
- 7182, 7186, 7190, 7194, 7198, 7202, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_30[] = {
- 7206, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 7210, 0,
- 7214, 7218, 7222, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7226, 0, 7231, 0,
- 7236, 0, 7241, 0, 7246, 0, 7251, 0,
- 7256, 0, 7261, 0, 7266, 0, 7271, 0,
- 7276, 0, 7281, 0, 0, 7286, 0, 7291,
- 0, 7296, 0, 0, 0, 0, 0, 0,
- 7301, 7306, 0, 7311, 7316, 0, 7321, 7326,
- 0, 7331, 7336, 0, 7341, 7346, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7351, 0, 0, 0,
- 0, 0, 0, 7356, 7361, 0, 7366, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7371, 0, 7376, 0,
- 7381, 0, 7386, 0, 7391, 0, 7396, 0,
- 7401, 0, 7406, 0, 7411, 0, 7416, 0,
- 7421, 0, 7426, 0, 0, 7431, 0, 7436,
- 0, 7441, 0, 0, 0, 0, 0, 0,
- 7446, 7451, 0, 7456, 7461, 0, 7466, 7471,
- 0, 7476, 7481, 0, 7486, 7491, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 7496, 0, 0, 7501,
- 7506, 7511, 7516, 0, 0, 0, 7521, 0,
-};
-
-static const Q_UINT16 di_31[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 7526, 7530, 7534, 7538, 7542, 7546, 7550,
- 7554, 7558, 7562, 7566, 7570, 7574, 7578, 7582,
- 7586, 7590, 7594, 7598, 7602, 7606, 7610, 7614,
- 7618, 7622, 7626, 7630, 7634, 7638, 7642, 7646,
- 7650, 7654, 7658, 7662, 7666, 7670, 7674, 7678,
- 7682, 7686, 7690, 7694, 7698, 7702, 7706, 7710,
- 7714, 7718, 7722, 7726, 7730, 7734, 7738, 7742,
- 7746, 7750, 7754, 7758, 7762, 7766, 7770, 7774,
- 7778, 7782, 7786, 7790, 7794, 7798, 7802, 7806,
- 7810, 7814, 7818, 7822, 7826, 7830, 7834, 7838,
- 7842, 7846, 7850, 7854, 7858, 7862, 7866, 7870,
- 7874, 7878, 7882, 7886, 7890, 7894, 7898, 0,
- 0, 0, 7902, 7906, 7910, 7914, 7918, 7922,
- 7926, 7930, 7934, 7938, 7942, 7946, 7950, 7954,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_32[] = {
- 7958, 7964, 7970, 7976, 7982, 7988, 7994, 8000,
- 8006, 8012, 8018, 8024, 8030, 8036, 8042, 8049,
- 8056, 8063, 8070, 8077, 8084, 8091, 8098, 8105,
- 8112, 8119, 8126, 8133, 8140, 0, 0, 0,
- 8147, 8153, 8159, 8165, 8171, 8177, 8183, 8189,
- 8195, 8201, 8207, 8213, 8219, 8225, 8231, 8237,
- 8243, 8249, 8255, 8261, 8267, 8273, 8279, 8285,
- 8291, 8297, 8303, 8309, 8315, 8321, 8327, 8333,
- 8339, 8345, 8351, 8357, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 8363, 8367, 8371, 8375, 8379, 8383, 8387, 8391,
- 8395, 8399, 8403, 8407, 8411, 8415, 8419, 8424,
- 8429, 8434, 8439, 8444, 8449, 8454, 8459, 8464,
- 8469, 8474, 8479, 8484, 0, 0, 0, 0,
- 8489, 8493, 8497, 8501, 8505, 8509, 8513, 8517,
- 8521, 8525, 8529, 8533, 8537, 8541, 8545, 8549,
- 8553, 8557, 8561, 8565, 8569, 8573, 8577, 8581,
- 8585, 8589, 8593, 8597, 8601, 8605, 8609, 8613,
- 8617, 8621, 8625, 8629, 8633, 8637, 8641, 8645,
- 8649, 8653, 8657, 8661, 8665, 8669, 8673, 8677,
- 8681, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 8685, 8690, 8695, 8700, 8705, 8710, 8715, 8720,
- 8725, 8730, 8736, 8742, 0, 0, 0, 0,
- 8748, 8752, 8756, 8760, 8764, 8768, 8772, 8776,
- 8780, 8784, 8788, 8792, 8796, 8800, 8804, 8808,
- 8812, 8816, 8820, 8824, 8828, 8832, 8836, 8840,
- 8844, 8848, 8852, 8856, 8860, 8864, 8868, 8872,
- 8876, 8880, 8884, 8888, 8892, 8896, 8900, 8904,
- 8908, 8912, 8916, 8920, 8924, 8928, 8932, 0,
-};
-
-static const Q_UINT16 di_33[] = {
- 8936, 8943, 8950, 8957, 8963, 8970, 8976, 8982,
- 8990, 8997, 9003, 9009, 9015, 9022, 9029, 9035,
- 9041, 9046, 9052, 9059, 9066, 9071, 9079, 9088,
- 9096, 9102, 9110, 9118, 9125, 9131, 9137, 9143,
- 9150, 9158, 9165, 9171, 9177, 9183, 9188, 9193,
- 9198, 9203, 9209, 9215, 9223, 9229, 9236, 9244,
- 9250, 9255, 9260, 9268, 9275, 9283, 9289, 9297,
- 9302, 9308, 9314, 9320, 9326, 9332, 9339, 9345,
- 9350, 9356, 9362, 9368, 9375, 9381, 9387, 9393,
- 9401, 9408, 9413, 9421, 9426, 9433, 9440, 9446,
- 9452, 9458, 9465, 9470, 9476, 9483, 9488, 9496,
- 9502, 9507, 9512, 9517, 9522, 9527, 9532, 9537,
- 9542, 9547, 9552, 9558, 9564, 9570, 9576, 9582,
- 9588, 9594, 9600, 9606, 9612, 9618, 9624, 9630,
- 9636, 9642, 9648, 9653, 9658, 9664, 9669, 0,
- 0, 0, 0, 9674, 9679, 9684, 9689, 9694,
- 9701, 9706, 9711, 9716, 9721, 9726, 9731, 9736,
- 9741, 9747, 9754, 9759, 9764, 9769, 9774, 9779,
- 9784, 9789, 9795, 9801, 9807, 9813, 9818, 9823,
- 9828, 9833, 9838, 9843, 9848, 9853, 9858, 9863,
- 9869, 9875, 9880, 9886, 9892, 9898, 9903, 9909,
- 9915, 9922, 9927, 9933, 9939, 9945, 9951, 9959,
- 9968, 9973, 9978, 9983, 9988, 9993, 9998, 10003,
- 10008, 10013, 10018, 10023, 10028, 10033, 10038, 10043,
- 10048, 10053, 10058, 10065, 10070, 10075, 10080, 10087,
- 10093, 10098, 10103, 10108, 10113, 10118, 10123, 10128,
- 10133, 10138, 10143, 10149, 10154, 10159, 10165, 10171,
- 10176, 10183, 10189, 10194, 10199, 10204, 0, 0,
- 10209, 10214, 10219, 10224, 10229, 10234, 10239, 10244,
- 10249, 10254, 10260, 10266, 10272, 10278, 10284, 10290,
- 10296, 10302, 10308, 10314, 10320, 10326, 10332, 10338,
- 10344, 10350, 10356, 10362, 10368, 10374, 10380, 0,
-};
-
-static const Q_UINT16 di_F9[] = {
- 10386, 10390, 10394, 10398, 10402, 10406, 10410, 10414,
- 10418, 10422, 10426, 10430, 10434, 10438, 10442, 10446,
- 10450, 10454, 10458, 10462, 10466, 10470, 10474, 10478,
- 10482, 10486, 10490, 10494, 10498, 10502, 10506, 10510,
- 10514, 10518, 10522, 10526, 10530, 10534, 10538, 10542,
- 10546, 10550, 10554, 10558, 10562, 10566, 10570, 10574,
- 10578, 10582, 10586, 10590, 10594, 10598, 10602, 10606,
- 10610, 10614, 10618, 10622, 10626, 10630, 10634, 10638,
- 10642, 10646, 10650, 10654, 10658, 10662, 10666, 10670,
- 10674, 10678, 10682, 10686, 10690, 10694, 10698, 10702,
- 10706, 10710, 10714, 10718, 10722, 10726, 10730, 10734,
- 10738, 10742, 10746, 10750, 10754, 10758, 10762, 10766,
- 10770, 10774, 10778, 10782, 10786, 10790, 10794, 10798,
- 10802, 10806, 10810, 10814, 10818, 10822, 10826, 10830,
- 10834, 10838, 10842, 10846, 10850, 10854, 10858, 10862,
- 10866, 10870, 10874, 10878, 10882, 10886, 10890, 10894,
- 10898, 10902, 10906, 10910, 10914, 10918, 10922, 10926,
- 10930, 10934, 10938, 10942, 10946, 10950, 10954, 10958,
- 10962, 10966, 10970, 10974, 10978, 10982, 10986, 10990,
- 10994, 10998, 11002, 11006, 11010, 11014, 11018, 11022,
- 11026, 11030, 11034, 11038, 11042, 11046, 11050, 11054,
- 11058, 11062, 11066, 11070, 11074, 11078, 11082, 11086,
- 11090, 11094, 11098, 11102, 11106, 11110, 11114, 11118,
- 11122, 11126, 11130, 11134, 11138, 11142, 11146, 11150,
- 11154, 11158, 11162, 11166, 11170, 11174, 11178, 11182,
- 11186, 11190, 11194, 11198, 11202, 11206, 11210, 11214,
- 11218, 11222, 11226, 11230, 11234, 11238, 11242, 11246,
- 11250, 11254, 11258, 11262, 11266, 11270, 11274, 11278,
- 11282, 11286, 11290, 11294, 11298, 11302, 11306, 11310,
- 11314, 11318, 11322, 11326, 11330, 11334, 11338, 11342,
- 11346, 11350, 11354, 11358, 11362, 11366, 11370, 11374,
- 11378, 11382, 11386, 11390, 11394, 11398, 11402, 11406,
-};
-
-static const Q_UINT16 di_FA[] = {
- 11410, 11414, 11418, 11422, 11426, 11430, 11434, 11438,
- 11442, 11446, 11450, 11454, 11458, 11462, 0, 0,
- 11466, 0, 11470, 0, 0, 11474, 11478, 11482,
- 11486, 11490, 11494, 11498, 11502, 11506, 11510, 0,
- 11514, 0, 11518, 0, 0, 11522, 11526, 0,
- 0, 0, 11530, 11534, 11538, 11542, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_FB[] = {
- 11546, 11551, 11556, 11561, 11567, 11573, 11578, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 11583, 11588, 11593, 11598, 11603,
- 0, 0, 0, 0, 0, 11608, 0, 11613,
- 11618, 11622, 11626, 11630, 11634, 11638, 11642, 11646,
- 11650, 11654, 11658, 11663, 11668, 11673, 11678, 11683,
- 11688, 11693, 11698, 11703, 11708, 11713, 11718, 0,
- 11723, 11728, 11733, 11738, 11743, 0, 11748, 0,
- 11753, 11758, 0, 11763, 11768, 0, 11773, 11778,
- 11783, 11788, 11793, 11798, 11803, 11808, 11813, 11818,
- 11823, 11827, 11831, 11835, 11839, 11843, 11847, 11851,
- 11855, 11859, 11863, 11867, 11871, 11875, 11879, 11883,
- 11887, 11891, 11895, 11899, 11903, 11907, 11911, 11915,
- 11919, 11923, 11927, 11931, 11935, 11939, 11943, 11947,
- 11951, 11955, 11959, 11963, 11967, 11971, 11975, 11979,
- 11983, 11987, 11991, 11995, 11999, 12003, 12007, 12011,
- 12015, 12019, 12023, 12027, 12031, 12035, 12039, 12043,
- 12047, 12051, 12055, 12059, 12063, 12067, 12071, 12075,
- 12079, 12083, 12087, 12091, 12095, 12099, 12103, 12107,
- 12111, 12115, 12119, 12123, 12127, 12131, 12135, 12139,
- 12143, 12147, 12151, 12155, 12159, 12163, 12167, 12171,
- 12175, 12179, 12183, 12187, 12191, 12195, 12199, 12203,
- 12207, 12211, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 12215, 12219, 12223, 12227, 12231,
- 12235, 12239, 12243, 12247, 12251, 12255, 12259, 12263,
- 12267, 12271, 12275, 12279, 12283, 12287, 12291, 12295,
- 12299, 12303, 12307, 12312, 12317, 12322, 12327, 12332,
- 12337, 12342, 12347, 12352, 12357, 12362, 12367, 12372,
- 12377, 12382, 12387, 12392, 12397, 12401, 12405, 12409,
-};
-
-static const Q_UINT16 di_FC[] = {
- 12413, 12418, 12423, 12428, 12433, 12438, 12443, 12448,
- 12453, 12458, 12463, 12468, 12473, 12478, 12483, 12488,
- 12493, 12498, 12503, 12508, 12513, 12518, 12523, 12528,
- 12533, 12538, 12543, 12548, 12553, 12558, 12563, 12568,
- 12573, 12578, 12583, 12588, 12593, 12598, 12603, 12608,
- 12613, 12618, 12623, 12628, 12633, 12638, 12643, 12648,
- 12653, 12658, 12663, 12668, 12673, 12678, 12683, 12688,
- 12693, 12698, 12703, 12708, 12713, 12718, 12723, 12728,
- 12733, 12738, 12743, 12748, 12753, 12758, 12763, 12768,
- 12773, 12778, 12783, 12788, 12793, 12798, 12803, 12808,
- 12813, 12818, 12823, 12828, 12833, 12838, 12843, 12848,
- 12853, 12858, 12863, 12868, 12873, 12878, 12883, 12889,
- 12895, 12901, 12907, 12913, 12919, 12924, 12929, 12934,
- 12939, 12944, 12949, 12954, 12959, 12964, 12969, 12974,
- 12979, 12984, 12989, 12994, 12999, 13004, 13009, 13014,
- 13019, 13024, 13029, 13034, 13039, 13044, 13049, 13054,
- 13059, 13064, 13069, 13074, 13079, 13084, 13089, 13094,
- 13099, 13104, 13109, 13114, 13119, 13124, 13129, 13134,
- 13139, 13144, 13149, 13154, 13159, 13164, 13169, 13174,
- 13179, 13184, 13189, 13194, 13199, 13204, 13209, 13214,
- 13219, 13224, 13229, 13234, 13239, 13244, 13249, 13254,
- 13259, 13264, 13269, 13274, 13279, 13284, 13289, 13294,
- 13299, 13304, 13309, 13314, 13319, 13324, 13329, 13334,
- 13339, 13344, 13349, 13354, 13359, 13364, 13369, 13374,
- 13379, 13384, 13389, 13394, 13399, 13404, 13409, 13414,
- 13419, 13424, 13429, 13434, 13439, 13444, 13449, 13454,
- 13459, 13464, 13469, 13474, 13479, 13484, 13489, 13494,
- 13499, 13504, 13509, 13514, 13519, 13524, 13529, 13534,
- 13539, 13544, 13549, 13554, 13559, 13564, 13569, 13574,
- 13579, 13584, 13589, 13594, 13599, 13604, 13609, 13614,
- 13619, 13624, 13629, 13635, 13641, 13647, 13652, 13657,
- 13662, 13667, 13672, 13677, 13682, 13687, 13692, 13697,
-};
-
-static const Q_UINT16 di_FD[] = {
- 13702, 13707, 13712, 13717, 13722, 13727, 13732, 13737,
- 13742, 13747, 13752, 13757, 13762, 13767, 13772, 13777,
- 13782, 13787, 13792, 13797, 13802, 13807, 13812, 13817,
- 13822, 13827, 13832, 13837, 13842, 13847, 13852, 13857,
- 13862, 13867, 13872, 13877, 13882, 13887, 13892, 13897,
- 13902, 13907, 13912, 13917, 13922, 13927, 13932, 13937,
- 13942, 13947, 13952, 13957, 13962, 13967, 13972, 13977,
- 13982, 13987, 13992, 13997, 14002, 14007, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 14012, 14018, 14024, 14030, 14036, 14042, 14048, 14054,
- 14060, 14066, 14072, 14078, 14084, 14090, 14096, 14102,
- 14108, 14114, 14120, 14126, 14132, 14138, 14144, 14150,
- 14156, 14162, 14168, 14174, 14180, 14186, 14192, 14198,
- 14204, 14210, 14216, 14222, 14228, 14234, 14240, 14246,
- 14252, 14258, 14264, 14270, 14276, 14282, 14288, 14294,
- 14300, 14306, 14312, 14318, 14324, 14330, 14336, 14342,
- 14348, 14354, 14360, 14366, 14372, 14378, 14384, 14390,
- 0, 0, 14396, 14402, 14408, 14414, 14420, 14426,
- 14432, 14438, 14444, 14450, 14456, 14462, 14468, 14474,
- 14480, 14486, 14492, 14498, 14504, 14510, 14516, 14522,
- 14528, 14534, 14540, 14546, 14552, 14558, 14564, 14570,
- 14576, 14582, 14588, 14594, 14600, 14606, 14612, 14618,
- 14624, 14630, 14636, 14642, 14648, 14654, 14660, 14666,
- 14672, 14678, 14684, 14690, 14696, 14702, 14708, 14714,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 14720, 14726, 14732, 14739, 14746, 14753, 14760, 14767,
- 14774, 14781, 14787, 14808, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 di_FE[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 14819, 14823, 14827, 14831, 14835, 14839, 14843, 14847,
- 14851, 14855, 14859, 14863, 14867, 14871, 14875, 14879,
- 14883, 14887, 14891, 14895, 14899, 0, 0, 0,
- 0, 14903, 14907, 14911, 14915, 14919, 14923, 14927,
- 14931, 14935, 14939, 0, 14943, 14947, 14951, 14955,
- 14959, 14963, 14967, 14971, 14975, 14979, 14983, 14987,
- 14991, 14995, 14999, 15003, 15007, 15011, 15015, 0,
- 15019, 15023, 15027, 15031, 0, 0, 0, 0,
- 15035, 15040, 15045, 0, 15050, 0, 15055, 15060,
- 15065, 15070, 15075, 15080, 15085, 15090, 15095, 15100,
- 15105, 15109, 15113, 15117, 15121, 15125, 15129, 15133,
- 15137, 15141, 15145, 15149, 15153, 15157, 15161, 15165,
- 15169, 15173, 15177, 15181, 15185, 15189, 15193, 15197,
- 15201, 15205, 15209, 15213, 15217, 15221, 15225, 15229,
- 15233, 15237, 15241, 15245, 15249, 15253, 15257, 15261,
- 15265, 15269, 15273, 15277, 15281, 15285, 15289, 15293,
- 15297, 15301, 15305, 15309, 15313, 15317, 15321, 15325,
- 15329, 15333, 15337, 15341, 15345, 15349, 15353, 15357,
- 15361, 15365, 15369, 15373, 15377, 15381, 15385, 15389,
- 15393, 15397, 15401, 15405, 15409, 15413, 15417, 15421,
- 15425, 15429, 15433, 15437, 15441, 15445, 15449, 15453,
- 15457, 15461, 15465, 15469, 15473, 15477, 15481, 15485,
- 15489, 15493, 15497, 15501, 15505, 15509, 15513, 15517,
- 15521, 15525, 15529, 15533, 15537, 15541, 15545, 15549,
- 15553, 15557, 15561, 15565, 15569, 15573, 15578, 15583,
- 15588, 15593, 15598, 15603, 15608, 0, 0, 0,
-};
-
-static const Q_UINT16 di_FF[] = {
- 0, 15613, 15617, 15621, 15625, 15629, 15633, 15637,
- 15641, 15645, 15649, 15653, 15657, 15661, 15665, 15669,
- 15673, 15677, 15681, 15685, 15689, 15693, 15697, 15701,
- 15705, 15709, 15713, 15717, 15721, 15725, 15729, 15733,
- 15737, 15741, 15745, 15749, 15753, 15757, 15761, 15765,
- 15769, 15773, 15777, 15781, 15785, 15789, 15793, 15797,
- 15801, 15805, 15809, 15813, 15817, 15821, 15825, 15829,
- 15833, 15837, 15841, 15845, 15849, 15853, 15857, 15861,
- 15865, 15869, 15873, 15877, 15881, 15885, 15889, 15893,
- 15897, 15901, 15905, 15909, 15913, 15917, 15921, 15925,
- 15929, 15933, 15937, 15941, 15945, 15949, 15953, 15957,
- 15961, 15965, 15969, 15973, 15977, 15981, 15985, 0,
- 0, 15989, 15993, 15997, 16001, 16005, 16009, 16013,
- 16017, 16021, 16025, 16029, 16033, 16037, 16041, 16045,
- 16049, 16053, 16057, 16061, 16065, 16069, 16073, 16077,
- 16081, 16085, 16089, 16093, 16097, 16101, 16105, 16109,
- 16113, 16117, 16121, 16125, 16129, 16133, 16137, 16141,
- 16145, 16149, 16153, 16157, 16161, 16165, 16169, 16173,
- 16177, 16181, 16185, 16189, 16193, 16197, 16201, 16205,
- 16209, 16213, 16217, 16221, 16225, 16229, 16233, 16237,
- 16241, 16245, 16249, 16253, 16257, 16261, 16265, 16269,
- 16273, 16277, 16281, 16285, 16289, 16293, 16297, 16301,
- 16305, 16309, 16313, 16317, 16321, 16325, 16329, 16333,
- 16337, 16341, 16345, 16349, 16353, 16357, 16361, 0,
- 0, 0, 16365, 16369, 16373, 16377, 16381, 16385,
- 0, 0, 16389, 16393, 16397, 16401, 16405, 16409,
- 0, 0, 16413, 16417, 16421, 16425, 16429, 16433,
- 0, 0, 16437, 16441, 16445, 0, 0, 0,
- 16449, 16453, 16457, 16461, 16465, 16469, 16473, 0,
- 16477, 16481, 16485, 16489, 16493, 16497, 16501, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 * const decomposition_info[256] = {
- di_00, di_01, di_02, di_03, di_04, di_05, di_06, di_07,
- di_07, di_09, di_0A, di_0B, di_0C, di_0D, di_0E, di_0F,
- di_10, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_1E, di_1F,
- di_20, di_21, di_22, di_23, di_24, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_2E, di_2F,
- di_30, di_31, di_32, di_33, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_07, di_07, di_07, di_07, di_07, di_07, di_07,
- di_07, di_F9, di_FA, di_FB, di_FC, di_FD, di_FE, di_FF,
-};
-// 68080 bytes
-
-static const Q_UINT16 ligature_map [] = {
- 0,
- 12883, 12889, 12895, 12901, 12907, 12913, 15035, 15045, 15050, 15055, 15065, 15075, 15085, 15095, 0,
- 5503, 0,
- 5488, 0,
- 5508, 0,
- 67, 72, 77, 82, 87, 92, 332, 342, 352, 966, 1196, 1206, 1346, 2357, 3137, 3147, 0,
- 2367, 2377, 2387, 0,
- 97, 362, 372, 382, 392, 0,
- 402, 2407, 2417, 2427, 2437, 2447, 0,
- 102, 107, 112, 117, 412, 422, 432, 442, 452, 1216, 1226, 1356, 2477, 2487, 3257, 3267, 3277, 0,
- 2507, 0,
- 462, 472, 482, 492, 1076, 1146, 2517, 0,
- 502, 1336, 2527, 2537, 2547, 2557, 2567, 0,
- 122, 127, 132, 137, 512, 522, 532, 542, 552, 976, 1236, 1246, 2577, 3337, 3347, 0,
- 567, 0,
- 577, 1086, 2597, 2607, 2617, 0,
- 587, 597, 607, 2627, 2647, 2657, 0,
- 2667, 2677, 2687, 0,
- 142, 627, 637, 647, 1156, 2697, 2707, 2717, 2727, 0,
- 147, 152, 157, 162, 167, 662, 672, 682, 901, 986, 1096, 1256, 1266, 1386, 3357, 3367, 0,
- 2777, 2787, 0,
- 692, 702, 712, 1276, 1286, 2797, 2807, 2827, 0,
- 722, 732, 742, 752, 1316, 2837, 2847, 0,
- 762, 772, 1326, 2887, 2897, 2907, 2917, 0,
- 172, 177, 182, 187, 782, 792, 802, 812, 822, 832, 911, 996, 1296, 1306, 2927, 2937, 2947, 3477, 3487, 0,
- 2977, 2987, 0,
- 842, 2997, 3007, 3017, 3027, 3037, 0,
- 3047, 3057, 0,
- 192, 852, 862, 1406, 3067, 3547, 3557, 3567, 3577, 0,
- 867, 877, 887, 3077, 3087, 3097, 0,
- 197, 202, 207, 212, 217, 222, 337, 347, 357, 971, 1201, 1211, 1351, 2362, 3142, 3152, 0,
- 2372, 2382, 2392, 0,
- 227, 367, 377, 387, 397, 0,
- 407, 2412, 2422, 2432, 2442, 2452, 0,
- 232, 237, 242, 247, 417, 427, 437, 447, 457, 1221, 1231, 1361, 2482, 2492, 3262, 3272, 3282, 0,
- 2512, 0,
- 467, 477, 487, 497, 1081, 1151, 2522, 0,
- 507, 1341, 2532, 2542, 2552, 2562, 2572, 3107, 0,
- 252, 257, 262, 267, 517, 527, 537, 547, 981, 1241, 1251, 2582, 3342, 3352, 0,
- 572, 1126, 0,
- 582, 1091, 2602, 2612, 2622, 0,
- 592, 602, 612, 2632, 2652, 2662, 0,
- 2672, 2682, 2692, 0,
- 272, 632, 642, 652, 1161, 2702, 2712, 2722, 2732, 0,
- 277, 282, 287, 292, 297, 667, 677, 687, 906, 991, 1101, 1261, 1271, 1391, 3362, 3372, 0,
- 2782, 2792, 0,
- 697, 707, 717, 1281, 1291, 2802, 2812, 2832, 0,
- 727, 737, 747, 757, 1321, 2842, 2852, 0,
- 767, 777, 1331, 2892, 2902, 2912, 2922, 3112, 0,
- 302, 307, 312, 317, 787, 797, 807, 817, 827, 837, 916, 1001, 1301, 1311, 2932, 2942, 2952, 3482, 3492, 0,
- 2982, 2992, 0,
- 847, 3002, 3012, 3022, 3032, 3042, 3117, 0,
- 3052, 3062, 0,
- 322, 327, 857, 1411, 3072, 3122, 3552, 3562, 3572, 3582, 0,
- 872, 882, 892, 3082, 3092, 3102, 0,
- 1537, 4468, 4662, 0,
- 3157, 3167, 3177, 3187, 0,
- 1046, 0,
- 1166, 0,
- 1066, 1176, 0,
- 2397, 0,
- 3287, 3297, 3307, 3317, 0,
- 2587, 0,
- 3377, 3387, 3397, 3407, 0,
- 1376, 2737, 2747, 0,
- 1366, 0,
- 1186, 0,
- 1006, 1016, 1026, 1036, 0,
- 3162, 3172, 3182, 3192, 0,
- 1051, 0,
- 1171, 0,
- 1071, 1181, 0,
- 2402, 0,
- 3292, 3302, 3312, 3322, 0,
- 2592, 0,
- 3382, 3392, 3402, 3412, 0,
- 1381, 2742, 2752, 0,
- 1371, 0,
- 1191, 0,
- 1011, 1021, 1031, 1041, 0,
- 3207, 3217, 3227, 3237, 0,
- 3212, 3222, 3232, 3242, 0,
- 2457, 2467, 0,
- 2462, 2472, 0,
- 2757, 2767, 0,
- 2762, 2772, 0,
- 2857, 0,
- 2862, 0,
- 2867, 0,
- 2872, 0,
- 2957, 0,
- 2962, 0,
- 2967, 0,
- 2972, 0,
- 3132, 0,
- 3427, 3437, 3447, 3457, 3467, 0,
- 3432, 3442, 3452, 3462, 3472, 0,
- 3497, 3507, 3517, 3527, 3537, 0,
- 3502, 3512, 3522, 3532, 3542, 0,
- 1116, 0,
- 1106, 0,
- 1111, 0,
- 1056, 0,
- 1061, 0,
- 2497, 0,
- 2502, 0,
- 1396, 0,
- 1401, 0,
- 1121, 0,
- 1514, 0,
- 1542, 3627, 3632, 4425, 4430, 4435, 4444, 0,
- 1551, 3697, 3702, 4498, 0,
- 1556, 3767, 3772, 4507, 4516, 0,
- 1561, 1586, 3847, 3852, 4565, 4570, 4575, 0,
- 1566, 3917, 3922, 4700, 0,
- 4657, 0,
- 1571, 1591, 3987, 4638, 4643, 4648, 0,
- 1576, 4047, 4052, 4709, 4718, 0,
- 4410, 0,
- 4483, 0,
- 1596, 3587, 3592, 4087, 4390, 4395, 4405, 4415, 0,
- 1601, 3667, 3672, 4096, 0,
- 1606, 3727, 3732, 4105, 4478, 4488, 0,
- 1611, 1621, 3807, 3812, 4114, 4536, 4541, 4555, 0,
- 1631, 3887, 3892, 4123, 0,
- 4618, 4623, 0,
- 1626, 1636, 3947, 3952, 4132, 4599, 4604, 4628, 0,
- 1641, 4007, 4012, 4141, 4680, 4690, 0,
- 1581, 4546, 4560, 0,
- 1616, 4609, 4633, 0,
- 4685, 0,
- 1658, 1663, 0,
- 1703, 0,
- 1788, 1798, 0,
- 1698, 0,
- 1688, 1693, 1808, 0,
- 1778, 1828, 0,
- 1838, 0,
- 1713, 1723, 1848, 1858, 0,
- 1708, 0,
- 1868, 0,
- 1718, 1898, 1908, 1918, 0,
- 1928, 0,
- 1938, 0,
- 1888, 0,
- 1793, 1803, 0,
- 1743, 0,
- 1733, 1738, 1813, 0,
- 1783, 1833, 0,
- 1843, 0,
- 1728, 1758, 1853, 1863, 0,
- 1753, 0,
- 1873, 0,
- 1763, 1903, 1913, 1923, 0,
- 1933, 0,
- 1943, 0,
- 1893, 0,
- 1748, 0,
- 1768, 0,
- 1773, 0,
- 1818, 0,
- 1823, 0,
- 1878, 0,
- 1883, 0,
- 11678, 11683, 11688, 0,
- 11693, 11803, 0,
- 11698, 0,
- 11703, 0,
- 11708, 0,
- 11713, 11798, 0,
- 11718, 0,
- 11723, 0,
- 11608, 11728, 0,
- 11733, 0,
- 11738, 11808, 0,
- 11743, 0,
- 11748, 0,
- 11753, 0,
- 11758, 0,
- 11763, 0,
- 11768, 11813, 0,
- 11773, 0,
- 11778, 0,
- 11783, 0,
- 11658, 11663, 11788, 0,
- 11793, 0,
- 11613, 0,
- 15105, 0,
- 15109, 15113, 0,
- 15117, 15121, 0,
- 15125, 15129, 0,
- 15133, 15137, 0,
- 12307, 12312, 12317, 12322, 12327, 12332, 12337, 12342, 12347, 12352, 12357, 12362, 12367, 12372, 12377, 12382, 12387, 12392, 12413, 12418, 12423, 12428, 12433, 12919, 12924, 12929, 12934, 12939, 12944, 13174, 13179, 13184, 13189, 13194, 13534, 13539, 15141, 15145, 15149, 15153, 0,
- 14732, 14739, 1958, 1968, 14007, 14002, 1953, 15157, 15161, 0,
- 14468, 14684, 12448, 12453, 12458, 12463, 12949, 12954, 12959, 12964, 12969, 12974, 13199, 13204, 13209, 13214, 13219, 13544, 13549, 12438, 12443, 15165, 15169, 15173, 15177, 0,
- 15181, 15185, 0,
- 14012, 14018, 14024, 14030, 14036, 14042, 14048, 14054, 14474, 14480, 14486, 14492, 14498, 14504, 13229, 13234, 13239, 13244, 13559, 13554, 12468, 12473, 12478, 12483, 12488, 12493, 12979, 12984, 12989, 12994, 12999, 13004, 13224, 15189, 15193, 15197, 15201, 0,
- 12498, 12503, 12508, 12513, 13009, 13014, 13019, 13024, 13029, 13034, 13249, 13564, 13569, 15205, 15209, 15213, 15217, 0,
- 14808, 14660, 14060, 14066, 14510, 14516, 14522, 12518, 12523, 13254, 13259, 13707, 13712, 13847, 13852, 15221, 15225, 15229, 15233, 0,
- 14072, 14078, 14666, 13264, 13269, 13697, 13702, 13842, 13837, 12528, 12533, 15237, 15241, 15245, 15249, 0,
- 12538, 12543, 12548, 13274, 13279, 13717, 13722, 13857, 13862, 15253, 15257, 15261, 15265, 0,
- 15269, 15273, 0,
- 12868, 15277, 15281, 0,
- 14760, 12873, 15285, 15289, 0,
- 15293, 15297, 0,
- 14084, 14090, 14096, 14102, 14108, 14114, 14120, 14126, 14528, 14708, 13677, 13682, 13772, 13817, 13822, 13912, 13947, 13962, 13967, 13972, 12553, 12558, 12563, 12568, 13284, 13289, 13294, 13299, 13574, 13579, 15301, 15305, 15309, 15313, 0,
- 14150, 14156, 14162, 14168, 14174, 14180, 14186, 14540, 13767, 13827, 13832, 13887, 13892, 13897, 13902, 13907, 13927, 13932, 13937, 13942, 13952, 13977, 13982, 13987, 13584, 13589, 13687, 13692, 13747, 13752, 13757, 13762, 15317, 15321, 15325, 15329, 0,
- 14787, 14753, 14781, 14138, 14132, 14144, 14534, 14702, 14720, 12573, 12578, 13304, 13309, 13314, 13727, 13732, 13777, 13872, 13917, 13867, 15333, 15337, 15341, 15345, 0,
- 14192, 14198, 14204, 14546, 13319, 13324, 13329, 13334, 13737, 13742, 13782, 13877, 13882, 13922, 12583, 12588, 12593, 12598, 15349, 15353, 15357, 15361, 0,
- 14210, 14216, 14222, 14228, 13647, 13652, 13787, 13792, 13992, 13957, 12603, 12608, 13339, 15365, 15369, 15373, 15377, 0,
- 12613, 13344, 13997, 15381, 15385, 15389, 15393, 0,
- 14767, 14696, 14234, 14240, 14246, 14252, 14612, 12618, 12623, 13349, 13354, 13657, 13662, 13797, 13802, 15397, 15401, 15405, 15409, 0,
- 14258, 14264, 14270, 13359, 13364, 13667, 13672, 13812, 13807, 12628, 12633, 15413, 15417, 15421, 15425, 0,
- 13629, 13635, 13641, 15040, 15060, 15070, 15080, 15090, 15100, 0,
- 14276, 14282, 14678, 12653, 12658, 12663, 13039, 13044, 13369, 13374, 13379, 13384, 12638, 12643, 12648, 15429, 15433, 15437, 15441, 0,
- 14600, 14726, 14294, 14288, 14588, 12668, 12673, 12678, 12683, 13049, 13054, 13389, 13394, 15445, 15449, 15453, 15457, 0,
- 14618, 14642, 14690, 12703, 12708, 12713, 12718, 12723, 13059, 13064, 13069, 13074, 13079, 13399, 13404, 13409, 13414, 13419, 13594, 13599, 12688, 12693, 12698, 15461, 15465, 15469, 15473, 0,
- 14648, 14300, 14306, 14312, 14318, 14324, 14330, 14336, 14342, 14348, 14552, 14558, 14606, 14636, 12728, 12733, 12738, 12743, 12748, 12753, 13084, 13089, 13094, 13424, 13429, 13434, 13439, 13444, 13604, 15573, 15578, 15583, 15588, 15593, 15598, 15603, 15608, 15477, 15481, 15485, 15489, 0,
- 14746, 14354, 14360, 14366, 14372, 14378, 14384, 14390, 14396, 14582, 14630, 14672, 12758, 12763, 12768, 12773, 12778, 12783, 13099, 13104, 13449, 13454, 13459, 13464, 15493, 15497, 15501, 15505, 0,
- 14414, 14420, 14426, 14432, 14438, 14444, 14450, 14594, 14624, 14654, 14714, 13134, 13469, 13474, 13479, 13484, 13489, 13609, 13614, 12788, 12793, 12798, 12803, 12808, 12813, 13109, 13114, 13119, 13124, 13129, 15509, 15513, 15517, 15521, 0,
- 14402, 14408, 12823, 12828, 12833, 13494, 13504, 13499, 12818, 15525, 15529, 15533, 15537, 0,
- 14774, 1963, 15541, 15545, 0,
- 12878, 13139, 12299, 12303, 15549, 15553, 0,
- 14456, 14462, 14564, 14570, 14576, 12858, 12863, 13144, 13149, 13154, 13159, 13164, 13169, 13509, 13514, 13519, 13524, 13529, 13619, 13624, 1973, 12838, 12843, 12848, 12853, 15557, 15561, 15565, 15569, 0,
- 11823, 11827, 0,
- 12255, 0,
- 11911, 11915, 11919, 11923, 0,
- 11879, 11883, 11887, 11891, 0,
- 11831, 11835, 11839, 11843, 0,
- 11847, 11851, 11855, 11859, 0,
- 11895, 11899, 11903, 11907, 0,
- 11863, 11867, 11871, 11875, 0,
- 11975, 11979, 11983, 11987, 0,
- 11959, 11963, 11967, 11971, 0,
- 11991, 11995, 11999, 12003, 0,
- 12007, 12011, 12015, 12019, 0,
- 12047, 12051, 0,
- 12031, 12035, 0,
- 12023, 12027, 0,
- 12039, 12043, 0,
- 12063, 12067, 0,
- 12055, 12059, 0,
- 11927, 11931, 11935, 11939, 0,
- 11943, 11947, 11951, 11955, 0,
- 12071, 12075, 12079, 12083, 0,
- 12215, 12219, 12223, 12227, 0,
- 12087, 12091, 12095, 12099, 0,
- 12119, 12123, 12127, 12131, 0,
- 12103, 12107, 12111, 12115, 0,
- 12135, 12139, 0,
- 12143, 12147, 12151, 12155, 0,
- 12183, 12187, 12191, 12195, 0,
- 12159, 12163, 0,
- 2003, 12167, 12171, 12175, 12179, 0,
- 12267, 12271, 0,
- 12239, 12243, 0,
- 12231, 12235, 0,
- 12247, 12251, 0,
- 12275, 12279, 0,
- 12259, 12263, 0,
- 12397, 12401, 12405, 12409, 0,
- 12283, 12287, 12291, 12295, 0,
- 2008, 12199, 12203, 0,
- 12207, 12211, 0,
- 1998, 0,
- 2028, 0,
- 2033, 0,
- 2038, 0,
- 2043, 0,
- 2048, 0,
- 2053, 0,
- 2013, 0,
- 2058, 0,
- 2063, 0,
- 2018, 0,
- 2023, 0,
- 2078, 0,
- 2083, 0,
- 2088, 0,
- 2068, 2073, 0,
- 2103, 0,
- 2108, 0,
- 2113, 0,
- 2118, 0,
- 2093, 0,
- 2098, 0,
- 2138, 0,
- 2143, 0,
- 2123, 2128, 2133, 0,
- 2148, 0,
- 2153, 2163, 0,
- 2158, 0,
- 2168, 0,
- 2173, 0,
- 2178, 2183, 2188, 0,
- 2193, 0,
- 2198, 2208, 0,
- 2203, 0,
- 2213, 2218, 2228, 0,
- 2223, 0,
- 2282, 0,
- 2257, 0,
- 2262, 0,
- 2267, 0,
- 2272, 0,
- 2277, 0,
- 2287, 2292, 2317, 0,
- 2347, 0,
- 2322, 0,
- 2327, 0,
- 2332, 0,
- 2337, 0,
- 2342, 0,
- 2297, 0,
- 2307, 0,
- 2352, 0,
- 2637, 0,
- 2642, 0,
- 2817, 0,
- 2822, 0,
- 2877, 0,
- 2882, 0,
- 3197, 3247, 0,
- 3202, 3252, 0,
- 3327, 0,
- 3332, 0,
- 3417, 0,
- 3422, 0,
- 3597, 3607, 3617, 4150, 0,
- 3602, 3612, 3622, 4155, 0,
- 4160, 0,
- 4165, 0,
- 4170, 0,
- 4175, 0,
- 4180, 0,
- 4185, 0,
- 3637, 3647, 3657, 4190, 0,
- 3642, 3652, 3662, 4195, 0,
- 4200, 0,
- 4205, 0,
- 4210, 0,
- 4215, 0,
- 4220, 0,
- 4225, 0,
- 3677, 3687, 0,
- 3682, 3692, 0,
- 3707, 3717, 0,
- 3712, 3722, 0,
- 3737, 3747, 3757, 4230, 0,
- 3742, 3752, 3762, 4235, 0,
- 4240, 0,
- 4245, 0,
- 4250, 0,
- 4255, 0,
- 4260, 0,
- 4265, 0,
- 3777, 3787, 3797, 4270, 0,
- 3782, 3792, 3802, 4275, 0,
- 4280, 0,
- 4285, 0,
- 4290, 0,
- 4295, 0,
- 4300, 0,
- 4305, 0,
- 3817, 3827, 3837, 0,
- 3822, 3832, 3842, 0,
- 3857, 3867, 3877, 0,
- 3862, 3872, 3882, 0,
- 3897, 3907, 0,
- 3902, 3912, 0,
- 3927, 3937, 0,
- 3932, 3942, 0,
- 3957, 3967, 3977, 0,
- 3962, 3972, 3982, 0,
- 3992, 3997, 4002, 0,
- 4017, 4027, 4037, 4310, 0,
- 4022, 4032, 4042, 4315, 0,
- 4320, 0,
- 4325, 0,
- 4330, 0,
- 4335, 0,
- 4340, 0,
- 4345, 0,
- 4057, 4067, 4077, 4350, 0,
- 4062, 4072, 4082, 4355, 0,
- 4360, 0,
- 4365, 0,
- 4370, 0,
- 4375, 0,
- 4380, 0,
- 4385, 0,
- 4400, 0,
- 4473, 0,
- 4675, 0,
- 4420, 0,
- 4521, 4526, 4531, 0,
- 4493, 0,
- 4695, 0,
- 4584, 4589, 4594, 0,
- 5391, 0,
- 5396, 0,
- 5401, 0,
- 5406, 0,
- 5416, 0,
- 5411, 0,
- 5421, 0,
- 5426, 0,
- 5431, 0,
- 5436, 0,
- 5441, 0,
- 5468, 0,
- 5473, 0,
- 5478, 0,
- 5483, 0,
- 5498, 0,
- 5493, 0,
- 5513, 0,
- 5518, 0,
- 5523, 0,
- 5528, 0,
- 5533, 0,
- 5538, 0,
- 5543, 0,
- 5548, 0,
- 5593, 0,
- 5598, 0,
- 5553, 0,
- 5558, 0,
- 5563, 0,
- 5568, 0,
- 5603, 0,
- 5608, 0,
- 5573, 0,
- 5578, 0,
- 5583, 0,
- 5588, 0,
- 5613, 0,
- 5618, 0,
- 5623, 0,
- 5628, 0,
- 7351, 0,
- 7226, 0,
- 7231, 0,
- 7236, 0,
- 7241, 0,
- 7246, 0,
- 7251, 0,
- 7256, 0,
- 7261, 0,
- 7266, 0,
- 7271, 0,
- 7276, 0,
- 7281, 0,
- 7286, 0,
- 7291, 0,
- 7296, 0,
- 7301, 7306, 0,
- 7311, 7316, 0,
- 7321, 7326, 0,
- 7331, 7336, 0,
- 7341, 7346, 0,
- 7366, 0,
- 7496, 0,
- 7371, 0,
- 7376, 0,
- 7381, 0,
- 7386, 0,
- 7391, 0,
- 7396, 0,
- 7401, 0,
- 7406, 0,
- 7411, 0,
- 7416, 0,
- 7421, 0,
- 7426, 0,
- 7431, 0,
- 7436, 0,
- 7441, 0,
- 7446, 7451, 0,
- 7456, 7461, 0,
- 7466, 7471, 0,
- 7476, 7481, 0,
- 7486, 7491, 0,
- 7501, 0,
- 7506, 0,
- 7511, 0,
- 7516, 0,
- 7521, 0,
- 11668, 11673, 0,
-
-};
-
-static const Q_UINT16 li_00[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 16, 18, 20, 0,
- 0, 22, 39, 43, 49, 56, 74, 76,
- 84, 92, 108, 110, 116, 123, 127, 137,
- 154, 0, 157, 166, 174, 182, 202, 205,
- 212, 215, 225, 0, 0, 0, 0, 0,
- 0, 232, 249, 253, 259, 266, 284, 286,
- 294, 303, 318, 321, 327, 334, 338, 348,
- 365, 0, 368, 377, 385, 394, 414, 417,
- 425, 428, 439, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 446, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 450, 0, 455, 457, 459, 462,
- 0, 0, 464, 0, 0, 0, 0, 469,
- 0, 0, 0, 0, 471, 476, 480, 0,
- 482, 0, 0, 0, 484, 0, 0, 0,
- 0, 0, 489, 0, 494, 496, 498, 501,
- 0, 0, 503, 0, 0, 0, 0, 508,
- 0, 0, 0, 0, 510, 515, 519, 0,
- 521, 0, 0, 0, 523, 0, 0, 0,
-};
-
-static const Q_UINT16 li_01[] = {
- 0, 0, 528, 533, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 538, 541, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 544, 547, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 550, 552, 0, 0, 0, 0,
- 554, 556, 0, 0, 0, 0, 0, 0,
- 558, 560, 562, 564, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 566,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 568, 574, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 580,
- 586, 0, 0, 0, 0, 0, 0, 592,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 594, 596, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 li_02[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 598, 600,
- 602, 604, 0, 0, 0, 0, 606, 608,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 610, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 li_03[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 612, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 614, 0, 0, 0, 622, 0, 627,
- 0, 633, 0, 0, 0, 0, 0, 641,
- 0, 646, 0, 0, 0, 648, 0, 0,
- 0, 655, 0, 0, 661, 0, 663, 0,
- 0, 665, 0, 0, 0, 674, 0, 679,
- 0, 686, 0, 0, 0, 0, 0, 695,
- 0, 700, 0, 0, 0, 703, 0, 0,
- 0, 712, 719, 723, 0, 0, 727, 0,
- 0, 0, 729, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 li_04[] = {
- 0, 0, 0, 0, 0, 0, 732, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 734, 0, 0, 737, 0, 739, 743, 746,
- 748, 0, 753, 0, 0, 0, 755, 0,
- 0, 0, 0, 757, 0, 0, 0, 762,
- 0, 0, 0, 764, 0, 766, 0, 0,
- 768, 0, 0, 771, 0, 773, 777, 780,
- 782, 0, 787, 0, 0, 0, 789, 0,
- 0, 0, 0, 791, 0, 0, 0, 796,
- 0, 0, 0, 798, 0, 800, 0, 0,
- 0, 0, 0, 0, 0, 0, 802, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 804, 806, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 808, 810, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 812, 814, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 li_05[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 816, 820, 823, 825, 827, 829, 832, 0,
- 834, 836, 839, 841, 844, 0, 846, 0,
- 848, 850, 0, 852, 854, 0, 857, 859,
- 861, 863, 867, 0, 0, 0, 0, 0,
- 0, 0, 869, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 li_06[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 871, 873, 876, 879, 882, 885, 926,
- 936, 962, 965, 1003, 1021, 1041, 1057, 1071,
- 1074, 1078, 1083, 1086, 1121, 1158, 1183, 1206,
- 1224, 1232, 1252, 0, 0, 0, 0, 0,
- 1268, 1278, 1298, 1316, 1344, 1386, 1415, 1450,
- 1464, 1469, 1476, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1506, 0, 0, 0, 0, 0, 1509,
- 0, 1511, 1516, 1521, 0, 0, 1526, 1531,
- 1536, 0, 0, 1541, 1546, 0, 1551, 1556,
- 1561, 0, 0, 0, 1564, 1567, 1570, 0,
- 0, 1573, 0, 0, 0, 0, 0, 0,
- 1576, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1579, 0, 1584, 0,
- 0, 1589, 0, 0, 0, 1594, 0, 1599,
- 0, 1604, 0, 1609, 0, 0, 0, 0,
- 0, 0, 1614, 1617, 0, 0, 1622, 0,
- 1627, 1630, 0, 0, 0, 1636, 1639, 1642,
- 1645, 1648, 0, 1651, 1654, 0, 0, 0,
- 1659, 0, 1664, 1668, 0, 1671, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 li_07[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 li_09[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1673, 1675, 1677,
- 0, 0, 0, 0, 1679, 0, 0, 0,
- 0, 1681, 1683, 0, 0, 0, 0, 0,
- 1685, 0, 0, 1687, 0, 0, 0, 1689,
- 1691, 0, 0, 1693, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1695, 1697, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1699,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1701,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 li_0A[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1704, 1706,
- 0, 0, 0, 0, 1708, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1710, 0, 0, 0, 0,
- 0, 0, 1712, 0, 0, 0, 0, 0,
- 1714, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 li_0B[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1716, 1718, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1720,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1724, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1726, 1729,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 li_0C[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1731, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1733,
- 0, 0, 0, 0, 0, 0, 1735, 0,
- 0, 0, 1739, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 li_0D[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1741, 1744,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1746, 0, 0, 1750, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 li_0F[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1752, 0, 1754, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1756, 0, 0, 0,
- 0, 1758, 0, 0, 0, 0, 1760, 0,
- 0, 0, 0, 1762, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 1764, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1768, 0, 1770, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1772, 0, 0, 0,
- 0, 1774, 0, 0, 0, 0, 1776, 0,
- 0, 0, 0, 1778, 0, 0, 0, 0,
- 0, 0, 1780, 1782, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 li_10[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1784, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 li_1E[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 1786, 1788,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 1790, 1792, 0, 0, 0, 0,
- 0, 0, 1794, 1796, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1798, 1801, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1804, 1806, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 1808, 1810, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 li_1F[] = {
- 1812, 1817, 1822, 1824, 1826, 1828, 1830, 1832,
- 1834, 1839, 1844, 1846, 1848, 1850, 1852, 1854,
- 1856, 1859, 0, 0, 0, 0, 0, 0,
- 1862, 1865, 0, 0, 0, 0, 0, 0,
- 1868, 1873, 1878, 1880, 1882, 1884, 1886, 1888,
- 1890, 1895, 1900, 1902, 1904, 1906, 1908, 1910,
- 1912, 1916, 0, 0, 0, 0, 0, 0,
- 1920, 1924, 0, 0, 0, 0, 0, 0,
- 1928, 1931, 0, 0, 0, 0, 0, 0,
- 1934, 1937, 0, 0, 0, 0, 0, 0,
- 1940, 1944, 0, 0, 0, 0, 0, 0,
- 0, 1948, 0, 0, 0, 0, 0, 0,
- 1952, 1957, 1962, 1964, 1966, 1968, 1970, 1972,
- 1974, 1979, 1984, 1986, 1988, 1990, 1992, 1994,
- 1996, 0, 0, 0, 1998, 0, 0, 0,
- 0, 0, 0, 0, 2000, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 2002, 0,
- 0, 0, 0, 0, 0, 0, 0, 2004,
- 0, 0, 0, 0, 0, 0, 2008, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 2010, 0,
- 0, 0, 0, 0, 0, 0, 2012, 0,
-};
-
-static const Q_UINT16 li_21[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 2016, 0, 2018, 0, 2020, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 2022, 0, 2024, 0, 2026, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 li_22[] = {
- 0, 0, 0, 2028, 0, 0, 0, 0,
- 2030, 0, 0, 2032, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 2034, 0, 2036, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 2038, 0, 0, 0,
- 0, 0, 0, 2040, 0, 2042, 0, 0,
- 2044, 0, 0, 0, 0, 2046, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 2048, 0, 0, 2050, 2052, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 2054, 2056, 0, 0, 2058, 2060,
- 0, 0, 2062, 2064, 2066, 2068, 0, 0,
- 0, 0, 2070, 2072, 0, 0, 2074, 2076,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 2078, 2080, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 2082, 0, 0, 0, 0, 0,
- 2084, 2086, 0, 2088, 0, 0, 0, 0,
- 0, 0, 2090, 2092, 2094, 2096, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 li_30[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 2098, 0,
- 0, 0, 0, 2100, 0, 2102, 0, 2104,
- 0, 2106, 0, 2108, 0, 2110, 0, 2112,
- 0, 2114, 0, 2116, 0, 2118, 0, 2120,
- 0, 2122, 0, 0, 2124, 0, 2126, 0,
- 2128, 0, 0, 0, 0, 0, 0, 2130,
- 0, 0, 2133, 0, 0, 2136, 0, 0,
- 2139, 0, 0, 2142, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 2145, 0, 0,
- 0, 0, 0, 0, 0, 0, 2147, 0,
- 0, 0, 0, 2149, 0, 2151, 0, 2153,
- 0, 2155, 0, 2157, 0, 2159, 0, 2161,
- 0, 2163, 0, 2165, 0, 2167, 0, 2169,
- 0, 2171, 0, 0, 2173, 0, 2175, 0,
- 2177, 0, 0, 0, 0, 0, 0, 2179,
- 0, 0, 2182, 0, 0, 2185, 0, 0,
- 2188, 0, 0, 2191, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 2194,
- 2196, 2198, 2200, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 2202, 0, 0,
-};
-
-static const Q_UINT16 li_FB[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 2204, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 * const ligature_info[256] = {
- li_00, li_01, li_02, li_03, li_04, li_05, li_06, li_07,
- li_07, li_09, li_0A, li_0B, li_0C, li_0D, li_07, li_0F,
- li_10, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_1E, li_1F,
- li_07, li_21, li_22, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_30, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_07, li_07, li_07, li_07, li_07,
- li_07, li_07, li_07, li_FB, li_07, li_07, li_07, li_07,
-};
-// 16188 bytes
-
-static const Q_UINT8 dir_00[] = {
- 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 8, 7, 8, 9, 7, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 7, 7, 7, 8,
- 9, 10, 10, 4, 4, 4, 10, 10,
- 138, 138, 10, 4, 6, 4, 6, 3,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 6, 10, 138, 10, 138, 10,
- 10, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 138, 10, 138, 10, 10,
- 10, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 138, 10, 138, 10, 18,
- 18, 18, 18, 18, 18, 7, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18,
- 18, 18, 18, 18, 18, 18, 18, 18,
- 6, 10, 4, 4, 4, 4, 10, 10,
- 10, 10, 0, 138, 10, 10, 10, 10,
- 4, 4, 2, 2, 10, 0, 10, 10,
- 10, 2, 0, 138, 10, 10, 10, 10,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 10,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 10,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_01[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_02[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 10, 10, 0, 0, 0, 0, 0,
- 0, 0, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 0, 0, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 0, 0, 0, 0, 0, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_03[] = {
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 17, 17, 17, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 10, 10, 0, 0,
- 0, 0, 0, 0, 0, 0, 10, 0,
- 0, 0, 0, 0, 10, 10, 0, 10,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_04[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 17, 17, 17, 17, 0,
- 17, 17, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_05[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 10, 0, 0, 0, 0, 0,
- 0, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 0, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 0, 17, 17, 17, 1, 17,
- 1, 17, 17, 1, 17, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 0, 0, 0, 0, 0,
- 1, 1, 1, 1, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_06[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 6, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 13, 0, 0, 0, 13,
- 0, 13, 77, 77, 77, 77, 45, 77,
- 45, 77, 45, 45, 45, 45, 45, 77,
- 77, 77, 77, 45, 45, 45, 45, 45,
- 45, 45, 45, 0, 0, 0, 0, 0,
- 109, 45, 45, 45, 45, 45, 45, 45,
- 77, 77, 45, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 5, 5, 5, 5, 5, 5, 5, 5,
- 5, 5, 4, 5, 5, 13, 0, 0,
- 17, 13, 77, 77, 13, 77, 77, 77,
- 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45,
- 77, 77, 77, 77, 77, 77, 77, 77,
- 77, 77, 77, 77, 77, 77, 77, 77,
- 77, 77, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45,
- 45, 45, 45, 45, 45, 45, 45, 45,
- 77, 45, 77, 77, 77, 77, 77, 77,
- 77, 77, 77, 77, 45, 77, 45, 77,
- 45, 45, 77, 77, 13, 13, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 13, 13, 17,
- 17, 10, 17, 17, 17, 17, 0, 0,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 45, 45, 45, 13, 13, 0,
-};
-
-static const Q_UINT8 dir_07[] = {
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 0, 18,
- 77, 17, 45, 45, 45, 77, 77, 77,
- 77, 77, 45, 45, 45, 45, 77, 45,
- 45, 45, 45, 45, 45, 45, 45, 45,
- 77, 45, 77, 45, 77, 0, 0, 0,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_09[] = {
- 0, 17, 17, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 17, 0, 0, 0,
- 0, 17, 17, 17, 17, 17, 17, 17,
- 17, 0, 0, 0, 0, 17, 0, 0,
- 0, 17, 17, 17, 17, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 17, 17, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 17, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 17, 0, 0, 0,
- 0, 17, 17, 17, 17, 0, 0, 0,
- 0, 0, 0, 0, 0, 17, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 17, 17, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 4, 4, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_0A[] = {
- 0, 0, 17, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 17, 0, 0, 0,
- 0, 17, 17, 0, 0, 0, 0, 17,
- 17, 0, 0, 17, 17, 17, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 17, 17, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 17, 17, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 17, 0, 0, 0,
- 0, 17, 17, 17, 17, 17, 0, 17,
- 17, 0, 0, 0, 0, 17, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_0B[] = {
- 0, 17, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 17, 0, 0, 17,
- 0, 17, 17, 17, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 17, 0, 0,
- 0, 0, 0, 0, 0, 0, 17, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 17, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 17, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 17, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_0C[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 17, 17,
- 17, 0, 0, 0, 0, 0, 17, 17,
- 17, 0, 17, 17, 17, 17, 0, 0,
- 0, 0, 0, 0, 0, 17, 17, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 17,
- 0, 0, 0, 0, 0, 0, 17, 0,
- 0, 0, 0, 0, 17, 17, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_0D[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 17, 17, 17, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 17, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 17, 0, 0, 0, 0, 0,
- 0, 0, 17, 17, 17, 0, 17, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_0E[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 17, 0, 0, 17, 17, 17, 17,
- 17, 17, 17, 0, 0, 0, 0, 4,
- 0, 0, 0, 0, 0, 0, 0, 17,
- 17, 17, 17, 17, 17, 17, 17, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 17, 0, 0, 17, 17, 17, 17,
- 17, 17, 0, 17, 17, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 17, 17, 17, 17, 17, 17, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_0F[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 17, 17, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 17, 0, 17,
- 0, 17, 10, 10, 10, 10, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 0,
- 17, 17, 17, 17, 17, 0, 17, 17,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 0, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 17, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_10[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 17, 17, 17,
- 17, 0, 17, 0, 0, 0, 17, 17,
- 0, 17, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 17, 17, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_16[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 9, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 10, 10, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_17[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 17,
- 17, 17, 17, 17, 17, 17, 0, 0,
- 0, 0, 0, 0, 0, 0, 17, 0,
- 0, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 0, 0, 0, 0,
- 0, 0, 0, 4, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_18[] = {
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 18, 18, 18, 18, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 17, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_1F[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 10, 0, 10,
- 10, 10, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 10, 10, 10,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 10, 10, 10,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 10, 10, 10,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 10, 10, 0,
-};
-
-static const Q_UINT8 dir_20[] = {
- 9, 9, 9, 9, 9, 9, 9, 9,
- 9, 9, 9, 18, 18, 18, 0, 1,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 9, 7, 11, 14, 16, 12, 15, 9,
- 4, 4, 4, 4, 4, 10, 10, 10,
- 10, 138, 138, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 138, 138, 0,
- 10, 10, 10, 10, 10, 10, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 18, 18, 18, 18, 18, 18,
- 2, 0, 0, 0, 2, 2, 2, 2,
- 2, 2, 4, 4, 10, 138, 138, 0,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 4, 4, 10, 138, 138, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 17, 17, 17, 17,
- 17, 17, 17, 17, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_21[] = {
- 10, 10, 0, 10, 10, 10, 10, 0,
- 10, 10, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 10, 0, 10, 10,
- 10, 0, 0, 0, 0, 0, 10, 10,
- 10, 10, 10, 10, 0, 10, 0, 10,
- 0, 10, 0, 0, 0, 0, 4, 0,
- 0, 0, 10, 0, 0, 0, 0, 0,
- 0, 0, 10, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_22[] = {
- 10, 138, 138, 138, 138, 10, 10, 10,
- 138, 138, 138, 138, 138, 138, 10, 10,
- 10, 138, 4, 4, 10, 138, 138, 10,
- 10, 10, 138, 138, 138, 138, 10, 138,
- 138, 138, 138, 10, 138, 10, 138, 10,
- 10, 10, 10, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 10, 10, 10, 10,
- 10, 138, 10, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 10, 10, 10,
- 10, 10, 138, 138, 138, 138, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 138,
- 138, 10, 138, 10, 138, 138, 138, 138,
- 138, 138, 138, 138, 10, 10, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 10, 10, 138,
- 138, 138, 138, 10, 10, 10, 10, 10,
- 138, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 138, 138, 10, 10, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 10, 10, 10, 10, 10, 138, 138,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 138, 138, 138, 138, 138, 10, 10,
- 138, 138, 10, 10, 10, 10, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 138, 138, 138, 138, 10, 10,
- 138, 138, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_23[] = {
- 10, 10, 10, 10, 10, 10, 10, 10,
- 138, 138, 138, 138, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 138, 138, 10, 10, 10, 10, 10, 10,
- 10, 138, 138, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 10, 0, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 0, 10, 10,
- 10, 10, 10, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_24[] = {
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 2, 2, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 2, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_25[] = {
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_26[] = {
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 0, 0, 0, 0,
- 0, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_27[] = {
- 0, 10, 10, 10, 10, 0, 10, 10,
- 10, 10, 0, 0, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 0, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 0, 10, 0, 10,
- 10, 10, 10, 0, 0, 0, 10, 0,
- 10, 10, 10, 10, 10, 10, 10, 0,
- 0, 10, 10, 10, 10, 10, 10, 10,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 0, 0, 0,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 0, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_28[] = {
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
-};
-
-static const Q_UINT8 dir_2E[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 0, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_2F[] = {
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_30[] = {
- 9, 10, 10, 10, 10, 0, 0, 0,
- 138, 138, 138, 138, 138, 138, 138, 138,
- 138, 138, 10, 10, 138, 138, 138, 138,
- 138, 138, 138, 138, 10, 10, 10, 10,
- 10, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 17, 17, 17, 17, 17, 17,
- 10, 0, 0, 0, 0, 0, 10, 10,
- 0, 0, 0, 0, 0, 0, 10, 10,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 17, 17, 10, 10, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 10, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_A4[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 0, 0, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 0, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 0, 10, 10, 10, 0, 10, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_FB[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 17, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 4, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 0,
- 1, 1, 1, 1, 1, 0, 1, 0,
- 1, 1, 0, 1, 1, 0, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
-};
-
-static const Q_UINT8 dir_FC[] = {
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
-};
-
-static const Q_UINT8 dir_FD[] = {
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 10, 10,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 0, 0, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 0, 0, 0, 0,
-};
-
-static const Q_UINT8 dir_FE[] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 17, 17, 17, 17, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 10,
- 10, 10, 10, 10, 10, 0, 0, 0,
- 0, 10, 10, 10, 10, 10, 10, 10,
- 6, 10, 6, 0, 10, 6, 10, 10,
- 10, 10, 10, 10, 10, 10, 10, 4,
- 10, 10, 4, 4, 10, 10, 10, 0,
- 10, 4, 4, 10, 0, 0, 0, 0,
- 13, 13, 13, 0, 13, 0, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 13, 13, 13,
- 13, 13, 13, 13, 13, 0, 0, 18,
-};
-
-static const Q_UINT8 dir_FF[] = {
- 0, 10, 10, 4, 4, 4, 10, 10,
- 10, 10, 10, 4, 6, 4, 6, 3,
- 2, 2, 2, 2, 2, 2, 2, 2,
- 2, 2, 6, 10, 10, 10, 10, 10,
- 10, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 10, 10, 10, 10, 10,
- 10, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 10, 10, 10, 10, 0,
- 0, 10, 10, 10, 10, 10, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 4, 4, 10, 10, 10, 4, 4, 0,
- 10, 10, 10, 10, 10, 10, 10, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 18, 18, 18, 10, 10, 0, 0,
-};
-
-static const Q_UINT8 * const direction_info[256] = {
- dir_00, dir_01, dir_02, dir_03, dir_04, dir_05, dir_06, dir_07,
- dir_01, dir_09, dir_0A, dir_0B, dir_0C, dir_0D, dir_0E, dir_0F,
- dir_10, dir_01, dir_01, dir_01, dir_01, dir_01, dir_16, dir_17,
- dir_18, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_1F,
- dir_20, dir_21, dir_22, dir_23, dir_24, dir_25, dir_26, dir_27,
- dir_28, dir_01, dir_01, dir_01, dir_01, dir_01, dir_2E, dir_2F,
- dir_30, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_A4, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01, dir_01,
- dir_01, dir_01, dir_01, dir_FB, dir_FC, dir_FD, dir_FE, dir_FF,
-};
-// 26940 bytes
-
-#endif
-
-// END OF GENERATED DATA
-
-// This is generated too. Script?
-
-#ifndef QT_NO_UNICODETABLES
-
-static const Q_UINT16 case_0 [] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67,
- 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
- 0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77,
- 0x78, 0x79, 0x7a, 0, 0, 0, 0, 0,
- 0, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47,
- 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f,
- 0x50, 0x51, 0x52, 0x53, 0x54, 0x55, 0x56, 0x57,
- 0x58, 0x59, 0x5a, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0x0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0x0, 0, 0,
- 0, 0, 0x0, 0, 0, 0, 0, 0,
- 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
- 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
- 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0,
- 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0x0,
- 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
- 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
- 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0,
- 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0x178,
-};
-
-static const Q_UINT16 case_1 [] = {
- 0x101, 0x100, 0x103, 0x102, 0x105, 0x104, 0x107, 0x106,
- 0x109, 0x108, 0x10b, 0x10a, 0x10d, 0x10c, 0x10f, 0x10e,
- 0x111, 0x110, 0x113, 0x112, 0x115, 0x114, 0x117, 0x116,
- 0x119, 0x118, 0x11b, 0x11a, 0x11d, 0x11c, 0x11f, 0x11e,
- 0x121, 0x120, 0x123, 0x122, 0x125, 0x124, 0x127, 0x126,
- 0x129, 0x128, 0x12b, 0x12a, 0x12d, 0x12c, 0x12f, 0x12e,
- 0x69, 0x49, 0x133, 0x132, 0x135, 0x134, 0x137, 0x136,
- 0x0, 0x13a, 0x139, 0x13c, 0x13b, 0x13e, 0x13d, 0x140,
- 0x13f, 0x142, 0x141, 0x144, 0x143, 0x146, 0x145, 0x148,
- 0x147, 0x0, 0x14b, 0x14a, 0x14d, 0x14c, 0x14f, 0x14e,
- 0x151, 0x150, 0x153, 0x152, 0x155, 0x154, 0x157, 0x156,
- 0x159, 0x158, 0x15b, 0x15a, 0x15d, 0x15c, 0x15f, 0x15e,
- 0x161, 0x160, 0x163, 0x162, 0x165, 0x164, 0x167, 0x166,
- 0x169, 0x168, 0x16b, 0x16a, 0x16d, 0x16c, 0x16f, 0x16e,
- 0x171, 0x170, 0x173, 0x172, 0x175, 0x174, 0x177, 0x176,
- 0xff, 0x17a, 0x179, 0x17c, 0x17b, 0x17e, 0x17d, 0x53,
- 0x0, 0x253, 0x183, 0x182, 0x185, 0x184, 0x254, 0x188,
- 0x187, 0x256, 0x257, 0x18c, 0x18b, 0x0, 0x1dd, 0x259,
- 0x25b, 0x192, 0x191, 0x260, 0x263, 0x3d9, 0x269, 0x268,
- 0x199, 0x198, 0x51, 0x0, 0x26f, 0x272, 0x0, 0x275,
- 0x1a1, 0x1a0, 0x1a3, 0x1a2, 0x1a5, 0x1a4, 0x280, 0x1a8,
- 0x1a7, 0x283, 0, 0x0, 0x1ad, 0x1ac, 0x288, 0x1b0,
- 0x1af, 0x28a, 0x28b, 0x1b4, 0x1b3, 0x1b6, 0x1b5, 0x292,
- 0x1b9, 0x1b8, 0x0, 0, 0x1bd, 0x1bc, 0, 0,
- 0, 0, 0, 0, 0x1c6, 0, 0x1c4, 0x1c9,
- 0, 0x1c7, 0x1cc, 0, 0x1ca, 0x1ce, 0x1cd, 0x1d0,
- 0x1cf, 0x1d2, 0x1d1, 0x1d4, 0x1d3, 0x1d6, 0x1d5, 0x1d8,
- 0x1d7, 0x1da, 0x1d9, 0x1dc, 0x1db, 0x18e, 0x1df, 0x1de,
- 0x1e1, 0x1e0, 0x1e3, 0x1e2, 0x1e5, 0x1e4, 0x1e7, 0x1e6,
- 0x1e9, 0x1e8, 0x1eb, 0x1ea, 0x1ed, 0x1ec, 0x1ef, 0x1ee,
- 0x0, 0x1f3, 0, 0x1f1, 0x1f5, 0x1f4, 0, 0,
- 0, 0, 0x1fb, 0x1fa, 0x1fd, 0x1fc, 0x1ff, 0x1fe,
-};
-
-static const Q_UINT16 case_2 [] = {
- 0x201, 0x200, 0x203, 0x202, 0x205, 0x204, 0x207, 0x206,
- 0x209, 0x208, 0x20b, 0x20a, 0x20d, 0x20c, 0x20f, 0x20e,
- 0x211, 0x210, 0x213, 0x212, 0x215, 0x214, 0x217, 0x216,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0x0, 0x0, 0x0, 0x181, 0x186, 0x0, 0x189, 0x18a,
- 0x0, 0x18f, 0x0, 0x190, 0x0, 0x0, 0x0, 0x0,
- 0x193, 0x0, 0x0, 0x194, 0x0, 0x0, 0x631, 0x579,
- 0x197, 0x196, 0x0, 0x0, 0x0, 0x0, 0x0, 0x19c,
- 0x0, 0x0, 0x19d, 0x0, 0x0, 0x19f, 0x0, 0x0,
- 0x0, 0x0, 0x7e1, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x1a6, 0x0, 0x0, 0x1a9, 0x0, 0x0, 0x0, 0x0,
- 0x1ae, 0x0, 0x1b1, 0x1b2, 0x0, 0xa21, 0x971, 0x0,
- 0x0, 0x0, 0x1b7, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 case_3 [] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0x3ac, 0,
- 0x3ad, 0x3ae, 0x3af, 0, 0x3cc, 0, 0x3cd, 0x3ce,
- 0x0, 0x3b1, 0x3b2, 0x3b3, 0x3b4, 0x3b5, 0x3b6, 0x3b7,
- 0x3b8, 0x3b9, 0x3ba, 0x3bb, 0x3bc, 0x3bd, 0x3be, 0x3bf,
- 0x3c0, 0x3c1, 0, 0x3c3, 0x3c4, 0x3c5, 0x3c6, 0x3c7,
- 0x3c8, 0x3c9, 0x3ca, 0x3cb, 0x386, 0x388, 0x389, 0x38a,
- 0x0, 0x391, 0x392, 0x393, 0x394, 0x395, 0x396, 0x397,
- 0x398, 0x399, 0x39a, 0x39b, 0x39c, 0x39d, 0x39e, 0x39f,
- 0x3a0, 0x3a1, 0x3a3, 0x3a3, 0x3a4, 0x3a5, 0x3a6, 0x3a7,
- 0x3a8, 0x3a9, 0x3aa, 0x3ab, 0x38c, 0x38e, 0x38f, 0,
- 0x392, 0x398, 0x0, 0x0, 0x0, 0x3a6, 0x3a0, 0,
- 0, 0, 0x0, 0, 0x0, 0, 0x0, 0,
- 0x0, 0, 0x3e3, 0x3e2, 0x3e5, 0x3e4, 0x3e7, 0x3e6,
- 0x3e9, 0x3e8, 0x3eb, 0x3ea, 0x3ed, 0x3ec, 0x3ef, 0x3ee,
- 0x39a, 0x3a1, 0x3a3, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 case_4 [] = {
- 0, 0x451, 0x452, 0x453, 0x454, 0x455, 0x456, 0x457,
- 0x458, 0x459, 0x45a, 0x45b, 0x45c, 0, 0x45e, 0x45f,
- 0x430, 0x431, 0x432, 0x433, 0x434, 0x435, 0x436, 0x437,
- 0x438, 0x439, 0x43a, 0x43b, 0x43c, 0x43d, 0x43e, 0x43f,
- 0x440, 0x441, 0x442, 0x443, 0x444, 0x445, 0x446, 0x447,
- 0x448, 0x449, 0x44a, 0x44b, 0x44c, 0x44d, 0x44e, 0x44f,
- 0x410, 0x411, 0x412, 0x413, 0x414, 0x415, 0x416, 0x417,
- 0x418, 0x419, 0x41a, 0x41b, 0x41c, 0x41d, 0x41e, 0x41f,
- 0x420, 0x421, 0x422, 0x423, 0x424, 0x425, 0x426, 0x427,
- 0x428, 0x429, 0x42a, 0x42b, 0x42c, 0x42d, 0x42e, 0x42f,
- 0, 0x401, 0x402, 0x403, 0x404, 0x405, 0x406, 0x407,
- 0x408, 0x409, 0x40a, 0x40b, 0x40c, 0, 0x40e, 0x40f,
- 0x461, 0x460, 0x463, 0x462, 0x465, 0x464, 0x467, 0x466,
- 0x469, 0x468, 0x46b, 0x46a, 0x46d, 0x46c, 0x46f, 0x46e,
- 0x471, 0x470, 0x473, 0x472, 0x475, 0x474, 0x477, 0x476,
- 0x479, 0x478, 0x47b, 0x47a, 0x47d, 0x47c, 0x47f, 0x47e,
- 0x481, 0x480, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0x491, 0x490, 0x493, 0x492, 0x495, 0x494, 0x497, 0x496,
- 0x499, 0x498, 0x49b, 0x49a, 0x49d, 0x49c, 0x49f, 0x49e,
- 0x4a1, 0x4a0, 0x4a3, 0x4a2, 0x4a5, 0x4a4, 0x4a7, 0x4a6,
- 0x4a9, 0x4a8, 0x4ab, 0x4aa, 0x4ad, 0x4ac, 0x4af, 0x4ae,
- 0x4b1, 0x4b0, 0x4b3, 0x4b2, 0x4b5, 0x4b4, 0x4b7, 0x4b6,
- 0x4b9, 0x4b8, 0x4bb, 0x4ba, 0x4bd, 0x4bc, 0x4bf, 0x4be,
- 0, 0x4c2, 0x4c1, 0x4c4, 0x4c3, 0, 0, 0x4c8,
- 0x4c7, 0, 0, 0x4cc, 0x4cb, 0, 0, 0,
- 0x4d1, 0x4d0, 0x4d3, 0x4d2, 0x4d5, 0x4d4, 0x4d7, 0x4d6,
- 0x4d9, 0x4d8, 0x4db, 0x4da, 0x4dd, 0x4dc, 0x4df, 0x4de,
- 0x4e1, 0x4e0, 0x4e3, 0x4e2, 0x4e5, 0x4e4, 0x4e7, 0x4e6,
- 0x4e9, 0x4e8, 0x4eb, 0x4ea, 0, 0, 0x4ef, 0x4ee,
- 0x4f1, 0x4f0, 0x4f3, 0x4f2, 0x4f5, 0x4f4, 0, 0,
- 0x4f9, 0x4f8, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 case_5 [] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0x561, 0x562, 0x563, 0x564, 0x565, 0x566, 0x567,
- 0x568, 0x569, 0x56a, 0x56b, 0x56c, 0x56d, 0x56e, 0x56f,
- 0x570, 0x571, 0x572, 0x573, 0x574, 0x575, 0x576, 0x577,
- 0x578, 0x579, 0x57a, 0x57b, 0x57c, 0x57d, 0x57e, 0x57f,
- 0x580, 0x581, 0x582, 0x583, 0x584, 0x585, 0x586, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0x531, 0x532, 0x533, 0x534, 0x535, 0x536, 0x537,
- 0x538, 0x539, 0x53a, 0x53b, 0x53c, 0x53d, 0x53e, 0x53f,
- 0x540, 0x541, 0x542, 0x543, 0x544, 0x545, 0x546, 0x547,
- 0x548, 0x549, 0x54a, 0x54b, 0x54c, 0x54d, 0x54e, 0x54f,
- 0x550, 0x551, 0x552, 0x553, 0x554, 0x555, 0x556, 0x0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 case_10 [] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0x10d0, 0x10d1, 0x10d2, 0x10d3, 0x10d4, 0x10d5, 0x10d6, 0x10d7,
- 0x10d8, 0x10d9, 0x10da, 0x10db, 0x10dc, 0x10dd, 0x10de, 0x10df,
- 0x10e0, 0x10e1, 0x10e2, 0x10e3, 0x10e4, 0x10e5, 0x10e6, 0x10e7,
- 0x10e8, 0x10e9, 0x10ea, 0x10eb, 0x10ec, 0x10ed, 0x10ee, 0x10ef,
- 0x10f0, 0x10f1, 0x10f2, 0x10f3, 0x10f4, 0x10f5, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 case_1e [] = {
- 0x1e01, 0x1e00, 0x1e03, 0x1e02, 0x1e05, 0x1e04, 0x1e07, 0x1e06,
- 0x1e09, 0x1e08, 0x1e0b, 0x1e0a, 0x1e0d, 0x1e0c, 0x1e0f, 0x1e0e,
- 0x1e11, 0x1e10, 0x1e13, 0x1e12, 0x1e15, 0x1e14, 0x1e17, 0x1e16,
- 0x1e19, 0x1e18, 0x1e1b, 0x1e1a, 0x1e1d, 0x1e1c, 0x1e1f, 0x1e1e,
- 0x1e21, 0x1e20, 0x1e23, 0x1e22, 0x1e25, 0x1e24, 0x1e27, 0x1e26,
- 0x1e29, 0x1e28, 0x1e2b, 0x1e2a, 0x1e2d, 0x1e2c, 0x1e2f, 0x1e2e,
- 0x1e31, 0x1e30, 0x1e33, 0x1e32, 0x1e35, 0x1e34, 0x1e37, 0x1e36,
- 0x1e39, 0x1e38, 0x1e3b, 0x1e3a, 0x1e3d, 0x1e3c, 0x1e3f, 0x1e3e,
- 0x1e41, 0x1e40, 0x1e43, 0x1e42, 0x1e45, 0x1e44, 0x1e47, 0x1e46,
- 0x1e49, 0x1e48, 0x1e4b, 0x1e4a, 0x1e4d, 0x1e4c, 0x1e4f, 0x1e4e,
- 0x1e51, 0x1e50, 0x1e53, 0x1e52, 0x1e55, 0x1e54, 0x1e57, 0x1e56,
- 0x1e59, 0x1e58, 0x1e5b, 0x1e5a, 0x1e5d, 0x1e5c, 0x1e5f, 0x1e5e,
- 0x1e61, 0x1e60, 0x1e63, 0x1e62, 0x1e65, 0x1e64, 0x1e67, 0x1e66,
- 0x1e69, 0x1e68, 0x1e6b, 0x1e6a, 0x1e6d, 0x1e6c, 0x1e6f, 0x1e6e,
- 0x1e71, 0x1e70, 0x1e73, 0x1e72, 0x1e75, 0x1e74, 0x1e77, 0x1e76,
- 0x1e79, 0x1e78, 0x1e7b, 0x1e7a, 0x1e7d, 0x1e7c, 0x1e7f, 0x1e7e,
- 0x1e81, 0x1e80, 0x1e83, 0x1e82, 0x1e85, 0x1e84, 0x1e87, 0x1e86,
- 0x1e89, 0x1e88, 0x1e8b, 0x1e8a, 0x1e8d, 0x1e8c, 0x1e8f, 0x1e8e,
- 0x1e91, 0x1e90, 0x1e93, 0x1e92, 0x1e95, 0x1e94, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x1e60, 0, 0, 0, 0,
- 0x1ea1, 0x1ea0, 0x1ea3, 0x1ea2, 0x1ea5, 0x1ea4, 0x1ea7, 0x1ea6,
- 0x1ea9, 0x1ea8, 0x1eab, 0x1eaa, 0x1ead, 0x1eac, 0x1eaf, 0x1eae,
- 0x1eb1, 0x1eb0, 0x1eb3, 0x1eb2, 0x1eb5, 0x1eb4, 0x1eb7, 0x1eb6,
- 0x1eb9, 0x1eb8, 0x1ebb, 0x1eba, 0x1ebd, 0x1ebc, 0x1ebf, 0x1ebe,
- 0x1ec1, 0x1ec0, 0x1ec3, 0x1ec2, 0x1ec5, 0x1ec4, 0x1ec7, 0x1ec6,
- 0x1ec9, 0x1ec8, 0x1ecb, 0x1eca, 0x1ecd, 0x1ecc, 0x1ecf, 0x1ece,
- 0x1ed1, 0x1ed0, 0x1ed3, 0x1ed2, 0x1ed5, 0x1ed4, 0x1ed7, 0x1ed6,
- 0x1ed9, 0x1ed8, 0x1edb, 0x1eda, 0x1edd, 0x1edc, 0x1edf, 0x1ede,
- 0x1ee1, 0x1ee0, 0x1ee3, 0x1ee2, 0x1ee5, 0x1ee4, 0x1ee7, 0x1ee6,
- 0x1ee9, 0x1ee8, 0x1eeb, 0x1eea, 0x1eed, 0x1eec, 0x1eef, 0x1eee,
- 0x1ef1, 0x1ef0, 0x1ef3, 0x1ef2, 0x1ef5, 0x1ef4, 0x1ef7, 0x1ef6,
- 0x1ef9, 0x1ef8, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 case_1f [] = {
- 0x1f08, 0x1f09, 0x1f0a, 0x1f0b, 0x1f0c, 0x1f0d, 0x1f0e, 0x1f0f,
- 0x1f00, 0x1f01, 0x1f02, 0x1f03, 0x1f04, 0x1f05, 0x1f06, 0x1f07,
- 0x1f18, 0x1f19, 0x1f1a, 0x1f1b, 0x1f1c, 0x1f1d, 0, 0,
- 0x1f10, 0x1f11, 0x1f12, 0x1f13, 0x1f14, 0x1f15, 0, 0,
- 0x1f28, 0x1f29, 0x1f2a, 0x1f2b, 0x1f2c, 0x1f2d, 0x1f2e, 0x1f2f,
- 0x1f20, 0x1f21, 0x1f22, 0x1f23, 0x1f24, 0x1f25, 0x1f26, 0x1f27,
- 0x1f38, 0x1f39, 0x1f3a, 0x1f3b, 0x1f3c, 0x1f3d, 0x1f3e, 0x1f3f,
- 0x1f30, 0x1f31, 0x1f32, 0x1f33, 0x1f34, 0x1f35, 0x1f36, 0x1f37,
- 0x1f48, 0x1f49, 0x1f4a, 0x1f4b, 0x1f4c, 0x1f4d, 0, 0,
- 0x1f40, 0x1f41, 0x1f42, 0x1f43, 0x1f44, 0x1f45, 0, 0,
- 0x0, 0x1f59, 0x0, 0x1f5b, 0x0, 0x1f5d, 0x0, 0x1f5f,
- 0, 0x1f51, 0, 0x1f53, 0, 0x1f55, 0, 0x1f57,
- 0x1f68, 0x1f69, 0x1f6a, 0x1f6b, 0x1f6c, 0x1f6d, 0x1f6e, 0x1f6f,
- 0x1f60, 0x1f61, 0x1f62, 0x1f63, 0x1f64, 0x1f65, 0x1f66, 0x1f67,
- 0x1fba, 0x1fbb, 0x1fc8, 0x1fc9, 0x1fca, 0x1fcb, 0x1fda, 0x1fdb,
- 0x1ff8, 0x1ff9, 0x1fea, 0x1feb, 0x1ffa, 0x1ffb, 0, 0,
- 0x1f88, 0x1f89, 0x1f8a, 0x1f8b, 0x1f8c, 0x1f8d, 0x1f8e, 0x1f8f,
- 0x1f80, 0x1f81, 0x1f82, 0x1f83, 0x1f84, 0x1f85, 0x1f86, 0x1f87,
- 0x1f98, 0x1f99, 0x1f9a, 0x1f9b, 0x1f9c, 0x1f9d, 0x1f9e, 0x1f9f,
- 0x1f90, 0x1f91, 0x1f92, 0x1f93, 0x1f94, 0x1f95, 0x1f96, 0x1f97,
- 0x1fa8, 0x1fa9, 0x1faa, 0x1fab, 0x1fac, 0x1fad, 0x1fae, 0x1faf,
- 0x1fa0, 0x1fa1, 0x1fa2, 0x1fa3, 0x1fa4, 0x1fa5, 0x1fa6, 0x1fa7,
- 0x1fb8, 0x1fb9, 0x0, 0x1fbc, 0x0, 0, 0x0, 0x0,
- 0x1fb0, 0x1fb1, 0x1f70, 0x1f71, 0x1fb3, 0, 0x399, 0,
- 0, 0, 0x0, 0x1fcc, 0x0, 0, 0x0, 0x0,
- 0x1f72, 0x1f73, 0x1f74, 0x1f75, 0x1fc3, 0, 0, 0,
- 0x1fd8, 0x1fd9, 0x0, 0x0, 0, 0, 0x0, 0x0,
- 0x1fd0, 0x1fd1, 0x1f76, 0x1f77, 0, 0, 0, 0,
- 0x1fe8, 0x1fe9, 0x0, 0x0, 0x0, 0x1fec, 0x0, 0x0,
- 0x1fe0, 0x1fe1, 0x1f7a, 0x1f7b, 0x1fe5, 0, 0, 0,
- 0, 0, 0x0, 0x1ffc, 0x0, 0, 0x0, 0x0,
- 0x1f78, 0x1f79, 0x1f7c, 0x1f7d, 0x1ff3, 0, 0, 0,
-};
-
-static const Q_UINT16 case_20 [] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0x0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 case_21 [] = {
- 0, 0, 0x0, 0, 0, 0, 0, 0x0,
- 0, 0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0x0, 0x0, 0, 0x0, 0, 0,
- 0x761, 0x0, 0x0, 0x0, 0x0, 0x0, 0, 0,
- 0, 0, 0, 0, 0x0, 0, 0x0, 0,
- 0x0, 0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0x0, 0x0, 0, 0x0, 0x0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 case_fb [] = {
- 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0x0, 0x0, 0x0, 0x0, 0x0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 case_ff [] = {
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0xff41, 0xff42, 0xff43, 0xff44, 0xff45, 0xff46, 0xff47,
- 0xff48, 0xff49, 0xff4a, 0xff4b, 0xff4c, 0xff4d, 0xff4e, 0xff4f,
- 0xff50, 0xff51, 0xff52, 0xff53, 0xff54, 0xff55, 0xff56, 0xff57,
- 0xff58, 0xff59, 0xff5a, 0, 0, 0, 0, 0,
- 0, 0xff21, 0xff22, 0xff23, 0xff24, 0xff25, 0xff26, 0xff27,
- 0xff28, 0xff29, 0xff2a, 0xff2b, 0xff2c, 0xff2d, 0xff2e, 0xff2f,
- 0xff30, 0xff31, 0xff32, 0xff33, 0xff34, 0xff35, 0xff36, 0xff37,
- 0xff38, 0xff39, 0xff3a, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
-};
-
-static const Q_UINT16 * const case_info[256] = {
-
- case_0, case_1, case_2, case_3, case_4, case_5, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- case_10, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, case_1e, case_1f,
- case_20, case_21, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, case_fb, 0, 0, 0, case_ff,
-};
-
-static const Q_INT8 num_0 [] = {
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 2, 3, -1, -1, -1, -1,
- -1, 1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
-};
-
-static const Q_INT8 num_6 [] = {
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, -1, -1, -1, -1, -1, -1,
-};
-
-static const Q_INT8 num_9 [] = {
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 0, 1,
- 2, 3, 4, 5, 6, 7, 8, 9,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 0, 1,
- 2, 3, 4, 5, 6, 7, 8, 9,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
-};
-
-static const Q_INT8 num_b [] = {
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 0, 1,
- 2, 3, 4, 5, 6, 7, 8, 9,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 1,
- 2, 3, 4, 5, 6, 7, 8, 9,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
-};
-
-static const Q_INT8 num_d [] = {
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 0, 1,
- 2, 3, 4, 5, 6, 7, 8, 9,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
-};
-
-static const Q_INT8 num_e [] = {
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
-};
-
-static const Q_INT8 num_f [] = {
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
-};
-
-static const Q_INT8 num_20 [] = {
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- 0, -1, -1, -1, 4, 5, 6, 7,
- 8, 9, -1, -1, -1, -1, -1, -1,
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
-};
-
-static const Q_INT8 num_ff [] = {
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1,
-};
-
-static const Q_INT8 * const decimal_info[256] = {
- num_0, 0, 0, 0, 0, 0, num_6, 0,
- 0, num_9, num_9, num_b, num_9, num_d, num_e, num_f,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- num_20, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, num_ff,
-};
-
-static const Q_UINT16 symmetricPairs[] = {
- 0x0028, 0x0029, 0x0029, 0x0028, 0x003C, 0x003E, 0x003E, 0x003C,
- 0x005B, 0x005D, 0x005D, 0x005B, 0x007B, 0x007D, 0x007D, 0x007B,
- 0x2045, 0x2046, 0x2046, 0x2045, 0x207D, 0x207E, 0x207E, 0x207D,
- 0x208D, 0x208E, 0x208E, 0x208D, 0x3008, 0x3009, 0x3009, 0x3008,
- 0x300A, 0x300B, 0x300B, 0x300A, 0x300C, 0x300D, 0x300D, 0x300C,
- 0x300E, 0x300F, 0x300F, 0x300E, 0x3010, 0x3011, 0x3011, 0x3010,
- 0x3014, 0x3015, 0x3015, 0x3014, 0x3016, 0x3017, 0x3017, 0x3016,
- 0x3018, 0x3019, 0x3019, 0x3018, 0x301A, 0x301B, 0x301B, 0x301A,
- 0xFD3E, 0xFD3F, 0xFD3F, 0xFD3E, 0xFE59, 0xFE5A, 0xFE5A, 0xFE59,
- 0xFE5B, 0xFE5C, 0xFE5C, 0xFE5B, 0xFE5D, 0xFE5E, 0xFE5E, 0xFE5D,
- 0xFF08, 0xFF09, 0xFF09, 0xFF08, 0xFF3B, 0xFF3D, 0xFF3D, 0xFF3B,
- 0xFF5B, 0xFF5D, 0xFF5D, 0xFF5B, 0xFF62, 0xFF63, 0xFF63, 0xFF62,
-};
-
-static int symmetricPairsSize =
- sizeof(symmetricPairs)/sizeof(symmetricPairs[0]);
-
-/*
- * ----------------------------------------------------------------------
- * End of unicode tables
- * ----------------------------------------------------------------------
- */
-
-#endif
-
-
-static int ucstrcmp( const QString &as, const QString &bs )
-{
- const QChar *a = as.unicode();
- const QChar *b = bs.unicode();
- if ( a == b )
- return 0;
- if ( a == 0 )
- return 1;
- if ( b == 0 )
- return -1;
- int l=QMIN(as.length(),bs.length());
- while ( l-- && *a == *b )
- a++,b++;
- if ( l==-1 )
- return ( as.length()-bs.length() );
- return a->unicode() - b->unicode();
-}
-
-static int ucstrncmp( const QChar *a, const QChar *b, int l )
-{
- while ( l-- && *a == *b )
- a++,b++;
- if ( l==-1 )
- return 0;
- return a->unicode() - b->unicode();
-}
-
-static int ucstrnicmp( const QChar *a, const QChar *b, int l )
-{
- while ( l-- && a->lower() == b->lower() )
- a++,b++;
- if ( l==-1 )
- return 0;
- QChar al = a->lower();
- QChar bl = b->lower();
- return al.unicode() - bl.unicode();
-}
-
-// NOT REVISED
-/*! \class QCharRef qstring.h
- \brief The QCharRef class is a helper class for QString.
-
- It provides the ability to work on characters in a QString in a natural
- fashion.
-
- When you get an object of type QCharRef, you can assign to it, which
- will operate on the string from which you got it. That is its whole
- purpose in life. It becomes invalid once further modifications are
- made to the string: If you want to keep it, copy it into a QChar.
-
- Most of the QChar member functions also exist in QCharRef. However,
- they are not explicitly documented here.
-
- \sa QString::operator[]() QString::at() QChar
-*/
-
-/*! \class QChar qstring.h
-
-\brief The QChar class provides a light-weight Unicode character.
-
-Unicode characters are (so far) 16-bit entities without any markup or
-structure. This class represents such an entity. It is rather
-light-weight, so it can be used everywhere. Most compilers treat it
-approximately like "short int". (In a few years, it may be necessary
-to make QChar 32-bit, once more than 65536 Unicode code points have
-been defined and come into use.)
-
-QChar provides a full complement of testing/classification functions,
-conversion to and from other formats, from composed to decomposed
-unicode, and will try to compare and case-convert if you ask it to.
-
-The classification functions include functions like those in ctype.h,
-but operating on the full range of unicode characters. They all
-return TRUE if the character is a certain type of character, and FALSE
-otherwise.
-
-These functions are: isNull() (returns TRUE if the character is
-U+0000), isPrint() (TRUE if the character is any sort of printable
-character, including whitespace), isPunct() (any sort of punctuation),
-isMark() (Unicode Marks), isLetter (letters), isNumber() (any sort of
-numeric characters), isLetterOrNumber(), and isDigit() (decimal digits).
-All of these are wrappers around category(), which returns the
-unicode-defined category of each character.
-
-QChar further provides direction(), which indicates the "natural"
-writing direction of this character, joining(), which indicates how
-this character joins with its neighbors (needed mostly for Arabic)
-and finally mirrored(), which indicates whether this character needs
-to be mirrored when it is printed in its unnatural writing
-direction.
-
-Composed Unicode characters (like &aring;) can be converted to
-decomposed Unicode ("a" followed by "ring above") using
-decomposition().
-
-In Unicode, comparison is not necessarily possible, and case
-conversion is at best very hard. Unicode, covering the "entire"
-globe, also includes a globe-sized collection of case and sorting
-problems. Qt tries, but not very hard: operator== and friends will do
-comparison based purely on the numeric Unicode value (code point) of
-the characters, and upper() and lower() will do case changes when the
-character has a well-defined upper/lower-case equivalent. There is no
-provision for locale-dependent case folding rules or comparison: These
-functions are meant to be fast, so they can be used unambiguously in
-data structures.
-
-The conversion functions include unicode() (to a scalar), latin1() (to
-scalar, but converts all non-Latin1 characters to 0), row() (gives the
-Unicode row), cell() (gives the unicode cell), digitValue() (gives the
-integer value of any of the numerous digit characters), and a host of
-constructors.
-
-\sa QString QCharRef \link unicode.html About Unicode \endlink
-*/
-
-/*! \enum QChar::Category
-
-This enum maps the Unicode character categories. The currently known
-categories are: <ul>
-
-<li> \c NoCategory - used when Qt is dazed and confused and cannot
-make sense of anything.
-
-<li> \c Mark_NonSpacing - (Mn) -
-
-<li> \c Mark_SpacingCombining - (Mc) -
-
-<li> \c Mark_Enclosing - (Me) -
-
-<li> \c Number_DecimalDigit - (Nd) -
-
-<li> \c Number_Letter - (Nl) -
-
-<li> \c Number_Other - (No) -
-
-<li> \c Separator_Space - (Zs) -
-
-<li> \c Separator_Line - (Zl) -
-
-<li> \c Separator_Paragraph - (Zp) -
-
-<li> \c Other_Control - (Cc) -
-
-<li> \c Other_Format - (Cf) -
-
-<li> \c Other_Surrogate - (Cs) -
-
-<li> \c Other_PrivateUse - (Co) -
-
-<li> \c Other_NotAssigned - (Cn) -
-
-<li> \c Letter_Uppercase - (Lu) -
-
-<li> \c Letter_Lowercase - (Ll) -
-
-<li> \c Letter_Titlecase - (Lt) -
-
-<li> \c Letter_Modifier - (Lm) -
-
-<li> \c Letter_Other - (Lo) -
-
-<li> \c Punctuation_Connector - (Pc) -
-
-<li> \c Punctuation_Dask - (Pd) -
-
-<li> \c Punctuation_Open - (Ps) -
-
-<li> \c Punctuation_Close - (Pe) -
-
-<li> \c Punctuation_InitialQuote - (Pi) -
-
-<li> \c Punctuation_FinalQuote - (Pf) -
-
-<li> \c Punctuation_Other - (Po) -
-
-<li> \c Symbol_Math - (Sm) -
-
-<li> \c Symbol_Currency - (Sc) -
-
-<li> \c Symbol_Modifier - (Sk) -
-
-<li> \c Symbol_Other - (So) -
-
-</ul>
-*/
-
-/*! \enum QChar::Direction
-
- This enum type defines the Unicode direction attributes.
- See <a href="http://www.unicode.org">the Unicode Standard</a>
- for a description of the values.
-
- In order to conform to C/C++ naming conventions "Dir" is
- prepended to the codes used in The Unicode Standard.
-*/
-
-/*! \enum QChar::Decomposition
-
- This enum type defines the Unicode decomposition attributes.
- See <a href="http://www.unicode.org">the Unicode Standard</a>
- for a description of the values.
-*/
-
-/*! \enum QChar::Joining
-
- This enum type defines the Unicode decomposition attributes.
- See <a href="http://www.unicode.org">the Unicode Standard</a>
- for a description of the values.
-*/
-
-
-
-/*! \fn QChar::QChar()
-
-Constructs a null QChar (one that isNull()).
-*/
-
-
-/*! \fn QChar::QChar( char c )
-
-Constructs a QChar corresponding to ASCII/Latin1 character \a c.
-*/
-
-
-/*! \fn QChar::QChar( uchar c )
-
-Constructs a QChar corresponding to ASCII/Latin1 character \a c.
-*/
-
-
-/*! \fn QChar::QChar( uchar c, uchar r )
-
-Constructs a QChar for Unicode cell \a c in row \a r.
-*/
-
-
-/*! \fn QChar::QChar( const QChar& c )
-
-Constructs a copy of \a c. This is a deep copy, if such a
-light-weight object can be said to have deep copies.
-*/
-
-
-/*! \fn QChar::QChar( ushort rc )
-
-Constructs a QChar for the character with Unicode code point \a rc.
-*/
-
-
-/*! \fn QChar::QChar( short rc )
-
-Constructs a QChar for the character with Unicode code point \a rc.
-*/
-
-
-/*! \fn QChar::QChar( uint rc )
-
-Constructs a QChar for the character with Unicode code point \a rc.
-*/
-
-
-/*! \fn QChar::QChar( int rc )
-
-Constructs a QChar for the character with Unicode code point \a rc.
-*/
-
-
-/*! \fn bool QChar::networkOrdered ()
-
- Returns TRUE if this character is in network byte order (MSB first),
- and FALSE if it is not. This is a platform-dependent property, so
- we strongly advise against using this function in portable code.
-*/
-
-
-/*!
- \fn bool QChar::isNull() const
- Returns TRUE if the characters is the unicode character 0x0000,
- ie. ASCII NUL.
-*/
-
-/*!
- \fn uchar QChar::cell () const
- Returns the cell (least significant byte) of the Unicode character.
-*/
-/*!
- \fn uchar QChar::row () const
- Returns the row (most significant byte) of the Unicode character.
-*/
-/*!
- \fn uchar& QChar::cell ()
- Returns a reference to the cell (least significant byte) of the Unicode character.
-*/
-/*!
- \fn uchar& QChar::row ()
- Returns a reference to the row (most significant byte) of the Unicode character.
-*/
-
-/*!
- Returns whether the character is a printable character. This is
- any character not of category Cc or Cn. Note that this gives no indication
- of whether the character is available in some font.
-*/
-bool QChar::isPrint() const
-{
- Category c = category();
- return !(c == Other_Control || c == Other_NotAssigned);
-}
-
-/*!
- Returns whether the character is a separator
- character (Separator_* categories).
-*/
-bool QChar::isSpace() const
-{
- if( !row() )
- if( cell() >= 9 && cell() <=13 ) return TRUE;
- Category c = category();
- return c >= Separator_Space && c <= Separator_Paragraph;
-}
-
-/*!
- Returns whether the character is a mark (Mark_* categories).
-*/
-bool QChar::isMark() const
-{
- Category c = category();
- return c >= Mark_NonSpacing && c <= Mark_Enclosing;
-}
-
-/*!
- Returns whether the character is punctuation (Punctuation_* categories).
-*/
-bool QChar::isPunct() const
-{
- Category c = category();
- return (c >= Punctuation_Connector && c <= Punctuation_Other);
-}
-
-/*!
- Returns whether the character is a letter (Letter_* categories).
-*/
-bool QChar::isLetter() const
-{
- Category c = category();
- return (c >= Letter_Uppercase && c <= Letter_Other);
-}
-
-/*!
- Returns whether the character is a number (of any sort - Number_* categories).
-
- \sa isDigit()
-*/
-bool QChar::isNumber() const
-{
- Category c = category();
- return c >= Number_DecimalDigit && c <= Number_Other;
-}
-
-/*!
- Returns whether the character is a letter or number (Letter_* or Number_* categories).
-*/
-bool QChar::isLetterOrNumber() const
-{
- Category c = category();
- return (c >= Letter_Uppercase && c <= Letter_Other)
- || (c >= Number_DecimalDigit && c <= Number_Other);
-}
-
-
-/*!
- Returns whether the character is a decimal digit (Number_DecimalDigit).
- */
-bool QChar::isDigit() const
-{
- return (category() == Number_DecimalDigit);
-}
-
-/*!
- Returns the numeric value of the digit, or -1 if the character is not
- a digit.
-*/
-int QChar::digitValue() const
-{
-#ifndef QT_NO_UNICODETABLES
- const Q_INT8 *dec_row = decimal_info[row()];
- if( !dec_row )
- return -1;
- return decimal_info[row()][cell()];
-#else
- // ##### just latin1
- if ( rw != 0 || cl < '0' || cl > '9' )
- return -1;
- else
- return cl - '0';
-#endif
-}
-
-/*!
- Returns the character category.
-
- \sa Category
-*/
-QChar::Category QChar::category() const
-{
-#ifndef QT_NO_UNICODETABLES
- return (Category)(unicode_info[row()][cell()]);
-#else
-// ### just ASCII
- if ( rw == 0 ) {
- return (Category)(ui_00[cell()]);
- }
- return Letter_Uppercase; //#######
-#endif
-}
-
-/*!
- Returns the characters directionality.
-
- \sa Direction
-*/
-QChar::Direction QChar::direction() const
-{
-#ifndef QT_NO_UNICODETABLES
- const Q_UINT8 *rowp = direction_info[row()];
- if(!rowp) return QChar::DirL;
- return (Direction) ( *(rowp+cell()) &0x1f );
-#else
- return DirL;
-#endif
-}
-
-/*!
- This function is not supported (it may change to use Unicode
- character classes).
-
- Returns information about the joining properties of the
- character (needed for arabic).
-*/
-QChar::Joining QChar::joining() const
-{
-#ifndef QT_NO_UNICODETABLES
- const Q_UINT8 *rowp = direction_info[row()];
- if ( !rowp )
- return QChar::OtherJoining;
- return (Joining) ((*(rowp+cell()) >> 5) &0x3);
-#else
- return OtherJoining;
-#endif
-}
-
-
-/*!
- Returns whether the character is a mirrored character (one that
- should be reversed if the text direction is reversed).
-*/
-bool QChar::mirrored() const
-{
-#ifndef QT_NO_UNICODETABLES
- const Q_UINT8 *rowp = direction_info[row()];
- if ( !rowp )
- return FALSE;
- return *(rowp+cell())>128;
-#else
- return FALSE;
-#endif
-}
-
-/*!
- Returns the mirrored char if this character is a mirrored char, the char
- itself otherwise
-*/
-QChar QChar::mirroredChar() const
-{
-#ifndef QT_NO_UNICODETABLES
- if(!mirrored()) return *this;
-
- int i;
- int c = unicode();
- for (i = 0; i < symmetricPairsSize; i += 2) {
- if (symmetricPairs[i] == c)
- return symmetricPairs[i+1];
- }
- return 0;
-#else
- return *this;
-#endif
-}
-
-/*!
- Decomposes a character into its parts. Returns QString::null if
- no decomposition exists.
-*/
-QString QChar::decomposition() const
-{
-#ifndef QT_NO_UNICODETABLES
- const Q_UINT16 *r = decomposition_info[row()];
- if(!r) return QString::null;
-
- Q_UINT16 pos = r[cell()];
- if(!pos) return QString::null;
- pos+=2;
-
- QString s;
- Q_UINT16 c;
- while((c = decomposition_map[pos++]) != 0) s += QChar(c);
-
- return s;
-#else
- return null;
-#endif
-}
-
-/*!
- Returns the tag defining the composition of the character.
- Returns QChar::Single if no decomposition exists.
-*/
-QChar::Decomposition QChar::decompositionTag() const
-{
-#ifndef QT_NO_UNICODETABLES
- const Q_UINT16 *r = decomposition_info[row()];
- if(!r) return QChar::Single;
-
- Q_UINT16 pos = r[cell()];
- if(!pos) return QChar::Single;
-
- return (QChar::Decomposition) decomposition_map[pos];
-#else
- return Single; // ########### FIX eg. just latin1
-#endif
-}
-
-/*!
- Returns the lowercase equivalent if the character is uppercase,
- or the character itself otherwise.
-*/
-QChar QChar::lower() const
-{
-#ifndef QT_NO_UNICODETABLES
- if(category() != Letter_Uppercase) return *this;
- Q_UINT16 lower = *(case_info[row()]+cell());
- if(lower == 0) return *this;
- return lower;
-#else
- if (row())
- return *this;
- else
- return QChar(tolower(latin1()));
-#endif
-}
-
-/*!
- Returns the uppercase equivalent if the character is lowercase,
- or the character itself otherwise.
-*/
-QChar QChar::upper() const
-{
-#ifndef QT_NO_UNICODETABLES
- if(category() != Letter_Lowercase) return *this;
- Q_UINT16 upper = *(case_info[row()]+cell());
- if(upper == 0) return *this;
- return upper;
-#else
- if (row())
- return *this;
- else
- return QChar(toupper(latin1()));
-#endif
-}
-
-/*!
- \fn QChar::operator char() const
-
- Returns the Latin1 character equivalent to the QChar,
- or 0. This is mainly useful for non-internationalized software.
-
- \sa unicode()
-*/
-
-/*!
- \fn ushort QChar::unicode() const
-
- Returns the numeric Unicode value equal to the QChar. Normally, you
- should use QChar objects as they are equivalent, but for some low-level
- tasks (eg. indexing into an array of Unicode information), this function
- is useful.
-*/
-
-/*****************************************************************************
- Documentation of QChar related functions
- *****************************************************************************/
-
-/*!
- \fn int operator==( QChar c1, QChar c2 )
- \relates QChar
-
- Returns TRUE if \a c1 and \a c2 are the same Unicode character.
-*/
-
-/*!
- \fn int operator==( char ch, QChar c )
- \relates QChar
-
- Returns TRUE if \a c is the ASCII/Latin1 character \a ch.
-*/
-
-/*!
- \fn int operator==( QChar c, char ch )
- \relates QChar
-
- Returns TRUE if \a c is the ASCII/Latin1 character \a ch.
-*/
-
-/*!
- \fn int operator!=( QChar c1, QChar c2 )
- \relates QChar
-
- Returns TRUE if \a c1 and \a c2 are not the same Unicode character.
-*/
-
-/*!
- \fn int operator!=( char ch, QChar c )
- \relates QChar
-
- Returns TRUE if \a c is not the ASCII/Latin1 character \a ch.
-*/
-
-/*!
- \fn int operator!=( QChar c, char ch )
- \relates QChar
-
- Returns TRUE if \a c is not the ASCII/Latin1 character \a ch.
-*/
-
-/*!
- \fn int operator<=( QChar c1, QChar c2 )
- \relates QChar
-
- Returns TRUE if the numeric Unicode value of \a c1 is less than that
- of \a c2, or they are the same Unicode character.
-*/
-
-/*!
- \fn int operator<=( QChar c, char ch )
- \relates QChar
-
- Returns TRUE if the numeric Unicode value of \a c is less than or
- equal to that of the ASCII/Latin1 character \a ch.
-*/
-
-/*!
- \fn int operator<=( char ch, QChar c )
- \relates QChar
-
- Returns TRUE if the numeric Unicode value of the ASCII/Latin1
- character \a ch is less than or equal to that of \a c.
-*/
-
-/*!
- \fn int operator>=( QChar c1, QChar c2 )
- \relates QChar
-
- Returns TRUE if the numeric Unicode value of \a c1 is greater than that
- of \a c2, or they are the same Unicode character.
-*/
-
-/*!
- \fn int operator>=( QChar c, char ch )
- \relates QChar
-
- Returns TRUE if the numeric Unicode value of \a c is greater than or
- equal to that of the ASCII/Latin1 character \a ch.
-*/
-
-/*!
- \fn int operator>=( char ch, QChar c )
- \relates QChar
-
- Returns TRUE if the numeric Unicode value of the ASCII/Latin1
- character \a ch is greater than or equal to that of \a c.
-*/
-
-/*!
- \fn int operator<( QChar c1, QChar c2 )
- \relates QChar
-
- Returns TRUE if the numeric Unicode value of \a c1 is less than that
- of \a c2.
-*/
-
-/*!
- \fn int operator<( QChar c, char ch )
- \relates QChar
-
- Returns TRUE if the numeric Unicode value of \a c is less than that
- of the ASCII/Latin1 character \a ch.
-*/
-
-/*!
- \fn int operator<( char ch, QChar c )
- \relates QChar
-
- Returns TRUE if the numeric Unicode value of the ASCII/Latin1
- character \a ch is less than that of \a c.
-*/
-
-/*!
- \fn int operator>( QChar c1, QChar c2 )
- \relates QChar
-
- Returns TRUE if the numeric Unicode value of \a c1 is greater than
- that of \a c2.
-*/
-
-/*!
- \fn int operator>( QChar c, char ch )
- \relates QChar
-
- Returns TRUE if the numeric Unicode value of \a c is greater than
- that of the ASCII/Latin1 character \a ch.
-*/
-
-/*!
- \fn int operator>( char ch, QChar c )
- \relates QChar
-
- Returns TRUE if the numeric Unicode value of the ASCII/Latin1
- character \a ch is greater than that of \a c.
-*/
-
-#ifndef QT_NO_UNICODETABLES
-
-// small class used internally in QString::Compose()
-class QLigature
-{
-public:
- QLigature( QChar c );
-
- Q_UINT16 first() { cur = ligatures; return cur ? *cur : 0; }
- Q_UINT16 next() { return cur && *cur ? *(cur++) : 0; }
- Q_UINT16 current() { return cur ? *cur : 0; }
-
- int match(QString & str, unsigned int index);
- QChar head();
- QChar::Decomposition tag();
-
-private:
- Q_UINT16 *ligatures;
- Q_UINT16 *cur;
-};
-
-QLigature::QLigature( QChar c )
-{
- const Q_UINT16 *r = ligature_info[c.row()];
- if( !r )
- ligatures = 0;
- else
- {
- const Q_UINT16 pos = r[c.cell()];
- ligatures = (Q_UINT16 *)&(ligature_map[pos]);
- }
- cur = ligatures;
-}
-
-QChar QLigature::head()
-{
- if(current())
- return QChar(decomposition_map[current()+1]);
-
- return QChar::null;
-}
-
-QChar::Decomposition QLigature::tag()
-{
- if(current())
- return (QChar::Decomposition) decomposition_map[current()];
-
- return QChar::Canonical;
-}
-
-int QLigature::match(QString & str, unsigned int index)
-{
- unsigned int i=index;
-
- if(!current()) return 0;
-
- Q_UINT16 lig = current() + 2;
- Q_UINT16 ch;
-
- while ((i < str.length()) && (ch = decomposition_map[lig])) {
- if (str[(int)i] != QChar(ch))
- return 0;
- i++; lig++;
- }
-
- if (!decomposition_map[lig])
- {
- return i-index;
- }
- return 0;
-}
-
-// this function is just used in QString::compose()
-static inline bool format(QChar::Decomposition tag, QString & str,
- int index, int len)
-{
- unsigned int l = index + len;
- unsigned int r = index;
-
- bool right = FALSE;
-
- bool left = ((l < str.length()) &&
- ((str[(int)l].joining() == QChar::Dual) ||
- (str[(int)l].joining() == QChar::Right)));
- if (r > 0) {
- r--;
- //printf("joining(right) = %d\n", str[(int)r].joining());
- right = (str[(int)r].joining() == QChar::Dual);
- }
-
-
- switch (tag) {
- case QChar::Medial:
- return (left && right);
- case QChar::Initial:
- return (left && !right);
- case QChar::Final:
- return (right);// && !left);
- case QChar::Isolated:
- default:
- return (!right && !left);
- }
-} // format()
-#endif
-
-/*
- QString::compose() and visual() were developed by Gordon Tisher
- <tisher@uniserve.ca>, with input from Lars Knoll <knoll@mpi-hd.mpg.de>,
- who developed the unicode data tables.
-*/
-/*!
- Note that this function is not supported in Qt 2.0, and is merely
- for experimental and illustrative purposes. It is mainly of interest
- to those experimenting with Arabic and other composition-rich texts.
-
- Applies possible ligatures to a QString, useful when composition-rich
- text requires rendering with glyph-poor fonts, but also
- makes compositions such as QChar(0x0041) ('A') and QChar(0x0308)
- (Unicode accent diaeresis) giving QChar(0x00c4) (German A Umlaut).
-*/
-void QString::compose()
-{
-#ifndef QT_NO_UNICODETABLES
- unsigned int index=0, len;
- unsigned int cindex = 0;
-
- QChar code, head;
-
- QArray<QChar> dia;
-
- QString composed = *this;
-
- while (index < length()) {
- code = at(index);
- //printf("\n\nligature for 0x%x:\n", code.unicode());
- QLigature ligature(code);
- ligature.first();
- while(ligature.current()) {
- if ((len = ligature.match(*this, index)) != 0) {
- head = ligature.head();
- unsigned short code = head.unicode();
- // we exclude Arabic presentation forms A and a few
- // other ligatures, which are undefined in most fonts
- if(!(code > 0xfb50 && code < 0xfe80) &&
- !(code > 0xfb00 && code < 0xfb2a)) {
- // joining info is only needed for arabic
- if (format(ligature.tag(), *this, index, len)) {
- //printf("using ligature 0x%x, len=%d\n",code,len);
- // replace letter
- composed.replace(cindex, len, QChar(head));
- index += len-1;
- // we continue searching in case we have a final
- // form because medial ones are preferred.
- if ( len != 1 || ligature.tag() !=QChar::Final )
- break;
- }
- }
- }
- ligature.next();
- }
- cindex++;
- index++;
- }
- *this = composed;
-#endif
-}
-
-static QChar LRM ((ushort)0x200e);
-static QChar RLM ((ushort)0x200f);
-static QChar LRE ((ushort)0x202a);
-static QChar RLE ((ushort)0x202b);
-static QChar RLO ((ushort)0x202e);
-static QChar LRO ((ushort)0x202d);
-static QChar PDF ((ushort)0x202c);
-
-#if 0
-static inline bool is_arabic(unsigned short x) {
- return (((x >= 0x0600) && (x <= 0x07bf)) ||
- ((x >= 0xfb50) && (x <= 0xfdff)) ||
- ((x >= 0xfe70) && (x <= 0xfeff)));
-}
-#endif
-
-#ifndef QT_NO_UNICODETABLES
-static inline bool is_neutral(unsigned short dir) {
- return ((dir == QChar::DirB) ||
- (dir == QChar::DirS) ||
- (dir == QChar::DirWS) ||
- (dir == QChar::DirON) ||
- (dir == QChar::DirNSM));
-}
-#endif
-
-/*!
-This function returns the directionality of the string.
-
-\returns a value of DirLTR, DirRTL, DirMixed or DirNeutral that indicates
-if the entire text represented by this text is unidirectional,
-and which direction, or if it is mixed-directional or all characters are neutral.
-*/
-QString::Direction QString::direction() const
-{
-#ifndef QT_NO_UNICODETABLES
- // find direction
- unsigned char resultDir = DirNeutral;
- for (unsigned int pos = 0; pos < length(); pos++)
- {
- if ((at(pos) != RLE) &&
- (at(pos) != LRE) &&
- (at(pos) != RLO) &&
- (at(pos) != LRO) &&
- (at(pos).direction() > 1) &&
- (at(pos).direction() != QChar::DirAL)) // not R and not L
- continue;
-
- if ((at(pos).direction() == QChar::DirR) ||
- (at(pos).direction() == QChar::DirAL) ||
- (at(pos) == RLE) ||
- (at(pos) == RLO))
- resultDir |= DirRTL;
- else
- resultDir |= DirLTR;
- if (resultDir == DirMixed)
- return DirMixed;
- }
- return static_cast<Direction>(resultDir);
-#else
- return DirLTR;
-#endif
-}
-
-/*!
-This function returns the basic directionality of the string. Useful to find the right
-alignment.
-
-The base direction is derived from the first character in the string
-with bidirectional character type L, R, or AL.
-If the first such character has type L, DirLTR is returned.
-If the first such character has type R or AL, DirRTL is returned.
-If the string does not contain any character of these types, then DirNeutral is returned.
-This is a lightweight function for use when only the base direction is needed and
-no further bidi processing of the text is needed.
-
-\returns DirRTL, DirLTR or DirNeutral
-*/
-QString::Direction QString::basicDirection() const
-{
-#ifndef QT_NO_UNICODETABLES
- // find base direction
- unsigned int pos = 0;
- while ((pos < length()) &&
- (at(pos) != RLE) &&
- (at(pos) != LRE) &&
- (at(pos) != RLO) &&
- (at(pos) != LRO) &&
- (at(pos).direction() > 1) &&
- (at(pos).direction() != QChar::DirAL)) // not R and not L
- pos++;
-
- if (pos == length())
- return DirNeutral;
-
- if ((at(pos).direction() == QChar::DirR) ||
- (at(pos).direction() == QChar::DirAL) ||
- (at(pos) == RLE) ||
- (at(pos) == RLO))
- return DirRTL;
- return DirLTR;
-#else
- return DirLTR;
-#endif
-}
-
-#ifndef QT_NO_UNICODETABLES
-// reverses part of the QChar array to get visual ordering
-// called from QString::visual()
-//
-static unsigned int reverse( QString &chars, unsigned char *level,
- unsigned int a, unsigned int b)
-{
- unsigned int c = a;
- unsigned char lev = level[c];
-
- while ((c < b) && (level[c] >= lev)) {
- if (level[c] > lev)
- c = reverse(chars, level, c, b);
- c++;
- }
-
- if (lev > 0) {
- QChar temp;
- unsigned int d = a, e = c-1;
- while (d < e) {
- temp = chars[(int)d];
- chars[(int)d] = chars[(int)e];
- chars[(int)e] = temp;
-
- d++; e--;
- }
- }
-
- return c;
-}
-
-// small class used for the ordering algorithm in QString::visual()
-class QBidiState {
-public:
- unsigned char level;
- signed char override;
-
- QBidiState(unsigned char l, signed char o) : level(l), override(o) {};
-};
-
-// matrix for resolving neutral types
-
-#define NEG1 (QChar::Direction)(-1)
-
-static QChar::Direction resolv[5][5] =
-{
- { NEG1, QChar::DirR, QChar::DirL, QChar::DirEN, QChar::DirAN },
- { QChar::DirR, QChar::DirR, NEG1, QChar::DirR, QChar::DirR },
- { QChar::DirL, NEG1, QChar::DirL, QChar::DirL, NEG1 },
- { QChar::DirEN, QChar::DirR, QChar::DirL, QChar::DirEN, QChar::DirR },
- { QChar::DirAN, QChar::DirR, NEG1, NEG1, QChar::DirAN }
-};
-
-#endif
-
-/*!
- This function returns the QString ordered visually. Useful for
- painting the string or when transforming to a visually ordered
- encoding.
-*/
-QString QString::visual(int index, int len)
-{
-#ifndef QT_NO_UNICODETABLES
- // #### This needs much more optimizing - it is called for
- // #### every text operation.
-
- unsigned char *level;
- QChar::Direction *dir;
- unsigned char base = 0;
-
- unsigned int l = length();
-
- // check bounds
- if (len == -1)
- len = length()-index;
- if ((uint)index > l)
- return QString::null;
-
- // find base direction
- unsigned int pos = 0;
- while ((pos < length()) &&
- (at(pos) != RLE) &&
- (at(pos) != LRE) &&
- (at(pos) != RLO) &&
- (at(pos) != LRO) &&
- (at(pos).direction() > 1) &&
- (at(pos).direction() != QChar::DirAL)
- ) // not R and not L
- pos++;
-
- if ((pos < length()) &&
- ((at(pos).direction() == QChar::DirR) ||
- (at(pos).direction() == QChar::DirAL) ||
- (at(pos) == RLE) ||
- (at(pos) == RLO)))
- base = 1;
-
- // is there any BiDi char at all?
- if ( base == 0 && pos == l ) {
- return mid(index, len);
- }
-
-
- level = new uchar[l];
- dir = new QChar::Direction[l];
-
- // explicit override pass
- //unsigned int code_count = 0;
-
- QStack<QBidiState> stack;
- stack.setAutoDelete(TRUE);
-
- unsigned char clevel = base;
- signed char override = -1;
-
- for (pos = 0; pos < l; pos++) {
-
- if (at(pos) == RLE) {
- //code_count++;
- stack.push(new QBidiState(clevel, override));
- if (clevel < 254)
- clevel += 1 + clevel % 2;
- override = -1;
- }
- else if (at(pos) == LRE) {
- //code_count++;
- stack.push(new QBidiState(clevel, override));
- if (clevel < 254)
- clevel += 2 - clevel % 2;
- override = -1;
- }
- else if (at(pos) == RLO) {
- //code_count++;
- stack.push(new QBidiState(clevel, override));
- if (clevel < 254)
- clevel += 1 + clevel % 2;
- override = QChar::DirR;
- }
- else if (at(pos) == LRO) {
- //code_count++;
- stack.push(new QBidiState(clevel, override));
- if (clevel < 254)
- clevel += 2 - clevel % 2;
- override = QChar::DirL;
- }
- else if (at(pos) == PDF) {
- //code_count++;
- if (!stack.isEmpty()) {
- override = stack.top()->override;
- clevel = stack.top()->level;
- stack.remove();
- }
- }
-
- // TODO: catch block separators (newlines, paras, etc.)
-
- level[pos] = clevel;
- if (override != -1)
- dir[pos] = (QChar::Direction) override;
- else
- dir[pos] = at(pos).direction();
- }
-
- // weak type pass
- for (pos = 0; pos < l; pos++) {
-
- int i;
-
- switch (at(pos).direction()) {
- case QChar::DirEN:
- i = pos-1;
- while ((i >= 0) &&
- !(at(i).direction() == QChar::DirAN) &&
- !(at(i).direction() == QChar::DirAL) &&
- !(at(i).direction() == QChar::DirB))
- i--;
-
- if ((i >= 0) &&
- ((at(i).direction() == QChar::DirAN) ||
- (at(i).direction() == QChar::DirAL)))
- dir[pos] = QChar::DirAN;
-
- break;
- case QChar::DirES:
- case QChar::DirCS:
- if ((pos > 0) && (pos < l-1) &&
- (dir[pos-1] == dir[pos+1]))
- dir[pos] = dir[pos-1];
- else
- dir[pos] = QChar::DirON;
-
- break;
- case QChar::DirET:
- if (((pos > 0) && (dir[pos-1] == QChar::DirEN)) ||
- ((pos < l-1) && (dir[pos+1] == QChar::DirEN)))
- dir[pos] = QChar::DirEN;
- else
- dir[pos] = QChar::DirON;
-
- break;
- case QChar::DirAL:
- dir[pos] = QChar::DirR;
- break;
- default:
- break;
- }
- }
-
- // neutral type pass
- for (pos = 0; pos < l; pos++) {
- QChar::Direction left,right; // declaring l here shadowed previous l
-
- if (is_neutral(dir[pos])) {
- if (pos > 0)
- left = dir[pos-1];
- else
- left = (base == 0 ? QChar::DirL : QChar::DirR);
-
- int i = pos;
-
- while ((i < (int)l-1) && is_neutral(dir[i+1]))
- i++;
-
- if (i < (int)l-1)
- right = dir[i+1];
- else
- right = (base == 0 ? QChar::DirL : QChar::DirR);
-
- for (int j=pos; j <= i; j++) {
- int a = 1, b = 1;
- while ((a < 5) && (left != resolv[0][a]))
- a++;
- while ((b < 5) && (right != resolv[0][b]))
- b++;
- if ((a == 5) || (b == 5))
- dir[j] = (base == 0 ? QChar::DirL : QChar::DirR);
- else
- dir[j] = resolv[a][b];
-
- if (dir[j] == (QChar::Direction)(-1))
- dir[j] = (base == 0 ? QChar::DirL : QChar::DirR);
- }
- }
- }
-
- // implicit level pass
- QChar::Direction prec = (base == 0 ? QChar::DirL : QChar::DirR);
-
- for (pos = 0; pos < l; pos++) {
- if (level[pos] % 2) {
- switch (dir[pos]) {
- case QChar::DirL:
- case QChar::DirAN:
- case QChar::DirEN:
- level[pos] += 1;
- break;
- default:
- break;
- }
- } else {
- switch (dir[pos]) {
- case QChar::DirL:
- // do nothing
- break;
- case QChar::DirR:
- level[pos] += 1;
- break;
- case QChar::DirEN:
- if (prec == QChar::DirL)
- continue;
- // fall through
- case QChar::DirAN:
- level[pos] += 2;
- break;
- default:
- break;
- }
- }
-
- prec = dir[pos];
- }
-
- // now do the work!
- QString ret(*this);
- reverse(ret, level, index, index+len);
-
- delete [] level;
- delete [] dir;
-
- return ret;
-#else
- return mid(index,len);
-#endif
-}
-
-
-
-// These macros are used for efficient allocation of QChar strings.
-// IMPORTANT! If you change these, make sure you also change the
-// "delete unicode" statement in ~QStringData() in qstring.h correspondingly!
-
-#define QT_ALLOC_QCHAR_VEC( N ) (QChar*) new char[ sizeof(QChar)*( N ) ]
-#define QT_DELETE_QCHAR_VEC( P ) delete[] ((char*)( P ))
-
-
-/*!
- This utility function converts the 8-bit string
- \a ba to Unicode, returning the result.
-
- The caller is responsible for deleting the return value with delete[].
-*/
-
-QChar* QString::asciiToUnicode( const QByteArray& ba, uint* len )
-{
- if ( ba.isNull() ) {
- if ( len )
- *len = 0;
- return 0;
- }
- int l = 0;
- while ( l < (int)ba.size() && ba[l] )
- l++;
- const char* str = ba.data();
- QChar *uc = new QChar[ l ]; // Can't use macro, since function is public
- QChar *result = uc;
- if ( len )
- *len = l;
- while (l--)
- *uc++ = *str++;
- return result;
-}
-
-static QChar* internalAsciiToUnicode( const QByteArray& ba, uint* len )
-{
- if ( ba.isNull() ) {
- if ( len )
- *len = 0;
- return 0;
- }
- int l = 0;
- while ( l < (int)ba.size() && ba[l] )
- l++;
- const char* str = ba.data();
- QChar *uc = QT_ALLOC_QCHAR_VEC( l );
- QChar *result = uc;
- if ( len )
- *len = l;
- while (l--)
- *uc++ = *str++;
- return result;
-}
-
-/*!
- This utility function converts the NUL-terminated 8-bit string
- \a str to Unicode, returning the result and setting \a len to
- the length of the Unicode string.
-
- The caller is responsible for deleting the return value with delete[].
-*/
-
-QChar* QString::asciiToUnicode( const char *str, uint* len, uint maxlen )
-{
- QChar* result = 0;
- uint l = 0;
- if ( str ) {
- if ( maxlen != (uint)-1 ) {
- while ( l < maxlen && str[l] )
- l++;
- } else {
- // Faster?
- l = qstrlen(str);
- }
- QChar *uc = new QChar[ l ]; // Can't use macro since function is public
- result = uc;
- uint i = l;
- while ( i-- )
- *uc++ = *str++;
- }
- if ( len )
- *len = l;
- return result;
-}
-
-static QChar* internalAsciiToUnicode( const char *str, uint* len,
- uint maxlen = (uint)-1 )
-{
- QChar* result = 0;
- uint l = 0;
- if ( str ) {
- if ( maxlen != (uint)-1 ) {
- while ( l < maxlen && str[l] )
- l++;
- } else {
- // Faster?
- l = qstrlen(str);
- }
- QChar *uc = QT_ALLOC_QCHAR_VEC( l );
- result = uc;
- uint i = l;
- while ( i-- )
- *uc++ = *str++;
- }
- if ( len )
- *len = l;
- return result;
-}
-
-/*!
- This utility function converts \a l 16-bit characters from
- \a uc to ASCII, returning a NUL-terminated string.
-
- The caller is responsible for deleting the string with delete[].
-*/
-char* QString::unicodeToAscii(const QChar *uc, uint l)
-{
- if (!uc) {
- return 0;
- }
- char *a = new char[l+1];
- char *result = a;
- while (l--)
- *a++ = *uc++;
- *a = '\0';
- return result;
-}
-
-static uint computeNewMax( uint len )
-{
- if (len >= 0x80000000)
- return len;
-
- uint newMax = 4;
- while ( newMax < len )
- newMax *= 2;
- // try to save some memory
- if ( newMax >= 1024 * 1024 && len <= newMax - (newMax >> 2) )
- newMax -= newMax >> 2;
- return newMax;
-}
-
-/*!
- Returns the QString as a zero terminated array of unsigned shorts
- if the string is not null; otherwise returns zero.
-
- The result remains valid so long as one unmodified
- copy of the source string exists.
- */
-const unsigned short *QString::ucs2() const
-{
- if ( ! d->unicode )
- return 0;
- unsigned int len = d->len;
- if ( d->maxl < len + 1 ) {
- // detach, grow or shrink
- uint newMax = computeNewMax( len + 1 );
- QChar* nd = QT_ALLOC_QCHAR_VEC( newMax );
- if ( nd ) {
- if ( d->unicode )
- memcpy( nd, d->unicode, sizeof(QChar)*len );
- ((QString *)this)->deref();
- ((QString *)this)->d = new QStringData( nd, len, newMax );
- }
- }
- d->unicode[len] = 0;
- return (unsigned short *) d->unicode;
-}
-
-/*!
- Constructs a string that is a deep copy of \a str, interpreted as a
- UCS2 encoded, zero terminated, Unicode string.
-
- If \a str is 0, then a null string is created.
- \sa isNull()
- */
-QString QString::fromUcs2( const unsigned short *str )
-{
- if ( !str ) {
- return QString::null;
- } else {
- int length = 0;
- while ( str[length] != 0 )
- length++;
- QChar* uc = QT_ALLOC_QCHAR_VEC( length );
- memcpy( uc, str, length*sizeof(QChar) );
- return QString( new QStringData( uc, length, length ), TRUE );
- }
-}
-
-
-/*****************************************************************************
- QString member functions
- *****************************************************************************/
-
-/*!
- \class QString qstring.h
-
- \brief The QString class provides an abstraction of Unicode text and
- the classic C null-terminated char array (<var>char*</var>).
-
- \ingroup tools
- \ingroup shared
-
- QString uses \link shclass.html implicit sharing\endlink, and so it
- is very efficient and easy to use.
-
- In all QString methods that take <var>const char*</var> parameters,
- the <var>const char*</var> is interpreted as a classic C-style
- 0-terminated ASCII string. It is legal for the <var>const
- char*</var> parameter to be 0. The results are undefined if the
- <var>const char*</var> string is not 0-terminated. Functions that
- copy classic C strings into a QString will not copy the terminating
- 0-character. The QChar array of the QString (as returned by
- unicode()) is not terminated by a null.
-
- A QString that has not been assigned to anything is \a null, i.e. both
- the length and data pointer is 0. A QString that references the empty
- string ("", a single '\0' char) is \a empty. Both null and empty
- QStrings are legal parameters to the methods. Assigning <var>const char
- * 0</var> to QString gives a null QString.
-
- Note that if you find that you are mixing usage of QCString, QString,
- and QByteArray, this causes lots of unnecessary copying and might
- indicate that the true nature of the data you are dealing with is
- uncertain. If the data is NUL-terminated 8-bit data, use QCString;
- if it is unterminated (ie. contains NULs) 8-bit data, use QByteArray;
- if it is text, use QString.
-
- \sa QChar \link shclass.html Shared classes\endlink
-*/
-
-Q_EXPORT QStringData *QString::shared_null = 0;
-//QT_STATIC_CONST_IMPL QString QString::null;
-QT_STATIC_CONST_IMPL QChar QChar::null;
-QT_STATIC_CONST_IMPL QChar QChar::replacement((ushort)0xfffd);
-QT_STATIC_CONST_IMPL QChar QChar::byteOrderMark((ushort)0xfeff);
-QT_STATIC_CONST_IMPL QChar QChar::byteOrderSwapped((ushort)0xfffe);
-QT_STATIC_CONST_IMPL QChar QChar::nbsp((ushort)0x00a0);
-
-#if defined(_CC_MSVC_) && _MSC_VER <= 1300
-const QString::Null QString::null;
-#else
-const QString::Null QString::null = { };
-#endif
-
-
-QStringData* QString::makeSharedNull()
-{
- return shared_null=new QStringData;
-}
-
-// Uncomment this to get some useful statistics.
-// #define Q2HELPER(x) x
-
-#ifdef Q2HELPER
-static int stat_construct_charstar=0;
-static int stat_construct_charstar_size=0;
-static int stat_construct_null=0;
-static int stat_construct_int=0;
-static int stat_construct_int_size=0;
-static int stat_construct_ba=0;
-static int stat_get_ascii=0;
-static int stat_get_ascii_size=0;
-static int stat_copy_on_write=0;
-static int stat_copy_on_write_size=0;
-static int stat_fast_copy=0;
-Q_EXPORT void qt_qstring_stats()
-{
- qDebug("construct_charstar = %d (%d chars)", stat_construct_charstar, stat_construct_charstar_size);
- qDebug("construct_null = %d", stat_construct_null);
- qDebug("construct_int = %d (%d chars)", stat_construct_int, stat_construct_int_size);
- qDebug("construct_ba = %d", stat_construct_ba);
- qDebug("get_ascii = %d (%d chars)", stat_get_ascii, stat_get_ascii_size);
- qDebug("copy_on_write = %d (%d chars)", stat_copy_on_write, stat_copy_on_write_size);
- qDebug("fast_copy = %d", stat_fast_copy);
-}
-#else
-#define Q2HELPER(x)
-#endif
-
-/*!
- \fn QString::QString()
-
- Constructs a null string.
- \sa isNull()
-*/
-
-/*!
- Constructs a string containing the one character \a ch.
-*/
-QString::QString( QChar ch )
-{
- d = new QStringData( QT_ALLOC_QCHAR_VEC( 1 ), 1, 1 );
- d->unicode[0] = ch;
-}
-
-/*!
- Constructs an implicitly-shared copy of \a s.
-*/
-QString::QString( const QString &s ) :
- d(s.d)
-{
- Q2HELPER(stat_fast_copy++)
- d->ref();
-}
-
-/*!
- Private function.
-
- Constructs a string with preallocated space for \a size characters.
-
- The string is empty.
-
- \sa isNull()
-*/
-
-QString::QString( int size, bool /*dummy*/ )
-{
- if ( size ) {
- Q2HELPER(stat_construct_int++)
- int l = size;
- Q2HELPER(stat_construct_int_size+=l)
- QChar* uc = QT_ALLOC_QCHAR_VEC( l );
- d = new QStringData( uc, 0, l );
- } else {
- Q2HELPER(stat_construct_null++)
- d = shared_null ? shared_null : (shared_null=new QStringData);
- d->ref();
- }
-}
-
-/*!
- Constructs a string that is a deep copy of \a ba interpreted as
- a classic C string.
-*/
-
-QString::QString( const QByteArray& ba )
-{
- Q2HELPER(stat_construct_ba++)
- uint l;
- QChar *uc = internalAsciiToUnicode(ba,&l);
- d = new QStringData(uc,l,l);
-}
-
-QString::QString( const QCString& ba )
-{
- //Q2HELPER(stat_construct_ba++)
- //uint l;
- //QChar *uc = internalAsciiToUnicode(ba,&l);
- //d = new QStringData(uc,l,l);
- Q2HELPER(stat_fast_copy++)
- QString s = QString::fromUtf8(ba.data(),ba.length());
- d = s.d;
- d->ref();
-}
-
-/*!
- Constructs a string that is a deep copy of the
- first \a length QChar in the array \a unicode.
-
- If \a unicode and \a length are 0, a null string is created.
-
- If only \a unicode is 0, the string is empty, but has
- \a length characters of space preallocated - QString expands
- automatically anyway, but this may speed some cases up a little.
-
- \sa isNull()
-*/
-
-QString::QString( const QChar* unicode, uint length )
-{
- if ( !unicode && !length ) {
- d = shared_null ? shared_null : makeSharedNull();
- d->ref();
- } else {
- QChar* uc = QT_ALLOC_QCHAR_VEC( length );
- if ( unicode )
- memcpy(uc, unicode, length*sizeof(QChar));
- d = new QStringData(uc,unicode ? length : 0,length);
- }
-}
-
-/*!
- Constructs a string that is a deep copy of \a str, interpreted as a
- classic C string.
-
- If \a str is 0 a null string is created.
-
- This is a cast constructor, but it is perfectly safe: converting a Latin1
- const char* to QString preserves all the information.
- You can disable this constructor by
- defining QT_NO_CAST_ASCII when you compile your applications.
- You can also make QString objects by using setLatin1()/fromLatin1(), or
- fromLocal8Bit(), fromUtf8(), or whatever encoding is appropriate for
- the 8-bit data you have.
-
- \sa isNull()
-*/
-
-QString::QString( const char *str )
-{
- //Q2HELPER(stat_construct_charstar++)
- //uint l;
- //QChar *uc = internalAsciiToUnicode(str,&l);
- //Q2HELPER(stat_construct_charstar_size+=l)
- //d = new QStringData(uc,l,l);
- Q2HELPER(stat_fast_copy++)
- QString s = QString::fromUtf8(str);
- d = s.d;
- d->ref();
-}
-
-
-/*! \fn QString::~QString()
-
-Destroys the string and frees the "real" string, if this was the last
-copy of that string.
-*/
-
-
-/*!
- Deallocates any space reserved solely by this QString.
-*/
-
-void QString::real_detach()
-{
- setLength( length() );
-}
-
-void QString::deref()
-{
- if ( d->deref() ) {
- if ( d == shared_null )
- shared_null = 0;
- delete d;
- d = 0; // helps debugging
- }
-}
-
-void QStringData::deleteSelf()
-{
- delete this;
-}
-
-/*!
- \fn QString& QString::operator=( QChar c )
- Sets the string to contain just the single character \a c.
-*/
-
-/*!
- \fn QString& QString::operator=( char c )
- Sets the string to contain just the single character \a c.
-*/
-
-/*!
- Assigns a shallow copy of \a s to this string and returns a
- reference to this string.
-*/
-QString &QString::operator=( const QString &s )
-{
- Q2HELPER(stat_fast_copy++)
- s.d->ref();
- deref();
- d = s.d;
- return *this;
-}
-
-/*!
- Assigns a deep copy of \a cs, interpreted as a classic C string, to
- this string and returns a reference to this string.
-*/
-QString &QString::operator=( const QCString& cs )
-{
- return setLatin1(cs);
-}
-
-
-/*!
- Assigns a deep copy of \a str, interpreted as a classic C string,
- to this string and returns a reference to this string.
-
- If \a str is 0 a null string is created.
-
- \sa isNull()
-*/
-QString &QString::operator=( const char *str )
-{
- return setLatin1(str);
-}
-
-
-/*!
- \fn bool QString::isNull() const
-
- Returns TRUE if the string is null.
- A null string is also an empty string.
-
- Example:
- \code
- QString a; // a.unicode() == 0, a.length() == 0
- QString b = ""; // b.unicode() == "", b.length() == 0
- a.isNull(); // TRUE, because a.unicode() == 0
- a.isEmpty(); // TRUE, because a.length() == 0
- b.isNull(); // FALSE, because b.unicode() != 0
- b.isEmpty(); // TRUE, because b.length() == 0
- \endcode
-
- \sa isEmpty(), length()
-*/
-
-/*!
- \fn bool QString::isEmpty() const
-
- Returns TRUE if the string is empty, i.e. if length() == 0.
- An empty string is not always a null string.
-
- See example in isNull().
-
- \sa isNull(), length()
-*/
-
-/*!
- \fn uint QString::length() const
-
- Returns the length of the string.
-
- Null strings and empty strings have zero length.
-
- \sa isNull(), isEmpty()
-*/
-
-/*!
- Truncates the string at position \a newLen if newLen is less than the
- current length . Otherwise, nothing happens.
-
- Example:
- \code
- QString s = "truncate this string";
- s.truncate( 5 ); // s == "trunc"
- \endcode
-
- In Qt 1.x, it was possible to "truncate" a string to a longer
- length. This is no longer possible.
-
-*/
-
-void QString::truncate( uint newLen )
-{
- if ( newLen < d->len )
- setLength( newLen );
-}
-
-/*### Make this public in 3.0
- Ensures that at least \a newLen characters are allocated, and
- sets the length to \a newLen. This function always detaches the
- string from other references to the same data. Any new space
- allocated is \e not defined.
-
- If \a newLen is 0, this string becomes empty, unless this string is
- null, in which case it remains null.
-
- \sa truncate(), isNull(), isEmpty()
-*/
-
-void QString::setLength( uint newLen )
-{
- if ( d->count != 1 || newLen > d->maxl || // detach, grow, or
- ( newLen*4 < d->maxl && d->maxl > 4 ) ) { // shrink
- Q2HELPER(stat_copy_on_write++)
- Q2HELPER(stat_copy_on_write_size+=d->len)
- uint newMax = 4;
- while ( newMax < newLen )
- newMax *= 2;
- QChar* nd = QT_ALLOC_QCHAR_VEC( newMax );
- uint len = QMIN( d->len, newLen );
- if ( d->unicode )
- memcpy( nd, d->unicode, sizeof(QChar)*len );
- deref();
- d = new QStringData( nd, newLen, newMax );
- } else {
- d->len = newLen;
- d->dirtyascii = 1;
- }
-}
-
-/*! Returns a string equal to this one, but with the lowest-numbered
- occurrence of \c %i (for a positive integer i) replaced by \a a.
-
- \code
- label.setText( tr("Rename %1 to %2?").arg(oldName).arg(newName) );
- \endcode
-
- \a fieldwidth is the minimum amount of space \a a is padded to. A
- positive value produces right-aligned text, while a negative value
- produces left aligned text.
-
- \warning Using arg() for constructing "real" sentences
- programmatically is likely to lead to translation problems.
- Inserting objects like numbers or file names is fairly safe.
-
- \warning Relying on spaces to create alignment is prone to lead to
- translation problems.
-
- If there is no \c %i pattern, a warning message (qWarning()) is
- printed and the text as appended at the end of the string. This is
- error recovery and should not occur in correct code.
-
- \sa QObject::tr()
-*/
-QString QString::arg(const QString& a, int fieldwidth) const
-{
- int pos, len;
- QString r = *this;
-
- if ( !findArg( pos, len ) ) {
- qWarning( "QString::arg(): Argument missing: %s, %s",
- (const char *)ascii(), (const char *)ascii() );
- // Make sure the text at least appears SOMEWHERE
- r += ' ';
- pos = r.length();
- len = 0;
- }
-
- r.replace( pos, len, a );
- if ( fieldwidth < 0 ) {
- QString s;
- while ( (uint)-fieldwidth > a.length() ) {
- s += ' ';
- fieldwidth++;
- }
- r.insert( pos + a.length(), s );
- } else if ( fieldwidth ) {
- QString s;
- while ( (uint)fieldwidth > a.length() ) {
- s += ' ';
- fieldwidth--;
- }
- r.insert( pos, s );
- }
-
- return r;
-}
-
-
-/*! \overload
-
- \a a is expressed in to \a base notation, which is decimal by
- default and must be in the range 2-36 inclusive.
-*/
-QString QString::arg(long a, int fieldwidth, int base) const
-{
- return arg( QString::number( a, base ), fieldwidth );
-}
-
-/*! \overload
-
- \a a is expressed in to \a base notation, which is decimal by
- default and must be in the range 2-36 inclusive.
-*/
-QString QString::arg(ulong a, int fieldwidth, int base) const
-{
- return arg( QString::number( a, base ), fieldwidth );
-}
-
-/*!
- \overload QString QString::arg(int a, int fieldwidth, int base) const
-
- \a a is expressed in to \a base notation, which is decimal by
- default and must be in the range 2-36 inclusive.
-
-*/
-
-/*!
- \overload QString QString::arg(uint a, int fieldwidth, int base) const
-
- \a a is expressed in to \a base notation, which is decimal by
- default and must be in the range 2-36 inclusive.
-*/
-
-/*!
- \overload QString QString::arg(short a, int fieldwidth, int base) const
-
- \a a is expressed in to \a base notation, which is decimal by
- default and must be in the range 2-36 inclusive.
-*/
-
-/*!
- \overload QString QString::arg(ushort a, int fieldwidth, int base) const
-
- \a a is expressed in to \a base notation, which is decimal by
- default and must be in the range 2-36 inclusive.
-*/
-
-
-/*! \overload
-
- \a a is assumed to be in the Latin1 character set.
-*/
-QString QString::arg(char a, int fieldwidth) const
-{
- QString c;
- c += a;
- return arg( c, fieldwidth );
-}
-
-/*! \overload
-*/
-QString QString::arg(QChar a, int fieldwidth) const
-{
- QString c;
- c += a;
- return arg( c, fieldwidth );
-}
-
-/*! \overload
-
- \a is formatted according to the \a fmt format specified, which is
- 'g' by default and can be any of 'f', 'F', 'e', 'E', 'g' or 'G', all
- of which have the same meaning as for sprintf(). \a prec determines
- the precision, just as for number() and sprintf().
-*/
-QString QString::arg(double a, int fieldwidth, char fmt, int prec) const
-{
- return arg( QString::number( a, fmt, prec ), fieldwidth );
-}
-
-
-/*!
- Just 1-digit arguments.
-*/
-bool QString::findArg(int& pos, int& len) const
-{
- char lowest=0;
- for (uint i=0; i<length(); i++) {
- if ( at(i) == '%' && i+1<length() ) {
- char dig = at(i+1);
- if ( dig >= '0' && dig <= '9' ) {
- if ( !lowest || dig < lowest ) {
- lowest = dig;
- pos = i;
- len = 2;
- }
- }
- }
- }
- return lowest != 0;
-}
-
-/*!
- Safely builds a formatted string from a format string and an
- arbitrary list of arguments. The format string supports all
- the escape sequences of printf() in the standard C library.
-
- The %s escape sequence expects a utf8() encoded string.
- The format string \e cformat is expected to be in latin1. If you need a unicode
- format string, use QString::arg() instead. For typesafe
- string building, with full Unicode support, you can use QTextOStream
- like this:
-
- \code
- QString str;
- QString s = ...;
- int x = ...;
- QTextOStream(&str) << s << " : " << x;
- \endcode
-
- For \link QObject::tr() translations,\endlink especially if the
- strings contains more than one escape sequence, you should consider
- using the arg() function instead. This allows the order of the
- replacements to be controlled by the translator, and has Unicode
- support.
-
- \sa arg()
-*/
-
-QString &QString::sprintf( const char* cformat, ... )
-{
- va_list ap;
- va_start( ap, cformat );
-
- if ( !cformat || !*cformat ) {
- // Qt 1.x compat
- *this = QString::fromLatin1( "" );
- return *this;
- }
- QString format = QString::fromLatin1( cformat );
-
- static QRegExp *escape = 0;
- if (!escape)
- escape = new QRegExp( "%#?0?-? ?\\+?'?[0-9*]*\\.?[0-9*]*h?l?L?q?Z?" );
-
- QString result;
- uint last = 0;
-
- int len = 0;
- int pos;
- while ( 1 ) {
- pos = escape->match( cformat, last, &len );
- // Non-escaped text
- if ( pos > (int)last )
- result += format.mid(last,pos-last);
- if ( pos < 0 ) {
- // The rest
- if ( last < format.length() )
- result += format.mid(last);
- break;
- }
- last = pos + len + 1;
-
- // Escape
- QString f = format.mid( pos, len );
- uint width, decimals;
- int params = 0;
- int wpos = f.find('*');
- if ( wpos >= 0 ) {
- params++;
- width = va_arg( ap, int );
- if ( f.find('*', wpos + 1) >= 0 ) {
- decimals = va_arg( ap, int );
- params++;
- } else {
- decimals = 0;
- }
- } else {
- decimals = width = 0;
- }
- QString replacement;
- if ( format[pos+len] == 's' ||
- format[pos+len] == 'S' ||
- format[pos+len] == 'c' )
- {
- bool rightjust = ( f.find('-') < 0 );
- // Yes, %-5s really means left adjust in sprintf
-
- if ( wpos < 0 ) {
- QRegExp num( "[0-9]+" );
- QRegExp dot( "\\." );
- int nlen;
- int p = num.match( f.data(), 0, &nlen );
- int q = dot.match( f.data(), 0 );
- if ( q < 0 || (p < q && p >= 0) )
- width = f.mid( p, nlen ).toInt();
- if ( q >= 0 ) {
- p = num.match( f.data(), q );
- // "decimals" is used to specify string truncation
- if ( p >= 0 )
- decimals = f.mid( p, nlen ).toInt();
- }
- }
-
- if ( format[pos+len] == 's' ) {
-#ifndef QT_NO_TEXTCODEC
- QString s = QString::fromUtf8(va_arg(ap, char*));
-#else
- QString s = QString::fromLatin1(va_arg(ap, char*));
-#endif
- if ( decimals <= 0 )
- replacement = s;
- else
- replacement = s.left(decimals);
- } else {
- int ch = va_arg(ap, int);
- replacement = QChar((ushort)ch);
- }
- if ( replacement.length() < width ) {
- replacement = rightjust
- ? replacement.rightJustify(width)
- : replacement.leftJustify(width);
- }
- } else if ( format[pos+len] == '%' ) {
- replacement = '%';
- } else if ( format[pos+len] == 'n' ) {
- int* n = va_arg(ap, int*);
- *n = result.length();
- } else {
- char in[64], out[330] = "";
- strncpy(in,f.latin1(),63);
- char fch = format[pos+len].latin1();
- in[f.length()] = fch;
- switch ( fch ) {
- case 'd': case 'i': case 'o': case 'u': case 'x': case 'X': {
- int value = va_arg(ap, int);
- switch (params) {
- case 0: ::sprintf( out, in, value ); break;
- case 1: ::sprintf( out, in, width, value ); break;
- case 2: ::sprintf( out, in, width, decimals, value ); break;
- }
- } break;
- case 'e': case 'E': case 'f': case 'g': case 'G': {
- double value = va_arg(ap, double);
- switch (params) {
- case 0: ::sprintf( out, in, value ); break;
- case 1: ::sprintf( out, in, width, value ); break;
- case 2: ::sprintf( out, in, width, decimals, value ); break;
- }
- } break;
- case 'p': {
- void* value = va_arg(ap, void*);
- switch (params) {
- case 0: ::sprintf( out, in, value ); break;
- case 1: ::sprintf( out, in, width, value ); break;
- case 2: ::sprintf( out, in, width, decimals, value ); break;
- }
- } break;
- }
- replacement = QString::fromLatin1(out);
- }
- result += replacement;
- }
- *this = result;
-
- va_end( ap );
- return *this;
-}
-
-/*!
- Fills the string with \a len characters of value \a c.
-
- If \a len is negative, the current string length is used.
-*/
-
-void QString::fill( QChar c, int len )
-{
- if ( len < 0 )
- len = length();
- if ( len == 0 ) {
- *this = "";
- } else {
- deref();
- QChar * nd = QT_ALLOC_QCHAR_VEC( len );
- d = new QStringData(nd,len,len);
- while (len--) *nd++ = c;
- }
-}
-
-
-/*!
- \fn QString QString::copy() const
-
- \obsolete
-
- Returns a deep copy of this string.
-
- Doing this is redundant in Qt 2.x, since QString is implicitly
- shared, and so will automatically be deeply copied as necessary.
-*/
-
-/*!
- Finds the first occurrence of the character \a c, starting at
- position \a index. If \a index is -1, the search starts at the
- last character; if -2, at the next to last character; etc.
-
- The search is case sensitive if \a cs is TRUE, or case insensitive
- if \a cs is FALSE.
-
- Returns the position of \a c, or -1 if \a c could not be found.
-*/
-
-int QString::find( QChar c, int index, bool cs ) const
-{
- if ( index < 0 )
- index += length();
- if ( (uint)index >= length() ) // index outside string
- return -1;
- const QChar *uc;
- uc = unicode()+index;
- int n = length()-index;
- if ( cs ) {
- while ( n-- && *uc != c )
- uc++;
- } else {
- c = c.lower();
- while ( n-- && uc->lower() != c )
- uc++;
- }
- if ( uint(uc - unicode()) >= length() )
- return -1;
- return (int)(uc - unicode());
-}
-
-/*!
- Finds the first occurrence of the string \a str, starting at position
- \a index. If \a index is -1, the search starts at the last character;
- if -2, at the next to last character; etc.
-
- The search is case sensitive if \a cs is TRUE, or case insensitive if
- \a cs is FALSE.
-
- Returns the position of \a str, or -1 if \a str could not be found.
-*/
-
-int QString::find( const QString& str, int index, bool cs ) const
-{
- /*
- We use some weird hashing for efficiency's sake. Instead of
- comparing strings, we compare the hash value of str with that of
- a part of this QString. Only if that matches, we call ucstrncmp
- or ucstrnicmp.
-
- The hash value of a string is the sum of the cells of its
- QChars.
- */
- if ( index < 0 )
- index += length();
- int lstr = str.length();
- int lthis = length() - index;
- if ( (uint)lthis > length() )
- return -1;
- int delta = lthis - lstr;
- if ( delta < 0 )
- return -1;
-
- const QChar *uthis = unicode() + index;
- const QChar *ustr = str.unicode();
- uint hthis = 0;
- uint hstr = 0;
- int i;
- if ( cs ) {
- for ( i = 0; i < lstr; i++ ) {
- hthis += uthis[i].cell();
- hstr += ustr[i].cell();
- }
- i = 0;
- while ( TRUE ) {
- if ( hthis == hstr && ucstrncmp(uthis + i, ustr, lstr) == 0 )
- return index + i;
- if ( i == delta )
- return -1;
- hthis += uthis[i + lstr].cell();
- hthis -= uthis[i].cell();
- i++;
- }
- } else {
- for ( i = 0; i < lstr; i++ ) {
- hthis += uthis[i].lower().cell();
- hstr += ustr[i].lower().cell();
- }
- i = 0;
- while ( TRUE ) {
- if ( hthis == hstr && ucstrnicmp(uthis + i, ustr, lstr) == 0 )
- return index + i;
- if ( i == delta )
- return -1;
- hthis += uthis[i + lstr].lower().cell();
- hthis -= uthis[i].lower().cell();
- i++;
- }
- }
-#if defined(Q_SPURIOUS_NON_VOID_WARNING)
- return -1;
-#endif
-}
-
-/*!
- \fn int QString::findRev( const char* str, int index ) const
-
- Equivalent to findRev(QString(str), index).
-*/
-
-/*!
- \fn int QString::find( const char* str, int index ) const
-
- Equivalent to find(QString(str), index).
-*/
-
-/*!
- Finds the first occurrence of the character \a c, starting at
- position \a index and searching backwards. If \a index is -1,
- the search starts at the last character; if -2, at the next to
- last character; etc.
-
- The search is case sensitive if \a cs is TRUE, or case insensitive if \a
- cs is FALSE.
-
- Returns the position of \a c, or -1 if \a c could not be found.
-*/
-
-int QString::findRev( QChar c, int index, bool cs ) const
-{
- QString t( c );
- return findRev( t, index, cs );
-}
-
-/*!
- Finds the first occurrence of the string \a str, starting at
- position \a index and searching backwards. If \a index is -1,
- the search starts at the last character; -2, at the next to last
- character; etc.
-
- The search is case sensitive if \a cs is TRUE, or case insensitive if \e
- cs is FALSE.
-
- Returns the position of \a str, or -1 if \a str could not be found.
-*/
-
-int QString::findRev( const QString& str, int index, bool cs ) const
-{
- /*
- See QString::find() for explanations.
- */
- int lthis = length();
- if ( index < 0 )
- index += lthis;
-
- int lstr = str.length();
- int delta = lthis - lstr;
- if ( index < 0 || index > lthis || delta < 0 )
- return -1;
- if ( index > delta )
- index = delta;
-
- const QChar *uthis = unicode();
- const QChar *ustr = str.unicode();
- uint hthis = 0;
- uint hstr = 0;
- int i;
- if ( cs ) {
- for ( i = 0; i < lstr; i++ ) {
- hthis += uthis[index + i].cell();
- hstr += ustr[i].cell();
- }
- i = index;
- while ( TRUE ) {
- if ( hthis == hstr && ucstrncmp(uthis + i, ustr, lstr) == 0 )
- return i;
- if ( i == 0 )
- return -1;
- i--;
- hthis -= uthis[i + lstr].cell();
- hthis += uthis[i].cell();
- }
- } else {
- for ( i = 0; i < lstr; i++ ) {
- hthis += uthis[index + i].lower().cell();
- hstr += ustr[i].lower().cell();
- }
- i = index;
- while ( TRUE ) {
- if ( hthis == hstr && ucstrnicmp(uthis + i, ustr, lstr) == 0 )
- return i;
- if ( i == 0 )
- return -1;
- i--;
- hthis -= uthis[i + lstr].lower().cell();
- hthis += uthis[i].lower().cell();
- }
- }
-#if defined(Q_SPURIOUS_NON_VOID_WARNING)
- return -1;
-#endif
-}
-
-
-/*!
- Returns the number of times the character \a c occurs in the string.
-
- The match is case sensitive if \a cs is TRUE, or case insensitive if \a cs
- is FALSE.
-*/
-
-int QString::contains( QChar c, bool cs ) const
-{
- int count = 0;
- const QChar *uc = unicode();
- if ( !uc )
- return 0;
- int n = length();
- if ( cs ) { // case sensitive
- while ( n-- )
- if ( *uc++ == c )
- count++;
- } else { // case insensitive
- c = c.lower();
- while ( n-- ) {
- if ( uc->lower() == c )
- count++;
- uc++;
- }
- }
- return count;
-}
-
-/*!
- \overload
-*/
-int QString::contains( const char* str, bool cs ) const
-{
- return contains(QString(str),cs);
-}
-
-/*!
- \overload int QString::contains (char c, bool cs) const
-*/
-
-/*!
- \overload int QString::find (char c, int index, bool cs) const
-
-*/
-
-/*!
- \overload int QString::findRev (char c, int index, bool cs) const
-
-*/
-
-/*!
- Returns the number of times \a str occurs in the string.
-
- The match is case sensitive if \a cs is TRUE, or case insensitive if \e
- cs is FALSE.
-
- This function counts overlapping substrings, for example, "banana"
- contains two occurrences of "ana".
-
- \sa findRev()
-*/
-
-int QString::contains( const QString &str, bool cs ) const
-{
- int count = 0;
- const QChar *uc = unicode();
- if ( !uc )
- return 0;
- int len = str.length();
- int n = length();
- while ( n-- ) { // counts overlapping strings
- // ### Doesn't account for length of this - searches over "end"
- if ( cs ) {
- if ( ucstrncmp( uc, str.unicode(), len ) == 0 )
- count++;
- } else {
- if ( ucstrnicmp(uc, str.unicode(), len) == 0 )
- count++;
- }
- uc++;
- }
- return count;
-}
-
-/*!
- Returns a substring that contains the \a len leftmost characters
- of the string.
-
- The whole string is returned if \a len exceeds the length of the
- string.
-
-
- Example:
- \code
- QString s = "Pineapple";
- QString t = s.left( 4 ); // t == "Pine"
- \endcode
-
- \sa right(), mid(), isEmpty()
-*/
-
-QString QString::left( uint len ) const
-{
- if ( isEmpty() ) {
- return QString();
- } else if ( len == 0 ) { // ## just for 1.x compat:
- return QString::fromLatin1("");
- } else if ( len > length() ) {
- return *this;
- } else {
- QString s( len, TRUE );
- memcpy( s.d->unicode, d->unicode, len*sizeof(QChar) );
- s.d->len = len;
- return s;
- }
-}
-
-/*!
- Returns a substring that contains the \a len rightmost characters
- of the string.
-
- The whole string is returned if \a len exceeds the length of the
- string.
-
- Example:
- \code
- QString s = "Pineapple";
- QString t = s.right( 5 ); // t == "apple"
- \endcode
-
- \sa left(), mid(), isEmpty()
-*/
-
-QString QString::right( uint len ) const
-{
- if ( isEmpty() ) {
- return QString();
- } else if ( len == 0 ) { // ## just for 1.x compat:
- return QString::fromLatin1("");
- } else {
- uint l = length();
- if ( len > l )
- len = l;
- QString s( len, TRUE );
- memcpy( s.d->unicode, d->unicode+(l-len), len*sizeof(QChar) );
- s.d->len = len;
- return s;
- }
-}
-
-/*!
- Returns a substring that contains the \a len characters of this
- string, starting at position \a index.
-
- Returns a null string if the string is empty or \a index is out
- of range. Returns the whole string from \a index if \a index+len exceeds
- the length of the string.
-
- Example:
- \code
- QString s = "Five pineapples";
- QString t = s.mid( 5, 4 ); // t == "pine"
- \endcode
-
- \sa left(), right()
-*/
-
-QString QString::mid( uint index, uint len ) const
-{
- uint slen = length();
- if ( isEmpty() || index >= slen ) {
- return QString();
- } else if ( len == 0 ) { // ## just for 1.x compat:
- return QString::fromLatin1("");
- } else {
- if ( len > slen-index )
- len = slen - index;
- if ( index == 0 && len == length() )
- return *this;
- const QChar *p = unicode()+index;
- QString s( len, TRUE );
- memcpy( s.d->unicode, p, len*sizeof(QChar) );
- s.d->len = len;
- return s;
- }
-}
-
-/*!
- Returns a string of length \a width that contains this
- string and padded by the \a fill character.
-
- If the length of the string exceeds \a width and \a truncate is FALSE,
- then the returned string is a copy of the string.
- If the length of the string exceeds \a width and \a truncate is TRUE,
- then the returned string is a left(\a width).
-
- Example:
- \code
- QString s("apple");
- QString t = s.leftJustify(8, '.'); // t == "apple..."
- \endcode
-
- \sa rightJustify()
-*/
-
-QString QString::leftJustify( uint width, QChar fill, bool truncate ) const
-{
- QString result;
- int len = length();
- int padlen = width - len;
- if ( padlen > 0 ) {
- result.setLength(len+padlen);
- if ( len )
- memcpy( result.d->unicode, unicode(), sizeof(QChar)*len );
- QChar* uc = result.d->unicode + len;
- while (padlen--)
- *uc++ = fill;
- } else {
- if ( truncate )
- result = left( width );
- else
- result = *this;
- }
- return result;
-}
-
-/*!
- Returns a string of length \a width that contains pad
- characters followed by the string.
-
- If the length of the string exceeds \a width and \a truncate is FALSE,
- then the returned string is a copy of the string.
- If the length of the string exceeds \a width and \a truncate is TRUE,
- then the returned string is a left(\a width).
-
- Example:
- \code
- QString s("pie");
- QString t = s.rightJustify(8, '.'); // t == ".....pie"
- \endcode
-
- \sa leftJustify()
-*/
-
-QString QString::rightJustify( uint width, QChar fill, bool truncate ) const
-{
- QString result;
- int len = length();
- int padlen = width - len;
- if ( padlen > 0 ) {
- result.setLength( len+padlen );
- QChar* uc = result.d->unicode;
- while (padlen--)
- *uc++ = fill;
- if ( len )
- memcpy( uc, unicode(), sizeof(QChar)*len );
- } else {
- if ( truncate )
- result = left( width );
- else
- result = *this;
- }
- return result;
-}
-
-/*!
- Returns a new string that is the string converted to lower case.
-
- Example:
- \code
- QString s("TeX");
- QString t = s.lower(); // t == "tex"
- \endcode
-
- \sa upper()
-*/
-
-QString QString::lower() const
-{
- QString s(*this);
- int l=length();
- if ( l ) {
- s.real_detach(); // could do this only when we find a change
- QChar *p=s.d->unicode;
- if ( p ) {
- while ( l-- ) {
- *p = p->lower();
- p++;
- }
- }
- }
- return s;
-}
-
-/*!
- Returns a new string that is the string converted to upper case.
-
- Example:
- \code
- QString s("TeX");
- QString t = s.upper(); // t == "TEX"
- \endcode
-
- \sa lower()
-*/
-
-QString QString::upper() const
-{
- QString s(*this);
- int l=length();
- if ( l ) {
- s.real_detach(); // could do this only when we find a change
- QChar *p=s.d->unicode;
- if ( p ) {
- while ( l-- ) {
- *p = p->upper();
- p++;
- }
- }
- }
- return s;
-}
-
-
-/*!
- Returns a new string that has white space removed from the start and the end.
-
- White space means any character for which QChar::isSpace() returns
- TRUE. This includes ASCII characters 9 (TAB), 10 (LF), 11 (VT), 12
- (FF), 13 (CR), and 32 (Space).
-
- Example:
- \code
- QString s = " space ";
- QString t = s.stripWhiteSpace(); // t == "space"
- \endcode
-
- \sa simplifyWhiteSpace()
-*/
-
-QString QString::stripWhiteSpace() const
-{
- if ( isEmpty() ) // nothing to do
- return *this;
- if ( !at(0).isSpace() && !at(length()-1).isSpace() )
- return *this;
-
- const QChar *s = unicode();
- QString result = fromLatin1("");
-
- int start = 0;
- int end = length() - 1;
- while ( start<=end && s[start].isSpace() ) // skip white space from start
- start++;
- if ( start > end ) { // only white space
- return result;
- }
- while ( end && s[end].isSpace() ) // skip white space from end
- end--;
- int l = end - start + 1;
- result.setLength( l );
- if ( l )
- memcpy( result.d->unicode, &s[start], sizeof(QChar)*l );
- return result;
-}
-
-
-/*!
- Returns a new string that has white space removed from the start and the end,
- plus any sequence of internal white space replaced with a single space
- (ASCII 32).
-
- White space means any character for which QChar::isSpace() returns
- TRUE. This includes ASCII characters 9 (TAB), 10 (LF), 11 (VT), 12
- (FF), 13 (CR), and 32 (Space).
-
- \code
- QString s = " lots\t of\nwhite space ";
- QString t = s.simplifyWhiteSpace(); // t == "lots of white space"
- \endcode
-
- \sa stripWhiteSpace()
-*/
-
-QString QString::simplifyWhiteSpace() const
-{
- if ( isEmpty() ) // nothing to do
- return *this;
- QString result;
- result.setLength( length() );
- const QChar *from = unicode();
- const QChar *fromend = from+length();
- int outc=0;
- QChar *to = result.d->unicode;
- while ( TRUE ) {
- while ( from!=fromend && from->isSpace() )
- from++;
- while ( from!=fromend && !from->isSpace() )
- to[outc++] = *from++;
- if ( from!=fromend )
- to[outc++] = ' ';
- else
- break;
- }
- if ( outc > 0 && to[outc-1] == ' ' )
- outc--;
- result.truncate( outc );
- return result;
-}
-
-
-/*!
- Insert \a s into the string before position \a index.
-
- If \a index is beyond the end of the string, the string is extended with
- spaces (ASCII 32) to length \a index and \a s is then appended.
-
- \code
- QString s = "I like fish";
- s.insert( 2, "don't "); // s == "I don't like fish"
- s = "x";
- s.insert( 3, "yz" ); // s == "x yz"
- \endcode
-*/
-
-QString &QString::insert( uint index, const QString &s )
-{
- // the sub function takes care of &s == this case.
- return insert( index, s.unicode(), s.length() );
-}
-
-/*!
- Insert \a len units of QChar data from \a s into the string before
- position \a index.
-*/
-
-QString &QString::insert( uint index, const QChar* s, uint len )
-{
- if ( len == 0 )
- return *this;
- uint olen = length();
- int nlen = olen + len;
-
- int df = (int)(s - d->unicode); // ### pointer subtraction, cast down to int
- if ( df >= 0 && (uint)df < d->maxl ) {
- // Part of me - take a copy.
- QChar *tmp = QT_ALLOC_QCHAR_VEC( len );
- memcpy(tmp,s,len*sizeof(QChar));
- insert(index,tmp,len);
- QT_DELETE_QCHAR_VEC( tmp );
- return *this;
- }
-
- if ( index >= olen ) { // insert after end of string
- setLength( len+index );
- int n = index-olen;
- QChar* uc = d->unicode+olen;
- while (n--)
- *uc++ = ' ';
- memcpy( d->unicode+index, s, sizeof(QChar)*len );
- } else { // normal insert
- setLength( nlen );
- memmove( d->unicode+index+len, unicode()+index,
- sizeof(QChar)*(olen-index) );
- memcpy( d->unicode+index, s, sizeof(QChar)*len );
- }
- return *this;
-}
-
-/*!
- Insert \a c into the string at (before) position \a index and returns
- a reference to the string.
-
- If \a index is beyond the end of the string, the string is extended with
- spaces (ASCII 32) to length \a index and \a c is then appended.
-
- Example:
- \code
- QString s = "Ys";
- s.insert( 1, 'e' ); // s == "Yes"
- s.insert( 3, '!'); // s == "Yes!"
- \endcode
-
- \sa remove(), replace()
-*/
-
-QString &QString::insert( uint index, QChar c ) // insert char
-{
- QString s( c );
- return insert( index, s );
-}
-
-/*!
- \overload QString& QString::insert( uint index, char c )
-*/
-
-/*!
- \fn QString &QString::prepend( const QString &s )
-
- Prepend \a s to the string. Equivalent to insert(0,s).
-
- \sa insert()
-*/
-
-/*!
- \fn QString& QString::prepend( char ch )
- Prepends \a ch to the string and returns a reference to the result.
-
- \sa insert()
- */
-
-/*!
- \fn QString& QString::prepend( QChar ch )
- Prepends \a ch to the string and returns a reference to the result.
-
- \sa insert()
- */
-
-
-/*!
- Removes \a len characters starting at position \a index from the
- string and returns a reference to the string.
-
- If \a index is too big, nothing happens. If \a index is valid, but
- \a len is too large, the rest of the string is removed.
-
- \code
- QString s = "Montreal";
- s.remove( 1, 4 );
- // s == "Meal"
- \endcode
-
- \sa insert(), replace()
-*/
-
-QString &QString::remove( uint index, uint len )
-{
- uint olen = length();
- if ( index + len >= olen ) { // range problems
- if ( index < olen ) { // index ok
- setLength( index );
- }
- } else if ( len != 0 ) {
- real_detach();
- memmove( d->unicode+index, d->unicode+index+len,
- sizeof(QChar)*(olen-index-len) );
- setLength( olen-len );
- }
- return *this;
-}
-
-/*!
- Replaces \a len characters starting at position \a index from the
- string with \a s, and returns a reference to the string.
-
- If \a index is too big, nothing is deleted and \a s is inserted at the
- end of the string. If \a index is valid, but \a len is too large, \e
- str replaces the rest of the string.
-
- \code
- QString s = "Say yes!";
- s.replace( 4, 3, "NO" ); // s == "Say NO!"
- \endcode
-
- \sa insert(), remove()
-*/
-
-QString &QString::replace( uint index, uint len, const QString &s )
-{
- return replace( index, len, s.unicode(), s.length() );
-}
-
-
-/*!
- Replaces \a len characters starting at position \a index by
- \a slen units to QChar data from \a s, and returns a reference to the string.
-
- \sa insert(), remove()
-*/
-
-QString &QString::replace( uint index, uint len, const QChar* s, uint slen )
-{
- if ( len == slen && index + len <= length() ) {
- // Optimized common case: replace without size change
- real_detach();
- memcpy( d->unicode+index, s, len*sizeof(QChar) );
- } else {
- int df = (int)(s - d->unicode); // ### pointer subtraction, cast down to int
- if ( df >= 0 && (uint)df < d->maxl ) {
- // Part of me - take a copy.
- QChar *tmp = QT_ALLOC_QCHAR_VEC( slen );
- memcpy(tmp,s,slen*sizeof(QChar));
- replace(index,len,tmp,slen);
- QT_DELETE_QCHAR_VEC( tmp );
- return *this;
- }
-
- remove( index, len );
- insert( index, s, slen );
- }
- return *this;
-}
-
-
-
-/*!
- Finds the first occurrence of the regular expression \a rx, starting at
- position \a index. If \a index is -1, the search starts at the last
- character; if -2, at the next to last character; etc.
-
- Returns the position of the next match, or -1 if \a rx was not found.
-
- \sa findRev() replace() contains()
-*/
-
-int QString::find( const QRegExp &rx, int index ) const
-{
- if ( index < 0 )
- index += length();
- return rx.match( data(), index );
-}
-
-/*!
- Finds the first occurrence of the regular expression \a rx, starting at
- position \a index and searching backwards. If \a index is -1, the
- search starts at the last character; if -2, at the next to last
- character; etc.
-
- Returns the position of the next match (backwards), or -1 if \a rx was not
- found.
-
- \sa find()
-*/
-
-int QString::findRev( const QRegExp &rx, int index ) const
-{
- if ( index < 0 ) // neg index ==> start from end
- index += length();
- if ( (uint)index > length() ) // bad index
- return -1;
- while( index >= 0 ) {
- if ( rx.match( data(), index ) == index )
- return index;
- index--;
- }
- return -1;
-}
-
-/*!
- Counts the number of overlapping occurrences of \a rx in the string.
-
- Example:
- \code
- QString s = "banana and panama";
- QRegExp r = QRegExp("a[nm]a", TRUE, FALSE);
- s.contains( r ); // 4 matches
- \endcode
-
- \sa find() findRev()
-*/
-
-int QString::contains( const QRegExp &rx ) const
-{
- if ( isEmpty() )
- return rx.match( data() ) < 0 ? 0 : 1;
- int count = 0;
- int index = -1;
- int len = length();
- while ( index < len-1 ) { // count overlapping matches
- index = rx.match( data(), index+1 );
- if ( index < 0 )
- break;
- count++;
- }
- return count;
-}
-
-
-/*!
- Replaces every occurrence of \a rx in the string with \a str.
- Returns a reference to the string.
-
- Examples:
- \code
- QString s = "banana";
- s.replace( QRegExp("a.*a"), "" ); // becomes "b"
-
- QString s = "banana";
- s.replace( QRegExp("^[bn]a"), " " ); // becomes " nana"
-
- QString s = "banana";
- s.replace( QRegExp("^[bn]a"), "" ); // NOTE! becomes ""
- \endcode
-
- \sa find() findRev()
-*/
-
-QString &QString::replace( const QRegExp &rx, const QString &str )
-{
- if ( isEmpty() )
- return *this;
- int index = 0;
- int slen = str.length();
- int len;
- while ( index < (int)length() ) {
- index = rx.match( data(), index, &len, FALSE );
- if ( index >= 0 ) {
- replace( index, len, str );
- index += slen;
- if ( !len )
- break; // Avoid infinite loop on 0-length matches, e.g. [a-z]*
- }
- else
- break;
- }
- return *this;
-}
-
-static bool
-ok_in_base( QChar c, int base )
-{
- if ( base <= 10 )
- return c.isDigit() && c.digitValue() < base;
- else
- return c.isDigit() || (c >= 'a' && c < char('a'+base-10))
- || (c >= 'A' && c < char('A'+base-10));
-}
-
-/*!
- Returns the string converted to a <code>long</code> value.
-
- If \a ok is non-null, \a *ok is set to TRUE if there are no
- conceivable errors, and FALSE if the string is not a number at all, or if
- it has trailing garbage.
-*/
-
-long QString::toLong( bool *ok, int base ) const
-{
- const QChar *p = unicode();
- 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 && p->isSpace() ) // 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->isDigit() ) {
- dv = p->digitValue();
- } 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 && p->isSpace() ) // skip trailing space
- l--,p++;
- if ( !l )
- is_ok = TRUE;
-bye:
- if ( ok )
- *ok = is_ok;
- return is_ok ? val : 0;
-}
-
-/*!
- Returns the string converted to an <code>unsigned long</code>
- value.
-
- If \a ok is non-null, \a *ok is set to TRUE if there are no
- conceivable errors, and FALSE if the string is not a number at all,
- or if it has trailing garbage.
-*/
-
-ulong QString::toULong( bool *ok, int base ) const
-{
- const QChar *p = unicode();
- 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 && p->isSpace() ) // 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->isDigit() ) {
- dv = p->digitValue();
- } 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 && p->isSpace() ) // skip trailing space
- l--,p++;
- if ( !l )
- is_ok = TRUE;
-bye:
- if ( ok )
- *ok = is_ok;
- return is_ok ? val : 0;
-}
-
-/*!
- Returns the string converted to an <code>unsigned long</code>
- value.
-
- If \a ok is non-null, \a *ok is set to TRUE if there are no
- conceivable errors, and FALSE if the string is not a number at all,
- or if it has trailing garbage.
-*/
-
-uint64 QString::toUInt64( bool *ok, int base ) const
-{
- const QChar *p = unicode();
- 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 && p->isSpace() ) // 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->isDigit() ) {
- dv = p->digitValue();
- } 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 && p->isSpace() ) // skip trailing space
- l--,p++;
- if ( !l )
- is_ok = TRUE;
-bye:
- if ( ok )
- *ok = is_ok;
- return is_ok ? val : 0;
-}
-
-
-/*!
- Returns the string converted to a <code>short</code> value.
-
- If \a ok is non-null, \a *ok is set to TRUE if there are no
- conceivable errors, and FALSE if the string is not a number at all, or if
- it has trailing garbage.
-*/
-
-short QString::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;
-}
-
-/*!
- Returns the string converted to an <code>unsigned short</code> value.
-
- If \a ok is non-null, \a *ok is set to TRUE if there are no
- conceivable errors, and FALSE if the string is not a number at all, or if
- it has trailing garbage.
-*/
-
-ushort QString::toUShort( bool *ok, int base ) const
-{
- ulong v = toULong( ok, base );
- if ( ok && *ok && (v > 65535) ) {
- *ok = FALSE;
- v = 0;
- }
- return (ushort)v;
-}
-
-
-/*!
- Returns the string converted to a <code>int</code> value.
-
- \code
- QString str("FF");
- bool ok;
- int hex = str.toInt( &ok, 16 ); // will return 255, and ok set to TRUE
- int dec = str.toInt( &ok, 10 ); // will return 0, and ok set to FALSE
- \endcode
-
- If \a ok is non-null, \a *ok is set to TRUE if there are no
- conceivable errors, and FALSE if the string is not a number at all,
- or if it has trailing garbage.
-*/
-
-int QString::toInt( bool *ok, int base ) const
-{
- return (int)toLong( ok, base );
-}
-
-/*!
- Returns the string converted to an <code>unsigned int</code> value.
-
- If \a ok is non-null, \a *ok is set to TRUE if there are no
- conceivable errors, and FALSE if the string is not a number at all,
- or if it has trailing garbage.
-*/
-
-uint QString::toUInt( bool *ok, int base ) const
-{
- return (uint)toULong( ok, base );
-}
-
-/*!
- Returns the string converted to a <code>double</code> value.
-
- If \a ok is non-null, \a *ok is set to TRUE if there are no conceivable
- errors, and FALSE if the string is not a number at all, or if it has
- trailing garbage.
-*/
-
-double QString::toDouble( bool *ok ) const
-{
- char *end;
-
- QCString a = latin1();
- // Just latin1() is not sufficient, since U0131 would look like '1'.
- for (uint i=0; i<d->len; i++)
- if ( d->unicode[i].row() )
- a[(int)i]='z';
-
- double val = strtod( a.data() ? a.data() : "", &end );
- if ( ok )
- *ok = ( a && *a && ( end == 0 || *end == '\0' ) );
- return val;
-}
-
-/*!
- Returns the string converted to a <code>float</code> value.
-
- If \a ok is non-null, \a *ok is set to TRUE if there are no
- conceivable errors, and FALSE if the string is not a number at all,
- or if it has trailing garbage.
-*/
-
-float QString::toFloat( bool *ok ) const
-{
- return (float)toDouble( ok );
-}
-
-
-/*!
- Sets the string to the printed value of \a n and returns a
- reference to the string.
-
- The value is converted to \a base notation (default is decimal).
- The base must be a value from 2 to 36.
-*/
-
-QString &QString::setNum( long n, int base )
-{
-#if defined(CHECK_RANGE)
- if ( base < 2 || base > 36 ) {
- qWarning( "QString::setNum: Invalid base %d", base );
- base = 10;
- }
-#endif
- char charbuf[65*sizeof(QChar)];
- QChar *buf = (QChar*)charbuf;
- QChar *p = &buf[64];
- int len = 0;
- bool neg;
- if ( n < 0 ) {
- neg = TRUE;
- if ( n == INT_MIN ) {
- // Cannot always negate this special case
- QString s1, s2;
- s1.setNum(n/base);
- s2.setNum((-(n+base))%base);
- *this = s1 + s2;
- return *this;
- }
- n = -n;
- } else {
- neg = FALSE;
- }
- do {
- *--p = "0123456789abcdefghijklmnopqrstuvwxyz"[((int)(n%base))];
- n /= base;
- len++;
- } while ( n );
- if ( neg ) {
- *--p = '-';
- len++;
- }
- return setUnicode( p, len );
-}
-
-/*!
- Sets the string to the printed unsigned value of \a n and
- returns a reference to the string.
-
- The value is converted to \a base notation (default is decimal).
- The base must be a value from 2 to 36.
-*/
-
-QString &QString::setNum( ulong n, int base )
-{
-#if defined(CHECK_RANGE)
- if ( base < 2 || base > 36 ) {
- qWarning( "QString::setNum: Invalid base %d", base );
- base = 10;
- }
-#endif
- char charbuf[65*sizeof(QChar)];
- QChar *buf = (QChar*)charbuf;
- QChar *p = &buf[64];
- int len = 0;
- do {
- *--p = "0123456789abcdefghijklmnopqrstuvwxyz"[((int)(n%base))];
- n /= base;
- len++;
- } while ( n );
- return setUnicode(p,len);
-}
-
-/*!
- \fn QString &QString::setNum( int n, int base )
- Sets the string to the printed value of \a n and returns a reference
- to the string.
-*/
-
-/*!
- \fn QString &QString::setNum( uint n, int base )
- Sets the string to the printed unsigned value of \a n and returns a
- reference to the string.
-*/
-
-/*!
- \fn QString &QString::setNum( short n, int base )
- Sets the string to the printed value of \a n and returns a reference
- to the string.
-*/
-
-/*!
- \fn QString &QString::setNum( ushort n, int base )
- Sets the string to the printed unsigned value of \a n and returns a
- reference to the string.
-*/
-
-/*! Sets the string to the printed value of \a n, formatted in the \a f
- format with \a prec precision, and returns a reference to the
- string.
-
- \a f can be 'f', 'F', 'e', 'E', 'g' or 'G', all of which have the
- same meaning as for sprintf().
-*/
-
-QString &QString::setNum( double n, char f, int prec )
-{
-#if defined(CHECK_RANGE)
- if ( !(f=='f' || f=='F' || f=='e' || f=='E' || f=='g' || f=='G') ) {
- qWarning( "QString::setNum: Invalid format char '%c'", f );
- f = 'f';
- }
-#endif
- char format[20];
- char buf[120]; // enough for 99 precision?
- char *fs = format; // generate format string
- *fs++ = '%'; // "%.<prec>l<f>"
- if ( prec >= 0 ) {
- if ( prec > 99 ) // buf big enough for precision?
- prec = 99;
- *fs++ = '.';
- if ( prec >= 10 ) {
- *fs++ = prec / 10 + '0';
- *fs++ = prec % 10 + '0';
- } else {
- *fs++ = prec + '0';
- }
- }
- *fs++ = 'l';
- *fs++ = f;
- *fs = '\0';
- ::sprintf( buf, format, n );
- return setLatin1(buf);
-}
-
-/*!
- \overload QString &QString::setNum( float n, char f, int prec )
-*/
-
-
-/*!
- A convenience factory function that returns a string representation
- of the number \a n.
-
- \sa setNum()
- */
-QString QString::number( long n, int base )
-{
- QString s;
- s.setNum( n, base );
- return s;
-}
-
-/*!
- A convenience factory function that returns a string representation
- of the number \a n.
-
- \sa setNum()
- */
-QString QString::number( ulong n, int base )
-{
- QString s;
- s.setNum( n, base );
- return s;
-}
-
-/*!
- A convenience factory function that returns a string representation
- of the number \a n.
-
- \sa setNum()
- */
-QString QString::number( int n, int base )
-{
- QString s;
- s.setNum( n, base );
- return s;
-}
-
-/*!
- A convenience factory function that returns a string representation
- of the number \a n.
-
- \sa setNum()
- */
-QString QString::number( uint n, int base )
-{
- QString s;
- s.setNum( n, base );
- return s;
-}
-
-/*!
- This static function returns the printed value of \a n, formatted in the
- \a f format with \a prec precision.
-
- \a f can be 'f', 'F', 'e', 'E', 'g' or 'G', all of which have the
- same meaning as for sprintf().
-
- \sa setNum()
- */
-QString QString::number( double n, char f, int prec )
-{
- QString s;
- s.setNum( n, f, prec );
- return s;
-}
-
-
-/*! \obsolete
-
- Sets the character at position \a index to \a c and expands the
- string if necessary, filling with spaces.
-
- This method is redundant in Qt 2.x, because operator[] will expand
- the string as necessary.
-*/
-
-void QString::setExpand( uint index, QChar c )
-{
- int spaces = index - d->len;
- at(index) = c;
- while (spaces-->0)
- d->unicode[--index]=' ';
-}
-
-
-/*!
- \fn const char* QString::data() const
-
- \obsolete
-
- Returns a pointer to a 0-terminated classic C string.
-
- In Qt 1.x, this returned a char* allowing direct manipulation of the
- string as a sequence of bytes. In Qt 2.x where QString is a Unicode
- string, char* conversion constructs a temporary string, and hence
- direct character operations are meaningless.
-*/
-
-/*!
- \fn bool QString::operator!() const
- Returns TRUE if it is a null string, otherwise FALSE. Thus
- you can write:
-
-\code
- QString name = getName();
- if ( !name )
- name = "Rodney";
-\endcode
-
- Note that if you say:
-
-\code
- QString name = getName();
- if ( name )
- doSomethingWith(name);
-\endcode
-
- Then this will call <tt>operator const char*()</tt>, which will do what
- you want, but rather inefficiently - you may wish to define the macro
- QT_NO_ASCII_CAST when writing code which you wish to strictly remain
- Unicode-clean.
-
- When you want the above semantics, use <tt>!isNull()</tt>
- or even <tt>!!</tt>:
-
-\code
- QString name = getName();
- if ( !!name )
- doSomethingWith(name);
-\endcode
-*/
-
-
-/*!
- \fn QString& QString::append( const QString& str )
- Appends \a str to the string and returns a reference to the result.
- Equivalent to operator+=().
- */
-
-/*!
- \fn QString& QString::append( char ch )
- Appends \a ch to the string and returns a reference to the result.
- Equivalent to operator+=().
- */
-
-/*!
- \fn QString& QString::append( QChar ch )
- Appends \a ch to the string and returns a reference to the result.
- Equivalent to operator+=().
- */
-
-/*!
- Appends \a str to the string and returns a reference to the string.
-*/
-QString& QString::operator+=( const QString &str )
-{
- uint len1 = length();
- uint len2 = str.length();
- if ( len2 ) {
- setLength(len1+len2);
- memcpy( d->unicode+len1, str.unicode(), sizeof(QChar)*len2 );
- } else if ( isNull() && !str.isNull() ) { // ## just for 1.x compat:
- *this = fromLatin1("");
- }
- return *this;
-}
-
-/*!
- Appends \a c to the string and returns a reference to the string.
-*/
-
-QString &QString::operator+=( QChar c )
-{
- setLength(length()+1);
- d->unicode[length()-1] = c;
- return *this;
-}
-
-/*!
- Appends \a c to the string and returns a reference to the string.
-*/
-
-QString &QString::operator+=( char c )
-{
- setLength(length()+1);
- d->unicode[length()-1] = c;
- return *this;
-}
-
-
-
-/*! \fn char QChar::latin1() const
-
- Returns a latin-1 copy of this character, if this character is in
- the latin-1 character set. If not, this function returns 0.
-*/
-
-
-/*!
- Returns a Latin-1 representation of the string. Note that the returned
- value is undefined if the string contains non-Latin-1 characters. If you
- want to convert strings into formats other than Unicode, see the
- QTextCodec classes.
-
- This function is mainly useful for boot-strapping legacy code to
- use Unicode.
-
- The result remains valid so long as one unmodified
- copy of the source string exists.
-
- \sa utf8(), local8Bit()
-*/
-const char* QString::latin1() const
-{
- if ( d->ascii ) {
- if ( d->dirtyascii )
- delete [] d->ascii;
- else
- return d->ascii;
- }
- Q2HELPER(stat_get_ascii++)
- Q2HELPER(stat_get_ascii_size+=d->len)
- static QTextCodec* codec = QTextCodec::codecForMib(106);
- if (codec) // we use utf8 coding also for latin1 if possible
- {
- QCString utf8str(codec->fromUnicode(*this));
- d->ascii = new char[utf8str.length()+1];
- if (utf8str.isEmpty())
- {
- d->ascii[0]='\0'; // make empty string
- }
- else // copy string
- {
- qstrcpy(d->ascii,utf8str.data());
- }
- }
- else // fall back to latin1
- {
- d->ascii = unicodeToAscii( d->unicode, d->len );
- }
- QCString utf8str(utf8());
- d->dirtyascii = 0;
- return d->ascii;
-}
-
-/*! \obsolete
-
- This functions simply calls latin1() and returns the result.
-*/
-const char* QString::ascii() const
-{
- return latin1();
-}
-
-#ifndef QT_NO_TEXTCODEC
-/*!
- Returns the string encoded in UTF8 format.
-
- See QTextCodec for more diverse coding/decoding of Unicode strings.
-
- \sa QString::fromUtf8(), local8Bit(), latin1()
-*/
-QCString QString::utf8() const
-{
- static QTextCodec* codec = QTextCodec::codecForMib(106);
- return codec
- ? codec->fromUnicode(*this)
- : QCString(latin1());
-}
-
-/*!
- Returns the unicode string decoded from the
- first \a len bytes of \a utf8. If \a len is -1 (the default), the
- length of \a utf8 is used. If trailing partial characters are in
- \a utf8, they are ignored.
-
- See QTextCodec for more diverse coding/decoding of Unicode strings.
-*/
-QString QString::fromUtf8(const char* utf8, int len)
-{
- static QTextCodec* codec = QTextCodec::codecForMib(106);
- if ( len < 0 ) len = qstrlen(utf8);
- return codec
- ? codec->toUnicode(utf8, len)
- : QString::fromLatin1(utf8, len);
-}
-#endif // QT_NO_TEXTCODEC
-/*!
- Creates a QString from Latin1 text. This is the same as the
- QString(const char*) constructor, but you can make that constructor
- invisible if you compile with the define QT_NO_CAST_ASCII, in which
- case you can explicitly create a QString from Latin-1 text using
- this function.
-*/
-QString QString::fromLatin1(const char* chars, int len)
-{
- uint l;
- QChar *uc;
- if ( len < 0 ) {
- uc = internalAsciiToUnicode(chars,&l);
- } else {
- uc = internalAsciiToUnicode(chars,&l,len);
- }
- return QString(new QStringData(uc,l,l), TRUE);
-}
-
-/*!
- \fn const QChar* QString::unicode() const
-
- Returns the Unicode representation of the string. The result
- remains valid until the string is modified.
-*/
-
-/*!
- Returns the string encoded in a locale-specific format. On X11, this
- is the QTextCodec::codecForLocale(). On Windows, it is a system-defined
- encoding.
-
- See QTextCodec for more diverse coding/decoding of Unicode strings.
-
- \sa QString::fromLocal8Bit(), latin1(), utf8()
-*/
-
-
-QCString QString::local8Bit() const
-{
-#ifdef QT_NO_TEXTCODEC
- return latin1();
-#else
-#ifdef _WS_X11_
- static QTextCodec* codec = QTextCodec::codecForLocale();
- return codec
- ? codec->fromUnicode(*this)
- : QCString(latin1());
-#endif
-#ifdef _WS_MAC_
- static QTextCodec* codec = QTextCodec::codecForLocale();
- return codec
- ? codec->fromUnicode(*this)
- : QCString(latin1());
-#endif
-#ifdef _WS_WIN_
- return qt_winQString2MB( *this );
-#endif
-#ifdef _WS_QWS_
- return utf8(); // ##### if there is ANY 8 bit format supported?
-#endif
-#endif
-}
-
-/*!
- Returns the unicode string decoded from the
- first \a len bytes of \a local8Bit. If \a len is -1 (the default), the
- length of \a local8Bit is used. If trailing partial characters are in
- \a local8Bit, they are ignored.
-
- \a local8Bit is assumed to be encoded in a locale-specific format.
-
- See QTextCodec for more diverse coding/decoding of Unicode strings.
-*/
-QString QString::fromLocal8Bit(const char* local8Bit, int len)
-{
-#ifdef QT_NO_TEXTCODEC
- return fromLatin1( local8Bit, len );
-#else
-
- if ( !local8Bit )
- return QString::null;
-#ifdef _WS_X11_
- static QTextCodec* codec = QTextCodec::codecForLocale();
- if ( len < 0 ) len = qstrlen(local8Bit);
- return codec
- ? codec->toUnicode(local8Bit, len)
- : QString::fromLatin1(local8Bit,len);
-#endif
-#ifdef _WS_MAC_
- static QTextCodec* codec = QTextCodec::codecForLocale();
- if ( len < 0 ) len = qstrlen(local8Bit);
- return codec
- ? codec->toUnicode(local8Bit, len)
- : QString::fromLatin1(local8Bit,len);
-#endif
-// Should this be OS_WIN32?
-#ifdef _WS_WIN_
- if ( len >= 0 ) {
- QCString s(local8Bit,len+1);
- return qt_winMB2QString(s);
- }
- return qt_winMB2QString( local8Bit );
-#endif
-#ifdef _WS_QWS_
- return fromUtf8(local8Bit,len);
-#endif
-#endif // QT_NO_TEXTCODEC
-}
-
-/*!
- \fn QString::operator const char *() const
-
- Returns latin1(). Be sure to see the warnings documented there.
- Note that for new code which you wish to be strictly Unicode-clean,
- you can define the macro QT_NO_ASCII_CAST when compiling your code
- to hide this function so that automatic casts are not done. This
- has the added advantage that you catch the programming error
- described under operator!().
-*/
-
-/*!
- \fn QChar QString::at( uint ) const
-
- Returns the character at \a i, or 0 if \a i is beyond the length
- of the string.
-
- Note: If this QString is not const or const&, the non-const at()
- will be used instead, which will expand the string if \a i is beyond
- the length of the string.
-*/
-
-/*!
- \fn QChar QString::constref(uint i) const
- Equivalent to at(i), this returns the QChar at \a i by value.
-
- \sa ref()
-*/
-
-/*!
- \fn QChar& QString::ref(uint i)
- Returns the QChar at \a i by reference.
-
- \sa constref()
-*/
-
-/*!
- \fn QChar QString::operator[](int) const
-
- Returns the character at \a i, or QChar::null if \a i is beyond the
- length of the string.
-
- Note: If this QString is not const or const&, the non-const operator[]
- will be used instead, which will expand the string if \a i is beyond
- the length of the string.
-*/
-
-/*!
- \fn QCharRef QString::operator[](int)
-
- Returns an object that references the character at \a i.
- This reference
- can then be assigned to, or otherwise used immediately, but
- becomes invalid once further modifications are made to the string.
- The QCharRef internal class can be used much like a constant QChar, but
- if you assign to it, you change the original string (which enlarges
- and detaches itself). You will get compilation errors if you try to
- use the result as anything but a QChar.
-*/
-
-/*!
- \fn QCharRef QString::at( uint i )
- Returns a reference to the character at \a i, expanding
- the string with QChar::null if necessary. The resulting reference
- can then be assigned to, or otherwise used immediately, but
- becomes invalid once further modifications are made to the string.
-*/
-
-/*!
- Internal chunk of code to handle the
- uncommon cases of at() above.
-*/
-void QString::subat( uint i )
-{
- uint olen = d->len;
- if ( i >= olen ) {
- setLength( i+1 ); // i is index; i+1 is needed length
- for ( uint j=olen; j<=i; j++ )
- d->unicode[j] = QChar::null;
- } else {
- // Just be sure to detach
- real_detach();
- }
-}
-
-
-/*!
- Resizes the string to \a len unicode characters and copies \a unicode
- into the string. If \a unicode is null, nothing is copied, but the
- string is resized to \a len anyway. If \a len is zero, the string
- becomes a \link isNull() null\endlink string.
-
- \sa setLatin1(), isNull()
-*/
-
-QString& QString::setUnicode( const QChar *unicode, uint len )
-{
- if ( len == 0 ) { // set to null string
- if ( d != shared_null ) { // beware of nullstring being set to nullstring
- deref();
- d = shared_null ? shared_null : makeSharedNull();
- d->ref();
- }
- } else if ( d->count != 1 || len > d->maxl ||
- ( len*4 < d->maxl && d->maxl > 4 ) ) { // detach, grown or shrink
- Q2HELPER(stat_copy_on_write++)
- Q2HELPER(stat_copy_on_write_size+=d->len)
- uint newMax = 4;
- while ( newMax < len )
- newMax *= 2;
- QChar* nd = QT_ALLOC_QCHAR_VEC( newMax );
- if ( unicode )
- memcpy( nd, unicode, sizeof(QChar)*len );
- deref();
- d = new QStringData( nd, len, newMax );
- } else {
- d->len = len;
- d->dirtyascii = 1;
- if ( unicode )
- memcpy( d->unicode, unicode, sizeof(QChar)*len );
- }
- return *this;
-}
-
-/*!
- Resizes the string to \a len unicode characters and copies
- \a unicode_as_ushorts into the string (on some X11 client
- platforms this will involve a byte-swapping pass).
-
- If \a unicode is null, nothing is copied, but the
- string is resized to \a len anyway. If \a len is zero, the string
- becomes a \link isNull() null\endlink string.
-
- \sa setLatin1(), isNull()
-*/
-QString& QString::setUnicodeCodes( const ushort* unicode_as_ushorts, uint len )
-{
- setUnicode((const QChar*)unicode_as_ushorts, len);
- QChar t(0x1234);
- if ( unicode_as_ushorts && *((ushort*)&t) == 0x3412 ) {
- // Need to byteswap
- char* b = (char*)d->unicode;
- while ( len-- ) {
- char c = b[0];
- b[0] = b[1];
- b[1] = c;
- b += sizeof(QChar);
- }
- }
- return *this;
-}
-
-
-/*!
- Sets this string to \a str, interpreted as a classic Latin 1 C string.
- If the \a len argument is negative (default), it is set to strlen(str).
-
- If \a str is 0 a null string is created. If \a str is "" an empty
- string is created.
-
- \sa isNull(), isEmpty()
-*/
-
-QString &QString::setLatin1( const char *str, int len )
-{
- if ( str == 0 )
- return setUnicode(0,0);
- if ( len < 0 )
- len = qstrlen(str);
- if ( len == 0 ) { // won't make a null string
- deref();
- uint l;
- QChar *uc = internalAsciiToUnicode(str,&l);
- d = new QStringData(uc,l,l);
- } else {
- setUnicode( 0, len ); // resize but not copy
- QChar *p = d->unicode;
- while ( len-- )
- *p++ = *str++;
- }
- return *this;
-}
-
-
-/*!
- \fn int QString::compare (const QString & s1, const QString & s2)
-
- Compare \a s1 to \a s2 returning an integer less than, equal to, or
- greater than zero if s1 is, respectively, lexically less than, equal to,
- or greater than s2.
-*/
-
-/*!
- Compares this string to \a s, returning an integer less than, equal to, or
- greater than zero if it is, respectively, lexically less than, equal to,
- or greater than \a s.
-*/
-int QString::compare( const QString& s ) const
-{
- return ucstrcmp(*this,s);
-}
-
-bool operator==( const QString &s1, const QString &s2 )
-{
- return (s1.length() == s2.length()) && s1.isNull() == s2.isNull() &&
- (memcmp((char*)s1.unicode(),(char*)s2.unicode(),
- s1.length()*sizeof(QChar)) ==0);
-}
-
-bool operator!=( const QString &s1, const QString &s2 )
-{ return !(s1==s2); }
-
-bool operator<( const QString &s1, const QString &s2 )
-{ return ucstrcmp(s1,s2) < 0; }
-
-bool operator<=( const QString &s1, const QString &s2 )
-{ return ucstrcmp(s1,s2) <= 0; }
-
-bool operator>( const QString &s1, const QString &s2 )
-{ return ucstrcmp(s1,s2) > 0; }
-
-bool operator>=( const QString &s1, const QString &s2 )
-{ return ucstrcmp(s1,s2) >= 0; }
-
-
-bool operator==( const QString &s1, const char *s2 )
-{ return s1==QString(s2); }
-
-bool operator==( const char *s1, const QString &s2 )
-{ return QString(s1)==s2; }
-
-bool operator!=( const QString &s1, const char *s2 )
-{ return !(s1==s2); }
-
-bool operator!=( const char *s1, const QString &s2 )
-{ return !(s1==s2); }
-
-bool operator<( const QString &s1, const char *s2 )
-{ return ucstrcmp(s1,s2) < 0; }
-
-bool operator<( const char *s1, const QString &s2 )
-{ return ucstrcmp(s1,s2) < 0; }
-
-bool operator<=( const QString &s1, const char *s2 )
-{ return ucstrcmp(s1,s2) <= 0; }
-
-bool operator<=( const char *s1, const QString &s2 )
-{ return ucstrcmp(s1,s2) <= 0; }
-
-bool operator>( const QString &s1, const char *s2 )
-{ return ucstrcmp(s1,s2) > 0; }
-
-bool operator>( const char *s1, const QString &s2 )
-{ return ucstrcmp(s1,s2) > 0; }
-
-bool operator>=( const QString &s1, const char *s2 )
-{ return ucstrcmp(s1,s2) >= 0; }
-
-bool operator>=( const char *s1, const QString &s2 )
-{ return ucstrcmp(s1,s2) >= 0; }
-
-
-/*****************************************************************************
- Documentation for QString related functions
- *****************************************************************************/
-
-/*!
- \fn bool operator==( const QString &s1, const QString &s2 )
- \relates QString
- Returns TRUE if the two strings are equal, or FALSE if they are different.
- A null string is different from an empty, non-null string.
-
- Equivalent to <code>qstrcmp(s1,s2) == 0</code>.
-*/
-
-/*!
- \fn bool operator==( const QString &s1, const char *s2 )
- \relates QString
- Returns TRUE if the two strings are equal, or FALSE if they are different.
-
- Equivalent to <code>qstrcmp(s1,s2) == 0</code>.
-*/
-
-/*!
- \fn bool operator==( const char *s1, const QString &s2 )
- \relates QString
- Returns TRUE if the two strings are equal, or FALSE if they are different.
-
- Equivalent to <code>qstrcmp(s1,s2) == 0</code>.
-*/
-
-/*!
- \fn bool operator!=( const QString &s1, const QString &s2 )
- \relates QString
- Returns TRUE if the two strings are different, or FALSE if they are equal.
-
- Equivalent to <code>qstrcmp(s1,s2) != 0</code>.
-*/
-
-/*!
- \fn bool operator!=( const QString &s1, const char *s2 )
- \relates QString
- Returns TRUE if the two strings are different, or FALSE if they are equal.
-
- Equivalent to <code>qstrcmp(s1,s2) != 0</code>.
-*/
-
-/*!
- \fn bool operator!=( const char *s1, const QString &s2 )
- \relates QString
- Returns TRUE if the two strings are different, or FALSE if they are equal.
-
- Equivalent to <code>qstrcmp(s1,s2) != 0</code>.
-*/
-
-/*!
- \fn bool operator<( const QString &s1, const char *s2 )
- \relates QString
- Returns TRUE if \a s1 is alphabetically less than \a s2, otherwise FALSE.
-
- Equivalent to <code>qstrcmp(s1,s2) \< 0</code>.
-*/
-
-/*!
- \fn bool operator<( const char *s1, const QString &s2 )
- \relates QString
- Returns TRUE if \a s1 is alphabetically less than \a s2, otherwise FALSE.
-
- Equivalent to <code>qstrcmp(s1,s2) \< 0</code>.
-*/
-
-/*!
- \fn bool operator<=( const QString &s1, const char *s2 )
- \relates QString
- Returns TRUE if \a s1 is alphabetically less than or equal to \a s2,
- otherwise FALSE.
-
- Equivalent to <code>qstrcmp(s1,s2) \<= 0</code>.
-*/
-
-/*!
- \fn bool operator<=( const char *s1, const QString &s2 )
- \relates QString
- Returns TRUE if \a s1 is alphabetically less than or equal to \a s2,
- otherwise FALSE.
-
- Equivalent to <code>qstrcmp(s1,s2) \<= 0</code>.
-*/
-
-/*!
- \fn bool operator>( const QString &s1, const char *s2 )
- \relates QString
- Returns TRUE if \a s1 is alphabetically greater than \a s2, otherwise FALSE.
-
- Equivalent to <code>qstrcmp(s1,s2) \> 0</code>.
-*/
-
-/*!
- \fn bool operator>( const char *s1, const QString &s2 )
- \relates QString
- Returns TRUE if \a s1 is alphabetically greater than \a s2, otherwise FALSE.
-
- Equivalent to <code>qstrcmp(s1,s2) \> 0</code>.
-*/
-
-/*!
- \fn bool operator>=( const QString &s1, const char *s2 )
- \relates QString
- Returns TRUE if \a s1 is alphabetically greater than or equal to \a s2,
- otherwise FALSE.
-
- Equivalent to <code>qstrcmp(s1,s2) \>= 0</code>.
-*/
-
-/*!
- \fn bool operator>=( const char *s1, const QString &s2 )
- \relates QString
- Returns TRUE if \a s1 is alphabetically greater than or equal to \a s2,
- otherwise FALSE.
-
- Equivalent to <code>qstrcmp(s1,s2) \>= 0</code>.
-*/
-
-/*!
- \fn QString operator+( const QString &s1, const QString &s2 )
- \relates QString
- Returns the concatenated string of s1 and s2.
-*/
-
-/*!
- \fn QString operator+( const QString &s1, const char *s2 )
- \relates QString
- Returns the concatenated string of s1 and s2.
-*/
-
-/*!
- \fn QString operator+( const char *s1, const QString &s2 )
- \relates QString
- Returns the concatenated string of s1 and s2.
-*/
-
-/*!
- \fn QString operator+( const QString &s, char c )
- \relates QString
- Returns the concatenated string of s and c.
-*/
-
-/*!
- \fn QString operator+( char c, const QString &s )
- \relates QString
- Returns the concatenated string of c and s.
-*/
-
-
-/*****************************************************************************
- QString stream functions
- *****************************************************************************/
-#ifndef QT_NO_DATASTREAM
-/*!
- \relates QString
- Writes a string to the stream.
-
- \sa \link datastreamformat.html Format of the QDataStream operators \endlink
-*/
-
-QDataStream &operator<<( QDataStream &s, const QString &str )
-{
- if ( s.version() == 1 ) {
- QCString l( str.latin1() );
- s << l;
- }
- else {
- const char* ub = (const char*)str.unicode();
- if ( ub || s.version() < 3 ) {
- if ( QChar::networkOrdered() ==
- (s.byteOrder()==QDataStream::BigEndian) ) {
- s.writeBytes( ub, (int)sizeof(QChar)*str.length() );
- } else {
- static const uint auto_size = 1024;
- char t[auto_size];
- char *b;
- if ( str.length()*sizeof(QChar) > auto_size ) {
- b = new char[str.length()*sizeof(QChar)];
- } else {
- b = t;
- }
- int l = str.length();
- char *c=b;
- while ( l-- ) {
- *c++ = ub[1];
- *c++ = ub[0];
- ub+=sizeof(QChar);
- }
- s.writeBytes( b, (int)sizeof(QChar)*str.length() );
- if ( str.length()*sizeof(QChar) > auto_size )
- delete [] b;
- }
- } else {
- // write null marker
- s << (Q_UINT32)0xffffffff;
- }
- }
- return s;
-}
-
-/*!
- \relates QString
- Reads a string from the stream.
-
- \sa \link datastreamformat.html Format of the QDataStream operators \endlink
-*/
-
-QDataStream &operator>>( QDataStream &s, QString &str )
-{
-#ifdef QT_QSTRING_UCS_4
-#if defined(_CC_GNU_)
-#warning "operator>> not working properly"
-#endif
-#endif
- if ( s.version() == 1 ) {
- QCString l;
- s >> l;
- str = QString( l );
- }
- else {
- Q_UINT32 bytes;
- s >> bytes; // read size of string
- if ( bytes == 0xffffffff ) { // null string
- str = QString::null;
- } else if ( bytes > 0 ) { // not empty
- str.setLength( bytes/2 );
- char* b = (char*)str.d->unicode;
- s.readRawBytes( b, bytes );
- if ( QChar::networkOrdered() !=
- (s.byteOrder()==QDataStream::BigEndian) ) {
- bytes /= 2;
- while ( bytes-- ) {
- char c = b[0];
- b[0] = b[1];
- b[1] = c;
- b += 2;
- }
- }
- } else {
- str = "";
- }
- }
- return s;
-}
-#endif // QT_NO_DATASTREAM
-
-/*****************************************************************************
- QConstString member functions
- *****************************************************************************/
-
-/*!
- \class QConstString qstring.h
- \brief A QString which uses constant Unicode data.
-
- In order to minimize copying, highly optimized applications can use
- QConstString to provide a QString-compatible object from existing
- Unicode data. It is then the user's responsibility to make sure
- that the Unicode data must exist for the entire lifetime of the
- QConstString object.
-*/
-
-/*!
- Constructs a QConstString that uses the first \a length Unicode
- characters in the array \a unicode. Any attempt to modify
- copies of the string will cause it to create a copy of the
- data, thus it remains forever unmodified.
-
- Note that \a unicode is \e not \e copied. The caller \e must be
- able to guarantee that \a unicode will not be deleted or
- modified. Since that is generally not the case with \c const strings
- (they are references), this constructor demands a non-const pointer
- even though it never modifies \a unicode.
-*/
-QConstString::QConstString( QChar* unicode, uint length ) :
- QString(new QStringData(unicode, length, length),TRUE)
-{
-}
-
-/*!
- Destroys the QConstString, creating a copy of the data if
- other strings are still using it.
-*/
-QConstString::~QConstString()
-{
- if ( d->count > 1 ) {
- QChar* cp = QT_ALLOC_QCHAR_VEC( d->len );
- memcpy( cp, d->unicode, d->len*sizeof(QChar) );
- d->unicode = cp;
- } else {
- d->unicode = 0;
- }
-
- // The original d->unicode is now unlinked.
-}
-
-/*!
- \fn const QString& QConstString::string() const
-
- Returns a constant string referencing the data passed during
- construction.
-*/
-
-/*!
- Returns whether the strings starts with \a s, or not.
- */
-bool QString::startsWith( const QString& s ) const
-{
- for ( int i =0; i < (int) s.length(); i++ ) {
- if ( i >= (int) length() || d->unicode[i] != s[i] )
- return FALSE;
- }
- return TRUE;
-}
-
-
-
-#if defined(_OS_WIN32_)
-
-#include <windows.h>
-
-/*!
- Returns a static Windows TCHAR* from a QString, possibly adding NUL.
-
- The lifetime of the return value is until the next call to this function.
-*/
-const void* qt_winTchar(const QString& str_in, bool addnul)
-{
- // So that the return value lives long enough.
- static QString str;
- str = str_in;
-
-#ifdef UNICODE
- static uint buflen = 256;
- static TCHAR *buf = new TCHAR[buflen];
-
- const QChar* uc = str.unicode();
-
-#define EXTEND if (str.length() > buflen) { delete buf; buf = new TCHAR[buflen=str.length()+1]; }
-
-#if defined(_WS_X11_) || defined(_OS_WIN32_BYTESWAP_)
- EXTEND
- for ( int i=str.length(); i--; )
- buf[i] = uc[i].row() << 8 | uc[i].cell();
- if ( addnul )
- buf[str.length()] = 0;
-#else
- // Same endianess of TCHAR
- if ( addnul ) {
- EXTEND
- memcpy(buf,uc,sizeof(TCHAR)*str.length());
- buf[str.length()] = 0;
- } else {
- return uc;
- }
-#endif
- return buf;
-#undef EXTEND
-
-#else
- return str.latin1();
-#endif
-}
-
-/*!
- Makes a new null terminated Windows TCHAR* from a QString.
-*/
-void* qt_winTchar_new(const QString& str)
-{
- TCHAR* result = new TCHAR[str.length()+1];
- memcpy(result, qt_winTchar(str,FALSE), sizeof(TCHAR)*str.length());
- result[str.length()] = 0;
- return result;
-}
-
-/*!
- Makes a QString from a Windows TCHAR*.
-*/
-QString qt_winQString(void* tc)
-{
-#ifdef UNICODE
-
- int len=0;
- while ( ((TCHAR*)tc)[len] )
- len++;
-#if defined(_WS_X11_) || defined(_OS_WIN32_BYTESWAP_)
- QString r;
- for ( int i=0; i<len; i++ )
- r += QChar(((TCHAR*)tc)[i]&0xff,((TCHAR*)tc)[i]>>8);
- return r;
-#else
- // Same endianess of TCHAR
- return QString((QChar*)tc,len);
-#endif
-#undef EXTEND
-#else
- return (TCHAR*)tc;
-#endif
-}
-
-QCString qt_winQString2MB( const QString& s, int uclen )
-{
- if ( uclen < 0 )
- uclen = s.length();
- if ( uclen == 0 )
- return QCString();
- BOOL used_def;
- int bufSize=4096;
- QCString mb(bufSize);
- int len;
- while ( !(len=WideCharToMultiByte(CP_ACP, 0, (const WCHAR*)s.unicode(), uclen,
- mb.rawData(), bufSize-1, 0, &used_def)) )
- {
- int r = GetLastError();
- if ( r == ERROR_INSUFFICIENT_BUFFER ) {
- bufSize=1+WideCharToMultiByte( CP_ACP, 0,
- (const WCHAR*)s.unicode(), uclen,
- 0, 0, 0, &used_def);
- mb.resize(bufSize);
- // and try again...
- } else {
- // Fail.
- qWarning("WideCharToMultiByte cannot convert multibyte text (error %d): %s (UTF8)",
- r, s.utf8().data());
- break;
- }
- }
- mb[len]='\0';
- return mb;
-}
-
-// WATCH OUT: mblen must include the NUL (or just use -1)
-QString qt_winMB2QString( const char* mb, int mblen )
-{
- if ( !mb || !mblen )
- return QString::null;
- const int wclen_auto = 4096;
- WCHAR wc_auto[wclen_auto];
- int wclen = wclen_auto;
- WCHAR *wc = wc_auto;
- int len;
- while ( !(len=MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED,
- mb, mblen, wc, wclen )) )
- {
- int r = GetLastError();
- if ( r == ERROR_INSUFFICIENT_BUFFER ) {
- if ( wc != wc_auto ) {
- qWarning("Size changed in MultiByteToWideChar");
- break;
- } else {
- wclen = MultiByteToWideChar( CP_ACP, MB_PRECOMPOSED,
- mb, mblen, 0, 0 );
- wc = new WCHAR[wclen];
- // and try again...
- }
- } else {
- // Fail.
- qWarning("MultiByteToWideChar cannot convert multibyte text");
- break;
- }
- }
- if ( len <= 0 )
- return QString::null;
- QString s( (QChar*)wc, len-1 ); // len-1: we don't want terminator
- if ( wc != wc_auto )
- delete [] wc;
- return s;
-}
-
-
-#endif // _OS_WIN32_
diff --git a/qtools/qstring.h b/qtools/qstring.h
deleted file mode 100644
index ed56d7f..0000000
--- a/qtools/qstring.h
+++ /dev/null
@@ -1,879 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of the QString class, and related Unicode
-** functions.
-**
-** Created : 920609
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QSTRING_H
-#define QSTRING_H
-
-#ifndef QT_H
-#include "qcstring.h"
-#endif // QT_H
-
-#define QT_NO_ASCII_CAST
-
-/*****************************************************************************
- QString class
- *****************************************************************************/
-
-class QRegExp;
-class QString;
-class QCharRef;
-
-class Q_EXPORT Q_PACKED QChar {
-public:
- QChar();
- QChar( char c );
- QChar( uchar c );
- QChar( uchar c, uchar r );
- QChar( const QChar& c );
- QChar( ushort rc );
- QChar( short rc );
- QChar( uint rc );
- QChar( int rc );
- QChar &operator=(const QChar &c);
-
- QT_STATIC_CONST QChar null; // 0000
- QT_STATIC_CONST QChar replacement; // FFFD
- QT_STATIC_CONST QChar byteOrderMark; // FEFF
- QT_STATIC_CONST QChar byteOrderSwapped; // FFFE
- QT_STATIC_CONST QChar nbsp; // 00A0
-
- // Unicode information
-
- enum Category
- {
- NoCategory,
-
- Mark_NonSpacing, // Mn
- Mark_SpacingCombining, // Mc
- Mark_Enclosing, // Me
-
- Number_DecimalDigit, // Nd
- Number_Letter, // Nl
- Number_Other, // No
-
- Separator_Space, // Zs
- Separator_Line, // Zl
- Separator_Paragraph, // Zp
-
- Other_Control, // Cc
- Other_Format, // Cf
- Other_Surrogate, // Cs
- Other_PrivateUse, // Co
- Other_NotAssigned, // Cn
-
- Letter_Uppercase, // Lu
- Letter_Lowercase, // Ll
- Letter_Titlecase, // Lt
- Letter_Modifier, // Lm
- Letter_Other, // Lo
-
- Punctuation_Connector, // Pc
- Punctuation_Dask, // Pd
- Punctuation_Open, // Ps
- Punctuation_Close, // Pe
- Punctuation_InitialQuote, // Pi
- Punctuation_FinalQuote, // Pf
- Punctuation_Other, // Po
-
- Symbol_Math, // Sm
- Symbol_Currency, // Sc
- Symbol_Modifier, // Sk
- Symbol_Other // So
- };
-
- enum Direction
- {
- DirL, DirR, DirEN, DirES, DirET, DirAN, DirCS, DirB, DirS, DirWS, DirON,
- DirLRE, DirLRO, DirAL, DirRLE, DirRLO, DirPDF, DirNSM, DirBN
- };
-
- enum Decomposition
- {
- Single, Canonical, Font, NoBreak, Initial, Medial,
- Final, Isolated, Circle, Super, Sub, Vertical,
- Wide, Narrow, Small, Square, Compat, Fraction
- };
-
- enum Joining
- {
- OtherJoining, Dual, Right, Center
- };
-
- // ****** WHEN ADDING FUNCTIONS, CONSIDER ADDING TO QCharRef TOO
-
- int digitValue() const;
- QChar lower() const;
- QChar upper() const;
-
- Category category() const;
- Direction direction() const;
- Joining joining() const;
- bool mirrored() const;
- QChar mirroredChar() const;
- QString decomposition() const;
- Decomposition decompositionTag() const;
-
- char latin1() const { return rw ? 0 : (char)cl; }
- ushort unicode() const { return (ushort)((rw << 8) | cl); }
-#ifndef QT_NO_CAST_ASCII
- // like all ifdef'd code this is undocumented
- operator char() const { return latin1(); }
-#endif
-
- bool isNull() const { return unicode()==0; }
- bool isPrint() const;
- bool isPunct() const;
- bool isSpace() const;
- bool isMark() const;
- bool isLetter() const;
- bool isNumber() const;
- bool isLetterOrNumber() const;
- bool isDigit() const;
-
- uchar& cell() { return cl; }
- uchar& row() { return rw; }
- uchar cell() const { return cl; }
- uchar row() const { return rw; }
-
- static bool networkOrdered() { return (int)net_ordered == 1; }
-
- friend inline int operator==( char ch, QChar c );
- friend inline int operator==( QChar c, char ch );
- friend inline int operator==( QChar c1, QChar c2 );
- friend inline int operator!=( QChar c1, QChar c2 );
- friend inline int operator!=( char ch, QChar c );
- friend inline int operator!=( QChar c, char ch );
- friend inline int operator<=( QChar c, char ch );
- friend inline int operator<=( char ch, QChar c );
- friend inline int operator<=( QChar c1, QChar c2 );
-
-private:
-#if defined(_WS_X11_) || defined(_OS_WIN32_BYTESWAP_) || defined( _WS_QWS_ )
- // XChar2b on X11, ushort on _OS_WIN32_BYTESWAP_
- //### QWS must be defined on a platform by platform basis
- uchar rw;
- uchar cl;
-#if defined(QT_QSTRING_UCS_4)
- ushort grp;
-#endif
- enum { net_ordered = 1 };
-#else
- // ushort on _OS_WIN32_
- uchar cl;
- uchar rw;
-#if defined(QT_QSTRING_UCS_4)
- ushort grp;
-#endif
- enum { net_ordered = 0 };
-#endif
-};
-
-inline QChar::QChar()
-{
- rw = 0; cl = 0;
-#ifdef QT_QSTRING_UCS_4
- grp = 0;
-#endif
-}
-inline QChar::QChar( char c )
-{
- rw = 0; cl = (uchar)c;
-#ifdef QT_QSTRING_UCS_4
- grp = 0;
-#endif
-}
-inline QChar::QChar( uchar c )
-{
- rw = 0; cl = c;
-#ifdef QT_QSTRING_UCS_4
- grp = 0;
-#endif
-}
-inline QChar::QChar( uchar c, uchar r )
-{
- rw = r; cl = c;
-#ifdef QT_QSTRING_UCS_4
- grp = 0;
-#endif
-}
-inline QChar::QChar( const QChar& c )
-{
- rw = c.rw; cl = c.cl;
-#ifdef QT_QSTRING_UCS_4
- grp = 0;
-#endif
-}
-inline QChar::QChar( ushort rc )
-{
- rw = (uchar)((rc>>8)&0xff); cl = (uchar)(rc&0xff);
-#ifdef QT_QSTRING_UCS_4
- grp = 0;
-#endif
-}
-inline QChar::QChar( short rc )
-{
- rw = (uchar)((rc>>8)&0xff); cl = (uchar)(rc&0xff);
-#ifdef QT_QSTRING_UCS_4
- grp = 0;
-#endif
-}
-inline QChar::QChar( uint rc )
-{
- rw = (uchar)((rc>>8)&0xff); cl = (uchar)(rc&0xff);
-#ifdef QT_QSTRING_UCS_4
- grp = 0;
-#endif
-}
-inline QChar::QChar( int rc )
-{
- rw = (uchar)((rc>>8)&0xff); cl = (uchar)(rc&0xff);
-#ifdef QT_QSTRING_UCS_4
- grp = 0;
-#endif
-}
-
-inline QChar &QChar::operator=(const QChar &c)
-{
- rw = c.rw;
- cl = c.cl;
-#ifdef QT_QSTRING_UCS_4
- grp = 0;
-#endif
- return *this;
-}
-
-inline int operator==( char ch, QChar c )
-{
- return ch == c.cl && !c.rw;
-}
-
-inline int operator==( QChar c, char ch )
-{
- return ch == c.cl && !c.rw;
-}
-
-inline int operator==( QChar c1, QChar c2 )
-{
- return c1.cl == c2.cl
- && c1.rw == c2.rw;
-}
-
-inline int operator!=( QChar c1, QChar c2 )
-{
- return c1.cl != c2.cl
- || c1.rw != c2.rw;
-}
-
-inline int operator!=( char ch, QChar c )
-{
- return ch != c.cl || c.rw;
-}
-
-inline int operator!=( QChar c, char ch )
-{
- return ch != c.cl || c.rw;
-}
-
-inline int operator<=( QChar c, char ch )
-{
- return !(ch < c.cl || c.rw);
-}
-
-inline int operator<=( char ch, QChar c )
-{
- return ch <= c.cl || c.rw;
-}
-
-inline int operator<=( QChar c1, QChar c2 )
-{
- return c1.rw > c2.rw
- ? FALSE
- : c1.rw < c2.rw
- ? TRUE
- : c1.cl <= c2.cl;
-}
-
-inline int operator>=( QChar c, char ch ) { return ch <= c; }
-inline int operator>=( char ch, QChar c ) { return c <= ch; }
-inline int operator>=( QChar c1, QChar c2 ) { return c2 <= c1; }
-inline int operator<( QChar c, char ch ) { return !(ch<=c); }
-inline int operator<( char ch, QChar c ) { return !(c<=ch); }
-inline int operator<( QChar c1, QChar c2 ) { return !(c2<=c1); }
-inline int operator>( QChar c, char ch ) { return !(ch>=c); }
-inline int operator>( char ch, QChar c ) { return !(c>=ch); }
-inline int operator>( QChar c1, QChar c2 ) { return !(c2>=c1); }
-
-// internal
-struct Q_EXPORT QStringData : public QShared {
- QStringData() :
- unicode(0), ascii(0), len(0), maxl(0), dirtyascii(0) { ref(); }
- QStringData(QChar *u, uint l, uint m) :
- unicode(u), ascii(0), len(l), maxl(m&0x3FFFFFFF), dirtyascii(0) { }
-
- ~QStringData() { if ( unicode ) delete[] ((char*)unicode);
- if ( ascii ) delete[] ascii; }
-
- void deleteSelf();
- QChar *unicode;
- char *ascii;
- uint len;
- uint maxl:30;
- uint dirtyascii:1;
-};
-
-
-class Q_EXPORT QString
-{
-public:
- QString(); // make null string
- QString( QChar ); // one-char string
- QString( const QString & ); // impl-shared copy
- QString( const QByteArray& ); // deep copy
- QString( const QCString& ); // deep copy
- QString( const QChar* unicode, uint length ); // deep copy
-#ifndef QT_NO_CAST_ASCII
- QString( const char *str ); // deep copy
-#endif
- ~QString();
-
- QString &operator=( const QString & ); // impl-shared copy
-#ifndef QT_NO_CAST_ASCII
- QString &operator=( const char * ); // deep copy
-#endif
- QString &operator=( const QCString& ); // deep copy
- QString &operator=( QChar c );
- QString &operator=( char c );
-
- enum Direction
- {
- /// No strongly directional text.
- /*!
- * As return value for direction() or baseDirection(), it means that the source string
- * is missing or empty, or contains neither left-to-right nor right-to-left characters.
- */
- DirNeutral = 0x0,
- /// Left-to-right text.
- /*!
- * - As return value for direction(), it means that the source string
- * contains no right-to-left characters.
- * - As return value for basicDirection(), it means that the first strong character
- * of the source string has a left-to-right direction.
- */
- DirLTR = 0x1,
- /// Right-to-left text.
- /*!
- * - As return value for direction(), it means that the source string
- * contains no left-to-right characters.
- * - As return value for basicDirection(), it means that the first strong character
- * of the source string has a right-to-left direction.
- */
- DirRTL = 0x2,
- /// Mixed-directional text
- /*!
- * As return value for direction(), it means that the source string
- * contains both left-to-right and right-to-left characters.
- */
- DirMixed = 0x3
- };
-
- //QT_STATIC_CONST QString null;
- //bool isNull() const;
-
- struct Null { };
- static const Null null;
- inline QString(const Null &): d(shared_null) { d->ref(); }
- inline QString &operator=(const Null &) { *this = QString(); return *this; }
- inline bool isNull() const { return d == shared_null; }
-
- bool isEmpty() const;
- uint length() const;
- void truncate( uint pos );
-
-#if QT_VERSION >= 300
-#error "fill() Should return *this, or QChar constructor should take count=1"
-#endif
- void fill( QChar c, int len = -1 );
-
- QString copy() const;
-
- QString arg(long a, int fieldwidth=0, int base=10) const;
- QString arg(ulong a, int fieldwidth=0, int base=10) const;
- QString arg(int a, int fieldwidth=0, int base=10) const;
- QString arg(uint a, int fieldwidth=0, int base=10) const;
- QString arg(short a, int fieldwidth=0, int base=10) const;
- QString arg(ushort a, int fieldwidth=0, int base=10) const;
- QString arg(char a, int fieldwidth=0) const;
- QString arg(QChar a, int fieldwidth=0) const;
- QString arg(const QString& a, int fieldwidth=0) const;
- QString arg(double a, int fieldwidth=0, char fmt='g', int prec=-1) const;
-
- QString &sprintf( const char* format, ... )
-#if defined(_CC_GNU_) && !defined(__INSURE__)
- __attribute__ ((format (printf, 2, 3)))
-#endif
- ;
-
- int find( QChar c, int index=0, bool cs=TRUE ) const;
- int find( char c, int index=0, bool cs=TRUE ) const;
- int find( const QString &str, int index=0, bool cs=TRUE ) const;
- int find( const QRegExp &, int index=0 ) const;
-#ifndef QT_NO_CAST_ASCII
- int find( const char* str, int index=0 ) const;
-#endif
- int findRev( QChar c, int index=-1, bool cs=TRUE) const;
- int findRev( char c, int index=-1, bool cs=TRUE) const;
- int findRev( const QString &str, int index=-1, bool cs=TRUE) const;
- int findRev( const QRegExp &, int index=-1 ) const;
-#ifndef QT_NO_CAST_ASCII
- int findRev( const char* str, int index=-1 ) const;
-#endif
- int contains( QChar c, bool cs=TRUE ) const;
- int contains( char c, bool cs=TRUE ) const
- { return contains(QChar(c), cs); }
-#ifndef QT_NO_CAST_ASCII
- int contains( const char* str, bool cs=TRUE ) const;
-#endif
- int contains( const QString &str, bool cs=TRUE ) const;
- int contains( const QRegExp & ) const;
-
- QString left( uint len ) const;
- QString right( uint len ) const;
- QString mid( uint index, uint len=0xffffffff) const;
-
- QString leftJustify( uint width, QChar fill=' ', bool trunc=FALSE)const;
- QString rightJustify( uint width, QChar fill=' ',bool trunc=FALSE)const;
-
- QString lower() const;
- QString upper() const;
-
- QString stripWhiteSpace() const;
- QString simplifyWhiteSpace() const;
-
- QString &insert( uint index, const QString & );
- QString &insert( uint index, const QChar*, uint len );
- QString &insert( uint index, QChar );
- QString &insert( uint index, char c ) { return insert(index,QChar(c)); }
- QString &append( char );
- QString &append( QChar );
- QString &append( const QString & );
- QString &prepend( char );
- QString &prepend( QChar );
- QString &prepend( const QString & );
- QString &remove( uint index, uint len );
- QString &replace( uint index, uint len, const QString & );
- QString &replace( uint index, uint len, const QChar*, uint clen );
- QString &replace( const QRegExp &, const QString & );
-
- 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;
- float toFloat( bool *ok=0 ) const;
- double toDouble( bool *ok=0 ) const;
-
- QString &setNum( short, int base=10 );
- QString &setNum( ushort, int base=10 );
- QString &setNum( int, int base=10 );
- QString &setNum( uint, int base=10 );
- QString &setNum( long, int base=10 );
- QString &setNum( ulong, int base=10 );
- QString &setNum( float, char f='g', int prec=6 );
- QString &setNum( double, char f='g', int prec=6 );
-
- static QString number( long, int base=10 );
- static QString number( ulong, int base=10);
- static QString number( int, int base=10 );
- static QString number( uint, int base=10);
- static QString number( double, char f='g', int prec=6 );
-
- void setExpand( uint index, QChar c );
-
- QString &operator+=( const QString &str );
- QString &operator+=( QChar c );
- QString &operator+=( char c );
-
- // Your compiler is smart enough to use the const one if it can.
- QChar at( uint i ) const
- { return i<d->len ? d->unicode[i] : QChar::null; }
- QChar operator[]( int i ) const { return at((uint)i); }
- QCharRef at( uint i );
- QCharRef operator[]( int i );
-
- QChar constref(uint i) const
- { return at(i); }
- QChar& ref(uint i)
- { // Optimized for easy-inlining by simple compilers.
- if (d->count!=1 || i>=d->len)
- subat(i);
- d->dirtyascii=1;
- return d->unicode[i];
- }
-
- const QChar* unicode() const { return d->unicode; }
- const char* ascii() const;
- const char* latin1() const;
- static QString fromLatin1(const char*, int len=-1);
- const unsigned short *ucs2() const;
- static QString fromUcs2( const unsigned short *ucs2 );
-#ifndef QT_NO_TEXTCODEC
- QCString utf8() const;
- static QString fromUtf8(const char*, int len=-1);
-#endif
- QCString local8Bit() const;
- static QString fromLocal8Bit(const char*, int len=-1);
- bool operator!() const;
-#ifndef QT_NO_ASCII_CAST
- operator const char *() const { return latin1(); }
-#endif
-
- QString &setUnicode( const QChar* unicode, uint len );
- QString &setUnicodeCodes( const ushort* unicode_as_ushorts, uint len );
- QString &setLatin1( const char*, int len=-1 );
-
- int compare( const QString& s ) const;
- static int compare( const QString& s1, const QString& s2 )
- { return s1.compare(s2); }
-
-#ifndef QT_NO_DATASTREAM
- friend Q_EXPORT QDataStream &operator>>( QDataStream &, QString & );
-#endif
- // new functions for BiDi
- void compose();
- QString::Direction direction() const;
- QString::Direction basicDirection() const;
- QString visual(int index = 0, int len = -1);
-
-#ifndef QT_NO_COMPAT
- const char* data() const { return latin1(); }
-#endif
-
- bool startsWith( const QString& ) const;
-
-private:
- QString( int size, bool dummy ); // allocate size incl. \0
-
- void deref();
- void real_detach();
- void setLength( uint pos );
- void subat( uint );
- bool findArg(int& pos, int& len) const;
-
- static QChar* asciiToUnicode( const char*, uint * len, uint maxlen=(uint)-1 );
- static QChar* asciiToUnicode( const QByteArray&, uint * len );
- static char* unicodeToAscii( const QChar*, uint len );
-
- QStringData *d;
- static QStringData* shared_null;
- static QStringData* makeSharedNull();
-
- friend class QConstString;
- QString(QStringData* dd, bool /*dummy*/) : d(dd) { }
-};
-
-class Q_EXPORT QCharRef {
- friend class QString;
- QString& s;
- uint p;
- QCharRef(QString* str, uint pos) : s(*str), p(pos) { }
- QCharRef(const QCharRef &ref) : s(ref.s), p(ref.p) { }
-
-public:
- // Most QChar operations repeated here...
-
- // all this is not documented: We just say "like QChar" and let it be.
-#if 1
- ushort unicode() const { return s.constref(p).unicode(); }
- char latin1() const { return s.constref(p).latin1(); }
-
- // An operator= for each QChar cast constructor...
- QCharRef operator=(char c ) { s.ref(p)=c; return *this; }
- QCharRef operator=(uchar c ) { s.ref(p)=c; return *this; }
- QCharRef operator=(QChar c ) { s.ref(p)=c; return *this; }
- QCharRef operator=(const QCharRef& c ) { s.ref(p)=c.unicode(); return *this; }
- QCharRef operator=(ushort rc ) { s.ref(p)=rc; return *this; }
- QCharRef operator=(short rc ) { s.ref(p)=rc; return *this; }
- QCharRef operator=(uint rc ) { s.ref(p)=rc; return *this; }
- QCharRef operator=(int rc ) { s.ref(p)=rc; return *this; }
-
- operator QChar () const { return s.constref(p); }
-
- // each function...
- bool isNull() const { return unicode()==0; }
- bool isPrint() const { return s.constref(p).isPrint(); }
- bool isPunct() const { return s.constref(p).isPunct(); }
- bool isSpace() const { return s.constref(p).isSpace(); }
- bool isMark() const { return s.constref(p).isMark(); }
- bool isLetter() const { return s.constref(p).isLetter(); }
- bool isNumber() const { return s.constref(p).isNumber(); }
- bool isLetterOrNumber() { return s.constref(p).isLetterOrNumber(); }
- bool isDigit() const { return s.constref(p).isDigit(); }
-
- int digitValue() const { return s.constref(p).digitValue(); }
- QChar lower() { return s.constref(p).lower(); }
- QChar upper() { return s.constref(p).upper(); }
-
- QChar::Category category() const { return s.constref(p).category(); }
- QChar::Direction direction() const { return s.constref(p).direction(); }
- QChar::Joining joining() const { return s.constref(p).joining(); }
- bool mirrored() const { return s.constref(p).mirrored(); }
- QChar mirroredChar() const { return s.constref(p).mirroredChar(); }
- QString decomposition() const { return s.constref(p).decomposition(); }
- QChar::Decomposition decompositionTag() const { return s.constref(p).decompositionTag(); }
-
- // Not the non-const ones of these.
- uchar cell() const { return s.constref(p).cell(); }
- uchar row() const { return s.constref(p).row(); }
-#endif
-};
-
-inline QCharRef QString::at( uint i ) { return QCharRef(this,i); }
-inline QCharRef QString::operator[]( int i ) { return at((uint)i); }
-
-
-class Q_EXPORT QConstString : private QString {
-public:
- QConstString( QChar* unicode, uint length );
- ~QConstString();
- const QString& string() const { return *this; }
-};
-
-
-/*****************************************************************************
- QString stream functions
- *****************************************************************************/
-#ifndef QT_NO_DATASTREAM
-Q_EXPORT QDataStream &operator<<( QDataStream &, const QString & );
-Q_EXPORT QDataStream &operator>>( QDataStream &, QString & );
-#endif
-
-/*****************************************************************************
- QString inline functions
- *****************************************************************************/
-
-// These two move code into makeSharedNull() and deletesData()
-// to improve cache-coherence (and reduce code bloat), while
-// keeping the common cases fast.
-//
-// No safe way to pre-init shared_null on ALL compilers/linkers.
-inline QString::QString() :
- d(shared_null ? shared_null : makeSharedNull())
-{
- d->ref();
-}
-//
-inline QString::~QString()
-{
- if ( d->deref() ) {
- if ( d == shared_null )
- shared_null = 0;
- d->deleteSelf();
- }
-}
-
-inline QString &QString::operator=( QChar c )
-{ return *this = QString(c); }
-
-inline QString &QString::operator=( char c )
-{ return *this = QString(QChar(c)); }
-
-//inline bool QString::isNull() const
-//{ return unicode() == 0; }
-
-inline bool QString::operator!() const
-{ return isNull(); }
-
-inline uint QString::length() const
-{ return d->len; }
-
-inline bool QString::isEmpty() const
-{ return length() == 0; }
-
-inline QString QString::copy() const
-{ return QString( *this ); }
-
-inline QString &QString::prepend( const QString & s )
-{ return insert(0,s); }
-
-inline QString &QString::prepend( QChar c )
-{ return insert(0,c); }
-
-inline QString &QString::prepend( char c )
-{ return insert(0,c); }
-
-inline QString &QString::append( const QString & s )
-{ return operator+=(s); }
-
-inline QString &QString::append( QChar c )
-{ return operator+=(c); }
-
-inline QString &QString::append( char c )
-{ return operator+=(c); }
-
-inline QString &QString::setNum( short n, int base )
-{ return setNum((long)n, base); }
-
-inline QString &QString::setNum( ushort n, int base )
-{ return setNum((ulong)n, base); }
-
-inline QString &QString::setNum( int n, int base )
-{ return setNum((long)n, base); }
-
-inline QString &QString::setNum( uint n, int base )
-{ return setNum((ulong)n, base); }
-
-inline QString &QString::setNum( float n, char f, int prec )
-{ return setNum((double)n,f,prec); }
-
-inline QString QString::arg(int a, int fieldwidth, int base) const
-{ return arg((long)a, fieldwidth, base); }
-
-inline QString QString::arg(uint a, int fieldwidth, int base) const
-{ return arg((ulong)a, fieldwidth, base); }
-
-inline QString QString::arg(short a, int fieldwidth, int base) const
-{ return arg((long)a, fieldwidth, base); }
-
-inline QString QString::arg(ushort a, int fieldwidth, int base) const
-{ return arg((ulong)a, fieldwidth, base); }
-
-inline int QString::find( char c, int index, bool cs ) const
-{ return find(QChar(c), index, cs); }
-
-inline int QString::findRev( char c, int index, bool cs) const
-{ return findRev( QChar(c), index, cs ); }
-
-
-#ifndef QT_NO_CAST_ASCII
-inline int QString::find( const char* str, int index ) const
-{ return find(QString::fromLatin1(str), index); }
-
-inline int QString::findRev( const char* str, int index ) const
-{ return findRev(QString::fromLatin1(str), index); }
-#endif
-
-
-/*****************************************************************************
- QString non-member operators
- *****************************************************************************/
-
-Q_EXPORT bool operator!=( const QString &s1, const QString &s2 );
-Q_EXPORT bool operator<( const QString &s1, const QString &s2 );
-Q_EXPORT bool operator<=( const QString &s1, const QString &s2 );
-Q_EXPORT bool operator==( const QString &s1, const QString &s2 );
-Q_EXPORT bool operator>( const QString &s1, const QString &s2 );
-Q_EXPORT bool operator>=( const QString &s1, const QString &s2 );
-#ifndef QT_NO_CAST_ASCII
-Q_EXPORT bool operator!=( const QString &s1, const char *s2 );
-Q_EXPORT bool operator<( const QString &s1, const char *s2 );
-Q_EXPORT bool operator<=( const QString &s1, const char *s2 );
-Q_EXPORT bool operator==( const QString &s1, const char *s2 );
-Q_EXPORT bool operator>( const QString &s1, const char *s2 );
-Q_EXPORT bool operator>=( const QString &s1, const char *s2 );
-Q_EXPORT bool operator!=( const char *s1, const QString &s2 );
-Q_EXPORT bool operator<( const char *s1, const QString &s2 );
-Q_EXPORT bool operator<=( const char *s1, const QString &s2 );
-Q_EXPORT bool operator==( const char *s1, const QString &s2 );
-//Q_EXPORT bool operator>( const char *s1, const QString &s2 ); // MSVC++
-Q_EXPORT bool operator>=( const char *s1, const QString &s2 );
-#endif
-
-Q_EXPORT inline QString operator+( const QString &s1, const QString &s2 )
-{
- QString tmp( s1 );
- tmp += s2;
- return tmp;
-}
-
-#ifndef QT_NO_CAST_ASCII
-Q_EXPORT inline QString operator+( const QString &s1, const char *s2 )
-{
- QString tmp( s1 );
- tmp += QString::fromLatin1(s2);
- return tmp;
-}
-
-Q_EXPORT inline QString operator+( const char *s1, const QString &s2 )
-{
- QString tmp = QString::fromLatin1( s1 );
- tmp += s2;
- return tmp;
-}
-#endif
-
-Q_EXPORT inline QString operator+( const QString &s1, QChar c2 )
-{
- QString tmp( s1 );
- tmp += c2;
- return tmp;
-}
-
-Q_EXPORT inline QString operator+( const QString &s1, char c2 )
-{
- QString tmp( s1 );
- tmp += c2;
- return tmp;
-}
-
-Q_EXPORT inline QString operator+( QChar c1, const QString &s2 )
-{
- QString tmp;
- tmp += c1;
- tmp += s2;
- return tmp;
-}
-
-Q_EXPORT inline QString operator+( char c1, const QString &s2 )
-{
- QString tmp;
- tmp += c1;
- tmp += s2;
- return tmp;
-}
-
-#if defined(_OS_WIN32_)
-extern Q_EXPORT QString qt_winQString(void*);
-extern Q_EXPORT const void* qt_winTchar(const QString& str, bool addnul);
-extern Q_EXPORT void* qt_winTchar_new(const QString& str);
-extern Q_EXPORT QCString qt_winQString2MB( const QString& s, int len=-1 );
-extern Q_EXPORT QString qt_winMB2QString( const char* mb, int len=-1 );
-#endif
-
-#endif // QSTRING_H
diff --git a/qtools/qstringlist.cpp b/qtools/qstringlist.cpp
deleted file mode 100644
index aa7ac16..0000000
--- a/qtools/qstringlist.cpp
+++ /dev/null
@@ -1,307 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QStringList
-**
-** Created : 990406
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qstringlist.h"
-
-#ifndef QT_NO_STRINGLIST
-#include "qstrlist.h"
-#include "qdatastream.h"
-#include "qtl.h"
-
-// NOT REVISED
-/*!
- \class QStringList qstringlist.h
- \brief A list of strings.
-
- \ingroup qtl
- \ingroup tools
- \ingroup shared
-
- QStringList is basically a QValueList of QString objects. As opposed
- to QStrList, that stores pointers to characters, QStringList deals
- with real QString objects. It is the class of choice whenever you
- work with unicode strings.
-
- Like QString itself, QStringList objects are implicit shared.
- Passing them around as value-parameters is both fast and safe.
-
- Example:
- \code
- QStringList list;
-
- // three different ways of appending values:
- list.append( "Torben");
- list += "Warwick";
- list << "Matthias" << "Arnt" << "Paul";
-
- // sort the list, Arnt's now first
- list.sort();
-
- // print it out
- for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
- printf( "%s \n", (*it).latin1() );
- }
- \endcode
-
- Convenience methods such as sort(), split(), join() and grep() make
- working with QStringList easy.
-*/
-
-/*!
- \fn QStringList::QStringList()
- Creates an empty list.
-*/
-
-/*! \fn QStringList::QStringList( const QStringList& l )
- Creates a copy of the list. This function is very fast since
- QStringList is implicit shared. However, for the programmer this
- is the same as a deep copy. If this list or the original one or some
- other list referencing the same shared data is modified, then the
- modifying list makes a copy first.
-*/
-
-/*!
- \fn QStringList::QStringList (const QString & i)
- Constructs a string list consisting of the single string \a i.
- To make longer lists easily, use:
- \code
- QString s1,s2,s3;
- ...
- QStringList mylist = QStringList() << s1 << s2 << s3;
- \endcode
-*/
-
-/*!
- \fn QStringList::QStringList (const char* i)
- Constructs a string list consisting of the single latin-1 string \a i.
-*/
-
-/*! \fn QStringList::QStringList( const QValueList<QString>& l )
-
- Constructs a new string list that is a copy of \a l.
-*/
-
-/*!
- Sorts the list of strings in ascending order.
-
- Sorting is very fast. It uses the Qt Template Library's
- efficient HeapSort implementation that operates in O(n*log n).
-*/
-void QStringList::sort()
-{
- qHeapSort(*this);
-}
-
-/*!
- Splits the string \a str using \a sep as separator. Returns the
- list of strings. If \a allowEmptyEntries is TRUE, also empty
- entries are inserted into the list, else not. So if you have
- a string 'abc..d.e.', a list which contains 'abc', 'd', and 'e'
- would be returned if \a allowEmptyEntries is FALSE, but
- a list containing 'abc', '', 'd', 'e' and '' would be returned if
- \a allowEmptyEntries is TRUE.
- If \a str doesn't contain \a sep, a stringlist
- with one item, which is the same as \a str, is returned.
-
- \sa join()
-*/
-
-QStringList QStringList::split( const QChar &sep, const QString &str, bool allowEmptyEntries )
-{
- return split( QString( sep ), str, allowEmptyEntries );
-}
-
-/*!
- Splits the string \a str using \a sep as separator. Returns the
- list of strings. If \a allowEmptyEntries is TRUE, also empty
- entries are inserted into the list, else not. So if you have
- a string 'abc..d.e.', a list which contains 'abc', 'd', and 'e'
- would be returned if \a allowEmptyEntries is FALSE, but
- a list containing 'abc', '', 'd', 'e' and '' would be returned if
- \a allowEmptyEntries is TRUE.
- If \a str doesn't contain \a sep, a stringlist
- with one item, which is the same as \a str, is returned.
-
- \sa join()
-*/
-
-QStringList QStringList::split( const QString &sep, const QString &str, bool allowEmptyEntries )
-{
- QStringList lst;
-
- int j = 0;
- int i = str.find( sep, j );
-
- while ( i != -1 ) {
- if ( str.mid( j, i - j ).length() > 0 )
- lst << str.mid( j, i - j );
- else if ( allowEmptyEntries )
- lst << QString::null;
- j = i + sep.length();
- i = str.find( sep, j );
- }
-
- int l = str.length() - 1;
- if ( str.mid( j, l - j + 1 ).length() > 0 )
- lst << str.mid( j, l - j + 1 );
- else if ( allowEmptyEntries )
- lst << QString::null;
-
- return lst;
-}
-
-QStringList QStringList::split( const QCString &sep, const QCString &str, bool allowEmptyEntries )
-{
- return split(QString(sep.data()),QString(str.data()),allowEmptyEntries);
-}
-
-/*!
- Splits the string \a str using the regular expression \a sep as separator. Returns the
- list of strings. If \a allowEmptyEntries is TRUE, also empty
- entries are inserted into the list, else not. So if you have
- a string 'abc..d.e.', a list which contains 'abc', 'd', and 'e'
- would be returned if \a allowEmptyEntries is FALSE, but
- a list containing 'abc', '', 'd', 'e' and '' would be returned if
- \a allowEmptyEntries is TRUE.
- If \a str doesn't contain \a sep, a stringlist
- with one item, which is the same as \a str, is returned.
-
- \sa join()
-*/
-
-QStringList QStringList::split( const QRegExp &sep, const QString &str, bool allowEmptyEntries )
-{
- QStringList lst;
-
- int j = 0;
- int len = 0;
- int i = sep.match( str.data(), j, &len );
-
- while ( i != -1 ) {
- if ( str.mid( j, i - j ).length() > 0 )
- lst << str.mid( j, i - j );
- else if ( allowEmptyEntries )
- lst << QString::null;
- j = i + len;
- i = sep.match( str.data(), j, &len );
- }
-
- int l = str.length() - 1;
- if ( str.mid( j, l - j + 1 ).length() > 0 )
- lst << str.mid( j, l - j + 1 );
- else if ( allowEmptyEntries )
- lst << QString::null;
-
- return lst;
-}
-
-/*!
- Returns a list of all strings containing the substring \a str.
-
- If \a cs is TRUE, the grep is done case sensitively, else not.
-*/
-
-QStringList QStringList::grep( const QString &str, bool cs ) const
-{
- QStringList res;
- for ( QStringList::ConstIterator it = begin(); it != end(); ++it )
- if ( (*it).contains( str, cs ) )
- res << *it;
-
- return res;
-}
-
-/*!
- Returns a list of all strings containing a substring that matches
- the regular expression \a expr.
-*/
-
-QStringList QStringList::grep( const QRegExp &expr ) const
-{
- QStringList res;
- for ( QStringList::ConstIterator it = begin(); it != end(); ++it )
- if ( (*it).contains( expr ) )
- res << *it;
-
- return res;
-}
-
-/*!
- Joins the stringlist into a single string with each element
- separated by \a sep.
-
- \sa split()
-*/
-QString QStringList::join( const QString &sep ) const
-{
- QString res;
- bool already = FALSE;
- for ( QStringList::ConstIterator it = begin(); it != end(); ++it ) {
- if ( already )
- res += sep;
- already = TRUE;
- res += *it;
- }
-
- return res;
-}
-
-#ifndef QT_NO_DATASTREAM
-Q_EXPORT QDataStream &operator>>( QDataStream & s, QStringList& l )
-{
- return s >> (QValueList<QString>&)l;
-}
-
-Q_EXPORT QDataStream &operator<<( QDataStream & s, const QStringList& l )
-{
- return s << (const QValueList<QString>&)l;
-}
-#endif
-
-/*!
- Converts from a QStrList (ASCII) to a QStringList (Unicode).
-*/
-QStringList QStringList::fromStrList(const QStrList& ascii)
-{
- QStringList res;
- const char * s;
- for ( QStrListIterator it(ascii); (s=it.current()); ++it )
- res << s;
- return res;
-}
-
-#endif //QT_NO_STRINGLIST
diff --git a/qtools/qstringlist.h b/qtools/qstringlist.h
deleted file mode 100644
index 3f9fbb2..0000000
--- a/qtools/qstringlist.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QStringList class
-**
-** Created : 990406
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QSTRINGLIST_H
-#define QSTRINGLIST_H
-
-#ifndef QT_H
-#include "qvaluelist.h"
-#include "qstring.h"
-#include "qregexp.h"
-#endif // QT_H
-
-#ifndef QT_NO_STRINGLIST
-
-class QStrList;
-
-class Q_EXPORT QStringList : public QValueList<QString>
-{
-public:
- QStringList() { }
- QStringList( const QStringList& l ) : QValueList<QString>(l) { }
- QStringList( const QValueList<QString>& l ) : QValueList<QString>(l) { }
- QStringList( const QString& i ) { append(i); }
-#ifndef QT_NO_CAST_ASCII
- QStringList( const char* i ) { append(i); }
-#endif
-
- static QStringList fromStrList(const QStrList&);
-
- void sort();
-
- static QStringList split( const QString &sep, const QString &str, bool allowEmptyEntries = FALSE );
- static QStringList split( const QCString &sep, const QCString &str, bool allowEmptyEntries = FALSE );
- static QStringList split( const QChar &sep, const QString &str, bool allowEmptyEntries = FALSE );
- static QStringList split( const QRegExp &sep, const QString &str, bool allowEmptyEntries = FALSE );
- QString join( const QString &sep ) const;
-
- QStringList grep( const QString &str, bool cs = TRUE ) const;
- QStringList grep( const QRegExp &expr ) const;
-};
-
-#ifndef QT_NO_DATASTREAM
-class QDataStream;
-extern Q_EXPORT QDataStream &operator>>( QDataStream &, QStringList& );
-extern Q_EXPORT QDataStream &operator<<( QDataStream &, const QStringList& );
-#endif
-#endif // QT_NO_STRINGLIST
-#endif // QSTRINGLIST_H
diff --git a/qtools/qstrlist.doc b/qtools/qstrlist.doc
deleted file mode 100644
index 751c6c2..0000000
--- a/qtools/qstrlist.doc
+++ /dev/null
@@ -1,5 +0,0 @@
-/****************************************************************************
-**
-*****************************************************************************/
-
-//typedef QListIterator<char> QStrListIterator;
diff --git a/qtools/qstrlist.h b/qtools/qstrlist.h
deleted file mode 100644
index ebf97c5..0000000
--- a/qtools/qstrlist.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QStrList, QStrIList and QStrListIterator classes
-**
-** Created : 920730
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QSTRLIST_H
-#define QSTRLIST_H
-
-#ifndef QT_H
-#include "qstring.h"
-#include "qinternallist.h"
-#include "qdatastream.h"
-#endif // QT_H
-
-
-#if defined(Q_TEMPLATEDLL)
-template class Q_EXPORT QInternalList<char>;
-template class Q_EXPORT QInternalListIterator<char>;
-#endif
-
-typedef QInternalList<char> QStrListBase;
-typedef QInternalListIterator<char> QStrListIterator;
-
-
-class Q_EXPORT QStrList : public QStrListBase
-{
-public:
- QStrList( bool deepCopies=TRUE ) { dc = deepCopies; del_item = deepCopies; }
- QStrList( const QStrList & );
- ~QStrList() { clear(); }
- QStrList& operator=( const QStrList & );
-
-private:
- QCollection::Item newItem( QCollection::Item d ) { return dc ? qstrdup( (const char*)d ) : d; }
- void deleteItem( QCollection::Item d ) { if ( del_item ) delete[] (char*)d; }
- int compareItems( QCollection::Item s1, QCollection::Item s2 ) { return qstrcmp((const char*)s1,
- (const char*)s2); }
-#ifndef QT_NO_DATASTREAM
- QDataStream &read( QDataStream &s, QCollection::Item &d )
- { s >> (char *&)d; return s; }
- QDataStream &write( QDataStream &s, QCollection::Item d ) const
- { return s << (const char *)d; }
-#endif
- bool dc;
-};
-
-
-class Q_EXPORT QStrIList : public QStrList // case insensitive string list
-{
-public:
- QStrIList( bool deepCopies=TRUE ) : QStrList( deepCopies ) {}
- ~QStrIList() { clear(); }
-private:
- int compareItems( QCollection::Item s1, QCollection::Item s2 )
- { return qstricmp((const char*)s1,
- (const char*)s2); }
-};
-
-
-inline QStrList & QStrList::operator=( const QStrList &strList )
-{
- clear();
- dc = strList.dc;
- del_item = dc;
- QStrListBase::operator=(strList);
- return *this;
-}
-
-inline QStrList::QStrList( const QStrList &strList )
- : QStrListBase( strList )
-{
- dc = FALSE;
- operator=(strList);
-}
-
-
-#endif // QSTRLIST_H
diff --git a/qtools/qstrvec.h b/qtools/qstrvec.h
deleted file mode 100644
index 15d3abb..0000000
--- a/qtools/qstrvec.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QStrVec and QStrIVec classes
-**
-** Created : 931203
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QSTRVEC_H
-#define QSTRVEC_H
-
-#ifndef QT_H
-#include "qstring.h"
-#include "qvector.h"
-#include "qdatastream.h"
-#endif // QT_H
-
-
-#if defined(Q_TEMPLATEDLL)
-template class Q_EXPORT QVector<char>
-#endif
-
-typedef QVector<char> QStrVecBase;
-
-
-class Q_EXPORT QStrVec : public QStrVecBase
-{
-public:
- QStrVec() { dc = TRUE; }
- QStrVec( uint size, bool deepc = TRUE ) : QStrVecBase(size) {dc=deepc;}
- ~QStrVec() { clear(); }
-private:
- Item newItem( Item d ) { return dc ? qstrdup( (const char*)d ) : d; }
- void deleteItem( Item d ) { if ( dc ) delete[] (char*)d; }
- int compareItems( Item s1, Item s2 )
- { return qstrcmp((const char*)s1,
- (const char*)s2); }
-#ifndef QT_NO_DATASTREAM
- QDataStream &read( QDataStream &s, Item &d )
- { s >> (char *&)d; return s; }
- QDataStream &write( QDataStream &s, Item d ) const
- { return s << (const char*)d; }
-#endif
- bool dc;
-};
-
-
-class Q_EXPORT QStrIVec : public QStrVec // case insensitive string vec
-{
-public:
- QStrIVec() {}
- QStrIVec( uint size, bool dc = TRUE ) : QStrVec( size, dc ) {}
- ~QStrIVec() { clear(); }
-private:
- int compareItems( Item s1, Item s2 )
- { return qstricmp((const char*)s1,
- (const char*)s2); }
-};
-
-
-#endif // QSTRVEC_H
diff --git a/qtools/qtextcodec.cpp b/qtools/qtextcodec.cpp
deleted file mode 100644
index 13c3d51..0000000
--- a/qtools/qtextcodec.cpp
+++ /dev/null
@@ -1,2071 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QTextCodec class
-**
-** Created : 981015
-**
-** Copyright (C)1998-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qtextcodec.h"
-#ifndef QT_NO_TEXTCODEC
-
-#include "qinternallist.h"
-#ifndef QT_NO_CODECS
-#include "qutfcodec.h"
-//#include "qgbkcodec.h"
-//#include "qeucjpcodec.h"
-//#include "qjiscodec.h"
-//#include "qsjiscodec.h"
-//#include "qeuckrcodec.h"
-//#include "qbig5codec.h"
-//#include "qrtlcodec.h"
-//#include "qtsciicodec.h"
-#endif
-
-#include "qfile.h"
-#include "qstrlist.h"
-#include "qstring.h"
-
-#include <stdlib.h>
-#include <ctype.h>
-#include <locale.h>
-
-
-static QInternalList<QTextCodec> * all = 0;
-static bool destroying_is_ok; // starts out as 0
-
-/*! Deletes all the created codecs.
-
- \warning Do not call this function.
-
- QApplication calls this just before exiting, to delete any
- QTextCodec objects that may be lying around. Since various other
- classes hold pointers to QTextCodec objects, it is not safe to call
- this function earlier.
-
- If you are using the utility classes (like QString) but not using
- QApplication, calling this function at the very end of your
- application can be helpful to chasing down memory leaks, as
- QTextCodec objects will not show up.
-*/
-
-void QTextCodec::deleteAllCodecs()
-{
- if ( !all )
- return;
-
- destroying_is_ok = TRUE;
- QInternalList<QTextCodec> * ball = all;
- all = 0;
- ball->clear();
- delete ball;
- destroying_is_ok = FALSE;
-}
-
-
-static void setupBuiltinCodecs();
-
-
-static void realSetup()
-{
-#if defined(CHECK_STATE)
- if ( destroying_is_ok )
- qWarning( "creating new codec during codec cleanup" );
-#endif
- all = new QInternalList<QTextCodec>;
- all->setAutoDelete( TRUE );
- setupBuiltinCodecs();
-}
-
-
-static inline void setup()
-{
- if ( !all )
- realSetup();
-}
-
-
-class QTextStatelessEncoder: public QTextEncoder {
- const QTextCodec* codec;
-public:
- QTextStatelessEncoder(const QTextCodec*);
- QCString fromUnicode(const QString& uc, int& lenInOut);
-};
-
-
-class QTextStatelessDecoder : public QTextDecoder {
- const QTextCodec* codec;
-public:
- QTextStatelessDecoder(const QTextCodec*);
- QString toUnicode(const char* chars, int len);
-};
-
-QTextStatelessEncoder::QTextStatelessEncoder(const QTextCodec* c) :
- codec(c)
-{
-}
-
-
-QCString QTextStatelessEncoder::fromUnicode(const QString& uc, int& lenInOut)
-{
- return codec->fromUnicode(uc,lenInOut);
-}
-
-
-QTextStatelessDecoder::QTextStatelessDecoder(const QTextCodec* c) :
- codec(c)
-{
-}
-
-
-QString QTextStatelessDecoder::toUnicode(const char* chars, int len)
-{
- return codec->toUnicode(chars,len);
-}
-
-
-
-// NOT REVISED
-/*!
- \class QTextCodec qtextcodec.h
- \brief Provides conversion between text encodings.
-
- By making objects of subclasses of QTextCodec, support for
- new text encodings can be added to Qt.
-
- The abstract virtual functions describe the encoder to the
- system and the coder is used as required in the different
- text file formats supported QTextStream and, under X11 for the
- locale-specific character input and output (under Windows NT
- codecs are not needed for GUI I/O since the system works
- with Unicode already, and Windows 95/98 has built-in convertors
- for the 8-bit local encoding).
-
- More recently created QTextCodec objects take precedence
- over earlier ones.
-
- To add support for another 8-bit encoding to Qt, make a subclass
- or QTextCodec and implement at least the following methods:
- <dl>
- <dt>\c const char* name() const
- <dd>Return the official name for the encoding.
- <dt>\c int mibEnum() const
- <dd>Return the MIB enum for the encoding if it is listed in the
- <a href=ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets>
- IANA character-sets encoding file</a>.
- </dl>
- If the encoding is multi-byte then it will have "state"; that is,
- the interpretation of some bytes will be dependent on some preceding
- bytes. For such an encoding, you will need to implement
- <dl>
- <dt> \c QTextDecoder* makeDecoder() const
- <dd>Return a QTextDecoder that remembers incomplete multibyte
- sequence prefixes or other required state.
- </dl>
- If the encoding does \e not require state, you should implement:
- <dl>
- <dt> \c QString toUnicode(const char* chars, int len) const
- <dd>Converts \e len characters from \e chars to Unicode.
- </dl>
- The base QTextCodec class has default implementations of the above
- two functions, <i>but they are mutually recursive</i>, so you must
- re-implement at least one of them, or both for improved efficiency.
-
- For conversion from Unicode to 8-bit encodings, it is rarely necessary
- to maintain state. However, two functions similar to the two above
- are used for encoding:
- <dl>
- <dt> \c QTextEncoder* makeEncoder() const
- <dd>Return a QTextDecoder.
- <dt> \c QCString fromUnicode(const QString& uc, int& lenInOut ) const;
- <dd>Converts \e lenInOut characters (of type QChar) from the start
- of the string \a uc, returning a QCString result, and also returning
- the \link QCString::length() length\endlink
- of the result in lenInOut.
- </dl>
- Again, these are mutually recursive so only one needs to be implemented,
- or both if better efficiency is possible.
-
- Finally, you must implement:
- <dl>
- <dt> \c int heuristicContentMatch(const char* chars, int len) const
- <dd>Gives a value indicating how likely it is that \e len characters
- from \e chars are in the encoding.
- </dl>
- A good model for this function is the
- QWindowsLocalCodec::heuristicContentMatch function found in the Qt sources.
-
- A QTextCodec subclass might have improved performance if you also
- re-implement:
- <dl>
- <dt> \c bool canEncode( QChar ) const
- <dd>Test if a Unicode character can be encoded.
- <dt> \c bool canEncode( const QString& ) const
- <dd>Test if a string of Unicode characters can be encoded.
- <dt> \c int heuristicNameMatch(const char* hint) const
- <dd>Test if a possibly non-standard name is referring to the codec.
- </dl>
-*/
-
-
-/*!
- Constructs a QTextCodec, making it of highest precedence.
- The QTextCodec should always be constructed on the heap
- (with new), and once constructed it becomes the responsibility
- of Qt to delete it (which is done at QApplication destruction).
-*/
-QTextCodec::QTextCodec()
-{
- setup();
- all->insert(0,this);
-}
-
-
-/*!
- Destructs the QTextCodec. Note that you should not delete
- codecs yourself - once created they become the responsibility
- of Qt to delete.
-*/
-QTextCodec::~QTextCodec()
-{
- if ( !destroying_is_ok )
- qWarning("QTextCodec::~QTextCodec() called by application");
- if ( all )
- all->remove( this );
-}
-
-
-/*!
- Returns a value indicating how likely this decoder is
- for decoding some format that has the given name.
-
- A good match returns a positive number around
- the length of the string. A bad match is negative.
-
- The default implementation calls simpleHeuristicNameMatch()
- with the name of the codec.
-*/
-int QTextCodec::heuristicNameMatch(const char* hint) const
-{
- return simpleHeuristicNameMatch(name(),hint);
-}
-
-
-// returns a string containing the letters and numbers from input,
-// with a space separating run of a character class. e.g. "iso8859-1"
-// becomes "iso 8859 1"
-static QString lettersAndNumbers( const char * input )
-{
- QString result;
- QChar c;
-
- while( input && *input ) {
- c = *input;
- if ( c.isLetter() || c.isNumber() )
- result += c.lower();
- if ( input[1] ) {
- // add space at character class transition, except
- // transition from upper-case to lower-case letter
- QChar n( input[1] );
- if ( c.isLetter() && n.isLetter() ) {
- if ( c == c.lower() && n == n.upper() )
- result += ' ';
- } else if ( c.category() != n.category() ) {
- result += ' ';
- }
- }
- input++;
- }
- return result.simplifyWhiteSpace();
-}
-
-/*!
- A simple utility function for heuristicNameMatch() - it
- does some very minor character-skipping
- so that almost-exact matches score high.
-*/
-int QTextCodec::simpleHeuristicNameMatch(const char* name, const char* hint)
-{
- // if they're the same, return a perfect score.
- if ( name && hint && qstrcmp( name, hint ) == 0 )
- return qstrlen( hint );
-
- // if the letters and numbers are the same, we have an "almost"
- // perfect match.
- QString h( lettersAndNumbers( hint ) );
- QString n( lettersAndNumbers( name ) );
- if ( h == n )
- return qstrlen( hint )-1;
-
- if ( h.stripWhiteSpace() == n.stripWhiteSpace() )
- return qstrlen( hint )-2;
-
- // could do some more here, but I don't think it's worth it
-
- return 0;
-}
-
-
-/*!
- Returns the QTextCodec \a i places from the more recently
- inserted, or NULL if there is no such QTextCodec. Thus,
- codecForIndex(0) returns the most recently created QTextCodec.
-*/
-QTextCodec* QTextCodec::codecForIndex(int i)
-{
- setup();
- return (uint)i >= all->count() ? 0 : all->at(i);
-}
-
-
-/*!
- Returns the QTextCodec which matches the
- \link QTextCodec::mibEnum() MIBenum\endlink \a mib.
-*/
-QTextCodec* QTextCodec::codecForMib(int mib)
-{
- setup();
- QInternalListIterator<QTextCodec> i(*all);
- QTextCodec* result;
- for ( ; (result=i); ++i ) {
- if ( result->mibEnum()==mib )
- break;
- }
- return result;
-}
-
-
-
-
-
-#ifdef _OS_WIN32_
-class QWindowsLocalCodec: public QTextCodec
-{
-public:
- QWindowsLocalCodec();
- ~QWindowsLocalCodec();
-
- QString toUnicode(const char* chars, int len) const;
- QCString fromUnicode(const QString& uc, int& lenInOut ) const;
-
- const char* name() const;
- int mibEnum() const;
-
- int heuristicContentMatch(const char* chars, int len) const;
-};
-
-QWindowsLocalCodec::QWindowsLocalCodec()
-{
-}
-
-QWindowsLocalCodec::~QWindowsLocalCodec()
-{
-}
-
-
-QString QWindowsLocalCodec::toUnicode(const char* chars, int len) const
-{
- if ( len == 1 && chars ) { // Optimization; avoids allocation
- char c[2];
- c[0] = *chars;
- c[1] = 0;
- return qt_winMB2QString( c, 2 );
- }
- if ( len < 0 )
- return qt_winMB2QString( chars );
- QCString s(chars,len+1);
- return qt_winMB2QString(s);
-}
-
-QCString QWindowsLocalCodec::fromUnicode(const QString& uc, int& lenInOut ) const
-{
- QCString r = qt_winQString2MB( uc, lenInOut );
- lenInOut = r.length();
- return r;
-}
-
-
-const char* QWindowsLocalCodec::name() const
-{
- return "System";
-}
-
-int QWindowsLocalCodec::mibEnum() const
-{
- return 0;
-}
-
-
-int QWindowsLocalCodec::heuristicContentMatch(const char* chars, int len) const
-{
- // ### Not a bad default implementation?
- QString t = toUnicode(chars,len);
- int l = t.length();
- QCString mb = fromUnicode(t,l);
- int i=0;
- while ( i < len )
- if ( chars[i] == mb[i] )
- i++;
- return i;
-}
-
-#else
-
-/* locale names mostly copied from XFree86 */
-static const char * const iso8859_2locales[] = {
- "croatian", "cs", "cs_CS", "cs_CZ","cz", "cz_CZ", "czech", "hr",
- "hr_HR", "hu", "hu_HU", "hungarian", "pl", "pl_PL", "polish", "ro",
- "ro_RO", "rumanian", "serbocroatian", "sh", "sh_SP", "sh_YU", "sk",
- "sk_SK", "sl", "sl_CS", "sl_SI", "slovak", "slovene", "sr_SP", 0 };
-
-static const char * const iso8859_3locales[] = {
- "eo", 0 };
-
-static const char * const iso8859_4locales[] = {
- "ee", "ee_EE", "lt", "lt_LT", "lv", "lv_LV", 0 };
-
-static const char * const iso8859_5locales[] = {
- "bg", "bg_BG", "bulgarian", "mk", "mk_MK",
- "sp", "sp_YU", 0 };
-
-static const char * const iso8859_6locales[] = {
- "ar_AA", "ar_SA", "arabic", 0 };
-
-static const char * const iso8859_7locales[] = {
- "el", "el_GR", "greek", 0 };
-
-static const char * const iso8859_8locales[] = {
- "hebrew", "he", "he_IL", "iw", "iw_IL", 0 };
-
-static const char * const iso8859_9locales[] = {
- "tr", "tr_TR", "turkish", 0 };
-
-static const char * const iso8859_15locales[] = {
- "fr", "fi", "french", "finnish", "et", "et_EE", 0 };
-
-static const char * const koi8_ulocales[] = {
- "uk", "uk_UA", "ru_UA", "ukrainian", 0 };
-
-static const char * const tis_620locales[] = {
- "th", "th_TH", "thai", 0 };
-
-
-static bool try_locale_list( const char * const locale[], const char * lang )
-{
- int i;
- for( i=0; locale[i] && qstrcmp(locale[i], lang); i++ )
- { }
- return locale[i] != 0;
-}
-
-// For the probably_koi8_locales we have to look. the standard says
-// these are 8859-5, but almost all Russian users uses KOI8-R and
-// incorrectly set $LANG to ru_RU. We'll check tolower() to see what
-// tolower() thinks ru_RU means.
-
-// If you read the history, it seems that many Russians blame ISO and
-// Peristroika for the confusion.
-//
-// The real bug is that some programs break if the user specifies
-// ru_RU.KOI8-R.
-
-static const char * const probably_koi8_rlocales[] = {
- "ru", "ru_SU", "ru_RU", "russian", 0 };
-
-// this means ANY of these locale aliases. if they're aliases for
-// different locales, the code breaks.
-static QTextCodec * ru_RU_codec = 0;
-
-static QTextCodec * ru_RU_hack( const char * i ) {
- if ( ! ru_RU_codec ) {
- QCString origlocale = setlocale( LC_CTYPE, i );
- // unicode koi8r latin5 name
- // 0x044E 0xC0 0xEE CYRILLIC SMALL LETTER YU
- // 0x042E 0xE0 0xCE CYRILLIC CAPITAL LETTER YU
- int latin5 = tolower( 0xCE );
- int koi8r = tolower( 0xE0 );
- if ( koi8r == 0xC0 && latin5 != 0xEE ) {
- ru_RU_codec = QTextCodec::codecForName( "KOI8-R" );
- } else if ( koi8r != 0xC0 && latin5 == 0xEE ) {
- ru_RU_codec = QTextCodec::codecForName( "ISO 8859-5" );
- } else {
- // something else again... let's assume... *throws dice*
- ru_RU_codec = QTextCodec::codecForName( "KOI8-R" );
- qWarning( "QTextCodec: using KOI8-R, probe failed (%02x %02x %s)",
- koi8r, latin5, i );
- }
- setlocale( LC_CTYPE, origlocale.data() );
- }
- return ru_RU_codec;
-}
-
-#endif
-
-static QTextCodec * localeMapper = 0;
-
-void qt_set_locale_codec( QTextCodec *codec )
-{
- localeMapper = codec;
-}
-
-/*! Returns a pointer to the codec most suitable for this locale. */
-
-QTextCodec* QTextCodec::codecForLocale()
-{
- if ( localeMapper )
- return localeMapper;
-
- setup();
-
-#ifdef _OS_WIN32_
- localeMapper = new QWindowsLocalCodec;
-#else
- // Very poorly defined and followed standards causes lots of code
- // to try to get all the cases...
-
- char * lang = qstrdup( getenv("LANG") );
-
- char * p = lang ? strchr( lang, '.' ) : 0;
- if ( !p || *p != '.' ) {
- // Some versions of setlocale return encoding, others not.
- char *ctype = qstrdup( setlocale( LC_CTYPE, 0 ) );
- // Some Linux distributions have broken locales which will return
- // "C" for LC_CTYPE
- if ( qstrcmp( ctype, "C" ) == 0 ) {
- delete [] ctype;
- } else {
- if ( lang )
- delete [] lang;
- lang = ctype;
- p = lang ? strchr( lang, '.' ) : 0;
- }
- }
-
- if( p && *p == '.' ) {
- // if there is an encoding and we don't know it, we return 0
- // User knows what they are doing. Codecs will believe them.
- localeMapper = codecForName( lang );
- if ( !localeMapper ) {
- // Use or codec disagree.
- localeMapper = codecForName( p+1 );
- }
- }
- if ( !localeMapper || !(p && *p == '.') ) {
- // if there is none, we default to 8859-1
- // We could perhaps default to 8859-15.
- if ( try_locale_list( iso8859_2locales, lang ) )
- localeMapper = codecForName( "ISO 8859-2" );
- else if ( try_locale_list( iso8859_3locales, lang ) )
- localeMapper = codecForName( "ISO 8859-3" );
- else if ( try_locale_list( iso8859_4locales, lang ) )
- localeMapper = codecForName( "ISO 8859-4" );
- else if ( try_locale_list( iso8859_5locales, lang ) )
- localeMapper = codecForName( "ISO 8859-5" );
- else if ( try_locale_list( iso8859_6locales, lang ) )
- localeMapper = codecForName( "ISO 8859-6-I" );
- else if ( try_locale_list( iso8859_7locales, lang ) )
- localeMapper = codecForName( "ISO 8859-7" );
- else if ( try_locale_list( iso8859_8locales, lang ) )
- localeMapper = codecForName( "ISO 8859-8-I" );
- else if ( try_locale_list( iso8859_9locales, lang ) )
- localeMapper = codecForName( "ISO 8859-9" );
- else if ( try_locale_list( iso8859_15locales, lang ) )
- localeMapper = codecForName( "ISO 8859-15" );
- else if ( try_locale_list( tis_620locales, lang ) )
- localeMapper = codecForName( "ISO 8859-11" );
- else if ( try_locale_list( koi8_ulocales, lang ) )
- localeMapper = codecForName( "KOI8-U" );
- else if ( try_locale_list( probably_koi8_rlocales, lang ) )
- localeMapper = ru_RU_hack( lang );
- else if (!lang || !(localeMapper = codecForName(lang) ))
- localeMapper = codecForName( "ISO 8859-1" );
- }
- delete[] lang;
-#endif
-
- return localeMapper;
-}
-
-
-/*!
- Searches all installed QTextCodec objects, returning the one
- which best matches given name. Returns NULL if no codec has
- a match closeness above \a accuracy.
-
- \sa heuristicNameMatch()
-*/
-QTextCodec* QTextCodec::codecForName(const char* hint, int accuracy)
-{
- setup();
- QInternalListIterator<QTextCodec> i(*all);
- QTextCodec* result = 0;
- int best=accuracy;
- for ( QTextCodec* cursor; (cursor=i); ++i ) {
- int s = cursor->heuristicNameMatch(hint);
- if ( s > best ) {
- best = s;
- result = cursor;
- }
- }
- return result;
-}
-
-
-/*!
- Searches all installed QTextCodec objects, returning the one
- which most recognizes the given content. May return 0.
-
- Note that this is often a poor choice, since character
- encodings often use most of the available character sequences,
- and so only by linguistic analysis could a true match be made.
-
- \sa heuristicContentMatch()
-*/
-QTextCodec* QTextCodec::codecForContent(const char* chars, int len)
-{
- setup();
- QInternalListIterator<QTextCodec> i(*all);
- QTextCodec* result = 0;
- int best=0;
- for ( QTextCodec* cursor; (cursor=i); ++i ) {
- int s = cursor->heuristicContentMatch(chars,len);
- if ( s > best ) {
- best = s;
- result = cursor;
- }
- }
- return result;
-}
-
-
-/*!
- \fn const char* QTextCodec::name() const
- Subclasses of QTextCodec must reimplement this function. It returns
- the name of the encoding supported by the subclass. When choosing
- a name for an encoding, consider these points:
- <ul>
- <li>On X11, heuristicNameMatch( const char * hint )
- is used to test if a the QTextCodec
- can convert between Unicode and the encoding of a font
- with encoding \e hint, such as "iso8859-1" for Latin-1 fonts,
- "koi8-r" for Russian KOI8 fonts.
- The default algorithm of heuristicNameMatch() uses name().
- <li>Some applications may use this function to present
- encodings to the end user.
- </ul>
-*/
-
-/*!
- \fn int QTextCodec::mibEnum() const
-
- Subclasses of QTextCodec must reimplement this function. It returns the
- MIBenum (see
- <a href="ftp://ftp.isi.edu/in-notes/iana/assignments/character-sets">
- the IANA character-sets encoding file</a> for more information).
- It is important that each QTextCodec subclass return the correct unique
- value for this function.
-*/
-
-
-/*!
- \fn int QTextCodec::heuristicContentMatch(const char* chars, int len) const
-
- Subclasses of QTextCodec must reimplement this function. It examines
- the first \a len bytes of \a chars and returns a value indicating how
- likely it is that the string is a prefix of text encoded in the
- encoding of the subclass. Any negative return value indicates that the text
- is detectably not in the encoding (eg. it contains undefined characters).
- A return value of 0 indicates that the text should be decoded with this
- codec rather than as ASCII, but there
- is no particular evidence. The value should range up to \a len. Thus,
- most decoders will return -1, 0, or -\a len.
-
- The characters are not null terminated.
-
- \sa codecForContent().
-*/
-
-
-/*!
- Creates a QTextDecoder which stores enough state to decode chunks
- of char* data to create chunks of Unicode data. The default implementation
- creates a stateless decoder, which is sufficient for only the simplest
- encodings where each byte corresponds to exactly one Unicode character.
-
- The caller is responsible for deleting the returned object.
-*/
-QTextDecoder* QTextCodec::makeDecoder() const
-{
- return new QTextStatelessDecoder(this);
-}
-
-
-/*!
- Creates a QTextEncoder which stores enough state to encode chunks
- of Unicode data as char* data. The default implementation
- creates a stateless encoder, which is sufficient for only the simplest
- encodings where each Unicode character corresponds to exactly one char.
-
- The caller is responsible for deleting the returned object.
-*/
-QTextEncoder* QTextCodec::makeEncoder() const
-{
- return new QTextStatelessEncoder(this);
-}
-
-
-/*!
- Subclasses of QTextCodec must reimplement this function or
- makeDecoder(). It converts the first \a len characters of \a chars
- to Unicode.
-
- The default implementation makes a decoder with makeDecoder() and
- converts the input with that. Note that the default makeDecoder()
- implementation makes a decoder that simply calls
- this function, hence subclasses \e must reimplement one function or
- the other to avoid infinite recursion.
-*/
-QString QTextCodec::toUnicode(const char* chars, int len) const
-{
- QTextDecoder* i = makeDecoder();
- QString result = i->toUnicode(chars,len);
- delete i;
- return result;
-}
-
-
-/*!
- Subclasses of QTextCodec must reimplement either this function or
- makeEncoder(). It converts the first \a lenInOut characters of \a
- uc from Unicode to the encoding of the subclass. If \a lenInOut
- is negative or too large, the length of \a uc is used instead.
-
- The value returned is the property of the caller, which is
- responsible for deleting it with "delete []". The length of the
- resulting Unicode character sequence is returned in \a lenInOut.
-
- The default implementation makes an encoder with makeEncoder() and
- converts the input with that. Note that the default makeEncoder()
- implementation makes an encoder that simply calls
- this function, hence subclasses \e must reimplement one function or
- the other to avoid infinite recursion.
-*/
-
-QCString QTextCodec::fromUnicode(const QString& uc, int& lenInOut) const
-{
- QTextEncoder* i = makeEncoder();
- QCString result = i->fromUnicode(uc, lenInOut);
- delete i;
- return result;
-}
-
-/*!
- \overload QCString QTextCodec::fromUnicode(const QString& uc) const
-*/
-QCString QTextCodec::fromUnicode(const QString& uc) const
-{
- int l = uc.length();
- return fromUnicode(uc,l);
-}
-
-/*!
- \overload QString QTextCodec::toUnicode(const QByteArray& a, int len) const
-*/
-QString QTextCodec::toUnicode(const QByteArray& a, int len) const
-{
- int l = a.size();
- if( l > 0 && a.data()[l - 1] == '\0' ) l--;
- l = QMIN( l, len );
- return toUnicode( a.data(), l );
-}
-
-/*!
- \overload QString QTextCodec::toUnicode(const QByteArray& a) const
-*/
-QString QTextCodec::toUnicode(const QByteArray& a) const
-{
- int l = a.size();
- if( l > 0 && a.data()[l - 1] == '\0' ) l--;
- return toUnicode( a.data(), l );
-}
-
-/*!
- \overload QString QTextCodec::toUnicode(const char* chars) const
-*/
-QString QTextCodec::toUnicode(const char* chars) const
-{
- return toUnicode(chars,qstrlen(chars));
-}
-
-/*!
- Returns TRUE if the unicode character \a ch can be fully encoded
- with this codec. The default implementation tests if the result of
- toUnicode(fromUnicode(ch)) is the original \a ch. Subclasses may be
- able to improve the efficiency.
-*/
-bool QTextCodec::canEncode( QChar ch ) const
-{
- return toUnicode(fromUnicode(ch)) == ch;
-}
-
-/*!
- Returns TRUE if the unicode string \a s can be fully encoded
- with this codec. The default implementation tests if the result of
- toUnicode(fromUnicode(s)) is the original \a s. Subclasses may be
- able to improve the efficiency.
-*/
-bool QTextCodec::canEncode( const QString& s ) const
-{
- return toUnicode(fromUnicode(s)) == s;
-}
-
-
-
-/*!
- \class QTextEncoder qtextcodec.h
- \brief State-based encoder
-
- A QTextEncoder converts Unicode into another format, remembering
- any state that is required between calls.
-
- \sa QTextCodec::makeEncoder()
-*/
-
-/*!
- Destructs the encoder.
-*/
-QTextEncoder::~QTextEncoder()
-{
-}
-/*!
- \fn QCString QTextEncoder::fromUnicode(const QString& uc, int& lenInOut)
-
- Converts \a lenInOut characters (not bytes) from \a uc, producing
- a QCString. \a lenInOut will also be set to the
- \link QCString::length() length\endlink of the result (in bytes).
-
- The encoder is free to record state to use when subsequent calls are
- made to this function (for example, it might change modes with escape
- sequences if needed during the encoding of one string, then assume that
- mode applies when a subsequent call begins).
-*/
-
-/*!
- \class QTextDecoder qtextcodec.h
- \brief State-based decoder
-
- A QTextEncoder converts a text format into Unicode, remembering
- any state that is required between calls.
-
- \sa QTextCodec::makeEncoder()
-*/
-
-
-/*!
- Destructs the decoder.
-*/
-QTextDecoder::~QTextDecoder()
-{
-}
-
-/*!
- \fn QString QTextDecoder::toUnicode(const char* chars, int len)
-
- Converts the first \a len bytes at \a chars to Unicode, returning the
- result.
-
- If not all characters are used (eg. only part of a multi-byte
- encoding is at the end of the characters), the decoder remembers
- enough state to continue with the next call to this function.
-*/
-
-#define CHAINED 0xffff
-
-struct QMultiByteUnicodeTable {
- // If multibyte, ignore unicode and index into multibyte
- // with the next character.
- QMultiByteUnicodeTable() : unicode(0xfffd), multibyte(0) { }
-
- ~QMultiByteUnicodeTable()
- {
- if ( multibyte )
- delete [] multibyte;
- }
-
- ushort unicode;
- QMultiByteUnicodeTable* multibyte;
-};
-
-#ifndef QT_NO_CODECS
-static int getByte(char* &cursor)
-{
- int byte = 0;
- if ( *cursor ) {
- if ( cursor[1] == 'x' )
- byte = (int)strtol(cursor+2,&cursor,16);
- else if ( cursor[1] == 'd' )
- byte = (int)strtol(cursor+2,&cursor,10);
- else
- byte = (int)strtol(cursor+2,&cursor,8);
- }
- return byte&0xff;
-}
-
-class QTextCodecFromIOD;
-
-class QTextCodecFromIODDecoder : public QTextDecoder {
- const QTextCodecFromIOD* codec;
- QMultiByteUnicodeTable* mb;
-public:
- QTextCodecFromIODDecoder(const QTextCodecFromIOD* c);
- QString toUnicode(const char* chars, int len);
-};
-
-class QTextCodecFromIOD : public QTextCodec {
- friend class QTextCodecFromIODDecoder;
-
- QCString n;
-
- // If from_unicode_page[row()][cell()] is 0 and from_unicode_page_multibyte,
- // use from_unicode_page_multibyte[row()][cell()] as string.
- char** from_unicode_page;
- char*** from_unicode_page_multibyte;
- char unkn;
-
- // Only one of these is used
- ushort* to_unicode;
- QMultiByteUnicodeTable* to_unicode_multibyte;
- int max_bytes_per_char;
- QStrList aliases;
-
- bool stateless() const { return !to_unicode_multibyte; }
-
-public:
- QTextCodecFromIOD(QIODevice* iod)
- {
- from_unicode_page = 0;
- to_unicode_multibyte = 0;
- to_unicode = 0;
- from_unicode_page_multibyte = 0;
- max_bytes_per_char = 1;
-
- const int maxlen=100;
- char line[maxlen];
- char esc='\\';
- char comm='%';
- bool incmap = FALSE;
- while (iod->readLine(line,maxlen) > 0) {
- if (0==qstrnicmp(line,"<code_set_name>",15))
- n = line+15;
- else if (0==qstrnicmp(line,"<escape_char> ",14))
- esc = line[14];
- else if (0==qstrnicmp(line,"<comment_char> ",15))
- comm = line[15];
- else if (line[0]==comm && 0==qstrnicmp(line+1," alias ",7)) {
- aliases.append(line+8);
- } else if (0==qstrnicmp(line,"CHARMAP",7)) {
- if (!from_unicode_page) {
- from_unicode_page = new char*[256];
- for (int i=0; i<256; i++)
- from_unicode_page[i]=0;
- }
- if (!to_unicode) {
- to_unicode = new ushort[256];
- }
- incmap = TRUE;
- } else if (0==qstrnicmp(line,"END CHARMAP",11))
- break;
- else if (incmap) {
- char* cursor = line;
- int byte=0,unicode=-1;
- ushort* mb_unicode=0;
- const int maxmb=8; // more -> we'll need to improve datastructures
- char mb[maxmb+1];
- int nmb=0;
-
- while (*cursor) {
- if (cursor[0]=='<' && cursor[1]=='U' &&
- cursor[2]>='0' && cursor[2]<='9' &&
- cursor[3]>='0' && cursor[3]<='9') {
-
- unicode = (int)strtol(cursor+2,&cursor,16);
-
- } else if (*cursor==esc) {
-
- byte = getByte(cursor);
-
- if ( *cursor == esc ) {
- if ( !to_unicode_multibyte ) {
- to_unicode_multibyte =
- new QMultiByteUnicodeTable[256];
- for (int i=0; i<256; i++) {
- to_unicode_multibyte[i].unicode =
- to_unicode[i];
- to_unicode_multibyte[i].multibyte = 0;
- }
- delete [] to_unicode;
- to_unicode = 0;
- }
- QMultiByteUnicodeTable* mbut =
- to_unicode_multibyte+byte;
- mb[nmb++] = byte;
- while ( nmb < maxmb && *cursor == esc ) {
- // Always at least once
-
- mbut->unicode = CHAINED;
- byte = getByte(cursor);
- mb[nmb++] = byte;
- if (!mbut->multibyte) {
- mbut->multibyte =
- new QMultiByteUnicodeTable[256];
- }
- mbut = mbut->multibyte+byte;
- mb_unicode = & mbut->unicode;
- }
-
- if ( nmb > max_bytes_per_char )
- max_bytes_per_char = nmb;
- }
- } else {
- cursor++;
- }
- }
-
- if (unicode >= 0 && unicode <= 0xffff)
- {
- QChar ch((ushort)unicode);
- if (!from_unicode_page[ch.row()]) {
- from_unicode_page[ch.row()] = new char[256];
- for (int i=0; i<256; i++)
- from_unicode_page[ch.row()][i]=0;
- }
- if ( mb_unicode ) {
- from_unicode_page[ch.row()][ch.cell()] = 0;
- if (!from_unicode_page_multibyte) {
- from_unicode_page_multibyte = new char**[256];
- for (int i=0; i<256; i++)
- from_unicode_page_multibyte[i]=0;
- }
- if (!from_unicode_page_multibyte[ch.row()]) {
- from_unicode_page_multibyte[ch.row()] = new char*[256];
- for (int i=0; i<256; i++)
- from_unicode_page_multibyte[ch.row()][i] = 0;
- }
- mb[nmb++] = 0;
- from_unicode_page_multibyte[ch.row()][ch.cell()]
- = qstrdup(mb);
- *mb_unicode = unicode;
- } else {
- from_unicode_page[ch.row()][ch.cell()] = (char)byte;
- if ( to_unicode )
- to_unicode[byte] = unicode;
- else
- to_unicode_multibyte[byte].unicode = unicode;
- }
- } else {
- }
- }
- }
- n = n.stripWhiteSpace();
-
- unkn = '?'; // ##### Might be a bad choice.
- }
-
- ~QTextCodecFromIOD()
- {
- if ( from_unicode_page ) {
- for (int i=0; i<256; i++)
- if (from_unicode_page[i])
- delete [] from_unicode_page[i];
- }
- if ( from_unicode_page_multibyte ) {
- for (int i=0; i<256; i++)
- if (from_unicode_page_multibyte[i])
- for (int j=0; j<256; j++)
- if (from_unicode_page_multibyte[i][j])
- delete [] from_unicode_page_multibyte[i][j];
- }
- if ( to_unicode )
- delete [] to_unicode;
- if ( to_unicode_multibyte )
- delete [] to_unicode_multibyte;
- }
-
- bool ok() const
- {
- return !!from_unicode_page;
- }
-
- QTextDecoder* makeDecoder() const
- {
- if ( stateless() )
- return QTextCodec::makeDecoder();
- else
- return new QTextCodecFromIODDecoder(this);
- }
-
- const char* name() const
- {
- return n;
- }
-
- int mibEnum() const
- {
- return 0; // #### Unknown.
- }
-
- int heuristicContentMatch(const char*, int) const
- {
- return 0;
- }
-
- int heuristicNameMatch(const char* hint) const
- {
- int bestr = QTextCodec::heuristicNameMatch(hint);
- QStrListIterator it(aliases);
- char* a;
- while ((a=it.current())) {
- ++it;
- int r = simpleHeuristicNameMatch(a,hint);
- if (r > bestr)
- bestr = r;
- }
- return bestr;
- }
-
- QString toUnicode(const char* chars, int len) const
- {
- const uchar* uchars = (const uchar*)chars;
- QString result;
- QMultiByteUnicodeTable* multibyte=to_unicode_multibyte;
- if ( multibyte ) {
- while (len--) {
- QMultiByteUnicodeTable& mb = multibyte[*uchars];
- if ( mb.multibyte ) {
- // Chained multi-byte
- multibyte = mb.multibyte;
- } else {
- result += QChar(mb.unicode);
- multibyte=to_unicode_multibyte;
- }
- uchars++;
- }
- } else {
- while (len--)
- result += QChar(to_unicode[*uchars++]);
- }
- return result;
- }
-
- QCString fromUnicode(const QString& uc, int& lenInOut) const
- {
- if (lenInOut > (int)uc.length())
- lenInOut = uc.length();
- int rlen = lenInOut*max_bytes_per_char;
- QCString rstr(rlen);
- char* cursor = rstr.rawData();
- char* s=0;
- int l = lenInOut;
- int lout = 0;
- for (int i=0; i<l; i++) {
- QChar ch = uc[i];
- if ( ch == QChar::null ) {
- // special
- *cursor++ = 0;
- } else if ( from_unicode_page[ch.row()] &&
- from_unicode_page[ch.row()][ch.cell()] )
- {
- *cursor++ = from_unicode_page[ch.row()][ch.cell()];
- lout++;
- } else if ( from_unicode_page_multibyte &&
- from_unicode_page_multibyte[ch.row()] &&
- (s=from_unicode_page_multibyte[ch.row()][ch.cell()]) )
- {
- while (*s) {
- *cursor++ = *s++;
- lout++;
- }
- } else {
- *cursor++ = unkn;
- lout++;
- }
- }
- *cursor = 0;
- lenInOut = lout;
- return rstr;
- }
-};
-
-QTextCodecFromIODDecoder::QTextCodecFromIODDecoder(const QTextCodecFromIOD* c) :
- codec(c)
-{
- mb = codec->to_unicode_multibyte;
-}
-
-QString QTextCodecFromIODDecoder::toUnicode(const char* chars, int len)
-{
- const uchar* uchars = (const uchar*)chars;
- QString result;
- while (len--) {
- QMultiByteUnicodeTable& t = mb[*uchars];
- if ( t.multibyte ) {
- // Chained multi-byte
- mb = t.multibyte;
- } else {
- if ( t.unicode )
- result += QChar(t.unicode);
- mb=codec->to_unicode_multibyte;
- }
- uchars++;
- }
- return result;
-}
-
-/*!
- Reads a POSIX2 charmap definition from \a iod.
- The parser recognizes the following lines:
-<pre>
- &lt;code_set_name&gt; <i>name</i>
- &lt;escape_char&gt; <i>character</i>
- % alias <i>alias</i>
- CHARMAP
- &lt;<i>token</i>&gt; /x<i>hexbyte</i> &lt;U<i>unicode</i>&gt; ...
- &lt;<i>token</i>&gt; /d<i>decbyte</i> &lt;U<i>unicode</i>&gt; ...
- &lt;<i>token</i>&gt; /<i>octbyte</i> &lt;U<i>unicode</i>&gt; ...
- &lt;<i>token</i>&gt; /<i>any</i>/<i>any</i>... &lt;U<i>unicode</i>&gt; ...
- END CHARMAP
-</pre>
-
- The resulting QTextCodec is returned (and also added to the
- global list of codecs). The name() of the result is taken
- from the code_set_name.
-
- Note that a codec constructed in this way uses much more memory
- and is slower than a hand-written QTextCodec subclass, since
- tables in code are in memory shared by all applications simultaneously
- using Qt.
-
- \sa loadCharmapFile()
-*/
-QTextCodec* QTextCodec::loadCharmap(QIODevice* iod)
-{
- QTextCodecFromIOD* r = new QTextCodecFromIOD(iod);
- if ( !r->ok() ) {
- delete r;
- r = 0;
- }
- return r;
-}
-
-/*!
- A convenience function for loadCharmap().
-*/
-QTextCodec* QTextCodec::loadCharmapFile(QString filename)
-{
- QFile f(filename);
- if (f.open(IO_ReadOnly)) {
- QTextCodecFromIOD* r = new QTextCodecFromIOD(&f);
- if ( !r->ok() )
- delete r;
- else
- return r;
- }
- return 0;
-}
-#endif //QT_NO_CODECS
-
-
-/*!
- Returns a string representing the current language.
-*/
-
-const char* QTextCodec::locale()
-{
- static QCString lang;
- if ( lang.isEmpty() ) {
- lang = getenv( "LANG" ); //########Windows??
- if ( lang.isEmpty() )
- lang = "C";
- }
- return lang;
-}
-
-
-
-#ifndef QT_NO_CODECS
-
-class QSimpleTextCodec: public QTextCodec
-{
-public:
- QSimpleTextCodec( int );
- ~QSimpleTextCodec();
-
- QString toUnicode(const char* chars, int len) const;
- QCString fromUnicode(const QString& uc, int& lenInOut ) const;
-
- const char* name() const;
- int mibEnum() const;
-
- int heuristicContentMatch(const char* chars, int len) const;
-
- int heuristicNameMatch(const char* hint) const;
-
-private:
- int forwardIndex;
-};
-
-
-#define LAST_MIB 2259
-
-static struct {
- const char * cs;
- int mib;
- Q_UINT16 values[128];
-} unicodevalues[] = {
- // from RFC 1489, ftp://ftp.isi.edu/in-notes/rfc1489.txt
- { "KOI8-R", 2084,
- { 0x2500, 0x2502, 0x250C, 0x2510, 0x2514, 0x2518, 0x251C, 0x2524,
- 0x252C, 0x2534, 0x253C, 0x2580, 0x2584, 0x2588, 0x258C, 0x2590,
- 0x2591, 0x2592, 0x2593, 0x2320, 0x25A0, 0x2219/**/, 0x221A, 0x2248,
- 0x2264, 0x2265, 0x00A0, 0x2321, 0x00B0, 0x00B2, 0x00B7, 0x00F7,
- 0x2550, 0x2551, 0x2552, 0x0451, 0x2553, 0x2554, 0x2555, 0x2556,
- 0x2557, 0x2558, 0x2559, 0x255A, 0x255B, 0x255C, 0x255D, 0x255E,
- 0x255F, 0x2560, 0x2561, 0x0401, 0x2562, 0x2563, 0x2564, 0x2565,
- 0x2566, 0x2567, 0x2568, 0x2569, 0x256A, 0x256B, 0x256C, 0x00A9,
- 0x044E, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433,
- 0x0445, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E,
- 0x043F, 0x044F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432,
- 0x044C, 0x044B, 0x0437, 0x0448, 0x044D, 0x0449, 0x0447, 0x044A,
- 0x042E, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413,
- 0x0425, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E,
- 0x041F, 0x042F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412,
- 0x042C, 0x042B, 0x0417, 0x0428, 0x042D, 0x0429, 0x0427, 0x042A } },
- // /**/ - The BULLET OPERATOR is confused. Some people think
- // it should be 0x2022 (BULLET).
-
- // from RFC 2319, ftp://ftp.isi.edu/in-notes/rfc2319.txt
- { "KOI8-U", 2088,
- { 0x2500, 0x2502, 0x250C, 0x2510, 0x2514, 0x2518, 0x251C, 0x2524,
- 0x252C, 0x2534, 0x253C, 0x2580, 0x2584, 0x2588, 0x258C, 0x2590,
- 0x2591, 0x2592, 0x2593, 0x2320, 0x25A0, 0x2219, 0x221A, 0x2248,
- 0x2264, 0x2265, 0x00A0, 0x2321, 0x00B0, 0x00B2, 0x00B7, 0x00F7,
- 0x2550, 0x2551, 0x2552, 0x0451, 0x0454, 0x2554, 0x0456, 0x0457,
- 0x2557, 0x2558, 0x2559, 0x255A, 0x255B, 0x0491, 0x255D, 0x255E,
- 0x255F, 0x2560, 0x2561, 0x0401, 0x0404, 0x2563, 0x0406, 0x0407,
- 0x2566, 0x2567, 0x2568, 0x2569, 0x256A, 0x0490, 0x256C, 0x00A9,
- 0x044E, 0x0430, 0x0431, 0x0446, 0x0434, 0x0435, 0x0444, 0x0433,
- 0x0445, 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E,
- 0x043F, 0x044F, 0x0440, 0x0441, 0x0442, 0x0443, 0x0436, 0x0432,
- 0x044C, 0x044B, 0x0437, 0x0448, 0x044D, 0x0449, 0x0447, 0x044A,
- 0x042E, 0x0410, 0x0411, 0x0426, 0x0414, 0x0415, 0x0424, 0x0413,
- 0x0425, 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E,
- 0x041F, 0x042F, 0x0420, 0x0421, 0x0422, 0x0423, 0x0416, 0x0412,
- 0x042C, 0x042B, 0x0417, 0x0428, 0x042D, 0x0429, 0x0427, 0x042A } },
-
- // next bits generated from tables on the Unicode 2.0 CD. we can
- // use these tables since this is part of the transition to using
- // unicode everywhere in qt.
-
- // $ for A in 8 9 A B C D E F ; do for B in 0 1 2 3 4 5 6 7 8 9 A B C D E F ; do echo 0x${A}${B} 0xFFFD ; done ; done > /tmp/digits ; for a in 8859-* ; do ( awk '/^0x[89ABCDEF]/{ print $1, $2 }' < $a ; cat /tmp/digits ) | sort | uniq -w4 | cut -c6- | paste '-d ' - - - - - - - - | sed -e 's/ /, /g' -e 's/$/,/' -e '$ s/,$/} },/' -e '1 s/^/{ /' > ~/tmp/$a ; done
-
- // then I inserted the files manually.
- { "ISO 8859-2", 5,
- { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
- 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
- 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x0104, 0x02D8, 0x0141, 0x00A4, 0x013D, 0x015A, 0x00A7,
- 0x00A8, 0x0160, 0x015E, 0x0164, 0x0179, 0x00AD, 0x017D, 0x017B,
- 0x00B0, 0x0105, 0x02DB, 0x0142, 0x00B4, 0x013E, 0x015B, 0x02C7,
- 0x00B8, 0x0161, 0x015F, 0x0165, 0x017A, 0x02DD, 0x017E, 0x017C,
- 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7,
- 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E,
- 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7,
- 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF,
- 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7,
- 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F,
- 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7,
- 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9} },
- { "ISO 8859-3", 6,
- { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
- 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
- 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x0126, 0x02D8, 0x00A3, 0x00A4, 0xFFFD, 0x0124, 0x00A7,
- 0x00A8, 0x0130, 0x015E, 0x011E, 0x0134, 0x00AD, 0xFFFD, 0x017B,
- 0x00B0, 0x0127, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x0125, 0x00B7,
- 0x00B8, 0x0131, 0x015F, 0x011F, 0x0135, 0x00BD, 0xFFFD, 0x017C,
- 0x00C0, 0x00C1, 0x00C2, 0xFFFD, 0x00C4, 0x010A, 0x0108, 0x00C7,
- 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0xFFFD, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x0120, 0x00D6, 0x00D7,
- 0x011C, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x016C, 0x015C, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0xFFFD, 0x00E4, 0x010B, 0x0109, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
- 0xFFFD, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x0121, 0x00F6, 0x00F7,
- 0x011D, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x016D, 0x015D, 0x02D9} },
- { "ISO 8859-4", 7,
- { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
- 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
- 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x0104, 0x0138, 0x0156, 0x00A4, 0x0128, 0x013B, 0x00A7,
- 0x00A8, 0x0160, 0x0112, 0x0122, 0x0166, 0x00AD, 0x017D, 0x00AF,
- 0x00B0, 0x0105, 0x02DB, 0x0157, 0x00B4, 0x0129, 0x013C, 0x02C7,
- 0x00B8, 0x0161, 0x0113, 0x0123, 0x0167, 0x014A, 0x017E, 0x014B,
- 0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E,
- 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x012A,
- 0x0110, 0x0145, 0x014C, 0x0136, 0x00D4, 0x00D5, 0x00D6, 0x00D7,
- 0x00D8, 0x0172, 0x00DA, 0x00DB, 0x00DC, 0x0168, 0x016A, 0x00DF,
- 0x0101, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x012F,
- 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x012B,
- 0x0111, 0x0146, 0x014D, 0x0137, 0x00F4, 0x00F5, 0x00F6, 0x00F7,
- 0x00F8, 0x0173, 0x00FA, 0x00FB, 0x00FC, 0x0169, 0x016B, 0x02D9} },
- { "ISO 8859-5", 8,
- { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
- 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
- 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x0401, 0x0402, 0x0403, 0x0404, 0x0405, 0x0406, 0x0407,
- 0x0408, 0x0409, 0x040A, 0x040B, 0x040C, 0x00AD, 0x040E, 0x040F,
- 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
- 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
- 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
- 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
- 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
- 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
- 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
- 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F,
- 0x2116, 0x0451, 0x0452, 0x0453, 0x0454, 0x0455, 0x0456, 0x0457,
- 0x0458, 0x0459, 0x045A, 0x045B, 0x045C, 0x00A7, 0x045E, 0x045F} },
- { "ISO 8859-6-I", 82,
- { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
- 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
- 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0xFFFD, 0xFFFD, 0xFFFD, 0x00A4, 0xFFFD, 0xFFFD, 0xFFFD,
- 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x060C, 0x00AD, 0xFFFD, 0xFFFD,
- 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
- 0xFFFD, 0xFFFD, 0xFFFD, 0x061B, 0xFFFD, 0xFFFD, 0xFFFD, 0x061F,
- 0xFFFD, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627,
- 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F,
- 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x0637,
- 0x0638, 0x0639, 0x063A, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
- 0x0640, 0x0641, 0x0642, 0x0643, 0x0644, 0x0645, 0x0646, 0x0647,
- 0x0648, 0x0649, 0x064A, 0x064B, 0x064C, 0x064D, 0x064E, 0x064F,
- 0x0650, 0x0651, 0x0652, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
- 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD} },
- { "ISO 8859-7", 10,
- { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
- 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
- 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x2018, 0x2019, 0x00A3, 0xFFFD, 0xFFFD, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0xFFFD, 0x00AB, 0x00AC, 0x00AD, 0xFFFD, 0x2015,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x0385, 0x0386, 0x00B7,
- 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F,
- 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
- 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
- 0x03A0, 0x03A1, 0xFFFD, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7,
- 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF,
- 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7,
- 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF,
- 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7,
- 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0xFFFD} },
- { "ISO 8859-8-I", 85,
- { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
- 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
- 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0xFFFD, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x203E,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0xFFFD,
- 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
- 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
- 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
- 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x2017,
- 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7,
- 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
- 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7,
- 0x05E8, 0x05E9, 0x05EA, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD} },
- { "ISO 8859-9", 12,
- { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
- 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
- 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
- 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7,
- 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
- 0x011F, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7,
- 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF} },
- { "ISO 8859-10", 13,
- { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
- 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
- 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x0104, 0x0112, 0x0122, 0x012A, 0x0128, 0x0136, 0x00A7,
- 0x013B, 0x0110, 0x0160, 0x0166, 0x017D, 0x00AD, 0x016A, 0x014A,
- 0x00B0, 0x0105, 0x0113, 0x0123, 0x012B, 0x0129, 0x0137, 0x00B7,
- 0x013C, 0x0111, 0x0161, 0x0167, 0x017E, 0x2015, 0x016B, 0x014B,
- 0x0100, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x012E,
- 0x010C, 0x00C9, 0x0118, 0x00CB, 0x0116, 0x00CD, 0x00CE, 0x00CF,
- 0x00D0, 0x0145, 0x014C, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x0168,
- 0x00D8, 0x0172, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF,
- 0x0101, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x012F,
- 0x010D, 0x00E9, 0x0119, 0x00EB, 0x0117, 0x00ED, 0x00EE, 0x00EF,
- 0x00F0, 0x0146, 0x014D, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x0169,
- 0x00F8, 0x0173, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x0138} },
- { "ISO 8859-13", 109,
- { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
- 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
- 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x201D, 0x00A2, 0x00A3, 0x00A4, 0x201E, 0x00A6, 0x00A7,
- 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x201C, 0x00B5, 0x00B6, 0x00B7,
- 0x00F8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6,
- 0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112,
- 0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B,
- 0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7,
- 0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF,
- 0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113,
- 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C,
- 0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7,
- 0x0173, 0x0142, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x2019} },
- { "ISO 8859-14", 110,
- { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
- 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
- 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x1E02, 0x1E03, 0x00A3, 0x010A, 0x010B, 0x1E0A, 0x00A7,
- 0x1E80, 0x00A9, 0x1E82, 0x1E0B, 0x1EF2, 0x00AD, 0x00AE, 0x0178,
- 0x1E1E, 0x1E1F, 0x0120, 0x0121, 0x1E40, 0x1E41, 0x00B6, 0x1E56,
- 0x1E81, 0x1E57, 0x1E83, 0x1E60, 0x1EF3, 0x1E84, 0x1E85, 0x1E61,
- 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
- 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0x0174, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x1E6A,
- 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x0176, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
- 0x0175, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x1E6B,
- 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x0177, 0x00FF} },
- { "ISO 8859-15", 111,
- { 0x0080, 0x0081, 0x0082, 0x0083, 0x0084, 0x0085, 0x0086, 0x0087,
- 0x0088, 0x0089, 0x008A, 0x008B, 0x008C, 0x008D, 0x008E, 0x008F,
- 0x0090, 0x0091, 0x0092, 0x0093, 0x0094, 0x0095, 0x0096, 0x0097,
- 0x0098, 0x0099, 0x009A, 0x009B, 0x009C, 0x009D, 0x009E, 0x009F,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x20AC, 0x00A5, 0x0160, 0x00A7,
- 0x0161, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x017D, 0x00B5, 0x00B6, 0x00B7,
- 0x017E, 0x00B9, 0x00BA, 0x00BB, 0x0152, 0x0153, 0x0178, 0x00BF,
- 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
- 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7,
- 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
- 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7,
- 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF} },
-
- // next bits generated again from tables on the Unicode 3.0 CD.
-
- // $ for a in CP* ; do ( awk '/^0x[89ABCDEF]/{ print $1, $2 }' < $a ) | sort | sed -e 's/#UNDEF.*$/0xFFFD/' | cut -c6- | paste '-d ' - - - - - - - - | sed -e 's/ /, /g' -e 's/$/,/' -e '$ s/,$/} },/' -e '1 s/^/{ /' > ~/tmp/$a ; done
-
- { "CP 874", 0, //### what is the mib?
- { 0x20AC, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x2026, 0xFFFD, 0xFFFD,
- 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
- 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
- 0x00A0, 0x0E01, 0x0E02, 0x0E03, 0x0E04, 0x0E05, 0x0E06, 0x0E07,
- 0x0E08, 0x0E09, 0x0E0A, 0x0E0B, 0x0E0C, 0x0E0D, 0x0E0E, 0x0E0F,
- 0x0E10, 0x0E11, 0x0E12, 0x0E13, 0x0E14, 0x0E15, 0x0E16, 0x0E17,
- 0x0E18, 0x0E19, 0x0E1A, 0x0E1B, 0x0E1C, 0x0E1D, 0x0E1E, 0x0E1F,
- 0x0E20, 0x0E21, 0x0E22, 0x0E23, 0x0E24, 0x0E25, 0x0E26, 0x0E27,
- 0x0E28, 0x0E29, 0x0E2A, 0x0E2B, 0x0E2C, 0x0E2D, 0x0E2E, 0x0E2F,
- 0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37,
- 0x0E38, 0x0E39, 0x0E3A, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0E3F,
- 0x0E40, 0x0E41, 0x0E42, 0x0E43, 0x0E44, 0x0E45, 0x0E46, 0x0E47,
- 0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F,
- 0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57,
- 0x0E58, 0x0E59, 0x0E5A, 0x0E5B, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD} },
- { "CP 1250", 2250,
- { 0x20AC, 0xFFFD, 0x201A, 0xFFFD, 0x201E, 0x2026, 0x2020, 0x2021,
- 0xFFFD, 0x2030, 0x0160, 0x2039, 0x015A, 0x0164, 0x017D, 0x0179,
- 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0xFFFD, 0x2122, 0x0161, 0x203A, 0x015B, 0x0165, 0x017E, 0x017A,
- 0x00A0, 0x02C7, 0x02D8, 0x0141, 0x00A4, 0x0104, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x015E, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x017B,
- 0x00B0, 0x00B1, 0x02DB, 0x0142, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x0105, 0x015F, 0x00BB, 0x013D, 0x02DD, 0x013E, 0x017C,
- 0x0154, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x0139, 0x0106, 0x00C7,
- 0x010C, 0x00C9, 0x0118, 0x00CB, 0x011A, 0x00CD, 0x00CE, 0x010E,
- 0x0110, 0x0143, 0x0147, 0x00D3, 0x00D4, 0x0150, 0x00D6, 0x00D7,
- 0x0158, 0x016E, 0x00DA, 0x0170, 0x00DC, 0x00DD, 0x0162, 0x00DF,
- 0x0155, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x013A, 0x0107, 0x00E7,
- 0x010D, 0x00E9, 0x0119, 0x00EB, 0x011B, 0x00ED, 0x00EE, 0x010F,
- 0x0111, 0x0144, 0x0148, 0x00F3, 0x00F4, 0x0151, 0x00F6, 0x00F7,
- 0x0159, 0x016F, 0x00FA, 0x0171, 0x00FC, 0x00FD, 0x0163, 0x02D9} },
- { "CP 1251", 2251,
- { 0x0402, 0x0403, 0x201A, 0x0453, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x20AC, 0x2030, 0x0409, 0x2039, 0x040A, 0x040C, 0x040B, 0x040F,
- 0x0452, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0xFFFD, 0x2122, 0x0459, 0x203A, 0x045A, 0x045C, 0x045B, 0x045F,
- 0x00A0, 0x040E, 0x045E, 0x0408, 0x00A4, 0x0490, 0x00A6, 0x00A7,
- 0x0401, 0x00A9, 0x0404, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x0407,
- 0x00B0, 0x00B1, 0x0406, 0x0456, 0x0491, 0x00B5, 0x00B6, 0x00B7,
- 0x0451, 0x2116, 0x0454, 0x00BB, 0x0458, 0x0405, 0x0455, 0x0457,
- 0x0410, 0x0411, 0x0412, 0x0413, 0x0414, 0x0415, 0x0416, 0x0417,
- 0x0418, 0x0419, 0x041A, 0x041B, 0x041C, 0x041D, 0x041E, 0x041F,
- 0x0420, 0x0421, 0x0422, 0x0423, 0x0424, 0x0425, 0x0426, 0x0427,
- 0x0428, 0x0429, 0x042A, 0x042B, 0x042C, 0x042D, 0x042E, 0x042F,
- 0x0430, 0x0431, 0x0432, 0x0433, 0x0434, 0x0435, 0x0436, 0x0437,
- 0x0438, 0x0439, 0x043A, 0x043B, 0x043C, 0x043D, 0x043E, 0x043F,
- 0x0440, 0x0441, 0x0442, 0x0443, 0x0444, 0x0445, 0x0446, 0x0447,
- 0x0448, 0x0449, 0x044A, 0x044B, 0x044C, 0x044D, 0x044E, 0x044F} },
- { "CP 1252", 2252,
- { 0x20AC, 0xFFFD, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0xFFFD, 0x017D, 0xFFFD,
- 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0xFFFD, 0x017E, 0x0178,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
- 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0x00D0, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7,
- 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x00DD, 0x00DE, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
- 0x00F0, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7,
- 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x00FD, 0x00FE, 0x00FF} },
- { "CP 1253", 2253,
- { 0x20AC, 0xFFFD, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0xFFFD, 0x2030, 0xFFFD, 0x2039, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
- 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0xFFFD, 0x2122, 0xFFFD, 0x203A, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
- 0x00A0, 0x0385, 0x0386, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0xFFFD, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x2015,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x0384, 0x00B5, 0x00B6, 0x00B7,
- 0x0388, 0x0389, 0x038A, 0x00BB, 0x038C, 0x00BD, 0x038E, 0x038F,
- 0x0390, 0x0391, 0x0392, 0x0393, 0x0394, 0x0395, 0x0396, 0x0397,
- 0x0398, 0x0399, 0x039A, 0x039B, 0x039C, 0x039D, 0x039E, 0x039F,
- 0x03A0, 0x03A1, 0xFFFD, 0x03A3, 0x03A4, 0x03A5, 0x03A6, 0x03A7,
- 0x03A8, 0x03A9, 0x03AA, 0x03AB, 0x03AC, 0x03AD, 0x03AE, 0x03AF,
- 0x03B0, 0x03B1, 0x03B2, 0x03B3, 0x03B4, 0x03B5, 0x03B6, 0x03B7,
- 0x03B8, 0x03B9, 0x03BA, 0x03BB, 0x03BC, 0x03BD, 0x03BE, 0x03BF,
- 0x03C0, 0x03C1, 0x03C2, 0x03C3, 0x03C4, 0x03C5, 0x03C6, 0x03C7,
- 0x03C8, 0x03C9, 0x03CA, 0x03CB, 0x03CC, 0x03CD, 0x03CE, 0xFFFD} },
- { "CP 1254", 2254,
- { 0x20AC, 0xFFFD, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x02C6, 0x2030, 0x0160, 0x2039, 0x0152, 0xFFFD, 0xFFFD, 0xFFFD,
- 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x02DC, 0x2122, 0x0161, 0x203A, 0x0153, 0xFFFD, 0xFFFD, 0x0178,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x00C0, 0x00C1, 0x00C2, 0x00C3, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
- 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x00CC, 0x00CD, 0x00CE, 0x00CF,
- 0x011E, 0x00D1, 0x00D2, 0x00D3, 0x00D4, 0x00D5, 0x00D6, 0x00D7,
- 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x0130, 0x015E, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x00E3, 0x00E4, 0x00E5, 0x00E6, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x00EC, 0x00ED, 0x00EE, 0x00EF,
- 0x011F, 0x00F1, 0x00F2, 0x00F3, 0x00F4, 0x00F5, 0x00F6, 0x00F7,
- 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x0131, 0x015F, 0x00FF} },
- { "CP 1255", 2255,
- { 0x20AC, 0xFFFD, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x02C6, 0x2030, 0xFFFD, 0x2039, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
- 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x02DC, 0x2122, 0xFFFD, 0x203A, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x20AA, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x00D7, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x00F7, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x05B0, 0x05B1, 0x05B2, 0x05B3, 0x05B4, 0x05B5, 0x05B6, 0x05B7,
- 0x05B8, 0x05B9, 0xFFFD, 0x05BB, 0x05BC, 0x05BD, 0x05BE, 0x05BF,
- 0x05C0, 0x05C1, 0x05C2, 0x05C3, 0x05F0, 0x05F1, 0x05F2, 0x05F3,
- 0x05F4, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
- 0x05D0, 0x05D1, 0x05D2, 0x05D3, 0x05D4, 0x05D5, 0x05D6, 0x05D7,
- 0x05D8, 0x05D9, 0x05DA, 0x05DB, 0x05DC, 0x05DD, 0x05DE, 0x05DF,
- 0x05E0, 0x05E1, 0x05E2, 0x05E3, 0x05E4, 0x05E5, 0x05E6, 0x05E7,
- 0x05E8, 0x05E9, 0x05EA, 0xFFFD, 0xFFFD, 0x200E, 0x200F, 0xFFFD} },
- { "CP 1256", 2256,
- { 0x20AC, 0x067E, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x02C6, 0x2030, 0x0679, 0x2039, 0x0152, 0x0686, 0x0698, 0x0688,
- 0x06AF, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x06A9, 0x2122, 0x0691, 0x203A, 0x0153, 0x200C, 0x200D, 0x06BA,
- 0x00A0, 0x060C, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x06BE, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x061B, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x061F,
- 0x06C1, 0x0621, 0x0622, 0x0623, 0x0624, 0x0625, 0x0626, 0x0627,
- 0x0628, 0x0629, 0x062A, 0x062B, 0x062C, 0x062D, 0x062E, 0x062F,
- 0x0630, 0x0631, 0x0632, 0x0633, 0x0634, 0x0635, 0x0636, 0x00D7,
- 0x0637, 0x0638, 0x0639, 0x063A, 0x0640, 0x0641, 0x0642, 0x0643,
- 0x00E0, 0x0644, 0x00E2, 0x0645, 0x0646, 0x0647, 0x0648, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0649, 0x064A, 0x00EE, 0x00EF,
- 0x064B, 0x064C, 0x064D, 0x064E, 0x00F4, 0x064F, 0x0650, 0x00F7,
- 0x0651, 0x00F9, 0x0652, 0x00FB, 0x00FC, 0x200E, 0x200F, 0x06D2} },
- { "CP 1257", 2257,
- { 0x20AC, 0xFFFD, 0x201A, 0xFFFD, 0x201E, 0x2026, 0x2020, 0x2021,
- 0xFFFD, 0x2030, 0xFFFD, 0x2039, 0xFFFD, 0x00A8, 0x02C7, 0x00B8,
- 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0xFFFD, 0x2122, 0xFFFD, 0x203A, 0xFFFD, 0x00AF, 0x02DB, 0xFFFD,
- 0x00A0, 0xFFFD, 0x00A2, 0x00A3, 0x00A4, 0xFFFD, 0x00A6, 0x00A7,
- 0x00D8, 0x00A9, 0x0156, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00C6,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00F8, 0x00B9, 0x0157, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00E6,
- 0x0104, 0x012E, 0x0100, 0x0106, 0x00C4, 0x00C5, 0x0118, 0x0112,
- 0x010C, 0x00C9, 0x0179, 0x0116, 0x0122, 0x0136, 0x012A, 0x013B,
- 0x0160, 0x0143, 0x0145, 0x00D3, 0x014C, 0x00D5, 0x00D6, 0x00D7,
- 0x0172, 0x0141, 0x015A, 0x016A, 0x00DC, 0x017B, 0x017D, 0x00DF,
- 0x0105, 0x012F, 0x0101, 0x0107, 0x00E4, 0x00E5, 0x0119, 0x0113,
- 0x010D, 0x00E9, 0x017A, 0x0117, 0x0123, 0x0137, 0x012B, 0x013C,
- 0x0161, 0x0144, 0x0146, 0x00F3, 0x014D, 0x00F5, 0x00F6, 0x00F7,
- 0x0173, 0x0142, 0x015B, 0x016B, 0x00FC, 0x017C, 0x017E, 0x02D9} },
- { "CP 1258", 2258,
- { 0x20AC, 0xFFFD, 0x201A, 0x0192, 0x201E, 0x2026, 0x2020, 0x2021,
- 0x02C6, 0x2030, 0xFFFD, 0x2039, 0x0152, 0xFFFD, 0xFFFD, 0xFFFD,
- 0xFFFD, 0x2018, 0x2019, 0x201C, 0x201D, 0x2022, 0x2013, 0x2014,
- 0x02DC, 0x2122, 0xFFFD, 0x203A, 0x0153, 0xFFFD, 0xFFFD, 0x0178,
- 0x00A0, 0x00A1, 0x00A2, 0x00A3, 0x00A4, 0x00A5, 0x00A6, 0x00A7,
- 0x00A8, 0x00A9, 0x00AA, 0x00AB, 0x00AC, 0x00AD, 0x00AE, 0x00AF,
- 0x00B0, 0x00B1, 0x00B2, 0x00B3, 0x00B4, 0x00B5, 0x00B6, 0x00B7,
- 0x00B8, 0x00B9, 0x00BA, 0x00BB, 0x00BC, 0x00BD, 0x00BE, 0x00BF,
- 0x00C0, 0x00C1, 0x00C2, 0x0102, 0x00C4, 0x00C5, 0x00C6, 0x00C7,
- 0x00C8, 0x00C9, 0x00CA, 0x00CB, 0x0300, 0x00CD, 0x00CE, 0x00CF,
- 0x0110, 0x00D1, 0x0309, 0x00D3, 0x00D4, 0x01A0, 0x00D6, 0x00D7,
- 0x00D8, 0x00D9, 0x00DA, 0x00DB, 0x00DC, 0x01AF, 0x0303, 0x00DF,
- 0x00E0, 0x00E1, 0x00E2, 0x0103, 0x00E4, 0x00E5, 0x00E6, 0x00E7,
- 0x00E8, 0x00E9, 0x00EA, 0x00EB, 0x0301, 0x00ED, 0x00EE, 0x00EF,
- 0x0111, 0x00F1, 0x0323, 0x00F3, 0x00F4, 0x01A1, 0x00F6, 0x00F7,
- 0x00F8, 0x00F9, 0x00FA, 0x00FB, 0x00FC, 0x01B0, 0x20AB, 0x00FF} },
-
- // this one is generated from the charmap file located in /usr/share/i18n/charmaps
- // on most Linux distributions. The thai character set tis620 is byte by byte equivalent
- // to iso8859-11, so we name it 8859-11 here, but recognise the name tis620 too.
-
- // $ for A in 8 9 A B C D E F ; do for B in 0 1 2 3 4 5 6 7 8 9 A B C D E F ; do echo x${A}${B} 0xFFFD ; done ; done > /tmp/digits ; ( cut -c25- < TIS-620 ; cat /tmp/digits ) | awk '/^x[89ABCDEF]/{ print $1, $2 }' | sed -e 's/<U/0x/' -e 's/>//' | sort | uniq -w4 | cut -c5- | paste '-d ' - - - - - - - - | sed -e 's/ /, /g' -e 's/$/,/' -e '$ s/,$/} },/' -e '1 s/^/{ /' > ~/tmp/tis-620
- { "ISO 8859-11", 2259, // Thai character set mib enum taken from tis620 (which is byte by byte equivalent)
- { 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
- 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
- 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
- 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD,
- 0xFFFD, 0x0E01, 0x0E02, 0x0E03, 0x0E04, 0x0E05, 0x0E06, 0x0E07,
- 0x0E08, 0x0E09, 0x0E0A, 0x0E0B, 0x0E0C, 0x0E0D, 0x0E0E, 0x0E0F,
- 0x0E10, 0x0E11, 0x0E12, 0x0E13, 0x0E14, 0x0E15, 0x0E16, 0x0E17,
- 0x0E18, 0x0E19, 0x0E1A, 0x0E1B, 0x0E1C, 0x0E1D, 0x0E1E, 0x0E1F,
- 0x0E20, 0x0E21, 0x0E22, 0x0E23, 0x0E24, 0x0E25, 0x0E26, 0x0E27,
- 0x0E28, 0x0E29, 0x0E2A, 0x0E2B, 0x0E2C, 0x0E2D, 0x0E2E, 0x0E2F,
- 0x0E30, 0x0E31, 0x0E32, 0x0E33, 0x0E34, 0x0E35, 0x0E36, 0x0E37,
- 0x0E38, 0x0E39, 0x0E3A, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD, 0x0E3F,
- 0x0E40, 0x0E41, 0x0E42, 0x0E43, 0x0E44, 0x0E45, 0x0E46, 0x0E47,
- 0x0E48, 0x0E49, 0x0E4A, 0x0E4B, 0x0E4C, 0x0E4D, 0x0E4E, 0x0E4F,
- 0x0E50, 0x0E51, 0x0E52, 0x0E53, 0x0E54, 0x0E55, 0x0E56, 0x0E57,
- 0x0E58, 0x0E59, 0x0E5A, 0x0E5B, 0xFFFD, 0xFFFD, 0xFFFD, 0xFFFD} },
-
- // change LAST_MIB if you add more, and edit unicodevalues in
- // kernel/qpsprinter.cpp too.
-};
-
-
-static const QSimpleTextCodec * reverseOwner = 0;
-static QArray<char> * reverseMap = 0;
-
-
-QSimpleTextCodec::QSimpleTextCodec( int i )
- : QTextCodec(), forwardIndex( i )
-{
-}
-
-
-QSimpleTextCodec::~QSimpleTextCodec()
-{
- if ( reverseOwner == this ) {
- delete reverseMap;
- reverseMap = 0;
- reverseOwner = 0;
- }
-}
-
-// what happens if strlen(chars)<len? what happens if !chars? if len<1?
-QString QSimpleTextCodec::toUnicode(const char* chars, int len) const
-{
- if(len <= 0)
- return QString::null;
-
- int clen = qstrlen(chars);
- len = QMIN(len, clen); // Note: NUL ends string
-
- QString r;
- r.setUnicode(0, len);
- QChar* uc = (QChar*)r.unicode(); // const_cast
- const unsigned char * c = (const unsigned char *)chars;
- for( int i=0; i<len; i++ ) {
- if ( c[i] > 127 )
- uc[i] = unicodevalues[forwardIndex].values[c[i]-128];
- else
- uc[i] = c[i];
- }
- return r;
-}
-
-
-QCString QSimpleTextCodec::fromUnicode(const QString& uc, int& len ) const
-{
- if ( reverseOwner != this ) {
- int m = 0;
- int i = 0;
- while( i < 128 ) {
- if ( unicodevalues[forwardIndex].values[i] > m &&
- unicodevalues[forwardIndex].values[i] < 0xfffd )
- m = unicodevalues[forwardIndex].values[i];
- i++;
- }
- m++;
- if ( !reverseMap )
- reverseMap = new QArray<char>( m );
- if ( m > (int)(reverseMap->size()) )
- reverseMap->resize( m );
- for( i = 0; i < 128 && i < m; i++ )
- (*reverseMap)[i] = (char)i;
- for( ;i < m; i++ )
- (*reverseMap)[i] = '?';
- for( i=128; i<256; i++ ) {
- int u = unicodevalues[forwardIndex].values[i-128];
- if ( u < m )
- (*reverseMap)[u] = (char)(unsigned char)(i);
- }
- reverseOwner = this;
- }
- if ( len <0 || len > (int)uc.length() )
- len = uc.length();
- QCString r( len+1 );
- int i = len;
- int u;
- const QChar* ucp = uc.unicode();
- char* rp = r.rawData();
- char* rmp = reverseMap->data();
- int rmsize = (int) reverseMap->size();
- while( i-- )
- {
- u = ucp->unicode();
- *rp++ = u < 128 ? u : (( u < rmsize ) ? (*(rmp+u)) : '?' );
- ucp++;
- }
- r[len] = 0;
- return r;
-}
-
-
-const char* QSimpleTextCodec::name() const
-{
- return unicodevalues[forwardIndex].cs;
-}
-
-
-int QSimpleTextCodec::mibEnum() const
-{
- return unicodevalues[forwardIndex].mib;
-}
-
-int QSimpleTextCodec::heuristicNameMatch(const char* hint) const
-{
- if ( hint[0]=='k' ) {
- // Help people with messy fonts
- if ( QCString(hint) == "koi8-1" )
- return QTextCodec::heuristicNameMatch("koi8-r")-1;
- if ( QCString(hint) == "koi8-ru" )
- return QTextCodec::heuristicNameMatch("koi8-r")-1;
- } else if ( hint[0] == 't' && QCString(name()) == "ISO 8859-11" ) {
- // 8859-11 and tis620 are byte by bute equivalent
- int i = simpleHeuristicNameMatch("tis620-0", hint);
- if( !i )
- i = simpleHeuristicNameMatch("tis-620", hint);
- if( i ) return i;
- }
- return QTextCodec::heuristicNameMatch(hint);
-}
-
-int QSimpleTextCodec::heuristicContentMatch(const char* chars, int len) const
-{
- if ( len<1 || !chars )
- return -1;
- int i = 0;
- const uchar * c = (const unsigned char *)chars;
- int r = 0;
- while( i<len && c && *c ) {
- if ( *c >= 128 ) {
- if ( unicodevalues[forwardIndex].values[(*c)-128] == 0xfffd )
- return -1;
- }
- if ( (*c >= ' ' && *c < 127) ||
- *c == '\n' || *c == '\t' || *c == '\r' )
- r++;
- i++;
- c++;
- }
- if ( mibEnum()==4 )
- r+=1;
- return r;
-}
-
-
-#endif // QT_NO_CODECS
-
-class QLatin1Codec: public QTextCodec
-{
-public:
- QLatin1Codec();
- ~QLatin1Codec();
-
- QString toUnicode(const char* chars, int len) const;
- QCString fromUnicode(const QString& uc, int& lenInOut ) const;
-
- const char* name() const;
- int mibEnum() const;
-
- int heuristicContentMatch(const char* chars, int len) const;
-
- int heuristicNameMatch(const char* hint) const;
-
-private:
- //int forwardIndex;
-};
-
-
-QLatin1Codec::QLatin1Codec()
- : QTextCodec()
-{
-}
-
-
-QLatin1Codec::~QLatin1Codec()
-{
-}
-
-// what happens if strlen(chars)<len? what happens if !chars? if len<1?
-QString QLatin1Codec::toUnicode(const char* chars, int len) const
-{
- if(len <= 0)
- return QString::null;
-
- return QString::fromLatin1(chars, len);
-}
-
-
-QCString QLatin1Codec::fromUnicode(const QString& uc, int& len ) const
-{
- if ( len <0 || len > (int)uc.length() )
- len = uc.length();
- QCString r( len+1 );
- int i = 0;
- const QChar *ch = uc.unicode();
- while ( i < len ) {
- r[i] = ch->row() ? '?' : ch->cell();
- i++;
- ch++;
- }
- r[len] = 0;
- return r;
-}
-
-
-const char* QLatin1Codec::name() const
-{
- return "ISO 8859-1";
-}
-
-
-int QLatin1Codec::mibEnum() const
-{
- return 4;
-}
-
-int QLatin1Codec::heuristicNameMatch(const char* hint) const
-{
- return QTextCodec::heuristicNameMatch(hint);
-}
-
-int QLatin1Codec::heuristicContentMatch(const char* chars, int len) const
-{
- if ( len<1 || !chars )
- return -1;
- int i = 0;
- const uchar * c = (const unsigned char *)chars;
- int r = 0;
- while( i<len && c && *c ) {
- if ( *c >= 0x80 && *c < 0xa0 )
- return -1;
- if ( (*c >= ' ' && *c < 127) ||
- *c == '\n' || *c == '\t' || *c == '\r' )
- r++;
- i++;
- c++;
- }
- return r;
-}
-
-
-static void setupBuiltinCodecs()
-{
- (void)new QLatin1Codec;
-
-#ifndef QT_NO_CODECS
- int i = 0;
- do {
- (void)new QSimpleTextCodec( i );
- } while( unicodevalues[i++].mib != LAST_MIB );
-
- //(void)new QEucJpCodec;
- //(void)new QSjisCodec;
- //(void)new QJisCodec;
- //(void)new QEucKrCodec;
- //(void)new QGbkCodec;
- //(void)new QBig5Codec;
- (void)new QUtf8Codec;
- (void)new QUtf16Codec;
- //(void)new QHebrewCodec;
- //(void)new QArabicCodec;
- //(void)new QTsciiCodec;
-#endif // QT_NO_CODECS
-}
-
-#endif // QT_NO_TEXTCODEC
diff --git a/qtools/qtextcodec.h b/qtools/qtextcodec.h
deleted file mode 100644
index 18ece20..0000000
--- a/qtools/qtextcodec.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QTextCodec class
-**
-** Created : 981015
-**
-** Copyright (C) 1998-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QTEXTCODEC_H
-#define QTEXTCODEC_H
-
-#ifndef QT_H
-#include "qstring.h"
-#endif // QT_H
-
-#ifndef QT_NO_TEXTCODEC
-
-class QTextCodec;
-class QIODevice;
-
-class Q_EXPORT QTextEncoder {
-public:
- virtual ~QTextEncoder();
- virtual QCString fromUnicode(const QString& uc, int& lenInOut) = 0;
-};
-
-class Q_EXPORT QTextDecoder {
-public:
- virtual ~QTextDecoder();
- virtual QString toUnicode(const char* chars, int len) = 0;
-};
-
-class Q_EXPORT QTextCodec {
-public:
- virtual ~QTextCodec();
-
-#ifndef QT_NO_CODECS
- static QTextCodec* loadCharmap(QIODevice*);
- static QTextCodec* loadCharmapFile(QString filename);
-#endif
- static QTextCodec* codecForMib(int mib);
- static QTextCodec* codecForName(const char* hint, int accuracy=0);
- static QTextCodec* codecForContent(const char* chars, int len);
- static QTextCodec* codecForIndex(int i);
- static QTextCodec* codecForLocale();
-
- static void deleteAllCodecs();
-
- static const char* locale();
-
- virtual const char* name() const = 0;
- virtual int mibEnum() const = 0;
-
- virtual QTextDecoder* makeDecoder() const;
- virtual QTextEncoder* makeEncoder() const;
-
- virtual QString toUnicode(const char* chars, int len) const;
- virtual QCString fromUnicode(const QString& uc, int& lenInOut) const;
-
- QCString fromUnicode(const QString& uc) const;
- QString toUnicode(const QByteArray&, int len) const;
- QString toUnicode(const QByteArray&) const;
- QString toUnicode(const char* chars) const;
- virtual bool canEncode( QChar ) const;
- virtual bool canEncode( const QString& ) const;
-
- virtual int heuristicContentMatch(const char* chars, int len) const = 0;
- virtual int heuristicNameMatch(const char* hint) const;
-
-protected:
- QTextCodec();
- static int simpleHeuristicNameMatch(const char* name, const char* hint);
-};
-#endif // QT_NO_TEXTCODEC
-#endif // QTEXTCODEC_H
diff --git a/qtools/qtextstream.cpp b/qtools/qtextstream.cpp
deleted file mode 100644
index ffbdeba..0000000
--- a/qtools/qtextstream.cpp
+++ /dev/null
@@ -1,2237 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QTextStream class
-**
-** Created : 940922
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qtextstream.h"
-
-#ifndef QT_NO_TEXTSTREAM
-#include "qtextcodec.h"
-#include "qregexp.h"
-#include "qbuffer.h"
-#include "qfile.h"
-#include <stdio.h>
-#include <ctype.h>
-#include <stdlib.h>
-
-#if defined(_OS_WIN32_)
-#include <windows.h>
-#endif
-
-// NOT REVISED
-/*!
- \class QTextStream qtextstream.h
-
- \brief The QTextStream class provides basic functions for reading and
- writing text using a QIODevice.
-
- \ingroup io
-
- \define endl
- \define bin
- \define oct
- \define dec
- \define hex
- \define flush
- \define ws
-
- The text stream class has a functional interface that is very
- similar to that of the standard C++ iostream class. The difference
- between iostream and QTextStream is that our stream operates on a
- QIODevice, which is easily subclassed, while iostream operates on
- FILE * pointers, which can not be subclassed.
-
- Qt provides several global functions similar to the ones in iostream:
- <ul>
- <li> \c bin sets the QTextStream to read/write binary numbers
- <li> \c oct sets the QTextStream to read/write octal numbers
- <li> \c dec sets the QTextStream to read/write decimal numbers
- <li> \c hex sets the QTextStream to read/write hexadecimal numbers
- <li> \c endl forces a line break
- <li> \c flush forces the QIODevice to flush any buffered data
- <li> \c ws eats any available white space (on input)
- <li> \c reset resets the QTextStream to its default mode (see reset()).
- </ul>
-
- \warning By default, QTextStream will automatically detect whether
- integers in the stream are in decimal, octal, hexadecimal or binary
- format when reading from the stream. In particular, a leading '0'
- signifies octal, ie. the sequence "0100" will be interpreted as
- 64.
-
- The QTextStream class reads and writes text and it is not
- appropriate for dealing with binary data (but QDataStream is).
-
- By default output of Unicode text (ie. QString) is done using the
- local 8-bit encoding. This can be changed using the setEncoding()
- method. For input, the QTextStream will auto-detect standard
- Unicode "byte order marked" text files, but otherwise the local
- 8-bit encoding is used.
-
- \sa QDataStream
-*/
-
-/*
- \class QTSManip qtextstream.h
-
- \brief The QTSManip class is an internal helper class for the
- QTextStream.
-
- It is generally a very bad idea to use this class directly in
- application programs.
-
- \internal
-
- This class makes it possible to give the QTextStream function objects
- with arguments, like this:
- \code
- QTextStream cout( stdout, IO_WriteOnly );
- cout << setprecision( 8 ); // QTSManip used here!
- cout << 3.14159265358979323846;
- \endcode
-
- The setprecision() function returns a QTSManip object.
- The QTSManip object contains a pointer to a member function in
- QTextStream and an integer argument.
- When serializing a QTSManip into a QTextStream, the function
- is executed with the argument.
-*/
-
-/*! \fn QTSManip::QTSManip (QTSMFI m, int a)
-
- Constructs a QTSManip object which will call \a m (a member function
- in QTextStream which accepts a single int) with argument \a a when
- QTSManip::exec() is called. Used internally in e.g. endl:
-
- \code
- s << "some text" << endl << "more text";
- \endcode
-*/
-
-/*! \fn void QTSManip::exec (QTextStream& s)
-
- Calls the member function specified in the constructor, for object
- \a s. Used internally in e.g. endl:
-
- \code
- s << "some text" << endl << "more text";
- \endcode
-*/
-
-
-/*****************************************************************************
- QTextStream member functions
- *****************************************************************************/
-
-#if defined(CHECK_STATE)
-#undef CHECK_STREAM_PRECOND
-#define CHECK_STREAM_PRECOND if ( !dev ) { \
- qWarning( "QTextStream: No device" ); \
- return *this; }
-#else
-#define CHECK_STREAM_PRECOND
-#endif
-
-
-#define I_SHORT 0x0010
-#define I_INT 0x0020
-#define I_LONG 0x0030
-#define I_TYPE_MASK 0x00f0
-
-#define I_BASE_2 QTS::bin
-#define I_BASE_8 QTS::oct
-#define I_BASE_10 QTS::dec
-#define I_BASE_16 QTS::hex
-#define I_BASE_MASK (QTS::bin | QTS::oct | QTS::dec | QTS::hex)
-
-#define I_SIGNED 0x0100
-#define I_UNSIGNED 0x0200
-#define I_SIGN_MASK 0x0f00
-
-
-static const QChar QEOF = QChar((ushort)0xffff); //guaranteed not to be a character.
-
-const int QTextStream::basefield = I_BASE_MASK;
-const int QTextStream::adjustfield = ( QTextStream::left |
- QTextStream::right |
- QTextStream::internal );
-const int QTextStream::floatfield = ( QTextStream::scientific |
- QTextStream::fixed );
-
-
-class QTextStreamPrivate {
-public:
-#ifndef QT_NO_TEXTCODEC
- QTextStreamPrivate() : decoder( 0 ), sourceType( NotSet ) {}
- ~QTextStreamPrivate() { delete decoder; }
- QTextDecoder *decoder; //???
-#else
- QTextStreamPrivate() : sourceType( NotSet ) {}
- ~QTextStreamPrivate() { }
-#endif
- QString ungetcBuf;
-
- enum SourceType { NotSet, IODevice, String, ByteArray, File };
- SourceType sourceType;
-};
-
-
-// skips whitespace and returns the first non-whitespace character
-QChar QTextStream::eat_ws()
-{
- QChar c;
- do { c = ts_getc(); } while ( c != QEOF && ts_isspace(c) );
- return c;
-}
-
-void QTextStream::init()
-{
- // ### ungetcBuf = QEOF;
- dev = 0; // no device set
- fstrm = owndev = FALSE;
- mapper = 0;
- d = new QTextStreamPrivate;
- doUnicodeHeader = TRUE; //default to autodetect
- latin1 = TRUE; // ### should use local?
- internalOrder = QChar::networkOrdered(); //default to network order
-}
-
-/*!
- Constructs a data stream that has no IO device.
-*/
-
-QTextStream::QTextStream()
-{
- init();
- setEncoding( Locale ); //###
- reset();
- d->sourceType = QTextStreamPrivate::NotSet;
-}
-
-/*!
- Constructs a text stream that uses the IO device \a iod.
-*/
-
-QTextStream::QTextStream( QIODevice *iod )
-{
- init();
- setEncoding( Locale ); //###
- dev = iod; // set device
- reset();
- d->sourceType = QTextStreamPrivate::IODevice;
-}
-
-// TODO: use special-case handling of this case in QTextStream, and
-// simplify this class to only deal with QChar or QString data.
-class QStringBuffer : public QIODevice {
-public:
- QStringBuffer( QString* str );
- ~QStringBuffer();
- bool open( int m );
- void close();
- void flush();
- uint size() const;
- int at() const;
- bool at( int pos );
- int readBlock( char *p, uint len );
- int writeBlock( const char *p, uint len );
- int getch();
- int putch( int ch );
- int ungetch( int ch );
-protected:
- QString* s;
-
-private: // Disabled copy constructor and operator=
- QStringBuffer( const QStringBuffer & );
- QStringBuffer &operator=( const QStringBuffer & );
-};
-
-
-QStringBuffer::QStringBuffer( QString* str )
-{
- s = str;
-}
-
-QStringBuffer::~QStringBuffer()
-{
-}
-
-
-bool QStringBuffer::open( int m )
-{
- if ( !s ) {
-#if defined(CHECK_STATE)
- qWarning( "QStringBuffer::open: No string" );
-#endif
- return FALSE;
- }
- if ( isOpen() ) { // buffer already open
-#if defined(CHECK_STATE)
- qWarning( "QStringBuffer::open: Buffer already open" );
-#endif
- return FALSE;
- }
- setMode( m );
- if ( m & IO_Truncate ) { // truncate buffer
- s->truncate( 0 );
- }
- if ( m & IO_Append ) { // append to end of buffer
- ioIndex = s->length()*(int)sizeof(QChar);
- } else {
- ioIndex = 0;
- }
- setState( IO_Open );
- setStatus( 0 );
- return TRUE;
-}
-
-void QStringBuffer::close()
-{
- if ( isOpen() ) {
- setFlags( IO_Direct );
- ioIndex = 0;
- }
-}
-
-void QStringBuffer::flush()
-{
-}
-
-uint QStringBuffer::size() const
-{
- return s ? s->length()*(int)sizeof(QChar) : 0;
-}
-
-int QStringBuffer::at() const
-{
- return ioIndex;
-}
-
-bool QStringBuffer::at( int pos )
-{
-#if defined(CHECK_STATE)
- if ( !isOpen() ) {
- qWarning( "QStringBuffer::at: Buffer is not open" );
- return FALSE;
- }
-#endif
- if ( (uint)pos >= s->length()*2 ) {
-#if defined(CHECK_RANGE)
- qWarning( "QStringBuffer::at: Index %d out of range", pos );
-#endif
- return FALSE;
- }
- ioIndex = pos;
- return TRUE;
-}
-
-
-int QStringBuffer::readBlock( char *p, uint len )
-{
-#if defined(CHECK_STATE)
- CHECK_PTR( p );
- if ( !isOpen() ) { // buffer not open
- qWarning( "QStringBuffer::readBlock: Buffer not open" );
- return -1;
- }
- if ( !isReadable() ) { // reading not permitted
- qWarning( "QStringBuffer::readBlock: Read operation not permitted" );
- return -1;
- }
-#endif
- if ( (uint)ioIndex + len > s->length()*sizeof(QChar) ) {
- // overflow
- if ( (uint)ioIndex >= s->length()*sizeof(QChar) ) {
- setStatus( IO_ReadError );
- return -1;
- } else {
- len = s->length()*2 - (uint)ioIndex;
- }
- }
- memcpy( p, ((const char*)(s->unicode()))+ioIndex, len );
- ioIndex += len;
- return len;
-}
-
-int QStringBuffer::writeBlock( const char *p, uint len )
-{
-#if defined(CHECK_NULL)
- if ( p == 0 && len != 0 )
- qWarning( "QStringBuffer::writeBlock: Null pointer error" );
-#endif
-#if defined(CHECK_STATE)
- if ( !isOpen() ) { // buffer not open
- qWarning( "QStringBuffer::writeBlock: Buffer not open" );
- return -1;
- }
- if ( !isWritable() ) { // writing not permitted
- qWarning( "QStringBuffer::writeBlock: Write operation not permitted" );
- return -1;
- }
- if ( ioIndex&1 ) {
- qWarning( "QStringBuffer::writeBlock: non-even index - non Unicode" );
- return -1;
- }
- if ( len&1 ) {
- qWarning( "QStringBuffer::writeBlock: non-even length - non Unicode" );
- return -1;
- }
-#endif
- s->replace(ioIndex/2, len/2, (QChar*)p, len/2);
- ioIndex += len;
- return len;
-}
-
-int QStringBuffer::getch()
-{
-#if defined(CHECK_STATE)
- if ( !isOpen() ) { // buffer not open
- qWarning( "QStringBuffer::getch: Buffer not open" );
- return -1;
- }
- if ( !isReadable() ) { // reading not permitted
- qWarning( "QStringBuffer::getch: Read operation not permitted" );
- return -1;
- }
-#endif
- if ( (uint)ioIndex >= s->length()*2 ) { // overflow
- setStatus( IO_ReadError );
- return -1;
- }
- return *((char*)s->unicode() + ioIndex++);
-}
-
-int QStringBuffer::putch( int ch )
-{
- char c = ch;
- if ( writeBlock(&c,1) < 0 )
- return -1;
- else
- return ch;
-}
-
-int QStringBuffer::ungetch( int ch )
-{
-#if defined(CHECK_STATE)
- if ( !isOpen() ) { // buffer not open
- qWarning( "QStringBuffer::ungetch: Buffer not open" );
- return -1;
- }
- if ( !isReadable() ) { // reading not permitted
- qWarning( "QStringBuffer::ungetch: Read operation not permitted" );
- return -1;
- }
-#endif
- if ( ch != -1 ) { // something to do with eof
- if ( ioIndex )
- ioIndex--;
- else
- ch = -1;
- }
- return ch;
-}
-
-
-/*!
- Constructs a text stream that operates on a Unicode QString through an
- internal device.
-
- If you set an encoding or codec with setEncoding() or setCodec(), this
- setting is ignored for text streams that operate on QString.
-
- Example:
- \code
- QString str;
- QTextStream ts( &str, IO_WriteOnly );
- ts << "pi = " << 3.14; // str == "pi = 3.14"
- \endcode
-
- Writing data to the text stream will modify the contents of the string.
- The string will be expanded when data is written beyond the end of the
- string. Note that the string will not be truncated:
- \code
- QString str = "pi = 3.14";
- QTextStream ts( &str, IO_WriteOnly );
- ts << "2+2 = " << 2+2; // str == "2+2 = 414"
- \endcode
-
- Note that since QString is Unicode, you should not use readRawBytes()
- or writeRawBytes() on such a stream.
-*/
-
-QTextStream::QTextStream( QString* str, int filemode )
-{
- // TODO: optimize for this case as it becomes more common
- // (see QStringBuffer above)
- init();
- dev = new QStringBuffer( str );
- ((QStringBuffer *)dev)->open( filemode );
- owndev = TRUE;
- setEncoding(RawUnicode);
- reset();
- d->sourceType = QTextStreamPrivate::String;
-}
-
-/*! \obsolete
-
- This constructor is equivalent to the constructor taking a QString*
- parameter.
-*/
-
-QTextStream::QTextStream( QString& str, int filemode )
-{
- init();
- dev = new QStringBuffer( &str );
- ((QStringBuffer *)dev)->open( filemode );
- owndev = TRUE;
- setEncoding(RawUnicode);
- reset();
- d->sourceType = QTextStreamPrivate::String;
-}
-
-/*!
- Constructs a text stream that operates on a byte array through an
- internal QBuffer device.
-
- Example:
- \code
- QByteArray array;
- QTextStream ts( array, IO_WriteOnly );
- ts << "pi = " << 3.14 << '\0'; // array == "pi = 3.14"
- \endcode
-
- Writing data to the text stream will modify the contents of the array.
- The array will be expanded when data is written beyond the end of the
- string.
-
- Same example, using a QBuffer:
- \code
- QByteArray array;
- QBuffer buf( array );
- buf.open( IO_WriteOnly );
- QTextStream ts( &buf );
- ts << "pi = " << 3.14 << '\0'; // array == "pi = 3.14"
- buf.close();
- \endcode
-*/
-
-QTextStream::QTextStream( QByteArray a, int mode )
-{
- init();
- dev = new QBuffer( a );
- ((QBuffer *)dev)->open( mode );
- owndev = TRUE;
- setEncoding( Locale ); //### Locale???
- reset();
- d->sourceType = QTextStreamPrivate::ByteArray;
-}
-
-/*!
- Constructs a text stream that operates on an existing file handle \e fh
- through an internal QFile device.
-
- Example:
- \code
- QTextStream cout( stdout, IO_WriteOnly );
- QTextStream cin ( stdin, IO_ReadOnly );
- QTextStream cerr( stderr, IO_WriteOnly );
- \endcode
-*/
-
-QTextStream::QTextStream( FILE *fh, int mode )
-{
- init();
- setEncoding( Locale ); //###
- dev = new QFile;
- ((QFile *)dev)->open( mode, fh );
- fstrm = owndev = TRUE;
- reset();
- d->sourceType = QTextStreamPrivate::File;
-}
-
-/*!
- Destructs the text stream.
-
- The destructor does not affect the current IO device.
-*/
-
-QTextStream::~QTextStream()
-{
- if ( owndev )
- delete dev;
- delete d;
-}
-
-/*!
- Positions the read pointer at the first non-whitespace character.
-*/
-void QTextStream::skipWhiteSpace()
-{
- ts_ungetc( eat_ws() );
-}
-
-
-/*!
- \fn Encoding QTextStream::encoding() const
-
- Returns the encoding mode of the stream.
-
- \sa setEncoding()
-*/
-
-/*!
- Tries to read len characters from the stream and stores them in \a buf.
- Returns the number of characters really read.
- Attention: There will no QEOF appended if the read reaches the end of
- the file. EOF is reached when the return value does not equal \a len.
-*/
-uint QTextStream::ts_getbuf( QChar* buf, uint len )
-{
- if( len<1 )
- return 0;
-
- uint rnum=0; // the number of QChars really read
-
- if ( d && d->ungetcBuf.length() ) {
- while( rnum < len && rnum < d->ungetcBuf.length() ) {
- buf[rnum] = d->ungetcBuf.constref(rnum);
- rnum++;
- }
- d->ungetcBuf = d->ungetcBuf.mid( rnum );
- if ( rnum >= len )
- return rnum;
- }
-
- // we use dev->ungetch() for one of the bytes of the unicode
- // byte-order mark, but a local unget hack for the other byte:
- int ungetHack = EOF;
-
- if ( doUnicodeHeader ) {
- doUnicodeHeader = FALSE; //only at the top
- int c1 = dev->getch();
- if ( c1 == EOF )
- return rnum;
- int c2 = dev->getch();
- if ( c1 == 0xfe && c2 == 0xff ) {
- mapper = 0;
- latin1 = FALSE;
- internalOrder = QChar::networkOrdered(); //network order
- } else if ( c1 == 0xff && c2 == 0xfe ) {
- mapper = 0;
- latin1 = FALSE;
- internalOrder = !QChar::networkOrdered(); //reverse network order
- } else {
- if ( c2 != EOF ) {
- dev->ungetch( c2 );
- ungetHack = c1;
- } else {
- dev->ungetch( c1 );
- // note that a small possible bug might hide here
- // here, if only the first byte of a file has made it
- // so far, and that first byte is half of the
- // byte-order mark, then the utfness will not be
- // detected. whether or not this is a bug depends on
- // taste. I can't really decide.
- }
- }
- }
-
-#ifndef QT_NO_TEXTCODEC
- if ( mapper ) {
- bool shortRead = FALSE;
- if ( !d->decoder )
- d->decoder = mapper->makeDecoder();
- while( rnum < len ) {
- QString s;
- bool readBlock = !( len == 1+rnum );
- while ( TRUE ) {
- // for efficiency: normally read a whole block
- if ( readBlock ) {
- // guess buffersize; this may be wrong (too small or too
- // big). But we can handle this (either iterate reading
- // or use ungetcBuf).
- // Note that this might cause problems for codecs where
- // one byte can result in >1 Unicode Characters if bytes
- // are written to the stream in the meantime (loss of
- // synchronicity).
- uint rlen = len - rnum;
- char *cbuf = new char[ rlen ];
- if ( ungetHack != EOF ) {
- rlen = 1+dev->readBlock( cbuf+1, rlen-1 );
- cbuf[0] = (char)ungetHack;
- ungetHack = EOF;
- } else {
- rlen = dev->readBlock( cbuf, rlen );
- }
- s += d->decoder->toUnicode( cbuf, rlen );
- delete[] cbuf;
- // use buffered reading only for the first time, because we
- // have to get the stream synchronous again (this is easier
- // with single character reading)
- readBlock = FALSE;
- }
- // get stream (and codec) in sync
- int c;
- if ( ungetHack == EOF ) {
- c = dev->getch();
- } else {
- c = ungetHack;
- ungetHack = EOF;
- }
- if ( c == EOF ) {
- shortRead = TRUE;
- break;
- }
- char b = c;
- uint lengthBefore = s.length();
- s += d->decoder->toUnicode( &b, 1 );
- if ( s.length() > lengthBefore )
- break; // it seems we are in sync now
- }
- uint i = 0;
- while( rnum < len && i < s.length() )
- buf[rnum++] = s.constref(i++);
- if ( s.length() > i )
- // could be = but append is clearer
- d->ungetcBuf.append( s.mid( i ) );
- if ( shortRead )
- return rnum;
- }
- } else
-#endif
- if ( latin1 ) {
- if ( len == 1+rnum ) {
- // use this method for one character because it is more efficient
- // (arnt doubts whether it makes a difference, but lets it stand)
- int c = (ungetHack == EOF) ? dev->getch() : ungetHack;
- if ( c != EOF )
- buf[rnum++] = (char)c;
- } else {
- if ( ungetHack != EOF ) {
- buf[rnum++] = (char)ungetHack;
- ungetHack = EOF;
- }
- char *cbuf = new char[len - rnum];
- while ( !dev->atEnd() && rnum < len ) {
- uint rlen = len - rnum;
- rlen = dev->readBlock( cbuf, rlen );
- uint i = 0;
- while( i < rlen )
- buf[rnum++] = cbuf[i++];
- }
- delete[] cbuf;
- }
- } else { // UCS-2 or UTF-16
- if ( len == 1+rnum ) {
- int c1 = (ungetHack == EOF) ? dev->getch() : ungetHack;
- if ( c1 == EOF )
- return rnum;
- int c2 = dev->getch();
- if ( c2 == EOF )
- return rnum;
- if ( isNetworkOrder() )
- buf[rnum++] = QChar( c2, c1 );
- else
- buf[rnum++] = QChar( c1, c2 );
- } else {
- char *cbuf = new char[ 2*( len - rnum ) ]; // for paranoids: overflow possible
- while ( !dev->atEnd() && rnum < len ) {
- uint rlen = 2 * ( len-rnum );
- if ( ungetHack != EOF ) {
- rlen = 1+dev->readBlock( cbuf+1, rlen-1 );
- cbuf[0] = (char)ungetHack;
- ungetHack = EOF;
- } else {
- rlen = dev->readBlock( cbuf, rlen );
- }
- // We can't use an odd number of bytes, so put it back. But
- // do it only if we are capable of reading more -- normally
- // there should not be an odd number, but the file might be
- // truncated or not in UTF-16...
- if ( (rlen & 1) == 1 )
- if ( !dev->atEnd() )
- dev->ungetch( cbuf[--rlen] );
- uint i = 0;
- if ( isNetworkOrder() ) {
- while( i < rlen ) {
- buf[rnum++] = QChar( cbuf[i+1], cbuf[i] );
- i+=2;
- }
- } else {
- while( i < rlen ) {
- buf[rnum++] = QChar( cbuf[i], cbuf[i+1] );
- i+=2;
- }
- }
- }
- delete[] cbuf;
- }
- }
- return rnum;
-}
-
-
-/*!
- Puts one character to the stream.
-*/
-void QTextStream::ts_putc( QChar c )
-{
-#ifndef QT_NO_TEXTCODEC
- if ( mapper ) {
- int len = 1;
- QString s = c;
- QCString block = mapper->fromUnicode( s, len );
- dev->writeBlock( block, len );
- } else
-#endif
- if ( latin1 ) {
- if( c.row() )
- dev->putch( '?' ); //######unknown character???
- else
- dev->putch( c.cell() );
- } else {
- if ( doUnicodeHeader ) {
- doUnicodeHeader = FALSE;
- ts_putc( QChar::byteOrderMark );
- }
- if ( internalOrder ) {
- dev->writeBlock( (char*)&c, sizeof(QChar) );
- } else if ( isNetworkOrder() ) {
- dev->putch(c.row());
- dev->putch(c.cell());
- } else {
- dev->putch(c.cell());
- dev->putch(c.row());
- }
- }
-}
-
-/*!
- Puts one character to the stream.
-*/
-void QTextStream::ts_putc(int ch)
-{
- ts_putc(QChar((ushort)ch));
-}
-
-bool QTextStream::ts_isdigit(QChar c)
-{
- return c.isDigit();
-}
-
-bool QTextStream::ts_isspace( QChar c )
-{
- return c.isSpace();
-}
-
-void QTextStream::ts_ungetc( QChar c )
-{
- if ( c.unicode() == 0xffff )
- return;
-
- d->ungetcBuf.prepend( c );
-}
-
-
-
-/*!
- Reads \e len bytes from the stream into \e e s and returns a reference to
- the stream.
-
- The buffer \e s must be preallocated.
-
- Note that no encoding is done by this function.
-
- \warning The behaviour of this function is undefined unless the
- stream's encoding is set to Unicode or Latin1.
-
- \sa QIODevice::readBlock()
-*/
-
-QTextStream &QTextStream::readRawBytes( char *s, uint len )
-{
- dev->readBlock( s, len );
- return *this;
-}
-
-/*!
- Writes the \e len bytes from \e s to the stream and returns a reference to
- the stream.
-
- Note that no encoding is done by this function.
-
- \sa QIODevice::writeBlock()
-*/
-
-QTextStream &QTextStream::writeRawBytes( const char* s, uint len )
-{
- dev->writeBlock( s, len );
- return *this;
-}
-
-
-QTextStream &QTextStream::writeBlock( const char* p, uint len )
-{
- if ( doUnicodeHeader ) {
- doUnicodeHeader = FALSE;
- if ( !mapper && !latin1 )
- ts_putc( QChar::byteOrderMark );
- }
- //All QCStrings and const char* are defined to be in Latin1
- if ( !mapper && latin1 ) {
- dev->writeBlock( p, len );
- } else if ( !mapper && internalOrder ) {
- QChar *u = new QChar[len];
- for (uint i=0; i<len; i++)
- u[i] = p[i];
- dev->writeBlock( (char*)u, len*(int)sizeof(QChar) );
- delete [] u;
- } else {
- for (uint i=0; i<len; i++)
- ts_putc( (uchar)p[i] );
- }
- return *this;
-}
-
-QTextStream &QTextStream::writeBlock( const QChar* p, uint len )
-{
- if ( !mapper && !latin1 && internalOrder ) {
- if ( doUnicodeHeader ) {
- doUnicodeHeader = FALSE;
- ts_putc( QChar::byteOrderMark );
- }
- dev->writeBlock( (char*)p, (int)sizeof(QChar)*len );
- } else {
- for (uint i=0; i<len; i++)
- ts_putc( p[i] );
- }
- return *this;
-}
-
-
-
-/*!
- Resets the text stream.
-
- <ul>
- <li> All flags are set to 0.
- <li> The field width is set to 0.
- <li> The fill character is set to ' ' (space).
- <li> The precision is set to 6.
- </ul>
-
- \sa setf(), width(), fill(), precision()
-*/
-
-void QTextStream::reset()
-{
- fflags = 0;
- fwidth = 0;
- fillchar = ' ';
- fprec = 6;
-}
-
-
-/*!
- \fn QIODevice *QTextStream::device() const
- Returns the IO device currently set.
- \sa setDevice(), unsetDevice()
-*/
-
-/*!
- Sets the IO device to \a iod.
- \sa device(), unsetDevice()
-*/
-
-void QTextStream::setDevice( QIODevice *iod )
-{
- if ( owndev ) {
- delete dev;
- owndev = FALSE;
- }
- dev = iod;
- d->sourceType = QTextStreamPrivate::IODevice;
-}
-
-/*!
- Unsets the IO device. Equivalent to setDevice( 0 ).
- \sa device(), setDevice()
-*/
-
-void QTextStream::unsetDevice()
-{
- setDevice( 0 );
- d->sourceType = QTextStreamPrivate::NotSet;
-}
-
-/*!
- \fn bool QTextStream::atEnd() const
- Returns TRUE if the IO device has reached the end position (end of
- stream or file) or if there is no IO device set.
-
- Returns FALSE if the current position of the read/write head of the IO
- device is somewhere before the end position.
-
- \sa QIODevice::atEnd()
-*/
-
-/*!\fn bool QTextStream::eof() const
-
- \obsolete
-
- This function has been renamed to atEnd().
-
- \sa QIODevice::atEnd()
-*/
-
-/*****************************************************************************
- QTextStream read functions
- *****************************************************************************/
-
-
-/*!
- Reads a \c char from the stream and returns a reference to the stream.
- Note that whitespace is skipped.
-*/
-
-QTextStream &QTextStream::operator>>( char &c )
-{
- CHECK_STREAM_PRECOND
- c = eat_ws();
- return *this;
-}
-
-/*!
- Reads a \c char from the stream and returns a reference to the stream.
- Note that whitespace is \e not skipped.
-*/
-
-QTextStream &QTextStream::operator>>( QChar &c )
-{
- CHECK_STREAM_PRECOND
- c = ts_getc();
- return *this;
-}
-
-
-ulong QTextStream::input_bin()
-{
- ulong val = 0;
- QChar ch = eat_ws();
- int dv = ch.digitValue();
- while ( dv == 0 || dv == 1 ) {
- val = ( val << 1 ) + dv;
- ch = ts_getc();
- dv = ch.digitValue();
- }
- if ( ch != QEOF )
- ts_ungetc( ch );
- return val;
-}
-
-ulong QTextStream::input_oct()
-{
- ulong val = 0;
- QChar ch = eat_ws();
- int dv = ch.digitValue();
- while ( dv >= 0 && dv <= 7 ) {
- val = ( val << 3 ) + dv;
- ch = ts_getc();
- dv = ch.digitValue();
- }
- if ( dv == 8 || dv == 9 ) {
- while ( ts_isdigit(ch) )
- ch = ts_getc();
- }
- if ( ch != QEOF )
- ts_ungetc( ch );
- return val;
-}
-
-ulong QTextStream::input_dec()
-{
- ulong val = 0;
- QChar ch = eat_ws();
- int dv = ch.digitValue();
- while ( ts_isdigit(ch) ) {
- val = val * 10 + dv;
- ch = ts_getc();
- dv = ch.digitValue();
- }
- if ( ch != QEOF )
- ts_ungetc( ch );
- return val;
-}
-
-ulong QTextStream::input_hex()
-{
- ulong val = 0;
- QChar ch = eat_ws();
- char c = ch;
- while ( isxdigit(c) ) {
- val <<= 4;
- if ( ts_isdigit(c) )
- val += c - '0';
- else
- val += 10 + tolower(c) - 'a';
- c = ch = ts_getc();
- }
- if ( ch != QEOF )
- ts_ungetc( ch );
- return val;
-}
-
-long QTextStream::input_int()
-{
- long val;
- QChar ch;
- char c;
- switch ( flags() & basefield ) {
- case bin:
- val = (long)input_bin();
- break;
- case oct:
- val = (long)input_oct();
- break;
- case dec:
- c = ch = eat_ws();
- if ( ch == QEOF ) {
- val = 0;
- } else {
- if ( !(c == '-' || c == '+') )
- ts_ungetc( ch );
- if ( c == '-' ) {
- ulong v = input_dec();
- if ( v ) { // ensure that LONG_MIN can be read
- v--;
- val = -((long)v) - 1;
- } else {
- val = 0;
- }
- } else {
- val = (long)input_dec();
- }
- }
- break;
- case hex:
- val = (long)input_hex();
- break;
- default:
- val = 0;
- c = ch = eat_ws();
- if ( c == '0' ) { // bin, oct or hex
- c = ch = ts_getc();
- if ( tolower(c) == 'x' )
- val = (long)input_hex();
- else if ( tolower(c) == 'b' )
- val = (long)input_bin();
- else { // octal
- ts_ungetc( ch );
- if ( c >= '0' && c <= '7' ) {
- val = (long)input_oct();
- } else {
- val = 0;
- }
- }
- } else if ( ts_isdigit(ch) ) {
- ts_ungetc( ch );
- val = (long)input_dec();
- } else if ( c == '-' || c == '+' ) {
- ulong v = input_dec();
- if ( c == '-' ) {
- if ( v ) { // ensure that LONG_MIN can be read
- v--;
- val = -((long)v) - 1;
- } else {
- val = 0;
- }
- } else {
- val = (long)v;
- }
- }
- }
- return val;
-}
-
-//
-// We use a table-driven FSM to parse floating point numbers
-// strtod() cannot be used directly since we're reading from a QIODevice
-//
-
-double QTextStream::input_double()
-{
- const int Init = 0; // states
- const int Sign = 1;
- const int Mantissa = 2;
- const int Dot = 3;
- const int Abscissa = 4;
- const int ExpMark = 5;
- const int ExpSign = 6;
- const int Exponent = 7;
- const int Done = 8;
-
- const int InputSign = 1; // input tokens
- const int InputDigit = 2;
- const int InputDot = 3;
- const int InputExp = 4;
-
- static uchar table[8][5] = {
- /* None InputSign InputDigit InputDot InputExp */
- { 0, Sign, Mantissa, Dot, 0, }, // Init
- { 0, 0, Mantissa, Dot, 0, }, // Sign
- { Done, Done, Mantissa, Dot, ExpMark,}, // Mantissa
- { 0, 0, Abscissa, 0, 0, }, // Dot
- { Done, Done, Abscissa, Done, ExpMark,}, // Abscissa
- { 0, ExpSign, Exponent, 0, 0, }, // ExpMark
- { 0, 0, Exponent, 0, 0, }, // ExpSign
- { Done, Done, Exponent, Done, Done } // Exponent
- };
-
- int state = Init; // parse state
- int input; // input token
-
- char buf[256];
- int i = 0;
- QChar c = eat_ws();
-
- while ( TRUE ) {
-
- switch ( c ) {
- case '+':
- case '-':
- input = InputSign;
- break;
- case '0': case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8': case '9':
- input = InputDigit;
- break;
- case '.':
- input = InputDot;
- break;
- case 'e':
- case 'E':
- input = InputExp;
- break;
- default:
- input = 0;
- break;
- }
-
- state = table[state][input];
-
- if ( state == 0 || state == Done || i > 250 ) {
- if ( i > 250 ) { // ignore rest of digits
- do { c = ts_getc(); } while ( c != QEOF && ts_isdigit(c) );
- }
- if ( c != QEOF )
- ts_ungetc( c );
- buf[i] = '\0';
- char *end;
- return strtod( buf, &end );
- }
-
- buf[i++] = c;
- c = ts_getc();
- }
-
-#if !defined(_CC_EGG_)
- return 0.0;
-#endif
-}
-
-
-/*!
- Reads a signed \c short integer from the stream and returns a reference to
- the stream. See flags() for an explanation of expected input format.
-*/
-
-QTextStream &QTextStream::operator>>( signed short &i )
-{
- CHECK_STREAM_PRECOND
- i = (signed short)input_int();
- return *this;
-}
-
-
-/*!
- Reads an unsigned \c short integer from the stream and returns a reference to
- the stream. See flags() for an explanation of expected input format.
-*/
-
-QTextStream &QTextStream::operator>>( unsigned short &i )
-{
- CHECK_STREAM_PRECOND
- i = (unsigned short)input_int();
- return *this;
-}
-
-
-/*!
- Reads a signed \c int from the stream and returns a reference to the
- stream. See flags() for an explanation of expected input format.
-*/
-
-QTextStream &QTextStream::operator>>( signed int &i )
-{
- CHECK_STREAM_PRECOND
- i = (signed int)input_int();
- return *this;
-}
-
-
-/*!
- Reads an unsigned \c int from the stream and returns a reference to the
- stream. See flags() for an explanation of expected input format.
-*/
-
-QTextStream &QTextStream::operator>>( unsigned int &i )
-{
- CHECK_STREAM_PRECOND
- i = (unsigned int)input_int();
- return *this;
-}
-
-
-/*!
- Reads a signed \c long int from the stream and returns a reference to the
- stream. See flags() for an explanation of expected input format.
-*/
-
-QTextStream &QTextStream::operator>>( signed long &i )
-{
- CHECK_STREAM_PRECOND
- i = (signed long)input_int();
- return *this;
-}
-
-
-/*!
- Reads an unsigned \c long int from the stream and returns a reference to the
- stream. See flags() for an explanation of expected input format.
-*/
-
-QTextStream &QTextStream::operator>>( unsigned long &i )
-{
- CHECK_STREAM_PRECOND
- i = (unsigned long)input_int();
- return *this;
-}
-
-
-/*!
- Reads a \c float from the stream and returns a reference to the stream.
- See flags() for an explanation of expected input format.
-*/
-
-QTextStream &QTextStream::operator>>( float &f )
-{
- CHECK_STREAM_PRECOND
- f = (float)input_double();
- return *this;
-}
-
-
-/*!
- Reads a \c double from the stream and returns a reference to the stream.
- See flags() for an explanation of expected input format.
-*/
-
-QTextStream &QTextStream::operator>>( double &f )
-{
- CHECK_STREAM_PRECOND
- f = input_double();
- return *this;
-}
-
-
-/*!
- Reads a word from the stream and returns a reference to the stream.
-*/
-
-QTextStream &QTextStream::operator>>( char *s )
-{
- CHECK_STREAM_PRECOND
- int maxlen = width( 0 );
- QChar c = eat_ws();
- if ( !maxlen )
- maxlen = -1;
- while ( c != QEOF ) {
- if ( ts_isspace(c) || maxlen-- == 0 ) {
- ts_ungetc( c );
- break;
- }
- *s++ = c;
- c = ts_getc();
- }
-
- *s = '\0';
- return *this;
-}
-
-/*!
- Reads a word from the stream and returns a reference to the stream.
-*/
-
-QTextStream &QTextStream::operator>>( QString &str )
-{
- CHECK_STREAM_PRECOND
- str=QString::fromLatin1("");
- QChar c = eat_ws();
-
- while ( c != QEOF ) {
- if ( ts_isspace(c) ) {
- ts_ungetc( c );
- break;
- }
- str += c;
- c = ts_getc();
- }
- return *this;
-}
-
-/*!
- Reads a word from the stream and returns a reference to the stream.
-*/
-
-QTextStream &QTextStream::operator>>( QCString &str )
-{
- CHECK_STREAM_PRECOND
- QCString *dynbuf = 0;
- const int buflen = 256;
- char buffer[buflen];
- char *s = buffer;
- int i = 0;
- QChar c = eat_ws();
-
- while ( c != QEOF ) {
- if ( ts_isspace(c) ) {
- ts_ungetc( c );
- break;
- }
- if ( i >= buflen-1 ) {
- if ( !dynbuf ) { // create dynamic buffer
- dynbuf = new QCString(buflen*2);
- memcpy( dynbuf->rawData(), s, i ); // copy old data
- } else if ( i >= (int)dynbuf->size()-1 ) {
- dynbuf->resize( dynbuf->size()*2 );
- }
- s = dynbuf->rawData();
- }
- s[i++] = c;
- c = ts_getc();
- }
- str.resize( i+1 );
- memcpy( str.rawData(), s, i );
- delete dynbuf;
- return *this;
-}
-
-
-/*!
- Reads a line from the stream and returns a string containing the text.
-
- The returned string does not contain any trailing newline or carriage
- return. Note that this is different from QIODevice::readLine(), which
- does not strip the newline at the end of the line.
-
- On EOF you will get a QString that is null. On reading an empty line the
- returned QString is empty but not null.
-
- \sa QIODevice::readLine()
-*/
-
-QString QTextStream::readLine()
-{
-#if defined(CHECK_STATE)
- if ( !dev ) {
- qWarning( "QTextStream::readLine: No device" );
- return QString::null;
- }
-#endif
- QString result( "" );
- const int buf_size = 256;
- QChar c[buf_size];
- int pos = 0;
-
- c[pos] = ts_getc();
- if ( c[pos] == QEOF )
- return QString::null;
-
- while ( c[pos] != QEOF && c[pos] != '\n' ) {
- pos++;
- if ( pos >= buf_size ) {
- result += QString( c, pos );
- pos = 0;
- }
- c[pos] = ts_getc();
- }
- result += QString( c, pos );
-
- int len = (int)result.length();
- if ( len && result[len-1] == '\r' )
- result.truncate(len-1); // (if there are two \r, let one stay)
-
- return result;
-}
-
-
-/*!
- Reads the entire stream and returns a string containing the text.
-
- \sa QIODevice::readLine()
-*/
-
-QString QTextStream::read()
-{
-#if defined(CHECK_STATE)
- if ( !dev ) {
- qWarning( "QTextStream::read: No device" );
- return QString::null;
- }
-#endif
- QString result;
- const uint bufsize = 512;
- QChar buf[bufsize];
- uint i, num, start;
- bool skipped_cr = FALSE;
-
- while ( 1 ) {
- num = ts_getbuf(buf,bufsize);
- // do a s/\r\n/\n
- start = 0;
- for ( i=0; i<num; i++ ) {
- if ( buf[i] == '\r' ) {
- // Only skip single cr's preceding lf's
- if ( skipped_cr ) {
- result += buf[i];
- start++;
- } else {
- result += QString( &buf[start], i-start );
- start = i+1;
- skipped_cr = TRUE;
- }
- } else {
- if ( skipped_cr ) {
- if ( buf[i] != '\n' ) {
- // Should not have skipped it
- result += '\r';
- }
- skipped_cr = FALSE;
- }
- }
- }
- if ( start < num )
- result += QString( &buf[start], i-start );
- if ( num != bufsize ) // if ( EOF )
- break;
- }
- return result;
-}
-
-
-
-/*****************************************************************************
- QTextStream write functions
- *****************************************************************************/
-
-/*!
- Writes a \c char to the stream and returns a reference to the stream.
-
- The character \a c is assumed to be Latin1 encoded independent of the Encoding set
- for the QTextStream.
-*/
-QTextStream &QTextStream::operator<<( QChar c )
-{
- CHECK_STREAM_PRECOND
- ts_putc( c );
- return *this;
-}
-
-/*!
- Writes a \c char to the stream and returns a reference to the stream.
-*/
-QTextStream &QTextStream::operator<<( char c )
-{
- CHECK_STREAM_PRECOND
- unsigned char uc = (unsigned char) c;
- ts_putc( uc );
- return *this;
-}
-
-QTextStream &QTextStream::output_int( int format, ulong n, bool neg )
-{
- static char hexdigits_lower[] = "0123456789abcdef";
- static char hexdigits_upper[] = "0123456789ABCDEF";
- CHECK_STREAM_PRECOND
- char buf[76];
- char *p;
- int len;
- char *hexdigits;
-
- switch ( flags() & I_BASE_MASK ) {
-
- case I_BASE_2: // output binary number
- switch ( format & I_TYPE_MASK ) {
- case I_SHORT: len=16; break;
- case I_INT: len=sizeof(int)*8; break;
- case I_LONG: len=32; break;
- default: len = 0;
- }
- p = &buf[74]; // go reverse order
- *p = '\0';
- while ( len-- ) {
- *--p = (char)(n&1) + '0';
- n >>= 1;
- if ( !n )
- break;
- }
- if ( flags() & showbase ) { // show base
- *--p = (flags() & uppercase) ? 'B' : 'b';
- *--p = '0';
- }
- break;
-
- case I_BASE_8: // output octal number
- p = &buf[74];
- *p = '\0';
- do {
- *--p = (char)(n&7) + '0';
- n >>= 3;
- } while ( n );
- if ( flags() & showbase )
- *--p = '0';
- break;
-
- case I_BASE_16: // output hexadecimal number
- p = &buf[74];
- *p = '\0';
- hexdigits = (flags() & uppercase) ?
- hexdigits_upper : hexdigits_lower;
- do {
- *--p = hexdigits[(int)n&0xf];
- n >>= 4;
- } while ( n );
- if ( flags() & showbase ) {
- *--p = (flags() & uppercase) ? 'X' : 'x';
- *--p = '0';
- }
- break;
-
- default: // decimal base is default
- p = &buf[74];
- *p = '\0';
- if ( neg )
- n = (ulong)(-(long)n);
- do {
- *--p = ((int)(n%10)) + '0';
- n /= 10;
- } while ( n );
- if ( neg )
- *--p = '-';
- else if ( flags() & showpos )
- *--p = '+';
- if ( (flags() & internal) && fwidth && !ts_isdigit(*p) ) {
- ts_putc( *p ); // special case for internal
- ++p; // padding
- fwidth--;
- return *this << (const char*)p;
- }
- }
- if ( fwidth ) { // adjustment required
- if ( !(flags() & left) ) { // but NOT left adjustment
- len = qstrlen(p);
- int padlen = fwidth - len;
- if ( padlen <= 0 ) { // no padding required
- writeBlock( p, len );
- } else if ( padlen < (int)(p-buf) ) { // speeds up padding
- memset( p-padlen, (char)fillchar, padlen );
- writeBlock( p-padlen, padlen+len );
- }
- else // standard padding
- *this << (const char*)p;
- }
- else
- *this << (const char*)p;
- fwidth = 0; // reset field width
- }
- else
- writeBlock( p, qstrlen(p) );
- return *this;
-}
-
-
-/*!
- Writes a \c short integer to the stream and returns a reference to
- the stream.
-*/
-
-QTextStream &QTextStream::operator<<( signed short i )
-{
- return output_int( I_SHORT | I_SIGNED, i, i < 0 );
-}
-
-
-/*!
- Writes an \c unsigned \c short integer to the stream and returns a reference
- to the stream.
-*/
-
-QTextStream &QTextStream::operator<<( unsigned short i )
-{
- return output_int( I_SHORT | I_UNSIGNED, i, FALSE );
-}
-
-
-/*!
- Writes an \c int to the stream and returns a reference to
- the stream.
-*/
-
-QTextStream &QTextStream::operator<<( signed int i )
-{
- return output_int( I_INT | I_SIGNED, i, i < 0 );
-}
-
-
-/*!
- Writes an \c unsigned \c int to the stream and returns a reference to
- the stream.
-*/
-
-QTextStream &QTextStream::operator<<( unsigned int i )
-{
- return output_int( I_INT | I_UNSIGNED, i, FALSE );
-}
-
-
-/*!
- Writes a \c long \c int to the stream and returns a reference to
- the stream.
-*/
-
-QTextStream &QTextStream::operator<<( signed long i )
-{
- return output_int( I_LONG | I_SIGNED, i, i < 0 );
-}
-
-
-/*!
- Writes an \c unsigned \c long \c int to the stream and returns a reference to
- the stream.
-*/
-
-QTextStream &QTextStream::operator<<( unsigned long i )
-{
- return output_int( I_LONG | I_UNSIGNED, i, FALSE );
-}
-
-
-/*!
- Writes a \c float to the stream and returns a reference to the stream.
-*/
-
-QTextStream &QTextStream::operator<<( float f )
-{
- return *this << (double)f;
-}
-
-
-/*!
- Writes a \c double to the stream and returns a reference to the stream.
-*/
-
-QTextStream &QTextStream::operator<<( double f )
-{
- CHECK_STREAM_PRECOND
- char buf[64];
- char f_char;
- char format[16];
- if ( (flags()&floatfield) == fixed )
- f_char = 'f';
- else if ( (flags()&floatfield) == scientific )
- f_char = (flags() & uppercase) ? 'E' : 'e';
- else
- f_char = (flags() & uppercase) ? 'G' : 'g';
- char *fs = format; // generate format string
- *fs++ = '%'; // "%.<prec>l<f_char>"
- *fs++ = '.';
- int prec = precision();
- if ( prec > 99 )
- prec = 99;
- if ( prec >= 10 ) {
- *fs++ = prec / 10 + '0';
- *fs++ = prec % 10 + '0';
- } else {
- *fs++ = prec + '0';
- }
- *fs++ = 'l';
- *fs++ = f_char;
- *fs = '\0';
- sprintf( buf, format, f ); // convert to text
- if ( fwidth ) // padding
- *this << (const char*)buf;
- else // just write it
- writeBlock( buf, qstrlen(buf) );
- return *this;
-}
-
-
-/*!
- Writes a string to the stream and returns a reference to the stream.
-
- The string \a s is assumed to be Latin1 encoded independent of the Encoding set
- for the QTextStream.
-*/
-
-QTextStream &QTextStream::operator<<( const char* s )
-{
- CHECK_STREAM_PRECOND
- char padbuf[48];
- uint len = qstrlen( s ); // don't write null terminator
- if ( fwidth ) { // field width set
- int padlen = fwidth - len;
- fwidth = 0; // reset width
- if ( padlen > 0 ) {
- char *ppad;
- if ( padlen > 46 ) { // create extra big fill buffer
- ppad = new char[padlen];
- CHECK_PTR( ppad );
- } else {
- ppad = padbuf;
- }
- memset( ppad, (char)fillchar, padlen ); // fill with fillchar
- if ( !(flags() & left) ) {
- writeBlock( ppad, padlen );
- padlen = 0;
- }
- writeBlock( s, len );
- if ( padlen )
- writeBlock( ppad, padlen );
- if ( ppad != padbuf ) // delete extra big fill buf
- delete[] ppad;
- return *this;
- }
- }
- writeBlock( s, len );
- return *this;
-}
-
-/*!
- Writes \a s to the stream and returns a reference to the stream.
-
- The string \a s is assumed to be Latin1 encoded independent of the Encoding set
- for the QTextStream.
-*/
-
-QTextStream &QTextStream::operator<<( const QCString & s )
-{
- return operator<<(s.data());
-}
-
-/*!
- Writes \a s to the stream and returns a reference to the stream.
-*/
-
-QTextStream &QTextStream::operator<<( const QString& s )
-{
- CHECK_STREAM_PRECOND
- uint len = s.length();
- QString s1 = s;
- if ( fwidth ) { // field width set
- if ( !(flags() & left) ) {
- s1 = s.rightJustify(fwidth, (char)fillchar);
- } else {
- s1 = s.leftJustify(fwidth, (char)fillchar);
- }
- fwidth = 0; // reset width
- }
- writeBlock( s1.unicode(), len );
- return *this;
-}
-
-
-/*!
- Writes a pointer to the stream and returns a reference to the stream.
-
- The \e ptr is output as an unsigned long hexadecimal integer.
-*/
-
-QTextStream &QTextStream::operator<<( void *ptr )
-{
- int f = flags();
- setf( hex, basefield );
- setf( showbase );
- unsetf( uppercase );
- output_int( I_LONG | I_UNSIGNED, (uintptr_t)ptr, FALSE );
- flags( f );
- return *this;
-}
-
-
-/*!
- \fn int QTextStream::flags() const
- Returns the current stream flags. The default value is 0.
-
- The meaning of the flags are:
- <ul>
- <li> \e skipws - Not currently used - whitespace always skipped
- <li> \e left - Numeric fields are left-aligned
- <li> \e right - Not currently used (by default numerics are right aligned)
- <li> \e internal - Put any padding spaces between +/- and value
- <li> \e bin - Output \e and input only in binary
- <li> \e oct - Output \e and input only in octal
- <li> \e dec - Output \e and input only in decimal
- <li> \e hex - Output \e and input only in hexadecimal
- <li> \e showbase - Annotate numeric outputs with 0b, 0, or 0x if in
- \e bin, \e oct, or \e hex format
- <li> \e showpoint - Not currently used
- <li> \e uppercase - Use 0B and 0X rather than 0b and 0x
- <li> \e showpos - Show + for positive numeric values
- <li> \e scientific - Use scientific notation for floating point values
- <li> \e fixed - Use fixed-point notation for floating point values
- </ul>
-
- Note that unless \e bin, \e oct, \e dec, or \e hex is set, the input base is
- octal if the value starts with 0, hexadecimal if it starts with 0x, binary
- if the value starts with 0b, and decimal otherwise.
-
- \sa setf(), unsetf()
-*/
-
-/*!
- \fn int QTextStream::flags( int f )
- Sets the stream flags to \e f.
- Returns the previous stream flags.
-
- \sa setf(), unsetf(), flags()
-*/
-
-/*!
- \fn int QTextStream::setf( int bits )
- Sets the stream flag bits \e bits.
- Returns the previous stream flags.
-
- Equivalent to <code>flags( flags() | bits )</code>.
-
- \sa setf(), unsetf()
-*/
-
-/*!
- \fn int QTextStream::setf( int bits, int mask )
- Sets the stream flag bits \e bits with a bit mask \e mask.
- Returns the previous stream flags.
-
- Equivalent to <code>flags( (flags() & ~mask) | (bits & mask) )</code>.
-
- \sa setf(), unsetf()
-*/
-
-/*!
- \fn int QTextStream::unsetf( int bits )
- Clears the stream flag bits \e bits.
- Returns the previous stream flags.
-
- Equivalent to <code>flags( flags() & ~mask )</code>.
-
- \sa setf()
-*/
-
-/*!
- \fn int QTextStream::width() const
- Returns the field width. The default value is 0.
-*/
-
-/*!
- \fn int QTextStream::width( int w )
- Sets the field width to \e w. Returns the previous field width.
-*/
-
-/*!
- \fn int QTextStream::fill() const
- Returns the fill character. The default value is ' ' (space).
-*/
-
-/*!
- \fn int QTextStream::fill( int f )
- Sets the fill character to \e f. Returns the previous fill character.
-*/
-
-/*!
- \fn int QTextStream::precision() const
- Returns the precision. The default value is 6.
-*/
-
-/*!
- \fn int QTextStream::precision( int p )
- Sets the precision to \e p. Returns the previous precision setting.
-*/
-
-
- /*****************************************************************************
- QTextStream manipulators
- *****************************************************************************/
-
-QTextStream &bin( QTextStream &s )
-{
- s.setf(QTS::bin,QTS::basefield);
- return s;
-}
-
-QTextStream &oct( QTextStream &s )
-{
- s.setf(QTS::oct,QTS::basefield);
- return s;
-}
-
-QTextStream &dec( QTextStream &s )
-{
- s.setf(QTS::dec,QTS::basefield);
- return s;
-}
-
-QTextStream &hex( QTextStream &s )
-{
- s.setf(QTS::hex,QTS::basefield);
- return s;
-}
-
-QTextStream &endl( QTextStream &s )
-{
- return s << '\n';
-}
-
-QTextStream &flush( QTextStream &s )
-{
- if ( s.device() )
- s.device()->flush();
- return s;
-}
-
-QTextStream &ws( QTextStream &s )
-{
- s.skipWhiteSpace();
- return s;
-}
-
-QTextStream &reset( QTextStream &s )
-{
- s.reset();
- return s;
-}
-
-
-/*!
- \class QTextIStream qtextstream.h
- \brief A convenience class for input streams.
-
- For simple tasks, code should be simple. Hence this
- class is a shorthand to avoid passing the \e mode argument
- to the normal QTextStream constructors.
-
- This makes it easy for example, to write things like this:
-\code
- QString data = "123 456";
- int a, b;
- QTextIStream(&data) >> a >> b;
-\endcode
-
- \sa QTextOStream
-*/
-
-/*!
- \fn QTextIStream::QTextIStream( QString *s )
-
- Constructs a stream to read from string \a s.
-*/
-/*!
- \fn QTextIStream::QTextIStream( QByteArray ba )
-
- Constructs a stream to read from the array \a ba.
-*/
-/*!
- \fn QTextIStream::QTextIStream( FILE *f )
-
- Constructs a stream to read from the file \a f.
-*/
-
-
-/*!
- \class QTextOStream qtextstream.h
- \brief A convenience class for output streams.
-
- For simple tasks, code should be simple. Hence this
- class is a shorthand to avoid passing the \e mode argument
- to the normal QTextStream constructors.
-
- This makes it easy for example, to write things like this:
-\code
- QString result;
- QTextOStream(&result) << "pi = " << 3.14;
-\endcode
-*/
-
-/*!
- \fn QTextOStream::QTextOStream( QString *s )
-
- Constructs a stream to write to string \a s.
-*/
-/*!
- \fn QTextOStream::QTextOStream( QByteArray ba )
-
- Constructs a stream to write to the array \a ba.
-*/
-/*!
- \fn QTextOStream::QTextOStream( FILE *f )
-
- Constructs a stream to write to the file \a f.
-*/
-
-
-
-/*!
- Sets the encoding of this stream to \a e, where \a e is one of:
- <ul>
- <li> \c Locale Using local file format (Latin1 if locale is not
- set), but autodetecting Unicode(utf16) on input.
- <li> \c Unicode Using Unicode(utf16) for input and output. Output
- will be written in the order most efficient for the current platform
- (i.e. the order used internally in QString).
- <li> \c UnicodeUTF8 Using Unicode(utf8) for input and output. If you use it
- for input it will autodetect utf16 and use it instead of utf8.
- <li> \c Latin1 ISO-8859-1. Will not autodetect utf16.
- <li> \c UnicodeNetworkOrder Using network order Unicode(utf16) for
- input and output. Useful when reading Unicode data that does not
- start with the byte order marker.
- <li> \c UnicodeReverse Using reverse network order Unicode(utf16)
- for input and output. Useful when reading Unicode data that does not
- start with the byte order marker, or writing data that should be
- read by buggy Windows applications.
- <li> \c RawUnicode Like Unicode, but does not write the byte order
- marker, nor does it autodetect the byte order. Only useful when
- writing to non-persistent storage used by a single process.
- </ul>
-
- \c Locale and all Unicode encodings, except \c RawUnicode, will look at
- the first two bytes in a input stream to determine the byte order. The
- initial byte order marker will be stripped off before data is read.
-
- Note that this function should be called before any data is read
- to/written from the stream.
- \sa setCodec()
-*/
-
-void QTextStream::setEncoding( Encoding e )
-{
- if ( d->sourceType == QTextStreamPrivate::String )
- return; // QString does not need any encoding
- switch ( e ) {
- case Unicode:
- mapper = 0;
- latin1 = FALSE;
- doUnicodeHeader = TRUE;
- internalOrder = TRUE;
- break;
- case UnicodeUTF8:
-#ifndef QT_NO_CODECS
- mapper = QTextCodec::codecForMib( 106 );
- latin1 = FALSE;
- doUnicodeHeader = TRUE;
- internalOrder = TRUE;
-#else
- mapper = 0;
- latin1 = TRUE;
- doUnicodeHeader = TRUE;
-#endif
- break;
- case UnicodeNetworkOrder:
- mapper = 0;
- latin1 = FALSE;
- doUnicodeHeader = TRUE;
- internalOrder = QChar::networkOrdered();
- break;
- case UnicodeReverse:
- mapper = 0;
- latin1 = FALSE;
- doUnicodeHeader = TRUE;
- internalOrder = !QChar::networkOrdered(); //reverse network ordered
- break;
- case RawUnicode:
- mapper = 0;
- latin1 = FALSE;
- doUnicodeHeader = FALSE;
- internalOrder = TRUE;
- break;
- case Locale:
- latin1 = TRUE; // fallback to Latin 1
-#ifndef QT_NO_TEXTCODEC
- mapper = QTextCodec::codecForLocale();
-#if defined(_OS_WIN32_)
- if ( GetACP() == 1252 )
- mapper = 0; // Optimized latin1 processing
-#endif
- if ( mapper && mapper->mibEnum() == 4 )
-#endif
- mapper = 0; // Optimized latin1 processing
- doUnicodeHeader = TRUE; // If it reads as Unicode, accept it
- break;
- case Latin1:
- mapper = 0;
- doUnicodeHeader = FALSE;
- latin1 = TRUE;
- break;
- }
-}
-
-
-#ifndef QT_NO_TEXTCODEC
-/*! Sets the codec for this stream to \a codec. Will not try to
- autodetect Unicode.
-
- Note that this function should be called before any data is read
- to/written from the stream.
-
- \sa setEncoding()
-*/
-
-void QTextStream::setCodec( QTextCodec *codec )
-{
- if ( d->sourceType == QTextStreamPrivate::String )
- return; // QString does not need any codec
- mapper = codec;
- doUnicodeHeader = FALSE;
-}
-#endif
-
-#endif // QT_NO_TEXTSTREAM
diff --git a/qtools/qtextstream.h b/qtools/qtextstream.h
deleted file mode 100644
index c5f5ba1..0000000
--- a/qtools/qtextstream.h
+++ /dev/null
@@ -1,351 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QTextStream class
-**
-** Created : 940922
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QTEXTSTREAM_H
-#define QTEXTSTREAM_H
-
-#ifndef QT_H
-#include "qiodevice.h"
-#include "qstring.h"
-#include <stdio.h>
-#endif // QT_H
-
-#ifndef QT_NO_TEXTSTREAM
-class QTextCodec;
-class QTextDecoder;
-
-class QTextStreamPrivate;
-
-class Q_EXPORT QTextStream // text stream class
-{
-public:
- enum Encoding { Locale, Latin1, Unicode, UnicodeNetworkOrder,
- UnicodeReverse, RawUnicode, UnicodeUTF8 };
-
- void setEncoding( Encoding );
-#ifndef QT_NO_TEXTCODEC
- void setCodec( QTextCodec* );
-#endif
-
- // Encoding encoding() const { return cmode; }
-
- QTextStream();
- QTextStream( QIODevice * );
- QTextStream( QString*, int mode );
- QTextStream( QString&, int mode ); // obsolete
- QTextStream( QByteArray, int mode );
- QTextStream( FILE *, int mode );
- virtual ~QTextStream();
-
- QIODevice *device() const;
- void setDevice( QIODevice * );
- void unsetDevice();
-
- bool atEnd() const;
- bool eof() const;
-
- QTextStream &operator>>( QChar & );
- QTextStream &operator>>( char & );
- QTextStream &operator>>( signed short & );
- QTextStream &operator>>( unsigned short & );
- QTextStream &operator>>( signed int & );
- QTextStream &operator>>( unsigned int & );
- QTextStream &operator>>( signed long & );
- QTextStream &operator>>( unsigned long & );
- QTextStream &operator>>( float & );
- QTextStream &operator>>( double & );
- QTextStream &operator>>( char * );
- QTextStream &operator>>( QString & );
- QTextStream &operator>>( QCString & );
-
- QTextStream &operator<<( QChar );
- QTextStream &operator<<( char );
- QTextStream &operator<<( signed short );
- QTextStream &operator<<( unsigned short );
- QTextStream &operator<<( signed int );
- QTextStream &operator<<( unsigned int );
- QTextStream &operator<<( signed long );
- QTextStream &operator<<( unsigned long );
- QTextStream &operator<<( float );
- QTextStream &operator<<( double );
- QTextStream &operator<<( const char* );
- QTextStream &operator<<( const QString & );
- QTextStream &operator<<( const QCString & );
- QTextStream &operator<<( void * ); // any pointer
-
- QTextStream &readRawBytes( char *, uint len );
- QTextStream &writeRawBytes( const char* , uint len );
-
- QString readLine();
- QString read();
- void skipWhiteSpace();
-
- enum {
- skipws = 0x0001, // skip whitespace on input
- left = 0x0002, // left-adjust output
- right = 0x0004, // right-adjust output
- internal = 0x0008, // pad after sign
- bin = 0x0010, // binary format integer
- oct = 0x0020, // octal format integer
- dec = 0x0040, // decimal format integer
- hex = 0x0080, // hex format integer
- showbase = 0x0100, // show base indicator
- showpoint = 0x0200, // force decimal point (float)
- uppercase = 0x0400, // upper-case hex output
- showpos = 0x0800, // add '+' to positive integers
- scientific= 0x1000, // scientific float output
- fixed = 0x2000 // fixed float output
- };
-
- static const int basefield; // bin | oct | dec | hex
- static const int adjustfield; // left | right | internal
- static const int floatfield; // scientific | fixed
-
- int flags() const;
- int flags( int f );
- int setf( int bits );
- int setf( int bits, int mask );
- int unsetf( int bits );
-
- void reset();
-
- int width() const;
- int width( int );
- int fill() const;
- int fill( int );
- int precision() const;
- int precision( int );
-
-private:
- long input_int();
- void init();
- QTextStream &output_int( int, ulong, bool );
- QIODevice *dev;
- bool isNetworkOrder() { return internalOrder == QChar::networkOrdered(); }
-
- int fflags;
- int fwidth;
- int fillchar;
- int fprec;
- bool fstrm;
- bool owndev;
- QTextCodec *mapper;
- QTextStreamPrivate * d;
- QChar ungetcBuf;
- bool latin1;
- bool internalOrder;
- bool doUnicodeHeader;
- void *reserved_ptr;
-
- QChar eat_ws();
- void ts_ungetc( QChar );
- QChar ts_getc();
- uint ts_getbuf( QChar*, uint );
- void ts_putc(int);
- void ts_putc(QChar);
- bool ts_isspace(QChar);
- bool ts_isdigit(QChar);
- ulong input_bin();
- ulong input_oct();
- ulong input_dec();
- ulong input_hex();
- double input_double();
- QTextStream &writeBlock( const char* p, uint len );
- QTextStream &writeBlock( const QChar* p, uint len );
-
-private: // Disabled copy constructor and operator=
-#if defined(Q_DISABLE_COPY)
- QTextStream( const QTextStream & );
- QTextStream &operator=( const QTextStream & );
-#endif
-};
-
-typedef QTextStream QTS;
-
-class Q_EXPORT QTextIStream : public QTextStream {
-public:
- QTextIStream( QString* s ) :
- QTextStream(s,IO_ReadOnly) { }
- QTextIStream( QByteArray ba ) :
- QTextStream(ba,IO_ReadOnly) { }
- QTextIStream( FILE *f ) :
- QTextStream(f,IO_ReadOnly) { }
-};
-
-class Q_EXPORT QTextOStream : public QTextStream {
-public:
- QTextOStream( QString* s ) :
- QTextStream(s,IO_WriteOnly) { }
- QTextOStream( QByteArray ba ) :
- QTextStream(ba,IO_WriteOnly) { }
- QTextOStream( FILE *f ) :
- QTextStream(f,IO_WriteOnly) { }
-};
-
-/*****************************************************************************
- QTextStream inline functions
- *****************************************************************************/
-
-inline QIODevice *QTextStream::device() const
-{ return dev; }
-
-inline bool QTextStream::atEnd() const
-{ return dev ? dev->atEnd() : FALSE; }
-
-inline bool QTextStream::eof() const
-{ return atEnd(); }
-
-inline int QTextStream::flags() const
-{ return fflags; }
-
-inline int QTextStream::flags( int f )
-{ int oldf = fflags; fflags = f; return oldf; }
-
-inline int QTextStream::setf( int bits )
-{ int oldf = fflags; fflags |= bits; return oldf; }
-
-inline int QTextStream::setf( int bits, int mask )
-{ int oldf = fflags; fflags = (fflags & ~mask) | (bits & mask); return oldf; }
-
-inline int QTextStream::unsetf( int bits )
-{ int oldf = fflags; fflags &= ~bits; return oldf; }
-
-inline int QTextStream::width() const
-{ return fwidth; }
-
-inline int QTextStream::width( int w )
-{ int oldw = fwidth; fwidth = w; return oldw; }
-
-inline int QTextStream::fill() const
-{ return fillchar; }
-
-inline int QTextStream::fill( int f )
-{ int oldc = fillchar; fillchar = f; return oldc; }
-
-inline int QTextStream::precision() const
-{ return fprec; }
-
-inline int QTextStream::precision( int p )
-{ int oldp = fprec; fprec = p; return oldp; }
-
-/*!
- Returns one character from the stream, or EOF.
-*/
-inline QChar QTextStream::ts_getc()
-{ QChar r; return ( ts_getbuf( &r,1 ) == 1 ? r : QChar((ushort)0xffff) ); }
-
-/*****************************************************************************
- QTextStream manipulators
- *****************************************************************************/
-
-typedef QTextStream & (*QTSFUNC)(QTextStream &);// manipulator function
-typedef int (QTextStream::*QTSMFI)(int); // manipulator w/int argument
-
-class Q_EXPORT QTSManip { // text stream manipulator
-public:
- QTSManip( QTSMFI m, int a ) { mf=m; arg=a; }
- void exec( QTextStream &s ) { (s.*mf)(arg); }
-private:
- QTSMFI mf; // QTextStream member function
- int arg; // member function argument
-};
-
-Q_EXPORT inline QTextStream &operator>>( QTextStream &s, QTSFUNC f )
-{ return (*f)( s ); }
-
-Q_EXPORT inline QTextStream &operator<<( QTextStream &s, QTSFUNC f )
-{ return (*f)( s ); }
-
-Q_EXPORT inline QTextStream &operator<<( QTextStream &s, QTSManip m )
-{ m.exec(s); return s; }
-
-Q_EXPORT QTextStream &bin( QTextStream &s ); // set bin notation
-Q_EXPORT QTextStream &oct( QTextStream &s ); // set oct notation
-Q_EXPORT QTextStream &dec( QTextStream &s ); // set dec notation
-Q_EXPORT QTextStream &hex( QTextStream &s ); // set hex notation
-Q_EXPORT QTextStream &endl( QTextStream &s ); // insert EOL ('\n')
-Q_EXPORT QTextStream &flush( QTextStream &s ); // flush output
-Q_EXPORT QTextStream &ws( QTextStream &s ); // eat whitespace on input
-Q_EXPORT QTextStream &reset( QTextStream &s ); // set default flags
-
-Q_EXPORT inline QTSManip qSetW( int w )
-{
- QTSMFI func = &QTextStream::width;
- return QTSManip(func,w);
-}
-
-Q_EXPORT inline QTSManip qSetFill( int f )
-{
- QTSMFI func = &QTextStream::fill;
- return QTSManip(func,f);
-}
-
-Q_EXPORT inline QTSManip qSetPrecision( int p )
-{
- QTSMFI func = &QTextStream::precision;
- return QTSManip(func,p);
-}
-
-
-#ifndef QT_ALTERNATE_QTSMANIP
-
-// These will go away in Qt 3.0, as they conflict with std libs
-//
-// If you get conflicts now, #define QT_ALTERNATE_QTSMANIP before
-// including this file.
-
-Q_EXPORT inline QTSManip setw( int w )
-{
- QTSMFI func = &QTextStream::width;
- return QTSManip(func,w);
-}
-
-Q_EXPORT inline QTSManip setfill( int f )
-{
- QTSMFI func = &QTextStream::fill;
- return QTSManip(func,f);
-}
-
-Q_EXPORT inline QTSManip setprecision( int p )
-{
- QTSMFI func = &QTextStream::precision;
- return QTSManip(func,p);
-}
-#endif
-
-#endif // QT_NO_TEXTSTREAM
-#endif // QTEXTSTREAM_H
diff --git a/qtools/qtl.doc b/qtools/qtl.doc
deleted file mode 100644
index 8ce89bd..0000000
--- a/qtools/qtl.doc
+++ /dev/null
@@ -1,249 +0,0 @@
-/****************************************************************************
-**
-**
-** Qt template library classes documentation
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-/*!
-\page qtl.html
-
-\title Qt Template library
-
-The Qt Template Library is a set of templates within Qt dealing with
-containers of objects. It provides a list of objects, a stack of
-objects, a map (or dictionary) from one type to another, and
-associated iterators and algorithms.
-
-Qt also contains similar classes that deal with pointers to objects;
-\l QValueList vs. \l QList, etc. Compared to the pointer-based
-templates, the QTL offers easy copying of the container, real support
-for classes that e.g. require constructors, expand to much more object
-code, can often be a bit faster, require that the objects stored can
-be copied, and finally, have a worse record of compiler problems.
-
-Compared to the STL, the QTL contains only the most important features
-of the STL, has more regular function naming, has no platform
-differences, is often a little slower and often expands to less object
-code.
-
-
-If you can not make copies of the objects you want to store you are
-better off with QCollection and friends. They were designed to handle
-exactly that kind of pointer semantics. This applies for example to
-all classes derived from \l QObject. A QObject does not have a copy
-constructor, so using it as value is impossible. You may choose be
-store pointers to QObjects in a QValueList, but using QList directly
-seems to be the better choice for this kind of application
-domain. QList, like all other QCollection based containers, provides
-far more sanity checking than a speed-optimized value
-based container.
-
-If you have objects that implement value semantics, use the Qt
-template library. Value semantics require at least
-<ul>
-<li>a copy constructor,
-<li>an assignment operator and
-<li> a default constructor, i.e. a constructor that does not take
-any arguments.
-</ul>
-Note that a fast copy constructor is absolutely crucial for a good
-overall performance of the container, since many copy operations are
-going to happen.
-
-Examples for value based classes are QRect, QPoint, QSize and all
-simple C++ types like int, bool or double.
-
-The Qt template library is designed for speed. Especially iterators
-are extremely fast. On the drawback side, less error checking is done
-than in the QCollection based containers. A template library container
-for example does not track associated iterators. This makes certain
-validity checks, like on removing items, impossible to perform
-automatically.
-
-<h2> Iterators </h2>
-
-The Qt template library deals with value objects, not with pointers.
-For that reason, there is no other way of iterating over containers
-than using iterators. This is no disadvantage as the size of an
-iterator matches the size of a normal pointer - 32 or 64 bits
-depending on your CPU architecture.
-
-To iterate over a container, use a loop like this:
-
-\code
- typedef QValueList<int> List;
- List l;
- for( List::Iterator it = l.begin(); it != l.end(); ++it )
- printf("Number is %i\n",*it);
-\endcode
-
-begin() returns the iterator pointing at the first element, while
-end() returns an iterator that points \e after the last
-element. end() marks an invalid position, it can never be
-dereferenced. It's the break condition in any iteration, may it be
-from begin() or fromLast(). For maximum speed, use increment or
-decrement iterators with the prefix operator (++it, --it) instead of the
-postfix one (it++, it--), since the former is slightly faster.
-
-The same concept applies to the other container classes:
-
-\code
- typedef QMap<QString,QString> Map;
- Map map;
- for( Map::Iterator it = map.begin(); it != map.end(); ++it )
- printf("Key=%s Data=%s\n", it.key().ascii(), it.data().ascii() );
-
- typedef QArray<int> Array;
- Array array;
- for( Array::Iterator it = array.begin(); it != array.end(); ++it )
- printf("Data=%i\n", *it );
-\endcode
-
-There are two kind of iterators, the volatile iterator shown in the
-examples above and a version that returns a const reference to its
-current object, the ConstIterator. Const iterators are required
-whenever the container itself is const, such as a member variable
-inside a const function. Assigning a ConstIterator to a normal
-Iterator is not allowed as it would violate const semantics.
-
-<h2> Algorithms </h2>
-
-The template library defines a number of algorithms that operate on
-its containers: qHeapSort(), qBubbleSort(), qSwap() and
-qCopy(). These algorithms are implemented as template functions.
-
-qHeapSort() and qBubbleSort() provide the well known sorting
-algorithms. You can use them like this:
-
-\code
- typedef QValueList<int> List;
- List l;
- l << 42 << 100 << 1234 << 12 << 8;
- qHeapSort( l );
-
- List l2;
- l2 << 42 << 100 << 1234 << 12 << 8;
- List::Iterator b = l2.find( 100 );
- List::Iterator e = l2.find( 8 );
- qHeapSort( b, e );
-
- double arr[] = { 3.2, 5.6, 8.9 };
- qHeapSort( arr, arr + 3 );
-\endcode
-
-The first example sorts the entire list. The second one sorts all
-elements enclosed in the two iterators, namely 100, 1234 and 12. The
-third example shows that iterators act like pointers and can be
-treated as such.
-
-Naturally, the sorting templates won't work with const iterators.
-
-Another utility is qSwap(). It exchanges the values of two variables:
-
-\code
- QString second( "Einstein" );
- QString name( "Albert" );
- qSwap( second, name );
-\endcode
-
-Another template function is qCopy(). It copies a container or a slice
-of it to an OutputIterator, in this case a QTextOStreamIterator:
-
-\code
- typedef QValueList<int> List;
- List l;
- l << 100 << 200 << 300;
- QTextOStream str( stdout );
- qCopy( l, QTextOStreamIterator( str ) );
-\endcode
-
-In addition, you can use any Qt template library iterator as the
-OutputIterator. Just make sure that the right hand of the iterator has
-as many elements present as you want to insert. The following example
-illustrates this:
-
-\code
- QStringList l1, l2;
- l1 << "Weis" << "Ettrich" << "Arnt" << "Sue";
- l2 << "Torben" << "Matthias";
- qCopy( l2, l1.begin();
-\endcode
-
-At the end of this code fragment, the List l1 contains "Torben",
-"Matthias", "Arnt" and "Sue", with the prior contents being
-overwritten. Another flavor of qCopy() takes three arguments to make
-it possible to copy a slice of a container:
-
-\code
- typedef QValueList<int> List;
- List l;
- l << 42 << 100 << 1234 << 12 << 8;
- List::Iterator b = l.find( 100 );
- List::Iterator e = l.find( 8 );
- QTextOStream str( stdout );
- qCopy( b, e, QTextOStreamIterator( str ) );
-\endcode
-
-If you write new algorithms, consider writing them as template
-functions in order to make them usable with as many containers
-possible. In the above example, you could just as easily print out a
-standard C++ array with qCopy():
-
-\code
- int arr[] = { 100, 200, 300 };
- QTextOStream str( stdout );
- qCopy( arr, arr + 3, QTextOStreamIterator( str ) );
-\endcode
-
-
-<h2> Streaming </h2>
-
-All mentioned containers can be serialized with the respective
-streaming operators. Here is an example.
-
-\code
- QDataStream str(...);
- QValueList<QRect> l;
- // ... fill the list here
- str << l;
-\endcode
-
-The container can be read in again with:
-
-\code
- QValueList<QRect> l;
- str >> l;
-\endcode
-
-The same applies to QStringList, QValueStack and QMap.
-
-*/
diff --git a/qtools/qtl.h b/qtools/qtl.h
deleted file mode 100644
index bd72e7d..0000000
--- a/qtools/qtl.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of Qt template library classes
-**
-** Created : 990128
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-#ifndef QTL_H
-#define QTL_H
-
-#ifndef QT_H
-#include "qtextstream.h"
-#include "qstring.h"
-#endif // QT_H
-
-#ifndef QT_NO_TEXTSTREAM
-template <class T>
-class QTextOStreamIterator
-{
-protected:
- QTextOStream& stream;
- QString separator;
-
-public:
- QTextOStreamIterator( QTextOStream& s) : stream( s ) {}
- QTextOStreamIterator( QTextOStream& s, const QString& sep )
- : stream( s ), separator( sep ) {}
- QTextOStreamIterator<T>& operator= ( const T& x ) {
- stream << x;
- if ( !separator.isEmpty() )
- stream << separator;
- return *this;
- }
- QTextOStreamIterator<T>& operator*() { return *this; }
- QTextOStreamIterator<T>& operator++() { return *this; }
- QTextOStreamIterator<T>& operator++(int) { return *this; }
-};
-#endif //QT_NO_TEXTSTREAM
-
-template <class InputIterator, class OutputIterator>
-inline OutputIterator qCopy( InputIterator _begin, InputIterator _end,
- OutputIterator _dest )
-{
- while( _begin != _end )
- *_dest++ = *_begin++;
- return _dest;
-}
-
-
-template <class T>
-inline void qSwap( T& _value1, T& _value2 )
-{
- T tmp = _value1;
- _value1 = _value2;
- _value2 = tmp;
-}
-
-
-template <class InputIterator>
-inline void qBubbleSort( InputIterator b, InputIterator e )
-{
- // Goto last element;
- InputIterator last = e;
- --last;
- // only one element or no elements ?
- if ( last == b )
- return;
-
- // So we have at least two elements in here
- while( b != last ) {
- bool swapped = FALSE;
- InputIterator swap_pos = b;
- InputIterator x = e;
- InputIterator y = x;
- y--;
- do {
- --x;
- --y;
- if ( *x < *y ) {
- swapped = TRUE;
- qSwap( *x, *y );
- swap_pos = y;
- }
- } while( y != b );
- if ( !swapped )
- return;
- b = swap_pos;
- b++;
- }
-}
-
-
-template <class Container>
-inline void qBubbleSort( Container &c )
-{
- qBubbleSort( c.begin(), c.end() );
-}
-
-
-template <class Value>
-inline void qHeapSortPushDown( Value* heap, int first, int last )
-{
- int r = first;
- while( r <= last/2 ) {
- // Node r has only one child ?
- if ( last == 2*r ) {
- // Need for swapping ?
- if ( heap[r] > heap[ 2*r ] )
- qSwap( heap[r], heap[ 2*r ] );
- // That's it ...
- r = last;
- } else { // Node has two children
- if ( heap[r] > heap[ 2*r ] && heap[ 2*r ] <= heap[ 2*r+1 ] ) {
- // Swap with left child
- qSwap( heap[r], heap[ 2*r ] );
- r *= 2;
- } else if ( heap[r] > heap[ 2*r+1 ] &&
- heap[ 2*r+1 ] < heap[ 2*r ] ) {
- // Swap with right child
- qSwap( heap[r], heap[ 2*r+1 ] );
- r = 2*r+1;
- } else {
- // We are done
- r = last;
- }
- }
- }
-}
-
-
-template <class InputIterator, class Value>
-inline void qHeapSortHelper( InputIterator b, InputIterator e, Value, uint n )
-{
- // Create the heap
- InputIterator insert = b;
- Value* realheap = new Value[ n ];
- // Wow, what a fake. But I want the heap to be indexed as 1...n
- Value* heap = realheap - 1;
- int size = 0;
- for( ; insert != e; ++insert ) {
- heap[++size] = *insert;
- int i = size;
- while( i > 1 && heap[i] < heap[ i / 2 ] ) {
- qSwap( heap[i], heap[ i / 2 ] );
- i /= 2;
- }
- }
-
- // Now do the sorting
- for( uint i = n; i > 0; i-- ) {
- *b++ = heap[1];
- if ( i > 1 ) {
- heap[1] = heap[i];
- qHeapSortPushDown( heap, 1, (int)i - 1 );
- }
- }
-
- delete[] realheap;
-}
-
-
-template <class InputIterator>
-inline void qHeapSort( InputIterator b, InputIterator e )
-{
- // Empty ?
- if ( b == e )
- return;
-
- // How many entries have to be sorted ?
- InputIterator it = b;
- uint n = 0;
- while ( it != e ) {
- ++n;
- ++it;
- }
-
- // The second last parameter is a hack to retrieve the value type
- // Do the real sorting here
- qHeapSortHelper( b, e, *b, n );
-}
-
-
-template <class Container>
-inline void qHeapSort( Container &c )
-{
- if ( c.isEmpty() )
- return;
-
- // The second last parameter is a hack to retrieve the value type
- // Do the real sorting here
- qHeapSortHelper( c.begin(), c.end(), *(c.begin()), c.count() );
-}
-
-#endif
diff --git a/qtools/qutfcodec.cpp b/qtools/qutfcodec.cpp
deleted file mode 100644
index a37e37f..0000000
--- a/qtools/qutfcodec.cpp
+++ /dev/null
@@ -1,276 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QEucCodec class
-**
-** Created : 981015
-**
-** Copyright (C)1998-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#include "qutfcodec.h"
-
-#ifndef QT_NO_TEXTCODEC
-
-int QUtf8Codec::mibEnum() const
-{
- return 106;
-}
-
-QCString QUtf8Codec::fromUnicode(const QString& uc, int& len_in_out) const
-{
- int l = QMIN((int)uc.length(),len_in_out);
- int rlen = l*3+1;
- QCString rstr(rlen);
- uchar* cursor = (uchar*)rstr.data();
- for (int i=0; i<l; i++) {
- QChar ch = uc[i];
- if ( !ch.row() && ch.cell() < 0x80 ) {
- *cursor++ = ch.cell();
- } else {
- uchar b = (ch.row() << 2) | (ch.cell() >> 6);
- if ( ch.row() < 0x08 ) {
- *cursor++ = 0xc0 | b;
- } else {
- *cursor++ = 0xe0 | (ch.row() >> 4);
- *cursor++ = 0x80 | (b&0x3f);
- }
- *cursor++ = 0x80 | (ch.cell()&0x3f);
- }
- }
- len_in_out = (int)(cursor - (uchar*)rstr.data());
- rstr.truncate(len_in_out);
- return rstr;
-}
-
-const char* QUtf8Codec::name() const
-{
- return "UTF-8";
-}
-
-int QUtf8Codec::heuristicContentMatch(const char* chars, int len) const
-{
- int score = 0;
- for (int i=0; i<len; i++) {
- uchar ch = chars[i];
- // No nulls allowed.
- if ( !ch )
- return -1;
- if ( ch < 128 ) {
- // Inconclusive
- score++;
- } else if ( (ch&0xe0) == 0xc0 ) {
- if ( i < len-1 ) {
- uchar c2 = chars[++i];
- if ( (c2&0xc0) != 0x80 )
- return -1;
- score+=3;
- }
- } else if ( (ch&0xf0) == 0xe0 ) {
- if ( i < len-1 ) {
- uchar c2 = chars[++i];
- if ( (c2&0xc0) != 0x80 ) {
- return -1;
-#if 0
- if ( i < len-1 ) {
- uchar c3 = chars[++i];
- if ( (c3&0xc0) != 0x80 )
- return -1;
- score+=3;
- }
-#endif
- }
- score+=2;
- }
- }
- }
- return score;
-}
-
-
-
-
-class QUtf8Decoder : public QTextDecoder {
- ushort uc;
- int need;
-public:
- QUtf8Decoder() : need(0)
- {
- }
-
- QString toUnicode(const char* chars, int len)
- {
- QString result;
- for (int i=0; i<len; i++) {
- uchar ch = chars[i];
- if (need) {
- if ( (ch&0xc0) == 0x80 ) {
- uc = (uc << 6) | (ch & 0x3f);
- need--;
- if ( !need ) {
- result += QChar(uc);
- }
- } else {
- // error
- result += QChar::replacement;
- need = 0;
- }
- } else {
- if ( ch < 128 ) {
- result += QChar(ch);
- } else if ( (ch&0xe0) == 0xc0 ) {
- uc = ch &0x1f;
- need = 1;
- } else if ( (ch&0xf0) == 0xe0 ) {
- uc = ch &0x0f;
- need = 2;
- }
- }
- }
- return result;
- }
-};
-
-QTextDecoder* QUtf8Codec::makeDecoder() const
-{
- return new QUtf8Decoder;
-}
-
-
-
-
-
-
-int QUtf16Codec::mibEnum() const
-{
- return 1000;
-}
-
-const char* QUtf16Codec::name() const
-{
- return "ISO-10646-UCS-2";
-}
-
-int QUtf16Codec::heuristicContentMatch(const char* chars, int len) const
-{
- uchar* uchars = (uchar*)chars;
- if ( len >= 2 && ((uchars[0] == 0xff && uchars[1] == 0xfe) ||
- (uchars[1] == 0xff && uchars[0] == 0xfe)) )
- return len;
- else
- return 0;
-}
-
-
-
-
-class QUtf16Encoder : public QTextEncoder {
- bool headerdone;
-public:
- QUtf16Encoder() : headerdone(FALSE)
- {
- }
-
- QCString fromUnicode(const QString& uc, int& len_in_out)
- {
- if ( headerdone ) {
- len_in_out = uc.length()*(int)sizeof(QChar);
- QCString d(len_in_out);
- memcpy(d.rawData(),uc.unicode(),len_in_out);
- return d;
- } else {
- headerdone = TRUE;
- len_in_out = (1+uc.length())*(int)sizeof(QChar);
- QCString d(len_in_out);
- memcpy(d.rawData(),&QChar::byteOrderMark,sizeof(QChar));
- memcpy(d.rawData()+sizeof(QChar),uc.unicode(),uc.length()*sizeof(QChar));
- return d;
- }
- }
-};
-
-class QUtf16Decoder : public QTextDecoder {
- uchar buf;
- bool half;
- bool swap;
- bool headerdone;
-
-public:
- QUtf16Decoder() : half(FALSE), swap(FALSE), headerdone(FALSE)
- {
- }
-
- QString toUnicode(const char* chars, int len)
- {
- QString r;
-
- while ( len-- ) {
- if ( half ) {
- QChar ch;
- if ( swap ) {
- ch.row() = *chars++;
- ch.cell() = buf;
- } else {
- ch.row() = buf;
- ch.cell() = *chars++;
- }
- if ( !headerdone ) {
- if ( ch == QChar::byteOrderSwapped ) {
- swap = !swap;
- } else if ( ch == QChar::byteOrderMark ) {
- // Ignore ZWNBSP
- } else {
- r += ch;
- }
- headerdone = TRUE;
- } else
- r += ch;
- half = FALSE;
- } else {
- buf = *chars++;
- half = TRUE;
- }
- }
-
- return r;
- }
-};
-
-QTextDecoder* QUtf16Codec::makeDecoder() const
-{
- return new QUtf16Decoder;
-}
-
-QTextEncoder* QUtf16Codec::makeEncoder() const
-{
- return new QUtf16Encoder;
-}
-
-#endif // QT_NO_TEXTCODEC
diff --git a/qtools/qutfcodec.h b/qtools/qutfcodec.h
deleted file mode 100644
index af864be..0000000
--- a/qtools/qutfcodec.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QEucCodec class
-**
-** Created : 981015
-**
-** Copyright (C) 1998-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QUTFCODEC_H
-#define QUTFCODEC_H
-
-#ifndef QT_H
-#include "qtextcodec.h"
-#endif // QT_H
-
-#ifndef QT_NO_TEXTCODEC
-
-class Q_EXPORT QUtf8Codec : public QTextCodec {
-public:
- virtual int mibEnum() const;
- const char* name() const;
-
- QTextDecoder* makeDecoder() const;
-
- QCString fromUnicode(const QString& uc, int& len_in_out) const;
-
- int heuristicContentMatch(const char* chars, int len) const;
-};
-
-class Q_EXPORT QUtf16Codec : public QTextCodec {
-public:
- virtual int mibEnum() const;
- const char* name() const;
-
- QTextDecoder* makeDecoder() const;
- QTextEncoder* makeEncoder() const;
-
- int heuristicContentMatch(const char* chars, int len) const;
-};
-
-#endif //QT_NO_TEXTCODEC
-#endif // QUTFCODEC_H
diff --git a/qtools/qvaluelist.doc b/qtools/qvaluelist.doc
deleted file mode 100644
index 9f34c8e..0000000
--- a/qtools/qvaluelist.doc
+++ /dev/null
@@ -1,772 +0,0 @@
-/****************************************************************************
-**
-**
-** QValueList and QValueListIterator class documentation
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-
-/*****************************************************************************
- QValueList documentation
- *****************************************************************************/
-
-/*!
- \class QValueList qvaluelist.h
- \brief The QValueList class is a value based template class that provides doubly linked lists.
-
- \ingroup qtl
- \ingroup tools
- \ingroup shared
-
- Define a template instance QValueList\<X\> to create a list of values which all
- have the class X. Please notice that QValueList does not store pointers to the
- members of the list. It holds a copy of every member. That is the reason why this
- kind of classes are called "value based" while QList and QDict are "reference based".
-
- Some classes can not be used within a QValueList, for example everything
- derived from QObject and thus all classes that implement widgets.
- Only values can be used in a QValueList. To qualify as a value, the class
- must provide
- <ul>
- <li>a copy constructor,
- <li>an assignment operator and
- <li> a default constructor, i.e. a constructor that does not take any arguments.
- </ul>
-
- Note that C++ defaults to field-by-field assignment operators and
- copy constructors if no explicit version is supplied. In many cases,
- this is sufficient.
-
- Example:
- \code
- #include <qvaluelist.h>
- #include <qstring.h>
- #include <stdio.h>
-
- class Employee
- {
- public:
- Employee(): s(0) {}
- Employee( const QString& name, int salary )
- : n(name), s(salary)
- {}
-
- QString name() const { return n; }
- int salary() const { return s; }
- void setSalary( int salary ) { s = salary; }
- private:
- QString n;
- int s;
- };
-
- void main()
- {
- typedef QValueList<Employee> EmployeeList;
- EmployeeList list; // list of Employee
-
- list.append( Employee("Bill", 50000) );
- list.append( Employee("Steve",80000) );
- list.append( Employee("Ron", 60000) );
-
- Employee joe( "Joe", 50000 );
- list.append( joe );
- joe.setSalary( 4000 );
-
- EmployeeList::Iterator it;
- for( it = list.begin(); it != list.end(); ++it )
- printf( "%s earns %d\n", (*it).name().latin1(), (*it).salary().latin1() );
- }
- \endcode
-
- Program output:
- \code
- Bill earns 50000
- Steve earns 80000
- Ron earns 60000
- Joe earns 50000
- \endcode
-
- As you can see, the latest changes to Joes salary did not affect the value
- in the list because the list created a copy of Joes entry.
-
- There are three ways of finding items in the list. The first one is by using
- the at() function. It returns an iterator. The advantages of
- getting an iterator is that you can now move forward or backward from this
- position by incrementing/decrementing the iterator. To get the amount of
- items in the list call count(). Valid indices are 0..count().
-
- The second way of accessing a list is with operator[]. That means you can address
- it like an array. The return value is a reference to the value stored in the list.
- There exist two versions of this operator. The first one is const and returns a
- const reference to the value. The second on is non const and returns a non const
- reference to the value. It is up to your compiler to choose the correct one.
-
- The third method is to use the functions begin() and end().
- With a simple for loop as shown in the example you can iterate over the complete list.
- It is save to have multiple iterators at the same time. If some member of the list is
- removed then only iterators pointing to the removed member become invalid. Inserting in
- the list does not invalidate any iterator. For convenience the function last() returns
- an iterator for the last and first() for the first element in the list.
-
- In addition you can search items in the list with the find() function. It exists in a const
- and a non const version. It starts searching from the beginning of the list, but another
- flavor of the find() function allows you to specify where searching should start.
- If you just want to know whether a certain item is at least once in the list, then you
- can use the contains() function.
-
- Since QValueList is value based there is no need to care about deleting elements in the
- list. The list holds its own copies and will free them if the corresponding member or
- the list itself is deleted. You can force the list to free all of its item with clear().
-
- QValueList is implicitly shared. That means you can just make copies of the list
- in time O(1). If multiple QValueList instances share the same data and one
- is doing a modification of the lists data then this modifying instance makes a copy
- and modifies its private copy. So it does not affect the other instances.
- From a developers point of view you can think that a QValueList and a copy of this
- list have nothing to do with each other. Developers may only notice that copying is
- very fast. People known to a CPUs MMU architecture will know this pattern as "copy on write".
-
- There exist three functions to insert items in the list. append()
- inserts an item at the end, prepend() inserts at the beginning
- and insert() inserts in front of the position given by an iterator.
-
- Items can be removed from the list in two ways. The first is to pass an iterator to
- the remove(). The other possibility is to pass a value to remove() which will
- delete all members which match this value.
-
- Lists can be sorted with the algorithms provided by the <a
- href="qtl.html">Qt Template Library</a>, for example with
- qHeapSort():
-
- Example:
- \code
- QValueList l;
- l.append( 5 );
- l.append( 8 );
- l.append( 3 );
- l.append( 4 );
- qHeapSort( l );
- \endcode
-
- \sa QValueListIterator
-*/
-
-
-/*!
- \fn QValueList::QValueList()
- Constructs an empty list.
-*/
-
-/*!
- \fn QValueList::QValueList( const QValueList<T>& l )
- Constructs a copy of \e l.
-
- This operation costs O(1) time since QValueList is implicit shared.
- The first instance applying modifications to a shared list will create
- a copy which takes in turn O(n) time. However returning a QValueList from
- a function is very fast.
-*/
-
-/*!
- \fn QValueList::~QValueList()
- Destroys the list. References to the values in the list and all iterators
- of this list become invalidated. Since QValueList is highly tuned for performance
- you won't see warnings if you use invalid iterators,
- because it is impossible for
- an iterator to check whether it is valid or not.
-*/
-
-/*!
- \fn QValueList<T>& QValueList::operator= ( const QValueList<T>& l )
- Assigns \e l to this list and returns a reference to this list.
-
- All iterators of the current list become invalidated by this operation.
- The cost of such an assignment is O(1) since QValueList is implicitly shared.
-*/
-
-/*!
- \fn QValueList<T> QValueList::operator+ ( const QValueList<T>& l ) const
- Creates a new list and fills it with the elements of this list. Then the
- elements of \e l are appended.
-
- Returns the new list.
-*/
-
-/*!
- \fn QValueList<T>& QValueList::operator+= ( const QValueList<T>& l )
- Adds \e list to this list.
-
- Returns a reference to this list.
-*/
-
-/*!
- \fn bool QValueList::operator== ( const QValueList<T>& l ) const
- Compares both lists.
-
- Returns TRUE if both list are equal.
-*/
-
-/*!
- \fn bool QValueList::operator!= ( const QValueList<T>& l ) const
- Compares both lists.
-
- Returns TRUE if both list are unequal.
-*/
-
-/*!
- \fn QValueList<T>& QValueList::operator+= ( const T& x )
- Adds the value \e x to the end of the list.
-
- Returns a reference to the list.
-*/
-
-/*!
- \fn QValueList<T>& QValueList::operator<< ( const T& x )
- Adds the value \e x to the end of the list.
-
- Returns a reference to the list.
-*/
-
-/*!
- \fn const T& QValueList::operator[] ( uint i ) const
- Returns a const reference to the item with index \e i in the list.
- It is up to you to check whether this item really exists. You can do that easily
- with the count() function. However this operator does not check whether \e i
- is in range and will deliver undefined results if it does not exist.
-*/
-
-/*!
- \fn T& QValueList::operator[] ( uint i )
- Returns a reference to the item with index \e i in the list.
- It is up to you to check whether this item really exists. You can do that easily
- with the count() function. However this operator does not check whether \e i
- is in range and will deliver undefined results if it does not exist.
- In contrast to the const operator[] you may manipulate the value returned by this
- operator.
-*/
-
-/*!
- \fn uint QValueList::count() const
- Returns the number of items in the list.
- \sa isEmpty()
-*/
-
-/*!
- \fn bool QValueList::isEmpty() const
- Returns TRUE if the list is empty, i.e. count() == 0. Returns FALSE
- otherwise.
- \sa count()
-*/
-
-/*!
- \fn Iterator QValueList::insert( Iterator it, const T& x )
- Inserts the value \e x in front of the iterator \e it.
-
- Returns an iterator pointing at the inserted item.
-
- \sa append(), prepend()
-*/
-
-/*!
- \fn Iterator QValueList::append( const T& x )
- Inserts the value \e x at the end of the list.
-
- Returns an iterator pointing at the inserted item.
-
- \sa insert(), prepend()
-*/
-
-/*!
- \fn Iterator QValueList::prepend( const T& x )
- Inserts the value \e x at the beginning of the list.
-
- Returns an iterator pointing at the inserted item.
-
- \sa insert(), append()
-*/
-
-/*!
- \fn Iterator QValueList::remove( Iterator it )
- Removes the item at position \e it in the list.
-
- Returns an iterator pointing to the item following the
- removed on or end() if the last item was deleted.
-
- \sa clear()
-*/
-
-/*!
- \fn void QValueList::remove( const T& x )
- Removes all items which have the value \e x.
-
- \sa clear()
-*/
-
-/*!
- \fn void QValueList::clear()
- Removes all items from the list.
-
- \sa remove()
-*/
-
-/*!
- \fn Iterator QValueList::find( const T& x )
- Finds the first occurrence of \e x in the list.
-
- Returns end() if no item did match.
-*/
-
-/*!
- \fn ConstIterator QValueList::find( const T& x ) const
- Finds the first occurrence of \e x in the list.
-
- Returns end() if no item did match.
-*/
-
-/*!
- \fn Iterator QValueList::find( Iterator it, const T& x )
- Finds the first occurrence of \e x in the list starting at
- the position given by \e it.
-
- Returns end() if no item did match.
-*/
-
-/*!
- \fn ConstIterator QValueList::find( ConstIterator it, const T& x ) const
- Finds the first occurrence of \e x in the list starting at
- the position given by \e it.
-
- Returns end() if no item did match.
-*/
-
-/*!
- \fn uint QValueList::contains( const T& x ) const
- Counts and returns the number of occurrences of the value \e x in the list.
-*/
-
-/*!
- \fn int QValueList::findIndex( const T& x ) const
- Returns the first index of the value \e x in the list or -1 if no such value
- can be found in the list.
-*/
-
-/*!
- \fn Iterator QValueList::at( uint i )
- Returns an iterator pointing to the item at position \e i in the list, or
- end() if the index is out of range.
-*/
-
-/*!
- \fn ConstIterator QValueList::at( uint i ) const
- Returns an iterator pointing to the item at position \e i in the list, or
- end() if the index is out of range.
-*/
-
-/*!
- \fn T& QValueList::first()
- Returns a reference to the first item in the list or the item
- referenced by end()
- if no such items exists. Please note that you may not change
- the value the end() Iterator is pointing to.
-
- \sa begin(), last()
-*/
-
-/*!
- \fn const T& QValueList::first() const
- Returns a reference to the first item in the list or the item
- referenced by end() if
- no such items exists.
-
- \sa begin(), last()
-*/
-
-/*!
- \fn Iterator QValueList::fromLast()
- Returns an iterator pointing to the last element in the list or
- end() if no such item exists.
-
- \sa last()
-*/
-
-/*!
- \fn ConstIterator QValueList::fromLast() const
- Returns an iterator pointing to the last element in the list or
- end() if no such item exists.
-
- \sa last()
-*/
-
-/*!
- \fn T& QValueList::last()
- Returns a reference to the last item in the list or the item
- referenced by end() if no
- such item exists. Please note that you may not change
- the value the end() Iterator is pointing to.
-
- \sa end(), first(), fromLast()
-*/
-
-/*!
- \fn const T& QValueList::last() const
- Returns a reference to the last item in the list or the item
- referenced by end() if no such item exists.
-
- \sa end(), first(), fromLast()
-*/
-
-/*!
- \fn Iterator QValueList::begin()
- Returns an iterator pointing to the first element in the list. This
- iterator equals end() if the list is empty;
- \sa first(), end()
-*/
-
-/*!
- \fn ConstIterator QValueList::begin() const
- Returns an iterator pointing to the first element in the list. This
- iterator equals end() if the list is empty;
- \sa first(), end()
-*/
-
-/*!
- \fn Iterator QValueList::end()
- Returns an iterator pointing behind the last element in the list. This
- iterator equals begin() if the list is empty.
-
- \sa last(), begin()
-*/
-
-/*!
- \fn ConstIterator QValueList::end() const
- Returns an iterator pointing behind the last element in the list. This
- iterator equals begin() if the list is empty.
-
- \sa last(), begin()
-*/
-
-/*!
- \fn void QValueList::detach()
- If the list does not share its data with another QValueList instance, then nothing
- happens, otherwise the function creates a new copy of this data and detaches
- from the shared one. This function is called whenever the list is modified.
- The implicit sharing mechanism is implemented this way.
-*/
-
-/*!
- \fn QDataStream& operator>>( QDataStream& s, QValueList<T>& l )
- \relates QValueList
- Reads a list from the stream. The type \e T stored in the list must implement
- the streaming operator, too.
-*/
-
-/*!
- \fn QDataStream& operator<<( QDataStream& s, const QValueList<T>& l )
- \relates QValueList
- Writes a list to the stream. The type \e T stored in the list must implement
- the streaming operator, too.
-*/
-
-/*****************************************************************************
- QValueListIterator documentation
- *****************************************************************************/
-
-/*!
- \class QValueListIterator qvaluelist.h
- \brief The QValueListIterator class provides an iterator for QValueList.
-
- \ingroup qtl
- \ingroup tools
-
- You can not create an iterator by yourself. Instead you have to
- ask a list to give you one. An iterator has only the size of a pointer.
- On 32 bit machines that means 4 bytes otherwise 8 bytes. That makes them
- very fast. In fact they resemble the semantics of pointers as good as possible
- and they are almost as fast as usual pointers.
-
- Example:
- \code
- #include <qvaluelist.h>
- #include <qstring.h>
- #include <stdio.h>
-
- class Employee
- {
- public:
- Employee(): s(0) {}
- Employee( const QString& name, int salary )
- : n(name), s(salary)
- {}
-
- QString name() const { return n; }
- int salary() const { return s; }
- void setSalary( int salary ) { s = salary; }
- private:
- QString n;
- int s;
- };
-
- void main()
- {
- typedef QValueList<Employee> EmployeeList;
- EmployeeList list; // list of Employee
-
- list.append( Employee("Bill", 50000) );
- list.append( Employee("Steve",80000) );
- list.append( Employee("Ron", 60000) );
-
- Employee joe( "Joe", 50000 );
- list.append( joe );
- joe.setSalary( 4000 );
-
- EmployeeList::Iterator it;
- for( it = list.begin(); it != list.end(); ++it )
- printf( "%s earns %d\n", (*it).name().latin1(), (*it).salary() );
- }
- \endcode
-
- Program output:
- \code
- Bill earns 50000
- Steve earns 80000
- Ron earns 60000
- Joe earns 50000
- \endcode
-
- In contrast to QList there are no built in functions in QValueList to
- traverse the list. The only way to do this is to use iterators.
- QValueList is highly optimized for performance and memory usage.
- On the other hand that means that you have to be a bit more careful
- by what you are doing. QValueList does not know about all its iterators
- and the iterators don't even know to which list they belong. That makes
- things fast and slim but a bit dangerous because it is up to you to make
- sure that iterators you are using are still valid. QListIterator will be able
- to give warnings while QValueListIterator may end up in an undefined state.
-
- For every Iterator there is a ConstIterator. When accessing a QValueList
- in a const environment or if the reference or pointer to the list is itself
- const, then you have to use the ConstIterator. Its semantics are the same,
- but it returns only const references to the item it points to.
-
- \sa QValueList, QValueListConstIterator
-*/
-
-/*!
- \fn QValueListIterator::QValueListIterator()
- Creates un uninitialized iterator.
-*/
-
-/*!
- \fn QValueListIterator::QValueListIterator( NodePtr p )
- Internal function.
-*/
-
-/*!
- \fn QValueListIterator::QValueListIterator( const QValueListIterator<T>& it )
- Constructs a copy of the iterator \e it.
-*/
-
-/*!
- \fn QValueListIterator::~QValueListIterator()
- Destroys the iterator.
-*/
-
-/* Unfortunately not with MSVC
- \fn T *QValueListIterator::operator->()
- Pointer operator. Returns a pointer to the current iterator item.
- The great advantage of this operator is that you can treat the
- iterator like a pointer.
-
- Example:
- \code
- QValueList<int>::Iterator it = list.begin();
- for( ; it != end(); ++it )
- it->show();
- \endcode
-*/
-
-/*!
- \fn T& QValueListIterator::operator*()
- Asterisk operator. Returns a reference to the current iterator item.
-*/
-
-/*!
- \fn const T& QValueListIterator::operator*() const
- Asterisk operator. Returns a reference to the current iterator item.
-*/
-
-/*!
- \fn QValueListIterator<T>& QValueListIterator::operator++()
- Prefix ++ makes the succeeding item current and returns
- an iterator pointing to the new current item.
- The iterator can not check whether it reached the end of the list. Incrementing
- the iterator as returned by end() causes undefined results.
-*/
-
-/*!
- \fn QValueListIterator<T> QValueListIterator::operator++(int)
- Postfix ++ makes the succeeding item current and returns
- an iterator pointing to the new current item.
- The iterator can not check whether it reached the end of the list. Incrementing
- the iterator as returned by end() causes undefined results.
-*/
-
-/*!
- \fn QValueListIterator<T>& QValueListIterator::operator--()
- Prefix -- makes the previous item current and returns
- an iterator pointing to the new current item.
- The iterator can not check whether it reached the beginning of the list. Decrementing
- the iterator as returned by begin() causes undefined results.
-*/
-
-/*!
- \fn QValueListIterator<T> QValueListIterator::operator--(int)
- Postfix -- makes the previous item current and returns
- an iterator pointing to the new current item.
- The iterator can not check whether it reached the beginning of the list. Decrementing
- the iterator as returned by begin() causes undefined results.
-*/
-
-/*!
- \fn bool QValueListIterator::operator==( const QValueListIterator<T>& it ) const
- Compares both iterators and returns TRUE if they point to the same item.
-*/
-
-/*!
- \fn bool QValueListIterator::operator!=( const QValueListIterator<T>& it ) const
- Compares both iterators and returns TRUE if they point to different items.
-*/
-
-/*****************************************************************************
- QValueListConstIterator documentation
- *****************************************************************************/
-
-/*!
- \class QValueListConstIterator qvaluelist.h
- \brief The QValueListConstIterator class provides an iterator for QValueList.
-
- \ingroup qtl
- \ingroup tools
-
- In contrast to QValueListIterator this class is used to iterate over a const
- list. It does not allow to modify the values of the list since this would
- break the const semantics.
-
- For more information on QValueList iterators see QValueListIterator.
-
- \sa QValueListIterator, QValueList
-*/
-
-/*!
- \fn QValueListConstIterator::QValueListConstIterator()
- Creates un uninitialized iterator.
-*/
-
-/*!
- \fn QValueListConstIterator::QValueListConstIterator( NodePtr p )
- Internal function.
-*/
-
-/*!
- \fn QValueListConstIterator::QValueListConstIterator( const QValueListConstIterator<T>& it )
- Constructs a copy of the iterator \e it.
-*/
-
-/*!
- \fn QValueListConstIterator::QValueListConstIterator( const QValueListIterator<T>& it )
- Constructs a copy of the iterator \e it.
-*/
-
-/*!
- \fn QValueListConstIterator::~QValueListConstIterator()
- Destroys the iterator.
-*/
-
-/* Unfortunately not with MSVC
- \fn const T *QValueListConstIterator::operator->()
- Pointer operator. Returns a pointer to the current iterator item.
- The great advantage of this operator is that you can treat the
- iterator like a pointer.
-
- Example:
- \code
- QValueList<int>::Iterator it = list.begin();
- for( ; it != end(); ++it )
- it->show();
- \endcode
-*/
-
-/*!
- \fn const T& QValueListConstIterator::operator*() const
- Asterisk operator. Returns a reference to the current iterator item.
-*/
-
-/*!
- \fn QValueListConstIterator<T>& QValueListConstIterator::operator++()
- Prefix ++ makes the succeeding item current and returns
- an iterator pointing to the new current item.
- The iterator can not check whether it reached the end of the list. Incrementing
- the iterator as returned by end() causes undefined results.
-*/
-
-/*!
- \fn QValueListConstIterator<T> QValueListConstIterator::operator++(int)
- Postfix ++ makes the succeeding item current and returns
- an iterator pointing to the new current item.
- The iterator can not check whether it reached the end of the list. Incrementing
- the iterator as returned by end() causes undefined results.
-*/
-
-/*!
- \fn QValueListConstIterator<T>& QValueListConstIterator::operator--()
- Prefix -- makes the previous item current and returns
- an iterator pointing to the new current item.
- The iterator can not check whether it reached the beginning of the list. Decrementing
- the iterator as returned by begin() causes undefined results.
-*/
-
-/*!
- \fn QValueListConstIterator<T> QValueListConstIterator::operator--(int)
- Postfix -- makes the previous item current and returns
- an iterator pointing to the new current item.
- The iterator can not check whether it reached the beginning of the list. Decrementing
- the iterator as returned by begin() causes undefined results.
-*/
-
-/*!
- \fn bool QValueListConstIterator::operator==( const QValueListConstIterator<T>& it ) const
- Compares both iterators and returns TRUE if they point to the same item.
-*/
-
-/*!
- \fn bool QValueListConstIterator::operator!=( const QValueListConstIterator<T>& it ) const
- Compares both iterators and returns TRUE if they point to different items.
-*/
diff --git a/qtools/qvaluelist.h b/qtools/qvaluelist.h
deleted file mode 100644
index 8885bea..0000000
--- a/qtools/qvaluelist.h
+++ /dev/null
@@ -1,455 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QValueList class
-**
-** Created : 990406
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QVALUELIST_H
-#define QVALUELIST_H
-
-#ifndef QT_H
-#include "qshared.h"
-#include "qdatastream.h"
-#endif // QT_H
-
-template <class T>
-class Q_EXPORT QValueListNode
-{
-public:
- QValueListNode( const T& t ) : data( t ) { }
- QValueListNode() { }
-#if defined(Q_TEMPLATEDLL)
- // Workaround MS bug in memory de/allocation in DLL vs. EXE
- virtual ~QValueListNode() { }
-#endif
-
- QValueListNode<T>* next;
- QValueListNode<T>* prev;
- T data;
-};
-
-template<class T>
-class Q_EXPORT QValueListIterator
-{
- public:
- /**
- * Typedefs
- */
- typedef QValueListNode<T>* NodePtr;
-
- /**
- * Variables
- */
- NodePtr node;
-
- /**
- * Functions
- */
- QValueListIterator() : node( 0 ) {}
- QValueListIterator( NodePtr p ) : node( p ) {}
- QValueListIterator( const QValueListIterator<T>& it ) : node( it.node ) {}
- QValueListIterator &operator=(const QValueListIterator &it)
- {
- node = it.node;
- return *this;
- }
-
- bool operator==( const QValueListIterator<T>& it ) const { return node == it.node; }
- bool operator!=( const QValueListIterator<T>& it ) const { return node != it.node; }
- const T& operator*() const { return node->data; }
- T& operator*() { return node->data; }
-
- // Compilers are too dumb to understand this for QValueList<int>
- //T* operator->() const { return &(node->data); }
-
- QValueListIterator<T>& operator++() {
- node = node->next;
- return *this;
- }
-
- QValueListIterator<T> operator++(int) {
- QValueListIterator<T> tmp = *this;
- node = node->next;
- return tmp;
- }
-
- QValueListIterator<T>& operator--() {
- node = node->prev;
- return *this;
- }
-
- QValueListIterator<T> operator--(int) {
- QValueListIterator<T> tmp = *this;
- node = node->prev;
- return tmp;
- }
-};
-
-template<class T>
-class Q_EXPORT QValueListConstIterator
-{
- public:
- /**
- * Typedefs
- */
- typedef QValueListNode<T>* NodePtr;
-
- /**
- * Variables
- */
- NodePtr node;
-
- /**
- * Functions
- */
- QValueListConstIterator() : node( 0 ) {}
- QValueListConstIterator( NodePtr p ) : node( p ) {}
- QValueListConstIterator( const QValueListConstIterator<T>& it ) : node( it.node ) {}
- QValueListConstIterator( const QValueListIterator<T>& it ) : node( it.node ) {}
- QValueListConstIterator &operator=(const QValueListConstIterator &it)
- {
- node = it.node;
- return *this;
- }
-
- bool operator==( const QValueListConstIterator<T>& it ) const { return node == it.node; }
- bool operator!=( const QValueListConstIterator<T>& it ) const { return node != it.node; }
- const T& operator*() const { return node->data; }
-
- // Compilers are too dumb to understand this for QValueList<int>
- //const T* operator->() const { return &(node->data); }
-
- QValueListConstIterator<T>& operator++() {
- node = node->next;
- return *this;
- }
-
- QValueListConstIterator<T> operator++(int) {
- QValueListConstIterator<T> tmp = *this;
- node = node->next;
- return tmp;
- }
-
- QValueListConstIterator<T>& operator--() {
- node = node->prev;
- return *this;
- }
-
- QValueListConstIterator<T> operator--(int) {
- QValueListConstIterator<T> tmp = *this;
- node = node->prev;
- return tmp;
- }
-};
-
-template <class T>
-class Q_EXPORT QValueListPrivate : public QShared
-{
-public:
- /**
- * Typedefs
- */
- typedef QValueListIterator<T> Iterator;
- typedef QValueListConstIterator<T> ConstIterator;
- typedef QValueListNode<T> Node;
- typedef QValueListNode<T>* NodePtr;
-
- /**
- * Functions
- */
- QValueListPrivate() { node = new Node; node->next = node->prev = node; nodes = 0; }
- QValueListPrivate( const QValueListPrivate<T>& _p ) : QShared() {
- node = new Node; node->next = node->prev = node; nodes = 0;
- Iterator b( _p.node->next );
- Iterator e( _p.node );
- Iterator i( node );
- while( b != e )
- insert( i, *b++ );
- }
-
- void derefAndDelete() // ### hack to get around hp-cc brain damage
- {
- if ( deref() )
- delete this;
- }
-
-#if defined(Q_TEMPLATEDLL)
- // Workaround MS bug in memory de/allocation in DLL vs. EXE
- virtual
-#endif
- ~QValueListPrivate() {
- NodePtr p = node->next;
- while( p != node ) {
- NodePtr x = p->next;
- delete p;
- p = x;
- }
- delete node;
- }
-
- Iterator insert( Iterator it, const T& x ) {
- NodePtr p = new Node( x );
- p->next = it.node;
- p->prev = it.node->prev;
- it.node->prev->next = p;
- it.node->prev = p;
- nodes++;
- return p;
- }
-
- Iterator remove( Iterator it ) {
- ASSERT ( it.node != node );
- NodePtr next = it.node->next;
- NodePtr prev = it.node->prev;
- prev->next = next;
- next->prev = prev;
- delete it.node;
- nodes--;
- return Iterator( next );
- }
-
- NodePtr find( NodePtr start, const T& x ) const {
- ConstIterator first( start );
- ConstIterator last( node );
- while( first != last) {
- if ( *first == x )
- return first.node;
- ++first;
- }
- return last.node;
- }
-
- int findIndex( NodePtr start, const T& x ) const {
- ConstIterator first( start );
- ConstIterator last( node );
- int pos = 0;
- while( first != last) {
- if ( *first == x )
- return pos;
- ++first;
- ++pos;
- }
- return -1;
- }
-
- uint contains( const T& x ) const {
- uint result = 0;
- Iterator first = Iterator( node->next );
- Iterator last = Iterator( node );
- while( first != last) {
- if ( *first == x )
- ++result;
- ++first;
- }
- return result;
- }
-
- void remove( const T& x ) {
- Iterator first = Iterator( node->next );
- Iterator last = Iterator( node );
- while( first != last) {
- if ( *first == x )
- first = remove( first );
- else
- ++first;
- }
- }
-
- NodePtr at( uint i ) const {
- ASSERT( i <= nodes );
- NodePtr p = node->next;
- for( uint x = 0; x < i; ++x )
- p = p->next;
- return p;
- }
-
- void clear() {
- nodes = 0;
- NodePtr p = node->next;
- while( p != node ) {
- NodePtr next = p->next;
- delete p;
- p = next;
- }
- node->next = node->prev = node;
- }
-
- NodePtr node;
- uint nodes;
-};
-
-template <class T>
-class Q_EXPORT QValueList
-{
-public:
- /**
- * Typedefs
- */
- typedef QValueListIterator<T> Iterator;
- typedef QValueListConstIterator<T> ConstIterator;
- typedef T ValueType;
-
- /**
- * API
- */
- QValueList() { sh = new QValueListPrivate<T>; }
- QValueList( const QValueList<T>& l ) { sh = l.sh; sh->ref(); }
- ~QValueList() { sh->derefAndDelete(); }
-
- QValueList<T>& operator= ( const QValueList<T>& l )
- {
- l.sh->ref();
- sh->derefAndDelete();
- sh = l.sh;
- return *this;
- }
-
- QValueList<T> operator+ ( const QValueList<T>& l ) const
- {
- QValueList<T> l2( *this );
- for( ConstIterator it = l.begin(); it != l.end(); ++it )
- l2.append( *it );
- return l2;
- }
-
- QValueList<T>& operator+= ( const QValueList<T>& l )
- {
- for( ConstIterator it = l.begin(); it != l.end(); ++it )
- append( *it );
- return *this;
- }
-
- bool operator== ( const QValueList<T>& l ) const
- {
- if ( count() != l.count() )
- return FALSE;
- ConstIterator it2 = begin();
- ConstIterator it = l.begin();
- for( ; it != l.end(); ++it, ++it2 )
- if ( !( *it == *it2 ) )
- return FALSE;
- return TRUE;
- }
-
- bool operator!= ( const QValueList<T>& l ) const { return !( *this == l ); }
-
- Iterator begin() { detach(); return Iterator( sh->node->next ); }
- ConstIterator begin() const { return ConstIterator( sh->node->next ); }
- Iterator end() { detach(); return Iterator( sh->node ); }
- ConstIterator end() const { return ConstIterator( sh->node ); }
- Iterator fromLast() { detach(); return Iterator( sh->node->prev ); }
- ConstIterator fromLast() const { return ConstIterator( sh->node->prev ); }
-
- bool isEmpty() const { return ( sh->nodes == 0 ); }
-
- Iterator insert( Iterator it, const T& x ) { detach(); return sh->insert( it, x ); }
-
- Iterator append( const T& x ) { detach(); return sh->insert( end(), x ); }
- Iterator prepend( const T& x ) { detach(); return sh->insert( begin(), x ); }
-
- Iterator remove( Iterator it ) { detach(); return sh->remove( it ); }
- void remove( const T& x ) { detach(); sh->remove( x ); }
-
- T& first() { detach(); return sh->node->next->data; }
- const T& first() const { return sh->node->next->data; }
- T& last() { detach(); return sh->node->prev->data; }
- const T& last() const { return sh->node->prev->data; }
-
- T& operator[] ( uint i ) { detach(); return sh->at(i)->data; }
- const T& operator[] ( uint i ) const { return sh->at(i)->data; }
- Iterator at( uint i ) { detach(); return Iterator( sh->at(i) ); }
- ConstIterator at( uint i ) const { return ConstIterator( sh->at(i) ); }
- Iterator find ( const T& x ) { detach(); return Iterator( sh->find( sh->node->next, x) ); }
- ConstIterator find ( const T& x ) const { return ConstIterator( sh->find( sh->node->next, x) ); }
- Iterator find ( Iterator it, const T& x ) { detach(); return Iterator( sh->find( it.node, x ) ); }
- ConstIterator find ( ConstIterator it, const T& x ) const { return ConstIterator( sh->find( it.node, x ) ); }
- int findIndex( const T& x ) const { return sh->findIndex( sh->node->next, x) ; }
- uint contains( const T& x ) const { return sh->contains( x ); }
-
- uint count() const { return sh->nodes; }
-
- void clear() { if ( sh->count == 1 ) sh->clear(); else { sh->deref(); sh = new QValueListPrivate<T>; } }
-
-
- QValueList<T>& operator+= ( const T& x )
- {
- append( x );
- return *this;
- }
- QValueList<T>& operator<< ( const T& x )
- {
- append( x );
- return *this;
- }
-
-
-protected:
- /**
- * Helpers
- */
- void detach() { if ( sh->count > 1 ) { sh->deref(); sh = new QValueListPrivate<T>( *sh ); } }
-
- /**
- * Variables
- */
- QValueListPrivate<T>* sh;
-};
-
-#ifndef QT_NO_DATASTREAM
-template<class T>
-inline QDataStream& operator>>( QDataStream& s, QValueList<T>& l )
-{
- l.clear();
- Q_UINT32 c;
- s >> c;
- for( Q_UINT32 i = 0; i < c; ++i )
- {
- T t;
- s >> t;
- l.append( t );
- }
- return s;
-}
-
-template<class T>
-inline QDataStream& operator<<( QDataStream& s, const QValueList<T>& l )
-{
- s << (Q_UINT32)l.count();
- QValueListConstIterator<T> it = l.begin();
- for( ; it != l.end(); ++it )
- s << *it;
- return s;
-}
-#endif // QT_NO_DATASTREAM
-#endif // QVALUELIST_H
diff --git a/qtools/qvaluestack.h b/qtools/qvaluestack.h
deleted file mode 100644
index fe4462a..0000000
--- a/qtools/qvaluestack.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QValueStack class
-**
-** Created : 990925
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the tools module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
-** Agreement provided with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QVALUESTACK_H
-#define QVALUESTACK_H
-
-#ifndef QT_H
-#include "qvaluelist.h"
-#endif // QT_H
-
-
-template<class T>
-class Q_EXPORT QValueStack : public QValueList<T>
-{
-public:
- QValueStack() {}
- ~QValueStack() {}
- void push( const T& d ) { QValueList<T>::append(d); }
- T pop()
- {
- T elem( this->last() );
- if ( !this->isEmpty() )
- this->remove( this->fromLast() );
- return elem;
- }
- T& top() { return this->last(); }
- const T& top() const { return this->last(); }
-};
-
-#endif
diff --git a/qtools/qxml.cpp b/qtools/qxml.cpp
deleted file mode 100644
index b7a68fc..0000000
--- a/qtools/qxml.cpp
+++ /dev/null
@@ -1,6061 +0,0 @@
-/****************************************************************************
-**
-**
-** Implementation of QXmlSimpleReader and related classes.
-**
-** Created : 000518
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the XML module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition licenses may use this
-** file in accordance with the Qt Commercial License Agreement provided
-** with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#define QT_XML_CPP
-#include "qxml.h"
-#include "qtextcodec.h"
-#include "qbuffer.h"
-
-#ifndef QT_NO_XML
-// NOT REVISED
-
-// Error strings for the XML reader
-#define XMLERR_OK "no error occurred"
-#define XMLERR_TAGMISMATCH "tag mismatch"
-#define XMLERR_UNEXPECTEDEOF "unexpected end of file"
-#define XMLERR_FINISHEDPARSINGWHILENOTEOF "parsing is finished but end of file is not reached"
-#define XMLERR_LETTEREXPECTED "letter is expected"
-#define XMLERR_ERRORPARSINGELEMENT "error while parsing element"
-#define XMLERR_ERRORPARSINGPROLOG "error while parsing prolog"
-#define XMLERR_ERRORPARSINGMAINELEMENT "error while parsing main element"
-#define XMLERR_ERRORPARSINGCONTENT "error while parsing content"
-#define XMLERR_ERRORPARSINGNAME "error while parsing name"
-#define XMLERR_ERRORPARSINGNMTOKEN "error while parsing Nmtoken"
-#define XMLERR_ERRORPARSINGATTRIBUTE "error while parsing attribute"
-#define XMLERR_ERRORPARSINGMISC "error while parsing misc"
-#define XMLERR_ERRORPARSINGCHOICE "error while parsing choice or seq"
-#define XMLERR_ERRORBYCONSUMER "error triggered by consumer"
-#define XMLERR_UNEXPECTEDCHARACTER "unexpected character"
-#define XMLERR_EQUALSIGNEXPECTED "expected '=' but not found"
-#define XMLERR_QUOTATIONEXPECTED "expected \" or ' but not found"
-#define XMLERR_ERRORPARSINGREFERENCE "error while parsing reference"
-#define XMLERR_ERRORPARSINGPI "error while parsing processing instruction"
-#define XMLERR_ERRORPARSINGATTLISTDECL "error while parsing attribute list declaration"
-#define XMLERR_ERRORPARSINGATTTYPE "error while parsing attribute type declaration"
-#define XMLERR_ERRORPARSINGATTVALUE "error while parsing attribute value declaration"
-#define XMLERR_ERRORPARSINGELEMENTDECL "error while parsing element declaration"
-#define XMLERR_ERRORPARSINGENTITYDECL "error while parsing entity declaration"
-#define XMLERR_ERRORPARSINGNOTATIONDECL "error while parsing notation declaration"
-#define XMLERR_ERRORPARSINGEXTERNALID "error while parsing external id"
-#define XMLERR_ERRORPARSINGCOMMENT "error while parsing comment"
-#define XMLERR_ERRORPARSINGENTITYVALUE "error while parsing entity value declaration"
-#define XMLERR_CDSECTHEADEREXPECTED "expected the header for a cdata section"
-#define XMLERR_MORETHANONEDOCTYPE "more than one document type definition"
-#define XMLERR_ERRORPARSINGDOCTYPE "error while parsing document type definition"
-#define XMLERR_INVALIDNAMEFORPI "invalid name for processing instruction"
-#define XMLERR_VERSIONEXPECTED "version expected while reading the XML declaration"
-#define XMLERR_EDECLORSDDECLEXPECTED "EDecl or SDDecl expected while reading the XML declaration"
-#define XMLERR_SDDECLEXPECTED "SDDecl expected while reading the XML declaration"
-#define XMLERR_WRONGVALUEFORSDECL "wrong value for standalone declaration"
-#define XMLERR_UNPARSEDENTITYREFERENCE "unparsed entity reference in wrong context"
-#define XMLERR_INTERNALGENERALENTITYINDTD "internal general entity reference not allowed in DTD"
-#define XMLERR_EXTERNALGENERALENTITYINDTD "external parsed general entity reference not allowed in DTD"
-#define XMLERR_EXTERNALGENERALENTITYINAV "external parsed general entity reference not allowed in attribute value"
-
-
-// the constants for the lookup table
-static const signed char cltWS = 0; // white space
-static const signed char cltPer = 1; // %
-static const signed char cltAmp = 2; // &
-static const signed char cltGt = 3; // >
-static const signed char cltLt = 4; // <
-static const signed char cltSlash = 5; // /
-static const signed char cltQm = 6; // ?
-static const signed char cltEm = 7; // !
-static const signed char cltDash = 8; // -
-static const signed char cltCB = 9; // ]
-static const signed char cltOB = 10; // [
-static const signed char cltEq = 11; // =
-static const signed char cltDq = 12; // "
-static const signed char cltSq = 13; // '
-static const signed char cltUnknown = 14;
-
-// character lookup table
-static const signed char charLookupTable[256]={
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x00 - 0x07
- cltUnknown, // 0x08
- cltWS, // 0x09 \t
- cltWS, // 0x0A \n
- cltUnknown, // 0x0B
- cltUnknown, // 0x0C
- cltWS, // 0x0D \r
- cltUnknown, // 0x0E
- cltUnknown, // 0x0F
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x17 - 0x16
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x18 - 0x1F
- cltWS, // 0x20 Space
- cltEm, // 0x21 !
- cltDq, // 0x22 "
- cltUnknown, // 0x23
- cltUnknown, // 0x24
- cltPer, // 0x25 %
- cltAmp, // 0x26 &
- cltSq, // 0x27 '
- cltUnknown, // 0x28
- cltUnknown, // 0x29
- cltUnknown, // 0x2A
- cltUnknown, // 0x2B
- cltUnknown, // 0x2C
- cltDash, // 0x2D -
- cltUnknown, // 0x2E
- cltSlash, // 0x2F /
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x30 - 0x37
- cltUnknown, // 0x38
- cltUnknown, // 0x39
- cltUnknown, // 0x3A
- cltUnknown, // 0x3B
- cltLt, // 0x3C <
- cltEq, // 0x3D =
- cltGt, // 0x3E >
- cltQm, // 0x3F ?
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x40 - 0x47
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x48 - 0x4F
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x50 - 0x57
- cltUnknown, // 0x58
- cltUnknown, // 0x59
- cltUnknown, // 0x5A
- cltOB, // 0x5B [
- cltUnknown, // 0x5C
- cltCB, // 0x5D ]
- cltUnknown, // 0x5E
- cltUnknown, // 0x5F
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x60 - 0x67
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x68 - 0x6F
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x70 - 0x77
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x78 - 0x7F
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x80 - 0x87
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x88 - 0x8F
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x90 - 0x97
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0x98 - 0x9F
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xA0 - 0xA7
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xA8 - 0xAF
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xB0 - 0xB7
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xB8 - 0xBF
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xC0 - 0xC7
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xC8 - 0xCF
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xD0 - 0xD7
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xD8 - 0xDF
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xE0 - 0xE7
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xE8 - 0xEF
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, // 0xF0 - 0xF7
- cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown, cltUnknown // 0xF8 - 0xFF
-};
-
-
-class QXmlNamespaceSupportPrivate
-{
-};
-class QXmlAttributesPrivate
-{
-};
-class QXmlInputSourcePrivate
-{
-};
-class QXmlParseExceptionPrivate
-{
-};
-class QXmlLocatorPrivate
-{
-};
-class QXmlDefaultHandlerPrivate
-{
-};
-
-#if defined(Q_FULL_TEMPLATE_INSTANTIATION)
-bool operator==( const QMap<QString, QString>, const QMap<QString, QString> )
-{
- return FALSE;
-}
-#endif
-
-/*!
- \class QXmlParseException qxml.h
- \brief The QXmlParseException class is used to report errors with the
- QXmlErrorHandler interface.
-
- \module XML
-
- \sa QXmlErrorHandler
-*/
-/*!
- \fn QXmlParseException::QXmlParseException( const QString& name, int c, int l, const QString& p, const QString& s )
-
- Constructs a parse exception with the error string \a name in the column
- \a c and line \a l for the public identifier \a p and the system identifier
- \a s.
-*/
-/*!
- Returns the error message.
-*/
-QString QXmlParseException::message() const
-{
- return msg;
-}
-/*!
- Returns the column number the error occurred.
-*/
-int QXmlParseException::columnNumber() const
-{
- return column;
-}
-/*!
- Returns the line number the error occurred.
-*/
-int QXmlParseException::lineNumber() const
-{
- return line;
-}
-/*!
- Returns the public identifier the error occurred.
-*/
-QString QXmlParseException::publicId() const
-{
- return pub;
-}
-/*!
- Returns the system identifier the error occurred.
-*/
-QString QXmlParseException::systemId() const
-{
- return sys;
-}
-
-
-/*!
- \class QXmlLocator qxml.h
- \brief The QXmlLocator class provides the XML handler classes with
- information about the actual parsing position.
-
- \module XML
-
- The reader reports a QXmlLocator to the content handler before he starts to
- parse the document. This is done with the
- QXmlContentHandler::setDocumentLocator() function. The handler classes can
- now use this locator to get the actual position the reader is at.
-*/
-/*!
- \fn QXmlLocator::QXmlLocator( QXmlSimpleReader* parent )
-
- Constructor.
-*/
-/*!
- \fn QXmlLocator::~QXmlLocator()
-
- Destructor.
-*/
-/*!
- Gets the column number (starting with 1) or -1 if there is no column number
- available.
-*/
-int QXmlLocator::columnNumber()
-{
- return ( reader->columnNr == -1 ? -1 : reader->columnNr + 1 );
-}
-/*!
- Gets the line number (starting with 1) or -1 if there is no line number
- available.
-*/
-int QXmlLocator::lineNumber()
-{
- return ( reader->lineNr == -1 ? -1 : reader->lineNr + 1 );
-}
-
-
-/*********************************************
- *
- * QXmlNamespaceSupport
- *
- *********************************************/
-
-/*!
- \class QXmlNamespaceSupport qxml.h
- \brief The QXmlNamespaceSupport class is a helper class for XML readers which
- want to include namespace support.
-
- \module XML
-
- It provides some functions that makes it easy to handle namespaces. Its main
- use is for subclasses of QXmlReader which want to provide namespace
- support.
-
- See also the <a href="xml-sax.html#namespaces">namespace description</a>.
-*/
-
-/*!
- Constructs a QXmlNamespaceSupport.
-*/
-QXmlNamespaceSupport::QXmlNamespaceSupport()
-{
- reset();
-}
-
-/*!
- Destructs a QXmlNamespaceSupport.
-*/
-QXmlNamespaceSupport::~QXmlNamespaceSupport()
-{
-}
-
-/*!
- This function declares a prefix in the current namespace context; the prefix
- will remain in force until this context is popped, unless it is shadowed in a
- descendant context.
-
- Note that there is an asymmetry in this library: while prefix() will not
- return the default "" prefix, even if you have declared one; to check for a
- default prefix, you have to look it up explicitly using uri(). This
- asymmetry exists to make it easier to look up prefixes for attribute names,
- where the default prefix is not allowed.
-*/
-void QXmlNamespaceSupport::setPrefix( const QString& pre, const QString& uri )
-{
- if( pre.isNull() ) {
- ns.insert( "", uri );
- } else {
- ns.insert( pre, uri );
- }
-}
-
-/*!
- Returns one of the prefixes mapped to a namespace URI.
-
- If more than one prefix is currently mapped to the same URI, this function
- will make an arbitrary selection; if you want all of the prefixes, use the
- prefixes() function instead.
-
- Note: this will never return the empty (default) prefix; to check for a
- default prefix, use the uri() function with an argument of "".
-*/
-QString QXmlNamespaceSupport::prefix( const QString& uri ) const
-{
- QMap<QString, QString>::ConstIterator itc, it = ns.begin();
- while ( (itc=it) != ns.end() ) {
- ++it;
- if ( itc.data() == uri && !itc.key().isEmpty() )
- return itc.key();
- }
- return "";
-}
-
-/*!
- Looks up a prefix in the current context and returns the currently-mapped
- namespace URI. Use the empty string ("") for the default namespace.
-*/
-QString QXmlNamespaceSupport::uri( const QString& prefix ) const
-{
- const QString& returi = ns[ prefix ];
- return returi;
-}
-
-/*!
- Splits the name at the ':' and returns the prefix and the local name.
-*/
-void QXmlNamespaceSupport::splitName( const QString& qname,
- QString& prefix, QString& localname ) const
-{
- uint pos;
- // search the ':'
- for( pos=0; pos<qname.length(); pos++ ) {
- if ( qname.at(pos) == ':' )
- break;
- }
- // and split
- prefix = qname.left( pos );
- localname = qname.mid( pos+1 );
-}
-
-/*!
- Processes a raw XML 1.0 name in the current context by removing the prefix
- and looking it up among the prefixes currently declared.
-
- First parameter is the raw XML 1.0 name to be processed. The second parameter
- is a flag whether the name is the name of an attribute (TRUE) or not (FALSE).
-
- The return values will be stored in the last two parameters as follows:
- <ul>
- <li> The namespace URI, or an empty string if none is in use.
- <li> The local name (without prefix).
- </ul>
-
- If the raw name has a prefix that has not been declared, then the return
- value will be empty.
-
- Note that attribute names are processed differently than element names: an
- unprefixed element name will received the default namespace (if any), while
- an unprefixed element name will not
-*/
-void QXmlNamespaceSupport::processName( const QString& qname,
- bool isAttribute,
- QString& nsuri, QString& localname ) const
-{
- uint pos;
- // search the ':'
- for( pos=0; pos<qname.length(); pos++ ) {
- if ( qname.at(pos) == ':' )
- break;
- }
- if ( pos < qname.length() ) {
- // there was a ':'
- nsuri = uri( qname.left( pos ) );
- localname = qname.mid( pos+1 );
- } else {
- // there was no ':'
- if ( isAttribute ) {
- nsuri = ""; // attributes don't take default namespace
- } else {
- nsuri = uri( "" ); // get default namespace
- }
- localname = qname;
- }
-}
-
-/*!
- Returns an enumeration of all prefixes currently declared.
-
- Note: if there is a default prefix, it will not be returned in this
- enumeration; check for the default prefix using uri() with an argument
- of "".
-*/
-QStringList QXmlNamespaceSupport::prefixes() const
-{
- QStringList list;
-
- QMap<QString, QString>::ConstIterator itc, it = ns.begin();
- while ( (itc=it) != ns.end() ) {
- ++it;
- if ( !itc.key().isEmpty() )
- list.append( itc.key() );
- }
- return list;
-}
-
-/*!
- Returns a list of all prefixes currently declared for a URI.
-
- The xml: prefix will be included. If you want only one prefix that's
- mapped to the namespace URI, and you don't care which one you get, use the
- prefix() function instead.
-
- Note: the empty (default) prefix is never included in this enumeration; to
- check for the presence of a default namespace, use uri() with an
- argument of "".
-*/
-QStringList QXmlNamespaceSupport::prefixes( const QString& uri ) const
-{
- QStringList list;
-
- QMap<QString, QString>::ConstIterator itc, it = ns.begin();
- while ( (itc=it) != ns.end() ) {
- ++it;
- if ( itc.data() == uri && !itc.key().isEmpty() )
- list.append( itc.key() );
- }
- return list;
-}
-
-/*!
- Starts a new namespace context.
-
- Normally, you should push a new context at the beginning of each XML element:
- the new context will automatically inherit the declarations of its parent
- context, but it will also keep track of which declarations were made within
- this context.
-*/
-void QXmlNamespaceSupport::pushContext()
-{
- nsStack.push( ns );
-}
-
-/*!
- Reverts to the previous namespace context.
-
- Normally, you should pop the context at the end of each XML element. After
- popping the context, all namespace prefix mappings that were previously in
- force are restored.
-*/
-void QXmlNamespaceSupport::popContext()
-{
- if( !nsStack.isEmpty() )
- ns = nsStack.pop();
-}
-
-/*!
- Resets this namespace support object for reuse.
-*/
-void QXmlNamespaceSupport::reset()
-{
- nsStack.clear();
- ns.clear();
- ns.insert( "xml", "http://www.w3.org/XML/1998/namespace" ); // the XML namespace
-}
-
-
-
-/*********************************************
- *
- * QXmlAttributes
- *
- *********************************************/
-
-/*!
- \class QXmlAttributes qxml.h
- \brief The QXmlAttributes class provides XML attributes.
-
- \module XML
-
- If attributes are reported by QXmlContentHandler::startElement() this
- class is used to pass the attribute values. It provides you with different
- functions to access the attribute names and values.
-*/
-/*!
- \fn QXmlAttributes::QXmlAttributes()
-
- Constructs an empty attribute list.
-*/
-/*!
- \fn QXmlAttributes::~QXmlAttributes()
-
- Destructs attributes.
-*/
-
-/*!
- Look up the index of an attribute by an XML 1.0 qualified name.
-
- Returns the index of the attribute (starting with 0) or -1 if it wasn't
- found.
-
- See also the <a href="xml-sax.html#namespaces">namespace description</a>.
-*/
-int QXmlAttributes::index( const QString& qName ) const
-{
- return qnameList.findIndex( qName );
-}
-
-/*!
- Looks up the index of an attribute by a namespace name.
-
- \a uri specifies the namespace URI, or the empty string if the name has no
- namespace URI. \a localPart specifies the attribute's local name.
-
- Returns the index of the attribute (starting with 0) or -1 if it wasn't
- found.
-
- See also the <a href="xml-sax.html#namespaces">namespace description</a>.
-*/
-int QXmlAttributes::index( const QString& uri, const QString& localPart ) const
-{
- uint count = uriList.count();
- for ( uint i=0; i<count; i++ ) {
- if ( uriList[i] == uri && localnameList[i] == localPart )
- return i;
- }
- return -1;
-}
-
-/*!
- Returns the number of attributes in the list.
-*/
-int QXmlAttributes::length() const
-{
- return valueList.count();
-}
-
-/*!
- Looks up an attribute's local name by index (starting with 0).
-
- See also the <a href="xml-sax.html#namespaces">namespace description</a>.
-*/
-QString QXmlAttributes::localName( int index ) const
-{
- return localnameList[index];
-}
-
-/*!
- Looks up an attribute's XML 1.0 qualified name by index (starting with 0).
-
- See also the <a href="xml-sax.html#namespaces">namespace description</a>.
-*/
-QString QXmlAttributes::qName( int index ) const
-{
- return qnameList[index];
-}
-
-/*!
- Looks up an attribute's namespace URI by index (starting with 0).
-
- See also the <a href="xml-sax.html#namespaces">namespace description</a>.
-*/
-QString QXmlAttributes::uri( int index ) const
-{
- return uriList[index];
-}
-
-/*!
- Looks up an attribute's type by index (starting with 0).
-
- At the moment only 'CDATA' is returned.
-*/
-QString QXmlAttributes::type( int ) const
-{
- return "CDATA";
-}
-
-/*!
- Looks up an attribute's type by XML 1.0 qualified name.
-
- At the moment only 'CDATA' is returned.
-*/
-QString QXmlAttributes::type( const QString& ) const
-{
- return "CDATA";
-}
-
-/*!
- Looks up an attribute's type by namespace name.
-
- The first parameter specifies the namespace URI, or the empty string if
- the name has no namespace URI. The second parameter specifies the
- attribute's local name.
-
- At the moment only 'CDATA' is returned.
-*/
-QString QXmlAttributes::type( const QString&, const QString& ) const
-{
- return "CDATA";
-}
-
-/*!
- Looks up an attribute's value by index (starting with 0).
-*/
-QString QXmlAttributes::value( int index ) const
-{
- return valueList[index];
-}
-
-/*!
- Looks up an attribute's value by XML 1.0 qualified name.
-
- See also the <a href="xml-sax.html#namespaces">namespace description</a>.
-*/
-QString QXmlAttributes::value( const QString& qName ) const
-{
- int i = index( qName );
- if ( i == -1 )
- return QString::null;
- return valueList[ i ];
-}
-
-/*!
- Looks up an attribute's value by namespace name.
-
- \a uri specifies the namespace URI, or the empty string if the name has no
- namespace URI. \a localName specifies the attribute's local name.
-
- See also the <a href="xml-sax.html#namespaces">namespace description</a>.
-*/
-QString QXmlAttributes::value( const QString& uri, const QString& localName ) const
-{
- int i = index( uri, localName );
- if ( i == -1 )
- return QString::null;
- return valueList[ i ];
-}
-
-
-/*********************************************
- *
- * QXmlInputSource
- *
- *********************************************/
-
-/*!
- \class QXmlInputSource qxml.h
- \brief The QXmlInputSource class is the source where XML data is read from.
-
- \module XML
-
- All subclasses of QXmlReader read the input from this class.
-*/
-
-/*!
- Returns all the data this input source contains.
-*/
-const QString& QXmlInputSource::data() const
-{
- return input;
-}
-
-/*!
- Constructs a input source which contains no data.
-*/
-QXmlInputSource::QXmlInputSource( )
-{
- input = "";
-}
-
-/*!
- Constructs a input source and get the data from the text stream.
-*/
-QXmlInputSource::QXmlInputSource( QTextStream& stream )
-{
- QByteArray rawData;
- if ( stream.device()->isDirectAccess() ) {
- rawData = stream.device()->readAll();
- } else {
- int nread = 0;
- const int bufsize = 512;
- while ( !stream.device()->atEnd() ) {
- rawData.resize( nread + bufsize );
- nread += stream.device()->readBlock( rawData.data()+nread, bufsize );
- }
- rawData.resize( nread );
- }
- readInput( rawData );
-}
-
-/*!
- Constructs a input source and get the data from a file. If the file cannot be
- read the input source is empty.
-*/
-QXmlInputSource::QXmlInputSource( QFile& file )
-{
- if ( !file.open(IO_ReadOnly) ) {
- input = "";
- return;
- }
- QByteArray rawData = file.readAll();
- readInput( rawData );
- file.close();
-}
-
-/*!
- Destructor.
-*/
-QXmlInputSource::~QXmlInputSource()
-{
-}
-
-/*!
- Sets the data of the input source to \a dat.
-*/
-void QXmlInputSource::setData( const QString& dat )
-{
- input = dat;
-}
-
-/*!
- Read the XML file from the byte array; try to recognize the encoding.
-*/
-// ### The input source should not do the encoding detection!
-void QXmlInputSource::readInput( QByteArray& rawData )
-{
- QBuffer buf( rawData );
- buf.open( IO_ReadOnly );
- QTextStream *stream = new QTextStream( &buf );
- QChar tmp;
- // assume UTF8 or UTF16 at first
- stream->setEncoding( QTextStream::UnicodeUTF8 );
- input = "";
- // read the first 5 characters
- for ( int i=0; i<5; i++ ) {
- *stream >> tmp;
- input += tmp;
- }
- // starts the document with an XML declaration?
- if ( input == "<?xml" ) {
- // read the whole XML declaration
- do {
- *stream >> tmp;
- input += tmp;
- } while( tmp != '>' );
- // and try to find out if there is an encoding
- int pos = input.find( "encoding" );
- if ( pos != -1 ) {
- QString encoding;
- do {
- pos++;
- if ( pos > (int)input.length() )
- goto finished;
- } while( input[pos] != '"' && input[pos] != '\'' );
- pos++;
- while( input[pos] != '"' && input[pos] != '\'' ) {
- encoding += input[pos];
- pos++;
- if ( pos > (int)input.length() )
- goto finished;
- }
- delete stream;
- stream = new QTextStream( &buf );
- stream->setCodec( QTextCodec::codecForName( encoding.utf8() ) );
- buf.reset();
- input = "";
- }
- }
-finished:
- input += stream->read();
- delete stream;
- buf.close();
-}
-
-
-/*********************************************
- *
- * QXmlDefaultHandler
- *
- *********************************************/
-
-/*!
- \class QXmlContentHandler qxml.h
- \brief The QXmlContentHandler class provides an interface to report logical
- content of XML data.
-
- \module XML
-
- If the application needs to be informed of basic parsing events, it
- implements this interface and sets it with QXmlReader::setContentHandler().
- The reader reports basic document-related events like the start and end of
- elements and character data through this interface.
-
- The order of events in this interface is very important, and mirrors the
- order of information in the document itself. For example, all of an element's
- content (character data, processing instructions, and/or subelements) will
- appear, in order, between the startElement() event and the corresponding
- endElement() event.
-
- The class QXmlDefaultHandler gives a default implementation for this
- interface; subclassing from this class is very convenient if you want only be
- informed of some parsing events.
-
- See also the <a href="xml.html#introSAX2">Introduction to SAX2</a>.
-
- \sa QXmlDTDHandler QXmlDeclHandler QXmlEntityResolver QXmlErrorHandler
- QXmlLexicalHandler
-*/
-/*!
- \fn void QXmlContentHandler::setDocumentLocator( QXmlLocator* locator )
-
- The reader calls this function before he starts parsing the document. The
- argument \a locator is a pointer to a QXmlLocator which allows the
- application to get the actual position of the parsing in the document.
-
- Do not destroy the \a locator; it is destroyed when the reader is destroyed
- (do not use the \a locator after the reader got destroyed).
-*/
-/*!
- \fn bool QXmlContentHandler::startDocument()
-
- The reader calls this function when he starts parsing the document.
- The reader will call this function only once before any other functions in
- this class or in the QXmlDTDHandler class are called (except
- QXmlContentHandler::setDocumentLocator()).
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-
- \sa endDocument()
-*/
-/*!
- \fn bool QXmlContentHandler::endDocument()
-
- The reader calls this function after he has finished the parsing. It
- is only called once. It is the last function of all handler functions that is
- called. It is called after the reader has read all input or has abandoned
- parsing because of a fatal error.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-
- \sa startDocument()
-*/
-/*!
- \fn bool QXmlContentHandler::startPrefixMapping( const QString& prefix, const QString& uri )
-
- The reader calls this function to signal the begin of a prefix-URI
- namespace mapping scope. This information is not necessary for normal
- namespace processing since the reader automatically replaces prefixes for
- element and attribute names.
-
- Note that startPrefixMapping and endPrefixMapping calls are not guaranteed to
- be properly nested relative to each-other: all startPrefixMapping events will
- occur before the corresponding startElement event, and all endPrefixMapping
- events will occur after the corresponding endElement event, but their order
- is not otherwise guaranteed.
-
- The argument \a prefix is the namespace prefix being declared and the
- argument \a uri is the namespace URI the prefix is mapped to.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-
- See also the <a href="xml-sax.html#namespaces">namespace description</a>.
-
- \sa endPrefixMapping()
-*/
-/*!
- \fn bool QXmlContentHandler::endPrefixMapping( const QString& prefix )
-
- The reader calls this function to signal the end of a prefix mapping.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-
- See also the <a href="xml-sax.html#namespaces">namespace description</a>.
-
- \sa startPrefixMapping()
-*/
-/*!
- \fn bool QXmlContentHandler::startElement( const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts )
-
- The reader calls this function when he has parsed a start element tag.
-
- There will be a corresponding endElement() call when the corresponding end
- element tag was read. The startElement() and endElement() calls are always
- nested correctly. Empty element tags (e.g. &lt;a/&gt;) are reported by
- startElement() directly followed by a call to endElement().
-
- The attribute list provided will contain only attributes with explicit
- values. The attribute list will contain attributes used for namespace
- declaration (i.e. attributes starting with xmlns) only if the
- namespace-prefix property of the reader is TRUE.
-
- The argument \a uri is the namespace URI, or the empty string if the element
- has no namespace URI or if namespace processing is not being performed, \a
- localName is the local name (without prefix), or the empty string if
- namespace processing is not being performed, \a qName is the qualified name
- (with prefix), or the empty string if qualified names are not available and
- \a atts are the attributes attached to the element. If there are no
- attributes, \a atts is an empty attributes object
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-
- See also the <a href="xml-sax.html#namespaces">namespace description</a>.
-
- \sa endElement()
-*/
-/*!
- \fn bool QXmlContentHandler::endElement( const QString& namespaceURI, const QString& localName, const QString& qName )
-
- The reader calls this function when he has parsed an end element tag.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-
- See also the <a href="xml-sax.html#namespaces">namespace description</a>.
-
- \sa startElement()
-*/
-/*!
- \fn bool QXmlContentHandler::characters( const QString& ch )
-
- The reader calls this function when he has parsed a chunk of character
- data (either normal character data or character data inside a CDATA section;
- if you have to distinguish between those two types you have to use
- QXmlLexicalHandler::startCDATA() and QXmlLexicalHandler::endCDATA() in
- addition).
-
- Some readers will report whitespace in element content using the
- ignorableWhitespace() function rather than this one (QXmlSimpleReader will
- do it not though).
-
- A reader is allowed to report the character data of an element in more than
- one chunk; e.g. a reader might want to report "a &amp;lt; b" in three
- characters() events ("a ", "<" and " b").
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-*/
-/*!
- \fn bool QXmlContentHandler::ignorableWhitespace( const QString& ch )
-
- Some readers may use this function to report each chunk of whitespace in
- element content (QXmlSimpleReader does not though).
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-*/
-/*!
- \fn bool QXmlContentHandler::processingInstruction( const QString& target, const QString& data )
-
- The reader calls this function when he has parsed a processing
- instruction.
-
- \a target is the target name of the processing instruction and \a data is the
- data of the processing instruction.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-*/
-/*!
- \fn bool QXmlContentHandler::skippedEntity( const QString& name )
-
- Some readers may skip entities if they have not seen the declarations (e.g.
- because they are in an external DTD). If they do so they will report it by
- calling this function.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-*/
-/*!
- \fn QString QXmlContentHandler::errorString()
-
- The reader calls this function to get an error string if any of the handler
- functions returns FALSE to him.
-*/
-
-
-/*!
- \class QXmlErrorHandler qxml.h
- \brief The QXmlErrorHandler class provides an interface to report errors in
- XML data.
-
- \module XML
-
- If the application is interested in reporting errors to the user or any other
- customized error handling, you should subclass this class.
-
- You can set the error handler with QXmlReader::setErrorHandler().
-
- See also the <a href="xml.html#introSAX2">Introduction to SAX2</a>.
-
- \sa QXmlDTDHandler QXmlDeclHandler QXmlContentHandler QXmlEntityResolver
- QXmlLexicalHandler
-*/
-/*!
- \fn bool QXmlErrorHandler::warning( const QXmlParseException& exception )
-
- A reader might use this function to report a warning. Warnings are conditions
- that are not errors or fatal errors as defined by the XML 1.0 specification.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-*/
-/*!
- \fn bool QXmlErrorHandler::error( const QXmlParseException& exception )
-
- A reader might use this function to report a recoverable error. A recoverable
- error corresponds to the definition of "error" in section 1.2 of the XML 1.0
- specification.
-
- The reader must continue to provide normal parsing events after invoking this
- function.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-*/
-/*!
- \fn bool QXmlErrorHandler::fatalError( const QXmlParseException& exception )
-
- A reader must use this function to report a non-recoverable error.
-
- If this function returns TRUE the reader might try to go on parsing and
- reporting further errors; but no regular parsing events are reported.
-*/
-/*!
- \fn QString QXmlErrorHandler::errorString()
-
- The reader calls this function to get an error string if any of the handler
- functions returns FALSE to him.
-*/
-
-
-/*!
- \class QXmlDTDHandler qxml.h
- \brief The QXmlDTDHandler class provides an interface to report DTD content
- of XML data.
-
- \module XML
-
- If an application needs information about notations and unparsed entities,
- then the application implements this interface and registers an instance with
- QXmlReader::setDTDHandler().
-
- Note that this interface includes only those DTD events that the XML
- recommendation requires processors to report: notation and unparsed entity
- declarations.
-
- See also the <a href="xml.html#introSAX2">Introduction to SAX2</a>.
-
- \sa QXmlDeclHandler QXmlContentHandler QXmlEntityResolver QXmlErrorHandler
- QXmlLexicalHandler
-*/
-/*!
- \fn bool QXmlDTDHandler::notationDecl( const QString& name, const QString& publicId, const QString& systemId )
-
- The reader calls this function when he has parsed a notation
- declaration.
-
- The argument \a name is the notation name, \a publicId is the notations's
- public identifier and \a systemId is the notations's system identifier.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-*/
-/*!
- \fn bool QXmlDTDHandler::unparsedEntityDecl( const QString& name, const QString& publicId, const QString& systemId, const QString& notationName )
-
- The reader calls this function when he finds an unparsed entity declaration.
-
- The argument \a name is the unparsed entity's name, \a publicId is the
- entity's public identifier, \a systemId is the entity's system identifier and
- \a notation is the name of the associated notation.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-*/
-/*!
- \fn QString QXmlDTDHandler::errorString()
-
- The reader calls this function to get an error string if any of the handler
- functions returns FALSE to him.
-*/
-
-
-/*!
- \class QXmlEntityResolver qxml.h
- \brief The QXmlEntityResolver class provides an interface to resolve extern
- entities contained in XML data.
-
- \module XML
-
- If an application needs to implement customized handling for external
- entities, it must implement this interface and register it with
- QXmlReader::setEntityResolver().
-
- See also the <a href="xml.html#introSAX2">Introduction to SAX2</a>.
-
- \sa QXmlDTDHandler QXmlDeclHandler QXmlContentHandler QXmlErrorHandler
- QXmlLexicalHandler
-*/
-/*!
- \fn bool QXmlEntityResolver::resolveEntity( const QString& publicId, const QString& systemId, QXmlInputSource* ret )
-
- The reader will call this function before he opens any external entity,
- except the top-level document entity. The application may request the reader
- to resolve the entity itself (\a ret is 0) or to use an entirely different
- input source (\a ret points to the input source).
-
- The reader will delete the input source \a ret when he no longer needs it. So
- you should allocate it on the heap with \c new.
-
- The argument \a publicId is the public identifier of the external entity, \a
- systemId is the system identifier of the external entity and \a ret is the
- return value of this function: if it is 0 the reader should resolve the
- entity itself, if it is non-zero it must point to an input source which the
- reader will use instead.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-*/
-/*!
- \fn QString QXmlEntityResolver::errorString()
-
- The reader calls this function to get an error string if any of the handler
- functions returns FALSE to him.
-*/
-
-
-/*!
- \class QXmlLexicalHandler qxml.h
- \brief The QXmlLexicalHandler class provides an interface to report lexical
- content of XML data.
-
- \module XML
-
- The events in the lexical handler apply to the entire document, not just to
- the document element, and all lexical handler events appear between the
- content handler's startDocument and endDocument events.
-
- You can set the lexical handler with QXmlReader::setLexicalHandler().
-
- This interface is designed after the SAX2 extension LexicalHandler. The
- functions startEntity() and endEntity() are not included though.
-
- See also the <a href="xml.html#introSAX2">Introduction to SAX2</a>.
-
- \sa QXmlDTDHandler QXmlDeclHandler QXmlContentHandler QXmlEntityResolver
- QXmlErrorHandler
-*/
-/*!
- \fn bool QXmlLexicalHandler::startDTD( const QString& name, const QString& publicId, const QString& systemId )
-
- The reader calls this function to report the start of a DTD declaration, if
- any.
-
- All declarations reported through QXmlDTDHandler or QXmlDeclHandler appear
- between the startDTD() and endDTD() calls.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-
- \sa endDTD()
-*/
-/*!
- \fn bool QXmlLexicalHandler::endDTD()
-
- The reader calls this function to report the end of a DTD declaration, if
- any.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-
- \sa startDTD()
-*/
-/*!
- \fn bool QXmlLexicalHandler::startCDATA()
-
- The reader calls this function to report the start of a CDATA section. The
- content of the CDATA section will be reported through the regular
- QXmlContentHandler::characters(). This function is intended only to report
- the boundary.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-
- \sa endCDATA()
-*/
-/*!
- \fn bool QXmlLexicalHandler::endCDATA()
-
- The reader calls this function to report the end of a CDATA section.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-
- \sa startCDATA()
-*/
-/*!
- \fn bool QXmlLexicalHandler::comment( const QString& ch )
-
- The reader calls this function to report an XML comment anywhere in the
- document.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-*/
-/*!
- \fn QString QXmlLexicalHandler::errorString()
-
- The reader calls this function to get an error string if any of the handler
- functions returns FALSE to him.
-*/
-
-
-/*!
- \class QXmlDeclHandler qxml.h
- \brief The QXmlDeclHandler class provides an interface to report declaration
- content of XML data.
-
- \module XML
-
- You can set the declaration handler with QXmlReader::setDeclHandler().
-
- This interface is designed after the SAX2 extension DeclHandler.
-
- See also the <a href="xml.html#introSAX2">Introduction to SAX2</a>.
-
- \sa QXmlDTDHandler QXmlContentHandler QXmlEntityResolver QXmlErrorHandler
- QXmlLexicalHandler
-*/
-/*!
- \fn bool QXmlDeclHandler::attributeDecl( const QString& eName, const QString& aName, const QString& type, const QString& valueDefault, const QString& value )
-
- The reader calls this function to report an attribute type declaration. Only
- the effective (first) declaration for an attribute will be reported.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-*/
-/*!
- \fn bool QXmlDeclHandler::internalEntityDecl( const QString& name, const QString& value )
-
- The reader calls this function to report an internal entity declaration. Only
- the effective (first) declaration will be reported.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-*/
-/*!
- \fn bool QXmlDeclHandler::externalEntityDecl( const QString& name, const QString& publicId, const QString& systemId )
-
- The reader calls this function to report a parsed external entity
- declaration. Only the effective (first) declaration for each entity will be
- reported.
-
- If this function returns FALSE the reader will stop parsing and will report
- an error. The reader will use the function errorString() to get the error
- message that will be used for reporting the error.
-*/
-/*!
- \fn QString QXmlDeclHandler::errorString()
-
- The reader calls this function to get an error string if any of the handler
- functions returns FALSE to him.
-*/
-
-
-/*!
- \class QXmlDefaultHandler qxml.h
- \brief The QXmlDefaultHandler class provides a default implementation of all
- XML handler classes.
-
- \module XML
-
- Very often you are only interested in parts of the things that that the
- reader reports to you. This class simply implements a default behaviour of
- the handler classes (most of the time: do nothing). Normally this is the
- class you subclass for implementing your customized handler.
-
- See also the <a href="xml.html#introSAX2">Introduction to SAX2</a>.
-
- \sa QXmlDTDHandler QXmlDeclHandler QXmlContentHandler QXmlEntityResolver
- QXmlErrorHandler QXmlLexicalHandler
-*/
-/*!
- \fn QXmlDefaultHandler::QXmlDefaultHandler()
-
- Constructor.
-*/
-/*!
- \fn QXmlDefaultHandler::~QXmlDefaultHandler()
-
- Destructor.
-*/
-
-/*!
- Does nothing.
-*/
-void QXmlDefaultHandler::setDocumentLocator( QXmlLocator* )
-{
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::startDocument()
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::endDocument()
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::startPrefixMapping( const QString&, const QString& )
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::endPrefixMapping( const QString& )
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::startElement( const QString&, const QString&,
- const QString&, const QXmlAttributes& )
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::endElement( const QString&, const QString&,
- const QString& )
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::characters( const QString& )
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::ignorableWhitespace( const QString& )
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::processingInstruction( const QString&,
- const QString& )
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::skippedEntity( const QString& )
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::warning( const QXmlParseException& )
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::error( const QXmlParseException& )
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::fatalError( const QXmlParseException& )
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::notationDecl( const QString&, const QString&,
- const QString& )
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::unparsedEntityDecl( const QString&, const QString&,
- const QString&, const QString& )
-{
- return TRUE;
-}
-
-/*!
- Always sets \a ret to 0, so that the reader will use the system identifier
- provided in the XML document.
-*/
-bool QXmlDefaultHandler::resolveEntity( const QString&, const QString&,
- QXmlInputSource* &ret )
-{
- ret = 0;
- return TRUE;
-}
-
-/*!
- Returns the default error string.
-*/
-QString QXmlDefaultHandler::errorString()
-{
- return QString( XMLERR_ERRORBYCONSUMER );
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::startDTD( const QString&, const QString&, const QString& )
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::endDTD()
-{
- return TRUE;
-}
-
-#if 0
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::startEntity( const QString& )
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::endEntity( const QString& )
-{
- return TRUE;
-}
-#endif
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::startCDATA()
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::endCDATA()
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::comment( const QString& )
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::attributeDecl( const QString&, const QString&, const QString&, const QString&, const QString& )
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::internalEntityDecl( const QString&, const QString& )
-{
- return TRUE;
-}
-
-/*!
- Does nothing.
-*/
-bool QXmlDefaultHandler::externalEntityDecl( const QString&, const QString&, const QString& )
-{
- return TRUE;
-}
-
-
-/*********************************************
- *
- * QXmlSimpleReaderPrivate
- *
- *********************************************/
-
-class QXmlSimpleReaderPrivate
-{
-private:
- // constructor
- QXmlSimpleReaderPrivate()
- { }
-
-
- // used for entity declarations
- struct ExternParameterEntity
- {
- ExternParameterEntity( ) {}
- ExternParameterEntity( const QString &p, const QString &s )
- : publicId(p), systemId(s) {}
- QString publicId;
- QString systemId;
- };
- struct ExternEntity
- {
- ExternEntity( ) {}
- ExternEntity( const QString &p, const QString &s, const QString &n )
- : publicId(p), systemId(s), notation(n) {}
- QString publicId;
- QString systemId;
- QString notation;
- };
- QMap<QString,ExternParameterEntity> externParameterEntities;
- QMap<QString,QString> parameterEntities;
- QMap<QString,ExternEntity> externEntities;
- QMap<QString,QString> entities;
-
- // used for standalone declaration
- enum Standalone { Yes, No, Unknown };
-
- QString doctype; // only used for the doctype
- QString xmlVersion; // only used to store the version information
- QString encoding; // only used to store the encoding
- Standalone standalone; // used to store the value of the standalone declaration
-
- QString publicId; // used by parseExternalID() to store the public ID
- QString systemId; // used by parseExternalID() to store the system ID
- QString attDeclEName; // use by parseAttlistDecl()
- QString attDeclAName; // use by parseAttlistDecl()
-
- // flags for some features support
- bool useNamespaces;
- bool useNamespacePrefixes;
- bool reportWhitespaceCharData;
-
- // used to build the attribute list
- QXmlAttributes attList;
-
- // helper classes
- QXmlLocator *locator;
- QXmlNamespaceSupport namespaceSupport;
-
- // error string
- QString error;
-
- // friend declarations
- friend class QXmlSimpleReader;
-};
-
-
-/*********************************************
- *
- * QXmlSimpleReader
- *
- *********************************************/
-
-/*!
- \class QXmlReader qxml.h
- \brief The QXmlReader class provides an interface for XML readers (i.e.
- parsers).
-
- \module XML
-
- This abstract class describes an interface for all XML readers in Qt. At the
- moment there is only one implementation of a reader included in the XML
- module of Qt (QXmlSimpleReader). In future releases there might be more
- readers with different properties available (e.g. a validating parser).
-
- The design of the XML classes follow the
- <a href="http://www.megginson.com/SAX/">SAX2 java interface</a>.
- It was adopted to fit into the Qt naming conventions; so it should be very
- easy for anybody who has worked with SAX2 to get started with the Qt XML
- classes.
-
- All readers use the class QXmlInputSource to read the input document from.
- Since you are normally interested in certain contents of the XML document,
- the reader reports those contents through special handler classes
- (QXmlDTDHandler, QXmlDeclHandler, QXmlContentHandler, QXmlEntityResolver,
- QXmlErrorHandler and QXmlLexicalHandler).
-
- You have to subclass these classes. Since the handler classes describe only
- interfaces you must implement all functions; there is a class
- (QXmlDefaultHandler) to make this easier; it implements a default behaviour
- (do nothing) for all functions.
-
- For getting started see also the
- <a href="xml-sax.html#quickStart">Quick start</a>.
-
- \sa QXmlSimpleReader
-*/
-/*!
- \fn bool QXmlReader::feature( const QString& name, bool *ok ) const
-
- If the reader has the feature \a name, this function returns the value of the
- feature.
-
- If the reader has not the feature \a name, the return value may be anything.
-
- If \a ok is not 0, then \a ok is set to TRUE if the reader has the feature
- \a name, otherwise \a ok is set to FALSE.
-
- \sa setFeature() hasFeature()
-*/
-/*!
- \fn void QXmlReader::setFeature( const QString& name, bool value )
-
- Sets the feature \a name to \a value. If the reader has not the feature \a
- name, this value is ignored.
-
- \sa feature() hasFeature()
-*/
-/*!
- \fn bool QXmlReader::hasFeature( const QString& name ) const
-
- Returns \c TRUE if the reader has the feature \a name, otherwise FALSE.
-
- \sa feature() setFeature()
-*/
-/*!
- \fn void* QXmlReader::property( const QString& name, bool *ok ) const
-
- If the reader has the property \a name, this function returns the value of
- the property.
-
- If the reader has not the property \a name, the return value is 0.
-
- If \a ok is not 0, then \a ok is set to TRUE if the reader has the property
- \a name, otherwise \a ok is set to FALSE.
-
- \sa setProperty() hasProperty()
-*/
-/*!
- \fn void QXmlReader::setProperty( const QString& name, void* value )
-
- Sets the property \a name to \a value. If the reader has not the property \a
- name, this value is ignored.
-
- \sa property() hasProperty()
-*/
-/*!
- \fn bool QXmlReader::hasProperty( const QString& name ) const
-
- Returns TRUE if the reader has the property \a name, otherwise FALSE.
-
- \sa property() setProperty()
-*/
-/*!
- \fn void QXmlReader::setEntityResolver( QXmlEntityResolver* handler )
-
- Sets the entity resolver to \a handler.
-
- \sa entityResolver()
-*/
-/*!
- \fn QXmlEntityResolver* QXmlReader::entityResolver() const
-
- Returns the entity resolver or 0 if none was set.
-
- \sa setEntityResolver()
-*/
-/*!
- \fn void QXmlReader::setDTDHandler( QXmlDTDHandler* handler )
-
- Sets the DTD handler to \a handler.
-
- \sa DTDHandler()
-*/
-/*!
- \fn QXmlDTDHandler* QXmlReader::DTDHandler() const
-
- Returns the DTD handler or 0 if none was set.
-
- \sa setDTDHandler()
-*/
-/*!
- \fn void QXmlReader::setContentHandler( QXmlContentHandler* handler )
-
- Sets the content handler to \a handler.
-
- \sa contentHandler()
-*/
-/*!
- \fn QXmlContentHandler* QXmlReader::contentHandler() const
-
- Returns the content handler or 0 if none was set.
-
- \sa setContentHandler()
-*/
-/*!
- \fn void QXmlReader::setErrorHandler( QXmlErrorHandler* handler )
-
- Sets the error handler to \a handler.
-
- \sa errorHandler()
-*/
-/*!
- \fn QXmlErrorHandler* QXmlReader::errorHandler() const
-
- Returns the error handler or 0 if none was set
-
- \sa setErrorHandler()
-*/
-/*!
- \fn void QXmlReader::setLexicalHandler( QXmlLexicalHandler* handler )
-
- Sets the lexical handler to \a handler.
-
- \sa lexicalHandler()
-*/
-/*!
- \fn QXmlLexicalHandler* QXmlReader::lexicalHandler() const
-
- Returns the lexical handler or 0 if none was set.
-
- \sa setLexicalHandler()
-*/
-/*!
- \fn void QXmlReader::setDeclHandler( QXmlDeclHandler* handler )
-
- Sets the declaration handler to \a handler.
-
- \sa declHandler()
-*/
-/*!
- \fn QXmlDeclHandler* QXmlReader::declHandler() const
-
- Returns the declaration handler or 0 if none was set.
-
- \sa setDeclHandler()
-*/
-/*!
- \fn bool QXmlReader::parse( const QXmlInputSource& input )
-
- Parses the XML document \a input. Returns TRUE if the parsing was successful,
- otherwise FALSE.
-*/
-/*!
- \fn bool QXmlReader::parse( const QString& systemId )
-
- Parses the XML document at the location \a systemId. Returns TRUE if the
- parsing was successful, otherwise FALSE.
-*/
-
-
-/*!
- \class QXmlSimpleReader qxml.h
- \brief The QXmlSimpleReader class provides an implementation of a simple XML
- reader (i.e. parser).
-
- \module XML
-
- This XML reader is sufficient for simple parsing tasks. Here is a short list
- of the properties of this reader:
- <ul>
- <li> well-formed parser
- <li> does not parse any external entities
- <li> can do namespace processing
- </ul>
-
- For getting started see also the
- <a href="xml-sax.html#quickStart">Quick start</a>.
-*/
-
-//guaranteed not to be a character
-const QChar QXmlSimpleReader::QEOF = QChar((ushort)0xffff);
-
-/*!
- Constructs a simple XML reader.
-*/
-QXmlSimpleReader::QXmlSimpleReader()
-{
- d = new QXmlSimpleReaderPrivate();
- d->locator = new QXmlLocator( this );
-
- entityRes = 0;
- dtdHnd = 0;
- contentHnd = 0;
- errorHnd = 0;
- lexicalHnd = 0;
- declHnd = 0;
-
- // default feature settings
- d->useNamespaces = TRUE;
- d->useNamespacePrefixes = FALSE;
- d->reportWhitespaceCharData = TRUE;
-}
-
-/*!
- Destroys a simple XML reader.
-*/
-QXmlSimpleReader::~QXmlSimpleReader()
-{
- delete d->locator;
- delete d;
-}
-
-/*!
- Gets the state of a feature.
-
- \sa setFeature() hasFeature()
-*/
-bool QXmlSimpleReader::feature( const QString& name, bool *ok ) const
-{
- if ( ok != 0 )
- *ok = TRUE;
- if ( name == "http://xml.org/sax/features/namespaces" ) {
- return d->useNamespaces;
- } else if ( name == "http://xml.org/sax/features/namespace-prefixes" ) {
- return d->useNamespacePrefixes;
- } else if ( name == "http://trolltech.com/xml/features/report-whitespace-only-CharData" ) {
- return d->reportWhitespaceCharData;
- } else {
- qWarning( "Unknown feature %s", name.ascii() );
- if ( ok != 0 )
- *ok = FALSE;
- }
- return FALSE;
-}
-
-/*!
- Sets the state of a feature.
-
- Supported features are:
- <ul>
- <li> http://xml.org/sax/features/namespaces:
- if this feature is TRUE, namespace processing is performed
- <li> http://xml.org/sax/features/namespace-prefixes:
- if this feature is TRUE, the original prefixed names and attributes
- used for namespace declarations are reported
- <li> http://trolltech.com/xml/features/report-whitespace-only-CharData:
- if this feature is TRUE, CharData that consists only of whitespace (and
- no other characters) is not reported via
- QXmlContentHandler::characters()
- </ul>
-
- \sa feature() hasFeature()
-*/
-void QXmlSimpleReader::setFeature( const QString& name, bool value )
-{
- if ( name == "http://xml.org/sax/features/namespaces" ) {
- d->useNamespaces = value;
- } else if ( name == "http://xml.org/sax/features/namespace-prefixes" ) {
- d->useNamespacePrefixes = value;
- } else if ( name == "http://trolltech.com/xml/features/report-whitespace-only-CharData" ) {
- d->reportWhitespaceCharData = value;
- } else {
- qWarning( "Unknown feature %s", name.ascii() );
- }
-}
-
-/*!
- Returns TRUE if the class has a feature named \a feature, otherwise FALSE.
-
- \sa setFeature() feature()
-*/
-bool QXmlSimpleReader::hasFeature( const QString& name ) const
-{
- if ( name == "http://xml.org/sax/features/namespaces" ||
- name == "http://xml.org/sax/features/namespace-prefixes" ||
- name == "http://trolltech.com/xml/features/report-whitespace-only-CharData" ) {
- return TRUE;
- } else {
- return FALSE;
- }
-}
-
-/*!
- Returns 0 since this class does not support any properties.
-*/
-void* QXmlSimpleReader::property( const QString&, bool *ok ) const
-{
- if ( ok != 0 )
- *ok = FALSE;
- return 0;
-}
-
-/*!
- Does nothing since this class does not support any properties.
-*/
-void QXmlSimpleReader::setProperty( const QString&, void* )
-{
-}
-
-/*!
- Returns FALSE since this class does not support any properties.
-*/
-bool QXmlSimpleReader::hasProperty( const QString& ) const
-{
- return FALSE;
-}
-
-/*! \reimp */
-void QXmlSimpleReader::setEntityResolver( QXmlEntityResolver* handler )
-{ entityRes = handler; }
-
-/*! \reimp */
-QXmlEntityResolver* QXmlSimpleReader::entityResolver() const
-{ return entityRes; }
-
-/*! \reimp */
-void QXmlSimpleReader::setDTDHandler( QXmlDTDHandler* handler )
-{ dtdHnd = handler; }
-
-/*! \reimp */
-QXmlDTDHandler* QXmlSimpleReader::DTDHandler() const
-{ return dtdHnd; }
-
-/*! \reimp */
-void QXmlSimpleReader::setContentHandler( QXmlContentHandler* handler )
-{ contentHnd = handler; }
-
-/*! \reimp */
-QXmlContentHandler* QXmlSimpleReader::contentHandler() const
-{ return contentHnd; }
-
-/*! \reimp */
-void QXmlSimpleReader::setErrorHandler( QXmlErrorHandler* handler )
-{ errorHnd = handler; }
-
-/*! \reimp */
-QXmlErrorHandler* QXmlSimpleReader::errorHandler() const
-{ return errorHnd; }
-
-/*! \reimp */
-void QXmlSimpleReader::setLexicalHandler( QXmlLexicalHandler* handler )
-{ lexicalHnd = handler; }
-
-/*! \reimp */
-QXmlLexicalHandler* QXmlSimpleReader::lexicalHandler() const
-{ return lexicalHnd; }
-
-/*! \reimp */
-void QXmlSimpleReader::setDeclHandler( QXmlDeclHandler* handler )
-{ declHnd = handler; }
-
-/*! \reimp */
-QXmlDeclHandler* QXmlSimpleReader::declHandler() const
-{ return declHnd; }
-
-
-
-/*! \reimp */
-bool QXmlSimpleReader::parse( const QXmlInputSource& input )
-{
- init( input );
- // call the handler
- if ( contentHnd ) {
- contentHnd->setDocumentLocator( d->locator );
- if ( !contentHnd->startDocument() ) {
- d->error = contentHnd->errorString();
- goto parseError;
- }
- }
- // parse prolog
- if ( !parseProlog() ) {
- d->error = XMLERR_ERRORPARSINGPROLOG;
- goto parseError;
- }
- // parse element
- if ( !parseElement() ) {
- d->error = XMLERR_ERRORPARSINGMAINELEMENT;
- goto parseError;
- }
- // parse Misc*
- while ( !atEnd() ) {
- if ( !parseMisc() ) {
- d->error = XMLERR_ERRORPARSINGMISC;
- goto parseError;
- }
- }
- // is stack empty?
- if ( !tags.isEmpty() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- // call the handler
- if ( contentHnd ) {
- if ( !contentHnd->endDocument() ) {
- d->error = contentHnd->errorString();
- goto parseError;
- }
- }
-
- return TRUE;
-
- // error handling
-
-parseError:
- reportParseError();
- tags.clear();
- return FALSE;
-}
-
-/*!
- Parses the prolog [22].
-*/
-bool QXmlSimpleReader::parseProlog()
-{
- bool xmldecl_possible = TRUE;
- bool doctype_read = FALSE;
-
- const signed char Init = 0;
- const signed char EatWS = 1; // eat white spaces
- const signed char Lt = 2; // '<' read
- const signed char Em = 3; // '!' read
- const signed char DocType = 4; // read doctype
- const signed char Comment = 5; // read comment
- const signed char PI = 6; // read PI
- const signed char Done = 7;
-
- const signed char InpWs = 0;
- const signed char InpLt = 1; // <
- const signed char InpQm = 2; // ?
- const signed char InpEm = 3; // !
- const signed char InpD = 4; // D
- const signed char InpDash = 5; // -
- const signed char InpUnknown = 6;
-
- // use some kind of state machine for parsing
- static signed char table[7][7] = {
- /* InpWs InpLt InpQm InpEm InpD InpDash InpUnknown */
- { EatWS, Lt, -1, -1, -1, -1, -1 }, // Init
- { -1, Lt, -1, -1, -1, -1, -1 }, // EatWS
- { -1, -1, PI, Em, Done, -1, Done }, // Lt
- { -1, -1, -1, -1, DocType, Comment, -1 }, // Em
- { EatWS, Lt, -1, -1, -1, -1, -1 }, // DocType
- { EatWS, Lt, -1, -1, -1, -1, -1 }, // Comment
- { EatWS, Lt, -1, -1, -1, -1, -1 } // PI
- };
- signed char state = Init;
- signed char input;
- bool parseOk = TRUE;
-
- while ( TRUE ) {
-
- // read input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( is_S(c) ) {
- input = InpWs;
- } else if ( c == '<' ) {
- input = InpLt;
- } else if ( c == '?' ) {
- input = InpQm;
- } else if ( c == '!' ) {
- input = InpEm;
- } else if ( c == 'D' ) {
- input = InpD;
- } else if ( c == '-' ) {
- input = InpDash;
- } else {
- input = InpUnknown;
- }
- // get new state
- state = table[state][input];
-
- // in some cases do special actions depending on state
- switch ( state ) {
- case EatWS:
- // XML declaration only on first position possible
- xmldecl_possible = FALSE;
- // eat white spaces
- eat_ws();
- break;
- case Lt:
- // next character
- next();
- break;
- case Em:
- // XML declaration only on first position possible
- xmldecl_possible = FALSE;
- // next character
- next();
- break;
- case DocType:
- parseOk = parseDoctype();
- break;
- case Comment:
- parseOk = parseComment();
- break;
- case PI:
- parseOk = parsePI( xmldecl_possible );
- break;
- }
- // no input is read after this
- switch ( state ) {
- case DocType:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGPROLOG;
- goto parseError;
- }
- if ( doctype_read ) {
- d->error = XMLERR_MORETHANONEDOCTYPE;
- goto parseError;
- } else {
- doctype_read = FALSE;
- }
- break;
- case Comment:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGPROLOG;
- goto parseError;
- }
- if ( lexicalHnd ) {
- if ( !lexicalHnd->comment( string() ) ) {
- d->error = lexicalHnd->errorString();
- goto parseError;
- }
- }
- break;
- case PI:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGPROLOG;
- goto parseError;
- }
- // call the handler
- if ( contentHnd ) {
- if ( xmldecl_possible && !d->xmlVersion.isEmpty() ) {
- QString value( "version = '" );
- value += d->xmlVersion;
- value += "'";
- if ( !d->encoding.isEmpty() ) {
- value += " encoding = '";
- value += d->encoding;
- value += "'";
- }
- if ( d->standalone == QXmlSimpleReaderPrivate::Yes ) {
- value += " standalone = 'yes'";
- } else if ( d->standalone == QXmlSimpleReaderPrivate::No ) {
- value += " standalone = 'no'";
- }
- if ( !contentHnd->processingInstruction( "xml", value ) ) {
- d->error = contentHnd->errorString();
- goto parseError;
- }
- } else {
- if ( !contentHnd->processingInstruction( name(), string() ) ) {
- d->error = contentHnd->errorString();
- goto parseError;
- }
- }
- }
- // XML declaration only on first position possible
- xmldecl_possible = FALSE;
- break;
- case Done:
- return TRUE;
- case -1:
- d->error = XMLERR_ERRORPARSINGELEMENT;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse an element [39].
-
- Precondition: the opening '<' is already read.
-*/
-bool QXmlSimpleReader::parseElement()
-{
- static QString uri, lname, prefix;
- static bool t;
-
- const signed char Init = 0;
- const signed char ReadName = 1;
- const signed char Ws1 = 2;
- const signed char STagEnd = 3;
- const signed char STagEnd2 = 4;
- const signed char ETagBegin = 5;
- const signed char ETagBegin2 = 6;
- const signed char Ws2 = 7;
- const signed char EmptyTag = 8;
- const signed char Attribute = 9;
- const signed char Ws3 = 10;
- const signed char Done = 11;
-
- const signed char InpWs = 0; // whitespace
- const signed char InpNameBe = 1; // is_NameBeginning()
- const signed char InpGt = 2; // >
- const signed char InpSlash = 3; // /
- const signed char InpUnknown = 4;
-
- // use some kind of state machine for parsing
- static signed char table[11][5] = {
- /* InpWs InpNameBe InpGt InpSlash InpUnknown */
- { -1, ReadName, -1, -1, -1 }, // Init
- { Ws1, Attribute, STagEnd, EmptyTag, -1 }, // ReadName
- { -1, Attribute, STagEnd, EmptyTag, -1 }, // Ws1
- { STagEnd2, STagEnd2, STagEnd2, STagEnd2, STagEnd2 }, // STagEnd
- { -1, -1, -1, ETagBegin, -1 }, // STagEnd2
- { -1, ETagBegin2, -1, -1, -1 }, // ETagBegin
- { Ws2, -1, Done, -1, -1 }, // ETagBegin2
- { -1, -1, Done, -1, -1 }, // Ws2
- { -1, -1, Done, -1, -1 }, // EmptyTag
- { Ws3, Attribute, STagEnd, EmptyTag, -1 }, // Attribute
- { -1, Attribute, STagEnd, EmptyTag, -1 } // Ws3
- };
- signed char state = Init;
- signed char input;
- bool parseOk = TRUE;
-
- while ( TRUE ) {
-
- // read input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( is_S(c) ) {
- input = InpWs;
- } else if ( is_NameBeginning(c) ) {
- input = InpNameBe;
- } else if ( c == '>' ) {
- input = InpGt;
- } else if ( c == '/' ) {
- input = InpSlash;
- } else {
- input = InpUnknown;
- }
- // get new state
-//qDebug( "%d -%d(%c)-> %d", state, input, c.latin1(), table[state][input] );
- state = table[state][input];
-
- // in some cases do special actions depending on state
- switch ( state ) {
- case ReadName:
- parseOk = parseName();
- break;
- case Ws1:
- case Ws2:
- case Ws3:
- eat_ws();
- break;
- case STagEnd:
- // call the handler
- if ( contentHnd ) {
- if ( d->useNamespaces ) {
- d->namespaceSupport.processName( tags.top(), FALSE, uri, lname );
- t = contentHnd->startElement( uri, lname, tags.top(), d->attList );
- } else {
- t = contentHnd->startElement( "", "", tags.top(), d->attList );
- }
- if ( !t ) {
- d->error = contentHnd->errorString();
- goto parseError;
- }
- }
- next();
- break;
- case STagEnd2:
- parseOk = parseContent();
- break;
- case ETagBegin:
- next();
- break;
- case ETagBegin2:
- // get the name of the tag
- parseOk = parseName();
- break;
- case EmptyTag:
- if ( tags.isEmpty() ) {
- d->error = XMLERR_TAGMISMATCH;
- goto parseError;
- }
- if ( !parseElementEmptyTag( t, uri, lname ) )
- goto parseError;
- // next character
- next();
- break;
- case Attribute:
- // get name and value of attribute
- parseOk = parseAttribute();
- break;
- case Done:
- next();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case ReadName:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGNAME;
- goto parseError;
- }
- // store it on the stack
- tags.push( name() );
- // empty the attributes
- d->attList.qnameList.clear();
- d->attList.uriList.clear();
- d->attList.localnameList.clear();
- d->attList.valueList.clear();
- // namespace support?
- if ( d->useNamespaces ) {
- d->namespaceSupport.pushContext();
- }
- break;
- case STagEnd2:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGCONTENT;
- goto parseError;
- }
- break;
- case ETagBegin2:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGNAME;
- goto parseError;
- }
- if ( !parseElementETagBegin2( uri, lname ) )
- goto parseError;
- break;
- case Attribute:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGATTRIBUTE;
- goto parseError;
- }
- if ( !parseElementAttribute( prefix, uri, lname ) )
- goto parseError;
- break;
- case Done:
- return TRUE;
- case -1:
- d->error = XMLERR_ERRORPARSINGELEMENT;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-/*!
- Helper to break down the size of the code in the case statement.
- Return FALSE on error, otherwise TRUE.
-*/
-bool QXmlSimpleReader::parseElementEmptyTag( bool &t, QString &uri, QString &lname )
-{
- // pop the stack and call the handler
- if ( contentHnd ) {
- // report startElement first...
- if ( d->useNamespaces ) {
- d->namespaceSupport.processName( tags.top(), FALSE, uri, lname );
- t = contentHnd->startElement( uri, lname, tags.top(), d->attList );
- } else {
- t = contentHnd->startElement( "", "", tags.top(), d->attList );
- }
- if ( !t ) {
- d->error = contentHnd->errorString();
- return FALSE;
- }
- // ... followed by endElement
- if ( d->useNamespaces ) {
- if ( !contentHnd->endElement( uri, lname,tags.pop() ) ) {
- d->error = contentHnd->errorString();
- return FALSE;
- }
- }
- else {
- if ( !contentHnd->endElement( "","",tags.pop() ) ) {
- d->error = contentHnd->errorString();
- return FALSE;
- }
- }
- // namespace support?
- if ( d->useNamespaces ) {
- QStringList prefixesBefore, prefixesAfter;
- if ( contentHnd ) {
- prefixesBefore = d->namespaceSupport.prefixes();
- }
- d->namespaceSupport.popContext();
- // call the handler for prefix mapping
- if ( contentHnd ) {
- prefixesAfter = d->namespaceSupport.prefixes();
- for ( QStringList::Iterator it = prefixesBefore.begin(); it != prefixesBefore.end(); ++it ) {
- if ( prefixesAfter.contains(*it) == 0 ) {
- if ( !contentHnd->endPrefixMapping( *it ) ) {
- d->error = contentHnd->errorString();
- return FALSE;
- }
- }
- }
- }
- }
- } else {
- tags.pop();
- }
- return TRUE;
-}
-/*!
- Helper to break down the size of the code in the case statement.
- Return FALSE on error, otherwise TRUE.
-*/
-bool QXmlSimpleReader::parseElementETagBegin2( QString &uri, QString &lname )
-{
-
- // pop the stack and compare it with the name
- if ( tags.pop() != name() ) {
- d->error = XMLERR_TAGMISMATCH;
- return FALSE;
- }
- // call the handler
- if ( contentHnd ) {
- if ( d->useNamespaces ) {
- d->namespaceSupport.processName( name(), FALSE, uri, lname );
- if ( !contentHnd->endElement(uri,lname,name()) ) {
- d->error = contentHnd->errorString();
- return FALSE;
- }
- }
- else {
- if ( !contentHnd->endElement("","",name()) ) {
- d->error = contentHnd->errorString();
- return FALSE;
- }
- }
- }
- // namespace support?
- if ( d->useNamespaces ) {
- QStringList prefixesBefore, prefixesAfter;
- if ( contentHnd ) {
- prefixesBefore = d->namespaceSupport.prefixes();
- }
- d->namespaceSupport.popContext();
- // call the handler for prefix mapping
- if ( contentHnd ) {
- prefixesAfter = d->namespaceSupport.prefixes();
- for ( QStringList::Iterator it = prefixesBefore.begin(); it != prefixesBefore.end(); ++it ) {
- if ( prefixesAfter.contains(*it) == 0 ) {
- if ( !contentHnd->endPrefixMapping( *it ) ) {
- d->error = contentHnd->errorString();
- return FALSE;
- }
- }
- }
- }
- }
- return TRUE;
-}
-/*!
- Helper to break down the size of the code in the case statement.
- Return FALSE on error, otherwise TRUE.
-*/
-bool QXmlSimpleReader::parseElementAttribute( QString &prefix, QString &uri, QString &lname )
-{
- // add the attribute to the list
- if ( d->useNamespaces ) {
- // is it a namespace declaration?
- d->namespaceSupport.splitName( name(), prefix, lname );
- if ( prefix == "xmlns" ) {
- // namespace declaration
- d->namespaceSupport.setPrefix( lname, string() );
- if ( d->useNamespacePrefixes ) {
- d->attList.qnameList.append( name() );
- d->attList.uriList.append( "" );
- d->attList.localnameList.append( "" );
- d->attList.valueList.append( string() );
- }
- // call the handler for prefix mapping
- if ( contentHnd ) {
- if ( !contentHnd->startPrefixMapping( lname, string() ) ) {
- d->error = contentHnd->errorString();
- return FALSE;
- }
- }
- } else {
- // no namespace declaration
- d->namespaceSupport.processName( name(), TRUE, uri, lname );
- d->attList.qnameList.append( name() );
- d->attList.uriList.append( uri );
- d->attList.localnameList.append( lname );
- d->attList.valueList.append( string() );
- }
- } else {
- // no namespace support
- d->attList.qnameList.append( name() );
- d->attList.uriList.append( "" );
- d->attList.localnameList.append( "" );
- d->attList.valueList.append( string() );
- }
- return TRUE;
-}
-
-/*!
- Parse a content [43].
-
- A content is only used between tags. If a end tag is found the < is already
- read and the head stand on the '/' of the end tag '</name>'.
-*/
-bool QXmlSimpleReader::parseContent()
-{
- bool charDataRead = FALSE;
-
- const signed char Init = 0;
- const signed char ChD = 1; // CharData
- const signed char ChD1 = 2; // CharData help state
- const signed char ChD2 = 3; // CharData help state
- const signed char Ref = 4; // Reference
- const signed char Lt = 5; // '<' read
- const signed char PI = 6; // PI
- const signed char Elem = 7; // Element
- const signed char Em = 8; // '!' read
- const signed char Com = 9; // Comment
- const signed char CDS = 10; // CDSect
- const signed char CDS1 = 11; // read a CDSect
- const signed char CDS2 = 12; // read a CDSect (help state)
- const signed char CDS3 = 13; // read a CDSect (help state)
- const signed char Done = 14; // finished reading content
-
- const signed char InpLt = 0; // <
- const signed char InpGt = 1; // >
- const signed char InpSlash = 2; // /
- const signed char InpQMark = 3; // ?
- const signed char InpEMark = 4; // !
- const signed char InpAmp = 5; // &
- const signed char InpDash = 6; // -
- const signed char InpOpenB = 7; // [
- const signed char InpCloseB = 8; // ]
- const signed char InpUnknown = 9;
-
- static signed char mapCLT2FSMChar[] = {
- InpUnknown, // white space
- InpUnknown, // %
- InpAmp, // &
- InpGt, // >
- InpLt, // <
- InpSlash, // /
- InpQMark, // ?
- InpEMark, // !
- InpDash, // -
- InpCloseB, // ]
- InpOpenB, // [
- InpUnknown, // =
- InpUnknown, // "
- InpUnknown, // '
- InpUnknown // unknown
- };
-
- // use some kind of state machine for parsing
- static signed char const table[14][10] = {
- /* InpLt InpGt InpSlash InpQMark InpEMark InpAmp InpDash InpOpenB InpCloseB InpUnknown */
- { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD1, ChD }, // Init
- { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD1, ChD }, // ChD
- { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD2, ChD }, // ChD1
- { Lt, -1, ChD, ChD, ChD, Ref, ChD, ChD, ChD2, ChD }, // ChD2
- { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, // Ref (same as Init)
- { -1, -1, Done, PI, Em, -1, -1, -1, -1, Elem }, // Lt
- { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, // PI (same as Init)
- { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, // Elem (same as Init)
- { -1, -1, -1, -1, -1, -1, Com, CDS, -1, -1 }, // Em
- { Lt, ChD, ChD, ChD, ChD, Ref, ChD, ChD, ChD, ChD }, // Com (same as Init)
- { CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS2, CDS1 }, // CDS
- { CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS2, CDS1 }, // CDS1
- { CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS3, CDS1 }, // CDS2
- { CDS1, Init, CDS1, CDS1, CDS1, CDS1, CDS1, CDS1, CDS3, CDS1 } // CDS3
- };
- signed char state = Init;
- signed char input;
- bool parseOk = TRUE;
-
- while ( TRUE ) {
-
- // get input (use lookup-table instead of nested ifs for performance
- // reasons)
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( c.row() ) {
- input = InpUnknown;
- } else {
- input = mapCLT2FSMChar[ charLookupTable[ c.cell() ] ];
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case Init:
- // next character
- next();
- break;
- case ChD:
- // on first call: clear string
- if ( !charDataRead ) {
- charDataRead = TRUE;
- stringClear();
- }
- stringAddC();
- next();
- break;
- case ChD1:
- // on first call: clear string
- if ( !charDataRead ) {
- charDataRead = TRUE;
- stringClear();
- }
- stringAddC();
- next();
- break;
- case ChD2:
- stringAddC();
- next();
- break;
- case Ref:
- if ( !charDataRead) {
- // reference may be CharData; so clear string to be safe
- stringClear();
- parseOk = parseReference( charDataRead, InContent );
- } else {
- bool tmp;
- parseOk = parseReference( tmp, InContent );
- }
- break;
- case Lt:
- // call the handler for CharData
- if ( contentHnd ) {
- if ( charDataRead ) {
- if ( d->reportWhitespaceCharData || !string().simplifyWhiteSpace().isEmpty() ) {
- if ( !contentHnd->characters( string() ) ) {
- d->error = contentHnd->errorString();
- goto parseError;
- }
- }
- }
- }
- charDataRead = FALSE;
- // next character
- next();
- break;
- case PI:
- parseOk = parsePI();
- break;
- case Elem:
- parseOk = parseElement();
- break;
- case Em:
- // next character
- next();
- break;
- case Com:
- parseOk = parseComment();
- break;
- case CDS:
- parseOk = parseString( "[CDATA[" );
- break;
- case CDS1:
- // read one character and add it
- stringAddC();
- next();
- break;
- case CDS2:
- // skip ']'
- next();
- break;
- case CDS3:
- // skip ']'...
- next();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case Ref:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGREFERENCE;
- goto parseError;
- }
- break;
- case PI:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGPI;
- goto parseError;
- }
- // call the handler
- if ( contentHnd ) {
- if ( !contentHnd->processingInstruction(name(),string()) ) {
- d->error = contentHnd->errorString();
- goto parseError;
- }
- }
- break;
- case Elem:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGELEMENT;
- goto parseError;
- }
- break;
- case Com:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGCOMMENT;
- goto parseError;
- }
- if ( lexicalHnd ) {
- if ( !lexicalHnd->comment( string() ) ) {
- d->error = lexicalHnd->errorString();
- goto parseError;
- }
- }
- break;
- case CDS:
- if( !parseOk ) {
- d->error = XMLERR_CDSECTHEADEREXPECTED;
- goto parseError;
- }
- // empty string
- stringClear();
- break;
- case CDS2:
- if (c != ']') {
- stringAddC( ']' );
- }
- break;
- case CDS3:
- // test if this skipping was legal
- if ( c == '>' ) {
- // the end of the CDSect
- if ( lexicalHnd ) {
- if ( !lexicalHnd->startCDATA() ) {
- d->error = lexicalHnd->errorString();
- goto parseError;
- }
- }
- if ( contentHnd ) {
- if ( !contentHnd->characters( string() ) ) {
- d->error = contentHnd->errorString();
- goto parseError;
- }
- }
- if ( lexicalHnd ) {
- if ( !lexicalHnd->endCDATA() ) {
- d->error = lexicalHnd->errorString();
- goto parseError;
- }
- }
- } else if (c == ']') {
- // three or more ']'
- stringAddC( ']' );
- } else {
- // after ']]' comes another character
- stringAddC( ']' );
- stringAddC( ']' );
- }
- break;
- case Done:
- // call the handler for CharData
- if ( contentHnd ) {
- if ( charDataRead ) {
- if ( d->reportWhitespaceCharData || !string().simplifyWhiteSpace().isEmpty() ) {
- if ( !contentHnd->characters( string() ) ) {
- d->error = contentHnd->errorString();
- goto parseError;
- }
- }
- }
- }
- // Done
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_ERRORPARSINGCONTENT;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse Misc [27].
-*/
-bool QXmlSimpleReader::parseMisc()
-{
- const signed char Init = 0;
- const signed char Lt = 1; // '<' was read
- const signed char Comment = 2; // read comment
- const signed char eatWS = 3; // eat whitespaces
- const signed char PI = 4; // read PI
- const signed char Comment2 = 5; // read comment
-
- const signed char InpWs = 0; // S
- const signed char InpLt = 1; // <
- const signed char InpQm = 2; // ?
- const signed char InpEm = 3; // !
- const signed char InpUnknown = 4;
-
- // use some kind of state machine for parsing
- static signed char table[3][5] = {
- /* InpWs InpLt InpQm InpEm InpUnknown */
- { eatWS, Lt, -1, -1, -1 }, // Init
- { -1, -1, PI, Comment, -1 }, // Lt
- { -1, -1, -1, -1, Comment2 } // Comment
- };
- signed char state = Init;
- signed char input;
- bool parseOk = TRUE;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( is_S(c) ) {
- input = InpWs;
- } else if ( c == '<' ) {
- input = InpLt;
- } else if ( c == '?' ) {
- input = InpQm;
- } else if ( c == '!' ) {
- input = InpEm;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case eatWS:
- eat_ws();
- break;
- case Lt:
- next();
- break;
- case PI:
- parseOk = parsePI();
- break;
- case Comment:
- next();
- break;
- case Comment2:
- parseOk = parseComment();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case eatWS:
- return TRUE;
- case PI:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGPI;
- goto parseError;
- }
- if ( contentHnd ) {
- if ( !contentHnd->processingInstruction(name(),string()) ) {
- d->error = contentHnd->errorString();
- goto parseError;
- }
- }
- return TRUE;
- case Comment2:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGCOMMENT;
- goto parseError;
- }
- if ( lexicalHnd ) {
- if ( !lexicalHnd->comment( string() ) ) {
- d->error = lexicalHnd->errorString();
- goto parseError;
- }
- }
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse a processing instruction [16].
-
- If xmldec is TRUE, it tries to parse a PI or a XML declaration [23].
-
- Precondition: the beginning '<' of the PI is already read and the head stand
- on the '?' of '<?'.
-
- If this function was successful, the head-position is on the first
- character after the PI.
-*/
-bool QXmlSimpleReader::parsePI( bool xmldecl )
-{
- const signed char Init = 0;
- const signed char QmI = 1; // ? was read
- const signed char Name = 2; // read Name
- const signed char XMLDecl = 3; // read XMLDecl
- const signed char Ws1 = 4; // eat ws after "xml" of XMLDecl
- const signed char PI = 5; // read PI
- const signed char Ws2 = 6; // eat ws after Name of PI
- const signed char Version = 7; // read versionInfo
- const signed char Ws3 = 8; // eat ws after versionInfo
- const signed char EorSD = 9; // read EDecl or SDDecl
- const signed char Ws4 = 10; // eat ws after EDecl or SDDecl
- const signed char SD = 11; // read SDDecl
- const signed char Ws5 = 12; // eat ws after SDDecl
- const signed char ADone = 13; // almost done
- const signed char Char = 14; // Char was read
- const signed char Qm = 15; // Qm was read
- const signed char Done = 16; // finished reading content
-
- const signed char InpWs = 0; // whitespace
- const signed char InpNameBe = 1; // is_nameBeginning()
- const signed char InpGt = 2; // >
- const signed char InpQm = 3; // ?
- const signed char InpUnknown = 4;
-
- // use some kind of state machine for parsing
- static signed char table[16][5] = {
- /* InpWs, InpNameBe InpGt InpQm InpUnknown */
- { -1, -1, -1, QmI, -1 }, // Init
- { -1, Name, -1, -1, -1 }, // QmI
- { -1, -1, -1, -1, -1 }, // Name (this state is left not through input)
- { Ws1, -1, -1, -1, -1 }, // XMLDecl
- { -1, Version, -1, -1, -1 }, // Ws1
- { Ws2, -1, -1, Qm, -1 }, // PI
- { Char, Char, Char, Qm, Char }, // Ws2
- { Ws3, -1, -1, ADone, -1 }, // Version
- { -1, EorSD, -1, ADone, -1 }, // Ws3
- { Ws4, -1, -1, ADone, -1 }, // EorSD
- { -1, SD, -1, ADone, -1 }, // Ws4
- { Ws5, -1, -1, ADone, -1 }, // SD
- { -1, -1, -1, ADone, -1 }, // Ws5
- { -1, -1, Done, -1, -1 }, // ADone
- { Char, Char, Char, Qm, Char }, // Char
- { Char, Char, Done, Qm, Char }, // Qm
- };
- signed char state = Init;
- signed char input;
- bool parseOk = TRUE;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( is_S(c) ) {
- input = InpWs;
- } else if ( is_NameBeginning(c) ) {
- input = InpNameBe;
- } else if ( c == '>' ) {
- input = InpGt;
- } else if ( c == '?' ) {
- input = InpQm;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case QmI:
- next();
- break;
- case Name:
- parseOk = parseName();
- break;
- case Ws1:
- case Ws2:
- case Ws3:
- case Ws4:
- case Ws5:
- eat_ws();
- break;
- case Version:
- parseOk = parseAttribute();
- break;
- case EorSD:
- parseOk = parseAttribute();
- break;
- case SD:
- // get the SDDecl (syntax like an attribute)
- if ( d->standalone != QXmlSimpleReaderPrivate::Unknown ) {
- // already parsed the standalone declaration
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- parseOk = parseAttribute();
- break;
- case ADone:
- next();
- break;
- case Char:
- stringAddC();
- next();
- break;
- case Qm:
- // skip the '?'
- next();
- break;
- case Done:
- next();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case Name:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGNAME;
- goto parseError;
- }
- // test what name was read and determine the next state
- // (not very beautiful, I admit)
- if ( name().lower() == "xml" ) {
- if ( xmldecl && name()=="xml" ) {
- state = XMLDecl;
- } else {
- d->error = XMLERR_INVALIDNAMEFORPI;
- goto parseError;
- }
- } else {
- state = PI;
- stringClear();
- }
- break;
- case Version:
- // get version (syntax like an attribute)
- if ( !parseOk ) {
- d->error = XMLERR_VERSIONEXPECTED;
- goto parseError;
- }
- if ( name() != "version" ) {
- d->error = XMLERR_VERSIONEXPECTED;
- goto parseError;
- }
- d->xmlVersion = string();
- break;
- case EorSD:
- // get the EDecl or SDDecl (syntax like an attribute)
- if ( !parseOk ) {
- d->error = XMLERR_EDECLORSDDECLEXPECTED;
- goto parseError;
- }
- if ( name() == "standalone" ) {
- if ( string()=="yes" ) {
- d->standalone = QXmlSimpleReaderPrivate::Yes;
- } else if ( string()=="no" ) {
- d->standalone = QXmlSimpleReaderPrivate::No;
- } else {
- d->error = XMLERR_WRONGVALUEFORSDECL;
- goto parseError;
- }
- } else if ( name() == "encoding" ) {
- d->encoding = string();
- } else {
- d->error = XMLERR_EDECLORSDDECLEXPECTED;
- goto parseError;
- }
- break;
- case SD:
- if ( !parseOk ) {
- d->error = XMLERR_SDDECLEXPECTED;
- goto parseError;
- }
- if ( name() != "standalone" ) {
- d->error = XMLERR_SDDECLEXPECTED;
- goto parseError;
- }
- if ( string()=="yes" ) {
- d->standalone = QXmlSimpleReaderPrivate::Yes;
- } else if ( string()=="no" ) {
- d->standalone = QXmlSimpleReaderPrivate::No;
- } else {
- d->error = XMLERR_WRONGVALUEFORSDECL;
- goto parseError;
- }
- break;
- case Qm:
- // test if the skipping was legal
- if ( c != '>' ) {
- stringAddC( '?' );
- }
- break;
- case Done:
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse a document type definition (doctypedecl [28]).
-
- Precondition: the beginning '<!' of the doctype is already read the head
- stands on the 'D' of '<!DOCTYPE'.
-
- If this function was successful, the head-position is on the first
- character after the document type definition.
-*/
-bool QXmlSimpleReader::parseDoctype()
-{
- // some init-stuff
- d->systemId = QString::null;
- d->publicId = QString::null;
-
- const signed char Init = 0;
- const signed char Doctype = 1; // read the doctype
- const signed char Ws1 = 2; // eat_ws
- const signed char Doctype2 = 3; // read the doctype, part 2
- const signed char Ws2 = 4; // eat_ws
- const signed char Sys = 5; // read SYSTEM
- const signed char Ws3 = 6; // eat_ws
- const signed char MP = 7; // markupdecl or PEReference
- const signed char PER = 8; // PERReference
- const signed char Mup = 9; // markupdecl
- const signed char Ws4 = 10; // eat_ws
- const signed char MPE = 11; // end of markupdecl or PEReference
- const signed char Done = 12;
-
- const signed char InpWs = 0;
- const signed char InpD = 1; // 'D'
- const signed char InpS = 2; // 'S' or 'P'
- const signed char InpOB = 3; // [
- const signed char InpCB = 4; // ]
- const signed char InpPer = 5; // %
- const signed char InpGt = 6; // >
- const signed char InpUnknown = 7;
-
- // use some kind of state machine for parsing
- static signed char table[12][8] = {
- /* InpWs, InpD InpS InpOB InpCB InpPer InpGt InpUnknown */
- { -1, Doctype, -1, -1, -1, -1, -1, -1 }, // Init
- { Ws1, Doctype2, Doctype2, -1, -1, -1, -1, Doctype2 }, // Doctype
- { -1, Doctype2, Doctype2, -1, -1, -1, -1, Doctype2 }, // Ws1
- { Ws2, -1, Sys, MP, -1, -1, Done, -1 }, // Doctype2
- { -1, -1, Sys, MP, -1, -1, Done, -1 }, // Ws2
- { Ws3, -1, -1, MP, -1, -1, Done, -1 }, // Sys
- { -1, -1, -1, MP, -1, -1, Done, -1 }, // Ws3
- { -1, -1, -1, -1, MPE, PER, -1, Mup }, // MP
- { Ws4, -1, -1, -1, MPE, PER, -1, Mup }, // PER
- { Ws4, -1, -1, -1, MPE, PER, -1, Mup }, // Mup
- { -1, -1, -1, -1, MPE, PER, -1, Mup }, // Ws4
- { -1, -1, -1, -1, -1, -1, Done, -1 } // MPE
- };
- signed char state = Init;
- signed char input;
- bool parseOk = TRUE;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( is_S(c) ) {
- input = InpWs;
- } else if ( c == 'D' ) {
- input = InpD;
- } else if ( c == 'S' ) {
- input = InpS;
- } else if ( c == 'P' ) {
- input = InpS;
- } else if ( c == '[' ) {
- input = InpOB;
- } else if ( c == ']' ) {
- input = InpCB;
- } else if ( c == '%' ) {
- input = InpPer;
- } else if ( c == '>' ) {
- input = InpGt;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case Doctype:
- parseOk = parseString( "DOCTYPE" );
- break;
- case Ws1:
- case Ws2:
- case Ws3:
- case Ws4:
- eat_ws();
- break;
- case Doctype2:
- parseName();
- break;
- case Sys:
- parseOk = parseExternalID();
- break;
- case MP:
- next_eat_ws();
- break;
- case PER:
- parseOk = parsePEReference( InDTD );
- break;
- case Mup:
- parseOk = parseMarkupdecl();
- break;
- case MPE:
- next_eat_ws();
- break;
- case Done:
- if ( lexicalHnd ) {
- if ( !lexicalHnd->endDTD() ) {
- d->error = lexicalHnd->errorString();
- goto parseError;
- }
- }
- next();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case Doctype:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGDOCTYPE;
- goto parseError;
- }
- if ( !is_S(c) ) {
- d->error = XMLERR_ERRORPARSINGDOCTYPE;
- goto parseError;
- }
- break;
- case Doctype2:
- d->doctype = name();
- if ( lexicalHnd ) {
- if ( !lexicalHnd->startDTD( d->doctype, d->publicId, d->systemId ) ) {
- d->error = lexicalHnd->errorString();
- goto parseError;
- }
- }
- break;
- case Sys:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGDOCTYPE;
- goto parseError;
- }
- break;
- case PER:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGDOCTYPE;
- goto parseError;
- }
- break;
- case Mup:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGDOCTYPE;
- goto parseError;
- }
- break;
- case Done:
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_ERRORPARSINGDOCTYPE;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse a ExternalID [75].
-
- If allowPublicID is TRUE parse ExternalID [75] or PublicID [83].
-*/
-bool QXmlSimpleReader::parseExternalID( bool allowPublicID )
-{
- // some init-stuff
- d->systemId = QString::null;
- d->publicId = QString::null;
-
- const signed char Init = 0;
- const signed char Sys = 1; // parse 'SYSTEM'
- const signed char SysWS = 2; // parse the whitespace after 'SYSTEM'
- const signed char SysSQ = 3; // parse SystemLiteral with '
- const signed char SysSQ2 = 4; // parse SystemLiteral with '
- const signed char SysDQ = 5; // parse SystemLiteral with "
- const signed char SysDQ2 = 6; // parse SystemLiteral with "
- const signed char Pub = 7; // parse 'PUBLIC'
- const signed char PubWS = 8; // parse the whitespace after 'PUBLIC'
- const signed char PubSQ = 9; // parse PubidLiteral with '
- const signed char PubSQ2 = 10; // parse PubidLiteral with '
- const signed char PubDQ = 11; // parse PubidLiteral with "
- const signed char PubDQ2 = 12; // parse PubidLiteral with "
- const signed char PubE = 13; // finished parsing the PubidLiteral
- const signed char PubWS2 = 14; // parse the whitespace after the PubidLiteral
- const signed char PDone = 15; // done if allowPublicID is TRUE
- const signed char Done = 16;
-
- const signed char InpSQ = 0; // '
- const signed char InpDQ = 1; // "
- const signed char InpS = 2; // S
- const signed char InpP = 3; // P
- const signed char InpWs = 4; // white space
- const signed char InpUnknown = 5;
-
- // use some kind of state machine for parsing
- static signed char table[15][6] = {
- /* InpSQ InpDQ InpS InpP InpWs InpUnknown */
- { -1, -1, Sys, Pub, -1, -1 }, // Init
- { -1, -1, -1, -1, SysWS, -1 }, // Sys
- { SysSQ, SysDQ, -1, -1, -1, -1 }, // SysWS
- { Done, SysSQ2, SysSQ2, SysSQ2, SysSQ2, SysSQ2 }, // SysSQ
- { Done, SysSQ2, SysSQ2, SysSQ2, SysSQ2, SysSQ2 }, // SysSQ2
- { SysDQ2, Done, SysDQ2, SysDQ2, SysDQ2, SysDQ2 }, // SysDQ
- { SysDQ2, Done, SysDQ2, SysDQ2, SysDQ2, SysDQ2 }, // SysDQ2
- { -1, -1, -1, -1, PubWS, -1 }, // Pub
- { PubSQ, PubDQ, -1, -1, -1, -1 }, // PubWS
- { PubE, -1, PubSQ2, PubSQ2, PubSQ2, PubSQ2 }, // PubSQ
- { PubE, -1, PubSQ2, PubSQ2, PubSQ2, PubSQ2 }, // PubSQ2
- { -1, PubE, PubDQ2, PubDQ2, PubDQ2, PubDQ2 }, // PubDQ
- { -1, PubE, PubDQ2, PubDQ2, PubDQ2, PubDQ2 }, // PubDQ2
- { PDone, PDone, PDone, PDone, PubWS2, PDone }, // PubE
- { SysSQ, SysDQ, PDone, PDone, PDone, PDone } // PubWS2
- };
- signed char state = Init;
- signed char input;
- bool parseOk = TRUE;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( is_S(c) ) {
- input = InpWs;
- } else if ( c == '\'' ) {
- input = InpSQ;
- } else if ( c == '"' ) {
- input = InpDQ;
- } else if ( c == 'S' ) {
- input = InpS;
- } else if ( c == 'P' ) {
- input = InpP;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case Sys:
- parseOk = parseString( "SYSTEM" );
- break;
- case SysWS:
- eat_ws();
- break;
- case SysSQ:
- case SysDQ:
- stringClear();
- next();
- break;
- case SysSQ2:
- case SysDQ2:
- stringAddC();
- next();
- break;
- case Pub:
- parseOk = parseString( "PUBLIC" );
- break;
- case PubWS:
- eat_ws();
- break;
- case PubSQ:
- case PubDQ:
- stringClear();
- next();
- break;
- case PubSQ2:
- case PubDQ2:
- stringAddC();
- next();
- break;
- case PubE:
- next();
- break;
- case PubWS2:
- d->publicId = string();
- eat_ws();
- break;
- case Done:
- d->systemId = string();
- next();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case Sys:
- if( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case Pub:
- if( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case PDone:
- if ( allowPublicID ) {
- d->publicId = string();
- return TRUE;
- } else {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case Done:
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse a markupdecl [29].
-*/
-bool QXmlSimpleReader::parseMarkupdecl()
-{
- const signed char Init = 0;
- const signed char Lt = 1; // < was read
- const signed char Em = 2; // ! was read
- const signed char CE = 3; // E was read
- const signed char Qm = 4; // ? was read
- const signed char Dash = 5; // - was read
- const signed char CA = 6; // A was read
- const signed char CEL = 7; // EL was read
- const signed char CEN = 8; // EN was read
- const signed char CN = 9; // N was read
- const signed char Done = 10;
-
- const signed char InpLt = 0; // <
- const signed char InpQm = 1; // ?
- const signed char InpEm = 2; // !
- const signed char InpDash = 3; // -
- const signed char InpA = 4; // A
- const signed char InpE = 5; // E
- const signed char InpL = 6; // L
- const signed char InpN = 7; // N
- const signed char InpUnknown = 8;
-
- // use some kind of state machine for parsing
- static signed char table[4][9] = {
- /* InpLt InpQm InpEm InpDash InpA InpE InpL InpN InpUnknown */
- { Lt, -1, -1, -1, -1, -1, -1, -1, -1 }, // Init
- { -1, Qm, Em, -1, -1, -1, -1, -1, -1 }, // Lt
- { -1, -1, -1, Dash, CA, CE, -1, CN, -1 }, // Em
- { -1, -1, -1, -1, -1, -1, CEL, CEN, -1 } // CE
- };
- signed char state = Init;
- signed char input;
- bool parseOk = TRUE;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( c == '<' ) {
- input = InpLt;
- } else if ( c == '?' ) {
- input = InpQm;
- } else if ( c == '!' ) {
- input = InpEm;
- } else if ( c == '-' ) {
- input = InpDash;
- } else if ( c == 'A' ) {
- input = InpA;
- } else if ( c == 'E' ) {
- input = InpE;
- } else if ( c == 'L' ) {
- input = InpL;
- } else if ( c == 'N' ) {
- input = InpN;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case Lt:
- next();
- break;
- case Em:
- next();
- break;
- case CE:
- next();
- break;
- case Qm:
- parseOk = parsePI();
- break;
- case Dash:
- parseOk = parseComment();
- break;
- case CA:
- parseOk = parseAttlistDecl();
- break;
- case CEL:
- parseOk = parseElementDecl();
- break;
- case CEN:
- parseOk = parseEntityDecl();
- break;
- case CN:
- parseOk = parseNotationDecl();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case Qm:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGPI;
- goto parseError;
- }
- if ( contentHnd ) {
- if ( !contentHnd->processingInstruction(name(),string()) ) {
- d->error = contentHnd->errorString();
- goto parseError;
- }
- }
- return TRUE;
- case Dash:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGCOMMENT;
- goto parseError;
- }
- if ( lexicalHnd ) {
- if ( !lexicalHnd->comment( string() ) ) {
- d->error = lexicalHnd->errorString();
- goto parseError;
- }
- }
- return TRUE;
- case CA:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGATTLISTDECL;
- goto parseError;
- }
- return TRUE;
- case CEL:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGELEMENTDECL;
- goto parseError;
- }
- return TRUE;
- case CEN:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGENTITYDECL;
- goto parseError;
- }
- return TRUE;
- case CN:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGNOTATIONDECL;
- goto parseError;
- }
- return TRUE;
- case Done:
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_LETTEREXPECTED;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse a PEReference [69]
-*/
-bool QXmlSimpleReader::parsePEReference( EntityRecognitionContext context )
-{
- const signed char Init = 0;
- const signed char Next = 1;
- const signed char Name = 2;
- const signed char Done = 3;
-
- const signed char InpSemi = 0; // ;
- const signed char InpPer = 1; // %
- const signed char InpUnknown = 2;
-
- // use some kind of state machine for parsing
- static signed char table[3][3] = {
- /* InpSemi InpPer InpUnknown */
- { -1, Next, -1 }, // Init
- { -1, -1, Name }, // Next
- { Done, -1, -1 } // Name
- };
- signed char state = Init;
- signed char input;
- bool parseOk = TRUE;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( c == ';' ) {
- input = InpSemi;
- } else if ( c == '%' ) {
- input = InpPer;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case Next:
- next();
- break;
- case Name:
- parseOk = parseName( TRUE );
- break;
- case Done:
- next();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case Name:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGNAME;
- goto parseError;
- }
- if ( d->parameterEntities.find( ref() ) == d->parameterEntities.end() ) {
- // ### skip it???
- if ( contentHnd ) {
- if ( !contentHnd->skippedEntity( QString("%") + ref() ) ) {
- d->error = contentHnd->errorString();
- goto parseError;
- }
- }
- } else {
- if ( context == InEntityValue ) {
- // Included in literal
- xmlRef = d->parameterEntities.find( ref() )
- .data().replace( QRegExp("\""), "&quot;" ).replace( QRegExp("'"), "&apos;" )
- + xmlRef;
- } else if ( context == InDTD ) {
- // Included as PE
- xmlRef = QString(" ") +
- d->parameterEntities.find( ref() ).data() +
- QString(" ") + xmlRef;
- }
- }
- break;
- case Done:
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_LETTEREXPECTED;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse a AttlistDecl [52].
-
- Precondition: the beginning '<!' is already read and the head
- stands on the 'A' of '<!ATTLIST'
-*/
-bool QXmlSimpleReader::parseAttlistDecl()
-{
- const signed char Init = 0;
- const signed char Attlist = 1; // parse the string "ATTLIST"
- const signed char Ws = 2; // whitespace read
- const signed char Name = 3; // parse name
- const signed char Ws1 = 4; // whitespace read
- const signed char Attdef = 5; // parse the AttDef
- const signed char Ws2 = 6; // whitespace read
- const signed char Atttype = 7; // parse the AttType
- const signed char Ws3 = 8; // whitespace read
- const signed char DDecH = 9; // DefaultDecl with #
- const signed char DefReq = 10; // parse the string "REQUIRED"
- const signed char DefImp = 11; // parse the string "IMPLIED"
- const signed char DefFix = 12; // parse the string "FIXED"
- const signed char Attval = 13; // parse the AttValue
- const signed char Ws4 = 14; // whitespace read
- const signed char Done = 15;
-
- const signed char InpWs = 0; // white space
- const signed char InpGt = 1; // >
- const signed char InpHash = 2; // #
- const signed char InpA = 3; // A
- const signed char InpI = 4; // I
- const signed char InpF = 5; // F
- const signed char InpR = 6; // R
- const signed char InpUnknown = 7;
-
- // use some kind of state machine for parsing
- static signed char table[15][8] = {
- /* InpWs InpGt InpHash InpA InpI InpF InpR InpUnknown */
- { -1, -1, -1, Attlist, -1, -1, -1, -1 }, // Init
- { Ws, -1, -1, -1, -1, -1, -1, -1 }, // Attlist
- { -1, -1, -1, Name, Name, Name, Name, Name }, // Ws
- { Ws1, Done, Attdef, Attdef, Attdef, Attdef, Attdef, Attdef }, // Name
- { -1, Done, Attdef, Attdef, Attdef, Attdef, Attdef, Attdef }, // Ws1
- { Ws2, -1, -1, -1, -1, -1, -1, -1 }, // Attdef
- { -1, Atttype, Atttype, Atttype, Atttype, Atttype, Atttype, Atttype }, // Ws2
- { Ws3, -1, -1, -1, -1, -1, -1, -1 }, // Atttype
- { -1, Attval, DDecH, Attval, Attval, Attval, Attval, Attval }, // Ws3
- { -1, -1, -1, -1, DefImp, DefFix, DefReq, -1 }, // DDecH
- { Ws4, Ws4, -1, -1, -1, -1, -1, -1 }, // DefReq
- { Ws4, Ws4, -1, -1, -1, -1, -1, -1 }, // DefImp
- { Ws3, -1, -1, -1, -1, -1, -1, -1 }, // DefFix
- { Ws4, Ws4, -1, -1, -1, -1, -1, -1 }, // Attval
- { -1, Done, Attdef, Attdef, Attdef, Attdef, Attdef, Attdef } // Ws4
- };
- signed char state = Init;
- signed char input;
- bool parseOk = TRUE;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( is_S(c) ) {
- input = InpWs;
- } else if ( c == '>' ) {
- input = InpGt;
- } else if ( c == '#' ) {
- input = InpHash;
- } else if ( c == 'A' ) {
- input = InpA;
- } else if ( c == 'I' ) {
- input = InpI;
- } else if ( c == 'F' ) {
- input = InpF;
- } else if ( c == 'R' ) {
- input = InpR;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case Attlist:
- parseOk = parseString( "ATTLIST" );
- break;
- case Ws:
- case Ws1:
- case Ws2:
- case Ws3:
- eat_ws();
- break;
- case Name:
- parseOk = parseName();
- break;
- case Attdef:
- parseOk = parseName();
- break;
- case Atttype:
- parseOk = parseAttType();
- break;
- case DDecH:
- next();
- break;
- case DefReq:
- parseOk = parseString( "REQUIRED" );
- break;
- case DefImp:
- parseOk = parseString( "IMPLIED" );
- break;
- case DefFix:
- parseOk = parseString( "FIXED" );
- break;
- case Attval:
- parseOk = parseAttValue();
- break;
- case Ws4:
- if ( declHnd ) {
- // TODO: not all values are computed yet...
- if ( !declHnd->attributeDecl( d->attDeclEName, d->attDeclAName, "", "", "" ) ) {
- d->error = declHnd->errorString();
- goto parseError;
- }
- }
- eat_ws();
- break;
- case Done:
- next();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case Attlist:
- if( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case Name:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGNAME;
- goto parseError;
- }
- d->attDeclEName = name();
- break;
- case Attdef:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGNAME;
- goto parseError;
- }
- d->attDeclAName = name();
- break;
- case Atttype:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGATTTYPE;
- goto parseError;
- }
- break;
- case DefReq:
- if( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case DefImp:
- if( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case DefFix:
- if( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case Attval:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGATTVALUE;
- goto parseError;
- }
- break;
- case Done:
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_LETTEREXPECTED;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse a AttType [54]
-*/
-bool QXmlSimpleReader::parseAttType()
-{
- const signed char Init = 0;
- const signed char ST = 1; // StringType
- const signed char TTI = 2; // TokenizedType starting with 'I'
- const signed char TTI2 = 3; // TokenizedType helpstate
- const signed char TTI3 = 4; // TokenizedType helpstate
- const signed char TTE = 5; // TokenizedType starting with 'E'
- const signed char TTEY = 6; // TokenizedType starting with 'ENTITY'
- const signed char TTEI = 7; // TokenizedType starting with 'ENTITI'
- const signed char N = 8; // N read (TokenizedType or Notation)
- const signed char TTNM = 9; // TokenizedType starting with 'NM'
- const signed char TTNM2 = 10; // TokenizedType helpstate
- const signed char NO = 11; // Notation
- const signed char NO2 = 12; // Notation helpstate
- const signed char NO3 = 13; // Notation helpstate
- const signed char NOName = 14; // Notation, read name
- const signed char NO4 = 15; // Notation helpstate
- const signed char EN = 16; // Enumeration
- const signed char ENNmt = 17; // Enumeration, read Nmtoken
- const signed char EN2 = 18; // Enumeration helpstate
- const signed char ADone = 19; // almost done (make next and accept)
- const signed char Done = 20;
-
- const signed char InpWs = 0; // whitespace
- const signed char InpOp = 1; // (
- const signed char InpCp = 2; // )
- const signed char InpPipe = 3; // |
- const signed char InpC = 4; // C
- const signed char InpE = 5; // E
- const signed char InpI = 6; // I
- const signed char InpM = 7; // M
- const signed char InpN = 8; // N
- const signed char InpO = 9; // O
- const signed char InpR = 10; // R
- const signed char InpS = 11; // S
- const signed char InpY = 12; // Y
- const signed char InpUnknown = 13;
-
- // use some kind of state machine for parsing
- static signed char table[19][14] = {
- /* InpWs InpOp InpCp InpPipe InpC InpE InpI InpM InpN InpO InpR InpS InpY InpUnknown */
- { -1, EN, -1, -1, ST, TTE, TTI, -1, N, -1, -1, -1, -1, -1 }, // Init
- { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, // ST
- { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, TTI2, Done, Done, Done }, // TTI
- { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, TTI3, Done, Done }, // TTI2
- { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, // TTI3
- { -1, -1, -1, -1, -1, -1, TTEI, -1, -1, -1, -1, -1, TTEY, -1 }, // TTE
- { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, // TTEY
- { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, // TTEI
- { -1, -1, -1, -1, -1, -1, -1, TTNM, -1, NO, -1, -1, -1, -1 }, // N
- { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, TTNM2, Done, Done }, // TTNM
- { Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done, Done }, // TTNM2
- { NO2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // NO
- { -1, NO3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // NO2
- { NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName, NOName }, // NO3
- { NO4, -1, ADone, NO3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // NOName
- { -1, -1, ADone, NO3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // NO4
- { -1, -1, ENNmt, -1, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt, ENNmt }, // EN
- { EN2, -1, ADone, EN, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // ENNmt
- { -1, -1, ADone, EN, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } // EN2
- };
- signed char state = Init;
- signed char input;
- bool parseOk = TRUE;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( is_S(c) ) {
- input = InpWs;
- } else if ( c == '(' ) {
- input = InpOp;
- } else if ( c == ')' ) {
- input = InpCp;
- } else if ( c == '|' ) {
- input = InpPipe;
- } else if ( c == 'C' ) {
- input = InpC;
- } else if ( c == 'E' ) {
- input = InpE;
- } else if ( c == 'I' ) {
- input = InpI;
- } else if ( c == 'M' ) {
- input = InpM;
- } else if ( c == 'N' ) {
- input = InpN;
- } else if ( c == 'O' ) {
- input = InpO;
- } else if ( c == 'R' ) {
- input = InpR;
- } else if ( c == 'S' ) {
- input = InpS;
- } else if ( c == 'Y' ) {
- input = InpY;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case ST:
- parseOk = parseString( "CDATA" );
- break;
- case TTI:
- parseOk = parseString( "ID" );
- break;
- case TTI2:
- parseOk = parseString( "REF" );
- break;
- case TTI3:
- next(); // S
- break;
- case TTE:
- parseOk = parseString( "ENTIT" );
- break;
- case TTEY:
- next(); // Y
- break;
- case TTEI:
- parseOk = parseString( "IES" );
- break;
- case N:
- next(); // N
- break;
- case TTNM:
- parseOk = parseString( "MTOKEN" );
- break;
- case TTNM2:
- next(); // S
- break;
- case NO:
- parseOk = parseString( "OTATION" );
- break;
- case NO2:
- eat_ws();
- break;
- case NO3:
- next_eat_ws();
- break;
- case NOName:
- parseOk = parseName();
- break;
- case NO4:
- eat_ws();
- break;
- case EN:
- next_eat_ws();
- break;
- case ENNmt:
- parseOk = parseNmtoken();
- break;
- case EN2:
- eat_ws();
- break;
- case ADone:
- next();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case ST:
- if( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case TTI:
- if( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case TTI2:
- if( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case TTE:
- if( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case TTEI:
- if( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case TTNM:
- if( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case NO:
- if( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case NOName:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGNAME;
- goto parseError;
- }
- break;
- case ENNmt:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGNMTOKEN;
- goto parseError;
- }
- break;
- case ADone:
- return TRUE;
- case Done:
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_LETTEREXPECTED;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse a AttValue [10]
-
- Precondition: the head stands on the beginning " or '
-
- If this function was successful, the head stands on the first
- character after the closing " or ' and the value of the attribute
- is in string().
-*/
-bool QXmlSimpleReader::parseAttValue()
-{
- bool tmp;
-
- const signed char Init = 0;
- const signed char Dq = 1; // double quotes were read
- const signed char DqRef = 2; // read references in double quotes
- const signed char DqC = 3; // signed character read in double quotes
- const signed char Sq = 4; // single quotes were read
- const signed char SqRef = 5; // read references in single quotes
- const signed char SqC = 6; // signed character read in single quotes
- const signed char Done = 7;
-
- const signed char InpDq = 0; // "
- const signed char InpSq = 1; // '
- const signed char InpAmp = 2; // &
- const signed char InpLt = 3; // <
- const signed char InpUnknown = 4;
-
- // use some kind of state machine for parsing
- static signed char table[7][5] = {
- /* InpDq InpSq InpAmp InpLt InpUnknown */
- { Dq, Sq, -1, -1, -1 }, // Init
- { Done, DqC, DqRef, -1, DqC }, // Dq
- { Done, DqC, DqRef, -1, DqC }, // DqRef
- { Done, DqC, DqRef, -1, DqC }, // DqC
- { SqC, Done, SqRef, -1, SqC }, // Sq
- { SqC, Done, SqRef, -1, SqC }, // SqRef
- { SqC, Done, SqRef, -1, SqC } // SqRef
- };
- signed char state = Init;
- signed char input;
- bool parseOk = TRUE;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( c == '"' ) {
- input = InpDq;
- } else if ( c == '\'' ) {
- input = InpSq;
- } else if ( c == '&' ) {
- input = InpAmp;
- } else if ( c == '<' ) {
- input = InpLt;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case Dq:
- case Sq:
- stringClear();
- next();
- break;
- case DqRef:
- case SqRef:
- parseOk = parseReference( tmp, InAttributeValue );
- break;
- case DqC:
- case SqC:
- stringAddC();
- next();
- break;
- case Done:
- next();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case DqRef:
- case SqRef:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGREFERENCE;
- goto parseError;
- }
- break;
- case Done:
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse a elementdecl [45].
-
- Precondition: the beginning '<!E' is already read and the head
- stands on the 'L' of '<!ELEMENT'
-*/
-bool QXmlSimpleReader::parseElementDecl()
-{
- const signed char Init = 0;
- const signed char Elem = 1; // parse the beginning string
- const signed char Ws1 = 2; // whitespace required
- const signed char Nam = 3; // parse Name
- const signed char Ws2 = 4; // whitespace required
- const signed char Empty = 5; // read EMPTY
- const signed char Any = 6; // read ANY
- const signed char Cont = 7; // read contentspec (except ANY or EMPTY)
- const signed char Mix = 8; // read Mixed
- const signed char Mix2 = 9; //
- const signed char Mix3 = 10; //
- const signed char MixN1 = 11; //
- const signed char MixN2 = 12; //
- const signed char MixN3 = 13; //
- const signed char MixN4 = 14; //
- const signed char Cp = 15; // parse cp
- const signed char Cp2 = 16; //
- const signed char WsD = 17; // eat whitespace before Done
- const signed char Done = 18;
-
- const signed char InpWs = 0;
- const signed char InpGt = 1; // >
- const signed char InpPipe = 2; // |
- const signed char InpOp = 3; // (
- const signed char InpCp = 4; // )
- const signed char InpHash = 5; // #
- const signed char InpQm = 6; // ?
- const signed char InpAst = 7; // *
- const signed char InpPlus = 8; // +
- const signed char InpA = 9; // A
- const signed char InpE = 10; // E
- const signed char InpL = 11; // L
- const signed char InpUnknown = 12;
-
- // use some kind of state machine for parsing
- static signed char table[18][13] = {
- /* InpWs InpGt InpPipe InpOp InpCp InpHash InpQm InpAst InpPlus InpA InpE InpL InpUnknown */
- { -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, Elem, -1 }, // Init
- { Ws1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // Elem
- { -1, -1, -1, -1, -1, -1, -1, -1, -1, Nam, Nam, Nam, Nam }, // Ws1
- { Ws2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // Nam
- { -1, -1, -1, Cont, -1, -1, -1, -1, -1, Any, Empty, -1, -1 }, // Ws2
- { WsD, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // Empty
- { WsD, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // Any
- { -1, -1, -1, Cp, Cp, Mix, -1, -1, -1, Cp, Cp, Cp, Cp }, // Cont
- { Mix2, -1, MixN1, -1, Mix3, -1, -1, -1, -1, -1, -1, -1, -1 }, // Mix
- { -1, -1, MixN1, -1, Mix3, -1, -1, -1, -1, -1, -1, -1, -1 }, // Mix2
- { WsD, Done, -1, -1, -1, -1, -1, WsD, -1, -1, -1, -1, -1 }, // Mix3
- { -1, -1, -1, -1, -1, -1, -1, -1, -1, MixN2, MixN2, MixN2, MixN2 }, // MixN1
- { MixN3, -1, MixN1, -1, MixN4, -1, -1, -1, -1, -1, -1, -1, -1 }, // MixN2
- { -1, -1, MixN1, -1, MixN4, -1, -1, -1, -1, -1, -1, -1, -1 }, // MixN3
- { -1, -1, -1, -1, -1, -1, -1, WsD, -1, -1, -1, -1, -1 }, // MixN4
- { WsD, Done, -1, -1, -1, -1, Cp2, Cp2, Cp2, -1, -1, -1, -1 }, // Cp
- { WsD, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }, // Cp2
- { -1, Done, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 } // WsD
- };
- signed char state = Init;
- signed char input;
- bool parseOk = TRUE;
-
- while ( TRUE ) {
-
- // read input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( is_S(c) ) {
- input = InpWs;
- } else if ( c == '>' ) {
- input = InpGt;
- } else if ( c == '|' ) {
- input = InpPipe;
- } else if ( c == '(' ) {
- input = InpOp;
- } else if ( c == ')' ) {
- input = InpCp;
- } else if ( c == '#' ) {
- input = InpHash;
- } else if ( c == '?' ) {
- input = InpQm;
- } else if ( c == '*' ) {
- input = InpAst;
- } else if ( c == '+' ) {
- input = InpPlus;
- } else if ( c == 'A' ) {
- input = InpA;
- } else if ( c == 'E' ) {
- input = InpE;
- } else if ( c == 'L' ) {
- input = InpL;
- } else {
- input = InpUnknown;
- }
- // get new state
-//qDebug( "%d -%d(%c)-> %d", state, input, c.latin1(), table[state][input] );
- state = table[state][input];
-
- // in some cases do special actions depending on state
- switch ( state ) {
- case Elem:
- parseOk = parseString( "LEMENT" );
- break;
- case Ws1:
- eat_ws();
- break;
- case Nam:
- parseOk = parseName();
- break;
- case Ws2:
- eat_ws();
- break;
- case Empty:
- parseOk = parseString( "EMPTY" );
- break;
- case Any:
- parseOk = parseString( "ANY" );
- break;
- case Cont:
- next_eat_ws();
- break;
- case Mix:
- parseOk = parseString( "#PCDATA" );
- break;
- case Mix2:
- eat_ws();
- break;
- case Mix3:
- next();
- break;
- case MixN1:
- next_eat_ws();
- break;
- case MixN2:
- parseOk = parseName();
- break;
- case MixN3:
- eat_ws();
- break;
- case MixN4:
- next();
- break;
- case Cp:
- parseOk = parseChoiceSeq();
- break;
- case Cp2:
- next();
- break;
- case WsD:
- next_eat_ws();
- break;
- case Done:
- next();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case Elem:
- if( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case Nam:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGNAME;
- goto parseError;
- }
- break;
- case Empty:
- if( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case Any:
- if( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case Mix:
- if( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case MixN2:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGNAME;
- goto parseError;
- }
- break;
- case Cp:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGCHOICE;
- goto parseError;
- }
- break;
- case Done:
- return TRUE;
- case -1:
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse a NotationDecl [82].
-
- Precondition: the beginning '<!' is already read and the head
- stands on the 'N' of '<!NOTATION'
-*/
-bool QXmlSimpleReader::parseNotationDecl()
-{
- const signed char Init = 0;
- const signed char Not = 1; // read NOTATION
- const signed char Ws1 = 2; // eat whitespaces
- const signed char Nam = 3; // read Name
- const signed char Ws2 = 4; // eat whitespaces
- const signed char ExtID = 5; // parse ExternalID
- const signed char Ws3 = 6; // eat whitespaces
- const signed char Done = 7;
-
- const signed char InpWs = 0;
- const signed char InpGt = 1; // >
- const signed char InpN = 2; // N
- const signed char InpUnknown = 3;
-
- // use some kind of state machine for parsing
- static signed char table[7][4] = {
- /* InpWs InpGt InpN InpUnknown */
- { -1, -1, Not, -1 }, // Init
- { Ws1, -1, -1, -1 }, // Not
- { -1, -1, Nam, Nam }, // Ws1
- { Ws2, Done, -1, -1 }, // Nam
- { -1, Done, ExtID, ExtID }, // Ws2
- { Ws3, Done, -1, -1 }, // ExtID
- { -1, Done, -1, -1 } // Ws3
- };
- signed char state = Init;
- signed char input;
- bool parseOk = TRUE;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( is_S(c) ) {
- input = InpWs;
- } else if ( c == '>' ) {
- input = InpGt;
- } else if ( c == 'N' ) {
- input = InpN;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case Not:
- parseOk = parseString( "NOTATION" );
- break;
- case Ws1:
- eat_ws();
- break;
- case Nam:
- parseOk = parseName();
- break;
- case Ws2:
- eat_ws();
- break;
- case ExtID:
- parseOk = parseExternalID( TRUE );
- break;
- case Ws3:
- eat_ws();
- break;
- case Done:
- next();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case Not:
- if ( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case Nam:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGNAME;
- goto parseError;
- }
- break;
- case ExtID:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGEXTERNALID;
- goto parseError;
- }
- // call the handler
- if ( dtdHnd ) {
- if ( !dtdHnd->notationDecl( name(), d->publicId, d->systemId ) ) {
- d->error = dtdHnd->errorString();
- goto parseError;
- }
- }
- break;
- case Done:
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse choice [49] or seq [50].
-
- Precondition: the beginning '('S? is already read and the head
- stands on the first non-whitespace character after it.
-*/
-bool QXmlSimpleReader::parseChoiceSeq()
-{
- const signed char Init = 0;
- const signed char Ws1 = 1; // eat whitespace
- const signed char CS_ = 2; // choice or set
- const signed char Ws2 = 3; // eat whitespace
- const signed char More = 4; // more cp to read
- const signed char Name = 5; // read name
- const signed char Done = 6; //
-
- const signed char InpWs = 0; // S
- const signed char InpOp = 1; // (
- const signed char InpCp = 2; // )
- const signed char InpQm = 3; // ?
- const signed char InpAst = 4; // *
- const signed char InpPlus = 5; // +
- const signed char InpPipe = 6; // |
- const signed char InpComm = 7; // ,
- const signed char InpUnknown = 8;
-
- // use some kind of state machine for parsing
- static signed char table[6][9] = {
- /* InpWs InpOp InpCp InpQm InpAst InpPlus InpPipe InpComm InpUnknown */
- { -1, Ws1, -1, -1, -1, -1, -1, -1, Name }, // Init
- { -1, CS_, -1, -1, -1, -1, -1, -1, CS_ }, // Ws1
- { Ws2, -1, Done, Ws2, Ws2, Ws2, More, More, -1 }, // CS_
- { -1, -1, Done, -1, -1, -1, More, More, -1 }, // Ws2
- { -1, Ws1, -1, -1, -1, -1, -1, -1, Name }, // More (same as Init)
- { Ws2, -1, Done, Ws2, Ws2, Ws2, More, More, -1 } // Name (same as CS_)
- };
- signed char state = Init;
- signed char input;
- bool parseOk = TRUE;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( is_S(c) ) {
- input = InpWs;
- } else if ( c == '(' ) {
- input = InpOp;
- } else if ( c == ')' ) {
- input = InpCp;
- } else if ( c == '?' ) {
- input = InpQm;
- } else if ( c == '*' ) {
- input = InpAst;
- } else if ( c == '+' ) {
- input = InpPlus;
- } else if ( c == '|' ) {
- input = InpPipe;
- } else if ( c == ',' ) {
- input = InpComm;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case Ws1:
- next_eat_ws();
- break;
- case CS_:
- parseOk = parseChoiceSeq();
- break;
- case Ws2:
- next_eat_ws();
- break;
- case More:
- next_eat_ws();
- break;
- case Name:
- parseOk = parseName();
- break;
- case Done:
- next();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case CS_:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGCHOICE;
- goto parseError;
- }
- break;
- case Name:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGNAME;
- goto parseError;
- }
- break;
- case Done:
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse a EntityDecl [70].
-
- Precondition: the beginning '<!E' is already read and the head
- stand on the 'N' of '<!ENTITY'
-*/
-bool QXmlSimpleReader::parseEntityDecl()
-{
- const signed char Init = 0;
- const signed char Ent = 1; // parse "ENTITY"
- const signed char Ws1 = 2; // white space read
- const signed char Name = 3; // parse name
- const signed char Ws2 = 4; // white space read
- const signed char EValue = 5; // parse entity value
- const signed char ExtID = 6; // parse ExternalID
- const signed char Ws3 = 7; // white space read
- const signed char Ndata = 8; // parse "NDATA"
- const signed char Ws4 = 9; // white space read
- const signed char NNam = 10; // parse name
- const signed char PEDec = 11; // parse PEDecl
- const signed char Ws6 = 12; // white space read
- const signed char PENam = 13; // parse name
- const signed char Ws7 = 14; // white space read
- const signed char PEVal = 15; // parse entity value
- const signed char PEEID = 16; // parse ExternalID
- const signed char WsE = 17; // white space read
- const signed char EDDone = 19; // done, but also report an external, unparsed entity decl
- const signed char Done = 18;
-
- const signed char InpWs = 0; // white space
- const signed char InpPer = 1; // %
- const signed char InpQuot = 2; // " or '
- const signed char InpGt = 3; // >
- const signed char InpN = 4; // N
- const signed char InpUnknown = 5;
-
- // use some kind of state machine for parsing
- static signed char table[18][6] = {
- /* InpWs InpPer InpQuot InpGt InpN InpUnknown */
- { -1, -1, -1, -1, Ent, -1 }, // Init
- { Ws1, -1, -1, -1, -1, -1 }, // Ent
- { -1, PEDec, -1, -1, Name, Name }, // Ws1
- { Ws2, -1, -1, -1, -1, -1 }, // Name
- { -1, -1, EValue, -1, -1, ExtID }, // Ws2
- { WsE, -1, -1, Done, -1, -1 }, // EValue
- { Ws3, -1, -1, EDDone,-1, -1 }, // ExtID
- { -1, -1, -1, EDDone,Ndata, -1 }, // Ws3
- { Ws4, -1, -1, -1, -1, -1 }, // Ndata
- { -1, -1, -1, -1, NNam, NNam }, // Ws4
- { WsE, -1, -1, Done, -1, -1 }, // NNam
- { Ws6, -1, -1, -1, -1, -1 }, // PEDec
- { -1, -1, -1, -1, PENam, PENam }, // Ws6
- { Ws7, -1, -1, -1, -1, -1 }, // PENam
- { -1, -1, PEVal, -1, -1, PEEID }, // Ws7
- { WsE, -1, -1, Done, -1, -1 }, // PEVal
- { WsE, -1, -1, Done, -1, -1 }, // PEEID
- { -1, -1, -1, Done, -1, -1 } // WsE
- };
- signed char state = Init;
- signed char input;
- bool parseOk = TRUE;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( is_S(c) ) {
- input = InpWs;
- } else if ( c == '%' ) {
- input = InpPer;
- } else if ( c == '"' || c == '\'' ) {
- input = InpQuot;
- } else if ( c == '>' ) {
- input = InpGt;
- } else if ( c == 'N' ) {
- input = InpN;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case Ent:
- parseOk = parseString( "NTITY" );
- break;
- case Ws1:
- eat_ws();
- break;
- case Name:
- parseOk = parseName();
- break;
- case Ws2:
- eat_ws();
- break;
- case EValue:
- parseOk = parseEntityValue();
- break;
- case ExtID:
- parseOk = parseExternalID();
- break;
- case Ws3:
- eat_ws();
- break;
- case Ndata:
- parseOk = parseString( "NDATA" );
- break;
- case Ws4:
- eat_ws();
- break;
- case NNam:
- parseOk = parseName( TRUE );
- break;
- case PEDec:
- next();
- break;
- case Ws6:
- eat_ws();
- break;
- case PENam:
- parseOk = parseName();
- break;
- case Ws7:
- eat_ws();
- break;
- case PEVal:
- parseOk = parseEntityValue();
- break;
- case PEEID:
- parseOk = parseExternalID();
- break;
- case WsE:
- eat_ws();
- break;
- case EDDone:
- next();
- break;
- case Done:
- next();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case Ent:
- if ( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case Name:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGNAME;
- goto parseError;
- }
- break;
- case EValue:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGENTITYVALUE;
- goto parseError;
- }
- if ( !entityExist( name() ) ) {
- d->entities.insert( name(), string() );
- if ( declHnd ) {
- if ( !declHnd->internalEntityDecl( name(), string() ) ) {
- d->error = declHnd->errorString();
- goto parseError;
- }
- }
- }
- break;
- case ExtID:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGEXTERNALID;
- goto parseError;
- }
- break;
- case Ndata:
- if ( !parseOk ) {
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
- break;
- case NNam:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGNAME;
- goto parseError;
- }
- if ( !entityExist( name() ) ) {
- d->externEntities.insert( name(), QXmlSimpleReaderPrivate::ExternEntity( d->publicId, d->systemId, ref() ) );
- if ( dtdHnd ) {
- if ( !dtdHnd->unparsedEntityDecl( name(), d->publicId, d->systemId, ref() ) ) {
- d->error = declHnd->errorString();
- goto parseError;
- }
- }
- }
- break;
- case PENam:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGNAME;
- goto parseError;
- }
- break;
- case PEVal:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGENTITYVALUE;
- goto parseError;
- }
- if ( !entityExist( name() ) ) {
- d->parameterEntities.insert( name(), string() );
- if ( declHnd ) {
- if ( !declHnd->internalEntityDecl( QString("%")+name(), string() ) ) {
- d->error = declHnd->errorString();
- goto parseError;
- }
- }
- }
- break;
- case PEEID:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGEXTERNALID;
- goto parseError;
- }
- if ( !entityExist( name() ) ) {
- d->externParameterEntities.insert( name(), QXmlSimpleReaderPrivate::ExternParameterEntity( d->publicId, d->systemId ) );
- if ( declHnd ) {
- if ( !declHnd->externalEntityDecl( QString("%")+name(), d->publicId, d->systemId ) ) {
- d->error = declHnd->errorString();
- goto parseError;
- }
- }
- }
- break;
- case EDDone:
- if ( !entityExist( name() ) ) {
- d->externEntities.insert( name(), QXmlSimpleReaderPrivate::ExternEntity( d->publicId, d->systemId, QString::null ) );
- if ( declHnd ) {
- if ( !declHnd->externalEntityDecl( name(), d->publicId, d->systemId ) ) {
- d->error = declHnd->errorString();
- goto parseError;
- }
- }
- }
- return TRUE;
- case Done:
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_LETTEREXPECTED;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse a EntityValue [9]
-*/
-bool QXmlSimpleReader::parseEntityValue()
-{
- bool tmp;
-
- const signed char Init = 0;
- const signed char Dq = 1; // EntityValue is double quoted
- const signed char DqC = 2; // signed character
- const signed char DqPER = 3; // PEReference
- const signed char DqRef = 4; // Reference
- const signed char Sq = 5; // EntityValue is double quoted
- const signed char SqC = 6; // signed character
- const signed char SqPER = 7; // PEReference
- const signed char SqRef = 8; // Reference
- const signed char Done = 9;
-
- const signed char InpDq = 0; // "
- const signed char InpSq = 1; // '
- const signed char InpAmp = 2; // &
- const signed char InpPer = 3; // %
- const signed char InpUnknown = 4;
-
- // use some kind of state machine for parsing
- static signed char table[9][5] = {
- /* InpDq InpSq InpAmp InpPer InpUnknown */
- { Dq, Sq, -1, -1, -1 }, // Init
- { Done, DqC, DqRef, DqPER, DqC }, // Dq
- { Done, DqC, DqRef, DqPER, DqC }, // DqC
- { Done, DqC, DqRef, DqPER, DqC }, // DqPER
- { Done, DqC, DqRef, DqPER, DqC }, // DqRef
- { SqC, Done, SqRef, SqPER, SqC }, // Sq
- { SqC, Done, SqRef, SqPER, SqC }, // SqC
- { SqC, Done, SqRef, SqPER, SqC }, // SqPER
- { SqC, Done, SqRef, SqPER, SqC } // SqRef
- };
- signed char state = Init;
- signed char input;
- bool parseOk = TRUE;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( c == '"' ) {
- input = InpDq;
- } else if ( c == '\'' ) {
- input = InpSq;
- } else if ( c == '&' ) {
- input = InpAmp;
- } else if ( c == '%' ) {
- input = InpPer;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case Dq:
- case Sq:
- stringClear();
- next();
- break;
- case DqC:
- case SqC:
- stringAddC();
- next();
- break;
- case DqPER:
- case SqPER:
- parseOk = parsePEReference( InEntityValue );
- break;
- case DqRef:
- case SqRef:
- parseOk = parseReference( tmp, InEntityValue );
- break;
- case Done:
- next();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case DqPER:
- case SqPER:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGDOCTYPE;
- goto parseError;
- }
- break;
- case DqRef:
- case SqRef:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGREFERENCE;
- goto parseError;
- }
- break;
- case Done:
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_LETTEREXPECTED;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse a comment [15].
-
- Precondition: the beginning '<!' of the comment is already read and the head
- stands on the first '-' of '<!--'.
-
- If this function was successful, the head-position is on the first
- character after the comment.
-*/
-bool QXmlSimpleReader::parseComment()
-{
- const signed char Init = 0;
- const signed char Dash1 = 1; // the first dash was read
- const signed char Dash2 = 2; // the second dash was read
- const signed char Com = 3; // read comment
- const signed char Com2 = 4; // read comment (help state)
- const signed char ComE = 5; // finished reading comment
- const signed char Done = 6;
-
- const signed char InpDash = 0; // -
- const signed char InpGt = 1; // >
- const signed char InpUnknown = 2;
-
- // use some kind of state machine for parsing
- static signed char table[6][3] = {
- /* InpDash InpGt InpUnknown */
- { Dash1, -1, -1 }, // Init
- { Dash2, -1, -1 }, // Dash1
- { Com2, Com, Com }, // Dash2
- { Com2, Com, Com }, // Com
- { ComE, Com, Com }, // Com2
- { -1, Done, -1 } // ComE
- };
- signed char state = Init;
- signed char input;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( c == '-' ) {
- input = InpDash;
- } else if ( c == '>' ) {
- input = InpGt;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case Dash1:
- next();
- break;
- case Dash2:
- next();
- break;
- case Com:
- stringAddC();
- next();
- break;
- case Com2:
- next();
- break;
- case ComE:
- next();
- break;
- case Done:
- next();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case Dash2:
- stringClear();
- break;
- case Com2:
- // if next character is not a dash than don't skip it
- if ( c != '-' ) {
- stringAddC( '-' );
- }
- break;
- case Done:
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_ERRORPARSINGCOMMENT;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse a Attribute [41].
-
- Precondition: the head stands on the first character of the name of the
- attribute (i.e. all whitespaces are already parsed).
-
- The head stand on the next character after the end quotes. The variable name
- contains the name of the attribute and the variable string contains the value
- of the attribute.
-*/
-bool QXmlSimpleReader::parseAttribute()
-{
- const signed char Init = 0;
- const signed char PName = 1; // parse name
- const signed char Ws = 2; // eat ws
- const signed char Eq = 3; // the '=' was read
- const signed char Quotes = 4; // " or ' were read
-
- const signed char InpNameBe = 0;
- const signed char InpEq = 1; // =
- const signed char InpDq = 2; // "
- const signed char InpSq = 3; // '
- const signed char InpUnknown = 4;
-
- // use some kind of state machine for parsing
- static signed char table[4][5] = {
- /* InpNameBe InpEq InpDq InpSq InpUnknown */
- { PName, -1, -1, -1, -1 }, // Init
- { -1, Eq, -1, -1, Ws }, // PName
- { -1, Eq, -1, -1, -1 }, // Ws
- { -1, -1, Quotes, Quotes, -1 } // Eq
- };
- signed char state = Init;
- signed char input;
- bool parseOk = TRUE;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( is_NameBeginning(c) ) {
- input = InpNameBe;
- } else if ( c == '=' ) {
- input = InpEq;
- } else if ( c == '"' ) {
- input = InpDq;
- } else if ( c == '\'' ) {
- input = InpSq;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case PName:
- parseOk = parseName();
- break;
- case Ws:
- eat_ws();
- break;
- case Eq:
- next_eat_ws();
- break;
- case Quotes:
- parseOk = parseAttValue();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case PName:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGNAME;
- goto parseError;
- }
- break;
- case Quotes:
- if ( !parseOk ) {
- d->error = XMLERR_ERRORPARSINGATTVALUE;
- goto parseError;
- }
- // Done
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse a Name [5] and store the name in name or ref (if useRef is TRUE).
-*/
-bool QXmlSimpleReader::parseName( bool useRef )
-{
- const signed char Init = 0;
- const signed char Name1 = 1; // parse first signed character of the name
- const signed char Name = 2; // parse name
- const signed char Done = 3;
-
- const signed char InpNameBe = 0; // name beginning signed characters
- const signed char InpNameCh = 1; // NameChar without InpNameBe
- const signed char InpUnknown = 2;
-
- // use some kind of state machine for parsing
- static signed char table[3][3] = {
- /* InpNameBe InpNameCh InpUnknown */
- { Name1, -1, -1 }, // Init
- { Name, Name, Done }, // Name1
- { Name, Name, Done } // Name
- };
- signed char state = Init;
- signed char input;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( is_NameBeginning(c) ) {
- input = InpNameBe;
- } else if ( is_NameChar(c) ) {
- input = InpNameCh;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case Name1:
- if ( useRef ) {
- refClear();
- refAddC();
- } else {
- nameClear();
- nameAddC();
- }
- next();
- break;
- case Name:
- if ( useRef ) {
- refAddC();
- } else {
- nameAddC();
- }
- next();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case Done:
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_LETTEREXPECTED;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse a Nmtoken [7] and store the name in name.
-*/
-bool QXmlSimpleReader::parseNmtoken()
-{
- const signed char Init = 0;
- const signed char NameF = 1;
- const signed char Name = 2;
- const signed char Done = 3;
-
- const signed char InpNameCh = 0; // NameChar without InpNameBe
- const signed char InpUnknown = 1;
-
- // use some kind of state machine for parsing
- static signed char table[3][2] = {
- /* InpNameCh InpUnknown */
- { NameF, -1 }, // Init
- { Name, Done }, // NameF
- { Name, Done } // Name
- };
- signed char state = Init;
- signed char input;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( is_NameChar(c) ) {
- input = InpNameCh;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case NameF:
- nameClear();
- nameAddC();
- next();
- break;
- case Name:
- nameAddC();
- next();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case Done:
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_LETTEREXPECTED;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Parse a Reference [67].
-
- charDataRead is set to TRUE if the reference must not be parsed. The
- character(s) which the reference mapped to are appended to string. The
- head stands on the first character after the reference.
-
- charDataRead is set to FALSE if the reference must be parsed. The
- character(s) which the reference mapped to are inserted at the reference
- position. The head stands on the first character of the replacement).
-*/
-bool QXmlSimpleReader::parseReference( bool &charDataRead, EntityRecognitionContext context )
-{
- // temporary variables
- uint tmp;
- bool ok;
-
- const signed char Init = 0;
- const signed char SRef = 1; // start of a reference
- const signed char ChRef = 2; // parse CharRef
- const signed char ChDec = 3; // parse CharRef decimal
- const signed char ChHexS = 4; // start CharRef hexadecimal
- const signed char ChHex = 5; // parse CharRef hexadecimal
- const signed char Name = 6; // parse name
- const signed char DoneD = 7; // done CharRef decimal
- const signed char DoneH = 8; // done CharRef hexadecimal
- const signed char DoneN = 9; // done EntityRef
-
- const signed char InpAmp = 0; // &
- const signed char InpSemi = 1; // ;
- const signed char InpHash = 2; // #
- const signed char InpX = 3; // x
- const signed char InpNum = 4; // 0-9
- const signed char InpHex = 5; // a-f A-F
- const signed char InpUnknown = 6;
-
- // use some kind of state machine for parsing
- static signed char table[8][7] = {
- /* InpAmp InpSemi InpHash InpX InpNum InpHex InpUnknown */
- { SRef, -1, -1, -1, -1, -1, -1 }, // Init
- { -1, -1, ChRef, Name, Name, Name, Name }, // SRef
- { -1, -1, -1, ChHexS, ChDec, -1, -1 }, // ChRef
- { -1, DoneD, -1, -1, ChDec, -1, -1 }, // ChDec
- { -1, -1, -1, -1, ChHex, ChHex, -1 }, // ChHexS
- { -1, DoneH, -1, -1, ChHex, ChHex, -1 }, // ChHex
- { -1, DoneN, -1, -1, -1, -1, -1 } // Name
- };
- signed char state = Init;
- signed char input;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( c.row() ) {
- input = InpUnknown;
- } else if ( c.cell() == '&' ) {
- input = InpAmp;
- } else if ( c.cell() == ';' ) {
- input = InpSemi;
- } else if ( c.cell() == '#' ) {
- input = InpHash;
- } else if ( c.cell() == 'x' ) {
- input = InpX;
- } else if ( '0' <= c.cell() && c.cell() <= '9' ) {
- input = InpNum;
- } else if ( 'a' <= c.cell() && c.cell() <= 'f' ) {
- input = InpHex;
- } else if ( 'A' <= c.cell() && c.cell() <= 'F' ) {
- input = InpHex;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- state = table[state][input];
-
- // do some actions according to state
- switch ( state ) {
- case SRef:
- refClear();
- next();
- break;
- case ChRef:
- next();
- break;
- case ChDec:
- refAddC();
- next();
- break;
- case ChHexS:
- next();
- break;
- case ChHex:
- refAddC();
- next();
- break;
- case Name:
- // read the name into the ref
- parseName( TRUE );
- break;
- case DoneD:
- tmp = ref().toUInt( &ok, 10 );
- if ( ok ) {
- stringAddC( QChar(tmp) );
- } else {
- d->error = XMLERR_ERRORPARSINGREFERENCE;
- goto parseError;
- }
- charDataRead = TRUE;
- next();
- break;
- case DoneH:
- tmp = ref().toUInt( &ok, 16 );
- if ( ok ) {
- stringAddC( QChar(tmp) );
- } else {
- d->error = XMLERR_ERRORPARSINGREFERENCE;
- goto parseError;
- }
- charDataRead = TRUE;
- next();
- break;
- case DoneN:
- if ( !processReference( charDataRead, context ) )
- goto parseError;
- next();
- break;
- }
- // no input is read after this
- switch ( state ) {
- case DoneD:
- return TRUE;
- case DoneH:
- return TRUE;
- case DoneN:
- return TRUE;
- case -1:
- // Error
- d->error = XMLERR_ERRORPARSINGREFERENCE;
- goto parseError;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-/*!
- Helper function for parseReference()
-*/
-bool QXmlSimpleReader::processReference( bool &charDataRead, EntityRecognitionContext context )
-{
- QString reference = ref();
- if ( reference == "amp" ) {
- if ( context == InEntityValue ) {
- // Bypassed
- stringAddC( '&' ); stringAddC( 'a' ); stringAddC( 'm' ); stringAddC( 'p' ); stringAddC( ';' );
- } else {
- // Included or Included in literal
- stringAddC( '&' );
- }
- charDataRead = TRUE;
- } else if ( reference == "lt" ) {
- if ( context == InEntityValue ) {
- // Bypassed
- stringAddC( '&' ); stringAddC( 'l' ); stringAddC( 't' ); stringAddC( ';' );
- } else {
- // Included or Included in literal
- stringAddC( '<' );
- }
- charDataRead = TRUE;
- } else if ( reference == "gt" ) {
- if ( context == InEntityValue ) {
- // Bypassed
- stringAddC( '&' ); stringAddC( 'g' ); stringAddC( 't' ); stringAddC( ';' );
- } else {
- // Included or Included in literal
- stringAddC( '>' );
- }
- charDataRead = TRUE;
- } else if ( reference == "apos" ) {
- if ( context == InEntityValue ) {
- // Bypassed
- stringAddC( '&' ); stringAddC( 'a' ); stringAddC( 'p' ); stringAddC( 'o' ); stringAddC( 's' ); stringAddC( ';' );
- } else {
- // Included or Included in literal
- stringAddC( '\'' );
- }
- charDataRead = TRUE;
- } else if ( reference == "quot" ) {
- if ( context == InEntityValue ) {
- // Bypassed
- stringAddC( '&' ); stringAddC( 'q' ); stringAddC( 'u' ); stringAddC( 'o' ); stringAddC( 't' ); stringAddC( ';' );
- } else {
- // Included or Included in literal
- stringAddC( '"' );
- }
- charDataRead = TRUE;
- } else {
- QMap<QString,QString>::Iterator it;
- it = d->entities.find( reference );
- if ( it != d->entities.end() ) {
- // "Internal General"
- switch ( context ) {
- case InContent:
- // Included
- xmlRef = it.data() + xmlRef;
- charDataRead = FALSE;
- break;
- case InAttributeValue:
- // Included in literal
- xmlRef = it.data().replace( QRegExp("\""), "&quot;" ).replace( QRegExp("'"), "&apos;" )
- + xmlRef;
- charDataRead = FALSE;
- break;
- case InEntityValue:
- {
- // Bypassed
- stringAddC( '&' );
- for ( int i=0; i<(int)reference.length(); i++ ) {
- stringAddC( reference[i] );
- }
- stringAddC( ';');
- charDataRead = TRUE;
- }
- break;
- case InDTD:
- // Forbidden
- d->error = XMLERR_INTERNALGENERALENTITYINDTD;
- charDataRead = FALSE;
- break;
- }
- } else {
- QMap<QString,QXmlSimpleReaderPrivate::ExternEntity>::Iterator itExtern;
- itExtern = d->externEntities.find( reference );
- if ( itExtern == d->externEntities.end() ) {
- // entity not declared
- // ### check this case for conformance
- if ( context == InEntityValue ) {
- // Bypassed
- stringAddC( '&' );
- for ( int i=0; i<(int)reference.length(); i++ ) {
- stringAddC( reference[i] );
- }
- stringAddC( ';');
- charDataRead = TRUE;
- } else {
- if ( contentHnd ) {
- if ( !contentHnd->skippedEntity( reference ) ) {
- d->error = contentHnd->errorString();
- return FALSE; // error
- }
- }
- }
- } else if ( (*itExtern).notation.isNull() ) {
- // "External Parsed General"
- switch ( context ) {
- case InContent:
- // Included if validating
- if ( contentHnd ) {
- if ( !contentHnd->skippedEntity( reference ) ) {
- d->error = contentHnd->errorString();
- return FALSE; // error
- }
- }
- charDataRead = FALSE;
- break;
- case InAttributeValue:
- // Forbidden
- d->error = XMLERR_EXTERNALGENERALENTITYINAV;
- charDataRead = FALSE;
- break;
- case InEntityValue:
- {
- // Bypassed
- stringAddC( '&' );
- for ( int i=0; i<(int)reference.length(); i++ ) {
- stringAddC( reference[i] );
- }
- stringAddC( ';');
- charDataRead = TRUE;
- }
- break;
- case InDTD:
- // Forbidden
- d->error = XMLERR_EXTERNALGENERALENTITYINDTD;
- charDataRead = FALSE;
- break;
- }
- } else {
- // "Unparsed"
- // ### notify for "Occurs as Attribute Value" missing (but this is no reference, anyway)
- // Forbidden
- d->error = XMLERR_UNPARSEDENTITYREFERENCE;
- charDataRead = FALSE;
- return FALSE; // error
- }
- }
- }
- return TRUE; // no error
-}
-
-
-/*!
- Parse over a simple string.
-
- After the string was successfully parsed, the head is on the first
- character after the string.
-*/
-bool QXmlSimpleReader::parseString( const QString& s )
-{
- signed char Done = s.length();
-
- const signed char InpCharExpected = 0; // the character that was expected
- const signed char InpUnknown = 1;
-
- signed char state = 0; // state in this function is the position in the string s
- signed char input;
-
- while ( TRUE ) {
-
- // get input
- if ( atEnd() ) {
- d->error = XMLERR_UNEXPECTEDEOF;
- goto parseError;
- }
- if ( c == s[(int)state] ) {
- input = InpCharExpected;
- } else {
- input = InpUnknown;
- }
-
- // set state according to input
- if ( input == InpCharExpected ) {
- state++;
- } else {
- // Error
- d->error = XMLERR_UNEXPECTEDCHARACTER;
- goto parseError;
- }
-
- // do some actions according to state
- next();
- // no input is read after this
- if ( state == Done ) {
- return TRUE;
- }
-
- }
-
- return TRUE;
-
-parseError:
- reportParseError();
- return FALSE;
-}
-
-
-/*!
- Inits the data values.
-*/
-void QXmlSimpleReader::init( const QXmlInputSource& i )
-{
- xml = i.data();
- xmlLength = xml.length();
- xmlRef = "";
-
- d->externParameterEntities.clear();
- d->parameterEntities.clear();
- d->externEntities.clear();
- d->entities.clear();
-
- tags.clear();
-
- d->doctype = "";
- d->xmlVersion = "";
- d->encoding = "";
- d->standalone = QXmlSimpleReaderPrivate::Unknown;
-
- lineNr = 0;
- columnNr = -1;
- pos = 0;
- next();
- d->error = XMLERR_OK;
-}
-
-/*!
- Returns TRUE if a entity with the name \a e exists,
- otherwise returns FALSE.
-*/
-bool QXmlSimpleReader::entityExist( const QString& e ) const
-{
- if ( d->parameterEntities.find(e) == d->parameterEntities.end() &&
- d->externParameterEntities.find(e) == d->externParameterEntities.end() ) {
- return FALSE;
- } else {
- return TRUE;
- }
-}
-
-void QXmlSimpleReader::reportParseError()
-{
- if ( errorHnd )
- errorHnd->fatalError( QXmlParseException( d->error, columnNr+1, lineNr+1 ) );
-}
-
-#endif //QT_NO_XML
diff --git a/qtools/qxml.h b/qtools/qxml.h
deleted file mode 100644
index b44e42c..0000000
--- a/qtools/qxml.h
+++ /dev/null
@@ -1,671 +0,0 @@
-/****************************************************************************
-**
-**
-** Definition of QXmlSimpleReader and related classes.
-**
-** Created : 000518
-**
-** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
-**
-** This file is part of the XML module of the Qt GUI Toolkit.
-**
-** This file may be distributed under the terms of the Q Public License
-** as defined by Trolltech AS of Norway and appearing in the file
-** LICENSE.QPL included in the packaging of this file.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** Licensees holding valid Qt Enterprise Edition licenses may use this
-** file in accordance with the Qt Commercial License Agreement provided
-** with the Software.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
-** information about Qt Commercial License Agreements.
-** See http://www.trolltech.com/qpl/ for QPL licensing information.
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-
-#ifndef QXML_H
-#define QXML_H
-
-#include <qmodules.h>
-
-#if !defined(QT_MODULE_XML)
-#define QM_EXPORT
-#else
-#define QM_EXPORT Q_EXPORT
-#endif
-
-#ifndef QT_H
-#include <qtextstream.h>
-#include <qfile.h>
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qvaluestack.h>
-#include <qmap.h>
-#endif // QT_H
-
-#ifndef QT_NO_XML
-
-class QXmlNamespaceSupport;
-class QXmlAttributes;
-class QXmlContentHandler;
-class QXmlDefaultHandler;
-class QXmlDTDHandler;
-class QXmlEntityResolver;
-class QXmlErrorHandler;
-class QXmlLexicalHandler;
-class QXmlDeclHandler;
-class QXmlInputSource;
-class QXmlLocator;
-class QXmlNamespaceSupport;
-class QXmlParseException;
-
-class QXmlReader;
-class QXmlSimpleReader;
-
-class QXmlSimpleReaderPrivate;
-class QXmlNamespaceSupportPrivate;
-class QXmlAttributesPrivate;
-class QXmlInputSourcePrivate;
-class QXmlParseExceptionPrivate;
-class QXmlLocatorPrivate;
-class QXmlDefaultHandlerPrivate;
-
-
-//
-// SAX Namespace Support
-//
-
-#if defined(Q_TEMPLATEDLL)
-// MOC_SKIP_BEGIN
-template class QM_EXPORT QMap<QString, QString>;
-template class QM_EXPORT QValueStack<QMap<QString, QString> >;
-template class QM_EXPORT QValueStack<QString>;
-// MOC_SKIP_END
-#endif
-
-class QM_EXPORT QXmlNamespaceSupport
-{
-public:
- QXmlNamespaceSupport();
- ~QXmlNamespaceSupport();
-
- void setPrefix( const QString&, const QString& );
-
- QString prefix( const QString& ) const;
- QString uri( const QString& ) const;
- void splitName( const QString&, QString&, QString& ) const;
- void processName( const QString&, bool, QString&, QString& ) const;
- QStringList prefixes() const;
- QStringList prefixes( const QString& ) const;
-
- void pushContext();
- void popContext();
- void reset();
-private:
- QValueStack<QMap<QString, QString> > nsStack;
- QMap<QString, QString> ns;
-
- //QXmlNamespaceSupportPrivate *d;
-};
-
-
-//
-// SAX Attributes
-//
-
-class QM_EXPORT QXmlAttributes
-{
-public:
- QXmlAttributes() {}
- virtual ~QXmlAttributes() {}
-
- int index( const QString& qName ) const;
- int index( const QString& uri, const QString& localPart ) const;
- int length() const;
- QString localName( int index ) const;
- QString qName( int index ) const;
- QString uri( int index ) const;
- QString type( int index ) const;
- QString type( const QString& qName ) const;
- QString type( const QString& uri, const QString& localName ) const;
- QString value( int index ) const;
- QString value( const QString& qName ) const;
- QString value( const QString& uri, const QString& localName ) const;
-
-private:
- QStringList qnameList;
- QStringList uriList;
- QStringList localnameList;
- QStringList valueList;
-
- //QXmlAttributesPrivate *d;
-
- friend class QXmlSimpleReader;
-};
-
-//
-// SAX Input Source
-//
-
-class QM_EXPORT QXmlInputSource
-{
-public:
- QXmlInputSource();
- QXmlInputSource( QTextStream& stream );
- QXmlInputSource( QFile& file );
- virtual ~QXmlInputSource();
-
- virtual const QString& data() const;
- virtual void setData( const QString& d );
-
-private:
- void readInput( QByteArray& rawData );
-
- QString input;
-
- //QXmlInputSourcePrivate *d;
-};
-
-//
-// SAX Exception Classes
-//
-
-class QM_EXPORT QXmlParseException
-{
-public:
- QXmlParseException( const QString& name="", int c=-1, int l=-1, const QString& p="", const QString& s="" )
- : msg( name ), column( c ), line( l ), pub( p ), sys( s )
- { }
-
- int columnNumber() const;
- int lineNumber() const;
- QString publicId() const;
- QString systemId() const;
- QString message() const;
-
-private:
- QString msg;
- int column;
- int line;
- QString pub;
- QString sys;
-
- //QXmlParseExceptionPrivate *d;
-};
-
-
-//
-// XML Reader
-//
-
-class QM_EXPORT QXmlReader
-{
-public:
- virtual ~QXmlReader() {}
- virtual bool feature( const QString& name, bool *ok = 0 ) const = 0;
- virtual void setFeature( const QString& name, bool value ) = 0;
- virtual bool hasFeature( const QString& name ) const = 0;
- virtual void* property( const QString& name, bool *ok = 0 ) const = 0;
- virtual void setProperty( const QString& name, void* value ) = 0;
- virtual bool hasProperty( const QString& name ) const = 0;
- virtual void setEntityResolver( QXmlEntityResolver* handler ) = 0;
- virtual QXmlEntityResolver* entityResolver() const = 0;
- virtual void setDTDHandler( QXmlDTDHandler* handler ) = 0;
- virtual QXmlDTDHandler* DTDHandler() const = 0;
- virtual void setContentHandler( QXmlContentHandler* handler ) = 0;
- virtual QXmlContentHandler* contentHandler() const = 0;
- virtual void setErrorHandler( QXmlErrorHandler* handler ) = 0;
- virtual QXmlErrorHandler* errorHandler() const = 0;
- virtual void setLexicalHandler( QXmlLexicalHandler* handler ) = 0;
- virtual QXmlLexicalHandler* lexicalHandler() const = 0;
- virtual void setDeclHandler( QXmlDeclHandler* handler ) = 0;
- virtual QXmlDeclHandler* declHandler() const = 0;
- virtual bool parse( const QXmlInputSource& input ) = 0;
-};
-
-class QM_EXPORT QXmlSimpleReader : public QXmlReader
-{
-public:
- QXmlSimpleReader();
- virtual ~QXmlSimpleReader();
-
- bool feature( const QString& name, bool *ok = 0 ) const;
- void setFeature( const QString& name, bool value );
- bool hasFeature( const QString& name ) const;
-
- void* property( const QString& name, bool *ok = 0 ) const;
- void setProperty( const QString& name, void* value );
- bool hasProperty( const QString& name ) const;
-
- void setEntityResolver( QXmlEntityResolver* handler );
- QXmlEntityResolver* entityResolver() const;
- void setDTDHandler( QXmlDTDHandler* handler );
- QXmlDTDHandler* DTDHandler() const;
- void setContentHandler( QXmlContentHandler* handler );
- QXmlContentHandler* contentHandler() const;
- void setErrorHandler( QXmlErrorHandler* handler );
- QXmlErrorHandler* errorHandler() const;
- void setLexicalHandler( QXmlLexicalHandler* handler );
- QXmlLexicalHandler* lexicalHandler() const;
- void setDeclHandler( QXmlDeclHandler* handler );
- QXmlDeclHandler* declHandler() const;
-
- bool parse( const QXmlInputSource& input );
-
-private:
- // variables
- QXmlContentHandler* contentHnd;
- QXmlErrorHandler* errorHnd;
- QXmlDTDHandler* dtdHnd;
- QXmlEntityResolver* entityRes;
- QXmlLexicalHandler* lexicalHnd;
- QXmlDeclHandler* declHnd;
-
- QChar c; // the character at reading position
- int lineNr; // number of line
- int columnNr; // position in line
- int pos; // position in string
-
- int namePos;
- QChar nameArray[256]; // only used for names
- QString nameValue; // only used for names
- int refPos;
- QChar refArray[256]; // only used for references
- QString refValue; // only used for references
- int stringPos;
- QChar stringArray[256]; // used for any other strings that are parsed
- QString stringValue; // used for any other strings that are parsed
-
- QString xml;
- int xmlLength;
- QString xmlRef; // used for parsing of entity references
-
- QValueStack<QString> tags;
-
- QXmlSimpleReaderPrivate* d;
-
- static const QChar QEOF;
-
- // inlines
- virtual bool is_S( const QChar& );
- virtual bool is_Letter( const QChar& );
- virtual bool is_NameBeginning( const QChar& );
- virtual bool is_Digit( const QChar& );
- virtual bool is_CombiningChar( const QChar& );
- virtual bool is_Extender( const QChar& );
- virtual bool is_NameChar( const QChar& );
-
- QString& string();
- void stringClear();
- void stringAddC();
- void stringAddC(const QChar&);
- QString& name();
- void nameClear();
- void nameAddC();
- void nameAddC(const QChar&);
- QString& ref();
- void refClear();
- void refAddC();
- void refAddC(const QChar&);
-
- // used by parseReference() and parsePEReference()
- enum EntityRecognitionContext { InContent, InAttributeValue, InEntityValue, InDTD };
-
- // private functions
- void eat_ws();
- void next_eat_ws();
-
- void next();
- bool atEnd();
-
- void init( const QXmlInputSource& i );
-
- bool entityExist( const QString& ) const;
-
- bool parseProlog();
- bool parseElement();
- bool parseElementEmptyTag( bool &t, QString &uri, QString &lname );
- bool parseElementETagBegin2( QString &uri, QString &lname );
- bool parseElementAttribute( QString &prefix, QString &uri, QString &lname );
- bool parseMisc();
- bool parseContent();
-
- bool parsePI(bool xmldecl=FALSE);
- bool parseDoctype();
- bool parseComment();
-
- bool parseName( bool useRef=FALSE );
- bool parseNmtoken();
- bool parseAttribute();
- bool parseReference( bool &charDataRead, EntityRecognitionContext context );
- bool processReference( bool &charDataRead, EntityRecognitionContext context );
-
- bool parseExternalID( bool allowPublicID = FALSE );
- bool parsePEReference( EntityRecognitionContext context );
- bool parseMarkupdecl();
- bool parseAttlistDecl();
- bool parseAttType();
- bool parseAttValue();
- bool parseElementDecl();
- bool parseNotationDecl();
- bool parseChoiceSeq();
- bool parseEntityDecl();
- bool parseEntityValue();
-
- bool parseString( const QString& s );
-
- void reportParseError();
-
- friend class QXmlSimpleReaderPrivate;
- friend class QXmlLocator;
-};
-
-//
-// SAX Locator
-//
-
-class QM_EXPORT QXmlLocator
-{
-public:
- QXmlLocator( QXmlSimpleReader* parent )
- { reader = parent; }
- ~QXmlLocator()
- { }
-
- int columnNumber();
- int lineNumber();
-// QString getPublicId()
-// QString getSystemId()
-
-private:
- QXmlSimpleReader* reader;
-
- //QXmlLocatorPrivate *d;
-};
-
-//
-// SAX handler classes
-//
-
-class QM_EXPORT QXmlContentHandler
-{
-public:
- virtual ~QXmlContentHandler() {}
- virtual void setDocumentLocator( QXmlLocator* locator ) = 0;
- virtual bool startDocument() = 0;
- virtual bool endDocument() = 0;
- virtual bool startPrefixMapping( const QString& prefix, const QString& uri ) = 0;
- virtual bool endPrefixMapping( const QString& prefix ) = 0;
- virtual bool startElement( const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts ) = 0;
- virtual bool endElement( const QString& namespaceURI, const QString& localName, const QString& qName ) = 0;
- virtual bool characters( const QString& ch ) = 0;
- virtual bool ignorableWhitespace( const QString& ch ) = 0;
- virtual bool processingInstruction( const QString& target, const QString& data ) = 0;
- virtual bool skippedEntity( const QString& name ) = 0;
- virtual QString errorString() = 0;
-};
-
-class QM_EXPORT QXmlErrorHandler
-{
-public:
- virtual ~QXmlErrorHandler() {}
- virtual bool warning( const QXmlParseException& exception ) = 0;
- virtual bool error( const QXmlParseException& exception ) = 0;
- virtual bool fatalError( const QXmlParseException& exception ) = 0;
- virtual QString errorString() = 0;
-};
-
-class QM_EXPORT QXmlDTDHandler
-{
-public:
- virtual ~QXmlDTDHandler() {}
- virtual bool notationDecl( const QString& name, const QString& publicId, const QString& systemId ) = 0;
- virtual bool unparsedEntityDecl( const QString& name, const QString& publicId, const QString& systemId, const QString& notationName ) = 0;
- virtual QString errorString() = 0;
-};
-
-class QM_EXPORT QXmlEntityResolver
-{
-public:
- virtual ~QXmlEntityResolver() {}
- virtual bool resolveEntity( const QString& publicId, const QString& systemId, QXmlInputSource* &ret ) = 0;
- virtual QString errorString() = 0;
-};
-
-class QM_EXPORT QXmlLexicalHandler
-{
-public:
- virtual ~QXmlLexicalHandler() {}
- virtual bool startDTD( const QString& name, const QString& publicId, const QString& systemId ) = 0;
- virtual bool endDTD() = 0;
-// virtual bool startEntity( const QString& name ) = 0;
-// virtual bool endEntity( const QString& name ) = 0;
- virtual bool startCDATA() = 0;
- virtual bool endCDATA() = 0;
- virtual bool comment( const QString& ch ) = 0;
- virtual QString errorString() = 0;
-};
-
-class QM_EXPORT QXmlDeclHandler
-{
-public:
- virtual ~QXmlDeclHandler() {}
- virtual bool attributeDecl( const QString& eName, const QString& aName, const QString& type, const QString& valueDefault, const QString& value ) = 0;
- virtual bool internalEntityDecl( const QString& name, const QString& value ) = 0;
- virtual bool externalEntityDecl( const QString& name, const QString& publicId, const QString& systemId ) = 0;
- virtual QString errorString() = 0;
-};
-
-
-class QM_EXPORT QXmlDefaultHandler : public QXmlContentHandler, public QXmlErrorHandler, public QXmlDTDHandler, public QXmlEntityResolver, public QXmlLexicalHandler, public QXmlDeclHandler
-{
-public:
- QXmlDefaultHandler() { }
- virtual ~QXmlDefaultHandler() { }
-
- void setDocumentLocator( QXmlLocator* locator );
- bool startDocument();
- bool endDocument();
- bool startPrefixMapping( const QString& prefix, const QString& uri );
- bool endPrefixMapping( const QString& prefix );
- bool startElement( const QString& namespaceURI, const QString& localName, const QString& qName, const QXmlAttributes& atts );
- bool endElement( const QString& namespaceURI, const QString& localName, const QString& qName );
- bool characters( const QString& ch );
- bool ignorableWhitespace( const QString& ch );
- bool processingInstruction( const QString& target, const QString& data );
- bool skippedEntity( const QString& name );
-
- bool warning( const QXmlParseException& exception );
- bool error( const QXmlParseException& exception );
- bool fatalError( const QXmlParseException& exception );
-
- bool notationDecl( const QString& name, const QString& publicId, const QString& systemId );
- bool unparsedEntityDecl( const QString& name, const QString& publicId, const QString& systemId, const QString& notationName );
-
- bool resolveEntity( const QString& publicId, const QString& systemId, QXmlInputSource* &ret );
-
- bool startDTD( const QString& name, const QString& publicId, const QString& systemId );
- bool endDTD();
-// bool startEntity( const QString& name );
-// bool endEntity( const QString& name );
- bool startCDATA();
- bool endCDATA();
- bool comment( const QString& ch );
-
- bool attributeDecl( const QString& eName, const QString& aName, const QString& type, const QString& valueDefault, const QString& value );
- bool internalEntityDecl( const QString& name, const QString& value );
- bool externalEntityDecl( const QString& name, const QString& publicId, const QString& systemId );
-
- QString errorString();
-
-private:
- //QXmlDefaultHandlerPrivate *d;
-};
-
-#ifdef _WS_QWS_
-#ifdef QT_XML_CPP
-#define inline
-#else
-#define QT_NO_XML_INLINE
-#endif
-#endif
-
-#ifndef QT_NO_XML_INLINE
-//
-// inlines
-//
-
-inline bool QXmlSimpleReader::is_S(const QChar& ch)
-{ return ch==' ' || ch=='\t' || ch=='\n' || ch=='\r'; }
-
-inline bool QXmlSimpleReader::is_Letter( const QChar& ch )
-{ return ch.isLetter(); }
-
-inline bool QXmlSimpleReader::is_NameBeginning( const QChar& ch )
-{ return ch=='_' || ch==':' || ch.isLetter(); }
-
-inline bool QXmlSimpleReader::is_Digit( const QChar& ch )
-{ return ch.isDigit(); }
-
-inline bool QXmlSimpleReader::is_CombiningChar( const QChar& )
-{ return FALSE; }
-
-inline bool QXmlSimpleReader::is_Extender( const QChar& )
-{ return FALSE; }
-
-inline bool QXmlSimpleReader::is_NameChar( const QChar& ch )
-{
- return ch=='.' || ch=='-' || ch=='_' || ch==':' ||
- is_Letter(ch) || is_Digit(ch) ||
- is_CombiningChar(ch) || is_Extender(ch);
-}
-
-inline void QXmlSimpleReader::next()
-{
- if ( !xmlRef.isEmpty() ) {
- c = xmlRef[0];
- xmlRef.remove( 0, 1 );
- } else {
- if ( c=='\n' || c=='\r' ) {
- lineNr++;
- columnNr = -1;
- }
- if ( pos >= xmlLength ) {
- c = QEOF;
- } else {
- c = xml[pos];
- columnNr++;
- pos++;
- }
- }
-}
-
-inline bool QXmlSimpleReader::atEnd()
-{ return c == QEOF; }
-
-inline void QXmlSimpleReader::eat_ws()
-{ while ( !atEnd() && is_S(c) ) next(); }
-
-inline void QXmlSimpleReader::next_eat_ws()
-{ next(); eat_ws(); }
-
-
-// use buffers instead of QString::operator+= when single characters are read
-inline QString& QXmlSimpleReader::string()
-{
- stringValue += QString( stringArray, stringPos );
- stringPos = 0;
- return stringValue;
-}
-inline QString& QXmlSimpleReader::name()
-{
- nameValue += QString( nameArray, namePos );
- namePos = 0;
- return nameValue;
-}
-inline QString& QXmlSimpleReader::ref()
-{
- refValue += QString( refArray, refPos );
- refPos = 0;
- return refValue;
-}
-
-inline void QXmlSimpleReader::stringClear()
-{ stringValue = ""; stringPos = 0; }
-inline void QXmlSimpleReader::nameClear()
-{ nameValue = ""; namePos = 0; }
-inline void QXmlSimpleReader::refClear()
-{ refValue = ""; refPos = 0; }
-
-inline void QXmlSimpleReader::stringAddC()
-{
- if ( stringPos >= 256 ) {
- stringValue += QString( stringArray, stringPos );
- stringPos = 0;
- }
- stringArray[stringPos++] = c;
-}
-inline void QXmlSimpleReader::nameAddC()
-{
- if ( namePos >= 256 ) {
- nameValue += QString( nameArray, namePos );
- namePos = 0;
- }
- nameArray[namePos++] = c;
-}
-inline void QXmlSimpleReader::refAddC()
-{
- if ( refPos >= 256 ) {
- refValue += QString( refArray, refPos );
- refPos = 0;
- }
- refArray[refPos++] = c;
-}
-
-inline void QXmlSimpleReader::stringAddC(const QChar& ch)
-{
- if ( stringPos >= 256 ) {
- stringValue += QString( stringArray, stringPos );
- stringPos = 0;
- }
- stringArray[stringPos++] = ch;
-}
-inline void QXmlSimpleReader::nameAddC(const QChar& ch)
-{
- if ( namePos >= 256 ) {
- nameValue += QString( nameArray, namePos );
- namePos = 0;
- }
- nameArray[namePos++] = ch;
-}
-inline void QXmlSimpleReader::refAddC(const QChar& ch)
-{
- if ( refPos >= 256 ) {
- refValue += QString( refArray, refPos );
- refPos = 0;
- }
- refArray[refPos++] = ch;
-}
-#endif
-
-#ifdef _WS_QWS_
-#ifdef QT_XML_CPP
-#undef inline
-#endif
-#endif
-
-#endif //QT_NO_XML
-
-#endif
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5004a95..1840648 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,11 +1,12 @@
# 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
${PROJECT_SOURCE_DIR}/libversion
+ ${PROJECT_SOURCE_DIR}/libxml
${PROJECT_SOURCE_DIR}/vhdlparser
${PROJECT_SOURCE_DIR}/src
${CLANG_INCLUDEDIR}
@@ -114,9 +115,10 @@ set(LEX_FILES scanner
commentcnv
commentscan
constexp
- xml
xmlcode
sqlcode
+ lexcode
+ lexscanner
configimpl)
# unfortunately ${LEX_FILES_H} and ${LEX_FILES_CPP} don't work in older versions of CMake (like 3.6.2) for add_library
@@ -164,7 +166,6 @@ add_library(doxycfg STATIC
${GENERATED_SRC}/settings.h
portable.cpp
portable_c.c
- ftextstream.cpp
message.cpp
debug.cpp
)
@@ -184,13 +185,14 @@ add_library(doxymain STATIC
${GENERATED_SRC}/doctokenizer.l.h
${GENERATED_SRC}/fortrancode.l.h
${GENERATED_SRC}/fortranscanner.l.h
+ ${GENERATED_SRC}/lexcode.l.h
+ ${GENERATED_SRC}/lexscanner.l.h
${GENERATED_SRC}/pre.l.h
${GENERATED_SRC}/pycode.l.h
${GENERATED_SRC}/pyscanner.l.h
${GENERATED_SRC}/scanner.l.h
${GENERATED_SRC}/sqlcode.l.h
${GENERATED_SRC}/vhdlcode.l.h
- ${GENERATED_SRC}/xml.l.h
${GENERATED_SRC}/xmlcode.l.h
${GENERATED_SRC}/code.cpp
${GENERATED_SRC}/commentcnv.cpp
@@ -200,13 +202,14 @@ add_library(doxymain STATIC
${GENERATED_SRC}/doctokenizer.cpp
${GENERATED_SRC}/fortrancode.cpp
${GENERATED_SRC}/fortranscanner.cpp
+ ${GENERATED_SRC}/lexcode.cpp
+ ${GENERATED_SRC}/lexscanner.cpp
${GENERATED_SRC}/pre.cpp
${GENERATED_SRC}/pycode.cpp
${GENERATED_SRC}/pyscanner.cpp
${GENERATED_SRC}/scanner.cpp
${GENERATED_SRC}/sqlcode.cpp
${GENERATED_SRC}/vhdlcode.cpp
- ${GENERATED_SRC}/xml.cpp
${GENERATED_SRC}/xmlcode.cpp
#
${GENERATED_SRC}/ce_parse.cpp
@@ -221,6 +224,7 @@ add_library(doxymain STATIC
classdef.cpp
classlist.cpp
cmdmapper.cpp
+ conceptdef.cpp
condparser.cpp
context.cpp
cppvalue.cpp
@@ -228,6 +232,7 @@ add_library(doxymain STATIC
definition.cpp
dia.cpp
diagram.cpp
+ dir.cpp
dirdef.cpp
docbookgen.cpp
docbookvisitor.cpp
@@ -252,6 +257,7 @@ add_library(doxymain STATIC
emoji.cpp
entry.cpp
filedef.cpp
+ fileinfo.cpp
fileparser.cpp
formula.cpp
ftvhelp.cpp
@@ -280,9 +286,11 @@ add_library(doxymain STATIC
pagedef.cpp
perlmodgen.cpp
plantuml.cpp
+ qcstring.cpp
qhp.cpp
qhpxmlwriter.cpp
reflist.cpp
+ regex.cpp
resourcemgr.cpp
rtfdocvisitor.cpp
rtfgen.cpp
@@ -295,6 +303,7 @@ add_library(doxymain STATIC
template.cpp
textdocvisitor.cpp
tooltip.cpp
+ utf8.cpp
util.cpp
vhdldocgen.cpp
vhdljjparser.cpp
@@ -344,10 +353,10 @@ endif()
target_link_libraries(doxygen PRIVATE
doxymain
doxycfg
- qtools
md5
lodepng
mscgen
+ xml
doxygen_version
vhdlparser
${SQLITE3_LIBRARIES}
@@ -363,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 e64a049..323f4bc 100644
--- a/src/bufstr.h
+++ b/src/bufstr.h
@@ -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.
*
@@ -18,20 +18,19 @@
#ifndef _BUFSTR_H
#define _BUFSTR_H
-#include <qglobal.h>
-#include <qcstring.h>
-#include <stdlib.h>
+#include <cstdlib>
+#include "qcstring.h"
/*! @brief Buffer used to store strings
- *
+ *
* This buffer is used append characters and strings. It will automatically
* resize itself, yet provide efficient random access to the content.
*/
-class BufStr
+class BufStr
{
public:
- BufStr(uint size)
- : m_size(size), m_writeOffset(0), m_spareRoom(10240), m_buf(0)
+ BufStr(uint size)
+ : m_size(size), m_writeOffset(0), m_spareRoom(10240), m_buf(0)
{
m_buf = (char *)calloc(size,1);
}
@@ -95,8 +94,8 @@ class BufStr
return m_buf;
}
uint curPos() const
- {
- return m_writeOffset;
+ {
+ return m_writeOffset;
}
void dropFromStart(uint bytes)
{
@@ -108,7 +107,7 @@ class BufStr
private:
void makeRoomFor(uint size)
{
- if (m_writeOffset+size>=m_size)
+ if (m_writeOffset+size>=m_size)
{
resize(m_size+size+m_spareRoom);
}
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 4129d55..6646adf 100644
--- a/src/clangparser.cpp
+++ b/src/clangparser.cpp
@@ -7,10 +7,8 @@
#include <clang-c/Index.h>
#include "clang/Tooling/CompilationDatabase.h"
#include "clang/Tooling/Tooling.h"
-#include <qfileinfo.h>
#include <stdlib.h>
#include "message.h"
-#include "sortdict.h"
#include "outputgen.h"
#include "filedef.h"
#include "memberdef.h"
@@ -21,6 +19,7 @@
#include "membername.h"
#include "filename.h"
#include "tooltip.h"
+#include "utf8.h"
#endif
//--------------------------------------------------------------------------
@@ -75,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++;
@@ -97,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",
@@ -268,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());
@@ -277,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});
@@ -360,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)
{
@@ -382,10 +377,10 @@ void ClangTUParser::switchToFile(const FileDef *fd)
}
}
-QCString ClangTUParser::lookup(uint line,const char *symbol)
+std::string ClangTUParser::lookup(uint line,const char *symbol)
{
//printf("ClangParser::lookup(%d,%s)\n",line,symbol);
- QCString result;
+ std::string result;
if (symbol==0) return result;
static bool clangAssistedParsing = Config_getBool(CLANG_ASSISTED_PARSING);
if (!clangAssistedParsing) return result;
@@ -522,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
@@ -639,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
{
@@ -912,9 +907,9 @@ void ClangTUParser::parse()
{
}
-QCString ClangTUParser::lookup(uint,const char *)
+std::string ClangTUParser::lookup(uint,const char *)
{
- return "";
+ return std::string();
}
class ClangParser::Private
diff --git a/src/clangparser.h b/src/clangparser.h
index 83aafdd..71a79d5 100644
--- a/src/clangparser.h
+++ b/src/clangparser.h
@@ -1,10 +1,10 @@
#ifndef CLANGPARSER_H
#define CLANGPARSER_H
-#include <qcstring.h>
-#include <qstrlist.h>
#include "containers.h"
+#include "types.h"
#include <memory>
+#include <string>
class CodeOutputInterface;
class FileDef;
@@ -40,7 +40,7 @@ class ClangTUParser
/** Looks for \a symbol which should be found at \a line.
* returns a clang unique reference to the symbol.
*/
- QCString lookup(uint line,const char *symbol);
+ std::string lookup(uint line,const char *symbol);
/** writes the syntax highlighted source code for a file
* @param[out] ol The output generator list to write to.
diff --git a/src/classdef.cpp b/src/classdef.cpp
index 88bc44c..152c316 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -18,9 +18,6 @@
#include <cstdio>
#include <algorithm>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qregexp.h>
#include "classdef.h"
#include "classlist.h"
#include "entry.h"
@@ -51,6 +48,7 @@
#include "membergroup.h"
#include "definitionimpl.h"
#include "symbolresolver.h"
+#include "fileinfo.h"
//-----------------------------------------------------------------------------
@@ -59,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)
@@ -102,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;
}
@@ -144,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;
}
@@ -156,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();
@@ -179,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;
@@ -190,22 +188,20 @@ 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 MemberDef *getMemberByName(const QCString &) const;
+ virtual FileDef *getFileDef() const;
+ virtual const MemberDef *getMemberByName(const QCString &) const;
virtual bool isBaseClass(const ClassDef *bcd,bool followInstances,int level=0) const;
virtual bool isSubClass(ClassDef *bcd,int level=0) const;
virtual bool isAccessibleMember(const MemberDef *md) const;
- virtual QDict<ClassDef> *getTemplateInstances() const;
+ virtual const TemplateInstanceList &getTemplateInstances() const;
virtual const ClassDef *templateMaster() const;
virtual bool isTemplate() const;
- virtual IncludeInfo *includeInfo() const;
- virtual UsesClassDict *usedImplementationClasses() const;
- virtual UsesClassDict *usedByImplementationClasses() const;
- virtual UsesClassDict *usedInterfaceClasses() const;
- virtual ConstraintClassDict *templateTypeConstraints() const;
+ virtual const IncludeInfo *includeInfo() const;
+ virtual const UsesClassList &usedImplementationClasses() const;
+ 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;
@@ -224,14 +220,13 @@ class ClassDefImpl : public DefinitionMixin<ClassDefMutable>
virtual MemberList *getMemberList(MemberListType lt) const;
virtual const MemberLists &getMemberLists() const;
virtual const MemberGroupList &getMemberGroups() const;
- virtual QDict<int> *getTemplateBaseClassNames() const;
- virtual ClassDef *getVariableInstance(const char *templSpec) const;
+ virtual const TemplateNameMap &getTemplateBaseClassNames() const;
virtual bool isUsedOnly() const;
virtual QCString anchor() const;
virtual bool isEmbeddedInOuterScope() const;
virtual bool isSimple() const;
virtual const ClassDef *tagLessReference() const;
- virtual MemberDef *isSmartPointer() const;
+ virtual const MemberDef *isSmartPointer() const;
virtual bool isJavaEnum() const;
virtual QCString title() const;
virtual QCString generatedFromFiles() const;
@@ -243,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(FileDef *);
- virtual bool addExample(const char *anchor,const char *name, const char *file);
+ virtual void insertUsedFile(const FileDef *);
+ 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(QDict<int> *templateNames);
+ 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();
@@ -289,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();
@@ -303,30 +299,33 @@ 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;
virtual int countMemberDeclarations(MemberListType lt,const ClassDef *inheritedFrom,
- int lt2,bool invert,bool showAlways,QPtrDict<void> *visitedClasses) const;
- virtual void writeMemberDeclarations(OutputList &ol,MemberListType lt,const QCString &title,
- const char *subTitle=0,bool showInline=FALSE,const ClassDef *inheritedFrom=0,
- int lt2=-1,bool invert=FALSE,bool showAlways=FALSE,
- QPtrDict<void> *visitedClasses=0) const;
+ int lt2,bool invert,bool showAlways,ClassDefSet &visitedClasses) const;
+ virtual void writeMemberDeclarations(OutputList &ol,ClassDefSet &visitedClasses,
+ MemberListType lt,const QCString &title,
+ 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;
- void internalInsertMember(MemberDef *md,Protection prot,bool addToAllList);
- void addMemberToList(MemberListType lt,MemberDef *md,bool isBrief);
- void writeInheritedMemberDeclarations(OutputList &ol,MemberListType lt,int lt2,const QCString &title,
+ void internalInsertMember(const MemberDef *md,Protection prot,bool addToAllList);
+ void addMemberToList(MemberListType lt,const MemberDef *md,bool isBrief);
+ void writeInheritedMemberDeclarations(OutputList &ol,ClassDefSet &visitedClasses,
+ MemberListType lt,int lt2,const QCString &title,
const ClassDef *inheritedFrom,bool invert,
- bool showAlways,QPtrDict<void> *visitedClasses) const;
+ 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;
@@ -351,11 +350,13 @@ class ClassDefImpl : public DefinitionMixin<ClassDefMutable>
void addClassAttributes(OutputList &ol) const;
int countInheritedDecMembers(MemberListType lt,
const ClassDef *inheritedFrom,bool invert,bool showAlways,
- QPtrDict<void> *visitedClasses) const;
+ ClassDefSet &visitedClasses) const;
void getTitleForMemberListType(MemberListType type,
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;
@@ -363,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);
@@ -411,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(); }
@@ -429,11 +430,11 @@ class ClassDefAliasImpl : public DefinitionAliasMixin<ClassDef>
{ return getCdAlias()->visibleInParentsDeclList(); }
virtual const ArgumentList &templateArguments() const
{ return getCdAlias()->templateArguments(); }
- virtual NamespaceDef *getNamespaceDef() const
- { return getCdAlias()->getNamespaceDef(); }
- virtual FileDef *getFileDef() const
+ //virtual NamespaceDef *getNamespaceDef() const
+ //{ return getCdAlias()->getNamespaceDef(); }
+ virtual FileDef *getFileDef() const
{ return getCdAlias()->getFileDef(); }
- virtual MemberDef *getMemberByName(const QCString &s) const
+ virtual const MemberDef *getMemberByName(const QCString &s) const
{ return getCdAlias()->getMemberByName(s); }
virtual bool isBaseClass(const ClassDef *bcd,bool followInstances,int level=0) const
{ return getCdAlias()->isBaseClass(bcd,followInstances,level); }
@@ -441,25 +442,23 @@ class ClassDefAliasImpl : public DefinitionAliasMixin<ClassDef>
{ return getCdAlias()->isSubClass(bcd,level); }
virtual bool isAccessibleMember(const MemberDef *md) const
{ return getCdAlias()->isAccessibleMember(md); }
- virtual QDict<ClassDef> *getTemplateInstances() const
+ virtual const TemplateInstanceList &getTemplateInstances() const
{ return getCdAlias()->getTemplateInstances(); }
virtual const ClassDef *templateMaster() const
{ return getCdAlias()->templateMaster(); }
virtual bool isTemplate() const
{ return getCdAlias()->isTemplate(); }
- virtual IncludeInfo *includeInfo() const
+ virtual const IncludeInfo *includeInfo() const
{ return getCdAlias()->includeInfo(); }
- virtual UsesClassDict *usedImplementationClasses() const
+ virtual const UsesClassList &usedImplementationClasses() const
{ return getCdAlias()->usedImplementationClasses(); }
- virtual UsesClassDict *usedByImplementationClasses() const
+ virtual const UsesClassList &usedByImplementationClasses() const
{ return getCdAlias()->usedByImplementationClasses(); }
- virtual UsesClassDict *usedInterfaceClasses() const
- { return getCdAlias()->usedInterfaceClasses(); }
- virtual ConstraintClassDict *templateTypeConstraints() const
+ virtual const ConstraintClassList &templateTypeConstraints() const
{ 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(); }
@@ -496,10 +495,8 @@ class ClassDefAliasImpl : public DefinitionAliasMixin<ClassDef>
{ return getCdAlias()->getMemberLists(); }
virtual const MemberGroupList &getMemberGroups() const
{ return getCdAlias()->getMemberGroups(); }
- virtual QDict<int> *getTemplateBaseClassNames() const
+ virtual const TemplateNameMap &getTemplateBaseClassNames() const
{ return getCdAlias()->getTemplateBaseClassNames(); }
- virtual ClassDef *getVariableInstance(const char *templSpec) const
- { return getCdAlias()->getVariableInstance(templSpec); }
virtual bool isUsedOnly() const
{ return getCdAlias()->isUsedOnly(); }
virtual QCString anchor() const
@@ -510,7 +507,7 @@ class ClassDefAliasImpl : public DefinitionAliasMixin<ClassDef>
{ return getCdAlias()->isSimple(); }
virtual const ClassDef *tagLessReference() const
{ return getCdAlias()->tagLessReference(); }
- virtual MemberDef *isSmartPointer() const
+ virtual const MemberDef *isSmartPointer() const
{ return getCdAlias()->isSmartPointer(); }
virtual bool isJavaEnum() const
{ return getCdAlias()->isJavaEnum(); }
@@ -534,17 +531,19 @@ 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); }
virtual int countInheritanceNodes() const
{ return getCdAlias()->countInheritanceNodes(); }
virtual int countMemberDeclarations(MemberListType lt,const ClassDef *inheritedFrom,
- int lt2,bool invert,bool showAlways,QPtrDict<void> *visitedClasses) const
+ int lt2,bool invert,bool showAlways,ClassDefSet &visitedClasses) const
{ 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
@@ -554,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;
}
@@ -573,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
@@ -594,7 +591,7 @@ class ClassDefImpl::IMPL
/*! Include information about the header file should be included
* in the documentation. 0 by default, set by setIncludeFile().
*/
- IncludeInfo *incInfo = 0;
+ std::unique_ptr<IncludeInfo> incInfo;
/*! List of base class (or super-classes) from which this class derives
* directly.
@@ -608,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;
@@ -643,24 +640,17 @@ class ClassDefImpl::IMPL
ClassLinkedRefMap innerClasses;
/* classes for the collaboration diagram */
- UsesClassDict *usesImplClassDict = 0;
- UsesClassDict *usedByImplClassDict = 0;
- UsesClassDict *usesIntfClassDict = 0;
+ UsesClassList usesImplClassList;
+ UsesClassList usedByImplClassList;
- ConstraintClassDict *constraintClassDict = 0;
+ ConstraintClassList constraintClassList;
/*! Template instances that exists of this class, the key in the
* dictionary is the template argument list.
*/
- mutable QDict<ClassDef> *templateInstances = 0;
-
- /*! Template instances that exists of this class, as defined by variables.
- * We do NOT want to document these individually. The key in the
- * dictionary is the template argument list.
- */
- mutable QDict<ClassDef> *variableInstances = 0;
+ TemplateInstanceList templateInstances;
- QDict<int> *templBaseClassNames = 0;
+ TemplateNameMap templBaseClassNames;
/*! The class this class is an instance of. */
const ClassDef *templateMaster = 0;
@@ -708,7 +698,7 @@ class ClassDefImpl::IMPL
bool isSimple = false;
/** Does this class overloaded the -> operator? */
- MemberDef *arrowOperator = 0;
+ const MemberDef *arrowOperator = 0;
const ClassDef *tagLessRef = 0;
@@ -718,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);
}
@@ -731,19 +724,11 @@ void ClassDefImpl::IMPL::init(const char *defFileName, const char *name,
{
fileName=ctStr+name;
}
- incInfo=0;
prot=Public;
- nspace=0;
+ //nspace=0;
fileDef=0;
- usesImplClassDict=0;
- usedByImplClassDict=0;
- usesIntfClassDict=0;
- constraintClassDict=0;
subGrouping=Config_getBool(SUBGROUPING);
- templateInstances = 0;
- variableInstances = 0;
templateMaster =0;
- templBaseClassNames = 0;
isAbstract = FALSE;
isStatic = FALSE;
isTemplArg = FALSE;
@@ -756,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);
@@ -777,23 +762,15 @@ ClassDefImpl::IMPL::IMPL()
ClassDefImpl::IMPL::~IMPL()
{
- delete usesImplClassDict;
- delete usedByImplClassDict;
- delete usesIntfClassDict;
- delete constraintClassDict;
- delete incInfo;
- delete templateInstances;
- delete variableInstances;
- delete templBaseClassNames;
}
//-------------------------------------------------------------------------------------------
// 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)
{
@@ -805,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);
}
@@ -828,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;
}
@@ -862,19 +839,19 @@ 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();
}
}
}
// adds new member definition to the class
-void ClassDefImpl::internalInsertMember(MemberDef *md,
+void ClassDefImpl::internalInsertMember(const MemberDef *md,
Protection prot,
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)
@@ -1044,7 +1021,7 @@ void ClassDefImpl::internalInsertMember(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 */
@@ -1100,7 +1077,7 @@ void ClassDefImpl::internalInsertMember(MemberDef *md,
case MemberType_Function:
if (md->isConstructor() || md->isDestructor())
{
- m_impl->memberLists.get(MemberListType_constructors)->append(md);
+ m_impl->memberLists.get(MemberListType_constructors)->push_back(md);
}
else
{
@@ -1112,7 +1089,7 @@ void ClassDefImpl::internalInsertMember(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());
@@ -1149,7 +1126,7 @@ void ClassDefImpl::internalInsertMember(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));
@@ -1205,21 +1182,20 @@ void ClassDefImpl::findSectionsInDocumentation()
// add a file name to the used files set
-void ClassDefImpl::insertUsedFile(FileDef *fd)
+void ClassDefImpl::insertUsedFile(const FileDef *fd)
{
if (fd==0) return;
- if (m_impl->files.find(fd)==-1) m_impl->files.append(fd);
- if (m_impl->templateInstances)
+ auto it = std::find(m_impl->files.begin(),m_impl->files.end(),fd);
+ if (it==m_impl->files.end())
{
- QDictIterator<ClassDef> qdi(*m_impl->templateInstances);
- ClassDef *cd;
- for (qdi.toFirst();(cd=qdi.current());++qdi)
+ m_impl->files.push_back(fd);
+ }
+ for (const auto &ti : m_impl->templateInstances)
+ {
+ ClassDefMutable *cdm = toClassDefMutable(ti.classDef);
+ if (cdm)
{
- ClassDefMutable *cdm = toClassDefMutable(cd);
- if (cdm)
- {
- cdm->insertUsedFile(fd);
- }
+ cdm->insertUsedFile(fd);
}
}
}
@@ -1247,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=new IncludeInfo;
- if ((includeName && m_impl->incInfo->includeName.isEmpty()) ||
+ if (!m_impl->incInfo) m_impl->incInfo = std::make_unique<IncludeInfo>();
+ if ((!includeName.isEmpty() && m_impl->incInfo->includeName.isEmpty()) ||
(fd!=0 && m_impl->incInfo->fileDef==0)
)
{
@@ -1260,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;
@@ -1320,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<");
@@ -1336,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(" ");
@@ -1353,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();
}
}
@@ -1369,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);
@@ -1402,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())
@@ -1416,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);
@@ -1459,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())
@@ -1487,29 +1480,30 @@ QCString ClassDefImpl::generatedFromFiles() const
{
QCString result;
SrcLangExt lang = getLanguage();
+ size_t numFiles = m_impl->files.size();
if (lang==SrcLangExt_Fortran)
{
result = theTranslator->trGeneratedFromFilesFortran(
getLanguage()==SrcLangExt_ObjC && m_impl->compType==Interface ? Class : m_impl->compType,
- m_impl->files.count()==1);
+ numFiles==1);
}
else if (isJavaEnum())
{
- result = theTranslator->trEnumGeneratedFromFiles(m_impl->files.count()==1);
+ result = theTranslator->trEnumGeneratedFromFiles(numFiles==1);
}
else if (m_impl->compType==Service)
{
- result = theTranslator->trServiceGeneratedFromFiles(m_impl->files.count()==1);
+ result = theTranslator->trServiceGeneratedFromFiles(numFiles==1);
}
else if (m_impl->compType==Singleton)
{
- result = theTranslator->trSingletonGeneratedFromFiles(m_impl->files.count()==1);
+ result = theTranslator->trSingletonGeneratedFromFiles(numFiles==1);
}
else
{
result = theTranslator->trGeneratedFromFiles(
getLanguage()==SrcLangExt_ObjC && m_impl->compType==Interface ? Class : m_impl->compType,
- m_impl->files.count()==1);
+ numFiles==1);
}
return result;
}
@@ -1532,9 +1526,7 @@ void ClassDefImpl::showUsedFiles(OutputList &ol) const
ol.enable(OutputGenerator::Docbook);
bool first=TRUE;
- QListIterator<FileDef> li(m_impl->files);
- FileDef *fd;
- for (;(fd=li.current());++li)
+ for (const auto &fd : m_impl->files)
{
if (first)
{
@@ -1560,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
{
@@ -1578,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
{
@@ -1624,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())
{
@@ -1657,80 +1647,61 @@ void ClassDefImpl::writeInheritanceGraph(OutputList &ol) const
if (!m_impl->inherits.empty())
{
- ol.startParagraph();
- //parseText(ol,theTranslator->trInherits()+" ");
-
- QCString inheritLine = theTranslator->trInheritsList((int)m_impl->inherits.size());
- QRegExp marker("@[0-9]+");
- int index=0,newIndex,matchLen;
- // now replace all markers in inheritLine with links to the classes
- while ((newIndex=marker.match(inheritLine,index,&matchLen))!=-1)
+ auto replaceFunc = [this,&ol](size_t entryIndex)
{
- ol.parseText(inheritLine.mid(index,newIndex-index));
- bool ok;
- uint entryIndex = inheritLine.mid(newIndex+1,matchLen-1).toUInt(&ok);
- BaseClassDef &bcd=m_impl->inherits.at(entryIndex);
- if (ok)
- {
- ClassDef *cd=bcd.classDef;
+ BaseClassDef &bcd=m_impl->inherits[entryIndex];
+ ClassDef *cd=bcd.classDef;
- // use the class name but with the template arguments as given
- // in the inheritance relation
- QCString displayName = insertTemplateSpecifierInScope(
- cd->displayName(),bcd.templSpecifiers);
+ // use the class name but with the template arguments as given
+ // in the inheritance relation
+ QCString displayName = insertTemplateSpecifierInScope(
+ cd->displayName(),bcd.templSpecifiers);
- if (cd->isLinkable())
- {
- ol.writeObjectLink(cd->getReference(),
- cd->getOutputFileBase(),
- cd->anchor(),
- displayName);
- }
- else
- {
- ol.docify(displayName);
- }
+ if (cd->isLinkable())
+ {
+ ol.writeObjectLink(cd->getReference(),
+ cd->getOutputFileBase(),
+ cd->anchor(),
+ displayName);
}
else
{
- err("invalid marker %d in inherits list!\n",entryIndex);
+ ol.docify(displayName);
}
- index=newIndex+matchLen;
- }
- ol.parseText(inheritLine.right(inheritLine.length()-(uint)index));
+ };
+
+ ol.startParagraph();
+ writeMarkerList(ol,
+ theTranslator->trInheritsList((int)m_impl->inherits.size()).str(),
+ m_impl->inherits.size(),
+ replaceFunc);
ol.endParagraph();
}
// write subclasses
if (!m_impl->inheritedBy.empty())
{
- ol.startParagraph();
- QCString inheritLine = theTranslator->trInheritedByList((int)m_impl->inheritedBy.size());
- QRegExp marker("@[0-9]+");
- int index=0,newIndex,matchLen;
- // now replace all markers in inheritLine with links to the classes
- while ((newIndex=marker.match(inheritLine,index,&matchLen))!=-1)
+
+ auto replaceFunc = [this,&ol](size_t entryIndex)
{
- ol.parseText(inheritLine.mid(index,newIndex-index));
- bool ok;
- uint entryIndex = inheritLine.mid(newIndex+1,matchLen-1).toUInt(&ok);
- BaseClassDef &bcd=m_impl->inheritedBy.at(entryIndex);
- if (ok)
+ BaseClassDef &bcd=m_impl->inheritedBy[entryIndex];
+ ClassDef *cd=bcd.classDef;
+ if (cd->isLinkable())
{
- ClassDef *cd=bcd.classDef;
- if (cd->isLinkable())
- {
- ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),cd->displayName());
- }
- else
- {
- ol.docify(cd->displayName());
- }
- writeInheritanceSpecifier(ol,bcd);
+ ol.writeObjectLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),cd->displayName());
}
- index=newIndex+matchLen;
- }
- ol.parseText(inheritLine.right(inheritLine.length()-(uint)index));
+ else
+ {
+ ol.docify(cd->displayName());
+ }
+ writeInheritanceSpecifier(ol,bcd);
+ };
+
+ ol.startParagraph();
+ writeMarkerList(ol,
+ theTranslator->trInheritedByList((int)m_impl->inheritedBy.size()).str(),
+ m_impl->inheritedBy.size(),
+ replaceFunc);
ol.endParagraph();
}
@@ -1788,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 += '/';
@@ -1814,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();
@@ -1823,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
{
@@ -1923,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();
@@ -1943,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
{
@@ -1973,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();
}
}
@@ -1992,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);
@@ -2002,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);
@@ -2012,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)
{
@@ -2047,22 +2018,19 @@ void ClassDefImpl::writeSummaryLinks(OutputList &ol) const
{
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::Class));
- LayoutDocEntry *lde;
bool first=TRUE;
SrcLangExt lang = getLanguage();
if (lang!=SrcLangExt_VHDL)
{
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
{
if (lde->kind()==LayoutDocEntry::ClassNestedClasses &&
m_impl->innerClasses.declVisible()
)
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
- ol.writeSummaryLink(0,"nested-classes",ls->title(lang),first);
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
+ ol.writeSummaryLink(QCString(),"nested-classes",ls->title(lang),first);
first=FALSE;
}
else if (lde->kind()==LayoutDocEntry::ClassAllMembersLink &&
@@ -2075,11 +2043,11 @@ void ClassDefImpl::writeSummaryLinks(OutputList &ol) const
}
else if (lde->kind()== LayoutDocEntry::MemberDecl)
{
- LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
+ const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
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;
}
}
@@ -2089,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;
}
}
@@ -2100,9 +2068,9 @@ void ClassDefImpl::writeSummaryLinks(OutputList &ol) const
ol.popGeneratorState();
}
-void ClassDefImpl::writeTagFile(FTextStream &tagFile)
+void ClassDefImpl::writeTagFile(TextStream &tagFile)
{
- if (!isLinkableInProject()) return;
+ if (!isLinkableInProject() || isArtificial()) return;
tagFile << " <compound kind=\"";
if (isFortran() && (compoundTypeString() == "type"))
tagFile << "struct";
@@ -2110,21 +2078,26 @@ 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)
{
- tagFile << " <templarg>" << convertToXML(a.name) << "</templarg>" << endl;
+ tagFile << " <templarg>" << convertToXML(a.type);
+ if (!a.name.isEmpty())
+ {
+ tagFile << " " << convertToXML(a.name);
+ }
+ tagFile << "</templarg>\n";
}
for (const auto &ibcd : m_impl->inherits)
{
@@ -2146,14 +2119,11 @@ void ClassDefImpl::writeTagFile(FTextStream &tagFile)
{
tagFile << " virtualness=\"virtual\"";
}
- tagFile << ">" << convertToXML(cd->name()) << "</base>" << endl;
+ tagFile << ">" << convertToXML(cd->name()) << "</base>\n";
}
}
}
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::Class));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
{
switch (lde->kind())
{
@@ -2167,14 +2137,14 @@ void ClassDefImpl::writeTagFile(FTextStream &tagFile)
)
{
tagFile << " <class kind=\"" << innerCd->compoundTypeString() <<
- "\">" << convertToXML(innerCd->name()) << "</class>" << endl;
+ "\">" << convertToXML(innerCd->name()) << "</class>\n";
}
}
}
break;
case LayoutDocEntry::MemberDecl:
{
- LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
+ const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
MemberList * ml = getMemberList(lmd->type);
if (ml)
{
@@ -2195,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) */
@@ -2203,11 +2173,8 @@ void ClassDefImpl::writeInlineDocumentation(OutputList &ol) const
{
bool isSimple = m_impl->isSimple;
- ol.addIndexItem(name(),0);
- //printf("ClassDefImpl::writeInlineDocumentation(%s)\n",name().data());
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::Class));
- LayoutDocEntry *lde;
+ ol.addIndexItem(name(),QCString());
+ //printf("ClassDefImpl::writeInlineDocumentation(%s)\n",qPrint(name()));
// part 1: anchor and title
QCString s = compoundTypeString()+" "+name();
@@ -2216,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();
@@ -2250,7 +2217,7 @@ void ClassDefImpl::writeInlineDocumentation(OutputList &ol) const
SrcLangExt lang=getLanguage();
// part 2: the header and detailed description
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
{
switch (lde->kind())
{
@@ -2273,8 +2240,9 @@ void ClassDefImpl::writeInlineDocumentation(OutputList &ol) const
break;
case LayoutDocEntry::MemberDecl:
{
- LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
- if (!isSimple) writeMemberDeclarations(ol,lmd->type,lmd->title(lang),lmd->subtitle(lang),TRUE);
+ ClassDefSet visitedClasses;
+ const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
+ if (!isSimple) writeMemberDeclarations(ol,visitedClasses,lmd->type,lmd->title(lang),lmd->subtitle(lang),TRUE);
}
break;
case LayoutDocEntry::MemberGroups:
@@ -2288,7 +2256,7 @@ void ClassDefImpl::writeInlineDocumentation(OutputList &ol) const
break;
case LayoutDocEntry::MemberDef:
{
- LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
+ const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get();
if (isSimple)
{
writeSimpleMemberDocumentation(ol,lmd->type);
@@ -2372,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);
@@ -2405,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);
}
@@ -2465,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());
@@ -2478,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();
}
@@ -2527,10 +2494,7 @@ void ClassDefImpl::writeDocumentationContents(OutputList &ol,const QCString & /*
SrcLangExt lang = getLanguage();
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::Class));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
{
switch (lde->kind())
{
@@ -2564,13 +2528,14 @@ void ClassDefImpl::writeDocumentationContents(OutputList &ol,const QCString & /*
break;
case LayoutDocEntry::MemberDecl:
{
- LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
- writeMemberDeclarations(ol,lmd->type,lmd->title(lang),lmd->subtitle(lang));
+ ClassDefSet visitedClasses;
+ const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
+ writeMemberDeclarations(ol,visitedClasses,lmd->type,lmd->title(lang),lmd->subtitle(lang));
}
break;
case LayoutDocEntry::ClassNestedClasses:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeNestedClasses(ol,ls->title(lang));
}
break;
@@ -2579,7 +2544,7 @@ void ClassDefImpl::writeDocumentationContents(OutputList &ol,const QCString & /*
break;
case LayoutDocEntry::DetailedDesc:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeDetailedDescription(ol,pageType,exampleFlag,ls->title(lang));
}
break;
@@ -2591,7 +2556,7 @@ void ClassDefImpl::writeDocumentationContents(OutputList &ol,const QCString & /*
break;
case LayoutDocEntry::MemberDef:
{
- LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
+ const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get();
writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
}
break;
@@ -2607,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:
@@ -2623,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:
@@ -2884,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());
@@ -2908,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())
{
@@ -2954,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());
@@ -2962,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");
}
@@ -3055,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)
{
@@ -3117,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));
}
@@ -3130,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());
@@ -3150,25 +3125,23 @@ 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)
{
- if (m_impl->constraintClassDict==0)
- {
- m_impl->constraintClassDict = new ConstraintClassDict(17);
- m_impl->constraintClassDict->setAutoDelete(TRUE);
- }
- ConstraintClassDef *ccd=m_impl->constraintClassDict->find(typeConstraint);
- if (ccd==0)
+ auto it = std::find_if(m_impl->constraintClassList.begin(),
+ m_impl->constraintClassList.end(),
+ [&cd](const auto &ccd) { return ccd.classDef==cd; });
+
+ if (it==m_impl->constraintClassList.end())
{
- ccd = new ConstraintClassDef(cd);
- m_impl->constraintClassDict->insert(typeConstraint,ccd);
+ m_impl->constraintClassList.emplace_back(cd);
+ it = m_impl->constraintClassList.end()-1;
}
- ccd->addAccessor(type);
+ (*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));
}
}
@@ -3222,15 +3195,11 @@ bool ClassDefImpl::hasNonReferenceSuperClass() const
if (!found)
{
// look for template instances that might have non-reference super classes
- QDict<ClassDef> *cil = bcd->getTemplateInstances();
- if (cil)
+ for (const auto &cil : bcd->getTemplateInstances())
{
- QDictIterator<ClassDef> tidi(*cil);
- for ( ; tidi.current() && !found ; ++tidi) // for each template instance
- {
- // recurse into the template instance branch
- found = found || tidi.current()->hasNonReferenceSuperClass();
- }
+ // recurse into the template instance branch
+ found = cil.classDef->hasNonReferenceSuperClass();
+ if (found) break;
}
}
else
@@ -3241,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);
@@ -3256,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
{
@@ -3275,14 +3254,11 @@ void ClassDefImpl::writeDeclaration(OutputList &ol,const MemberDef *md,bool inGr
mg->writePlainDeclarations(ol,this,0,0,0,inheritedFrom,inheritId);
}
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::Class));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
{
if (lde->kind()==LayoutDocEntry::MemberDecl)
{
- LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
+ const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
writePlainMemberDeclaration(ol,lmd->type,inGroup,inheritedFrom,inheritId);
}
}
@@ -3360,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()));
@@ -3397,7 +3373,7 @@ bool ClassDefImpl::isSubClass(ClassDef *cd,int level) const
//----------------------------------------------------------------------------
-static bool isStandardFunc(MemberDef *md)
+static bool isStandardFunc(const MemberDef *md)
{
return md->name()=="operator=" || // assignment operator
md->isConstructor() || // constructor
@@ -3420,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())
@@ -3446,18 +3422,18 @@ void ClassDefImpl::mergeMembers()
{
for (auto &srcMi : *srcMni)
{
- MemberDef *srcMd = srcMi->memberDef();
+ const MemberDef *srcMd = srcMi->memberDef();
bool found=FALSE;
bool ambiguous=FALSE;
bool hidden=FALSE;
const ClassDef *srcCd = srcMd->getClassDef();
for (auto &dstMi : *dstMni)
{
- MemberDef *dstMd = dstMi->memberDef();
+ const MemberDef *dstMd = dstMi->memberDef();
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
{
@@ -3469,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;
}
@@ -3478,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()))
@@ -3507,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()))
@@ -3522,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,
@@ -3541,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);
}
}
@@ -3554,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()))
@@ -3602,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)
@@ -3614,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);
}
}
@@ -3673,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;
@@ -3708,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());
@@ -3753,25 +3729,23 @@ 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);
- if (m_impl->usesImplClassDict==0)
- {
- m_impl->usesImplClassDict = new UsesClassDict(17);
- m_impl->usesImplClassDict->setAutoDelete(TRUE);
- }
- UsesClassDef *ucd=m_impl->usesImplClassDict->find(cd->name());
- if (ucd==0)
+ //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(),
+ [&cd](const auto &ucd) { return ucd.classDef==cd; });
+ if (it==m_impl->usesImplClassList.end())
{
- ucd = new UsesClassDef(cd);
- m_impl->usesImplClassDict->insert(cd->name(),ucd);
- //printf("Adding used class %s to class %s via accessor %s\n",
- // cd->name().data(),name().data(),accessName);
+ m_impl->usesImplClassList.emplace_back(cd);
+ //printf("Adding used class %s to class %s via accessor %s\n",
+ // qPrint(cd->name()),qPrint(name()),accessName);
+ it = m_impl->usesImplClassList.end()-1;
}
QCString acc = accessName;
if (umlLook)
@@ -3784,28 +3758,26 @@ void ClassDefImpl::addUsedClass(ClassDef *cd,const char *accessName,
case Package: acc.prepend("~"); break;
}
}
- ucd->addAccessor(acc);
+ (*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);
- if (m_impl->usedByImplClassDict==0)
- {
- m_impl->usedByImplClassDict = new UsesClassDict(17);
- m_impl->usedByImplClassDict->setAutoDelete(TRUE);
- }
- UsesClassDef *ucd=m_impl->usedByImplClassDict->find(cd->name());
- if (ucd==0)
- {
- ucd = new UsesClassDef(cd);
- m_impl->usedByImplClassDict->insert(cd->name(),ucd);
+ //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(),
+ [&cd](const auto &ucd) { return ucd.classDef==cd; });
+ if (it==m_impl->usedByImplClassList.end())
+ {
+ 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;
if (umlLook)
@@ -3818,7 +3790,7 @@ void ClassDefImpl::addUsedByClass(ClassDef *cd,const char *accessName,
case Package: acc.prepend("~"); break;
}
}
- ucd->addAccessor(acc);
+ (*it).addAccessor(acc);
}
@@ -3913,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)
@@ -3932,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.
{
@@ -3940,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);
}
@@ -3949,11 +3921,14 @@ ClassDef *ClassDefImpl::insertTemplateInstance(const QCString &fileName,
int startLine, int startColumn, const QCString &templSpec,bool &freshInstance) const
{
freshInstance = FALSE;
- if (m_impl->templateInstances==0)
+ auto it = std::find_if(m_impl->templateInstances.begin(),
+ m_impl->templateInstances.end(),
+ [&templSpec](const auto &ti) { return templSpec==ti.templSpec; });
+ ClassDefMutable *templateClass=0;
+ if (it!=m_impl->templateInstances.end())
{
- m_impl->templateInstances = new QDict<ClassDef>(17);
+ templateClass = toClassDefMutable((*it).classDef);
}
- ClassDefMutable *templateClass=toClassDefMutable(m_impl->templateInstances->find(templSpec));
if (templateClass==0)
{
QCString tcname = removeRedundantWhiteSpace(localName()+templSpec);
@@ -3975,7 +3950,7 @@ ClassDef *ClassDefImpl::insertTemplateInstance(const QCString &fileName,
templateClass->setOuterScope(getOuterScope());
templateClass->setHidden(isHidden());
templateClass->setArtificial(isArtificial());
- m_impl->templateInstances->insert(templSpec,templateClass);
+ m_impl->templateInstances.push_back(TemplateInstanceDef(templSpec,templateClass));
// also add nested classes
for (const auto &innerCd : m_impl->innerClasses)
@@ -4000,63 +3975,28 @@ ClassDef *ClassDefImpl::insertTemplateInstance(const QCString &fileName,
return templateClass;
}
-ClassDef *ClassDefImpl::getVariableInstance(const char *templSpec) const
+void ClassDefImpl::setTemplateBaseClassNames(const TemplateNameMap &templateNames)
{
- if (m_impl->variableInstances==0)
- {
- m_impl->variableInstances = new QDict<ClassDef>(17);
- m_impl->variableInstances->setAutoDelete(TRUE);
- }
- ClassDefMutable *templateClass=toClassDefMutable(m_impl->variableInstances->find(templSpec));
- if (templateClass==0)
- {
- Debug::print(Debug::Classes,0," New template variable instance class '%s' '%s'\n",qPrint(name()),qPrint(templSpec));
- QCString tcname = removeRedundantWhiteSpace(name()+templSpec);
- templateClass = new ClassDefImpl("<code>",1,1,tcname,
- ClassDef::Class,0,0,FALSE);
- templateClass->addMembersToTemplateInstance( this, templateArguments(), templSpec );
- templateClass->setTemplateMaster(this);
- m_impl->variableInstances->insert(templSpec,templateClass);
- }
- return templateClass;
+ m_impl->templBaseClassNames = templateNames;
}
-void ClassDefImpl::setTemplateBaseClassNames(QDict<int> *templateNames)
-{
- if (templateNames==0) return;
- if (m_impl->templBaseClassNames==0)
- {
- m_impl->templBaseClassNames = new QDict<int>(17);
- m_impl->templBaseClassNames->setAutoDelete(TRUE);
- }
- // make a deep copy of the dictionary.
- QDictIterator<int> qdi(*templateNames);
- for (;qdi.current();++qdi)
- {
- if (m_impl->templBaseClassNames->find(qdi.currentKey())==0)
- {
- m_impl->templBaseClassNames->insert(qdi.currentKey(),new int(*qdi.current()));
- }
- }
-}
-
-QDict<int> *ClassDefImpl::getTemplateBaseClassNames() const
+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)
{
auto actualArguments_p = stringToArgumentList(getLanguage(),templSpec);
- MemberDef *md = mi->memberDef();
+ 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());
@@ -4066,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));
}
@@ -4143,7 +4083,7 @@ QCString ClassDefImpl::className() const
}
}
-void ClassDefImpl::setClassName(const char *name)
+void ClassDefImpl::setClassName(const QCString &name)
{
m_impl->className = name;
}
@@ -4152,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,
@@ -4161,7 +4101,7 @@ void ClassDefImpl::addListReferences()
: theTranslator->trClass(TRUE,TRUE),
getOutputFileBase(),
displayName(),
- 0,
+ QCString(),
this
);
}
@@ -4178,9 +4118,9 @@ void ClassDefImpl::addListReferences()
}
}
-MemberDef *ClassDefImpl::getMemberByName(const QCString &name) const
+const MemberDef *ClassDefImpl::getMemberByName(const QCString &name) const
{
- MemberDef *xmd = 0;
+ const MemberDef *xmd = 0;
MemberNameInfo *mni = m_impl->allMemberNameInfoLinkedMap.find(name);
if (mni)
{
@@ -4191,7 +4131,7 @@ 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;
@@ -4199,7 +4139,7 @@ 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;
}
@@ -4220,13 +4160,13 @@ MemberList *ClassDefImpl::getMemberList(MemberListType lt) const
return 0;
}
-void ClassDefImpl::addMemberToList(MemberListType lt,MemberDef *md,bool isBrief)
+void ClassDefImpl::addMemberToList(MemberListType lt,const MemberDef *md,bool isBrief)
{
static bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
static bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
const auto &ml = m_impl->memberLists.get(lt);
ml->setNeedsSorting((isBrief && sortBriefDocs) || (!isBrief && sortMemberDocs));
- ml->append(md);
+ ml->push_back(md);
// for members in the declaration lists we set the section, needed for member grouping
if ((ml->listType()&MemberListType_detailedLists)==0)
@@ -4256,9 +4196,9 @@ void ClassDefImpl::sortMemberLists()
}
int ClassDefImpl::countMemberDeclarations(MemberListType lt,const ClassDef *inheritedFrom,
- int lt2,bool invert,bool showAlways,QPtrDict<void> *visitedClasses) const
+ 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);
@@ -4295,14 +4235,11 @@ int ClassDefImpl::countMemberDeclarations(MemberListType lt,const ClassDef *inhe
void ClassDefImpl::setAnonymousEnumType()
{
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::Class));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
{
if (lde->kind()==LayoutDocEntry::MemberDecl)
{
- LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
+ const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
MemberList * ml = getMemberList(lmd->type);
if (ml)
{
@@ -4335,13 +4272,13 @@ void ClassDefImpl::countMembers()
int ClassDefImpl::countInheritedDecMembers(MemberListType lt,
const ClassDef *inheritedFrom,bool invert,bool showAlways,
- QPtrDict<void> *visitedClasses) const
+ ClassDefSet &visitedClasses) const
{
int inhCount = 0;
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)
@@ -4352,10 +4289,10 @@ 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);
- if (visitedClasses->find(icd)==0)
+ // qPrint(icd->name()),lt,lt1,lt2,ibcd->prot);
+ if (visitedClasses.find(icd)==visitedClasses.end())
{
- visitedClasses->insert(icd,icd); // guard for multiple virtual inheritance
+ visitedClasses.insert(icd); // guard for multiple virtual inheritance
if (lt1!=-1)
{
inhCount+=icd->countMemberDeclarations((MemberListType)lt1,inheritedFrom,lt2,FALSE,TRUE,visitedClasses);
@@ -4371,14 +4308,11 @@ void ClassDefImpl::getTitleForMemberListType(MemberListType type,
QCString &title,QCString &subtitle) const
{
SrcLangExt lang = getLanguage();
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::Class));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
{
if (lde->kind()==LayoutDocEntry::MemberDecl)
{
- LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
+ const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
if (lmd->type==type)
{
title = lmd->title(lang);
@@ -4394,22 +4328,15 @@ void ClassDefImpl::getTitleForMemberListType(MemberListType type,
int ClassDefImpl::countAdditionalInheritedMembers() const
{
int totalCount=0;
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::Class));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
{
if (lde->kind()==LayoutDocEntry::MemberDecl)
{
- LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
+ const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
if (lmd->type!=MemberListType_friends) // friendship is not inherited
{
- //MemberList *ml = getMemberList(lmd->type);
- //if (ml==0 || ml->numDecMembers()==0)
- //{
- QPtrDict<void> visited(17);
- totalCount+=countInheritedDecMembers(lmd->type,this,TRUE,FALSE,&visited);
- //}
+ ClassDefSet visited;
+ totalCount+=countInheritedDecMembers(lmd->type,this,TRUE,FALSE,visited);
}
}
}
@@ -4420,18 +4347,15 @@ int ClassDefImpl::countAdditionalInheritedMembers() const
void ClassDefImpl::writeAdditionalInheritedMembers(OutputList &ol) const
{
//printf("**** writeAdditionalInheritedMembers()\n");
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::Class));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Class))
{
if (lde->kind()==LayoutDocEntry::MemberDecl)
{
- LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
+ const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
if (lmd->type!=MemberListType_friends)
{
- QPtrDict<void> visited(17);
- writeInheritedMemberDeclarations(ol,lmd->type,-1,lmd->title(getLanguage()),this,TRUE,FALSE,&visited);
+ ClassDefSet visited;
+ writeInheritedMemberDeclarations(ol,visited,lmd->type,-1,lmd->title(getLanguage()),this,TRUE,FALSE);
}
}
}
@@ -4446,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() ||
@@ -4457,22 +4381,21 @@ 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;
}
-void ClassDefImpl::writeInheritedMemberDeclarations(OutputList &ol,
+void ClassDefImpl::writeInheritedMemberDeclarations(OutputList &ol,ClassDefSet &visitedClasses,
MemberListType lt,int lt2,const QCString &title,
- const ClassDef *inheritedFrom,bool invert,bool showAlways,
- QPtrDict<void> *visitedClasses) const
+ const ClassDef *inheritedFrom,bool invert,bool showAlways) const
{
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
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)
@@ -4486,19 +4409,19 @@ void ClassDefImpl::writeInheritedMemberDeclarations(OutputList &ol,
{
lt2=lt3;
}
- //printf("%s:convert %d->(%d,%d) prot=%d\n",icd->name().data(),lt,lt1,lt2,ibcd->prot);
- if (visitedClasses->find(icd)==0)
+ //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,icd); // guard for multiple virtual inheritance
+ visitedClasses.insert(icd); // guard for multiple virtual inheritance
if (lt1!=-1)
{
- icd->writeMemberDeclarations(ol,(MemberListType)lt1,
- title,QCString(),FALSE,inheritedFrom,lt2,FALSE,TRUE,visitedClasses);
+ icd->writeMemberDeclarations(ol,visitedClasses,(MemberListType)lt1,
+ title,QCString(),FALSE,inheritedFrom,lt2,FALSE,TRUE);
}
}
else
{
- //printf("%s: class already visited!\n",icd->name().data());
+ //printf("%s: class already visited!\n",qPrint(icd->name()));
}
}
}
@@ -4506,11 +4429,12 @@ void ClassDefImpl::writeInheritedMemberDeclarations(OutputList &ol,
ol.popGeneratorState();
}
-void ClassDefImpl::writeMemberDeclarations(OutputList &ol,MemberListType lt,const QCString &title,
- const char *subTitle,bool showInline,const ClassDef *inheritedFrom,int lt2,
- bool invert,bool showAlways,QPtrDict<void> *visitedClasses) const
+void ClassDefImpl::writeMemberDeclarations(OutputList &ol,ClassDefSet &visitedClasses,
+ MemberListType lt,const QCString &title,
+ 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
@@ -4528,7 +4452,7 @@ void ClassDefImpl::writeMemberDeclarations(OutputList &ol,MemberListType lt,cons
}
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)
{
@@ -4545,11 +4469,9 @@ void ClassDefImpl::writeMemberDeclarations(OutputList &ol,MemberListType lt,cons
static bool inlineInheritedMembers = Config_getBool(INLINE_INHERITED_MEMB);
if (!inlineInheritedMembers) // show inherited members as separate lists
{
- QPtrDict<void> visited(17);
- writeInheritedMemberDeclarations(ol,lt,lt2,title,
+ writeInheritedMemberDeclarations(ol,visitedClasses,lt,lt2,title,
inheritedFrom ? inheritedFrom : this,
- invert,showAlways,
- visitedClasses==0 ? &visited: visitedClasses);
+ invert,showAlways);
}
}
}
@@ -4557,7 +4479,7 @@ void ClassDefImpl::writeMemberDeclarations(OutputList &ol,MemberListType lt,cons
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
@@ -4569,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)
{
@@ -4609,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;
}
@@ -4619,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;
}
@@ -4654,17 +4576,17 @@ 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
{
return m_impl->fileDef;
}
-QDict<ClassDef> *ClassDefImpl::getTemplateInstances() const
+const TemplateInstanceList &ClassDefImpl::getTemplateInstances() const
{
return m_impl->templateInstances;
}
@@ -4679,29 +4601,24 @@ bool ClassDefImpl::isTemplate() const
return !m_impl->tempArgs.empty();
}
-IncludeInfo *ClassDefImpl::includeInfo() const
+const IncludeInfo *ClassDefImpl::includeInfo() const
{
- return m_impl->incInfo;
+ return m_impl->incInfo.get();
}
-UsesClassDict *ClassDefImpl::usedImplementationClasses() const
+const UsesClassList &ClassDefImpl::usedImplementationClasses() const
{
- return m_impl->usesImplClassDict;
+ return m_impl->usesImplClassList;
}
-UsesClassDict *ClassDefImpl::usedByImplementationClasses() const
+const UsesClassList &ClassDefImpl::usedByImplementationClasses() const
{
- return m_impl->usedByImplClassDict;
+ return m_impl->usedByImplClassList;
}
-UsesClassDict *ClassDefImpl::usedInterfaceClasses() const
+const ConstraintClassList &ClassDefImpl::templateTypeConstraints() const
{
- return m_impl->usesIntfClassDict;
-}
-
-ConstraintClassDict *ClassDefImpl::templateTypeConstraints() const
-{
- return m_impl->constraintClassDict;
+ return m_impl->constraintClassList;
}
bool ClassDefImpl::isTemplateArgument() const
@@ -4769,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;
@@ -4829,7 +4741,7 @@ bool ClassDefImpl::isSimple() const
return m_impl->isSimple;
}
-MemberDef *ClassDefImpl::isSmartPointer() const
+const MemberDef *ClassDefImpl::isSmartPointer() const
{
return m_impl->arrowOperator;
}
@@ -4887,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
}
@@ -4954,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 46e1f7d..2c8f870 100644
--- a/src/classdef.h
+++ b/src/classdef.h
@@ -21,10 +21,6 @@
#include <vector>
#include <set>
-#include <qlist.h>
-#include <qdict.h>
-#include <qptrdict.h>
-
#include "containers.h"
#include "definition.h"
#include "arguments.h"
@@ -43,23 +39,21 @@ class NamespaceDef;
class MemberDef;
class ExampleList;
class MemberNameInfoLinkedMap;
-class UsesClassDict;
-class ConstraintClassDict;
-class QTextStream;
class PackageDef;
class GroupDef;
-class StringDict;
struct IncludeInfo;
class ClassDefImpl;
-class FTextStream;
class ClassDef;
class ClassDefMutable;
+class UsesClassList;
+class ConstraintClassList;
+class MemberGroupList;
/** Class that contains information about an inheritance relation.
*/
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. */
@@ -86,6 +80,21 @@ struct BaseClassDef
using BaseClassList = std::vector<BaseClassDef>;
+/** Class that contains information about a template instance relation */
+struct TemplateInstanceDef
+{
+ TemplateInstanceDef(const QCString &ts,const ClassDef *cd) : templSpec(ts), classDef(cd) {}
+ QCString templSpec;
+ const ClassDef *classDef;
+};
+
+using TemplateInstanceList = std::vector<TemplateInstanceDef>;
+
+using TemplateNameMap = std::map<std::string,int>;
+
+using ClassDefSet = std::set<const ClassDef*>;
+
+
/** A abstract class representing of a compound symbol.
*
* A compound can be a class, struct, union, interface, service, singleton,
@@ -158,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;
@@ -202,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).
@@ -212,7 +221,7 @@ class ClassDef : public Definition
/** Returns the Java package this class is in or 0 if not applicable.
*/
- virtual MemberDef *getMemberByName(const QCString &) const = 0;
+ virtual const MemberDef *getMemberByName(const QCString &) const = 0;
/** Returns TRUE iff \a bcd is a direct or indirect base class of this
* class. This function will recursively traverse all branches of the
@@ -233,7 +242,7 @@ class ClassDef : public Definition
/** Returns a sorted dictionary with all template instances found for
* this template class. Returns 0 if not a template or no instances.
*/
- virtual QDict<ClassDef> *getTemplateInstances() const = 0;
+ virtual const TemplateInstanceList &getTemplateInstances() const = 0;
/** Returns the template master of which this class is an instance.
* Returns 0 if not applicable.
@@ -243,15 +252,13 @@ class ClassDef : public Definition
/** Returns TRUE if this class is a template */
virtual bool isTemplate() const = 0;
- virtual IncludeInfo *includeInfo() const = 0;
-
- virtual UsesClassDict *usedImplementationClasses() const = 0;
+ virtual const IncludeInfo *includeInfo() const = 0;
- virtual UsesClassDict *usedByImplementationClasses() const = 0;
+ virtual const UsesClassList &usedImplementationClasses() const = 0;
- virtual UsesClassDict *usedInterfaceClasses() const = 0;
+ virtual const UsesClassList &usedByImplementationClasses() const = 0;
- virtual ConstraintClassDict *templateTypeConstraints() const = 0;
+ virtual const ConstraintClassList &templateTypeConstraints() const = 0;
virtual bool isTemplateArgument() const = 0;
@@ -259,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.
@@ -322,9 +329,7 @@ class ClassDef : public Definition
/** Returns the member groups defined for this class */
virtual const MemberGroupList &getMemberGroups() const = 0;
- virtual QDict<int> *getTemplateBaseClassNames() const = 0;
-
- virtual ClassDef *getVariableInstance(const char *templSpec) const = 0;
+ virtual const TemplateNameMap &getTemplateBaseClassNames() const = 0;
virtual bool isUsedOnly() const = 0;
@@ -335,7 +340,7 @@ class ClassDef : public Definition
virtual const ClassDef *tagLessReference() const = 0;
- virtual MemberDef *isSmartPointer() const = 0;
+ virtual const MemberDef *isSmartPointer() const = 0;
virtual bool isJavaEnum() const = 0;
@@ -353,6 +358,8 @@ class ClassDef : public Definition
virtual bool isSliceLocal() const = 0;
virtual bool hasNonReferenceSuperClass() const = 0;
+ virtual QCString requiresClause() const = 0;
+
//-----------------------------------------------------------------------------------
// --- count members ----
//-----------------------------------------------------------------------------------
@@ -361,7 +368,7 @@ class ClassDef : public Definition
const ClassDef *inheritedFrom,bool additional) const = 0;
virtual int countInheritanceNodes() const = 0;
virtual int countMemberDeclarations(MemberListType lt,const ClassDef *inheritedFrom,
- int lt2,bool invert,bool showAlways,QPtrDict<void> *visitedClasses) const = 0;
+ int lt2,bool invert,bool showAlways,ClassDefSet &visitedClasses) const = 0;
//-----------------------------------------------------------------------------------
// --- helpers ----
@@ -370,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;
};
@@ -381,39 +388,39 @@ 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(QDict<int> *templateNames) = 0;
+ virtual void setTemplateBaseClassNames(const TemplateNameMap &templateNames) = 0;
virtual void setTemplateMaster(const ClassDef *tm) = 0;
virtual void setTypeConstraints(const ArgumentList &al) = 0;
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(FileDef *) = 0;
- virtual void addMembersToTemplateInstance(const ClassDef *cd,const ArgumentList &templateArguments,const char *templSpec) = 0;
+ virtual void insertUsedFile(const FileDef *) = 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;
@@ -439,15 +446,16 @@ 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 writeMemberDeclarations(OutputList &ol,MemberListType lt,const QCString &title,
- const char *subTitle=0,bool showInline=FALSE,const ClassDef *inheritedFrom=0,
- int lt2=-1,bool invert=FALSE,bool showAlways=FALSE,
- QPtrDict<void> *visitedClasses=0) const = 0;
+ virtual void writeTagFile(TextStream &) = 0;
+ virtual void writeMemberDeclarations(OutputList &ol,ClassDefSet &visitedClasses,
+ MemberListType lt,const QCString &title,
+ 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;
@@ -456,17 +464,13 @@ 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);
-// --- Set of classes
-
-using ClassDefSet = std::set<const ClassDef*>;
-
// --- Cast functions
ClassDef *toClassDef(Definition *d);
@@ -487,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. */
@@ -508,28 +512,12 @@ struct UsesClassDef
bool containment = true;
};
-/** Dictionary of usage relations.
- */
-class UsesClassDict : public QDict<UsesClassDef>
-{
- public:
- UsesClassDict(uint size) : QDict<UsesClassDef>(size) {}
- ~UsesClassDict() {}
-};
-
-/** Iterator class to iterate over a dictionary of usage relations.
- */
-class UsesClassDictIterator : public QDictIterator<UsesClassDef>
+class UsesClassList : public std::vector<UsesClassDef>
{
- public:
- UsesClassDictIterator(const QDict<UsesClassDef> &d)
- : QDictIterator<UsesClassDef>(d) {}
- ~UsesClassDictIterator() {}
};
//------------------------------------------------------------------------
-
/** Class that contains information about a type constraint relations.
*/
struct ConstraintClassDef
@@ -540,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. */
@@ -556,23 +544,8 @@ struct ConstraintClassDef
StringSet accessors;
};
-/** Dictionary of constraint relations.
- */
-class ConstraintClassDict : public QDict<ConstraintClassDef>
+class ConstraintClassList : public std::vector<ConstraintClassDef>
{
- public:
- ConstraintClassDict(uint size) : QDict<ConstraintClassDef>(size) {}
- ~ConstraintClassDict() {}
-};
-
-/** Iterator class to iterate over a dictionary of constraint relations.
- */
-class ConstraintClassDictIterator : public QDictIterator<ConstraintClassDef>
-{
- public:
- ConstraintClassDictIterator(const QDict<ConstraintClassDef> &d)
- : QDictIterator<ConstraintClassDef>(d) {}
- ~ConstraintClassDictIterator() {}
};
//------------------------------------------------------------------------
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 372ba5b..bc8719a 100644
--- a/src/cmdmapper.cpp
+++ b/src/cmdmapper.cpp
@@ -1,13 +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.
*
@@ -233,34 +230,34 @@ CommandMap htmlTagMap[] =
//----------------------------------------------------------------------------
-Mapper *Mappers::cmdMapper = new Mapper(cmdMap,TRUE);
-Mapper *Mappers::htmlTagMapper = new Mapper(htmlTagMap,FALSE);
+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 (n.isEmpty()) return 0;
+ QCString name = n;
if (!m_cs) name=name.lower();
- int *result;
- return !name.isEmpty() && (result=m_map.find(name)) ? *result: 0;
+ auto it = m_map.find(name.str());
+ return it!=m_map.end() ? it->second : 0;
}
QCString Mapper::find(const int n)
{
- QDictIterator<int> mapIterator(m_map);
- for (int *curVal = mapIterator.toFirst();(curVal = mapIterator.current());++mapIterator)
+ for (const auto &kv : m_map)
{
- if (*curVal == n || (*curVal == (n | SIMPLESECT_BIT))) return mapIterator.currentKey();
+ int curVal = kv.second;
+ if (curVal == n || (curVal == (n | SIMPLESECT_BIT))) return kv.first.c_str();
}
return QCString();
}
-Mapper::Mapper(const CommandMap *cm,bool caseSensitive) : m_map(89), m_cs(caseSensitive)
+Mapper::Mapper(const CommandMap *cm,bool caseSensitive) : m_cs(caseSensitive)
{
- m_map.setAutoDelete(TRUE);
const CommandMap *p = cm;
while (p->cmdName)
{
- m_map.insert(p->cmdName,new int(p->cmdId));
+ m_map.insert(std::make_pair(p->cmdName,p->cmdId));
p++;
}
}
diff --git a/src/cmdmapper.h b/src/cmdmapper.h
index a86c20a..17e17e9 100644
--- a/src/cmdmapper.h
+++ b/src/cmdmapper.h
@@ -1,13 +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,7 +16,9 @@
#ifndef _CMDMAPPER_H
#define _CMDMAPPER_H
-#include <qdict.h>
+#include <map>
+#include <string>
+#include "qcstring.h"
struct CommandMap;
@@ -28,9 +27,9 @@ const int SIMPLESECT_BIT = 0x1000;
enum CommandType
{
CMD_UNKNOWN = 0,
- CMD_ADDINDEX = 1,
+ CMD_ADDINDEX = 1,
CMD_AMP = 2,
- CMD_ANCHOR = 3,
+ CMD_ANCHOR = 3,
CMD_AT = 4,
CMD_ATTENTION = 5 | SIMPLESECT_BIT,
CMD_AUTHOR = 6 | SIMPLESECT_BIT,
@@ -38,18 +37,18 @@ enum CommandType
CMD_BOLD = 8,
CMD_BSLASH = 9,
CMD_CODE = 10,
- CMD_COPYDOC = 11,
+ CMD_COPYDOC = 11,
CMD_DATE = 12 | SIMPLESECT_BIT,
CMD_DOLLAR = 13,
- CMD_DONTINCLUDE = 14,
- CMD_DOTFILE = 15,
+ CMD_DONTINCLUDE = 14,
+ CMD_DOTFILE = 15,
CMD_EMPHASIS = 16,
- CMD_ENDCODE = 17,
- CMD_ENDHTMLONLY = 18,
- CMD_ENDLATEXONLY = 19,
- CMD_ENDLINK = 20,
+ CMD_ENDCODE = 17,
+ CMD_ENDHTMLONLY = 18,
+ CMD_ENDLATEXONLY = 19,
+ CMD_ENDLINK = 20,
CMD_ENDSECREFLIST= 21,
- CMD_ENDVERBATIM = 22,
+ CMD_ENDVERBATIM = 22,
CMD_ENDXMLONLY = 23,
CMD_EXCEPTION = 24 | SIMPLESECT_BIT,
CMD_FORMULA = 25,
@@ -57,9 +56,9 @@ enum CommandType
CMD_HASH = 27,
CMD_HTMLINCLUDE = 28,
CMD_HTMLONLY = 29,
- CMD_IMAGE = 30,
+ CMD_IMAGE = 30,
CMD_INCLUDE = 31,
- CMD_INTERNAL = 32,
+ CMD_INTERNAL = 32,
CMD_INTERNALREF = 33,
CMD_INVARIANT = 34 | SIMPLESECT_BIT ,
CMD_LATEXONLY = 35,
@@ -67,11 +66,11 @@ enum CommandType
CMD_LI = 37,
CMD_LINE = 38,
CMD_LINEBREAK = 39,
- CMD_LINK = 40,
+ CMD_LINK = 40,
CMD_NOTE = 41 | SIMPLESECT_BIT,
CMD_PAR = 42 | SIMPLESECT_BIT,
CMD_PARAM = 43 | SIMPLESECT_BIT,
- CMD_PERCENT = 44,
+ CMD_PERCENT = 44,
CMD_POST = 45 | SIMPLESECT_BIT,
CMD_PRE = 46 | SIMPLESECT_BIT,
CMD_REF = 47,
@@ -115,7 +114,7 @@ enum CommandType
CMD_COPYRIGHT = 85 | SIMPLESECT_BIT,
CMD_CITE = 86,
CMD_SNIPPET = 87,
- CMD_RTFONLY = 88,
+ CMD_RTFONLY = 88,
CMD_ENDRTFONLY = 89,
CMD_PIPE = 90,
CMD_VHDLFLOW = 91,
@@ -214,15 +213,16 @@ enum HtmlTagType
XML_INHERITDOC = XML_CmdMask + 22
};
+
/** Class representing a mapping from command names to command IDs. */
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:
- QDict<int> m_map;
+ std::map<std::string,int> m_map;
bool m_cs;
};
diff --git a/src/code.h b/src/code.h
index 42265ad..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,
@@ -46,6 +46,7 @@ class CCodeParser : public CodeParserInterface
bool collectXRefs=TRUE
);
void resetCodeParserState();
+ void setStartCodeLine(const bool inp);
private:
struct Private;
std::unique_ptr<Private> p;
diff --git a/src/code.l b/src/code.l
index 6feda35..3acf41a 100644
--- a/src/code.l
+++ b/src/code.l
@@ -34,12 +34,11 @@
#include <vector>
#include <string>
#include <mutex>
+#include <sstream>
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
-#include <qregexp.h>
-#include <qdir.h>
#include "code.h"
#include "entry.h"
@@ -59,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
@@ -78,7 +78,7 @@ struct ObjCCallCtx
int id;
QCString methodName;
QCString objectTypeOrName;
- QGString comment;
+ TextStream comment;
const ClassDef *objectType;
const MemberDef *objectVar;
const MemberDef *method;
@@ -93,11 +93,16 @@ struct codeYY_state
std::unordered_map< std::string, ScopedTypeVariant > codeClassMap;
QCString curClassName;
- QStrList curClassBases;
+ StringVector curClassBases;
QCString parmType;
QCString parmName;
+ bool beginCodeLine = true; //!< signals whether or not we should with the first line
+ //!< write a start line code or not. Essential
+ //!< when this code parser is called from another
+ //!< code parser.
+
const char * inputString = 0; //!< the code fragment as text
yy_size_t inputPosition = 0; //!< read offset during parsing
int inputLines = 0; //!< number of line in the code fragment
@@ -178,7 +183,7 @@ struct codeYY_state
SymbolResolver symbolResolver;
};
-static bool isCastKeyword(const QCString &s);
+static bool isCastKeyword(const char *s);
//-------------------------------------------------------------------
#if USE_STATE2STRING
@@ -188,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);
@@ -198,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);
@@ -236,9 +246,10 @@ 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);
+static bool startsWithKeyword(const QCString &str,const QCString &kw);
//-------------------------------------------------------------------
@@ -256,6 +267,7 @@ static std::mutex g_countFlowKeywordsMutex;
%}
B [ \t]
+Bopt {B}*
BN [ \t\n\r]
ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
SEP ("::"|"\\")
@@ -264,7 +276,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")
@@ -279,6 +291,8 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
RAWBEGIN (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"("
RAWEND ")"[^ \t\(\)\\]{0,16}\"
+ /* no comment start / end signs inside square brackets */
+NCOMM [^/\*]
//- start: NUMBER -------------------------------------------------------------------------
// Note same defines in commentcnv.l: keep in sync
DECIMAL_INTEGER [1-9][0-9']*[0-9]?[uU]?[lL]?[lL]?
@@ -307,6 +321,18 @@ FLOAT_NUMBER {FLOAT_DECIMAL}|{FLOAT_HEXADECIMAL}
NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
//- end: NUMBER ---------------------------------------------------------------------------
+ // C start comment
+CCS "/\*"
+ // C end comment
+CCE "*\/"
+ // Cpp comment
+CPPC "/\/"
+
+ // ENDIDopt
+ENDIDopt ("::"{ID})*
+ // Optional end qualifiers
+ENDQopt ("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"sealed"|"override"))*
+
%option noyywrap
%x SkipString
@@ -342,6 +368,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
%x ObjCSkipStr
%x ObjCCallComment
%x OldStyleArgs
+%x ConceptName
%x UsingName
%x RawString
%x InlineInit
@@ -400,7 +427,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
}
else // Start of Objective-C method
{
- //printf("Method!\n");
+ DBG_CTX((stderr,"Start of Objective-C method!\n"));
yyextra->code->codify(yytext);
BEGIN(ObjCMethod);
}
@@ -472,13 +499,13 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
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
{
- //printf("===== yes %s is ambiguous\n",yytext);
- QCString name = QDir::cleanDirPath(yytext).utf8();
+ DBG_CTX((stderr,"===== yes %s is ambiguous\n",yytext));
+ QCString name(Dir::cleanDirPath(yytext));
if (!name.isEmpty() && yyextra->sourceFileDef)
{
const FileName *fn = Doxygen::inputNameLinkedMap->find(name);
@@ -499,7 +526,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
found = TRUE;
}
}
- //printf(" 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);
@@ -535,7 +562,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
<SkipCPP>\\[\r]?\n {
codifyLines(yyscanner,yytext);
}
-<SkipCPP>"//"/[^/!] {
+<SkipCPP>{CPPC}/[^/!] {
REJECT;
}
<Body,FuncCall>"{" {
@@ -587,13 +614,13 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
BEGIN(Body);
}
<Body,ClassVar>"@end" {
- //printf("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;
yyextra->insideObjC = fd->name().lower().right(2)==".m" ||
fd->name().lower().right(3)==".mm";
- //printf("insideObjC=%d\n",yyextra->insideObjC);
+ DBG_CTX((stderr,"insideObjC=%d\n",yyextra->insideObjC));
}
else
{
@@ -631,7 +658,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
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 *
@@ -702,7 +729,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
}
<PackageName>{ID}("."{ID})* {
yyextra->curClassName=substitute(yytext,".","::");
- //printf("found package: %s\n",yyextra->curClassName.data());
+ DBG_CTX((stderr,"found package: %s\n",qPrint(yyextra->curClassName)));
addType(yyscanner);
codifyLines(yyscanner,yytext);
}
@@ -718,14 +745,14 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
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)
{
@@ -739,13 +766,13 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
BEGIN( Bases );
}
<PackageName>[ \t]*";" |
-<Bases>^{B}*/"@"{ID} | // Objective-C interface
+<Bases>^{Bopt}/"@"{ID} | // Objective-C interface
<Bases,ClassName,ClassVar,CppCliTypeModifierFollowup>{B}*"{"{B}* {
yyextra->theVarContext.pushScope();
yyextra->code->codify(yytext);
if (YY_START==ClassVar && yyextra->curClassName.isEmpty())
{
- yyextra->curClassName = yyextra->name.copy();
+ yyextra->curClassName = yyextra->name;
}
if (yyextra->searchingForBody)
{
@@ -758,14 +785,13 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
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);
@@ -773,12 +799,11 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
{
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)));
}
@@ -799,8 +824,8 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
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>"<" {
@@ -859,7 +884,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
}
-<Body>{SCOPEPREFIX}?"operator"{B}*"()"{B}*/"(" {
+<Body>{SCOPEPREFIX}?"operator"{B}*"()"{Bopt}/"(" {
addType(yyscanner);
generateFunctionLink(yyscanner,*yyextra->code,yytext);
yyextra->bracketCount=0;
@@ -890,17 +915,26 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
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);
}
-<UsingName>{ID}("::"{ID})* { addUsingDirective(yyscanner,yytext);
+<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);
- DBG_CTX((stderr,"** scope stack push CLASSBLOCK\n"));
- yyextra->scopeStack.push(CLASSBLOCK);
- pushScope(yyscanner,yytext);
BEGIN(Body);
}
<UsingName>\n { codifyLines(yyscanner,yytext); BEGIN(Body); }
@@ -1092,7 +1126,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
generatePHPVariableLink(yyscanner,*yyextra->code,yytext);
yyextra->name+=yytext+7;
}
-<Body,TemplCast>{SCOPENAME}{B}*"<"[^\n\/\-\.\{\"\>\(]*">"("::"{ID})*/{B}* { // A<T> *pt;
+<Body,TemplCast>{SCOPENAME}{B}*"<"[^\n\/\-\.\{\"\>\(]*">"{ENDIDopt}/{B}* { // A<T> *pt;
if (isCastKeyword(yytext) && YY_START==Body)
{
REJECT;
@@ -1102,13 +1136,14 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
yyextra->name+=yytext;
}
<Body>{SCOPENAME}/{BN}*[:;,)\]] { // "int var;" or "var, var2" or "debug(f) macro" , or int var : 5;
+ if (startsWithKeyword(yytext,"typedef")) REJECT;
addType(yyscanner);
// changed this to generateFunctionLink, see bug 624514
- //generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext,FALSE,TRUE);
generateFunctionLink(yyscanner,*yyextra->code,yytext);
yyextra->name+=yytext;
}
<Body>{SCOPENAME}/{B}* { // p->func()
+ if (startsWithKeyword(yytext,"typedef")) REJECT;
addType(yyscanner);
generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
yyextra->name+=yytext;
@@ -1135,11 +1170,11 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
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;
@@ -1170,7 +1205,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
<SkipStringS>[^\'\\\r\n]* {
yyextra->code->codify(yytext);
}
-<SkipString,SkipStringS>"//"|"/*" {
+<SkipString,SkipStringS>{CPPC}|{CCS} {
yyextra->code->codify(yytext);
}
<SkipString>@?\" {
@@ -1188,7 +1223,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
}
<RawString>{RAWEND} {
yyextra->code->codify(yytext);
- QCString delimiter = yytext+1;
+ QCString delimiter(yytext+1);
delimiter=delimiter.left(delimiter.length()-1);
if (delimiter==yyextra->delimiter)
{
@@ -1255,14 +1290,14 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
{
if (!generateClassMemberLink(yyscanner,*yyextra->code,yyextra->theCallContext.getScope().globalDef(),yytext))
{
- yyextra->code->codify(yytext);
+ codifyLines(yyscanner,yytext);
addToSearchIndex(yyscanner,yytext);
}
yyextra->name.resize(0);
}
else
{
- yyextra->code->codify(yytext);
+ codifyLines(yyscanner,yytext);
addToSearchIndex(yyscanner,yytext);
yyextra->name.resize(0);
}
@@ -1279,10 +1314,10 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
<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);
+ codifyLines(yyscanner,yytext);
addToSearchIndex(yyscanner,yytext);
}
yyextra->name.resize(0);
@@ -1290,7 +1325,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
else
{
DBG_CTX((stderr,"no class context!\n"));
- yyextra->code->codify(yytext);
+ codifyLines(yyscanner,yytext);
addToSearchIndex(yyscanner,yytext);
yyextra->name.resize(0);
}
@@ -1300,7 +1335,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
<Body>[,=;\[] {
if (yyextra->insideObjC && *yytext=='[')
{
- //printf("Found start of ObjC call!\n");
+ DBG_CTX((stderr,"Found start of ObjC call!\n"));
// start of a method call
yyextra->contextMap.clear();
yyextra->nameMap.clear();
@@ -1318,15 +1353,15 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
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);
@@ -1345,57 +1380,11 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
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())
- {
- //printf("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;
BEGIN(ObjCCall);
- //printf("open\n");
+ DBG_CTX((stderr,"open\n"));
}
<ObjCCall,ObjCMName>"]"|"}" {
yyextra->currentCtx->format+=*yytext;
@@ -1413,31 +1402,32 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
writeObjCMethodCall(yyscanner,ctx);
BEGIN(Body);
}
- //printf("close\n");
+ DBG_CTX((stderr,"close\n"));
}
-<ObjCCall,ObjCMName>"//".* {
+<ObjCCall,ObjCMName>{CPPC}.* {
yyextra->currentCtx->format+=escapeComment(yyscanner,yytext);
}
-<ObjCCall,ObjCMName>"/*" {
+<ObjCCall,ObjCMName>{CCS} {
yyextra->lastObjCCallContext = YY_START;
- yyextra->currentCtx->comment=yytext;
+ yyextra->currentCtx->comment.str(yytext);
BEGIN(ObjCCallComment);
}
-<ObjCCallComment>"*/" {
- yyextra->currentCtx->comment+=yytext;
- yyextra->currentCtx->format+=escapeComment(yyscanner,yyextra->currentCtx->comment);
+<ObjCCallComment>{CCE} {
+ 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>"//"|"/*" { 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;
- //printf("new type=%s\n",yyextra->currentCtx->objectTypeOrName.data());
+ DBG_CTX((stderr,"new type=%s\n",qPrint(yyextra->currentCtx->objectTypeOrName)));
BEGIN(ObjCMName);
}
}
@@ -1485,8 +1475,8 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
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);
@@ -1610,7 +1600,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
<MemberCall,MemberCall2,FuncCall>("*"{B}*)?")" {
if (yytext[0]==')') // no a pointer cast
{
- //printf("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;
@@ -1650,7 +1640,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
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);
@@ -1670,7 +1660,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
BEGIN( SkipInits );
}
}
-<CallEnd>("const"|"volatile"|"sealed"|"override")({BN}+("const"|"volatile"|"sealed"|"override"))*/{BN}*(";"|"="|"throw"{BN}*"(") {
+<CallEnd>{ENDQopt}/{BN}*(";"|"="|"throw"{BN}*"(") {
startFontClass(yyscanner,"keyword");
codifyLines(yyscanner,yytext);
endFontClass(yyscanner);
@@ -1684,11 +1674,11 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
//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)
{
@@ -1736,6 +1726,11 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
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())
{
@@ -1802,12 +1797,12 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
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);
@@ -1850,18 +1845,18 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
yyextra->memCallContext = YY_START;
BEGIN( MemberCall );
}
-<SkipComment>"/*"("!"?)"*/" {
+<SkipComment>{CCS}("!"?){CCE} {
yyextra->code->codify(yytext);
endFontClass(yyscanner);
BEGIN( yyextra->lastCContext ) ;
}
-<SkipComment>"//"|"/*" {
+<SkipComment>{CPPC}|{CCS} {
yyextra->code->codify(yytext);
}
-<SkipComment>[^*/\n]+ {
+<SkipComment>[^*\/\n]+ {
yyextra->code->codify(yytext);
}
-<SkipComment>[ \t]*"*/" {
+<SkipComment>[ \t]*{CCE} {
yyextra->code->codify(yytext);
endFontClass(yyscanner);
if (yyextra->lastCContext==SkipCPP)
@@ -1885,10 +1880,10 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
<SkipCxxComment>. {
yyextra->code->codify(yytext);
}
-<RemoveSpecialCComment>"*/"{B}*\n({B}*\n)*({B}*(("//@"[{}])|("/*@"[{}]"*/")){B}*\n)?{B}*"/*"[*!]/[^/*] {
+<RemoveSpecialCComment>{CCE}{B}*\n({B}*\n)*({B}*(({CPPC}"@"[{}])|({CCS}"@"[{}]{CCE})){B}*\n)?{B}*{CCS}[*!]/{NCOMM} {
yyextra->yyLineNr+=QCString(yytext).contains('\n');
}
-<RemoveSpecialCComment>"*/"{B}*\n({B}*\n)*({B}*(("//@"[{}])|("/*@"[{}]"*/")){B}*\n)? {
+<RemoveSpecialCComment>{CCE}{B}*\n({B}*\n)*({B}*(({CPPC}"@"[{}])|({CCS}"@"[{}]{CCE})){B}*\n)? {
if (yyextra->lastSpecialCContext==SkipCxxComment)
{ // force end of C++ comment here
yyextra->yyLineNr+=QCString(yytext).contains('\n');
@@ -1911,11 +1906,11 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
BEGIN(yyextra->lastSpecialCContext);
}
}
-<RemoveSpecialCComment>"*/" {
+<RemoveSpecialCComment>{CCE} {
BEGIN(yyextra->lastSpecialCContext);
}
<RemoveSpecialCComment>[^*\n]+
-<RemoveSpecialCComment>"//"|"/*"
+<RemoveSpecialCComment>{CPPC}|{CCS}
<RemoveSpecialCComment>\n { yyextra->yyLineNr++; }
<RemoveSpecialCComment>.
<MemberCall>[^a-z_A-Z0-9(\n] {
@@ -1924,7 +1919,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
yyextra->name.resize(0);
BEGIN(yyextra->memCallContext);
}
-<*>\n({B}*"//"[!/][^\n]*\n)+ { // remove special one-line comment
+<*>\n({B}*{CPPC}[!/][^\n]*\n)+ { // remove special one-line comment
if (YY_START==SkipCPP) REJECT;
if (Config_getBool(STRIP_CODE_COMMENTS))
{
@@ -1948,7 +1943,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
BEGIN( yyextra->lastSkipCppContext ) ;
unput('\n');
}
-<*>\n{B}*"//@"[{}].*\n { // remove one-line group marker
+<*>\n{B}*{CPPC}"@"[{}].*\n { // remove one-line group marker
if (Config_getBool(STRIP_CODE_COMMENTS))
{
yyextra->yyLineNr+=2;
@@ -1966,7 +1961,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
BEGIN( yyextra->lastCContext ) ;
}
}
-<*>\n{B}*"/*@"[{}] { // remove one-line group marker
+<*>\n{B}*{CCS}"@"[{}] { // remove one-line group marker
if (Config_getBool(STRIP_CODE_COMMENTS))
{
if (YY_START != RemoveSpecialCComment) yyextra->lastSpecialCContext = YY_START;
@@ -1985,7 +1980,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
BEGIN(SkipComment);
}
}
-<*>^{B}*"//@"[{}].*\n { // remove one-line group marker
+<*>^{B}*{CPPC}"@"[{}].*\n { // remove one-line group marker
if (Config_getBool(STRIP_CODE_COMMENTS))
{
yyextra->yyLineNr++;
@@ -1998,7 +1993,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
endFontClass(yyscanner);
}
}
-<*>^{B}*"/*@"[{}] { // remove multi-line group marker
+<*>^{B}*{CCS}"@"[{}] { // remove multi-line group marker
if (Config_getBool(STRIP_CODE_COMMENTS))
{
if (YY_START != RemoveSpecialCComment) yyextra->lastSpecialCContext = YY_START;
@@ -2016,20 +2011,15 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
BEGIN(SkipComment);
}
}
-<*>^{B}*"//"[!/][^\n]*\n { // remove special one-line comment
- if (Config_getBool(STRIP_CODE_COMMENTS))
- {
- yyextra->yyLineNr++;
- //nextCodeLine(yyscanner);
- }
- else
+<*>^{B}*{CPPC}[!/][^\n]* { // remove special one-line comment
+ if (!Config_getBool(STRIP_CODE_COMMENTS))
{
startFontClass(yyscanner,"comment");
codifyLines(yyscanner,yytext);
endFontClass(yyscanner);
}
}
-<*>"//"[!/][^\n]*/\n { // strip special one-line comment
+<*>{CPPC}[!/][^\n]* { // strip special one-line comment
if (YY_START==SkipComment || YY_START==SkipString) REJECT;
if (!Config_getBool(STRIP_CODE_COMMENTS))
{
@@ -2038,7 +2028,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
endFontClass(yyscanner);
}
}
-<*>\n{B}*"/*"[!*]/[^/*] {
+<*>\n{B}*{CCS}[!*]/{NCOMM} {
if (Config_getBool(STRIP_CODE_COMMENTS))
{
if (YY_START != RemoveSpecialCComment) yyextra->lastSpecialCContext = YY_START;
@@ -2057,7 +2047,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
BEGIN(SkipComment);
}
}
-<*>^{B}*"/**"[*]+/[^/] { // special C "banner" comment block at a new line
+<*>^{B}*{CCS}"*"[*]+/[^/] { // special C "banner" comment block at a new line
if (Config_getBool(JAVADOC_BANNER) && Config_getBool(STRIP_CODE_COMMENTS))
{
if (YY_START != RemoveSpecialCComment) yyextra->lastSpecialCContext = YY_START;
@@ -2075,7 +2065,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
BEGIN(SkipComment);
}
}
-<*>^{B}*"/*"[!*]/[^/*] { // special C comment block at a new line
+<*>^{B}*{CCS}[!*]/{NCOMM} { // special C comment block at a new line
if (Config_getBool(STRIP_CODE_COMMENTS))
{
if (YY_START != RemoveSpecialCComment) yyextra->lastSpecialCContext = YY_START;
@@ -2093,7 +2083,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
BEGIN(SkipComment);
}
}
-<*>"/*"[!*]/[^/*] { // special C comment block half way a line
+<*>{CCS}[!*]/{NCOMM} { // special C comment block half way a line
if (YY_START==SkipString) REJECT;
if (Config_getBool(STRIP_CODE_COMMENTS))
{
@@ -2112,7 +2102,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
BEGIN(SkipComment);
}
}
-<*>"/*"("!"?)"*/" {
+<*>{CCS}("!"?){CCE} {
if (YY_START==SkipString) REJECT;
if (!Config_getBool(STRIP_CODE_COMMENTS))
{
@@ -2124,7 +2114,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
<SkipComment>[^\*\n]+ {
yyextra->code->codify(yytext);
}
-<*>"/*" {
+<*>{CCS} {
startFontClass(yyscanner,"comment");
yyextra->code->codify(yytext);
// check is to prevent getting stuck in skipping C++ comments
@@ -2140,7 +2130,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
yyextra->lastVerbStringContext=YY_START;
BEGIN(SkipVerbString);
}
-<*>"//" {
+<*>{CPPC} {
startFontClass(yyscanner,"comment");
yyextra->code->codify(yytext);
yyextra->lastCContext = YY_START ;
@@ -2181,10 +2171,17 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
/*@ ----------------------------------------------------------------------------
*/
+static bool startsWithKeyword(const QCString &str,const QCString &kw)
+{
+ if (str.length()<kw.length()) return false; // string too short to match
+ return str==kw || // exact match
+ (str.startsWith(kw) && !isId(str.at(kw.length()))); // match that is not a substring
+}
+
static void addVariable(yyscan_t yyscanner,QCString type,QCString name)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- //printf("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 ")
@@ -2197,11 +2194,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
@@ -2210,7 +2207,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)
@@ -2225,7 +2222,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
@@ -2239,7 +2236,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()));
@@ -2252,7 +2249,7 @@ static void pushScope(yyscan_t yyscanner,const char *s)
yyextra->classScope += "::";
yyextra->classScope += s;
}
- //printf("pushScope(%s) result: '%s'\n",s,yyextra->classScope.data());
+ DBG_CTX((stderr,"pushScope(%s) result: '%s'\n",qPrint(s),qPrint(yyextra->classScope)));
}
@@ -2270,7 +2267,7 @@ static void popScope(yyscan_t yyscanner)
{
//err("Too many end of scopes found!\n");
}
- //printf("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)
@@ -2290,7 +2287,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)
@@ -2300,15 +2297,21 @@ 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;
- //printf("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
int te=n.findRev('>'); // end of template
- //printf("ts=%d te=%d\n",ts,te);
+ DBG_CTX((stderr,"ts=%d te=%d\n",ts,te));
if (ts!=-1 && te!=-1 && te>ts)
{
// remove template from scope
@@ -2326,7 +2329,7 @@ static void setClassScope(yyscan_t yyscanner,const QCString &name)
n = n.mid(i+2);
}
pushScope(yyscanner,n);
- //printf("--->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
@@ -2344,7 +2347,7 @@ static void startCodeLine(yyscan_t yyscanner)
//lineAnchor.sprintf("l%05d",yyextra->yyLineNr);
const Definition *d = yyextra->sourceFileDef->getSourceDefinition(yyextra->yyLineNr);
- //printf("%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;
@@ -2358,7 +2361,7 @@ static void startCodeLine(yyscan_t yyscanner)
yyextra->args.resize(0);
yyextra->parmType.resize(0);
yyextra->parmName.resize(0);
- //printf("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);
@@ -2366,27 +2369,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));
}
}
@@ -2415,11 +2419,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;
+ 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)
@@ -2434,18 +2439,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);
@@ -2466,7 +2476,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);
@@ -2480,24 +2490,23 @@ static void writeMultiLineCodeLink(yyscan_t yyscanner,CodeOutputInterface &ol,
tooltip = d->briefDescriptionAsTooltip();
}
bool done=FALSE;
- char *p=(char *)text;
+ const char *p=text.data();
while (!done)
{
- char *sp=p;
+ const char *sp=p;
char c;
while ((c=*p++) && c!='\n') { }
if (c=='\n')
{
yyextra->yyLineNr++;
- *(p-1)='\0';
- //printf("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),qPrint(QCString(sp,p-sp-1))));
+ ol.writeCodeLink(ref,file,anchor,QCString(sp,p-sp-1),tooltip);
nextCodeLine(yyscanner);
}
else
{
- //printf("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;
}
}
@@ -2540,7 +2549,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;
@@ -2555,7 +2564,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;
@@ -2574,7 +2583,7 @@ static const ClassDef *stripClassName(yyscan_t yyscanner,const char *s,const Def
{
cd=yyextra->symbolResolver.resolveClass(d,clName);
}
- //printf("stripClass trying '%s' = %p\n",clName.data(),cd);
+ DBG_CTX((stderr,"stripClass trying '%s' = %p\n",qPrint(clName),(void*)cd));
if (cd)
{
return cd;
@@ -2588,21 +2597,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);
- //printf("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())
{
- MemberDef *md=mcd->getMemberByName(locName);
+ const MemberDef *md=mcd->getMemberByName(locName);
if (md)
{
- //printf("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;
}
@@ -2615,7 +2624,7 @@ static const MemberDef *setCallContextForVar(yyscan_t yyscanner,const QCString &
const MemberDef *md=mnd->getMemberByName(locName);
if (md)
{
- //printf("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;
}
@@ -2630,25 +2639,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;
@@ -2659,7 +2668,7 @@ static const MemberDef *setCallContextForVar(yyscan_t yyscanner,const QCString &
// look for a global member
if ((mn=Doxygen::functionNameLinkedMap->find(name)))
{
- //printf("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();
@@ -2684,7 +2693,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())));
- //printf("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();
}
}
@@ -2698,7 +2707,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()))
{
@@ -2706,7 +2715,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()));
}
}
}
@@ -2714,9 +2723,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
)
{
@@ -2726,20 +2735,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())
{
- //printf("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);
- //printf("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))
{
@@ -2754,8 +2763,8 @@ static bool getLinkInScope(yyscan_t yyscanner,
if (d && d->isLinkable())
{
yyextra->theCallContext.setScope(ScopedTypeVariant(stripClassName(yyscanner,md->typeString(),md->getOuterScope())));
- //printf("yyextra->currentDefinition=%p yyextra->currentMemberDef=%p yyextra->insideBody=%d\n",
- // yyextra->currentDefinition,yyextra->currentMemberDef,yyextra->insideBody);
+ DBG_CTX((stderr,"yyextra->currentDefinition=%p yyextra->currentMemberDef=%p yyextra->insideBody=%d\n",
+ (void*)yyextra->currentDefinition,(void*)yyextra->currentMemberDef,yyextra->insideBody));
if (yyextra->currentDefinition && yyextra->currentMemberDef &&
md!=yyextra->currentMemberDef && yyextra->insideBody && yyextra->collectXRefs)
@@ -2763,17 +2772,17 @@ 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());
+ 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;
}
}
@@ -2781,14 +2790,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;
- //printf("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))
@@ -2806,18 +2816,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
{
@@ -2836,20 +2846,22 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,
const MemberDef *md=0;
bool isLocal=FALSE;
- //printf("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;
- //printf("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
@@ -2864,10 +2876,18 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,
writeMultiLineCodeLink(yyscanner,*yyextra->code,nd,clName);
return;
}
- //printf("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))
@@ -2878,10 +2898,10 @@ static void generateClassOrGlobalLink(yyscan_t yyscanner,
}
else
{
- //printf("local variable!\n");
+ DBG_CTX((stderr,"local variable!\n"));
if (lcd->type()!=ScopedTypeVariant::Dummy)
{
- //printf("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
@@ -2893,20 +2913,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);
- //printf("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))
{
@@ -2932,19 +2952,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);
- //printf("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 &&
@@ -2955,7 +2975,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;
@@ -2978,26 +2998,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
- //printf("type='%s' args='%s' class=%s\n",
- // xmd->typeString(),xmd->argsString(),
- // xmd->getClassDef()->name().data());
+ DBG_CTX((stderr,"type='%s' args='%s' class=%s\n",
+ 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);
- //printf("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))
{
@@ -3007,7 +3033,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 ?
@@ -3016,7 +3042,8 @@ static bool generateClassMemberLink(yyscan_t yyscanner,
if (xd && xd->isLinkable())
{
- //printf("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();
@@ -3043,14 +3070,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);
- //printf("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);
@@ -3070,7 +3097,7 @@ static bool generateClassMemberLink(yyscan_t yyscanner,
else if (def && def->definitionType()==Definition::TypeNamespace)
{
const NamespaceDef *nd = toNamespaceDef(def);
- //printf("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)
{
@@ -3086,11 +3113,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;
- //printf("generateMemberLink(object=%s,mem=%s) classScope=%s\n",
- // varName.data(),memName,yyextra->classScope.data());
+ DBG_CTX((stderr,"generateMemberLink(object=%s,mem=%s) classScope=%s\n",
+ qPrint(varName),qPrint(memName),qPrint(yyextra->classScope)));
if (varName.isEmpty()) return;
@@ -3100,10 +3127,10 @@ static void generateMemberLink(yyscan_t yyscanner,
{
if (stv->type()!=ScopedTypeVariant::Dummy)
{
- //printf("Class found!\n");
+ DBG_CTX((stderr,"Class found!\n"));
if (getLink(yyscanner,stv->name(),memName,ol))
{
- //printf("Found result!\n");
+ DBG_CTX((stderr,"Found result!\n"));
return;
}
if (stv->localDef() && !stv->localDef()->baseClasses().empty())
@@ -3112,7 +3139,7 @@ static void generateMemberLink(yyscan_t yyscanner,
{
if (getLink(yyscanner,bcName,memName,ol))
{
- //printf("Found result!\n");
+ DBG_CTX((stderr,"Found result!\n"));
return;
}
}
@@ -3124,7 +3151,7 @@ static void generateMemberLink(yyscan_t yyscanner,
const ClassDef *vcd = yyextra->symbolResolver.resolveClass(yyextra->currentDefinition,yyextra->classScope);
if (vcd && vcd->isLinkable())
{
- //printf("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)
{
@@ -3135,14 +3162,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)
{
- //printf("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())
{
@@ -3155,12 +3182,12 @@ static void generateMemberLink(yyscan_t yyscanner,
}
if (vmn)
{
- //printf("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)
{
- //printf("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())
{
@@ -3180,16 +3207,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("$");
- //printf("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;
@@ -3200,7 +3227,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() &&
@@ -3225,7 +3252,7 @@ static void generateFunctionLink(yyscan_t yyscanner,CodeOutputInterface &ol,cons
locFunc=locFunc.right(locFunc.length()-i-len).stripWhiteSpace();
int ts=locScope.find('<'); // start of template
int te=locScope.findRev('>'); // end of template
- //printf("ts=%d te=%d\n",ts,te);
+ DBG_CTX((stderr,"ts=%d te=%d\n",ts,te));
if (ts!=-1 && te!=-1 && te>ts)
{
// remove template from scope
@@ -3233,7 +3260,7 @@ static void generateFunctionLink(yyscan_t yyscanner,CodeOutputInterface &ol,cons
}
ts=funcScope.find('<'); // start of template
te=funcScope.findRev('>'); // end of template
- //printf("ts=%d te=%d\n",ts,te);
+ DBG_CTX((stderr,"ts=%d te=%d\n",ts,te));
if (ts!=-1 && te!=-1 && te>ts)
{
// remove template from scope
@@ -3298,6 +3325,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)
{
@@ -3333,7 +3365,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;
}
@@ -3345,15 +3377,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())
{
- //printf("writeObjCMethodCall(%s) obj=%s method=%s\n",
- // ctx->format.data(),ctx->objectTypeOrName.data(),ctx->methodName.data());
+ DBG_CTX((stderr,"writeObjCMethodCall(%s) obj=%s method=%s\n",
+ qPrint(ctx->format),qPrint(ctx->objectTypeOrName),qPrint(ctx->methodName)));
if (!ctx->objectTypeOrName.isEmpty() && ctx->objectTypeOrName.at(0)!='$')
{
- //printf("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
{
@@ -3370,29 +3401,29 @@ static void writeObjCMethodCall(yyscan_t yyscanner,ObjCCallCtx *ctx)
ctx->objectType = yyextra->symbolResolver.resolveClass(yyextra->currentDefinition,ctx->objectTypeOrName);
ctx->method = yyextra->symbolResolver.getTypedef();
}
- //printf(" 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);
- //printf(" 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
{
- //printf(" no\n");
- //printf("yyextra->currentDefinition=%p\n",yyextra->currentDefinition);
+ DBG_CTX((stderr," no\n"));
+ 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);
- //printf(" 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);
- //printf(" 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);
- //printf(" ctx->method=%p\n",ctx->method);
+ DBG_CTX((stderr," ctx->method=%p\n",(void*)ctx->method));
}
}
}
@@ -3400,7 +3431,7 @@ static void writeObjCMethodCall(yyscan_t yyscanner,ObjCCallCtx *ctx)
}
else // local variable
{
- //printf(" object is local variable\n");
+ DBG_CTX((stderr," object is local variable\n"));
if (stv->globalDef() && !ctx->methodName.isEmpty())
{
const ClassDef *cd = toClassDef(stv->globalDef());
@@ -3408,236 +3439,240 @@ static void writeObjCMethodCall(yyscan_t yyscanner,ObjCCallCtx *ctx)
{
ctx->method = cd->getMemberByName(ctx->methodName);
}
- //printf(" class=%p method=%p\n",cd,ctx->method);
+ DBG_CTX((stderr," class=%p method=%p\n",(void*)cd,(void*)ctx->method));
}
}
}
}
- //printf("[");
- while ((c=*p++)) // for each character in ctx->format
+ DBG_CTX((stderr,"["));
+ 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())
+ {
+ 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
{
- std::lock_guard<std::mutex> lock(g_docCrossReferenceMutex);
- addDocCrossReference(toMemberDefMutable(yyextra->currentMemberDef),toMemberDefMutable(ctx->method));
+ codifyLines(yyscanner,name);
}
}
else
{
- codifyLines(yyscanner,name);
+ DBG_CTX((stderr,"Invalid name: id=%d\n",refId));
}
}
- else
+ else if (nc=='o') // reference to potential object name
{
- //printf("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())
- {
- 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())
- {
- cd = cd->categoryOf();
- }
- for (const auto &bclass : cd->baseClasses())
+ if (yyextra->currentDefinition &&
+ yyextra->currentDefinition->definitionType()==Definition::TypeClass)
{
- if (bclass.classDef->compoundType()!=ClassDef::Protocol)
+ const ClassDef *cd = toClassDef(yyextra->currentDefinition);
+ if (cd->categoryOf())
+ {
+ cd = cd->categoryOf();
+ }
+ for (const auto &bclass : cd->baseClasses())
{
- ctx->objectType = bclass.classDef;
- if (ctx->objectType && !ctx->methodName.isEmpty())
+ 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
- {
- //printf("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));
}
- //printf(" ***** 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
{
- //printf("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);
+ }
}
}
- //printf("%s %s]\n",ctx->objectTypeOrName.data(),ctx->methodName.data());
- //printf("}=(type='%s',name='%s')",
- // 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')",
+ qPrint(ctx->objectTypeOrName),
+ qPrint(ctx->methodName)));
}
// Replaces an Objective-C method name fragment s by a marker of the form
@@ -3683,14 +3718,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();
@@ -3722,13 +3759,13 @@ static void saveObjCContext(yyscan_t yyscanner)
if (yyextra->braceCount==0 && YY_START==ObjCCall)
{
yyextra->currentCtx->objectTypeOrName=yyextra->currentCtx->format.mid(1);
- //printf("new type=%s\n",yyextra->currentCtx->objectTypeOrName.data());
+ DBG_CTX((stderr,"new type=%s\n",qPrint(yyextra->currentCtx->objectTypeOrName)));
}
yyextra->contextStack.push(yyextra->currentCtx);
}
else
{
- //printf("Trying to save NULL context!\n");
+ DBG_CTX((stderr,"Trying to save NULL context!\n"));
}
auto newCtx = std::make_unique<ObjCCallCtx>();
newCtx->id = yyextra->currentCtxId;
@@ -3737,7 +3774,7 @@ static void saveObjCContext(yyscan_t yyscanner)
newCtx->objectType = 0;
newCtx->objectVar = 0;
newCtx->method = 0;
- //printf("save state=%d\n",YY_START);
+ DBG_CTX((stderr,"save state=%d\n",YY_START));
yyextra->currentCtx = newCtx.get();
yyextra->contextMap.emplace(std::make_pair(yyextra->currentCtxId,std::move(newCtx)));
yyextra->braceCount = 0;
@@ -3747,7 +3784,7 @@ static void saveObjCContext(yyscan_t yyscanner)
static void restoreObjCContext(yyscan_t yyscanner)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- //printf("restore state=%d->%d\n",YY_START,yyextra->currentCtx->lexState);
+ DBG_CTX((stderr,"restore state=%d->%d\n",YY_START,yyextra->currentCtx->lexState));
BEGIN(yyextra->currentCtx->lexState);
yyextra->braceCount = yyextra->currentCtx->braceCount;
if (!yyextra->contextStack.empty())
@@ -3758,7 +3795,7 @@ static void restoreObjCContext(yyscan_t yyscanner)
else
{
yyextra->currentCtx = 0;
- //printf("Trying to pop context while yyextra->contextStack is empty!\n");
+ DBG_CTX((stderr,"Trying to pop context while yyextra->contextStack is empty!\n"));
}
}
@@ -3785,7 +3822,7 @@ CCodeParser::~CCodeParser()
void CCodeParser::resetCodeParserState()
{
struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
- //printf("***CodeParser::reset()\n");
+ DBG_CTX((stderr,"***CodeParser::reset()\n"));
yyextra->theVarContext.clear();
while (!yyextra->classScopeLengthStack.empty()) yyextra->classScopeLengthStack.pop();
yyextra->codeClassMap.clear();
@@ -3793,23 +3830,29 @@ void CCodeParser::resetCodeParserState()
yyextra->anchorCount = 0;
}
-void CCodeParser::parseCode(CodeOutputInterface &od,const char *className,const QCString &s,
- SrcLangExt lang,bool exBlock, const char *exName,FileDef *fd,
+void CCodeParser::setStartCodeLine(const bool inp)
+{
+ struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
+ yyextra->beginCodeLine = inp;
+}
+
+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)
{
yyscan_t yyscanner = p->yyscanner;
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- //printf("***parseCode() exBlock=%d exName=%s fd=%p className=%s searchCtx=%s\n",
- // exBlock,exName,fd,className,searchCtx?searchCtx->name().data():"<none>");
+ DBG_CTX((stderr,"***parseCode() exBlock=%d exName=%s fd=%p className=%s searchCtx=%s\n",
+ 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;
@@ -3837,7 +3880,7 @@ void CCodeParser::parseCode(CodeOutputInterface &od,const char *className,const
yyextra->theCallContext.clear();
while (!yyextra->scopeStack.empty()) yyextra->scopeStack.pop();
yyextra->classScope = className;
- //printf("parseCCode %s\n",className);
+ DBG_CTX((stderr,"parseCCode %s\n",qPrint(className)));
yyextra->exampleBlock = exBlock;
yyextra->exampleName = exName;
yyextra->sourceFileDef = fd;
@@ -3846,7 +3889,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;
@@ -3855,7 +3898,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;
@@ -3863,11 +3906,11 @@ void CCodeParser::parseCode(CodeOutputInterface &od,const char *className,const
if (!yyextra->exampleName.isEmpty())
{
yyextra->exampleFile = convertNameToFile(yyextra->exampleName+"-example",FALSE,TRUE);
- //printf("yyextra->exampleFile=%s\n",yyextra->exampleFile.data());
+ DBG_CTX((stderr,"yyextra->exampleFile=%s\n",qPrint(yyextra->exampleFile)));
}
yyextra->includeCodeFragment = inlineFragment;
- //printf("** exBlock=%d exName=%s include=%d\n",exBlock,exName,inlineFragment);
- startCodeLine(yyscanner);
+ 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);
yyextra->args.resize(0);
@@ -3892,7 +3935,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 b5f8e41..23611a9 100644
--- a/src/commentcnv.l
+++ b/src/commentcnv.l
@@ -27,11 +27,8 @@
#include <stdio.h>
#include <stdlib.h>
-
-#include <qstack.h>
-#include <qregexp.h>
-#include <qtextstream.h>
-#include <qglobal.h>
+#include <stack>
+#include <algorithm>
#include "bufstr.h"
#include "debug.h"
@@ -80,8 +77,8 @@ struct commentcnvYY_state
QCString fileName;
int lineNr = 0;
int condCtx = 0;
- QStack<CondCtx> condStack;
- QStack<CommentCtx> commentStack;
+ std::stack<CondCtx> condStack;
+ std::stack<int> commentStack;
QCString blockName;
int lastCommentContext = 0;
bool inSpecialComment = FALSE;
@@ -111,12 +108,13 @@ 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);
@@ -170,6 +168,23 @@ FLOAT_NUMBER {FLOAT_DECIMAL}|{FLOAT_HEXADECIMAL}
NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
//- end: NUMBER ---------------------------------------------------------------------------
+ // C start comment
+CCS "/\*"
+ // C end comment
+CCE "*\/"
+ // Cpp comment
+CPPC "/\/"
+
+ // Optional any character
+ANYopt .*
+
+ // Optional white space
+WSopt [ \t\r]*
+ // readline non special
+RLopt [^\\@\n\*\/]*
+ // Optional slash
+SLASHopt [/]*
+
%%
<Scan>{NUMBER} { //Note similar code in code.l
@@ -191,10 +206,10 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
{
yyextra->pythonDocString = TRUE;
yyextra->nestingCount=1;
- yyextra->commentStack.clear(); /* to be on the save side */
+ clearCommentStack(yyscanner); /* to be on the save side */
copyToOutput(yyscanner,yytext,(int)yyleng);
BEGIN(CComment);
- yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
+ yyextra->commentStack.push(yyextra->lineNr);
}
}
<Scan>![><!]/.*\n {
@@ -206,9 +221,9 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
{
copyToOutput(yyscanner,yytext,(int)yyleng);
yyextra->nestingCount=0; // Fortran doesn't have an end comment
- yyextra->commentStack.clear(); /* to be on the save side */
+ clearCommentStack(yyscanner); /* to be on the save side */
BEGIN(CComment);
- yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
+ yyextra->commentStack.push(yyextra->lineNr);
}
}
<Scan>[Cc\*][><!]/.*\n {
@@ -223,9 +238,9 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
{
copyToOutput(yyscanner,yytext,(int)yyleng);
yyextra->nestingCount=0; // Fortran doesn't have an end comment
- yyextra->commentStack.clear(); /* to be on the safe side */
+ clearCommentStack(yyscanner); /* to be on the save side */
BEGIN(CComment);
- yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
+ yyextra->commentStack.push(yyextra->lineNr);
}
else
{
@@ -276,8 +291,8 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
<Scan>\n { /* new line */
copyToOutput(yyscanner,yytext,(int)yyleng);
}
-<Scan>"//!"/.*\n[ \t]*"//"[\/!][^\/] | /* start C++ style special comment block */
-<Scan>("///"[/]*)/[^/].*\n[ \t]*"//"[\/!][^\/] { /* start C++ style special comment block */
+<Scan>{CPPC}"!"/.*\n[ \t]*{CPPC}[\/!][^\/] | /* start C++ style special comment block */
+<Scan>({CPPC}"/"[/]*)/[^/].*\n[ \t]*{CPPC}[\/!][^\/] { /* start C++ style special comment block */
if (yyextra->mlBrief)
{
REJECT; // bail out if we do not need to convert
@@ -291,48 +306,48 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
}
yyextra->blockHeadCol=yyextra->col;
copyToOutput(yyscanner,"/**",3);
- replaceAliases(yyscanner,yytext+i);
+ replaceAliases(yyscanner,QCString(yytext+i));
yyextra->inSpecialComment=TRUE;
//BEGIN(SComment);
yyextra->readLineCtx=SComment;
BEGIN(ReadLine);
}
}
-<Scan>"//##Documentation".*/\n { /* Start of Rational Rose ANSI C++ comment block */
+<Scan>{CPPC}"##Documentation"{ANYopt}/\n { /* Start of Rational Rose ANSI C++ comment block */
if (yyextra->mlBrief) REJECT;
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);
}
-<Scan>"//"[!\/]/.*\n[ \t]*"//"[|\/][ \t]*[@\\]"}" { // next line contains an end marker, see bug 752712
+<Scan>{CPPC}[!\/]/.*\n[ \t]*{CPPC}[|\/][ \t]*[@\\]"}" { // next line contains an end marker, see bug 752712
yyextra->inSpecialComment=yytext[2]=='/' || yytext[2]=='!';
copyToOutput(yyscanner,yytext,(int)yyleng);
yyextra->readLineCtx=YY_START;
BEGIN(ReadLine);
}
-<Scan>"//"/.*\n { /* one line C++ comment */
+<Scan>{CPPC}/.*\n { /* one line C++ comment */
yyextra->inSpecialComment=yytext[2]=='/' || yytext[2]=='!';
copyToOutput(yyscanner,yytext,(int)yyleng);
yyextra->readLineCtx=YY_START;
BEGIN(ReadLine);
}
-<Scan>"/**/" { /* avoid matching next rule for empty C comment, see bug 711723 */
+<Scan>{CCS}{CCE} { /* avoid matching next rule for empty C comment, see bug 711723 */
copyToOutput(yyscanner,yytext,(int)yyleng);
}
-<Scan>"/*"[*!]? { /* start of a C comment */
+<Scan>{CCS}[*!]? { /* start of a C comment */
if (yyextra->lang==SrcLangExt_Python)
{
REJECT;
}
yyextra->specialComment=(int)yyleng==3;
yyextra->nestingCount=1;
- yyextra->commentStack.clear(); /* to be on the save side */
+ clearCommentStack(yyscanner); /* to be on the save side */
copyToOutput(yyscanner,yytext,(int)yyleng);
BEGIN(CComment);
- yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
+ yyextra->commentStack.push(yyextra->lineNr);
}
<Scan>"#"("#")? {
if (yyextra->lang!=SrcLangExt_Python)
@@ -343,9 +358,9 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
{
copyToOutput(yyscanner,yytext,(int)yyleng);
yyextra->nestingCount=0; // Python doesn't have an end comment for #
- yyextra->commentStack.clear(); /* to be on the save side */
+ clearCommentStack(yyscanner); /* to be on the save side */
BEGIN(CComment);
- yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
+ yyextra->commentStack.push(yyextra->lineNr);
}
}
<Scan>"--"[^!][^\n]* {
@@ -368,9 +383,9 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
yyextra->vhdl = TRUE;
copyToOutput(yyscanner,yytext,(int)yyleng);
yyextra->nestingCount=0; // VHDL doesn't have an end comment
- yyextra->commentStack.clear(); /* to be on the save side */
+ clearCommentStack(yyscanner); /* to be on the save side */
BEGIN(CComment);
- yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
+ yyextra->commentStack.push(yyextra->lineNr);
}
}
<Scan>![><!] {
@@ -382,9 +397,9 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
{
copyToOutput(yyscanner,yytext,(int)yyleng);
yyextra->nestingCount=0; // Fortran doesn't have an end comment
- yyextra->commentStack.clear(); /* to be on the save side */
+ clearCommentStack(yyscanner); /* to be on the save side */
BEGIN(CComment);
- yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
+ yyextra->commentStack.push(yyextra->lineNr);
}
}
<CComment,ReadLine>{MAILADR} |
@@ -443,8 +458,14 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
yyextra->lastCommentContext = YY_START;
BEGIN(Verbatim);
}
+<Scan>"\\\"" { /* escaped double quote */
+ copyToOutput(yyscanner,yytext,(int)yyleng);
+ }
+<Scan>"\\\\" { /* escaped backslash */
+ copyToOutput(yyscanner,yytext,(int)yyleng);
+ }
<Scan>. { /* any other character */
- copyToOutput(yyscanner,yytext,(int)yyleng);
+ copyToOutput(yyscanner,yytext,(int)yyleng);
}
<Verbatim>[\\@]("endverbatim"|"endlatexonly"|"endhtmlonly"|"endxmlonly"|"enddocbookonly"|"endrtfonly"|"endmanonly"|"f$"|"f]"|"f}") { /* end of verbatim block */
copyToOutput(yyscanner,yytext,(int)yyleng);
@@ -501,7 +522,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
BEGIN(yyextra->lastCommentContext);
}
}
-<VerbatimCode>^[ \t]*"//"[\!\/]? { /* skip leading comments */
+<VerbatimCode>^[ \t]*{CPPC}[\!\/]? { /* skip leading comments */
if (!yyextra->inSpecialComment)
{
copyToOutput(yyscanner,yytext,(int)yyleng);
@@ -530,7 +551,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
<Verbatim,VerbatimCode>\n { /* new line in verbatim block */
copyToOutput(yyscanner,yytext,(int)yyleng);
}
-<Verbatim>^[ \t]*"//"[/!] {
+<Verbatim>^[ \t]*{CPPC}[/!] {
if (yyextra->blockName=="dot" || yyextra->blockName=="msc" || yyextra->blockName=="uml" || yyextra->blockName.at(0)=='f')
{
// see bug 487871, strip /// from dot images and formulas.
@@ -596,7 +617,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
<CComment>[^ `~<\\!@*\n{\"\/]* { /* anything that is not a '*' or command */
copyToOutput(yyscanner,yytext,(int)yyleng);
}
-<CComment>"*"+[^*/\\@\n{\"]* { /* stars without slashes */
+<CComment>"*"+[^*\/\\@\n{\"]* { /* stars without slashes */
copyToOutput(yyscanner,yytext,(int)yyleng);
}
<CComment>"\"\"\"" { /* end of Python docstring */
@@ -627,7 +648,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
REJECT;
}
yyextra->nestingCount++;
- yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
+ yyextra->commentStack.push(yyextra->lineNr);
copyToOutput(yyscanner,yytext,(int)yyleng);
}
<CComment>"*"+"/" { /* end of C comment */
@@ -647,7 +668,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
else
{
//yyextra->nestingCount--;
- delete yyextra->commentStack.pop();
+ yyextra->commentStack.pop();
}
}
}
@@ -728,18 +749,18 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
<CComment>. {
copyToOutput(yyscanner,yytext,(int)yyleng);
}
-<SComment>^[ \t]*"///"[\/]*/\n {
+<SComment>^[ \t]*{CPPC}"/"{SLASHopt}/\n {
replaceComment(yyscanner,0);
}
-<SComment>\n[ \t]*"///"[\/]*/\n {
+<SComment>\n[ \t]*{CPPC}"/"{SLASHopt}/\n {
replaceComment(yyscanner,1);
}
-<SComment>^[ \t]*"///"[^\/\n]/.*\n {
+<SComment>^[ \t]*{CPPC}"/"[^\/\n]/.*\n {
replaceComment(yyscanner,0);
yyextra->readLineCtx=YY_START;
BEGIN(ReadLine);
}
-<SComment>\n[ \t]*"//"[\/!]("<")?[ \t]*[\\@]"}".*\n {
+<SComment>\n[ \t]*{CPPC}[\/!]("<")?[ \t]*[\\@]"}".*\n {
/* See Bug 752712: end the multiline comment when finding a @} or \} command */
copyToOutput(yyscanner," */",3);
copyToOutput(yyscanner,yytext,(int)yyleng);
@@ -747,26 +768,26 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
yyextra->inRoseComment=FALSE;
BEGIN(Scan);
}
-<SComment>\n[ \t]*"///"[^\/\n]/.*\n {
+<SComment>\n[ \t]*{CPPC}"/"[^\/\n]/.*\n {
replaceComment(yyscanner,1);
yyextra->readLineCtx=YY_START;
BEGIN(ReadLine);
}
-<SComment>^[ \t]*"//!" | // just //!
-<SComment>^[ \t]*"//!<"/.*\n | // or //!< something
-<SComment>^[ \t]*"//!"[^<]/.*\n { // or //!something
+<SComment>^[ \t]*{CPPC}"!" | // just //!
+<SComment>^[ \t]*{CPPC}"!<"/.*\n | // or //!< something
+<SComment>^[ \t]*{CPPC}"!"[^<]/.*\n { // or //!something
replaceComment(yyscanner,0);
yyextra->readLineCtx=YY_START;
BEGIN(ReadLine);
}
-<SComment>\n[ \t]*"//!" |
-<SComment>\n[ \t]*"//!<"/.*\n |
-<SComment>\n[ \t]*"//!"[^<\n]/.*\n {
+<SComment>\n[ \t]*{CPPC}"!" |
+<SComment>\n[ \t]*{CPPC}"!<"/.*\n |
+<SComment>\n[ \t]*{CPPC}"!"[^<\n]/.*\n {
replaceComment(yyscanner,1);
yyextra->readLineCtx=YY_START;
BEGIN(ReadLine);
}
-<SComment>^[ \t]*"//##"/.*\n {
+<SComment>^[ \t]*{CPPC}"##"/.*\n {
if (!yyextra->inRoseComment)
{
REJECT;
@@ -778,7 +799,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
BEGIN(ReadLine);
}
}
-<SComment>\n[ \t]*"//##"/.*\n {
+<SComment>\n[ \t]*{CPPC}"##"/.*\n {
if (!yyextra->inRoseComment)
{
REJECT;
@@ -797,19 +818,19 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
yyextra->inRoseComment=FALSE;
BEGIN(Scan);
}
-<ReadLine>"/**" {
+<ReadLine>{CCS}"*" {
copyToOutput(yyscanner,"/&zwj;**",8);
}
-<ReadLine>"*/" {
+<ReadLine>{CCE} {
copyToOutput(yyscanner,"*&zwj;/",7);
}
<ReadLine>"*" {
copyToOutput(yyscanner,yytext,(int)yyleng);
}
-<ReadLine>[^\\@\n\*/]* {
+<ReadLine>{RLopt} {
copyToOutput(yyscanner,yytext,(int)yyleng);
}
-<ReadLine>[^\\@\n\*/]*/\n {
+<ReadLine>{RLopt}/\n {
copyToOutput(yyscanner,yytext,(int)yyleng);
BEGIN(yyextra->readLineCtx);
}
@@ -843,7 +864,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
<CondLine>[!()&| \ta-z_A-Z0-9.\-]+ {
handleCondSectionId(yyscanner,yytext);
}
-<CComment,ReadLine>[\\@]"cond"[ \t\r]*/\n {
+<CComment,ReadLine>[\\@]"cond"{WSopt}/\n {
yyextra->condCtx=YY_START;
handleCondSectionId(yyscanner," "); // fake section id causing the section to be hidden unconditionally
}
@@ -852,7 +873,7 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
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;
@@ -861,16 +882,16 @@ NUMBER {INTEGER_NUMBER}|{FLOAT_NUMBER}
yyextra->lastEscaped=0;
BEGIN( ReadAliasArgs );
}
-<ReadAliasArgs>^[ \t]*"//"[/!]/[^\n]+ { // skip leading special comments (see bug 618079)
+<ReadAliasArgs>^[ \t]*{CPPC}[/!]/[^\n]+ { // skip leading special comments (see bug 618079)
}
-<ReadAliasArgs>"*/" { // oops, end of comment in the middle of an alias?
+<ReadAliasArgs>{CCE} { // oops, end of comment in the middle of an alias?
if (yyextra->lang==SrcLangExt_Python)
{
REJECT;
}
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);
}
@@ -1016,13 +1037,19 @@ static inline void copyToOutput(yyscan_t yyscanner,const char *s,int len)
}
}
-static void startCondSection(yyscan_t yyscanner,const char *sectId)
+static void clearCommentStack(yyscan_t yyscanner)
+{
+ struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+ while (!yyextra->commentStack.empty()) yyextra->commentStack.pop();
+}
+
+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());
CondParser prs;
bool expResult = prs.parse(yyextra->fileName,yyextra->lineNr,sectId);
- yyextra->condStack.push(new CondCtx(yyextra->lineNr,sectId,yyextra->skip));
+ yyextra->condStack.push(CondCtx(yyextra->lineNr,sectId,yyextra->skip));
if (!expResult) // not enabled
{
yyextra->skip=TRUE;
@@ -1032,15 +1059,16 @@ static void startCondSection(yyscan_t yyscanner,const char *sectId)
static void endCondSection(yyscan_t yyscanner)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- if (yyextra->condStack.isEmpty())
+ if (yyextra->condStack.empty())
{
warn(yyextra->fileName,yyextra->lineNr,"Found \\endcond command without matching \\cond");
yyextra->skip=FALSE;
}
else
{
- CondCtx *ctx = yyextra->condStack.pop();
- yyextra->skip=ctx->skip;
+ const CondCtx &ctx = yyextra->condStack.top();
+ yyextra->skip=ctx.skip;
+ yyextra->condStack.pop();
}
//printf("endCondSection: skip=%d stack=%d\n",g_skip,g_condStack.count());
}
@@ -1049,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)
{
@@ -1075,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());
}
@@ -1087,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;
@@ -1124,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;
@@ -1144,65 +1172,63 @@ void convertCppComments(BufStr *inBuf,BufStr *outBuf,const char *fileName)
yyextra->lang = getLanguageFromFileName(fileName);
yyextra->pythonDocString = FALSE;
yyextra->lineNr = 1;
- yyextra->condStack.clear();
- yyextra->condStack.setAutoDelete(TRUE);
- yyextra->commentStack.clear();
- yyextra->commentStack.setAutoDelete(TRUE);
+ while (!yyextra->condStack.empty()) yyextra->condStack.pop();
+ 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)
{
yyextra->nestingCount=0;
BEGIN(CComment);
- yyextra->commentStack.push(new CommentCtx(yyextra->lineNr));
+ yyextra->commentStack.push(yyextra->lineNr);
}
else
{
BEGIN(Scan);
}
yylex(yyscanner);
- while (!yyextra->condStack.isEmpty())
+ while (!yyextra->condStack.empty())
{
- CondCtx *ctx = yyextra->condStack.pop();
- QCString sectionInfo = " ";
- if (ctx->sectionId!=" ") sectionInfo.sprintf(" with label '%s' ",ctx->sectionId.stripWhiteSpace().data());
- warn(yyextra->fileName,ctx->lineNr,"Conditional section%sdoes not have "
+ const CondCtx &ctx = yyextra->condStack.top();
+ 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());
+ yyextra->condStack.pop();
}
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.isEmpty())
+ while (!yyextra->commentStack.empty())
{
- CommentCtx *ctx = yyextra->commentStack.pop();
+ int lineNr = yyextra->commentStack.top();
if (!first) tmp += ", ";
- tmp += QCString().setNum(ctx->lineNr);
+ tmp += QCString().setNum(lineNr);
first = FALSE;
- delete ctx;
+ yyextra->commentStack.pop();
}
tmp += ")";
warn(yyextra->fileName,yyextra->lineNr,"Reached end of file while still inside a (nested) comment. "
"Nesting level %d %s",yyextra->nestingCount,tmp.data());
}
- yyextra->commentStack.clear();
yyextra->nestingCount = 0;
if (Debug::isFlagSet(Debug::CommentCnv))
{
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 767b964..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);
@@ -469,7 +470,8 @@ DETAILEDHTMLOPT {CODE}
BN [ \t\n\r]
BL [ \t\r]*"\n"
B [ \t]
-BS ^(({B}*"//")?)(({B}*"*"+)?){B}*
+Bopt {B}*
+BS ^(({B}*"/""/")?)(({B}*"*"+)?){B}*
ATTR ({B}+[^>\n]*)?
DOCNL "\n"|"\\ilinebr"
LC "\\"{B}*"\n"
@@ -488,6 +490,18 @@ TMPLSPEC "<"{BN}*[^>]+{BN}*">"
MAILADDR [a-z_A-Z0-9.+\-]+"@"[a-z_A-Z0-9\-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-]+
RCSTAG "$"{ID}":"[^\n$]+"$"
+ // C start comment
+CCS "/\*"
+ // C end comment
+CCE "*\/"
+ // Cpp comment
+CPPC "/\/"
+
+ // end of section title with asterisk
+STAopt [^\n@\\*]*
+ // end of section title without asterisk
+STopt [^\n@\\]*
+
%option noyywrap
/* comment parsing states. */
@@ -507,6 +521,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
%x EnumDocArg1
%x NameSpaceDocArg1
%x PackageDocArg1
+%x ConceptDocArg1
%x GroupDocArg1
%x GroupDocArg2
%x SectionLabel
@@ -541,7 +556,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
/* What can happen in while parsing a comment block:
* commands (e.g. @page, or \page)
* escaped commands (e.g. @@page or \\page).
- * formulas (e.g. \f$ \f[ \f{..)
+ * formulas (e.g. \f$...\f$ \f[...\f] \f{...\f})
* directories (e.g. \doxygen\src\)
* autolist end. (e.g. a dot on an otherwise empty line)
* newlines.
@@ -592,17 +607,15 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
addOutput(yyscanner,yytext);
}
<Comment>"</summary>" { // start of a .NET XML style detailed description
- setOutput(yyscanner,OutputBrief);
addOutput(yyscanner,yytext);
setOutput(yyscanner,OutputDoc);
}
<Comment>"</remarks>" { // end of a brief or detailed description
-
setOutput(yyscanner,OutputDoc);
addOutput(yyscanner,yytext);
}
<Comment>"<"{CAPTION}{ATTR}">" {
- QCString tag=yytext;
+ QCString tag(yytext);
int s=tag.find("id=");
if (s!=-1) // command has id attribute
{
@@ -657,19 +670,19 @@ RCSTAG "$"{ID}":"[^\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;
@@ -716,9 +729,9 @@ RCSTAG "$"{ID}":"[^\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);
}
@@ -726,7 +739,7 @@ RCSTAG "$"{ID}":"[^\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
@@ -770,7 +783,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
<Comment>[a-z_A-Z]+ { // normal word
addOutput(yyscanner,yytext);
}
-<Comment>^{B}*"."{B}*/\n { // explicit end autolist: e.g " ."
+<Comment>^{B}*"."{Bopt}/\n { // explicit end autolist: e.g " ."
addOutput(yyscanner,yytext);
}
<Comment>^{B}*[1-9][0-9]*"."{B}+ |
@@ -797,7 +810,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
}
addOutput(yyscanner,yytext);
}
-<Comment>^{B}*([\-:|]{B}*)*("--"|"---")({B}*[\-:|])*{B}*/\n { // horizontal line (dashed)
+<Comment>^{B}*([\-:|]{B}*)*("--"|"---")({B}*[\-:|])*{Bopt}/\n { // horizontal line (dashed)
addOutput(yyscanner,yytext);
}
<Comment>{CMD}"---" { // escaped mdash
@@ -972,7 +985,7 @@ RCSTAG "$"{ID}":"[^\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
@@ -1015,14 +1028,36 @@ RCSTAG "$"{ID}":"[^\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";
@@ -1031,7 +1066,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
BEGIN( ClassDocArg2 );
}
<CategoryDocArg1>{SCOPENAME}{B}*"("[^\)]+")" {
- yyextra->current->name = substitute(yytext,".","::");
+ yyextra->current->name = substitute(QCString(yytext),".","::");
BEGIN( ClassDocArg2 );
}
<ClassDocArg1,CategoryDocArg1>{LC} { // line continuation
@@ -1041,7 +1076,7 @@ RCSTAG "$"{ID}":"[^\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++;
@@ -1129,7 +1164,7 @@ RCSTAG "$"{ID}":"[^\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);
@@ -1172,7 +1207,7 @@ RCSTAG "$"{ID}":"[^\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;
@@ -1187,6 +1222,10 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
<ParamArg1>"," {
addOutput(yyscanner," , ");
}
+<ParamArg1>{DOCNL} {
+ if (*yytext=='\n') yyextra->lineNr++;
+ addOutput(yyscanner," ");
+ }
<ParamArg1>{ID} {
addOutput(yyscanner,yytext);
BEGIN( Comment );
@@ -1295,7 +1334,7 @@ RCSTAG "$"{ID}":"[^\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++;
@@ -1344,12 +1383,12 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
);
BEGIN(Comment);
}
-<SectionTitle>[^\n@\\*]*/"\n" { // end of section title
+<SectionTitle>{STAopt}/"\n" { // end of section title
addSection(yyscanner);
addOutput(yyscanner,yytext);
BEGIN( Comment );
}
-<SectionTitle>[^\n@\\]*/"\\ilinebr" { // end of section title
+<SectionTitle>{STopt}/"\\ilinebr" { // end of section title
addSection(yyscanner);
addOutput(yyscanner,yytext);
BEGIN( Comment );
@@ -1381,7 +1420,7 @@ RCSTAG "$"{ID}":"[^\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
@@ -1408,7 +1447,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
/* ----- handle arguments of the anchor command ------- */
<AnchorLabel>{LABELID} { // found argument
- addAnchor(yyscanner,yytext);
+ addAnchor(yyscanner,QCString(yytext));
addOutput(yyscanner,yytext);
BEGIN( Comment );
}
@@ -1451,11 +1490,11 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
if (*yytext=='\n') yyextra->lineNr++;
addOutput(yyscanner,'\n');
}
-<FormatBlock>"/*" { // start of a C-comment
+<FormatBlock>{CCS} { // start of a C-comment
if (!(yyextra->blockName=="code" || yyextra->blockName=="verbatim")) yyextra->commentCount++;
addOutput(yyscanner,yytext);
}
-<FormatBlock>"*/" { // end of a C-comment
+<FormatBlock>{CCE} { // end of a C-comment
addOutput(yyscanner,yytext);
if (!(yyextra->blockName=="code" || yyextra->blockName=="verbatim"))
{
@@ -1463,7 +1502,7 @@ RCSTAG "$"{ID}":"[^\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));
}
}
}
@@ -1475,7 +1514,7 @@ RCSTAG "$"{ID}":"[^\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();
}
@@ -1504,12 +1543,12 @@ RCSTAG "$"{ID}":"[^\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++;
@@ -1700,7 +1739,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
<InGroupParam>{LABELID} { // group id
yyextra->current->groups.push_back(
- Grouping(yytext, Grouping::GROUPING_INGROUP)
+ Grouping(QCString(yytext), Grouping::GROUPING_INGROUP)
);
yyextra->inGroupParamFound=TRUE;
}
@@ -1785,7 +1824,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
<InheritParam>({ID}("::"|"."))*{ID} { // found argument
yyextra->current->extends.push_back(
- BaseInfo(removeRedundantWhiteSpace(yytext),Public,Normal)
+ BaseInfo(removeRedundantWhiteSpace(QCString(yytext)),Public,Normal)
);
BEGIN( Comment );
}
@@ -1808,13 +1847,13 @@ RCSTAG "$"{ID}":"[^\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');
@@ -1827,9 +1866,9 @@ RCSTAG "$"{ID}":"[^\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);
}
@@ -1886,19 +1925,23 @@ RCSTAG "$"{ID}":"[^\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);
@@ -1908,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);
@@ -1917,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);
@@ -1925,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);
@@ -1933,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);
@@ -1942,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);
@@ -1951,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);
@@ -1960,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);
@@ -1968,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);
@@ -1976,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);
@@ -1985,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);
@@ -2001,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);
@@ -2010,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);
@@ -2019,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);
@@ -2028,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);
@@ -2037,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);
@@ -2046,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);
@@ -2054,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);
@@ -2067,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);
@@ -2079,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
@@ -2089,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 ");
@@ -2097,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);
@@ -2106,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;
@@ -2121,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);
@@ -2130,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)
@@ -2142,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);
@@ -2165,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;
@@ -2174,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;
@@ -2183,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;
@@ -2192,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;
@@ -2201,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;
@@ -2209,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)
@@ -2227,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)
@@ -2241,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())
@@ -2254,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())
@@ -2268,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())
@@ -2282,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 ");
@@ -2290,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);
@@ -2303,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 &&
@@ -2324,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+" ");
@@ -2332,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())
@@ -2345,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 ");
@@ -2371,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;
@@ -2381,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;
@@ -2391,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())
@@ -2408,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())
@@ -2424,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())
@@ -2446,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;
@@ -2454,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))
@@ -2554,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(':');
@@ -2627,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
@@ -2657,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()));
}
}
}
@@ -2671,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;
@@ -2686,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())
@@ -2704,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);
@@ -2717,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);
@@ -2768,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;
@@ -2821,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);
@@ -2835,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;
}
@@ -2846,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
{
@@ -2856,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;
@@ -2878,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
@@ -2907,7 +2957,7 @@ static QCString addFormula(yyscan_t yyscanner)
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
QCString formLabel;
QCString fText=yyextra->formulaText.simplifyWhiteSpace();
- int id = FormulaManager::instance().addFormula(fText);
+ int id = FormulaManager::instance().addFormula(fText.str());
formLabel.sprintf("\\_form#%d",id);
for (int i=0;i<yyextra->formulaNewLines;i++) formLabel+="@_fakenl"; // add fake newlines to
// keep the warnings
@@ -2933,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
@@ -2960,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);
}
//-----------------------------------------------------------------------------
@@ -2993,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
@@ -3029,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
@@ -3124,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;
@@ -3134,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);
}
}
@@ -3156,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)
{
@@ -3271,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";
@@ -3342,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;
}
@@ -3386,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 e25c94e..f3f4e5c 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[
@@ -558,12 +545,12 @@ Go to the <a href="commands.html">next</a> section or return to the
\endverbatim
For example adding
\verbatim
- "sideeffect=@par Side Effects:\n"
+ "sideeffect=@par Side Effects:^^"
\endverbatim
will allow you to
put the command \c \\sideeffect (or \c \@sideeffect) in the documentation, which
will result in a user-defined paragraph with heading "Side Effects:".
- You can put \ref cmdn "\\n"'s in the value part of an alias to insert newlines
+ Note that you cannot put \ref cmdn "\\n"'s in the value part of an alias to insert newlines
(in the resulting output).
You can put `^^` in the value part of an alias to insert a newline as if
a physical newline was in the original file.
@@ -647,7 +634,7 @@ Go to the <a href="commands.html">next</a> section or return to the
With this tag you can assign which parser to use for a given extension.
Doxygen has a built-in mapping, but you can override or extend it using this tag.
The format is <code>ext=language</code>, where \c ext is a file extension, and language is one of
- the parsers supported by doxygen: IDL, Java, JavaScript, Csharp (C#), C, C++, D, PHP,
+ the parsers supported by doxygen: IDL, Java, JavaScript, Csharp (C#), C, C++, Lex, D, PHP,
md (Markdown), Objective-C, Python, Slice, VHDL, Fortran (fixed format Fortran: FortranFixed,
free formatted Fortran: FortranFree, unknown formatted Fortran: Fortran. In
the later case the parser tries to guess whether the code is fixed or free
@@ -832,7 +819,7 @@ Go to the <a href="commands.html">next</a> section or return to the
to get more control over the balance between CPU load and processing speed.
At this moment only the input processing can be done using multiple threads.
Since this is still an experimental feature the default is set to 1,
- which efficively disables parallel processing. Please report any issues you
+ which effectively disables parallel processing. Please report any issues you
encounter.
Generating dot graphs in parallel is controlled by the \c DOT_NUM_THREADS setting.
]]>
@@ -1316,22 +1303,33 @@ FILE_VERSION_FILTER = "cleartool desc -fmt \%Vn"
<docs>
<![CDATA[
If the \c WARN_IF_DOC_ERROR tag is set to \c YES, doxygen will generate warnings for
- potential errors in the documentation, such as not documenting some
- parameters in a documented function, or documenting parameters that
+ potential errors in the documentation, such as documenting some
+ parameters in a documented function twice, or documenting parameters that
don't exist or using markup commands wrongly.
]]>
</docs>
</option>
+ <option type='bool' id='WARN_IF_INCOMPLETE_DOC' defval='1'>
+ <docs>
+<![CDATA[
+ If \c WARN_IF_INCOMPLETE_DOC is set to \c YES, doxygen will warn about
+ incomplete function parameter documentation.
+ If set to \c NO, doxygen will accept that some parameters have no
+ documentation without warning.
+]]>
+ </docs>
+ </option>
<option type='bool' id='WARN_NO_PARAMDOC' defval='0'>
<docs>
<![CDATA[
This \c WARN_NO_PARAMDOC option can be enabled to get warnings for
functions that are documented, but have no documentation for their parameters
or return value. If set to \c NO, doxygen will only warn about
- wrong or incomplete parameter documentation, but not about the absence of
+ wrong parameter documentation, but not about the absence of
documentation.
If \ref cfg_extract_all "EXTRACT_ALL" is set to \c YES then this flag will
automatically be disabled.
+ See also \ref cfg_warn_if_incomplete_doc "WARN_IF_INCOMPLETE_DOC"
]]>
</docs>
</option>
@@ -1434,6 +1432,7 @@ FILE_VERSION_FILTER = "cleartool desc -fmt \%Vn"
<value name='*.hxx'/>
<value name='*.hpp'/>
<value name='*.h++'/>
+ <value name='*.l'/>
<value name='*.cs'/>
<value name='*.d'/>
<value name='*.php'/>
@@ -1740,11 +1739,11 @@ to disable this feature.
]]>
</docs>
</option>
- <option type='bool' id='CLANG_ADD_INC_PATHS' setting='USE_LIBCLANG' defval='1'>
+ <option type='bool' id='CLANG_ADD_INC_PATHS' setting='USE_LIBCLANG' depends='CLANG_ASSISTED_PARSING' defval='1'>
<docs>
<![CDATA[
- If clang assisted parsing is enabled and the \c CLANG_ADD_INC_PATHS tag
- is set to \c YES then doxygen will add the directory of each input to the
+ If the \c CLANG_ASSISTED_PARSING tag is set to \c YES and the \c CLANG_ADD_INC_PATHS
+ tag is set to \c YES then doxygen will add the directory of each input to the
include path.
]]>
</docs>
@@ -2049,7 +2048,7 @@ hr.footer {
<![CDATA[
The \c HTML_COLORSTYLE_HUE tag controls the color of the HTML output.
Doxygen will adjust the colors in the style sheet and background images
- according to this color. Hue is specified as an angle on a colorwheel,
+ according to this color. Hue is specified as an angle on a color-wheel,
see https://en.wikipedia.org/wiki/Hue for more information.
For instance the value 0 represents red, 60 is yellow, 120 is green,
180 is cyan, 240 is blue, 300 purple, and 360 is red again.
@@ -2061,7 +2060,7 @@ hr.footer {
<![CDATA[
The \c HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of
the colors in the HTML output. For a value of 0 the output will use
- grayscales only. A value of 255 will produce the most vivid colors.
+ gray-scales only. A value of 255 will produce the most vivid colors.
]]>
</docs>
</option>
@@ -2182,10 +2181,12 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
If the \c GENERATE_HTMLHELP tag is set to \c YES then
doxygen generates three additional HTML index files:
\c index.hhp, \c index.hhc, and \c index.hhk. The \c index.hhp is a
- project file that can be read by
- <a href="https://www.microsoft.com/en-us/download/details.aspx?id=21138">
- Microsoft's HTML Help Workshop</a>
+ project file that can be read by Microsoft's HTML Help Workshop
on Windows.
+ In the beginning of 2021 Microsoft took the original page, with a.o. the download links,
+ offline the HTML help workshop was already many years in maintenance mode).
+ You can download the HTML help workshop from the web archives at
+ <a href="http://web.archive.org/web/20160201063255/http://download.microsoft.com/download/0/A/9/0A939EF6-E31C-430F-A3DF-DFAE7960D564/htmlhelp.exe">Installation executable</a>.
<br>
The HTML Help Workshop contains a compiler that can convert all HTML output
generated by doxygen into a single compiled HTML file (`.chm`). Compiled
@@ -2474,20 +2475,33 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
]]>
</docs>
</option>
+ <option type='enum' id='MATHJAX_VERSION' defval='MathJax_2' depends='USE_MATHJAX'>
+ <docs>
+<![CDATA[
+ With \c MATHJAX_VERSION it is possible to specify the MathJax version to be used.
+ Note that the different versions of MathJax have different requirements with regards to
+ the different settings, so it is possible that also other MathJax settings have to be changed
+ when switching between the different MathJax versions.
+]]>
+ </docs>
+ <value name="MathJax_2"/>
+ <value name="MathJax_3"/>
+ </option>
<option type='enum' id='MATHJAX_FORMAT' defval='HTML-CSS' depends='USE_MATHJAX'>
<docs>
<![CDATA[
When MathJax is enabled you can set the default output format to be used for
the MathJax output.
- See <a href="http://docs.mathjax.org/en/v2.7-latest/output.html">the MathJax site</a>
- for more details.
+ For more details about the output format see <a href="http://docs.mathjax.org/en/v2.7-latest/output.html">MathJax version 2</a>
+ and <a href="http://docs.mathjax.org/en/latest/web/components/output.html">MathJax version 3</a>.
]]>
</docs>
- <value name="HTML-CSS" desc="(which is slower, but has the best compatibility)"/>
- <value name="NativeMML" desc="(i.e. MathML)"/>
+ <value name="HTML-CSS" desc="(which is slower, but has the best compatibility. This is the name for Mathjax version 2, for MathJax version 3 this will be translated into \c chtml)"/>
+ <value name="NativeMML" desc="(i.e. MathML. Only supported for NathJax 2. For MathJax version 3 \c chtml will be used instead.)"/>
+ <value name="chtml" desc="(This is the name for Mathjax version 3, for MathJax version 2 this will be translated into \c HTML-CSS)"/>
<value name="SVG"/>
</option>
- <option type='string' id='MATHJAX_RELPATH' format='string' defval='https://cdn.jsdelivr.net/npm/mathjax@2' depends='USE_MATHJAX'>
+ <option type='string' id='MATHJAX_RELPATH' format='string' depends='USE_MATHJAX'>
<docs>
<![CDATA[
When MathJax is enabled you need to specify the location relative to the
@@ -2498,6 +2512,10 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
the MathJax Content Delivery Network so you can quickly see the result without
installing MathJax. However, it is strongly recommended to install a local
copy of MathJax from https://www.mathjax.org before deployment.
+
+ The default value is:
+ - in case of MathJax version 2: https://cdn.jsdelivr.net/npm/mathjax@2
+ - in case of MathJax version 3: https://cdn.jsdelivr.net/npm/mathjax@3
]]>
</docs>
</option>
@@ -2505,10 +2523,15 @@ The \c DOCSET_PUBLISHER_NAME tag identifies the documentation publisher.
<docs>
<![CDATA[
The \c MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax extension
- names that should be enabled during MathJax rendering. For example
+ names that should be enabled during MathJax rendering. For example for MathJax version 2
+ (see https://docs.mathjax.org/en/v2.7-latest/tex.html#tex-and-latex-extensions):
\verbatim
MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols
\endverbatim
+For example for MathJax version 3 (see http://docs.mathjax.org/en/latest/input/tex/extensions/index.html):
+\verbatim
+MATHJAX_EXTENSIONS = ams
+\endverbatim
]]>
</docs>
</option>
@@ -3235,6 +3258,9 @@ front of it.
<![CDATA[
If the \c GENERATE_SQLITE3 tag is set to \c YES doxygen will generate a
\c Sqlite3 database with symbols found by doxygen stored in tables.
+
+ @note The availability of this option depends on whether or not doxygen
+ was generated with the `-Duse_sqlite3=ON` option for CMake.
]]>
</docs>
</option>
@@ -3244,6 +3270,9 @@ If the \c GENERATE_SQLITE3 tag is set to \c YES doxygen will generate a
The \c SQLITE3_OUTPUT tag is used to specify where the \c Sqlite3 database will be put.
If a relative path is entered the value of \ref cfg_output_directory "OUTPUT_DIRECTORY" will be
put in front of it.
+
+ @note The availability of this option depends on whether or not doxygen
+ was generated with the `-Duse_sqlite3=ON` option for CMake.
]]>
</docs>
</option>
@@ -3253,6 +3282,9 @@ put in front of it.
The \c SQLITE3_OVERWRITE_DB tag is set to \c YES, the existing doxygen_sqlite3.db
database file will be recreated with each doxygen run.
If set to \c NO, doxygen will warn if an a database file is already found and not modify it.
+
+ @note The availability of this option depends on whether or not doxygen
+ was generated with the `-Duse_sqlite3=ON` option for CMake.
]]>
</docs>
</option>
@@ -3883,5 +3915,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 063c1f4..d3b9137 100755
--- a/src/configgen.py
+++ b/src/configgen.py
@@ -683,9 +683,7 @@ def main():
print("#ifndef CONFIGVALUES_H")
print("#define CONFIGVALUES_H")
print("")
- print("#include <qdict.h>")
- print("#include <qstrlist.h>")
- print("#include <qcstring.h>")
+ print("#include \"qcstring.h\"")
print("#include \"containers.h\"")
print("#include \"settings.h\"")
print("")
@@ -722,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:
@@ -740,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(" {");
@@ -749,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 a267cc6..d90fe8c 100644
--- a/src/configimpl.h
+++ b/src/configimpl.h
@@ -19,13 +19,16 @@
#ifndef CONFIGIMPL_H
#define CONFIGIMPL_H
-#include <qstrlist.h>
-#include <qdict.h>
-#include <qlist.h>
-#include <qregexp.h>
-#include "ftextstream.h"
+#include <vector>
+#include <unordered_map>
+#include <string>
+#include <memory>
+#include <iostream>
+
#include "containers.h"
+#include "qcstring.h"
+class TextStream;
/** Abstract base class for any configuration option.
*/
@@ -73,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;
@@ -105,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() {}
};
@@ -128,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:
@@ -151,20 +154,17 @@ class ConfigEnum : public ConfigOption
m_value = defVal;
m_defValue = defVal;
}
- void addValue(const char *v) { m_valueRange.append(v); }
- QStrListIterator iterator()
- {
- return QStrListIterator(m_valueRange);
- }
+ void addValue(const char *v) { m_valueRange.push_back(v); }
+ 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:
- QStrList m_valueRange;
+ std::vector<QCString> m_valueRange;
QCString m_value;
QCString m_defValue;
};
@@ -189,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:
@@ -222,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;
@@ -251,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;
@@ -267,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() {}
};
@@ -279,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() {}
};
@@ -292,6 +292,9 @@ class ConfigDisabled : public ConfigOption
#define ConfigImpl_getBool(val) ConfigImpl::instance()->getBool(__FILE__,__LINE__,val)
+using ConfigOptionList = std::vector< std::unique_ptr<ConfigOption> >;
+using ConfigOptionMap = std::unordered_map< std::string, ConfigOption* >;
+
/** Singleton for configuration variables.
*
* This object holds the global static variables
@@ -323,14 +326,6 @@ class ConfigImpl
m_instance=0;
}
- /*! Returns an iterator that can by used to iterate over the
- * configuration options.
- */
- QListIterator<ConfigOption> iterator()
- {
- return QListIterator<ConfigOption>(*m_options);
- }
-
/*!
* @name Getting configuration values.
* @{
@@ -369,9 +364,10 @@ 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
{
- return m_dict->find(name);
+ auto it = m_dict.find(name.str());
+ return it!=m_dict.end() ? it->second : nullptr;
}
/* @} */
@@ -386,7 +382,7 @@ class ConfigImpl
ConfigInfo *addInfo(const char *name,const char *doc)
{
ConfigInfo *result = new ConfigInfo(name,doc);
- m_options->append(result);
+ m_options.push_back(std::unique_ptr<ConfigOption>(result));
return result;
}
@@ -397,8 +393,8 @@ class ConfigImpl
const char *doc)
{
ConfigString *result = new ConfigString(name,doc);
- m_options->append(result);
- m_dict->insert(name,result);
+ m_options.push_back(std::unique_ptr<ConfigOption>(result));
+ m_dict.insert(std::make_pair(name,result));
return result;
}
@@ -411,8 +407,8 @@ class ConfigImpl
const char *defVal)
{
ConfigEnum *result = new ConfigEnum(name,doc,defVal);
- m_options->append(result);
- m_dict->insert(name,result);
+ m_options.push_back(std::unique_ptr<ConfigOption>(result));
+ m_dict.insert(std::make_pair(name,result));
return result;
}
@@ -423,8 +419,8 @@ class ConfigImpl
const char *doc)
{
ConfigList *result = new ConfigList(name,doc);
- m_options->append(result);
- m_dict->insert(name,result);
+ m_options.push_back(std::unique_ptr<ConfigOption>(result));
+ m_dict.insert(std::make_pair(name,result));
return result;
}
@@ -438,8 +434,8 @@ class ConfigImpl
int minVal,int maxVal,int defVal)
{
ConfigInt *result = new ConfigInt(name,doc,minVal,maxVal,defVal);
- m_options->append(result);
- m_dict->insert(name,result);
+ m_options.push_back(std::unique_ptr<ConfigOption>(result));
+ m_dict.insert(std::make_pair(name,result));
return result;
}
@@ -452,25 +448,25 @@ class ConfigImpl
bool defVal)
{
ConfigBool *result = new ConfigBool(name,doc,defVal);
- m_options->append(result);
- m_dict->insert(name,result);
+ m_options.push_back(std::unique_ptr<ConfigOption>(result));
+ m_dict.insert(std::make_pair(name,result));
return result;
}
/*! Adds an option that has become obsolete. */
ConfigOption *addObsolete(const char *name)
{
- ConfigObsolete *option = new ConfigObsolete(name);
- m_dict->insert(name,option);
- m_obsolete->append(option);
- return option;
+ ConfigObsolete *result = new ConfigObsolete(name);
+ m_obsolete.push_back(std::unique_ptr<ConfigOption>(result));
+ m_dict.insert(std::make_pair(name,result));
+ return result;
}
/*! Adds an option that has been disabled at compile time. */
ConfigOption *addDisabled(const char *name)
{
- ConfigDisabled *option = new ConfigDisabled(name);
- m_dict->insert(name,option);
- m_disabled->append(option);
- return option;
+ ConfigDisabled *result = new ConfigDisabled(name);
+ m_disabled.push_back(std::unique_ptr<ConfigOption>(result));
+ m_dict.insert(std::make_pair(name,result));
+ return result;
}
/*! @} */
@@ -478,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; }
@@ -512,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
@@ -545,7 +540,7 @@ class ConfigImpl
{
QCString result=m_startComment;
m_startComment.resize(0);
- return result.replace(QRegExp("\r"),"");
+ return substitute(result,"\r","");
}
/*! Take the user comment and reset it internally
* \returns user comment
@@ -554,36 +549,25 @@ class ConfigImpl
{
QCString result=m_userComment;
m_userComment.resize(0);
- return result.replace(QRegExp("\r"),"");
+ return substitute(result,"\r","");
}
protected:
ConfigImpl()
{
- m_options = new QList<ConfigOption>;
- m_obsolete = new QList<ConfigOption>;
- m_disabled = new QList<ConfigOption>;
- m_dict = new QDict<ConfigOption>(257);
- m_options->setAutoDelete(TRUE);
- m_obsolete->setAutoDelete(TRUE);
- m_disabled->setAutoDelete(TRUE);
m_initialized = FALSE;
create();
}
~ConfigImpl()
{
- delete m_options;
- delete m_obsolete;
- delete m_disabled;
- delete m_dict;
}
private:
- QList<ConfigOption> *m_options;
- QList<ConfigOption> *m_obsolete;
- QList<ConfigOption> *m_disabled;
- QDict<ConfigOption> *m_dict;
+ ConfigOptionList m_options;
+ ConfigOptionList m_obsolete;
+ ConfigOptionList m_disabled;
+ ConfigOptionMap m_dict;
static ConfigImpl *m_instance;
QCString m_startComment;
QCString m_userComment;
diff --git a/src/configimpl.l b/src/configimpl.l
index 7f73ec0..cf5386e 100644
--- a/src/configimpl.l
+++ b/src/configimpl.l
@@ -26,24 +26,21 @@
#include <ctype.h>
#include <stdarg.h>
#include <errno.h>
-
-#include <qfileinfo.h>
-#include <qdir.h>
-#include <qregexp.h>
-#include <qstack.h>
-#include <qglobal.h>
-
#include <thread>
#include <algorithm>
+#include <fstream>
+#include <iostream>
+#include "regex.h"
#include "configimpl.h"
#include "version.h"
#include "portable.h"
-#include "util.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
@@ -61,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);
@@ -78,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
@@ -94,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())
{
@@ -131,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)
{
@@ -173,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 << " ";
@@ -201,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
{
@@ -226,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");
}
}
}
@@ -239,112 +237,110 @@ void ConfigEnum::convertStrToVal()
return;
}
QCString val = m_value.stripWhiteSpace().lower();
- const char *s=m_valueRange.first();
- while (s)
+ for (const auto &s : m_valueRange)
{
- if (QCString(s).lower() == val)
+ if (s.lower() == val)
{
m_value = s;
return;
}
- s = m_valueRange.next();
}
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;
}
QCString &ConfigImpl::getString(const char *fileName,int num,const char *name) const
{
- ConfigOption *opt = m_dict->find(name);
- if (opt==0)
+ auto it = m_dict.find(name);
+ if (it==m_dict.end())
{
config_term("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
}
- else if (opt->kind()!=ConfigOption::O_String)
+ else if (it->second->kind()!=ConfigOption::O_String)
{
config_term("%s<%d>: Internal error: Requested option %s not of string type!\n",fileName,num,name);
}
- return *((ConfigString *)opt)->valueRef();
+ return *((ConfigString *)it->second)->valueRef();
}
StringVector &ConfigImpl::getList(const char *fileName,int num,const char *name) const
{
- ConfigOption *opt = m_dict->find(name);
- if (opt==0)
+ auto it = m_dict.find(name);
+ if (it==m_dict.end())
{
config_term("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
}
- else if (opt->kind()!=ConfigOption::O_List)
+ else if (it->second->kind()!=ConfigOption::O_List)
{
config_term("%s<%d>: Internal error: Requested option %s not of list type!\n",fileName,num,name);
}
- return *((ConfigList *)opt)->valueRef();
+ return *((ConfigList *)it->second)->valueRef();
}
QCString &ConfigImpl::getEnum(const char *fileName,int num,const char *name) const
{
- ConfigOption *opt = m_dict->find(name);
- if (opt==0)
+ auto it = m_dict.find(name);
+ if (it==m_dict.end())
{
config_term("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
}
- else if (opt->kind()!=ConfigOption::O_Enum)
+ else if (it->second->kind()!=ConfigOption::O_Enum)
{
config_term("%s<%d>: Internal error: Requested option %s not of enum type!\n",fileName,num,name);
}
- return *((ConfigEnum *)opt)->valueRef();
+ return *((ConfigEnum *)it->second)->valueRef();
}
int &ConfigImpl::getInt(const char *fileName,int num,const char *name) const
{
- ConfigOption *opt = m_dict->find(name);
- if (opt==0)
+ auto it = m_dict.find(name);
+ if (it==m_dict.end())
{
config_term("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
}
- else if (opt->kind()!=ConfigOption::O_Int)
+ else if (it->second->kind()!=ConfigOption::O_Int)
{
config_term("%s<%d>: Internal error: Requested option %s not of integer type!\n",fileName,num,name);
}
- return *((ConfigInt *)opt)->valueRef();
+ return *((ConfigInt *)it->second)->valueRef();
}
bool &ConfigImpl::getBool(const char *fileName,int num,const char *name) const
{
- ConfigOption *opt = m_dict->find(name);
- if (opt==0)
+ auto it = m_dict.find(name);
+ if (it==m_dict.end())
{
config_term("%s<%d>: Internal error: Requested unknown option %s!\n",fileName,num,name);
}
- else if (opt->kind()!=ConfigOption::O_Bool)
+ else if (it->second->kind()!=ConfigOption::O_Bool)
{
config_term("%s<%d>: Internal error: Requested option %s not of boolean type!\n",fileName,num,name);
}
- return *((ConfigBool *)opt)->valueRef();
+ return *((ConfigBool *)it->second)->valueRef();
}
/* ------------------------------------------ */
-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())
{
@@ -355,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);
@@ -388,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())
{
@@ -405,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())
{
@@ -427,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())
{
@@ -456,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);
@@ -485,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) {}
/* -----------------------------------------------------------------
*
@@ -516,8 +513,7 @@ static QCString *g_string=0;
static StringVector *g_list=0;
static QCString g_listStr;
static StringVector g_includePathList;
-static QStack<ConfigFileState> g_includeStack;
-static int g_includeDepth;
+static std::vector< std::unique_ptr<ConfigFileState> > g_includeStack;
static bool g_configUpdate = FALSE;
static QCString g_encoding;
static ConfigImpl *g_config;
@@ -530,7 +526,7 @@ static ConfigImpl *g_config;
static yy_size_t yyread(char *buf,yy_size_t max_size)
{
// no file included
- if (g_includeStack.isEmpty())
+ if (g_includeStack.empty())
{
yy_size_t c=0;
if (g_inputString==0) return c;
@@ -544,43 +540,41 @@ static yy_size_t yyread(char *buf,yy_size_t max_size)
else
{
//assert(g_includeStack.current()->newState==YY_CURRENT_BUFFER);
- return (yy_size_t)fread(buf,1,max_size,g_includeStack.current()->filePtr);
+ return (yy_size_t)fread(buf,1,max_size,g_includeStack.back()->filePtr);
}
}
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;
QCString output(outputSize);
- void *cd = portable_iconv_open(outputEncoding,inputEncoding);
+ void *cd = portable_iconv_open(outputEncoding.data(),inputEncoding.data());
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;
- char *inputPtr = str.rawData();
+ const char *inputPtr = str.data();
char *outputPtr = output.rawData();
if (!portable_iconv(cd, &inputPtr, &iLeft, &outputPtr, &oLeft))
{
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;
@@ -661,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;
}
@@ -677,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;
@@ -695,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="";
}
@@ -747,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;
@@ -765,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;
@@ -785,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)
@@ -805,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_includeDepth==MAX_INCLUDE_DEPTH) {
+ 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;
@@ -827,8 +821,8 @@ static void readIncludeFile(const char *incName)
{
// For debugging
#if SHOW_INCLUDES
- for (i=0;i<g_includeStack.count();i++) msg(" ");
- msg("@INCLUDE = %s: parsing...\n",inc.data());
+ for (size_t i=0;i<g_includeStack.size();i++) msg(" ");
+ msg("@INCLUDE = %s: parsing...\n",qPrint(inc));
#endif
// store the state of the old file
@@ -838,16 +832,15 @@ static void readIncludeFile(const char *incName)
fs->fileName=g_yyFileName;
fs->filePtr=f;
// push the state on the stack
- g_includeStack.push(fs);
+ g_includeStack.push_back(std::unique_ptr<ConfigFileState>(fs));
// set the scanner to the include file
yy_switch_to_buffer(yy_create_buffer(f, YY_BUF_SIZE));
fs->newState=YY_CURRENT_BUFFER;
g_yyFileName=inc;
- g_includeDepth++;
}
else
{
- config_term("@INCLUDE = %s: not found!\n",inc.data());
+ config_term("@INCLUDE = %s: not found!\n",qPrint(inc));
}
}
@@ -885,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
@@ -928,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;
@@ -942,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;
@@ -961,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
@@ -983,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;
}
@@ -1014,26 +1007,25 @@ static void readIncludeFile(const char *incName)
<<EOF>> {
//printf("End of include file\n");
//printf("Include stack depth=%d\n",g_includeStack.count());
- if (g_includeStack.isEmpty())
+ if (g_includeStack.empty())
{
//printf("Terminating scanner!\n");
yyterminate();
}
else
{
- ConfigFileState *fs=g_includeStack.pop();
+ auto &fs=g_includeStack.back();
fclose(fs->filePtr);
YY_BUFFER_STATE oldBuf = YY_CURRENT_BUFFER;
yy_switch_to_buffer( fs->oldState );
yy_delete_buffer( oldBuf );
g_yyLineNr=fs->lineNr;
g_yyFileName=fs->fileName;
- delete fs; fs=0;
- g_includeDepth--;
+ g_includeStack.pop_back();
}
}
-<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();
@@ -1083,46 +1075,42 @@ 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,"");
}
- QListIterator<ConfigOption> it = iterator();
- ConfigOption *option;
- for (;(option=it.current());++it)
+ for (const auto &option : m_options)
{
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;
- QListIterator<ConfigOption> it = iterator();
- ConfigOption *option;
- for (;(option=it.current());++it)
+ t << "\n";
+ for (const auto &option : m_options)
{
option->m_userComment = "";
option->compareDoxyfile(t);
@@ -1131,42 +1119,48 @@ void ConfigImpl::compareDoxyfile(FTextStream &t)
void ConfigImpl::convertStrToVal()
{
- QListIterator<ConfigOption> it = iterator();
- ConfigOption *option;
- for (;(option=it.current());++it)
+ for (const auto &option : m_options)
{
option->convertStrToVal();
}
}
void ConfigImpl::emptyValueToDefault()
{
- QListIterator<ConfigOption> it = iterator();
- ConfigOption *option;
- for (;(option=it.current());++it)
+ for (const auto &option : m_options)
{
option->emptyValueToDefault();
}
}
-static void substEnvVarsInString(QCString &s)
+static void substEnvVarsInString(QCString &str)
{
- static QRegExp re("\\$\\([a-z_A-Z0-9.-]+\\)");
- static QRegExp re2("\\$\\([a-z_A-Z0-9.-]+\\([a-z_A-Z0-9.-]+\\)\\)"); // For e.g. PROGRAMFILES(X86)
- if (s.isEmpty()) return;
- int p=0;
- int i,l;
- //printf("substEnvVarInString(%s) start\n",s.data());
- while ((i=re.match(s,p,&l))!=-1 || (i=re2.match(s,p,&l))!=-1)
+ if (str.isEmpty()) return;
+ auto replace = [](const std::string &s, const reg::Ex &re) -> std::string
{
- //printf("Found environment var s.mid(%d,%d)='%s'\n",i+2,l-3,s.mid(i+2,l-3).data());
- QCString env=Portable::getenv(s.mid(i+2,l-3));
- substEnvVarsInString(env); // recursively expand variables if needed.
- s = s.left(i)+env+s.right(s.length()-i-l);
- p=i+env.length(); // next time start at the end of the expanded string
- }
- s=s.stripWhiteSpace(); // to strip the bogus space that was added when an argument
- // has quotes
- //printf("substEnvVarInString(%s) end\n",s.data());
+ reg::Iterator it(s,re);
+ reg::Iterator end;
+ std::string result;
+ size_t p = 0;
+ for (; it!=end ; ++it)
+ {
+ const auto &match = *it;
+ size_t i = match.position();
+ size_t l = match.length();
+ result+=s.substr(p,i-p);
+ std::string matchContents = match[1].str();
+ QCString env=Portable::getenv(matchContents.c_str()); // get content of $(..) match
+ substEnvVarsInString(env); // recursively expand variables if needed.
+ result+=env.str();
+ p=i+l;
+ }
+ result+=s.substr(p);
+ return result;
+ };
+
+ // match e.g. re1=$(HOME) but also re2=$(PROGRAMFILES(X86))
+ static const reg::Ex re1(R"(\$\((\a[\w.-]*)\))");
+ static const reg::Ex re2(R"(\$\((\a[\w.-]*\(\a[\w.-]*\))\))");
+ str = QCString(replace(replace(str.str(),re1),re2)).stripWhiteSpace();
}
static void substEnvVarsInStrList(StringVector &sl)
@@ -1175,12 +1169,11 @@ static void substEnvVarsInStrList(StringVector &sl)
for (const auto &s : sl)
{
QCString result = s.c_str();
- // an argument with quotes will have an extra space at the end, so wasQuoted will be TRUE.
- bool wasQuoted = (result.find(' ')!=-1) || (result.find('\t')!=-1);
+ bool wasQuoted = (result.find(' ')!=-1) || (result.find('\t')!=-1) || (result.find('"')!=-1);
// 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
@@ -1210,7 +1203,7 @@ static void substEnvVarsInStrList(StringVector &sl)
c=result.at(i);
if (c=='"') // end quote
{
- results.push_back(result.mid(p,i-p).data());
+ results.push_back(result.mid(p,i-p).str());
p=i+1;
break;
}
@@ -1222,19 +1215,19 @@ static void substEnvVarsInStrList(StringVector &sl)
}
else if (c==' ' || c=='\t') // separator
{
- if (i>p) results.push_back(result.mid(p,i-p).data());
+ if (i>p) results.push_back(result.mid(p,i-p).str());
p=i+1;
}
}
}
if (p!=l) // add the leftover as a string
{
- results.push_back(result.right(l-p).data());
+ results.push_back(result.right(l-p).str());
}
}
else // just goto the next element in the list
{
- if (!result.isEmpty()) results.push_back(result.data());
+ if (!result.isEmpty()) results.push_back(result.str());
}
}
sl = results;
@@ -1269,9 +1262,7 @@ void ConfigEnum::substEnvVars()
void ConfigImpl::substituteEnvironmentVars()
{
- QListIterator<ConfigOption> it = iterator();
- ConfigOption *option;
- for (;(option=it.current());++it)
+ for (const auto &option : m_options)
{
option->substEnvVars();
}
@@ -1279,15 +1270,13 @@ void ConfigImpl::substituteEnvironmentVars()
void ConfigImpl::init()
{
- QListIterator<ConfigOption> it = iterator();
- ConfigOption *option;
- for (;(option=it.current());++it)
+ for (const auto &option : m_options)
{
option->init();
}
// sanity check if all depends relations are valid
- for (it.toFirst();(option=it.current());++it)
+ for (const auto &option : m_options)
{
QCString depName = option->dependsOn();
if (!depName.isEmpty())
@@ -1296,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));
}
}
}
@@ -1309,74 +1298,45 @@ 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;
- }
- }
- if (!fileOpened)
- {
- config_term("cannot open file '%s' for reading\n",name);
+ return stream2string(f);
}
- 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;
- g_includeStack.setAutoDelete(TRUE);
g_includeStack.clear();
- g_includeDepth = 0;
configimplYYrestart( configimplYYin );
BEGIN( Start );
g_configUpdate = update;
@@ -1386,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;
}
@@ -1406,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().data();
+ path = fi.absFilePath();
if (path[path.size()-1]!='/') path+='/';
}
}
@@ -1423,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;
@@ -1445,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));
}
}
}
@@ -1542,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().data());
+ std::string p = Dir::currentDirPath()+"/";
+ stripFromPath.push_back(p);
}
else
{
@@ -1564,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));
}
}
@@ -1577,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));
}
}
@@ -1589,18 +1547,47 @@ void Config::checkAndCorrect()
// Test to see if MathJax code file is valid
if (Config_getBool(USE_MATHJAX))
{
+ QCString mathJaxFormat = Config_getEnum(MATHJAX_FORMAT);
+ QCString mathjaxVersion = Config_getEnum(MATHJAX_VERSION);
+ if (!mathJaxFormat.isEmpty())
+ {
+ if (mathjaxVersion == "MathJax_2")
+ {
+ if (mathJaxFormat=="chtml") Config_updateEnum(MATHJAX_FORMAT,"HTML-CSS");
+ }
+ else
+ {
+ if (mathJaxFormat=="HTML-CSS" || mathJaxFormat=="NativeMML")
+ {
+ Config_updateEnum(MATHJAX_FORMAT,"chtml");
+ }
+ }
+ }
+
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);
- if (!path.isEmpty() && path.at(path.length()-1)!='/')
+ if (path.isEmpty())
+ {
+ if (mathjaxVersion == "MathJax_2")
+ {
+ path = "https://cdn.jsdelivr.net/npm/mathjax@2";
+ }
+ else
+ {
+ path = "https://cdn.jsdelivr.net/npm/mathjax@3";
+ }
+ }
+
+ if (path.at(path.length()-1)!='/')
{
path+="/";
}
@@ -1612,11 +1599,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));
}
}
@@ -1625,11 +1612,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));
}
}
@@ -1638,7 +1625,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());
}
@@ -1656,7 +1643,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));
}
}
}
@@ -1664,16 +1651,15 @@ void Config::checkAndCorrect()
//------------------------
// check ALIASES
const StringVector &aliasList = Config_getList(ALIASES);
- for (const auto &s : aliasList)
+ for (const auto &alias : aliasList)
{
- QRegExp re1("[a-z_A-Z][a-z_A-Z0-9]*[ \t]*="); // alias without argument
- QRegExp re2("[a-z_A-Z][a-z_A-Z0-9]*{[0-9]+}[ \t]*="); // alias with argument
- QCString alias=s.c_str();
- alias=alias.stripWhiteSpace();
- if (alias.find(re1)!=0 && alias.find(re2)!=0)
+ // 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*=)");
+ 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",
- alias.data());
+ alias.c_str());
}
}
@@ -1779,7 +1765,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);
@@ -1788,22 +1774,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
@@ -1822,29 +1809,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="";
}
}
@@ -1855,15 +1843,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)='\\';
@@ -1882,13 +1871,13 @@ void Config::checkAndCorrect()
if (inputSources.empty())
{
// use current dir as the default
- inputSources.push_back(QDir::currentDirPath().utf8().data());
+ 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());
@@ -2014,15 +2003,6 @@ void Config::checkAndCorrect()
Config_updateInt(HTML_COLORSTYLE_GAMMA,gamma);
//------------------------
- QCString mathJaxFormat = Config_getEnum(MATHJAX_FORMAT);
- if (!mathJaxFormat.isEmpty() && mathJaxFormat!="HTML-CSS" &&
- mathJaxFormat!="NativeMML" && mathJaxFormat!="SVG")
- {
- err("Unsupported value for MATHJAX_FORMAT: Should be one of HTML-CSS, NativeMML, or SVG\n");
- Config_updateEnum(MATHJAX_FORMAT,"HTML-CSS");
- }
-
- //------------------------
// add default words if needed
const StringVector &annotationFromBrief = Config_getList(ABBREVIATE_BRIEF);
if (annotationFromBrief.empty())
@@ -2080,9 +2060,7 @@ void Config::checkAndCorrect()
#if 0 // TODO: this breaks test 25; SOURCEBROWSER = NO and SOURCE_TOOLTIPS = YES.
// So this and other regressions should be analysed and fixed before this can be enabled
// disable any boolean options that depend on disabled options
- QListIterator<ConfigOption> it = iterator();
- ConfigOption *option;
- for (it.toFirst();(option=it.current());++it)
+ for (const auto &option : m_options)
{
QCString depName = option->dependsOn(); // option has a dependency
if (!depName.isEmpty())
@@ -2093,7 +2071,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
}
}
@@ -2104,20 +2082,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.h b/src/constexp.h
index 0b52e14..212387b 100644
--- a/src/constexp.h
+++ b/src/constexp.h
@@ -1,13 +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,14 +16,14 @@
#ifndef _CONSTEXP_H
#define _CONSTEXP_H
-#include <qcstring.h>
+#include <string>
class ConstExpressionParser
{
public:
ConstExpressionParser();
~ConstExpressionParser();
- bool parse(const char *fileName,int line,const QCString &expression);
+ bool parse(const char *fileName,int line,const std::string &expression);
private:
struct Private;
Private *p;
diff --git a/src/constexp.l b/src/constexp.l
index 0f053bd..889626c 100644
--- a/src/constexp.l
+++ b/src/constexp.l
@@ -90,6 +90,9 @@ CONSTSUFFIX ([uU][lL]?[lL]?)|([lL][lL]?[uU]?)
(0x|0X)[0-9a-fA-F]+{CONSTSUFFIX}? { yyextra->strToken=yytext+2;
return TOK_HEXADECIMALINT;
}
+(0b|0B)[01]+{CONSTSUFFIX}? { yyextra->strToken=yytext+2;
+ return TOK_BINARYINT;
+ }
(([0-9]+\.[0-9]*)|([0-9]*\.[0-9]+))([eE]([\-\+])?[0-9]+)?([fFlL])? {
yyextra->strToken=yytext; return TOK_FLOAT;
}
@@ -132,7 +135,7 @@ ConstExpressionParser::~ConstExpressionParser()
delete p;
}
-bool ConstExpressionParser::parse(const char *fileName,int lineNr,const QCString &s)
+bool ConstExpressionParser::parse(const char *fileName,int lineNr,const std::string &s)
{
struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
@@ -146,13 +149,13 @@ bool ConstExpressionParser::parse(const char *fileName,int lineNr,const QCString
yyextra->inputPosition = 0;
constexpYYrestart( yyin, p->yyscanner );
- printlex(yy_flex_debug, TRUE, __FILE__, fileName);
- //printf("Expression: '%s'\n",s.data());
+ printlex(yy_flex_debug, true, __FILE__, fileName);
+ //printf("Expression: '%s'\n",qPrint(s));
constexpYYparse(p->yyscanner);
//printf("Result: %ld\n",(long)g_resultValue);
- printlex(yy_flex_debug, FALSE, __FILE__, fileName);
+ printlex(yy_flex_debug, false, __FILE__, fileName);
bool result = (long)yyextra->resultValue!=0;
return result;
diff --git a/src/constexp.y b/src/constexp.y
index c4110f9..4ebbc79 100644
--- a/src/constexp.y
+++ b/src/constexp.y
@@ -1,13 +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.
*
@@ -28,8 +25,8 @@
int constexpYYerror(yyscan_t yyscanner, const char *s)
{
struct constexpYY_state* yyextra = constexpYYget_extra(yyscanner);
- warn(yyextra->constExpFileName, yyextra->constExpLineNr,
- "preprocessing issue while doing constant expression evaluation: %s: input='%s'",s,yyextra->inputString);
+ warn(yyextra->constExpFileName.c_str(), yyextra->constExpLineNr,
+ "preprocessing issue while doing constant expression evaluation: %s: input='%s'",s,yyextra->inputString.c_str());
return 0;
}
@@ -67,6 +64,7 @@ int constexpYYerror(yyscan_t yyscanner, const char *s)
%token TOK_OCTALINT
%token TOK_DECIMALINT
%token TOK_HEXADECIMALINT
+%token TOK_BINARYINT
%token TOK_CHARACTER
%token TOK_FLOAT
@@ -81,8 +79,8 @@ start: constant_expression
constant_expression: logical_or_expression
{ $$ = $1; }
- | logical_or_expression
- TOK_QUESTIONMARK logical_or_expression
+ | logical_or_expression
+ TOK_QUESTIONMARK logical_or_expression
TOK_COLON logical_or_expression
{
bool c = ($1.isInt() ? ((long)$1 != 0) : ((double)$1 != 0.0));
@@ -108,9 +106,9 @@ logical_and_expression: inclusive_or_expression
inclusive_or_expression: exclusive_or_expression
{ $$ = $1; }
- | inclusive_or_expression TOK_BITWISEOR
+ | inclusive_or_expression TOK_BITWISEOR
exclusive_or_expression
- {
+ {
$$ = CPPValue( (long)$1 | (long)$3 );
}
;
@@ -126,7 +124,7 @@ exclusive_or_expression: and_expression
and_expression: equality_expression
{ $$ = $1; }
| and_expression TOK_AMPERSAND equality_expression
- {
+ {
$$ = CPPValue( (long)$1 & (long)$3 );
}
;
@@ -134,7 +132,7 @@ and_expression: equality_expression
equality_expression: relational_expression
{ $$ = $1; }
| equality_expression TOK_EQUAL relational_expression
- {
+ {
$$ = CPPValue( (long)((double)$1 == (double)$3) );
}
| equality_expression TOK_NOTEQUAL relational_expression
@@ -146,7 +144,7 @@ equality_expression: relational_expression
relational_expression: shift_expression
{ $$ = $1; }
| relational_expression TOK_LESSTHAN shift_expression
- {
+ {
$$ = CPPValue( (long)((double)$1 < (double)$3) );
}
| relational_expression TOK_GREATERTHAN shift_expression
@@ -169,7 +167,7 @@ shift_expression: additive_expression
{ $$ = $1; }
| shift_expression TOK_SHIFTLEFT additive_expression
{
- $$ = CPPValue( (long)$1 << (long)$3 );
+ $$ = CPPValue( (long)$1 << (long)$3 );
}
| shift_expression TOK_SHIFTRIGHT additive_expression
{
@@ -185,7 +183,7 @@ additive_expression: multiplicative_expression
{
$$ = CPPValue( (double)$1 + (double)$3 );
}
- else
+ else
{
$$ = CPPValue( (long)$1 + (long)$3 );
}
@@ -196,7 +194,7 @@ additive_expression: multiplicative_expression
{
$$ = CPPValue( (double)$1 - (double)$3 );
}
- else
+ else
{
$$ = CPPValue( (long)$1 - (long)$3 );
}
@@ -206,7 +204,7 @@ additive_expression: multiplicative_expression
multiplicative_expression: unary_expression
{ $$ = $1; }
| multiplicative_expression TOK_STAR unary_expression
- {
+ {
if (!$1.isInt() || !$3.isInt())
{
$$ = CPPValue( (double)$1 * (double)$3 );
@@ -217,7 +215,7 @@ multiplicative_expression: unary_expression
}
}
| multiplicative_expression TOK_DIVIDE unary_expression
- {
+ {
if (!$1.isInt() || !$3.isInt())
{
$$ = CPPValue( (double)$1 / (double)$3 );
@@ -230,7 +228,7 @@ multiplicative_expression: unary_expression
}
}
| multiplicative_expression TOK_MOD unary_expression
- {
+ {
long value = $3;
if (value==0) value=1;
$$ = CPPValue( (long)$1 % value );
@@ -242,8 +240,8 @@ unary_expression: primary_expression
| TOK_PLUS unary_expression
{ $$ = $1; }
| TOK_MINUS unary_expression
- {
- if ($2.isInt())
+ {
+ if ($2.isInt())
$$ = CPPValue(-(long)$2);
else
$$ = CPPValue(-(double)$2);
@@ -279,6 +277,11 @@ constant: TOK_OCTALINT
struct constexpYY_state* yyextra = constexpYYget_extra(yyscanner);
$$ = parseHexadecimal(yyextra->strToken);
}
+ | TOK_BINARYINT
+ {
+ struct constexpYY_state* yyextra = constexpYYget_extra(yyscanner);
+ $$ = parseBinary(yyextra->strToken);
+ }
| TOK_CHARACTER
{
struct constexpYY_state* yyextra = constexpYYget_extra(yyscanner);
diff --git a/src/constexp_p.h b/src/constexp_p.h
index ad09b2d..1f3408b 100644
--- a/src/constexp_p.h
+++ b/src/constexp_p.h
@@ -1,10 +1,10 @@
/******************************************************************************
*
- * Copyright (C) 1997-2019 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.
*
@@ -16,7 +16,7 @@
#ifndef _CONSTEXP_P_H
#define _CONSTEXP_P_H
-#include <qcstring.h>
+#include <string>
//! @file
//! @brief Private interface between Parser (constexp.y) and Lexer (constexp.l)
@@ -27,12 +27,12 @@
typedef void* yyscan_t;
struct constexpYY_state
{
- QCString strToken;
- CPPValue resultValue;
- int constExpLineNr;
- QCString constExpFileName;
+ std::string strToken;
+ CPPValue resultValue;
+ int constExpLineNr;
+ std::string constExpFileName;
- const char *inputString;
+ std::string inputString;
int inputPosition;
};
constexpYY_state* constexpYYget_extra(yyscan_t yyscanner );
diff --git a/src/containers.h b/src/containers.h
index 770f92d..f8027fd 100644
--- a/src/containers.h
+++ b/src/containers.h
@@ -26,6 +26,7 @@
using StringUnorderedMap = std::unordered_map<std::string,std::string>;
using StringUnorderedSet = std::unordered_set<std::string>;
+using StringMap = std::map<std::string,std::string>;
using StringSet = std::set<std::string>;
using StringVector = std::vector<std::string>;
using BoolStack = std::stack<bool>;
diff --git a/src/context.cpp b/src/context.cpp
index 7f3a33e..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
@@ -128,40 +129,40 @@ template<class T> class SharedPtr
class GenericConstIterator : public TemplateListIntf::ConstIterator
{
public:
- GenericConstIterator(const QList<TemplateVariant> &list)
- : m_it(list) { }
+ GenericConstIterator(const std::vector<TemplateVariant> &list) : m_list(list) {}
virtual ~GenericConstIterator() {}
void toFirst()
{
- m_it.toFirst();
+ m_index=0;
}
void toLast()
{
- m_it.toLast();
+ m_index=static_cast<int>(m_list.size())-1;
}
void toNext()
{
- if (m_it.current()) ++m_it;
+ if (m_index < static_cast<int>(m_list.size())) ++m_index;
}
void toPrev()
{
- if (m_it.current()) --m_it;
+ if (m_index>=0) --m_index;
}
bool current(TemplateVariant &v) const
{
- if (m_it.current())
+ if (m_index>=0 && m_index < static_cast<int>(m_list.size()))
{
- v = *m_it.current();
- return TRUE;
+ v = m_list[m_index];
+ return true;
}
else
{
v = TemplateVariant();
- return FALSE;
+ return false;
}
}
private:
- QListIterator<TemplateVariant> m_it;
+ const std::vector<TemplateVariant> &m_list;
+ int m_index=0;
};
//------------------------------------------------------------------------
@@ -172,7 +173,6 @@ class GenericNodeListContext : public TemplateListIntf
public:
GenericNodeListContext() : m_refCount(0)
{
- m_children.setAutoDelete(TRUE);
}
static GenericNodeListContext *alloc()
{
@@ -182,14 +182,14 @@ class GenericNodeListContext : public TemplateListIntf
// TemplateListIntf methods
uint count() const
{
- return m_children.count();
+ return static_cast<uint>(m_children.size());
}
TemplateVariant at(uint index) const
{
TemplateVariant result;
if (index<count())
{
- result = *m_children.at(index);
+ result = m_children[index];
}
return result;
}
@@ -200,11 +200,11 @@ class GenericNodeListContext : public TemplateListIntf
void append(const TemplateVariant &ctn)
{
- m_children.append(new TemplateVariant(ctn));
+ m_children.emplace_back(ctn);
}
bool isEmpty() const
{
- return m_children.isEmpty();
+ return m_children.empty();
}
int addRef()
{
@@ -220,7 +220,7 @@ class GenericNodeListContext : public TemplateListIntf
return count;
}
private:
- mutable QList<TemplateVariant> m_children;
+ std::vector< TemplateVariant > m_children;
int m_refCount;
};
@@ -248,21 +248,20 @@ class PropertyMapper
};
public:
- PropertyMapper() : m_map(63) { m_map.setAutoDelete(TRUE); }
-
/** Add a property to the map
* @param[in] name The name of the property to add.
* @param[in] handle The method to call when the property is accessed.
*/
void addProperty(const char *name,typename PropertyFunc::Handler handle)
{
- if (m_map.find(name))
+ auto it = m_map.find(name);
+ if (it!=m_map.end())
{
- err("Error: adding property '%s' more than once",name);
+ err("adding property '%s' more than once\n",name);
}
else
{
- m_map.insert(name,new PropertyFunc(handle));
+ m_map.insert(std::make_pair(name,std::make_unique<PropertyFunc>(handle)));
}
}
@@ -272,20 +271,16 @@ 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;
- PropertyFuncIntf *func = m_map.find(name);
- if (func)
- {
- result = (*func)(obj);
- }
- return result;
+ auto it = m_map.find(name.str());
+ return it!=m_map.end() ? (*it->second)(obj) : TemplateVariant();
}
private:
- QDict<PropertyFuncIntf> m_map;
+ std::unordered_map<std::string,std::unique_ptr<PropertyFuncIntf>> m_map;
};
@@ -296,15 +291,15 @@ class PropertyMapper
class ConfigContext::Private
{
public:
- Private() { m_cachedLists.setAutoDelete(TRUE); }
+ Private() { }
virtual ~Private() { }
TemplateVariant fetchList(const QCString &name,const StringVector &list)
{
- TemplateVariant *v = m_cachedLists.find(name);
- if (v==0)
+ auto it = m_cachedLists.find(name.str());
+ if (it==m_cachedLists.end())
{
TemplateList *tlist = TemplateList::alloc();
- m_cachedLists.insert(name,new TemplateVariant(tlist));
+ m_cachedLists.insert(std::make_pair(name.str(),TemplateVariant(tlist)));
for (const auto &s : list)
{
tlist->append(s.c_str());
@@ -313,11 +308,11 @@ class ConfigContext::Private
}
else
{
- return *v;
+ return it->second;
}
}
private:
- QDict<TemplateVariant> m_cachedLists;
+ std::unordered_map<std::string,TemplateVariant> m_cachedLists;
};
//%% }
@@ -331,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)
@@ -402,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);
}
@@ -430,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);
}
@@ -1228,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);
}
@@ -1253,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);
}
@@ -1263,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;
}
@@ -1303,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)
@@ -1334,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
@@ -1360,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
@@ -1378,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);
}
//------------------------------------------------------------------------
@@ -1546,6 +1536,7 @@ class DefinitionContext
case SrcLangExt_SQL: result="sql"; break;
case SrcLangExt_Markdown: result="markdown"; break;
case SrcLangExt_Slice: result="slice"; break;
+ case SrcLangExt_Lex: result="lex"; break;
}
return result;
}
@@ -1561,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;
@@ -1702,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);
}
@@ -1753,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);
}
@@ -1765,18 +1757,16 @@ TemplateVariant IncludeInfoContext::get(const char *n) const
class IncludeInfoListContext::Private : public GenericNodeListContext
{
public:
- Private(const QList<IncludeInfo> &list,SrcLangExt lang)
+ Private(const IncludeInfoList &list,SrcLangExt lang)
{
- QListIterator<IncludeInfo> li(list);
- IncludeInfo *ii;
- for (li.toFirst();(ii=li.current());++li)
+ for (const auto &ii : list)
{
- append(IncludeInfoContext::alloc(ii,lang));
+ append(IncludeInfoContext::alloc(&ii,lang));
}
}
};
-IncludeInfoListContext::IncludeInfoListContext(const QList<IncludeInfo> &list,SrcLangExt lang) : RefCountedContext("IncludeListContext")
+IncludeInfoListContext::IncludeInfoListContext(const IncludeInfoList &list,SrcLangExt lang) : RefCountedContext("IncludeListContext")
{
p = new Private(list,lang);
}
@@ -1887,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);
}
@@ -1957,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:
@@ -1987,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++;
@@ -1995,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>";
}
}
@@ -2034,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
{
@@ -2058,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:
@@ -2085,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
@@ -2128,11 +2115,11 @@ 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)
{
- MemberList *ml = m_classDef->getMemberList(type);
+ const MemberList *ml = m_classDef->getMemberList(type);
if (ml)
{
list.reset(MemberListInfoContext::alloc(m_classDef,relPathAsString(),ml,title,""));
@@ -2426,17 +2413,15 @@ class ClassContext::Private : public DefinitionContext<ClassContext::Private>
}
void addMembers(const ClassDef *cd,MemberListType lt) const
{
- MemberList *ml = cd->getMemberList(lt);
+ const MemberList *ml = cd->getMemberList(lt);
if (ml)
{
Cachable &cache = getCache();
- MemberListIterator li(*ml);
- const MemberDef *md;
- for (li.toFirst();(md=li.current());++li)
+ for (const auto &md : *ml)
{
if (md->isBriefSectionVisible())
{
- cache.allMembers.append(md);
+ cache.allMembers.push_back(md);
}
}
}
@@ -2653,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);
}
@@ -2662,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);
}
@@ -2709,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);
}
@@ -2792,11 +2777,11 @@ 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)
{
- MemberList *ml = m_namespaceDef->getMemberList(type);
+ const MemberList *ml = m_namespaceDef->getMemberList(type);
if (ml)
{
list.reset(MemberListInfoContext::alloc(m_namespaceDef,relPathAsString(),ml,title,""));
@@ -2953,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);
}
@@ -3010,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);
}
@@ -3033,10 +3018,10 @@ class FileContext::Private : public DefinitionContext<FileContext::Private>
TemplateVariant includeList() const
{
Cachable &cache = getCache();
- if (!cache.includeInfoList && m_fileDef->includeFileList())
+ if (!cache.includeInfoList && !m_fileDef->includeFileList().empty())
{
cache.includeInfoList.reset(IncludeInfoListContext::alloc(
- *m_fileDef->includeFileList(),m_fileDef->getLanguage()));
+ m_fileDef->includeFileList(),m_fileDef->getLanguage()));
}
if (cache.includeInfoList)
{
@@ -3065,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:
@@ -3092,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
{
@@ -3117,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:
@@ -3144,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
{
@@ -3231,11 +3214,11 @@ 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)
{
- MemberList *ml = m_fileDef->getMemberList(type);
+ const MemberList *ml = m_fileDef->getMemberList(type);
if (ml)
{
list.reset(MemberListInfoContext::alloc(m_fileDef,relPathAsString(),ml,title,""));
@@ -3407,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);
}
@@ -3440,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);
}
@@ -3480,16 +3463,10 @@ class DirContext::Private : public DefinitionContext<DirContext::Private>
if (!cache.files)
{
cache.files.reset(TemplateList::alloc());
- FileList *files = m_dirDef->getFiles();
- if (files)
+ for (const auto &fd : m_dirDef->getFiles())
{
- QListIterator<FileDef> it(*files);
- const FileDef *fd;
- for (it.toFirst();(fd=it.current());++it)
- {
- FileContext *fc = FileContext::alloc(fd);
- cache.files->append(fc);
- }
+ FileContext *fc = FileContext::alloc(fd);
+ cache.files->append(fc);
}
}
return cache.files.get();
@@ -3529,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:
@@ -3564,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:
@@ -3603,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);
}
@@ -3632,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);
}
@@ -3736,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);
}
@@ -3746,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++))
{
@@ -3797,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();
@@ -3812,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;
};
@@ -3829,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);
@@ -3843,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
@@ -3879,7 +3855,7 @@ class TextGeneratorLatex : public TextGeneratorIntf
}
private:
- FTextStream &m_ts;
+ TextStream &m_ts;
};
//------------------------------------------------------------------------
@@ -3893,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)
{
@@ -3913,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
{
@@ -4062,11 +4037,11 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
s_inst.addProperty("nameWithContextFor", &Private::nameWithContextFor);
init=TRUE;
}
- if (md && !md->cookie()) { md->setCookie(new MemberContext::Private::Cachable(md)); }
+ if (!md->cookie()) { md->setCookie(new MemberContext::Private::Cachable(md)); }
Cachable &cache = getCache();
cache.propertyAttrs.reset(TemplateList::alloc());
- if (md && md->isProperty())
+ if (md->isProperty())
{
if (md->isGettable()) cache.propertyAttrs->append("get");
if (md->isPrivateGettable()) cache.propertyAttrs->append("private get");
@@ -4076,7 +4051,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
if (md->isProtectedSettable()) cache.propertyAttrs->append("protected set");
}
cache.eventAttrs.reset(TemplateList::alloc());
- if (md && md->isEvent())
+ if (md->isEvent())
{
if (md->isAddable()) cache.eventAttrs->append("add");
if (md->isRemovable()) cache.eventAttrs->append("remove");
@@ -4084,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);
}
@@ -4470,15 +4445,7 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
Cachable &cache = getCache();
if (!cache.enumValues)
{
- const MemberList *ml = m_memberDef->enumFieldList();
- if (ml)
- {
- cache.enumValues.reset(MemberListContext::alloc(ml));
- }
- else
- {
- cache.enumValues.reset(MemberListContext::alloc());
- }
+ cache.enumValues.reset(MemberListContext::alloc(&m_memberDef->enumFieldList()));
}
return cache.enumValues.get();
}
@@ -4710,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);
}
@@ -4758,11 +4720,12 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
Cachable &cache = getCache();
if (!cache.implements)
{
- MemberDef *md = m_memberDef->reimplements();
+ const MemberDef *md = m_memberDef->reimplements();
cache.implements.reset(TemplateList::alloc());
if (md)
{
const ClassDef *cd = md->getClassDef();
+ // filter on pure virtual/interface methods
if (cd && (md->virtualness()==Pure || cd->compoundType()==ClassDef::Interface))
{
MemberContext *mc = MemberContext::alloc(md);
@@ -4777,11 +4740,12 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
Cachable &cache = getCache();
if (!cache.reimplements)
{
- MemberDef *md = m_memberDef->reimplements();
+ const MemberDef *md = m_memberDef->reimplements();
cache.reimplements.reset(TemplateList::alloc());
if (md)
{
const ClassDef *cd = md->getClassDef();
+ // filter on non-pure virtual & non interface methods
if (cd && md->virtualness()!=Pure && cd->compoundType()!=ClassDef::Interface)
{
MemberContext *mc = MemberContext::alloc(md);
@@ -4796,20 +4760,15 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
Cachable &cache = getCache();
if (!cache.implementedBy)
{
- MemberList *ml = m_memberDef->reimplementedBy();
cache.implementedBy.reset(TemplateList::alloc());
- if (ml)
+ for (const auto &md : m_memberDef->reimplementedBy())
{
- MemberListIterator mli(*ml);
- MemberDef *md=0;
- for (mli.toFirst();(md=mli.current());++mli)
+ const ClassDef *cd = md->getClassDef();
+ // filter on pure virtual/interface methods
+ if (cd && md->virtualness()==Pure && cd->compoundType()==ClassDef::Interface)
{
- const ClassDef *cd = md->getClassDef();
- if (cd && (md->virtualness()==Pure || cd->compoundType()==ClassDef::Interface))
- {
- MemberContext *mc = new MemberContext(md);
- cache.implementedBy->append(mc);
- }
+ MemberContext *mc = new MemberContext(md);
+ cache.implementedBy->append(mc);
}
}
}
@@ -4821,19 +4780,14 @@ class MemberContext::Private : public DefinitionContext<MemberContext::Private>
if (!cache.reimplementedBy)
{
cache.reimplementedBy.reset(TemplateList::alloc());
- MemberList *ml = m_memberDef->reimplementedBy();
- if (ml)
+ for (const auto &md : m_memberDef->reimplementedBy())
{
- MemberListIterator mli(*ml);
- MemberDef *md=0;
- for (mli.toFirst();(md=mli.current());++mli)
+ const ClassDef *cd = md->getClassDef();
+ // filter on non-pure virtual & non interface methods
+ if (cd && md->virtualness()!=Pure && cd->compoundType()!=ClassDef::Interface)
{
- const ClassDef *cd = md->getClassDef();
- if (cd && md->virtualness()!=Pure && cd->compoundType()!=ClassDef::Interface)
- {
- MemberContext *mc = new MemberContext(md);
- cache.reimplementedBy->append(mc);
- }
+ MemberContext *mc = new MemberContext(md);
+ cache.reimplementedBy->append(mc);
}
}
}
@@ -4976,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:
@@ -5000,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
{
@@ -5015,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("");
}
@@ -5048,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:
@@ -5072,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
{
@@ -5087,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("");
}
@@ -5207,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);
}
@@ -5273,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);
}
@@ -5312,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:
@@ -5345,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
{
@@ -5421,14 +5372,9 @@ class ModuleContext::Private : public DefinitionContext<ModuleContext::Private>
if (!cache.files)
{
TemplateList *fileList = TemplateList::alloc();
- if (m_groupDef->getFiles())
+ for (const auto &fd : m_groupDef->getFiles())
{
- QListIterator<FileDef> it(*m_groupDef->getFiles());
- const FileDef *fd;
- for (it.toFirst();(fd=it.current());++it)
- {
- fileList->append(FileContext::alloc(fd));
- }
+ fileList->append(FileContext::alloc(fd));
}
cache.files.reset(fileList);
}
@@ -5487,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)
{
@@ -5724,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);
}
@@ -5803,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);
}
@@ -5889,7 +5835,7 @@ ClassIndexContext::~ClassIndexContext()
}
// TemplateStructIntf
-TemplateVariant ClassIndexContext::get(const char *n) const
+TemplateVariant ClassIndexContext::get(const QCString &n) const
{
return p->get(n);
}
@@ -5995,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);
}
@@ -6102,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);
}
@@ -6162,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);
}
@@ -6369,10 +6315,7 @@ class NestingNodeContext::Private
if (dd)
{
m_children->addDirs(dd->subDirs(),visitedClasses);
- if (dd && dd->getFiles())
- {
- m_children->addFiles(*dd->getFiles(),visitedClasses);
- }
+ m_children->addFiles(dd->getFiles(),visitedClasses);
}
}
void addPages(ClassDefSet &visitedClasses)
@@ -6427,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);
}
@@ -6451,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)
{
@@ -6548,9 +6493,7 @@ class NestingContext::Private : public GenericNodeListContext
}
void addFiles(const FileList &fList,ClassDefSet &visitedClasses)
{
- QListIterator<FileDef> li(fList);
- const FileDef *fd;
- for (li.toFirst();(fd=li.current());++li)
+ for (const auto &fd : fList)
{
append(NestingNodeContext::alloc(m_parent,fd,m_index,m_level,FALSE,FALSE,FALSE,visitedClasses));
m_index++;
@@ -6793,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);
}
@@ -6880,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);
}
@@ -6957,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);
}
@@ -7046,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);
}
@@ -7162,9 +7105,7 @@ UsedFilesContext::UsedFilesContext(const ClassDef *cd) : RefCountedContext("Used
p = new Private;
if (cd)
{
- QListIterator<FileDef> li(cd->usedFiles());
- const FileDef *fd;
- for (li.toFirst();(fd=li.current());++li)
+ for (const auto &fd : cd->usedFiles())
{
p->addFile(fd);
}
@@ -7229,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);
}
@@ -7303,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);
}
@@ -7337,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);
}
@@ -7411,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);
}
@@ -7579,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);
}
@@ -7653,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);
}
@@ -7679,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);
}
@@ -7747,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);
}
@@ -7781,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);
}
@@ -7855,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);
}
@@ -7890,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);
}
@@ -8008,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);
}
@@ -8043,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);
}
@@ -8163,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);
}
@@ -8198,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);
}
@@ -8315,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);
}
@@ -8336,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,*/
@@ -8355,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;
@@ -8377,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);
}
@@ -8400,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);
}
@@ -8436,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);
}
@@ -8469,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);
}
}
@@ -8518,9 +8458,7 @@ MemberListContext::MemberListContext(const MemberList *list) : RefCountedContext
if (list)
{
bool details = list->listType()&MemberListType_detailedLists;
- MemberListIterator mli(*list);
- MemberDef *md;
- for (mli.toFirst();(md=mli.current());++mli)
+ for (const auto &md : *list)
{
if ((md->isBriefSectionVisible() && !details) ||
(md->isDetailedSectionLinkable() && details)
@@ -8586,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);
}
@@ -8649,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);
}
@@ -8738,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);
}
@@ -8746,7 +8684,7 @@ class MemberGroupInfoContext::Private
{
if (!m_cache.memberListContext)
{
- m_cache.memberListContext.reset(MemberListContext::alloc(m_memberGroup->members()));
+ m_cache.memberListContext.reset(MemberListContext::alloc(&m_memberGroup->members()));
}
return m_cache.memberListContext.get();
}
@@ -8821,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);
}
@@ -8912,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);
}
@@ -8993,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);
}
@@ -9005,7 +8943,7 @@ TemplateVariant MemberListInfoContext::get(const char *name) const
class InheritedMemberInfoContext::Private
{
public:
- Private(const ClassDef *cd,MemberList *ml,const QCString &title)
+ Private(const ClassDef *cd,const MemberList *ml,const QCString &title)
: m_class(cd), m_memberList(ml), m_title(title)
{
static bool init=FALSE;
@@ -9019,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);
}
@@ -9065,7 +9003,7 @@ class InheritedMemberInfoContext::Private
private:
const ClassDef * m_class;
- MemberList *m_memberList;
+ const MemberList *m_memberList;
QCString m_title;
mutable SharedPtr<ClassContext> m_classCtx;
mutable SharedPtr<MemberListContext> m_memberListCtx;
@@ -9076,7 +9014,7 @@ class InheritedMemberInfoContext::Private
PropertyMapper<InheritedMemberInfoContext::Private> InheritedMemberInfoContext::Private::s_inst;
-InheritedMemberInfoContext::InheritedMemberInfoContext(const ClassDef *cd,MemberList *ml,
+InheritedMemberInfoContext::InheritedMemberInfoContext(const ClassDef *cd,const MemberList *ml,
const QCString &title) : RefCountedContext("InheritedMemberInfoContext")
{
p = new Private(cd,ml,title);
@@ -9087,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);
}
@@ -9098,26 +9036,21 @@ TemplateVariant InheritedMemberInfoContext::get(const char *name) const
class InheritedMemberInfoListContext::Private : public GenericNodeListContext
{
public:
- void addMemberList(const ClassDef *inheritedFrom,MemberList *ml,MemberList *combinedList)
+ void addMemberList(const ClassDef *inheritedFrom,const MemberList &ml,MemberList *combinedList)
{
- if (ml)
+ for (const auto &md : ml)
{
- MemberListIterator li(*ml);
- MemberDef *md;
- for (li.toFirst();(md=li.current());++li)
+ if (md->isBriefSectionVisible() && !md->isReimplementedBy(inheritedFrom))
{
- if (md->isBriefSectionVisible() && !md->isReimplementedBy(inheritedFrom))
- {
- combinedList->append(md);
- }
+ combinedList->push_back(md);
}
}
}
- void addMemberListIncludingGrouped(const ClassDef *inheritedFrom,MemberList *ml,MemberList *combinedList)
+ void addMemberListIncludingGrouped(const ClassDef *inheritedFrom,const MemberList *ml,MemberList *combinedList)
{
if (ml)
{
- addMemberList(inheritedFrom,ml,combinedList);
+ addMemberList(inheritedFrom,*ml,combinedList);
for (const auto *mg : ml->getMemberGroupList())
{
addMemberList(inheritedFrom,mg->members(),combinedList);
@@ -9131,17 +9064,15 @@ class InheritedMemberInfoListContext::Private : public GenericNodeListContext
// addMemberGroupsOfGroup?
for (const auto &mg: cd->getMemberGroups())
{
- if (mg->members() && (!mg->allMembersInSameSection() || !cd->subGrouping())) // group is in its own section
+ if (!mg->members().empty() && (!mg->allMembersInSameSection() || !cd->subGrouping())) // group is in its own section
{
- MemberListIterator li(*mg->members());
- MemberDef *md;
- for (li.toFirst();(md=li.current());++li)
+ for (const auto &md : mg->members())
{
if (lt==md->getSectionList(mg->container())->listType() &&
!md->isReimplementedBy(inheritedFrom) &&
md->isBriefSectionVisible())
{
- combinedList->append(md);
+ combinedList->push_back(md);
}
}
}
@@ -9154,8 +9085,8 @@ class InheritedMemberInfoListContext::Private : public GenericNodeListContext
if (lt2!=-1) count += cd->countMembersIncludingGrouped((MemberListType)lt2,inheritedFrom,additionalList);
if (count>0)
{
- MemberList *ml = cd->getMemberList(lt1);
- MemberList *ml2 = lt2!=-1 ? cd->getMemberList((MemberListType)lt2) : 0;
+ const MemberList *ml = cd->getMemberList(lt1);
+ const MemberList *ml2 = lt2!=-1 ? cd->getMemberList((MemberListType)lt2) : 0;
MemberList *combinedList = new MemberList(lt);
addMemberListIncludingGrouped(inheritedFrom,ml,combinedList);
addMemberListIncludingGrouped(inheritedFrom,ml2,combinedList);
@@ -9166,7 +9097,7 @@ class InheritedMemberInfoListContext::Private : public GenericNodeListContext
}
void findInheritedMembers(const ClassDef *inheritedFrom,const ClassDef *cd,MemberListType lt,
int lt2, const QCString &title,bool additionalList,
- QPtrDict<void> *visitedClasses)
+ ClassDefSet &visitedClasses)
{
for (const auto &ibcd : cd->baseClasses())
{
@@ -9179,9 +9110,9 @@ class InheritedMemberInfoListContext::Private : public GenericNodeListContext
{
lt2=lt3;
}
- if (visitedClasses->find(icd)==0)
+ if (visitedClasses.find(icd)==visitedClasses.end())
{
- visitedClasses->insert(icd,icd); // guard for multiple virtual inheritance
+ visitedClasses.insert(icd); // guard for multiple virtual inheritance
if (lt1!=-1)
{
// add member info for members of cd with list type lt
@@ -9203,14 +9134,14 @@ InheritedMemberInfoListContext::InheritedMemberInfoListContext() : RefCountedCon
void InheritedMemberInfoListContext::addMemberList(
const ClassDef *cd,MemberListType lt,const QCString &title,bool additionalList)
{
- QPtrDict<void> visited(17);
+ ClassDefSet visited;
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);
+ p->findInheritedMembers(cd,cd,lt,-1,title,additionalList,visited);
}
}
@@ -9258,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);
}
@@ -9335,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);
}
@@ -9425,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);
}
@@ -9529,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);
}
@@ -9602,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);
}
@@ -9648,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);
}
@@ -9729,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);
}
@@ -9775,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);
}
@@ -9840,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);
}
@@ -9884,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);
}
@@ -9952,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++))
@@ -9962,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:
};
@@ -9986,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++))
@@ -9995,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)
@@ -10017,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
@@ -10026,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;
@@ -10170,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);
}
@@ -10195,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);
}
@@ -10222,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 a975d3d..1fb934e 100644
--- a/src/context.h
+++ b/src/context.h
@@ -18,7 +18,6 @@
#include "types.h"
#include "template.h"
-#include <qlist.h>
#include <stdio.h>
#include "classdef.h"
#include "searchindex.h"
@@ -48,7 +47,10 @@ class DirList;
class FileDef;
class FileList;
+
struct IncludeInfo;
+class IncludeInfoList;
+
class MemberList;
class MemberDef;
struct Argument;
@@ -78,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)
{
@@ -132,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(); }
@@ -151,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(); }
@@ -170,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(); }
@@ -214,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(); }
@@ -230,7 +232,7 @@ class IncludeInfoContext : public RefCountedContext, public TemplateStructIntf
class IncludeInfoListContext : public RefCountedContext, public TemplateListIntf
{
public:
- static IncludeInfoListContext *alloc(const QList<IncludeInfo> &list,SrcLangExt lang)
+ static IncludeInfoListContext *alloc(const IncludeInfoList &list,SrcLangExt lang)
{ return new IncludeInfoListContext(list,lang); }
// TemplateListIntf
@@ -241,7 +243,7 @@ class IncludeInfoListContext : public RefCountedContext, public TemplateListIntf
virtual int release() { return RefCountedContext::release(); }
private:
- IncludeInfoListContext(const QList<IncludeInfo> &list,SrcLangExt lang);
+ IncludeInfoListContext(const IncludeInfoList &list,SrcLangExt lang);
~IncludeInfoListContext();
class Private;
Private *p;
@@ -256,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(); }
@@ -275,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(); }
@@ -294,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(); }
@@ -312,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(); }
@@ -332,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(); }
@@ -351,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(); }
@@ -371,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(); }
@@ -411,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(); }
@@ -431,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(); }
@@ -451,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(); }
@@ -493,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(); }
@@ -517,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(); }
@@ -576,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(); }
@@ -616,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(); }
@@ -677,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(); }
@@ -719,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(); }
@@ -738,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(); }
@@ -781,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(); }
@@ -822,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(); }
@@ -841,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(); }
@@ -860,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(); }
@@ -879,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(); }
@@ -898,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(); }
@@ -919,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(); }
@@ -989,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(); }
@@ -1040,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(); }
@@ -1061,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(); }
@@ -1077,16 +1079,16 @@ class MemberInfoContext : public RefCountedContext, public TemplateStructIntf
class InheritedMemberInfoContext : public RefCountedContext, public TemplateStructIntf
{
public:
- static InheritedMemberInfoContext *alloc(const ClassDef *cd,MemberList *ml,const QCString &title)
+ static InheritedMemberInfoContext *alloc(const ClassDef *cd,const MemberList *ml,const QCString &title)
{ 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(); }
private:
- InheritedMemberInfoContext(const ClassDef *cd,MemberList *ml,const QCString &title);
+ InheritedMemberInfoContext(const ClassDef *cd,const MemberList *ml,const QCString &title);
~InheritedMemberInfoContext();
class Private;
Private *p;
@@ -1145,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(); }
@@ -1189,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(); }
@@ -1234,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(); }
@@ -1278,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(); }
@@ -1320,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(); }
@@ -1355,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 1543498..8cd7c5c 100644
--- a/src/cppvalue.cpp
+++ b/src/cppvalue.cpp
@@ -1,13 +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.
*
@@ -21,40 +18,50 @@
#include "cppvalue.h"
#include "constexp.h"
-CPPValue parseOctal(const QCString& token)
+CPPValue parseOctal(const std::string& token)
{
long val = 0;
- for (const char *p = token.data(); *p != 0; p++)
+ for (const char *p = token.c_str(); *p != 0; p++)
{
if (*p >= '0' && *p <= '7') val = val * 8 + *p - '0';
}
return CPPValue(val);
}
-CPPValue parseDecimal(const QCString& token)
+CPPValue parseDecimal(const std::string& token)
{
long val = 0;
- for (const char *p = token.data(); *p != 0; p++)
+ for (const char *p = token.c_str(); *p != 0; p++)
{
if (*p >= '0' && *p <= '9') val = val * 10 + *p - '0';
}
return CPPValue(val);
}
-CPPValue parseHexadecimal(const QCString& token)
+CPPValue parseHexadecimal(const std::string& token)
{
long val = 0;
- for (const char *p = token.data(); *p != 0; p++)
+ for (const char *p = token.c_str(); *p != 0; p++)
{
if (*p >= '0' && *p <= '9') val = val * 16 + *p - '0';
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);
+}
+
+CPPValue parseBinary(const std::string& token)
+{
+ long val = 0;
+ for (const char *p = token.c_str(); *p != 0; p++)
+ {
+ if (*p >= '0' && *p <= '1') val = val * 2 + *p - '0';
+ }
return CPPValue(val);
}
-CPPValue parseCharacter(const QCString& token) // does not work for '\n' and the alike
+CPPValue parseCharacter(const std::string& token) // does not work for '\n' and the alike
{
if (token[1]=='\\')
{
@@ -80,16 +87,16 @@ CPPValue parseCharacter(const QCString& token) // does not work for '\n' and the
case '6': // fall through
case '7': // fall through
return parseOctal(token);
- case 'x':
+ case 'x':
case 'X': return parseHexadecimal(token);
- default: printf("Invalid escape sequence %s found!\n",token.data());
- return CPPValue(0L);
+ default: printf("Invalid escape sequence %s found!\n",token.c_str());
+ return CPPValue(0L);
}
}
return CPPValue((long)token[1]);
}
-CPPValue parseFloat(const QCString& token)
+CPPValue parseFloat(const std::string& token)
{
- return CPPValue(atof(token));
+ return CPPValue(std::stod(token));
}
diff --git a/src/cppvalue.h b/src/cppvalue.h
index cde033d..74fe4d7 100644
--- a/src/cppvalue.h
+++ b/src/cppvalue.h
@@ -1,13 +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,16 +16,15 @@
#ifndef _CPPVALUE_H
#define _CPPVALUE_H
-#include <stdio.h>
-#include <qglobal.h>
-#include <qcstring.h>
+#include <cstdio>
+#include <string>
/** A class representing a C-preprocessor value. */
class CPPValue
{
public:
enum Type { Int, Float };
-
+
CPPValue(long val=0) : type(Int) { v.l = val; }
CPPValue(double val) : type(Float) { v.d = val; }
@@ -36,10 +32,10 @@ class CPPValue
operator long () const { return type==Int ? v.l : (long)v.d; }
bool isInt() const { return type == Int; }
-
+
void print() const
{
- if (type==Int)
+ if (type==Int)
printf("(%ld)\n",v.l);
else
printf("(%f)\n",v.d);
@@ -53,10 +49,11 @@ class CPPValue
} v;
};
-extern CPPValue parseOctal(const QCString& token);
-extern CPPValue parseDecimal(const QCString& token);
-extern CPPValue parseHexadecimal(const QCString& token);
-extern CPPValue parseCharacter(const QCString& token);
-extern CPPValue parseFloat(const QCString& token);
+extern CPPValue parseOctal(const std::string& token);
+extern CPPValue parseDecimal(const std::string& token);
+extern CPPValue parseHexadecimal(const std::string& token);
+extern CPPValue parseBinary(const std::string& token);
+extern CPPValue parseCharacter(const std::string& token);
+extern CPPValue parseFloat(const std::string& token);
#endif
diff --git a/src/debug.cpp b/src/debug.cpp
index f56ef3a..ea6f272 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -22,6 +22,7 @@
#include "debug.h"
#include "message.h"
+#include "qcstring.h"
//------------------------------------------------------------------------
@@ -31,6 +32,7 @@ static std::map< std::string, Debug::DebugMask > s_labels =
{ "functions", Debug::Functions },
{ "variables", Debug::Variables },
{ "preprocessor", Debug::Preprocessor },
+ { "nolineno", Debug::NoLineNo },
{ "classes", Debug::Classes },
{ "commentcnv", Debug::CommentCnv },
{ "commentscan", Debug::CommentScan },
@@ -68,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 | 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));
}
@@ -118,8 +120,8 @@ class Timer
double elapsedTimeS()
{
return (std::chrono::duration_cast<
- std::chrono::milliseconds>(
- std::chrono::system_clock::now() - m_startTime).count()) / 1000.0;
+ std::chrono::microseconds>(
+ std::chrono::system_clock::now() - m_startTime).count()) / 1000000.0;
}
private:
std::chrono::time_point<std::chrono::system_clock> m_startTime;
diff --git a/src/debug.h b/src/debug.h
index e71595f..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
{
@@ -37,12 +39,13 @@ class Debug
Lex = 0x00002000,
Plantuml = 0x00004000,
FortranFixed2Free = 0x00008000,
- Cite = 0x00010000
+ Cite = 0x00010000,
+ NoLineNo = 0x00020000
};
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 014ef75..e340df5 100644
--- a/src/declinfo.l
+++ b/src/declinfo.l
@@ -83,6 +83,7 @@ static yy_size_t yyread(char *buf,yy_size_t max_size, yyscan_t yyscanner);
%}
B [ \t]
+Bopt {B}*
ID "$"?([a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*)|(@[0-9]+)
%x Start
@@ -117,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-
@@ -125,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())
@@ -134,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);
}
@@ -151,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}*")" {
@@ -188,11 +189,11 @@ ID "$"?([a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*)|(@[0-9]+)
<Template>. {
yyextra->name+=*yytext;
}
-<Operator>{B}*"("{B}*")"{B}*"<>"{B}*/"(" {
+<Operator>{B}*"("{B}*")"{B}*"<>"{Bopt}/"(" {
yyextra->name+="() <>";
BEGIN(ReadArgs);
}
-<Operator>{B}*"("{B}*")"{B}*/"(" {
+<Operator>{B}*"("{B}*")"{Bopt}/"(" {
yyextra->name+="()";
BEGIN(ReadArgs);
}
@@ -219,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+"::";
@@ -232,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
{
@@ -275,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;
@@ -296,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 [])
@@ -349,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);
@@ -369,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 e25c1fe..9385cc3 100644
--- a/src/defargs.l
+++ b/src/defargs.l
@@ -27,12 +27,12 @@
* The Argument list as a whole can be pure, constant or volatile.
*
* Examples of input strings are:
- * \code
+ * \verbatim
* "(int a,int b) const"
* "(const char *s="hello world",int=5) = 0"
* "<class T,class N>"
* "(char c,const char)"
- * \endcode
+ * \endverbatim
*
* Note: It is not always possible to distinguish between the name and
* type of an argument. In case of doubt the name is added to the
@@ -56,8 +56,6 @@
//#include <iostream.h>
#include <assert.h>
#include <ctype.h>
-#include <qregexp.h>
-#include <qcstringlist.h>
#include "defargs.h"
#include "entry.h"
@@ -115,10 +113,18 @@ static bool nameIsActuallyPartOfType(QCString &name);
%}
B [ \t]
+Bopt {B}*
ID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
RAWBEGIN (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"("
RAWEND ")"[^ \t\(\)\\]{0,16}\"
+ // C start comment
+CCS "/\*"
+ // C end comment
+CCE "*\/"
+ // Cpp comment
+CPPC "/\/"
+
%option noyywrap
%x Start
@@ -159,7 +165,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
<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);
@@ -169,7 +175,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
yyextra->curArgDefValue+=*yytext;
BEGIN( CopyArgString );
}
-<ReadFuncArgType>"("([^:)]+{B}*"::")*{B}*[&*\^]+{B}*/{ID} {
+<ReadFuncArgType>"("([^:)]+{B}*"::")*{B}*[&*\^]+{Bopt}/{ID} {
// function pointer as argument
yyextra->curArgTypeName+=yytext;
//yyextra->curArgTypeName=yyextra->curArgTypeName.simplifyWhiteSpace();
@@ -323,7 +329,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
}
<CopyRawString>{RAWEND} {
yyextra->curArgDefValue+=yytext;
- QCString delimiter = yytext+1;
+ QCString delimiter(yytext+1);
delimiter=delimiter.left(delimiter.length()-1);
if (delimiter==yyextra->delimiter)
{
@@ -337,10 +343,10 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
<ReadFuncArgType>"=" {
BEGIN( ReadFuncArgDef );
}
-<ReadFuncArgType,ReadFuncArgDef>[,)>]{B}*("/*"[*!]|"//"[/!])"<" {
+<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
@@ -356,7 +362,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
{
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)
{
@@ -364,10 +370,10 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
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
{
@@ -408,7 +414,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
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
{
@@ -420,7 +426,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
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])
@@ -433,10 +439,10 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
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);
@@ -469,13 +475,13 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
}
}
<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>. {
@@ -489,8 +495,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
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;
@@ -524,7 +529,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
BEGIN(FuncQual);
}
<FuncQual>"->" { // C++11 trailing return type
- yyextra->argList->setTrailingReturnType(" -> ");
+ yyextra->argList->setTrailingReturnType(QCString(" -> "));
BEGIN(TrailingReturn);
}
<TrailingReturn>{B}/("final"|"override"){B}* {
@@ -547,7 +552,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
<ReadDocLine>[^\n]+ {
yyextra->curArgDocs+=yytext;
}
-<ReadDocBlock>"*/" {
+<ReadDocBlock>{CCE} {
if (yyextra->lastDocChar!=0)
unput(yyextra->lastDocChar);
BEGIN(yyextra->lastDocContext);
@@ -563,7 +568,7 @@ RAWEND ")"[^ \t\(\)\\]{0,16}\"
<ReadDocBlock>. {
yyextra->curArgDocs+=*yytext;
}
-<*>("/*"[*!]|"//"[/!])("<"?) {
+<*>({CCS}[*!]|{CPPC}[/!])("<"?) {
yyextra->lastDocContext=YY_START;
yyextra->lastDocChar=0;
if (yytext[1]=='/')
@@ -764,19 +769,19 @@ static bool nameIsActuallyPartOfType(QCString &name)
}
/*! Converts an argument string into an ArgumentList.
+ * \param[in] lang language of the current argument list
* \param[in] argsString the list of Arguments.
- * \param[out] al a reference to resulting argument list pointer.
* \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);
@@ -792,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 89f7568..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,32 +35,32 @@
#include "namespacedef.h"
#include "filedef.h"
#include "filename.h"
-
-#include <qdir.h>
-#include <qfile.h>
-#include <qtextstream.h>
+#include "dir.h"
+#include "textstream.h"
#define DEF_DB(x)
-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 << '\'';
}
-void generateDEFForMember(MemberDef *md,
- FTextStream &t,
- Definition *def,
- const char* Prefix)
+static void generateDEFForMember(const MemberDef *md,
+ TextStream &t,
+ const Definition *def,
+ const QCString &prefix)
{
QCString memPrefix;
@@ -81,9 +83,9 @@ void generateDEFForMember(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;
@@ -108,27 +110,27 @@ void generateDEFForMember(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 &&
@@ -136,11 +138,11 @@ void generateDEFForMember(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
{
@@ -157,42 +159,42 @@ void generateDEFForMember(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
@@ -201,45 +203,39 @@ void generateDEFForMember(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
{
- const MemberList *enumList = md->enumFieldList();
- if (enumList!=0)
+ for (const auto &emd : md->enumFieldList())
{
- MemberListIterator emli(*enumList);
- MemberDef *emd;
- for (emli.toFirst();(emd=emli.current());++emli)
+ t << memPrefix << "enum = { enum-name = " << emd->name() << ';';
+ if (!emd->initializer().isEmpty())
{
- t << memPrefix << "enum = { enum-name = " << emd->name() << ';';
- if (!emd->initializer().isEmpty())
- {
- t << " enum-value = ";
- writeDEFString(t,emd->initializer());
- t << ';';
- }
- t << " };" << endl;
+ t << " enum-value = ";
+ writeDEFString(t,emd->initializer());
+ t << ';';
}
+ 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());
@@ -249,14 +245,14 @@ void generateDEFForMember(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();
@@ -267,7 +263,7 @@ void generateDEFForMember(MemberDef *md,
t << refPrefix << "name = ";
writeDEFString(t,name);
- t << ';' << endl << " };" << endl;
+ t << ';' << "\n };\n";
}
}
auto refByList = md->getReferencedByMembers();
@@ -275,14 +271,14 @@ void generateDEFForMember(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();
@@ -293,35 +289,33 @@ void generateDEFForMember(MemberDef *md,
t << refPrefix << "name = ";
writeDEFString(t,name);
- t << ';' << endl << " };" << endl;
+ t << ';' << "\n };\n";
}
}
- t << " }; /* " << Prefix << "-member */" << endl;
+ t << " }; /* " << prefix << "-member */\n";
}
-void generateDEFClassSection(ClassDef *cd,
- FTextStream &t,
- MemberList *ml,
- const char *kind)
+static void generateDEFClassSection(const ClassDef *cd,
+ TextStream &t,
+ const MemberList *ml,
+ const QCString &kind)
{
- if (cd && ml && ml->count()>0)
+ if (cd && ml && !ml->empty())
{
- t << " cp-section = {" << endl;
- t << " sec-kind = '" << kind << "';" << endl;
+ t << " cp-section = {\n";
+ t << " sec-kind = '" << kind << "';\n";
- MemberListIterator mli(*ml);
- MemberDef *md;
- for (mli.toFirst();(md=mli.current());++mli)
+ for (const auto &md : *ml)
{
generateDEFForMember(md,t,cd,"sec");
}
- t << " }; /* cp-section */" << endl;
+ t << " }; /* cp-section */\n";
}
}
-void generateDEFForClass(ClassDef *cd,FTextStream &t)
+static void generateDEFForClass(const ClassDef *cd,TextStream &t)
{
// + brief description
// + detailed description
@@ -341,22 +335,22 @@ void generateDEFForClass(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)
@@ -365,21 +359,21 @@ void generateDEFForClass(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)
@@ -388,15 +382,15 @@ void generateDEFForClass(ClassDef *cd,FTextStream &t)
case Virtual: t << "virtual;"; break;
case Pure: t << "pure-virtual;"; break;
}
- t << endl << " };" << endl;
+ t << "\n };\n";
}
- int numMembers = 0;
+ size_t numMembers = 0;
for (const auto &ml : cd->getMemberLists())
{
if ((ml->listType()&MemberListType_detailedLists)==0)
{
- numMembers+=ml->count();
+ numMembers+=ml->size();
}
}
if (numMembers>0)
@@ -428,57 +422,55 @@ void generateDEFForClass(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";
}
-void generateDEFSection(Definition *d,
- FTextStream &t,
- MemberList *ml,
- const char *kind)
+static void generateDEFSection(const Definition *d,
+ TextStream &t,
+ const MemberList *ml,
+ const QCString &kind)
{
- if (ml && ml->count()>0)
+ if (ml && !ml->empty())
{
- t << " " << kind << " = {" << endl;
- MemberListIterator mli(*ml);
- MemberDef *md;
- for (mli.toFirst();(md=mli.current());++mli)
+ t << " " << kind << " = {\n";
+ for (const auto &md : *ml)
{
generateDEFForMember(md,t,d,kind);
}
- t << " };" << endl;
+ t << " };\n";
}
}
-void generateDEFForNamespace(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");
@@ -489,25 +481,25 @@ void generateDEFForNamespace(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";
}
-void generateDEFForFile(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");
@@ -518,75 +510,42 @@ void generateDEFForFile(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())
+ QCString outputDirectory = Config_getString(OUTPUT_DIRECTORY)+"/def";
+ Dir defDir(outputDirectory.str());
+ if (!defDir.exists() && !defDir.mkdir(outputDirectory.str()))
{
- 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"))
- {
- 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()>0)
+ if (Doxygen::classLinkedMap->size()+
+ Doxygen::inputNameLinkedMap->size()+
+ Doxygen::namespaceLinkedMap->size()>0)
{
for (const auto &cd : *Doxygen::classLinkedMap)
{
@@ -599,9 +558,13 @@ void generateDEF()
generateDEFForFile(fd.get(),t);
}
}
+ for (const auto &nd : *Doxygen::namespaceLinkedMap)
+ {
+ generateDEFForNamespace(nd.get(),t);
+ }
}
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 2a03ef9..a03a676 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
@@ -21,11 +19,11 @@
#include <string>
#include <ctype.h>
-#include <qregexp.h>
#include "md5.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
+#include "regex.h"
#include "config.h"
#include "definitionimpl.h"
#include "doxygen.h"
@@ -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
- QCString symName = name;
+ std::string symName = name.str();
for (const auto &pat : exclSyms)
{
QCString pattern = pat.c_str();
@@ -176,38 +174,36 @@ static bool matchExcludedSymbols(const char *name)
pattern=pattern.left(pattern.length()-1),forceEnd=TRUE;
if (pattern.find('*')!=-1) // wildcard mode
{
- QRegExp re(substitute(pattern,"*",".*"),TRUE);
- int pl;
- int i = re.match(symName,0,&pl);
- //printf(" %d = re.match(%s) pattern=%s pl=%d len=%d\n",i,symName.data(),pattern.data(),pl,symName.length());
- if (i!=-1) // wildcard match
+ const reg::Ex re(substitute(pattern,"*",".*").str());
+ reg::Match match;
+ if (reg::search(symName,match,re)) // wildcard match
{
- uint ui=(uint)i;
- uint sl=symName.length();
- // check if it is a whole word match
+ size_t ui = match.position();
+ size_t pl = match.length();
+ size_t sl = symName.length();
if ((ui==0 || pattern.at(0)=='*' || (!isId(symName.at(ui-1)) && !forceStart)) &&
(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
{
- int i = symName.find(pattern);
- if (i!=-1) // we have a match!
+ size_t i = symName.find(pattern.str());
+ if (i!=std::string::npos) // we have a match!
{
- uint ui=(uint)i;
- uint pl=pattern.length();
- uint sl=symName.length();
+ size_t ui=i;
+ size_t pl=pattern.length();
+ size_t sl=symName.length();
// check if it is a whole word match
if ((ui==0 || (!isId(symName.at(ui-1)) && !forceStart)) &&
(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;
}
}
@@ -217,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;
@@ -231,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;
@@ -295,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));
}
}
@@ -322,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);
@@ -344,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)
@@ -368,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)
@@ -407,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"))
@@ -423,7 +419,7 @@ void DefinitionImpl::writeDocAnchorsToTagFile(FTextStream &tagFile) const
{
tagFile << " title=\"" << convertToXML(si->title()) << "\"";
}
- tagFile << ">" << si->label() << "</docanchor>" << endl;
+ tagFile << ">" << si->label() << "</docanchor>\n";
}
}
}
@@ -432,17 +428,17 @@ void DefinitionImpl::writeDocAnchorsToTagFile(FTextStream &tagFile) const
bool DefinitionImpl::_docsAlreadyAdded(const QCString &doc,QCString &sigList)
{
uchar md5_sig[16];
- QCString sigStr(33);
+ char sigStr[33];
// to avoid mismatches due to differences in indenting, we first remove
// double whitespaces...
QCString docStr = doc.simplifyWhiteSpace();
MD5Buffer((const unsigned char *)docStr.data(),docStr.length(),md5_sig);
- MD5SigToString(md5_sig,sigStr.rawData(),33);
+ MD5SigToString(md5_sig,sigStr);
//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;
+ sigList+=QCString(":")+sigStr;
return FALSE;
}
else
@@ -451,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)
{
@@ -467,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;
@@ -497,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" &&
@@ -536,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;
}
}
@@ -574,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)
{
@@ -598,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);
}
@@ -747,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);
@@ -883,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;
}
@@ -920,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);
@@ -958,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)
@@ -996,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)
@@ -1037,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)
@@ -1076,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)
@@ -1110,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;
@@ -1131,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())
{
@@ -1146,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)
{
@@ -1162,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
@@ -1194,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
{
@@ -1208,28 +1190,14 @@ void DefinitionImpl::_writeSourceRefList(OutputList &ol,const char *scopeName,
{
auto members = refMapToVector(membersMap);
- ol.startParagraph("reference");
- ol.parseText(text);
- ol.docify(" ");
-
- QCString ldefLine=theTranslator->trWriteList((int)members.size());
-
- QRegExp marker("@[0-9]+");
- uint index=0;
- int matchLen;
- int newIndex;
- // now replace all markers in inheritLine with links to the classes
- while ((newIndex=marker.match(ldefLine,index,&matchLen))!=-1)
+ auto replaceFunc = [this,&members,scopeName,&ol](size_t entryIndex)
{
- bool ok;
- ol.parseText(ldefLine.mid(index,(uint)newIndex-index));
- uint entryIndex = ldefLine.mid(newIndex+1,matchLen-1).toUInt(&ok);
- const MemberDef *md=members.at(entryIndex);
- if (ok && md)
+ const MemberDef *md=members[entryIndex];
+ if (md)
{
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));
@@ -1271,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,21 +1308,28 @@ void DefinitionImpl::_writeSourceRefList(OutputList &ol,const char *scopeName,
ol.docify(name);
}
}
- index=(uint)newIndex+matchLen;
- }
- ol.parseText(ldefLine.right(ldefLine.length()-index));
+ };
+
+ ol.startParagraph("reference");
+ ol.parseText(text);
+ ol.docify(" ");
+ writeMarkerList(ol,
+ theTranslator->trWriteList((int)members.size()).str(),
+ members.size(),
+ replaceFunc);
ol.writeString(".");
ol.endParagraph();
+
}
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);
}
@@ -1416,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;
}
@@ -1436,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>")
@@ -1461,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.
@@ -1514,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
@@ -1526,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)
{
@@ -1554,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
{
@@ -1590,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>";
@@ -1672,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)
{
@@ -1738,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)
{
@@ -1835,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("::");
@@ -1850,8 +1828,7 @@ QCString abbreviate(const char *s,const char *name)
const StringVector &briefDescAbbrev = Config_getList(ABBREVIATE_BRIEF);
for (const auto &p : briefDescAbbrev)
{
- QCString str = p.c_str();
- str.replace(QRegExp("\\$name"), scopelessName); // replace $name with entity name
+ QCString str = substitute(p.c_str(),"$name",scopelessName); // replace $name with entity name
str += " ";
stripWord(result,str);
}
@@ -1871,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("");
@@ -2045,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;
}
@@ -2065,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;
}
@@ -2097,10 +2074,10 @@ QCString DefinitionImpl::externalReference(const QCString &relPath) const
QCString ref = getReference();
if (!ref.isEmpty())
{
- QCString *dest = Doxygen::tagDestinationDict[ref];
- if (dest)
+ auto it = Doxygen::tagDestinationMap.find(ref.str());
+ if (it!=Doxygen::tagDestinationMap.end())
{
- QCString result = *dest;
+ QCString result(it->second);
uint l = result.length();
if (!relPath.isEmpty() && l>0 && result.at(0)=='.')
{ // relative path -> prepend relPath.
@@ -2177,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 444b188..6a1edfa 100644
--- a/src/definition.h
+++ b/src/definition.h
@@ -19,8 +19,6 @@
#define DEFINITION_H
#include <vector>
-#include <qlist.h>
-#include <qdict.h>
#include "types.h"
#include "reflist.h"
@@ -41,13 +39,13 @@ class SectionInfo;
class Definition;
class DefinitionMutable;
class DefinitionImpl;
-class FTextStream;
+class TextStream;
/** Data associated with a detailed description. */
struct DocInfo
{
QCString doc;
- int line;
+ int line = -1;
QCString file;
};
@@ -56,17 +54,17 @@ struct BriefInfo
{
QCString doc;
QCString tooltip;
- int line;
+ int line = -1;
QCString file;
};
/** Data associated with description found in the body. */
struct BodyInfo
{
- int defLine; //!< line number of the start of the definition
- int startLine; //!< line number of the start of the definition's body
- int endLine; //!< line number of the end of the definition's body
- FileDef *fileDef; //!< file definition containing the function body
+ int defLine = -1; //!< line number of the start of the definition
+ int startLine = -1; //!< line number of the start of the definition's body
+ int endLine = -1; //!< line number of the end of the definition's body
+ FileDef *fileDef = 0; //!< file definition containing the function body
};
/** The common base class of all entity definitions found in the sources.
@@ -92,7 +90,8 @@ class Definition
TypeGroup = 4,
TypePackage = 5,
TypePage = 6,
- TypeDir = 7
+ TypeDir = 7,
+ TypeConcept = 8
};
@@ -265,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;
@@ -318,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;
@@ -354,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 ----
@@ -378,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;
// ---------------------------------
@@ -405,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 80c85c6..0f20636 100644
--- a/src/diagram.cpp
+++ b/src/diagram.cpp
@@ -15,10 +15,8 @@
#include <stdio.h>
#include <stdlib.h>
-#include <qlist.h>
-#include <qarray.h>
-#include "ftextstream.h"
-#include <qfile.h>
+#include <fstream>
+#include <algorithm>
#include "diagram.h"
#include "image.h"
@@ -30,6 +28,7 @@
#include "portable.h"
#include "index.h"
#include "classlist.h"
+#include "textstream.h"
//-----------------------------------------------------------------------------
@@ -42,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; }
@@ -82,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(); }
@@ -109,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);
@@ -178,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)
@@ -234,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";
@@ -243,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())
@@ -269,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)
{
}
@@ -334,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);
@@ -367,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());
}
}
}
@@ -380,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)
@@ -395,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)
{
@@ -522,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;
}
@@ -566,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,
@@ -696,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)
@@ -744,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) << " "
@@ -813,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";
@@ -852,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";
@@ -861,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";
@@ -911,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 << " "
@@ -951,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 << " "
@@ -986,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 << " "
@@ -1045,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();
@@ -1054,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.
@@ -1067,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;
@@ -1080,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";
@@ -1088,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)
{
@@ -1338,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();
@@ -1350,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 6f23251..1814b51 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; }
@@ -49,8 +48,8 @@ class DirDefImpl : public DefinitionMixin<DirDef>
virtual QCString displayName(bool=TRUE) const { return m_dispName; }
virtual const QCString &shortName() const { return m_shortName; }
virtual void addSubDir(DirDef *subdir);
- virtual FileList * getFiles() const { return m_fileList; }
- virtual void addFile(FileDef *fd);
+ virtual const FileList &getFiles() const { return m_fileList; }
+ virtual void addFile(const FileDef *fd);
virtual const DirList &subDirs() const { return m_subdirs; }
virtual bool isCluster() const { return m_subdirs.size()>0; }
virtual int level() const { return m_level; }
@@ -62,13 +61,13 @@ 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);
virtual void setLevel();
- virtual void addUsesDependency(DirDef *usedDir,FileDef *srcFd,
- FileDef *dstFd,bool inherited);
+ virtual void addUsesDependency(const DirDef *usedDir,const FileDef *srcFd,
+ const FileDef *dstFd,bool inherited);
virtual void computeDependencies();
public:
@@ -84,21 +83,21 @@ 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;
QCString m_dispName;
QCString m_shortName;
QCString m_diskName;
- FileList *m_fileList; // list of files in the group
+ FileList m_fileList; // list of files in the group
int m_dirCount;
int m_level;
DirDef *m_parent;
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)
@@ -132,7 +131,6 @@ DirDefImpl::DirDefImpl(const char *path) : DefinitionMixin(path,1,1,path)
m_dispName = m_dispName.left(m_dispName.length()-1);
}
- m_fileList = new FileList;
m_dirCount = g_dirCount++;
m_level=-1;
m_parent=0;
@@ -140,7 +138,6 @@ DirDefImpl::DirDefImpl(const char *path) : DefinitionMixin(path,1,1,path)
DirDefImpl::~DirDefImpl()
{
- delete m_fileList;
}
bool DirDefImpl::isLinkableInProject() const
@@ -165,25 +162,25 @@ void DirDefImpl::setParent(DirDef *p)
m_parent=p;
}
-void DirDefImpl::addFile(FileDef *fd)
+void DirDefImpl::addFile(const FileDef *fd)
{
- m_fileList->append(fd);
- fd->setDirDef(this);
+ m_fileList.push_back(fd);
+ const_cast<FileDef*>(fd)->setDirDef(this);
}
void DirDefImpl::sort()
{
std::sort(m_subdirs.begin(), m_subdirs.end(), compareDirDefs);
- m_fileList->sort();
+ std::sort(m_fileList.begin(), m_fileList.end(), compareFileDefs);
}
static QCString encodeDirName(const QCString &anchor)
{
// convert to md5 hash
uchar md5_sig[16];
- QCString sigStr(33);
+ char sigStr[33];
MD5Buffer((const unsigned char *)anchor.data(),anchor.length(),md5_sig);
- MD5SigToString(md5_sig,sigStr.rawData(),33);
+ MD5SigToString(md5_sig,sigStr);
return sigStr;
// old algorithm
@@ -212,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);
}
@@ -227,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);
@@ -237,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) &&
@@ -258,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));
}
}
}
@@ -269,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();
@@ -288,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();
}
@@ -309,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();
@@ -326,7 +323,7 @@ void DirDefImpl::writeSubDirList(OutputList &ol)
int numSubdirs = 0;
for(const auto dd : m_subdirs)
{
- if (dd->hasDocumentation() || dd->getFiles()->count()>0)
+ if (dd->hasDocumentation() || !dd->getFiles().empty())
{
numSubdirs++;
}
@@ -341,13 +338,13 @@ void DirDefImpl::writeSubDirList(OutputList &ol)
ol.startMemberList();
for(const auto dd : m_subdirs)
{
- if (dd->hasDocumentation() || dd->getFiles()->count()==0)
+ if (dd->hasDocumentation() || dd->getFiles().empty())
{
ol.startMemberDeclaration();
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))
{
@@ -355,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());
}
}
@@ -373,9 +370,7 @@ void DirDefImpl::writeSubDirList(OutputList &ol)
void DirDefImpl::writeFileList(OutputList &ol)
{
int numFiles = 0;
- QListIterator<FileDef> it(*m_fileList);
- FileDef *fd;
- for (it.toFirst();(fd=it.current());++it)
+ for (const auto &fd : m_fileList)
{
if (fd->hasDocumentation())
{
@@ -390,7 +385,7 @@ void DirDefImpl::writeFileList(OutputList &ol)
ol.parseText(theTranslator->trFile(TRUE,FALSE));
ol.endMemberHeader();
ol.startMemberList();
- for (it.toFirst();(fd=it.current());++it)
+ for (const auto &fd : m_fileList)
{
if (fd->hasDocumentation())
{
@@ -400,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
{
@@ -413,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("]");
@@ -427,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();
@@ -462,16 +457,13 @@ 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;
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::Directory));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ 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())
{
@@ -481,21 +473,16 @@ 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";
}
}
}
break;
case LayoutDocEntry::DirFiles:
{
- if (m_fileList->count()>0)
+ for (const auto &fd : m_fileList)
{
- QListIterator<FileDef> it(*m_fileList);
- FileDef *fd;
- for (;(fd=it.current());++it)
- {
- tagFile << " <file>" << convertToXML(fd->name()) << "</file>" << endl;
- }
+ tagFile << " <file>" << convertToXML(fd->name()) << "</file>\n";
}
}
break;
@@ -504,7 +491,7 @@ void DirDefImpl::writeTagFile(FTextStream &tagFile)
}
}
writeDocAnchorsToTagFile(tagFile);
- tagFile << " </compound>" << endl;
+ tagFile << " </compound>\n";
}
void DirDefImpl::writeDocumentation(OutputList &ol)
@@ -536,10 +523,7 @@ void DirDefImpl::writeDocumentation(OutputList &ol)
//---------------------------------------- start flexible part -------------------------------
SrcLangExt lang = getLanguage();
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::Directory));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Directory))
{
switch (lde->kind())
{
@@ -563,7 +547,7 @@ void DirDefImpl::writeDocumentation(OutputList &ol)
break;
case LayoutDocEntry::DetailedDesc:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeDetailedDescription(ol,ls->title(lang));
}
break;
@@ -577,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:
@@ -593,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:
@@ -641,24 +629,23 @@ void DirDefImpl::setLevel()
/** Add as "uses" dependency between \a this dir and \a dir,
* that was caused by a dependency on file \a fd.
*/
-void DirDefImpl::addUsesDependency(DirDef *dir,FileDef *srcFd,
- FileDef *dstFd,bool inherited)
+void DirDefImpl::addUsesDependency(const DirDef *dir,const FileDef *srcFd,
+ const FileDef *dstFd,bool inherited)
{
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;
UsedDir *usedDir = m_usedDirs.find(dir->getOutputFileBase());
if (usedDir) // dir dependency already present
{
- const FilePair *usedPair = usedDir->findFilePair(
- srcFd->getOutputFileBase()+dstFd->getOutputFileBase());
+ const FilePair *usedPair = usedDir->findFilePair(FilePair::key(srcFd,dstFd));
if (usedPair==0) // new file dependency
{
//printf(" => new file\n");
@@ -697,35 +684,23 @@ void DirDefImpl::addUsesDependency(DirDef *dir,FileDef *srcFd,
*/
void DirDefImpl::computeDependencies()
{
- FileList *fl = m_fileList;
- if (fl)
+ for (const auto &fd : m_fileList)
{
- QListIterator<FileDef> fli(*fl);
- FileDef *fd;
- for (fli.toFirst();(fd=fli.current());++fli) // foreach file in dir dd
+ //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(" File %s\n",fd->name().data());
- //printf("** dir=%s file=%s\n",shortName().data(),fd->name().data());
- QList<IncludeInfo> *ifl = fd->includeFileList();
- if (ifl)
+ //printf(" > %s\n",qPrint(ii->includeName));
+ //printf(" #include %s\n",qPrint(ii->includeName));
+ if (ii.fileDef && ii.fileDef->isLinkable()) // linkable file
{
- QListIterator<IncludeInfo> ifli(*ifl);
- IncludeInfo *ii;
- for (ifli.toFirst();(ii=ifli.current());++ifli) // foreach include file
+ DirDef *usedDir = ii.fileDef->getDirDef();
+ if (usedDir)
{
- //printf(" > %s\n",ii->includeName.data());
- //printf(" #include %s\n",ii->includeName.data());
- if (ii->fileDef && ii->fileDef->isLinkable()) // linkable file
- {
- DirDef *usedDir = ii->fileDef->getDirDef();
- if (usedDir)
- {
- // add dependency: thisDir->usedDir
- //static int count=0;
- //printf(" %d: add dependency %s->%s\n",count++,name().data(),usedDir->name().data());
- addUsesDependency(usedDir,fd,ii->fileDef,FALSE);
- }
- }
+ // add dependency: thisDir->usedDir
+ //static int count=0;
+ //printf(" %d: add dependency %s->%s\n",count++,qPrint(name()),qPrint(usedDir->name()));
+ addUsesDependency(usedDir,fd,ii.fileDef,FALSE);
}
}
}
@@ -756,47 +731,42 @@ bool DirDefImpl::depGraphIsTrivial() const
return m_usedDirs.empty();
}
-//----------------------------------------------------------------------
-
-int FilePairDict::compareValues(const FilePair *left,const FilePair *right) const
-{
- int orderHi = qstricmp(left->source()->name(),right->source()->name());
- if (orderHi!=0) return orderHi;
- int orderLo = qstricmp(left->destination()->name(),right->destination()->name());
- return orderLo;
-}
//----------------------------------------------------------------------
UsedDir::UsedDir(const DirDef *dir,bool inherited) :
- m_dir(dir), m_filePairs(7), m_inherited(inherited)
+ m_dir(dir), m_inherited(inherited)
{
- m_filePairs.setAutoDelete(TRUE);
}
UsedDir::~UsedDir()
{
}
-
-void UsedDir::addFileDep(FileDef *srcFd,FileDef *dstFd)
+void UsedDir::addFileDep(const FileDef *srcFd,const FileDef *dstFd)
{
- m_filePairs.append(srcFd->getOutputFileBase()+dstFd->getOutputFileBase(),
- new FilePair(srcFd,dstFd));
+ m_filePairs.add(FilePair::key(srcFd,dstFd),std::make_unique<FilePair>(srcFd,dstFd));
}
void UsedDir::sort()
{
- m_filePairs.sort();
+ std::sort(m_filePairs.begin(),
+ m_filePairs.end(),
+ [](const auto &left,const auto &right)
+ {
+ int orderHi = qstricmp(left->source()->name(),right->source()->name());
+ if (orderHi!=0) return orderHi<0;
+ int orderLo = qstricmp(left->destination()->name(),right->destination()->name());
+ return orderLo<0;
+ });
}
-FilePair *UsedDir::findFilePair(const char *name)
+FilePair *UsedDir::findFilePair(const QCString &name)
{
- QCString n=name;
- return n.isEmpty() ? 0 : m_filePairs.find(n);
+ 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);
@@ -806,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;
}
@@ -829,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)
@@ -846,6 +816,13 @@ DirDef *DirDefImpl::mergeDirectoryInTree(const QCString &path)
//----------------------------------------------------------------------
+QCString FilePair::key(const FileDef *srcFd,const FileDef *dstFd)
+{
+ return srcFd->getOutputFileBase()+";"+dstFd->getOutputFileBase();
+}
+
+//----------------------------------------------------------------------
+
static void writePartialDirPath(OutputList &ol,const DirDef *root,const DirDef *target)
{
if (target->parent()!=root)
@@ -853,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)
@@ -865,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
{
@@ -882,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());
@@ -909,9 +884,7 @@ void DirRelation::writeDocumentation(OutputList &ol)
ol.writeString("</th>");
ol.writeString("</tr>");
- SDict<FilePair>::Iterator fpi(m_dst->filePairs());
- FilePair *fp;
- for (fpi.toFirst();(fp=fpi.current());++fpi)
+ for (const auto &fp : m_dst->filePairs())
{
ol.writeString("<tr class=\"dirtab\">");
ol.writeString("<td class=\"dirtab\">");
@@ -963,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
@@ -1008,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));
}
}
@@ -1019,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;
@@ -1049,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()));
}
}
}
@@ -1079,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 b3f2a30..3d775d0 100644
--- a/src/dirdef.h
+++ b/src/dirdef.h
@@ -16,22 +16,18 @@
#ifndef DIRDEF_H
#define DIRDEF_H
-#include "linkedmap.h"
-#include "sortdict.h"
-#include "definition.h"
#include <vector>
#include <map>
-#include <qglobal.h>
-#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;
@@ -45,23 +41,20 @@ bool compareDirDefs(const DirDef *item1, const DirDef *item2);
class FilePair
{
public:
- FilePair(FileDef *src,FileDef *dst) : m_src(src), m_dst(dst) {}
+ FilePair(const FileDef *src,const FileDef *dst) : m_src(src), m_dst(dst) {}
const FileDef *source() const { return m_src; }
const FileDef *destination() const { return m_dst; }
+ static QCString key(const FileDef *srcFd,const FileDef *dstFd);
private:
- FileDef *m_src;
- FileDef *m_dst;
+ const FileDef *m_src;
+ const FileDef *m_dst;
};
// ------------------
-/** A sorted dictionary of FilePair objects. */
-class FilePairDict : public SDict<FilePair>
+/** A linked map of file pairs */
+class FilePairLinkedMap : public LinkedMap<FilePair>
{
- public:
- FilePairDict(uint size) : SDict<FilePair>(size) {}
- private:
- int compareValues(const FilePair *item1,const FilePair *item2) const;
};
// ------------------
@@ -72,16 +65,16 @@ class UsedDir
public:
UsedDir(const DirDef *dir,bool inherited);
virtual ~UsedDir();
- void addFileDep(FileDef *srcFd,FileDef *dstFd);
- FilePair *findFilePair(const char *name);
- const FilePairDict &filePairs() const { return m_filePairs; }
+ void addFileDep(const FileDef *srcFd,const FileDef *dstFd);
+ 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; }
void sort();
private:
const DirDef *m_dir;
- FilePairDict m_filePairs;
+ FilePairLinkedMap m_filePairs;
bool m_inherited;
};
@@ -104,8 +97,8 @@ class DirDef : public DefinitionMutable, public Definition
virtual QCString displayName(bool=TRUE) const = 0;
virtual const QCString &shortName() const = 0;
virtual void addSubDir(DirDef *subdir) = 0;
- virtual FileList * getFiles() const = 0;
- virtual void addFile(FileDef *fd) = 0;
+ virtual const FileList &getFiles() const = 0;
+ virtual void addFile(const FileDef *fd) = 0;
virtual const DirList &subDirs() const = 0;
virtual bool isCluster() const = 0;
virtual int level() const = 0;
@@ -119,14 +112,14 @@ 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;
virtual void setParent(DirDef *parent) = 0;
virtual void setLevel() = 0;
- virtual void addUsesDependency(DirDef *usedDir,FileDef *srcFd,
- FileDef *dstFd,bool inherited) = 0;
+ virtual void addUsesDependency(const DirDef *usedDir,const FileDef *srcFd,
+ const FileDef *dstFd,bool inherited) = 0;
virtual void computeDependencies() = 0;
};
@@ -171,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 d9e79cb..ab2fb84 100644
--- a/src/docbookgen.cpp
+++ b/src/docbookgen.cpp
@@ -17,11 +17,6 @@
#include <stdlib.h>
-#include <qdir.h>
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qintdict.h>
-#include <qregexp.h>
#include "docbookgen.h"
#include "doxygen.h"
#include "message.h"
@@ -54,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)
@@ -75,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++))
{
@@ -120,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);
@@ -131,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;
@@ -227,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
{
@@ -244,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.
@@ -271,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)
{
}
@@ -299,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;
@@ -328,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";
@@ -362,7 +367,7 @@ DB_GEN_C
{
fileType="chapter";
}
- t << "</" << fileType << ">" << endl;
+ m_t << "</" << fileType << ">\n";
endPlainFile();
m_codeGen.setSourceFileName("");
}
@@ -375,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"
@@ -395,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"
@@ -408,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;
@@ -451,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() &&
@@ -531,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)
{
@@ -549,192 +578,196 @@ 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";
}
}
}
-void DocbookGenerator::writeDoc(DocNode *n,const Definition *,const MemberDef *,int)
+void DocbookGenerator::writeDoc(DocNode *n,const Definition *ctx,const MemberDef *,int)
{
DB_GEN_C
DocbookDocVisitor *visitor =
- new DocbookDocVisitor(t,*this);
+ 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()
{
@@ -743,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)
{
@@ -766,7 +799,7 @@ DB_GEN_C
if (dense)
{
m_denseText = TRUE;
- t << "<programlisting>";
+ m_t << "<programlisting>";
}
}
void DocbookGenerator::endTextBlock(bool)
@@ -775,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()
{
@@ -842,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()
{
@@ -856,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()
@@ -897,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)
{
@@ -928,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()
@@ -962,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()
@@ -1036,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()
{
@@ -1051,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()
{
@@ -1060,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()
{
@@ -1069,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()
{
@@ -1078,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()
{
@@ -1087,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()
{
@@ -1098,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()
{
@@ -1117,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()
{
@@ -1135,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 d444b7b..2cfa6f0 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++))
{
@@ -84,15 +84,13 @@ static bool supportedHtmlAttribute(const QCString &name)
}
-void DocbookDocVisitor::visitCaption(const QList<DocNode> &children)
+void DocbookDocVisitor::visitCaption(const DocNodeList &children)
{
- QListIterator<DocNode> cli(children);
- DocNode *n;
- for (cli.toFirst();(n=cli.current());++cli) n->accept(this);
+ for (const auto &n : children) n->accept(this);
}
-void DocbookDocVisitor::visitPreStart(FTextStream &t,
- const QList<DocNode> &children,
+void DocbookDocVisitor::visitPreStart(TextStream &t,
+ const DocNodeList &children,
bool hasCaption,
const QCString &name,
const QCString &width,
@@ -101,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())
{
@@ -126,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)
- : DocVisitor(DocVisitor_Docbook), m_t(t), m_ci(ci)
+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";
}
//--------------------------------------
@@ -244,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 *)
@@ -347,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:
@@ -371,40 +370,41 @@ 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:
{
static QCString docbookOutput = Config_getString(DOCBOOK_OUTPUT);
- QCString baseName = PlantumlManager::instance()->writePlantUMLSource(docbookOutput,s->exampleFile(),s->text(),PlantumlManager::PUML_BITMAP);
+ QCString baseName = PlantumlManager::instance().writePlantUMLSource(docbookOutput,s->exampleFile(),s->text(),PlantumlManager::PUML_BITMAP);
QCString shortName = baseName;
int i;
if ((i=shortName.findRev('/'))!=-1)
{
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;
}
@@ -427,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,
@@ -476,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(),
@@ -513,7 +513,7 @@ DB_VIS_C
{
m_t << "<programlisting>";
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide = TRUE;
}
QCString locLangExt = getFileNameExtension(op->includeFileName());
@@ -521,14 +521,14 @@ DB_VIS_C
SrcLangExt langExt = getLanguageFromFileName(locLangExt);
if (op->type()!=DocIncOperator::Skip)
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide)
{
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(),
@@ -543,17 +543,17 @@ DB_VIS_C
);
if (fd) delete fd;
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
if (op->isLast())
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide) m_t << "</programlisting>";
}
else
{
- if (!m_hide) m_t << endl;
+ if (!m_hide) m_t << "\n";
}
}
@@ -562,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)
@@ -578,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 *)
@@ -646,7 +646,7 @@ void DocbookDocVisitor::visitPre(DocPara *)
{
DB_VIS_C
if (m_hide) return;
- m_t << endl;
+ m_t << "\n";
m_t << "<para>";
}
@@ -655,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 *)
@@ -679,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;
}
}
@@ -848,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;
}
}
@@ -915,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 *)
@@ -932,7 +932,30 @@ void DocbookDocVisitor::visitPre(DocHtmlList *s)
DB_VIS_C
if (m_hide) return;
if (s->type()==DocHtmlList::Ordered)
- m_t << "<orderedlist>\n";
+ {
+ m_t << "<orderedlist";
+ for (const auto &opt : s->attribs())
+ {
+ if (opt.name=="type")
+ {
+ if (opt.value=="1")
+ m_t << " numeration=\"arabic\"";
+ else if (opt.value=="a")
+ m_t << " numeration=\"loweralpha\"";
+ else if (opt.value=="A")
+ m_t << " numeration=\"upperalpha\"";
+ else if (opt.value=="i")
+ m_t << " numeration=\"lowerroman\"";
+ else if (opt.value=="I")
+ m_t << " numeration=\"upperroman\"";
+ }
+ else if (opt.name=="start")
+ {
+ m_t << " startingnumber=\"" << opt.value << "\"";
+ }
+ }
+ m_t << ">\n";
+ }
else
m_t << "<itemizedlist>\n";
}
@@ -1008,8 +1031,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=\"" << 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)?
@@ -1021,10 +1044,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)
@@ -1047,14 +1070,12 @@ DB_VIS_C
m_t << " <row ";
- HtmlAttribListIterator li(tr->attribs());
- HtmlAttrib *opt;
- for (li.toFirst();(opt=li.current());++li)
+ for (const auto &opt : tr->attribs())
{
- if (supportedHtmlAttribute(opt->name))
+ if (supportedHtmlAttribute(opt.name))
{
// process supported attributes only
- m_t << " " << opt->name << "='" << convertToDocBook(opt->value) << "'";
+ m_t << " " << opt.name << "='" << convertToDocBook(opt.value) << "'";
}
}
m_t << ">\n";
@@ -1079,35 +1100,33 @@ DB_VIS_C
if (m_hide) return;
m_t << "<entry";
- HtmlAttribListIterator li(c->attribs());
- HtmlAttrib *opt;
- for (li.toFirst();(opt=li.current());++li)
+ for (const auto &opt : c->attribs())
{
- if (opt->name=="colspan")
+ if (opt.name=="colspan")
{
m_t << " namest='c" << m_colCnt << "'";
- int cols = opt->value.toInt();
+ int cols = opt.value.toInt();
m_colCnt += (cols - 1);
m_t << " nameend='c" << m_colCnt << "'";
}
- else if (opt->name=="rowspan")
+ else if (opt.name=="rowspan")
{
- int extraRows = opt->value.toInt() - 1;
+ int extraRows = opt.value.toInt() - 1;
m_t << " morerows='" << extraRows << "'";
}
- else if (opt->name=="class")
+ else if (opt.name=="class")
{
- if (opt->value.left(13)=="markdownTable") // handle markdown generated attributes
+ if (opt.value.left(13)=="markdownTable") // handle markdown generated attributes
{
- if (opt->value.right(5)=="Right")
+ if (opt.value.right(5)=="Right")
{
m_t << " align='right'";
}
- else if (opt->value.right(4)=="Left")
+ else if (opt.value.right(4)=="Left")
{
m_t << " align='left'";
}
- else if (opt->value.right(6)=="Center")
+ else if (opt.value.right(6)=="Center")
{
m_t << " align='center'";
}
@@ -1115,13 +1134,13 @@ DB_VIS_C
}
else
{
- m_t << " class='" << convertToDocBook(opt->value) << "'";
+ m_t << " class='" << convertToDocBook(opt.value) << "'";
}
}
- else if (supportedHtmlAttribute(opt->name))
+ else if (supportedHtmlAttribute(opt.name))
{
// process supported attributes only
- m_t << " " << opt->name << "='" << convertToDocBook(opt->value) << "'";
+ m_t << " " << opt.name << "='" << convertToDocBook(opt.value) << "'";
}
}
m_t << ">";
@@ -1196,7 +1215,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)
@@ -1207,7 +1226,7 @@ DB_VIS_C
}
else
{
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
}
@@ -1233,23 +1252,11 @@ 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
{
- popEnabled();
+ m_hide = popHidden();
}
}
@@ -1314,7 +1321,7 @@ DB_VIS_C
if (m_hide) return;
if (ref->isSubPage())
{
- startLink(0,ref->anchor());
+ startLink(QCString(),ref->anchor());
}
else
{
@@ -1343,30 +1350,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;
@@ -1376,9 +1383,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)
{
@@ -1387,24 +1394,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 << " ";
}
@@ -1412,7 +1419,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)
@@ -1443,39 +1450,35 @@ DB_VIS_C
if (sect && sect->hasTypeSpecifier())
{
- QListIterator<DocNode> li(pl->paramTypes());
- DocNode *type;
m_t << " <entry>";
- for (li.toFirst();(type=li.current());++li)
+ for (const auto &type : pl->paramTypes())
{
if (type->kind()==DocNode::Kind_Word)
{
- visit((DocWord*)type);
+ visit((DocWord*)type.get());
}
else if (type->kind()==DocNode::Kind_LinkedWord)
{
- visit((DocLinkedWord*)type);
+ visit((DocLinkedWord*)type.get());
}
else if (type->kind()==DocNode::Kind_Sep)
{
- m_t << " " << ((DocSeparator *)type)->chars() << " ";
+ m_t << " " << ((DocSeparator *)type.get())->chars() << " ";
}
}
m_t << " </entry>";
}
- QListIterator<DocNode> li(pl->parameters());
- DocNode *param;
- if (!li.toFirst())
+ if (pl->parameters().empty())
{
- m_t << " <entry></entry>" << endl;
+ m_t << " <entry></entry>\n";
}
else
{
m_t << " <entry>";
int cnt = 0;
- for (li.toFirst();(param=li.current());++li)
+ for (const auto &param : pl->parameters())
{
if (cnt)
{
@@ -1483,15 +1486,15 @@ DB_VIS_C
}
if (param->kind()==DocNode::Kind_Word)
{
- visit((DocWord*)param);
+ visit((DocWord*)param.get());
}
else if (param->kind()==DocNode::Kind_LinkedWord)
{
- visit((DocLinkedWord*)param);
+ visit((DocLinkedWord*)param.get());
}
cnt++;
}
- m_t << "</entry>" << endl;
+ m_t << "</entry>\n";
}
m_t << " <entry>";
}
@@ -1500,8 +1503,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)
@@ -1592,7 +1595,7 @@ DB_VIS_C
}
-void DocbookDocVisitor::filter(const char *str)
+void DocbookDocVisitor::filter(const QCString &str)
{
DB_VIS_C
m_t << convertToDocBook(str);
@@ -1604,7 +1607,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 << "\">";
@@ -1616,19 +1619,6 @@ DB_VIS_C
m_t << "</link>";
}
-void DocbookDocVisitor::pushEnabled()
-{
-DB_VIS_C
- m_enabled.push(m_hide);
-}
-
-void DocbookDocVisitor::popEnabled()
-{
-DB_VIS_C
- m_hide=m_enabled.top();
- m_enabled.pop();
-}
-
void DocbookDocVisitor::writeMscFile(const QCString &baseName, DocVerbatim *s)
{
DB_VIS_C
@@ -1655,7 +1645,7 @@ DB_VIS_C
shortName=shortName.right((int)shortName.length()-i-1);
}
QCString outDir = Config_getString(DOCBOOK_OUTPUT);
- PlantumlManager::instance()->generatePlantUMLOutput(baseName,outDir,PlantumlManager::PUML_BITMAP);
+ PlantumlManager::instance().generatePlantUMLOutput(baseName,outDir,PlantumlManager::PUML_BITMAP);
visitPreStart(m_t, s->children(), s->hasCaption(), s->relPath() + shortName + ".png", s->width(),s->height());
visitCaption(s->children());
visitPostEnd(m_t, s->hasCaption());
@@ -1665,7 +1655,7 @@ void DocbookDocVisitor::startMscFile(const QCString &fileName,
const QCString &width,
const QCString &height,
bool hasCaption,
- const QList<DocNode> &children
+ const DocNodeList &children
)
{
DB_VIS_C
@@ -1682,7 +1672,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);
}
@@ -1691,7 +1681,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)
@@ -1714,7 +1704,7 @@ void DocbookDocVisitor::startDiaFile(const QCString &fileName,
const QCString &width,
const QCString &height,
bool hasCaption,
- const QList<DocNode> &children
+ const DocNodeList &children
)
{
DB_VIS_C
@@ -1731,7 +1721,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);
}
@@ -1740,7 +1730,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)
@@ -1763,7 +1753,7 @@ void DocbookDocVisitor::startDotFile(const QCString &fileName,
const QCString &width,
const QCString &height,
bool hasCaption,
- const QList<DocNode> &children
+ const DocNodeList &children
)
{
DB_VIS_C
@@ -1781,7 +1771,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);
}
@@ -1789,8 +1779,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 ee07df5..5580de0 100644
--- a/src/docbookvisitor.h
+++ b/src/docbookvisitor.h
@@ -16,22 +16,22 @@
#ifndef _DOCBOOKDOCVISITOR_H
#define _DOCBOOKDOCVISITOR_H
+#include <iostream>
+
#include "containers.h"
#include "docvisitor.h"
-#include <qstack.h>
-#include <qlist.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);
+ DocbookDocVisitor(TextStream &t,CodeOutputInterface &ci,const QCString &langExt);
~DocbookDocVisitor();
//--------------------------------------
// visitor functions for leaf nodes
@@ -139,38 +139,36 @@ 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();
- void pushEnabled();
- void popEnabled();
void startMscFile(const QCString &fileName,const QCString &width,
- const QCString &height, bool hasCaption,const QList<DocNode> &children);
+ const QCString &height, bool hasCaption,const DocNodeList &children);
void endMscFile(bool hasCaption);
void writeMscFile(const QCString &fileName, DocVerbatim *s);
void startDiaFile(const QCString &fileName,const QCString &width,
- const QCString &height, bool hasCaption,const QList<DocNode> &children);
+ const QCString &height, bool hasCaption,const DocNodeList &children);
void endDiaFile(bool hasCaption);
void writeDiaFile(const QCString &fileName, DocVerbatim *s);
void startDotFile(const QCString &fileName,const QCString &width,
- const QCString &height, bool hasCaption,const QList<DocNode> &children);
+ const QCString &height, bool hasCaption,const DocNodeList &children);
void endDotFile(bool hasCaption);
void writeDotFile(const QCString &fileName, DocVerbatim *s);
void writePlantUMLFile(const QCString &fileName, DocVerbatim *s);
- void visitPreStart(FTextStream &t,
- const QList<DocNode> &children,
+ 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 visitCaption(const QList<DocNode> &children);
+ 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 c724348..de22098 100644
--- a/src/docgroup.h
+++ b/src/docgroup.h
@@ -3,8 +3,8 @@
* Copyright (C) 1997-2019 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 @@
#define DOCGROUP_H
#include <vector>
-#include <qstring.h>
#include "membergroup.h"
class Entry;
@@ -28,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 33faf54..6e2a6d8 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -1,9 +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
@@ -18,16 +15,12 @@
#include <stdio.h>
#include <stdlib.h>
+#include <cassert>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qcstring.h>
-#include <qstack.h>
-#include <qdict.h>
-#include <qregexp.h>
#include <ctype.h>
-#include <qcstringlist.h>
+#include "qcstring.h"
+#include "regex.h"
#include "doxygen.h"
#include "debug.h"
#include "util.h"
@@ -56,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)
@@ -86,23 +81,29 @@ static const char *sectionLevelToName[] =
//---------------------------------------------------------------------------
+//---------------------------------------------------------------------------
+
+using DefinitionStack = std::vector<const Definition *>;
+using DocNodeStack = std::stack<const DocNode *>;
+using DocStyleChangeStack = std::stack<const DocStyleChange *>;
+
// Parser state: global variables during a call to validatingParseDoc
static const Definition * g_scope;
static QCString g_context;
static bool g_inSeeBlock;
static bool g_xmlComment;
static bool g_insideHtmlLink;
-static QStack<DocNode> g_nodeStack;
-static QStack<DocStyleChange> g_styleStack;
-static QStack<DocStyleChange> g_initialStyleStack;
-static QList<Definition> g_copyStack;
+static DocNodeStack g_nodeStack;
+static DocStyleChangeStack g_styleStack;
+static DocStyleChangeStack g_initialStyleStack;
+static DefinitionStack g_copyStack;
static QCString g_fileName;
static QCString g_relPath;
static bool g_hasParamCommand;
static bool g_hasReturnCommand;
-static QDict<void> g_retvalsFound;
-static QDict<void> g_paramsFound;
+static StringSet g_retvalsFound;
+static StringSet g_paramsFound;
static const MemberDef * g_memberDef;
static bool g_isExample;
static QCString g_exampleName;
@@ -126,10 +127,10 @@ struct DocParserContext
bool inSeeBlock;
bool xmlComment;
bool insideHtmlLink;
- QStack<DocNode> nodeStack;
- QStack<DocStyleChange> styleStack;
- QStack<DocStyleChange> initialStyleStack;
- QList<Definition> copyStack;
+ DocNodeStack nodeStack;
+ DocStyleChangeStack styleStack;
+ DocStyleChangeStack initialStyleStack;
+ DefinitionStack copyStack;
QCString fileName;
int lineNo;
QCString relPath;
@@ -137,8 +138,8 @@ struct DocParserContext
bool hasParamCommand;
bool hasReturnCommand;
const MemberDef * memberDef;
- QDict<void> retvalsFound;
- QDict<void> paramsFound;
+ StringSet retvalsFound;
+ StringSet paramsFound;
bool isExample;
QCString exampleName;
QCString searchUrl;
@@ -152,20 +153,41 @@ struct DocParserContext
TokenInfo *token;
};
-static QStack<DocParserContext> g_parserStack;
+static std::stack< std::unique_ptr<DocParserContext> > g_parserStack;
+
+//---------------------------------------------------------------------------
+
+class AutoNodeStack
+{
+ public:
+ AutoNodeStack(const DocNode* node) : m_node(node) { g_nodeStack.push(node); }
+ ~AutoNodeStack() {
+#if defined(NDEBUG)
+ (void)m_node;
+ if (!g_nodeStack.empty()) g_nodeStack.pop(); // robust version that does not assert
+#else
+ assert(g_nodeStack.top()==m_node); g_nodeStack.pop(); // error checking version
+#endif
+ }
+
+ private:
+ const DocNode *m_node;
+};
//---------------------------------------------------------------------------
-static void handleImg(DocNode *parent,QList<DocNode> &children,const HtmlAttribList &tagHtmlAttribs);
+static void handleImg(DocNode *parent,DocNodeList &children,const HtmlAttribList &tagHtmlAttribs);
//---------------------------------------------------------------------------
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();
- DocParserContext *ctx = new DocParserContext;
+
+ g_parserStack.push(std::make_unique<DocParserContext>());
+ auto &ctx = g_parserStack.top();
ctx->scope = g_scope;
ctx->context = g_context;
ctx->inSeeBlock = g_inSeeBlock;
@@ -200,13 +222,11 @@ static void docParserPushContext(bool saveParamInfo=TRUE)
ctx->token = g_token;
g_token = new TokenInfo;
-
- g_parserStack.push(ctx);
}
static void docParserPopContext(bool keepParamInfo=FALSE)
{
- DocParserContext *ctx = g_parserStack.pop();
+ auto &ctx = g_parserStack.top();
g_scope = ctx->scope;
g_context = ctx->context;
g_inSeeBlock = ctx->inSeeBlock;
@@ -241,12 +261,12 @@ static void docParserPopContext(bool keepParamInfo=FALSE)
delete g_token;
g_token = ctx->token;
- delete ctx;
+ g_parserStack.pop();
doctokenizerYYpopContext();
//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());
}
//---------------------------------------------------------------------------
@@ -255,21 +275,21 @@ static void docParserPopContext(bool keepParamInfo=FALSE)
// replaces &gt; with < and &gt; with > within string s
static void unescapeCRef(QCString &s)
{
- QCString tmp(s);
- char *p = tmp.rawData();
+ QCString result;
+ const char *p = s.data();
if (p)
{
char c;
- while ((c=*p))
+ while ((c=*p++))
{
if (c=='{') c='<'; else if (c=='}') c='>';
- *p++=c;
+ result+=c;
}
}
- tmp=substitute(tmp,"&lt;","<");
- tmp=substitute(tmp,"&gt;",">");
- s = tmp;
+ result=substitute(result,"&lt;","<");
+ result=substitute(result,"&gt;",">");
+ s = result;
}
//---------------------------------------------------------------------------
@@ -278,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;
@@ -292,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;
@@ -305,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)
{
@@ -327,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
{
@@ -373,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)
{
@@ -404,7 +408,7 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type, bool
* member g_memberDef, then a warning is raised (unless warnings
* are disabled altogether).
*/
-static void checkArgumentName(const QCString &name)
+static void checkArgumentName(const std::string &name)
{
if (!Config_getBool(WARN_IF_DOC_ERROR)) return;
if (g_memberDef==0) return; // not a member
@@ -415,24 +419,26 @@ static void checkArgumentName(const QCString &name)
//printf("isDocsForDefinition()=%d\n",g_memberDef->isDocsForDefinition());
if (al.empty()) return; // no argument list
- static QRegExp re("$?[a-zA-Z0-9_\\x80-\\xFF]+\\.*");
- int p=0,i=0,l;
- while ((i=re.match(name,p,&l))!=-1) // to handle @param x,y
+ static const reg::Ex re(R"(\$?\w+\.*)");
+ reg::Iterator it(name,re);
+ reg::Iterator end;
+ for (; it!=end ; ++it)
{
- QCString aName=name.mid(i,l);
+ 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)
{
- g_paramsFound.insert(aName,(void *)(0x8));
+ g_paramsFound.insert(aName.str());
found=TRUE;
break;
}
@@ -445,7 +451,7 @@ static void checkArgumentName(const QCString &name)
QCString inheritedFrom = "";
QCString docFile = g_memberDef->docFile();
int docLine = g_memberDef->docLine();
- MemberDef *inheritedMd = g_memberDef->inheritsDocsFrom();
+ const MemberDef *inheritedMd = g_memberDef->inheritsDocsFrom();
if (inheritedMd) // documentation was inherited
{
inheritedFrom.sprintf(" inherited from member %s at line "
@@ -461,7 +467,6 @@ static void checkArgumentName(const QCString &name)
qPrint(aName), qPrint(scope), qPrint(g_memberDef->name()),
qPrint(alStr), qPrint(inheritedFrom));
}
- p=i+l;
}
}
/*! Collects the return values found with \@retval command
@@ -471,16 +476,16 @@ static void checkRetvalName(const QCString &name)
{
if (!Config_getBool(WARN_IF_DOC_ERROR)) return;
if (g_memberDef==0 || name.isEmpty()) return; // not a member or no valid name
- if (g_retvalsFound.find(name))
+ if (g_retvalsFound.find(name.str())!=g_retvalsFound.end())
{
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,(void *)(0x8));
+ g_retvalsFound.insert(name.str());
}
/*! Checks if the parameters that have been specified using \@param are
@@ -491,7 +496,7 @@ static void checkRetvalName(const QCString &name)
*/
static void checkUnOrMultipleDocumentedParams()
{
- if (g_memberDef && g_hasParamCommand && Config_getBool(WARN_IF_DOC_ERROR))
+ if (g_memberDef && g_hasParamCommand)
{
const ArgumentList &al=g_memberDef->isDocsForDefinition() ?
g_memberDef->argumentList() :
@@ -512,31 +517,29 @@ static void checkUnOrMultipleDocumentedParams()
{
// allow undocumented self / cls parameter for Python
}
- else if (!argName.isEmpty() && g_paramsFound.find(argName)==0 && a.docs.isEmpty())
+ else if (!argName.isEmpty() && g_paramsFound.find(argName.str())==g_paramsFound.end() && a.docs.isEmpty())
{
notArgCnt++;
}
else
{
- QDictIterator<void> it1(g_paramsFound);
- void *item1;
- for (;(item1=it1.current());++it1)
+ for (const auto &par : g_paramsFound)
{
- if (argName == it1.currentKey()) count++;
+ if (argName == QCString(par)) count++;
}
}
- if (count > 1)
+ if ((count > 1) && Config_getBool(WARN_IF_DOC_ERROR))
{
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)
+ if ((notArgCnt>0) && Config_getBool(WARN_IF_INCOMPLETE_DOC))
{
bool first=TRUE;
QCString errMsg=
@@ -555,7 +558,7 @@ static void checkUnOrMultipleDocumentedParams()
{
// allow undocumented self / cls parameter for Python
}
- else if (!argName.isEmpty() && g_paramsFound.find(argName)==0)
+ else if (!argName.isEmpty() && g_paramsFound.find(argName.str())==g_paramsFound.end())
{
if (!first)
{
@@ -568,10 +571,10 @@ static void checkUnOrMultipleDocumentedParams()
errMsg+=" parameter '"+argName+"'";
}
}
- warn_doc_error(g_memberDef->getDefFileName(),
- g_memberDef->getDefLine(),
- "%s",
- substitute(errMsg,"%","%%").data());
+ warn_incomplete_doc(g_memberDef->getDefFileName(),
+ g_memberDef->getDefLine(),
+ "%s",
+ qPrint(substitute(errMsg,"%","%%")));
}
}
}
@@ -580,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")
@@ -670,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="";
@@ -745,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();
@@ -767,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);
@@ -803,26 +806,27 @@ static bool findDocsForMemberOrCompound(const char *commandName,
//---------------------------------------------------------------------------
inline void errorHandleDefaultToken(DocNode *parent,int tok,
- QList<DocNode> &children,const char *txt)
+ DocNodeList &children,const QCString &txt)
{
const char *cmd_start = "\\";
switch (tok)
{
case TK_COMMAND_AT:
cmd_start = "@";
+ // fall through
case TK_COMMAND_BS:
- children.append(new DocWord(parent,TK_COMMAND_CHAR(tok) + g_token->name));
+ 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.append(new DocWord(parent,g_token->name));
+ 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;
}
}
@@ -830,10 +834,10 @@ inline void errorHandleDefaultToken(DocNode *parent,int tok,
//---------------------------------------------------------------------------
// forward declaration
static bool defaultHandleToken(DocNode *parent,int tok,
- QList<DocNode> &children,bool
+ DocNodeList &children,bool
handleWord=TRUE);
-static int handleStyleArgument(DocNode *parent,QList<DocNode> &children,
+static int handleStyleArgument(DocNode *parent,DocNodeList &children,
const QCString &cmdName)
{
DBG(("handleStyleArgument(%s)\n",qPrint(cmdName)));
@@ -852,9 +856,9 @@ static int handleStyleArgument(DocNode *parent,QList<DocNode> &children,
tok!=TK_ENDLIST
)
{
- static QRegExp specialChar("[.,|()\\[\\]:;\\?]");
+ static const reg::Ex specialChar(R"([.,|()\[\]:;?])");
if (tok==TK_WORD && g_token->name.length()==1 &&
- g_token->name.find(specialChar)!=-1)
+ reg::match(g_token->name.str(),specialChar))
{
// special character that ends the markup command
return tok;
@@ -885,30 +889,30 @@ static int handleStyleArgument(DocNode *parent,QList<DocNode> &children,
/*! Called when a style change starts. For instance a \<b\> command is
* encountered.
*/
-static void handleStyleEnter(DocNode *parent,QList<DocNode> &children,
+static void handleStyleEnter(DocNode *parent,DocNodeList &children,
DocStyleChange::Style s,const QCString &tagName,const HtmlAttribList *attribs)
{
DBG(("HandleStyleEnter\n"));
- DocStyleChange *sc= new DocStyleChange(parent,g_nodeStack.count(),s,tagName,TRUE,attribs);
- children.append(sc);
+ DocStyleChange *sc= new DocStyleChange(parent,(uint)g_nodeStack.size(),s,tagName,TRUE,attribs);
+ children.push_back(std::unique_ptr<DocStyleChange>(sc));
g_styleStack.push(sc);
}
/*! Called when a style change ends. For instance a \</b\> command is
* encountered.
*/
-static void handleStyleLeave(DocNode *parent,QList<DocNode> &children,
- DocStyleChange::Style s,const char *tagName)
+static void handleStyleLeave(DocNode *parent,DocNodeList &children,
+ DocStyleChange::Style s,const QCString &tagName)
{
DBG(("HandleStyleLeave\n"));
QCString tagNameLower = QCString(tagName).lower();
- if (g_styleStack.isEmpty() || // no style change
- g_styleStack.top()->style()!=s || // wrong style change
- g_styleStack.top()->tagName()!=tagNameLower || // wrong style change
- g_styleStack.top()->position()!=g_nodeStack.count() // wrong position
+ if (g_styleStack.empty() || // no style change
+ g_styleStack.top()->style()!=s || // wrong style change
+ g_styleStack.top()->tagName()!=tagNameLower || // wrong style change
+ g_styleStack.top()->position()!=g_nodeStack.size() // wrong position
)
{
- if (g_styleStack.isEmpty())
+ if (g_styleStack.empty())
{
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"found </%s> tag without matching <%s>",
qPrint(tagName),qPrint(tagName));
@@ -925,14 +929,15 @@ static void handleStyleLeave(DocNode *parent,QList<DocNode> &children,
}
else
{
- warn_doc_error(g_fileName,getDoctokinizerLineNr(),"found </%s> at different nesting level (%d) than expected (%d)",
- qPrint(tagName),g_nodeStack.count(),g_styleStack.top()->position());
+ warn_doc_error(g_fileName,getDoctokinizerLineNr(),"found </%s> at different nesting level (%zu) than expected (%d)",
+ qPrint(tagName),g_nodeStack.size(),g_styleStack.top()->position());
}
}
else // end the section
{
- DocStyleChange *sc= new DocStyleChange(parent,g_nodeStack.count(),s,g_styleStack.top()->tagName(),FALSE);
- children.append(sc);
+ children.push_back(
+ std::make_unique<DocStyleChange>(
+ parent,(uint)g_nodeStack.size(),s,g_styleStack.top()->tagName(),FALSE));
g_styleStack.pop();
}
}
@@ -941,49 +946,42 @@ static void handleStyleLeave(DocNode *parent,QList<DocNode> &children,
* (e.g. a <b> without a </b>). The closed styles are pushed onto a stack
* and entered again at the start of a new paragraph.
*/
-static void handlePendingStyleCommands(DocNode *parent,QList<DocNode> &children)
+static void handlePendingStyleCommands(DocNode *parent,DocNodeList &children)
{
- if (!g_styleStack.isEmpty())
+ if (!g_styleStack.empty())
{
- DocStyleChange *sc = g_styleStack.top();
- while (sc && sc->position()>=g_nodeStack.count())
+ const DocStyleChange *sc = g_styleStack.top();
+ while (sc && sc->position()>=g_nodeStack.size())
{ // there are unclosed style modifiers in the paragraph
- children.append(new DocStyleChange(parent,g_nodeStack.count(),sc->style(),sc->tagName(),FALSE));
+ children.push_back(std::make_unique<DocStyleChange>(parent,(uint)g_nodeStack.size(),sc->style(),sc->tagName(),FALSE));
g_initialStyleStack.push(sc);
g_styleStack.pop();
- sc = g_styleStack.top();
+ sc = !g_styleStack.empty() ? g_styleStack.top() : 0;
}
}
}
-static void handleInitialStyleCommands(DocPara *parent,QList<DocNode> &children)
+static void handleInitialStyleCommands(DocPara *parent,DocNodeList &children)
{
- DocStyleChange *sc;
- while ((sc=g_initialStyleStack.pop()))
+ while (!g_initialStyleStack.empty())
{
+ const DocStyleChange *sc = g_initialStyleStack.top();
handleStyleEnter(parent,children,sc->style(),sc->tagName(),&sc->attribs());
+ g_initialStyleStack.pop();
}
}
-static int handleAHref(DocNode *parent,QList<DocNode> &children,const HtmlAttribList &tagHtmlAttribs)
+static int handleAHref(DocNode *parent,DocNodeList &children,const HtmlAttribList &tagHtmlAttribs)
{
- HtmlAttribListIterator li(tagHtmlAttribs);
- HtmlAttrib *opt;
uint index=0;
int retval = RetVal_OK;
- for (li.toFirst();(opt=li.current());++li,++index)
+ for (const auto &opt : tagHtmlAttribs)
{
- if (opt->name=="name" || opt->name=="id") // <a name=label> or <a id=label> tag
+ if (opt.name=="name" || opt.name=="id") // <a name=label> or <a id=label> tag
{
- if (!opt->value.isEmpty())
+ if (!opt.value.isEmpty())
{
- // copy attributes
- HtmlAttribList attrList = tagHtmlAttribs;
- // and remove the href attribute
- bool result = attrList.remove(index);
- ASSERT(result);
- DocAnchor *anc = new DocAnchor(parent,opt->value,TRUE);
- children.append(anc);
+ children.push_back(std::make_unique<DocAnchor>(parent,opt.value,TRUE));
break; // stop looking for other tag attribs
}
else
@@ -991,15 +989,14 @@ static int handleAHref(DocNode *parent,QList<DocNode> &children,const HtmlAttrib
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"found <a> tag with name option but without value!");
}
}
- else if (opt->name=="href") // <a href=url>..</a> tag
+ else if (opt.name=="href") // <a href=url>..</a> tag
{
// copy attributes
HtmlAttribList attrList = tagHtmlAttribs;
// and remove the href attribute
- bool result = attrList.remove(index);
- ASSERT(result);
- DocHRef *href = new DocHRef(parent,attrList,opt->value,g_relPath);
- children.append(href);
+ attrList.erase(attrList.begin()+index);
+ DocHRef *href = new DocHRef(parent,attrList,opt.value,g_relPath);
+ children.push_back(std::unique_ptr<DocHRef>(href));
g_insideHtmlLink=TRUE;
retval = href->parse();
g_insideHtmlLink=FALSE;
@@ -1008,6 +1005,7 @@ static int handleAHref(DocNode *parent,QList<DocNode> &children,const HtmlAttrib
else // unsupported option for tag a
{
}
+ ++index;
}
return retval;
}
@@ -1037,9 +1035,9 @@ const char *DocStyleChange::styleString() const
static void handleUnclosedStyleCommands()
{
- if (!g_initialStyleStack.isEmpty())
+ if (!g_initialStyleStack.empty())
{
- DocStyleChange *sc = g_initialStyleStack.top();
+ const DocStyleChange *sc = g_initialStyleStack.top();
g_initialStyleStack.pop();
handleUnclosedStyleCommands();
warn_doc_error(g_fileName,getDoctokinizerLineNr(),
@@ -1048,13 +1046,13 @@ static void handleUnclosedStyleCommands()
}
}
-static void handleLinkedWord(DocNode *parent,QList<DocNode> &children,bool ignoreAutoLinkFlag=FALSE)
+static void handleLinkedWord(DocNode *parent,DocNodeList &children,bool ignoreAutoLinkFlag=FALSE)
{
QCString name = linkToText(SrcLangExt_Unknown,g_token->name,TRUE);
static bool autolinkSupport = Config_getBool(AUTOLINK_SUPPORT);
if (!autolinkSupport && !ignoreAutoLinkFlag) // no autolinking -> add as normal word
{
- children.append(new DocWord(parent,name));
+ children.push_back(std::make_unique<DocWord>(parent,name));
return;
}
@@ -1066,7 +1064,7 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children,bool ignor
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
@@ -1082,14 +1080,13 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children,bool ignor
bool localLink = g_memberDef ? member->getClassDef()==g_memberDef->getClassDef() : FALSE;
name = member->objCMethodName(localLink,g_inSeeBlock);
}
- children.append(new
- DocLinkedWord(parent,name,
+ children.push_back(
+ std::make_unique<DocLinkedWord>(
+ parent,name,
member->getReference(),
member->getOutputFileBase(),
member->anchor(),
- member->briefDescriptionAsTooltip()
- )
- );
+ member->briefDescriptionAsTooltip()));
}
else if (compound->isLinkable()) // compound link
{
@@ -1100,33 +1097,31 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children,bool ignor
}
else if (compound->definitionType()==Definition::TypeGroup)
{
- name=(toGroupDef(compound))->groupTitle();
+ name=toGroupDef(compound)->groupTitle();
}
- children.append(new
- DocLinkedWord(parent,name,
- compound->getReference(),
- compound->getOutputFileBase(),
- anchor,
- compound->briefDescriptionAsTooltip()
- )
- );
+ children.push_back(
+ std::make_unique<DocLinkedWord>(
+ parent,name,
+ compound->getReference(),
+ compound->getOutputFileBase(),
+ anchor,
+ compound->briefDescriptionAsTooltip()));
}
else if (compound->definitionType()==Definition::TypeFile &&
(toFileDef(compound))->generateSourceFile()
) // undocumented file that has source code we can link to
{
- children.append(new
- DocLinkedWord(parent,g_token->name,
- compound->getReference(),
- compound->getSourceFileBase(),
- "",
- compound->briefDescriptionAsTooltip()
- )
- );
+ children.push_back(
+ std::make_unique<DocLinkedWord>(
+ parent,g_token->name,
+ compound->getReference(),
+ compound->getSourceFileBase(),
+ "",
+ compound->briefDescriptionAsTooltip()));
}
else // not linkable
{
- children.append(new DocWord(parent,name));
+ children.push_back(std::make_unique<DocWord>(parent,name));
}
}
else if (!g_insideHtmlLink && len>1 && g_token->name.at(len-1)==':')
@@ -1135,47 +1130,35 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children,bool ignor
// but Foo itself might be linkable.
g_token->name=g_token->name.left(len-1);
handleLinkedWord(parent,children,ignoreAutoLinkFlag);
- children.append(new DocWord(parent,":"));
+ children.push_back(std::make_unique<DocWord>(parent,":"));
}
else if (!g_insideHtmlLink && (cd=getClass(g_token->name+"-p")))
{
// special case 2, where the token name is not a class, but could
// be a Obj-C protocol
- children.append(new
- DocLinkedWord(parent,name,
+ children.push_back(
+ std::make_unique<DocLinkedWord>(
+ parent,name,
cd->getReference(),
cd->getOutputFileBase(),
cd->anchor(),
- cd->briefDescriptionAsTooltip()
- ));
+ cd->briefDescriptionAsTooltip()));
}
-// else if (!g_insideHtmlLink && (cd=getClass(g_token->name+"-g")))
-// {
-// // special case 3, where the token name is not a class, but could
-// // be a C# generic
-// children.append(new
-// DocLinkedWord(parent,name,
-// cd->getReference(),
-// cd->getOutputFileBase(),
-// cd->anchor(),
-// cd->briefDescriptionAsTooltip()
-// ));
-// }
else // normal non-linkable word
{
if (g_token->name.left(1)=="#" || g_token->name.left(2)=="::")
{
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"explicit link request to '%s' could not be resolved",qPrint(name));
- children.append(new DocWord(parent,g_token->name));
+ children.push_back(std::make_unique<DocWord>(parent,g_token->name));
}
else
{
- children.append(new DocWord(parent,name));
+ children.push_back(std::make_unique<DocWord>(parent,name));
}
}
}
-static void handleParameterType(DocNode *parent,QList<DocNode> &children,const QCString &paramTypes)
+static void handleParameterType(DocNode *parent,DocNodeList &children,const QCString &paramTypes)
{
QCString name = g_token->name; // save token name
QCString name1;
@@ -1186,15 +1169,15 @@ static void handleParameterType(DocNode *parent,QList<DocNode> &children,const Q
ii=name1.find('[');
g_token->name=ii!=-1 ? name1.mid(0,ii) : name1; // take part without []
handleLinkedWord(parent,children);
- if (ii!=-1) children.append(new DocWord(parent,name1.mid(ii))); // add [] part
+ if (ii!=-1) children.push_back(std::make_unique<DocWord>(parent,name1.mid(ii))); // add [] part
p=i+1;
- children.append(new DocSeparator(parent,"|"));
+ children.push_back(std::make_unique<DocSeparator>(parent,"|"));
}
name1 = paramTypes.mid(p);
ii=name1.find('[');
g_token->name=ii!=-1 ? name1.mid(0,ii) : name1;
handleLinkedWord(parent,children);
- if (ii!=-1) children.append(new DocWord(parent,name1.mid(ii)));
+ if (ii!=-1) children.push_back(std::make_unique<DocWord>(parent,name1.mid(ii)));
g_token->name = name; // restore original token name
}
@@ -1257,9 +1240,9 @@ static DocAnchor *handleAnchor(DocNode *parent)
* @param[out] width the extracted width specifier
* @param[out] height the extracted height specifier
*/
-static void defaultHandleTitleAndSize(const int cmd, DocNode *parent, QList<DocNode> &children, QCString &width,QCString &height)
+static void defaultHandleTitleAndSize(const int cmd, DocNode *parent, DocNodeList &children, QCString &width,QCString &height)
{
- g_nodeStack.push(parent);
+ auto ns = AutoNodeStack(parent);
// parse title
doctokenizerYYsetStateTitle();
@@ -1273,7 +1256,7 @@ static void defaultHandleTitleAndSize(const int cmd, DocNode *parent, QList<DocN
}
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, QList<DocN
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;
}
}
@@ -1312,8 +1295,6 @@ static void defaultHandleTitleAndSize(const int cmd, DocNode *parent, QList<DocN
doctokenizerYYsetStatePara();
handlePendingStyleCommands(parent,children);
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==parent);
}
/* Helper function that deals with the most common tokens allowed in
@@ -1327,7 +1308,7 @@ static void defaultHandleTitleAndSize(const int cmd, DocNode *parent, QList<DocN
* @retval TRUE The token was handled.
* @retval FALSE The token was not handled.
*/
-static bool defaultHandleToken(DocNode *parent,int tok, QList<DocNode> &children,bool
+static bool defaultHandleToken(DocNode *parent,int tok, DocNodeList &children,bool
handleWord)
{
DBG(("token %s at %d",tokToString(tok),getDoctokinizerLineNr()));
@@ -1348,62 +1329,62 @@ reparsetoken:
switch (Mappers::cmdMapper->map(tokenName))
{
case CMD_BSLASH:
- children.append(new DocSymbol(parent,DocSymbol::Sym_BSlash));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_BSlash));
break;
case CMD_AT:
- children.append(new DocSymbol(parent,DocSymbol::Sym_At));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_At));
break;
case CMD_LESS:
- children.append(new DocSymbol(parent,DocSymbol::Sym_Less));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_Less));
break;
case CMD_GREATER:
- children.append(new DocSymbol(parent,DocSymbol::Sym_Greater));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_Greater));
break;
case CMD_AMP:
- children.append(new DocSymbol(parent,DocSymbol::Sym_Amp));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_Amp));
break;
case CMD_DOLLAR:
- children.append(new DocSymbol(parent,DocSymbol::Sym_Dollar));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_Dollar));
break;
case CMD_HASH:
- children.append(new DocSymbol(parent,DocSymbol::Sym_Hash));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_Hash));
break;
case CMD_DCOLON:
- children.append(new DocSymbol(parent,DocSymbol::Sym_DoubleColon));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_DoubleColon));
break;
case CMD_PERCENT:
- children.append(new DocSymbol(parent,DocSymbol::Sym_Percent));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_Percent));
break;
case CMD_NDASH:
- children.append(new DocSymbol(parent,DocSymbol::Sym_Minus));
- children.append(new DocSymbol(parent,DocSymbol::Sym_Minus));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_Minus));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_Minus));
break;
case CMD_MDASH:
- children.append(new DocSymbol(parent,DocSymbol::Sym_Minus));
- children.append(new DocSymbol(parent,DocSymbol::Sym_Minus));
- children.append(new DocSymbol(parent,DocSymbol::Sym_Minus));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_Minus));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_Minus));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_Minus));
break;
case CMD_QUOTE:
- children.append(new DocSymbol(parent,DocSymbol::Sym_Quot));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_Quot));
break;
case CMD_PUNT:
- children.append(new DocSymbol(parent,DocSymbol::Sym_Dot));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_Dot));
break;
case CMD_PLUS:
- children.append(new DocSymbol(parent,DocSymbol::Sym_Plus));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_Plus));
break;
case CMD_MINUS:
- children.append(new DocSymbol(parent,DocSymbol::Sym_Minus));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_Minus));
break;
case CMD_EQUAL:
- children.append(new DocSymbol(parent,DocSymbol::Sym_Equal));
+ children.push_back(std::make_unique<DocSymbol>(parent,DocSymbol::Sym_Equal));
break;
case CMD_EMPHASIS:
{
- children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Italic,tokenName,TRUE));
+ children.push_back(std::make_unique<DocStyleChange>(parent,(uint)g_nodeStack.size(),DocStyleChange::Italic,tokenName,TRUE));
tok=handleStyleArgument(parent,children,tokenName);
- children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Italic,tokenName,FALSE));
- if (tok!=TK_WORD) children.append(new DocWhiteSpace(parent," "));
+ children.push_back(std::make_unique<DocStyleChange>(parent,(uint)g_nodeStack.size(),DocStyleChange::Italic,tokenName,FALSE));
+ if (tok!=TK_WORD) children.push_back(std::make_unique<DocWhiteSpace>(parent," "));
if (tok==TK_NEWPARA) goto handlepara;
else if (tok==TK_WORD || tok==TK_HTMLTAG)
{
@@ -1414,10 +1395,10 @@ reparsetoken:
break;
case CMD_BOLD:
{
- children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Bold,tokenName,TRUE));
+ children.push_back(std::make_unique<DocStyleChange>(parent,(uint)g_nodeStack.size(),DocStyleChange::Bold,tokenName,TRUE));
tok=handleStyleArgument(parent,children,tokenName);
- children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Bold,tokenName,FALSE));
- if (tok!=TK_WORD) children.append(new DocWhiteSpace(parent," "));
+ children.push_back(std::make_unique<DocStyleChange>(parent,(uint)g_nodeStack.size(),DocStyleChange::Bold,tokenName,FALSE));
+ if (tok!=TK_WORD) children.push_back(std::make_unique<DocWhiteSpace>(parent," "));
if (tok==TK_NEWPARA) goto handlepara;
else if (tok==TK_WORD || tok==TK_HTMLTAG)
{
@@ -1428,10 +1409,10 @@ reparsetoken:
break;
case CMD_CODE:
{
- children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Code,tokenName,TRUE));
+ children.push_back(std::make_unique<DocStyleChange>(parent,(uint)g_nodeStack.size(),DocStyleChange::Code,tokenName,TRUE));
tok=handleStyleArgument(parent,children,tokenName);
- children.append(new DocStyleChange(parent,g_nodeStack.count(),DocStyleChange::Code,tokenName,FALSE));
- if (tok!=TK_WORD) children.append(new DocWhiteSpace(parent," "));
+ children.push_back(std::make_unique<DocStyleChange>(parent,(uint)g_nodeStack.size(),DocStyleChange::Code,tokenName,FALSE));
+ if (tok!=TK_WORD) children.push_back(std::make_unique<DocWhiteSpace>(parent," "));
if (tok==TK_NEWPARA) goto handlepara;
else if (tok==TK_WORD || tok==TK_HTMLTAG)
{
@@ -1444,7 +1425,7 @@ reparsetoken:
{
doctokenizerYYsetStateHtmlOnly();
tok = doctokenizerYYlex();
- children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::HtmlOnly,g_isExample,g_exampleName,g_token->name=="block"));
+ children.push_back(std::make_unique<DocVerbatim>(parent,g_context,g_token->verb,DocVerbatim::HtmlOnly,g_isExample,g_exampleName,g_token->name=="block"));
if (tok==0) warn_doc_error(g_fileName,getDoctokinizerLineNr(),"htmlonly section ended without end marker");
doctokenizerYYsetStatePara();
}
@@ -1453,7 +1434,7 @@ reparsetoken:
{
doctokenizerYYsetStateManOnly();
tok = doctokenizerYYlex();
- children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::ManOnly,g_isExample,g_exampleName));
+ children.push_back(std::make_unique<DocVerbatim>(parent,g_context,g_token->verb,DocVerbatim::ManOnly,g_isExample,g_exampleName));
if (tok==0) warn_doc_error(g_fileName,getDoctokinizerLineNr(),"manonly section ended without end marker");
doctokenizerYYsetStatePara();
}
@@ -1462,7 +1443,7 @@ reparsetoken:
{
doctokenizerYYsetStateRtfOnly();
tok = doctokenizerYYlex();
- children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::RtfOnly,g_isExample,g_exampleName));
+ children.push_back(std::make_unique<DocVerbatim>(parent,g_context,g_token->verb,DocVerbatim::RtfOnly,g_isExample,g_exampleName));
if (tok==0) warn_doc_error(g_fileName,getDoctokinizerLineNr(),"rtfonly section ended without end marker");
doctokenizerYYsetStatePara();
}
@@ -1471,7 +1452,7 @@ reparsetoken:
{
doctokenizerYYsetStateLatexOnly();
tok = doctokenizerYYlex();
- children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::LatexOnly,g_isExample,g_exampleName));
+ children.push_back(std::make_unique<DocVerbatim>(parent,g_context,g_token->verb,DocVerbatim::LatexOnly,g_isExample,g_exampleName));
if (tok==0) warn_doc_error(g_fileName,getDoctokinizerLineNr(),"latexonly section ended without end marker");
doctokenizerYYsetStatePara();
}
@@ -1480,7 +1461,7 @@ reparsetoken:
{
doctokenizerYYsetStateXmlOnly();
tok = doctokenizerYYlex();
- children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::XmlOnly,g_isExample,g_exampleName));
+ children.push_back(std::make_unique<DocVerbatim>(parent,g_context,g_token->verb,DocVerbatim::XmlOnly,g_isExample,g_exampleName));
if (tok==0) warn_doc_error(g_fileName,getDoctokinizerLineNr(),"xmlonly section ended without end marker");
doctokenizerYYsetStatePara();
}
@@ -1489,15 +1470,14 @@ reparsetoken:
{
doctokenizerYYsetStateDbOnly();
tok = doctokenizerYYlex();
- children.append(new DocVerbatim(parent,g_context,g_token->verb,DocVerbatim::DocbookOnly,g_isExample,g_exampleName));
+ children.push_back(std::make_unique<DocVerbatim>(parent,g_context,g_token->verb,DocVerbatim::DocbookOnly,g_isExample,g_exampleName));
if (tok==0) warn_doc_error(g_fileName,getDoctokinizerLineNr(),"docbookonly section ended without end marker");
doctokenizerYYsetStatePara();
}
break;
case CMD_FORMULA:
{
- DocFormula *form=new DocFormula(parent,g_token->id);
- children.append(form);
+ children.push_back(std::make_unique<DocFormula>(parent,g_token->id));
}
break;
case CMD_ANCHOR:
@@ -1505,7 +1485,7 @@ reparsetoken:
DocAnchor *anchor = handleAnchor(parent);
if (anchor)
{
- children.append(anchor);
+ children.push_back(std::unique_ptr<DocAnchor>(anchor));
}
}
break;
@@ -1514,7 +1494,7 @@ reparsetoken:
DocInternalRef *ref = handleInternalRef(parent);
if (ref)
{
- children.append(ref);
+ children.push_back(std::unique_ptr<DocInternalRef>(ref));
ref->parse();
}
doctokenizerYYsetStatePara();
@@ -1524,10 +1504,10 @@ reparsetoken:
{
QCString scope;
doctokenizerYYsetStateSetScope();
- doctokenizerYYlex();
+ (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;
@@ -1684,7 +1664,7 @@ reparsetoken:
DocSymbol::SymType s = DocSymbol::decodeSymbol(tokenName);
if (s!=DocSymbol::Sym_Unknown)
{
- children.append(new DocSymbol(parent,s));
+ children.push_back(std::make_unique<DocSymbol>(parent,s));
}
else
{
@@ -1695,9 +1675,9 @@ reparsetoken:
case TK_WHITESPACE:
case TK_NEWPARA:
handlepara:
- if (insidePRE(parent) || !children.isEmpty())
+ if (insidePRE(parent) || !children.empty())
{
- children.append(new DocWhiteSpace(parent,g_token->chars));
+ children.push_back(std::make_unique<DocWhiteSpace>(parent,g_token->chars));
}
break;
case TK_LNKWORD:
@@ -1711,7 +1691,7 @@ handlepara:
case TK_WORD:
if (handleWord)
{
- children.append(new DocWord(parent,g_token->name));
+ children.push_back(std::make_unique<DocWord>(parent,g_token->name));
}
else
return FALSE;
@@ -1719,11 +1699,11 @@ handlepara:
case TK_URL:
if (g_insideHtmlLink)
{
- children.append(new DocWord(parent,g_token->name));
+ children.push_back(std::make_unique<DocWord>(parent,g_token->name));
}
else
{
- children.append(new DocURL(parent,g_token->name,g_token->isEMailAddr));
+ children.push_back(std::make_unique<DocURL>(parent,g_token->name,g_token->isEMailAddr));
}
break;
default:
@@ -1734,27 +1714,26 @@ handlepara:
//---------------------------------------------------------------------------
-static void handleImg(DocNode *parent,QList<DocNode> &children,const HtmlAttribList &tagHtmlAttribs)
+static void handleImg(DocNode *parent, DocNodeList &children,const HtmlAttribList &tagHtmlAttribs)
{
- HtmlAttribListIterator li(tagHtmlAttribs);
- HtmlAttrib *opt;
bool found=FALSE;
uint index=0;
- for (li.toFirst();(opt=li.current());++li,++index)
+ for (const auto &opt : tagHtmlAttribs)
{
- //printf("option name=%s value=%s\n",opt->name.data(),opt->value.data());
- if (opt->name=="src" && !opt->value.isEmpty())
+ //printf("option name=%s value=%s\n",qPrint(opt.name),qPrint(opt.value));
+ if (opt.name=="src" && !opt.value.isEmpty())
{
// copy attributes
HtmlAttribList attrList = tagHtmlAttribs;
// and remove the src attribute
- bool result = attrList.remove(index);
- ASSERT(result);
+ attrList.erase(attrList.begin()+index);
DocImage::Type t = DocImage::Html;
- DocImage *img = new DocImage(parent,attrList,findAndCopyImage(opt->value,t,false),t,opt->value);
- children.append(img);
+ children.push_back(
+ std::make_unique<DocImage>(
+ parent,attrList,findAndCopyImage(opt.value,t,false),t,opt.value));
found = TRUE;
}
+ ++index;
}
if (!found)
{
@@ -1784,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));
@@ -1793,21 +1772,21 @@ DocEmoji::DocEmoji(DocNode *parent,const QCString &symName) :
//---------------------------------------------------------------------------
-static int internalValidatingParseDoc(DocNode *parent,QList<DocNode> &children,
+static int internalValidatingParseDoc(DocNode *parent,DocNodeList &children,
const QCString &doc)
{
int retval = RetVal_OK;
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;
DocPara *lastPar=0;
- if (!children.isEmpty() && children.getLast()->kind()==DocNode::Kind_Para)
+ if (!children.empty() && children.back()->kind()==DocNode::Kind_Para)
{ // last child item was a paragraph
- lastPar = (DocPara*)children.getLast();
+ lastPar = (DocPara*)children.back().get();
isFirst=FALSE;
}
do
@@ -1817,7 +1796,7 @@ static int internalValidatingParseDoc(DocNode *parent,QList<DocNode> &children,
retval=par->parse();
if (!par->isEmpty())
{
- children.append(par);
+ children.push_back(std::unique_ptr<DocNode>(par));
if (lastPar) lastPar->markLast(FALSE);
lastPar=par;
}
@@ -1838,9 +1817,9 @@ static int internalValidatingParseDoc(DocNode *parent,QList<DocNode> &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));
@@ -1850,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;
}
}
@@ -1886,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);
@@ -1904,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);
@@ -1948,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();
}
@@ -1995,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
@@ -2016,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:
@@ -2039,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())
@@ -2070,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:
@@ -2101,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:
@@ -2161,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;
}
@@ -2169,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;
@@ -2196,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())
{
@@ -2236,7 +2215,7 @@ DocFormula::DocFormula(DocNode *parent,int id) :
//{
// int retval;
// DBG(("DocLanguage::parse() start\n"));
-// g_nodeStack.push(this);
+// auto ns = AutoNodeStack(this);
//
// // parse one or more paragraphs
// bool isFirst=TRUE;
@@ -2245,15 +2224,13 @@ DocFormula::DocFormula(DocNode *parent,int id) :
// {
// par = new DocPara(this);
// if (isFirst) { par->markFirst(); isFirst=FALSE; }
-// m_children.append(par);
+// m_children.push_back(std::unique_ptr<DocPara>(par));
// retval=par->parse();
// }
// while (retval==TK_NEWPARA);
// if (par) par->markLast();
//
// DBG(("DocLanguage::parse() end\n"));
-// DocNode *n = g_nodeStack.pop();
-// ASSERT(n==this);
// return retval;
//}
@@ -2262,7 +2239,7 @@ DocFormula::DocFormula(DocNode *parent,int id) :
void DocSecRefItem::parse()
{
DBG(("DocSecRefItem::parse() start\n"));
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
doctokenizerYYsetStateTitle();
int tok;
@@ -2297,8 +2274,6 @@ void DocSecRefItem::parse()
}
DBG(("DocSecRefItem::parse() end\n"));
- DocNode *n = g_nodeStack.pop();
- ASSERT(n==this);
}
//---------------------------------------------------------------------------
@@ -2306,7 +2281,7 @@ void DocSecRefItem::parse()
void DocSecRefList::parse()
{
DBG(("DocSecRefList::parse() start\n"));
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
int tok=doctokenizerYYlex();
// skip white space
@@ -2336,7 +2311,7 @@ void DocSecRefList::parse()
}
DocSecRefItem *item = new DocSecRefItem(this,g_token->name);
- m_children.append(item);
+ m_children.push_back(std::unique_ptr<DocSecRefItem>(item));
item->parse();
}
break;
@@ -2363,8 +2338,6 @@ void DocSecRefList::parse()
endsecreflist:
DBG(("DocSecRefList::parse() end\n"));
- DocNode *n = g_nodeStack.pop();
- ASSERT(n==this);
}
//---------------------------------------------------------------------------
@@ -2387,7 +2360,7 @@ DocInternalRef::DocInternalRef(DocNode *parent,const QCString &ref)
void DocInternalRef::parse()
{
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DBG(("DocInternalRef::parse() start\n"));
int tok;
@@ -2401,8 +2374,6 @@ void DocInternalRef::parse()
handlePendingStyleCommands(this,m_children);
DBG(("DocInternalRef::parse() end\n"));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
}
//---------------------------------------------------------------------------
@@ -2413,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;
@@ -2449,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))
@@ -2464,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);
@@ -2480,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();
@@ -2498,38 +2469,36 @@ DocRef::DocRef(DocNode *parent,const QCString &target,const QCString &context) :
qPrint(target));
}
-static void flattenParagraphs(DocNode *root,QList<DocNode> &children)
+static void flattenParagraphs(DocNode *root,DocNodeList &children)
{
- QListIterator<DocNode> li(children);
- QList<DocNode> newChildren;
- DocNode *dn;
- for (li.toFirst();(dn=li.current());++li)
+ DocNodeList newChildren;
+ for (const auto &dn : children)
{
if (dn->kind()==DocNode::Kind_Para)
{
- DocPara *para = (DocPara*)dn;
- QList<DocNode> &paraChildren = para->children();
- paraChildren.setAutoDelete(FALSE); // unlink children from paragraph node
- QListIterator<DocNode> li2(paraChildren);
- DocNode *dn2;
- for (li2.toFirst();(dn2=li2.current());++li2)
- {
- newChildren.append(dn2); // add them to new node
- }
+ DocPara *para = (DocPara*)dn.get();
+ // move the children of the paragraph to the end of the newChildren list
+ newChildren.insert(newChildren.end(),
+ std::make_move_iterator(para->children().begin()),
+ std::make_move_iterator(para->children().end()));
}
}
+
+ // replace the children list by the newChildren list
children.clear();
- QListIterator<DocNode> li3(newChildren);
- for (li3.toFirst();(dn=li3.current());++li3)
+ children.insert(children.end(),
+ std::make_move_iterator(newChildren.begin()),
+ std::make_move_iterator(newChildren.end()));
+ // reparent the children
+ for (const auto &cn : children)
{
- children.append(dn);
- dn->setParent(root);
+ cn->setParent(root);
}
}
void DocRef::parse()
{
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DBG(("DocRef::parse() start\n"));
int tok;
@@ -2548,7 +2517,7 @@ void DocRef::parse()
}
}
- if (m_children.isEmpty() && !m_text.isEmpty())
+ if (m_children.empty() && !m_text.isEmpty())
{
g_insideHtmlLink=TRUE;
docParserPushContext();
@@ -2559,9 +2528,6 @@ void DocRef::parse()
}
handlePendingStyleCommands(this,m_children);
-
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
}
//---------------------------------------------------------------------------
@@ -2570,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();
@@ -2583,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;
@@ -2616,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())
@@ -2644,7 +2609,7 @@ DocLink::DocLink(DocNode *parent,const QCString &target)
QCString DocLink::parse(bool isJavaLink,bool isXmlLink)
{
QCString result;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DBG(("DocLink::parse() start\n"));
int tok;
@@ -2697,7 +2662,7 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink)
else if ((p=w.find('}'))!=-1)
{
uint l=w.length();
- m_children.append(new DocWord(this,w.left(p)));
+ m_children.push_back(std::make_unique<DocWord>(this,w.left(p)));
if ((uint)p<l-1) // something left after the } (for instance a .)
{
result=w.right((int)l-p-1);
@@ -2705,7 +2670,7 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink)
goto endlink;
}
}
- m_children.append(new DocWord(this,g_token->name));
+ m_children.push_back(std::make_unique<DocWord>(this,g_token->name));
break;
default:
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Unexpected token %s",
@@ -2721,15 +2686,13 @@ QCString DocLink::parse(bool isJavaLink,bool isXmlLink)
}
endlink:
- if (m_children.isEmpty()) // no link text
+ if (m_children.empty()) // no link text
{
- m_children.append(new DocWord(this,m_refText));
+ m_children.push_back(std::make_unique<DocWord>(this,m_refText));
}
handlePendingStyleCommands(this,m_children);
DBG(("DocLink::parse() end\n"));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return result;
}
@@ -2858,7 +2821,7 @@ DocVhdlFlow::DocVhdlFlow(DocNode *parent)
void DocVhdlFlow::parse()
{
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DBG(("DocVhdlFlow::parse() start\n"));
doctokenizerYYsetStateTitle();
@@ -2876,8 +2839,6 @@ void DocVhdlFlow::parse()
handlePendingStyleCommands(this,m_children);
DBG(("DocVhdlFlow::parse() end\n"));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
VhdlDocGen::createFlowChart(g_memberDef);
}
@@ -2913,7 +2874,7 @@ void DocImage::parse()
int DocHtmlHeader::parse()
{
int retval=RetVal_OK;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DBG(("DocHtmlHeader::parse() start\n"));
int tok;
@@ -2989,8 +2950,7 @@ int DocHtmlHeader::parse()
}
else if (tagId==HTML_BR)
{
- DocLineBreak *lb = new DocLineBreak(this,g_token->attribs);
- m_children.append(lb);
+ m_children.push_back(std::make_unique<DocLineBreak>(this,g_token->attribs));
}
else
{
@@ -3014,8 +2974,6 @@ int DocHtmlHeader::parse()
endheader:
handlePendingStyleCommands(this,m_children);
DBG(("DocHtmlHeader::parse() end\n"));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval;
}
@@ -3024,7 +2982,7 @@ endheader:
int DocHRef::parse()
{
int retval=RetVal_OK;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DBG(("DocHRef::parse() start\n"));
int tok;
@@ -3062,8 +3020,6 @@ int DocHRef::parse()
endhref:
handlePendingStyleCommands(this,m_children);
DBG(("DocHRef::parse() end\n"));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval;
}
@@ -3072,7 +3028,7 @@ endhref:
int DocInternal::parse(int level)
{
int retval=RetVal_OK;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DBG(("DocInternal::parse() start\n"));
// first parse any number of paragraphs
@@ -3085,7 +3041,7 @@ int DocInternal::parse(int level)
retval=par->parse();
if (!par->isEmpty())
{
- m_children.append(par);
+ m_children.push_back(std::unique_ptr<DocPara>(par));
lastPar=par;
}
else
@@ -3113,8 +3069,8 @@ int DocInternal::parse(int level)
)
{
DocSection *s=new DocSection(this,
- QMIN(level+Doxygen::subpageNestingLevel,5),g_token->sectionId);
- m_children.append(s);
+ std::min(level+Doxygen::subpageNestingLevel,5),g_token->sectionId);
+ m_children.push_back(std::unique_ptr<DocSection>(s));
retval = s->parse();
}
@@ -3124,8 +3080,6 @@ int DocInternal::parse(int level)
}
DBG(("DocInternal::parse() end: retval=%x\n",retval));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval;
}
@@ -3134,7 +3088,7 @@ int DocInternal::parse(int level)
int DocIndexEntry::parse()
{
int retval=RetVal_OK;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DBG(("DocIndexEntry::parse() start\n"));
int tok=doctokenizerYYlex();
if (tok!=TK_WHITESPACE)
@@ -3219,8 +3173,6 @@ int DocIndexEntry::parse()
m_entry = m_entry.stripWhiteSpace();
endindexentry:
DBG(("DocIndexEntry::parse() end retval=%x\n",retval));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval;
}
@@ -3229,28 +3181,26 @@ endindexentry:
DocHtmlCaption::DocHtmlCaption(DocNode *parent,const HtmlAttribList &attribs)
{
m_hasCaptionId = FALSE;
- HtmlAttribListIterator li(attribs);
- HtmlAttrib *opt;
- for (li.toFirst();(opt=li.current());++li)
+ for (const auto &opt : attribs)
{
- if (opt->name=="id" && !opt->value.isEmpty()) // interpret id attribute as an anchor
+ if (opt.name=="id" && !opt.value.isEmpty()) // interpret id attribute as an anchor
{
- const SectionInfo *sec = SectionManager::instance().find(opt->value);
+ 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;
}
else
{
- warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Invalid caption id '%s'",qPrint(opt->value));
+ warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Invalid caption id '%s'",qPrint(opt.value));
}
}
else // copy attribute
{
- m_attribs.append(new HtmlAttrib(*opt));
+ m_attribs.push_back(opt);
}
}
m_parent = parent;
@@ -3259,7 +3209,7 @@ DocHtmlCaption::DocHtmlCaption(DocNode *parent,const HtmlAttribList &attribs)
int DocHtmlCaption::parse()
{
int retval=0;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DBG(("DocHtmlCaption::parse() start\n"));
int tok;
while ((tok=doctokenizerYYlex()))
@@ -3297,8 +3247,6 @@ int DocHtmlCaption::parse()
endcaption:
handlePendingStyleCommands(this,m_children);
DBG(("DocHtmlCaption::parse() end\n"));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval;
}
@@ -3307,7 +3255,7 @@ endcaption:
int DocHtmlCell::parse()
{
int retval=RetVal_OK;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DBG(("DocHtmlCell::parse() start\n"));
// parse one or more paragraphs
@@ -3317,7 +3265,7 @@ int DocHtmlCell::parse()
{
par = new DocPara(this);
if (isFirst) { par->markFirst(); isFirst=FALSE; }
- m_children.append(par);
+ m_children.push_back(std::unique_ptr<DocPara>(par));
retval=par->parse();
if (retval==TK_HTMLTAG)
{
@@ -3336,15 +3284,13 @@ int DocHtmlCell::parse()
if (par) par->markLast();
DBG(("DocHtmlCell::parse() end\n"));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval;
}
int DocHtmlCell::parseXml()
{
int retval=RetVal_OK;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DBG(("DocHtmlCell::parseXml() start\n"));
// parse one or more paragraphs
@@ -3354,7 +3300,7 @@ int DocHtmlCell::parseXml()
{
par = new DocPara(this);
if (isFirst) { par->markFirst(); isFirst=FALSE; }
- m_children.append(par);
+ m_children.push_back(std::unique_ptr<DocPara>(par));
retval=par->parse();
if (retval==TK_HTMLTAG)
{
@@ -3373,74 +3319,62 @@ int DocHtmlCell::parseXml()
if (par) par->markLast();
DBG(("DocHtmlCell::parseXml() end\n"));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval;
}
uint DocHtmlCell::rowSpan() const
{
- uint retval = 0;
- HtmlAttribList attrs = attribs();
- uint i;
- for (i=0; i<attrs.count(); ++i)
+ for (const auto &attr : attribs())
{
- if (attrs.at(i)->name.lower()=="rowspan")
+ if (attr.name.lower()=="rowspan")
{
- retval = attrs.at(i)->value.toUInt();
- break;
+ return attr.value.toUInt();
}
}
- return retval;
+ return 0;
}
uint DocHtmlCell::colSpan() const
{
- uint retval = 1;
- HtmlAttribList attrs = attribs();
- uint i;
- for (i=0; i<attrs.count(); ++i)
+ for (const auto &attr : attribs())
{
- if (attrs.at(i)->name.lower()=="colspan")
+ if (attr.name.lower()=="colspan")
{
- retval = QMAX(1,attrs.at(i)->value.toUInt());
- break;
+ return std::max(1u,attr.value.toUInt());
}
}
- return retval;
+ return 1;
}
DocHtmlCell::Alignment DocHtmlCell::alignment() const
{
- HtmlAttribList attrs = attribs();
- uint i;
- for (i=0; i<attrs.count(); ++i)
+ for (const auto &attr : attribs())
{
- if (attrs.at(i)->name.lower()=="align")
+ if (attr.name.lower()=="align")
{
- if (attrs.at(i)->value.lower()=="center")
+ if (attr.value.lower()=="center")
return Center;
- else if (attrs.at(i)->value.lower()=="right")
+ else if (attr.value.lower()=="right")
return Right;
else return Left;
}
- else if (attrs.at(i)->name.lower()=="class")
+ else if (attr.name.lower()=="class")
{
- if (attrs.at(i)->value.lower()=="markdowntableheadcenter")
+ if (attr.value.lower()=="markdowntableheadcenter")
return Center;
- else if (attrs.at(i)->value.lower()=="markdowntableheadright")
+ else if (attr.value.lower()=="markdowntableheadright")
return Right;
- else if (attrs.at(i)->value.lower()=="markdowntableheadleft")
+ else if (attr.value.lower()=="markdowntableheadleft")
return Left;
- else if (attrs.at(i)->value.lower()=="markdowntableheadnone")
+ else if (attr.value.lower()=="markdowntableheadnone")
return Center;
- else if (attrs.at(i)->value.lower()=="markdowntablebodycenter")
+ else if (attr.value.lower()=="markdowntablebodycenter")
return Center;
- else if (attrs.at(i)->value.lower()=="markdowntablebodyright")
+ else if (attr.value.lower()=="markdowntablebodyright")
return Right;
- else if (attrs.at(i)->value.lower()=="markdowntablebodyleft")
+ else if (attr.value.lower()=="markdowntablebodyleft")
return Left;
- else if (attrs.at(i)->value.lower()=="markdowntablebodynone")
+ else if (attr.value.lower()=="markdowntablebodynone")
return Left;
else return Left;
}
@@ -3454,7 +3388,7 @@ DocHtmlCell::Alignment DocHtmlCell::alignment() const
int DocHtmlRow::parse()
{
int retval=RetVal_OK;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DBG(("DocHtmlRow::parse() start\n"));
bool isHeading=FALSE;
@@ -3503,7 +3437,7 @@ int DocHtmlRow::parse()
cell=new DocHtmlCell(this,g_token->attribs,isHeading);
cell->markFirst(isFirst);
isFirst=FALSE;
- m_children.append(cell);
+ m_children.push_back(std::unique_ptr<DocHtmlCell>(cell));
retval=cell->parse();
isHeading = retval==RetVal_TableHCell;
}
@@ -3512,15 +3446,13 @@ int DocHtmlRow::parse()
endrow:
DBG(("DocHtmlRow::parse() end\n"));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval;
}
int DocHtmlRow::parseXml(bool isHeading)
{
int retval=RetVal_OK;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DBG(("DocHtmlRow::parseXml() start\n"));
bool isFirst=TRUE;
@@ -3566,7 +3498,7 @@ int DocHtmlRow::parseXml(bool isHeading)
cell=new DocHtmlCell(this,g_token->attribs,isHeading);
cell->markFirst(isFirst);
isFirst=FALSE;
- m_children.append(cell);
+ m_children.push_back(std::unique_ptr<DocHtmlCell>(cell));
retval=cell->parseXml();
}
while (retval==RetVal_TableCell || retval==RetVal_TableHCell);
@@ -3574,8 +3506,6 @@ int DocHtmlRow::parseXml(bool isHeading)
endrow:
DBG(("DocHtmlRow::parseXml() end\n"));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval;
}
@@ -3584,7 +3514,7 @@ endrow:
int DocHtmlTable::parse()
{
int retval=RetVal_OK;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DBG(("DocHtmlTable::parse() start\n"));
getrow:
@@ -3639,22 +3569,20 @@ getrow:
while (retval==RetVal_TableRow)
{
DocHtmlRow *tr=new DocHtmlRow(this,g_token->attribs);
- m_children.append(tr);
+ m_children.push_back(std::unique_ptr<DocHtmlRow>(tr));
retval=tr->parse();
}
computeTableGrid();
DBG(("DocHtmlTable::parse() end\n"));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval==RetVal_EndTable ? RetVal_OK : retval;
}
int DocHtmlTable::parseXml()
{
int retval=RetVal_OK;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DBG(("DocHtmlTable::parseXml() start\n"));
// get next token
@@ -3682,7 +3610,7 @@ int DocHtmlTable::parseXml()
while (retval==RetVal_TableRow)
{
DocHtmlRow *tr=new DocHtmlRow(this,g_token->attribs);
- m_children.append(tr);
+ m_children.push_back(std::unique_ptr<DocHtmlRow>(tr));
retval=tr->parseXml(isHeader);
isHeader=FALSE;
}
@@ -3690,8 +3618,6 @@ int DocHtmlTable::parseXml()
computeTableGrid();
DBG(("DocHtmlTable::parseXml() end\n"));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
tagId=Mappers::htmlTagMapper->map(g_token->name);
return tagId==XML_LIST && g_token->endTag ? RetVal_OK : retval;
}
@@ -3705,7 +3631,7 @@ struct ActiveRowSpan
};
/** List of ActiveRowSpan classes. */
-typedef QList<ActiveRowSpan> RowSpanList;
+typedef std::vector<ActiveRowSpan> RowSpanList;
/** determines the location of all cells in a grid, resolving row and
column spans. For each the total number of visible cells is computed,
@@ -3715,39 +3641,34 @@ void DocHtmlTable::computeTableGrid()
{
//printf("computeTableGrid()\n");
RowSpanList rowSpans;
- rowSpans.setAutoDelete(TRUE);
uint maxCols=0;
uint rowIdx=1;
- QListIterator<DocNode> li(children());
- DocNode *rowNode;
- for (li.toFirst();(rowNode=li.current());++li)
+ for (const auto &rowNode : children())
{
uint colIdx=1;
uint cells=0;
if (rowNode->kind()==DocNode::Kind_HtmlRow)
{
- uint i;
- DocHtmlRow *row = (DocHtmlRow*)rowNode;
- QListIterator<DocNode> rli(row->children());
- DocNode *cellNode;
- for (rli.toFirst();(cellNode=rli.current());++rli)
+ size_t i;
+ DocHtmlRow *row = (DocHtmlRow*)rowNode.get();
+ for (const auto &cellNode : row->children())
{
if (cellNode->kind()==DocNode::Kind_HtmlCell)
{
- DocHtmlCell *cell = (DocHtmlCell*)cellNode;
+ DocHtmlCell *cell = (DocHtmlCell*)cellNode.get();
uint rs = cell->rowSpan();
uint cs = cell->colSpan();
- for (i=0;i<rowSpans.count();i++)
+ for (i=0;i<rowSpans.size();i++)
{
- if (rowSpans.at(i)->rowsLeft>0 &&
- rowSpans.at(i)->column==colIdx)
+ if (rowSpans[i].rowsLeft>0 &&
+ rowSpans[i].column==colIdx)
{
- colIdx=rowSpans.at(i)->column+1;
+ colIdx=rowSpans[i].column+1;
cells++;
}
}
- if (rs>0) rowSpans.append(new ActiveRowSpan(rs,colIdx));
+ if (rs>0) rowSpans.emplace_back(rs,colIdx);
//printf("found cell at (%d,%d)\n",rowIdx,colIdx);
cell->setRowIndex(rowIdx);
cell->setColumnIndex(colIdx);
@@ -3755,9 +3676,9 @@ void DocHtmlTable::computeTableGrid()
cells++;
}
}
- for (i=0;i<rowSpans.count();i++)
+ for (i=0;i<rowSpans.size();i++)
{
- if (rowSpans.at(i)->rowsLeft>0) rowSpans.at(i)->rowsLeft--;
+ if (rowSpans[i].rowsLeft>0) rowSpans[i].rowsLeft--;
}
row->setVisibleCells(cells);
row->setRowIndex(rowIdx);
@@ -3775,9 +3696,7 @@ void DocHtmlTable::accept(DocVisitor *v)
//if (m_caption && v->id()==DocVisitor_Html) m_caption->accept(v);
// doxygen 1.8.11: always put the caption first
if (m_caption) m_caption->accept(v);
- QListIterator<DocNode> cli(m_children);
- DocNode *n;
- for (cli.toFirst();(n=cli.current());++cli) n->accept(v);
+ for (const auto &n : m_children) n->accept(v);
// for other output formats we put the caption last
//if (m_caption && v->id()!=DocVisitor_Html) m_caption->accept(v);
v->visitPost(this);
@@ -3788,7 +3707,7 @@ void DocHtmlTable::accept(DocVisitor *v)
int DocHtmlDescTitle::parse()
{
int retval=0;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DBG(("DocHtmlDescTitle::parse() start\n"));
int tok;
@@ -3828,7 +3747,7 @@ int DocHtmlDescTitle::parse()
else
{
DocRef *ref = new DocRef(this,g_token->name,g_context);
- m_children.append(ref);
+ m_children.push_back(std::unique_ptr<DocRef>(ref));
ref->parse();
}
doctokenizerYYsetStatePara();
@@ -3859,11 +3778,11 @@ int DocHtmlDescTitle::parse()
{
doctokenizerYYsetStatePara();
DocLink *lnk = new DocLink(this,g_token->name);
- m_children.append(lnk);
+ m_children.push_back(std::unique_ptr<DocLink>(lnk));
QCString leftOver = lnk->parse(isJavaLink);
if (!leftOver.isEmpty())
{
- m_children.append(new DocWord(this,leftOver));
+ m_children.push_back(std::make_unique<DocWord>(this,leftOver));
}
}
}
@@ -3932,8 +3851,6 @@ int DocHtmlDescTitle::parse()
endtitle:
handlePendingStyleCommands(this,m_children);
DBG(("DocHtmlDescTitle::parse() end\n"));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval;
}
@@ -3943,7 +3860,7 @@ int DocHtmlDescData::parse()
{
m_attribs = g_token->attribs;
int retval=0;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DBG(("DocHtmlDescData::parse() start\n"));
bool isFirst=TRUE;
@@ -3952,15 +3869,13 @@ int DocHtmlDescData::parse()
{
par = new DocPara(this);
if (isFirst) { par->markFirst(); isFirst=FALSE; }
- m_children.append(par);
+ m_children.push_back(std::unique_ptr<DocPara>(par));
retval=par->parse();
}
while (retval==TK_NEWPARA);
if (par) par->markLast();
DBG(("DocHtmlDescData::parse() end\n"));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval;
}
@@ -3969,7 +3884,7 @@ int DocHtmlDescData::parse()
int DocHtmlDescList::parse()
{
int retval=RetVal_OK;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DBG(("DocHtmlDescList::parse() start\n"));
// get next token
@@ -4008,9 +3923,9 @@ int DocHtmlDescList::parse()
do
{
DocHtmlDescTitle *dt=new DocHtmlDescTitle(this,g_token->attribs);
- m_children.append(dt);
+ m_children.push_back(std::unique_ptr<DocHtmlDescTitle>(dt));
DocHtmlDescData *dd=new DocHtmlDescData(this);
- m_children.append(dd);
+ m_children.push_back(std::unique_ptr<DocHtmlDescData>(dd));
retval=dt->parse();
if (retval==RetVal_DescData)
{
@@ -4030,8 +3945,6 @@ int DocHtmlDescList::parse()
enddesclist:
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
DBG(("DocHtmlDescList::parse() end\n"));
return retval==RetVal_EndDesc ? RetVal_OK : retval;
}
@@ -4042,7 +3955,7 @@ int DocHtmlListItem::parse()
{
DBG(("DocHtmlListItem::parse() start\n"));
int retval=0;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
// parse one or more paragraphs
bool isFirst=TRUE;
@@ -4051,14 +3964,12 @@ int DocHtmlListItem::parse()
{
par = new DocPara(this);
if (isFirst) { par->markFirst(); isFirst=FALSE; }
- m_children.append(par);
+ m_children.push_back(std::unique_ptr<DocPara>(par));
retval=par->parse();
}
while (retval==TK_NEWPARA);
if (par) par->markLast();
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
DBG(("DocHtmlListItem::parse() end retval=%x\n",retval));
return retval;
}
@@ -4067,7 +3978,7 @@ int DocHtmlListItem::parseXml()
{
DBG(("DocHtmlListItem::parseXml() start\n"));
int retval=0;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
// parse one or more paragraphs
bool isFirst=TRUE;
@@ -4076,7 +3987,7 @@ int DocHtmlListItem::parseXml()
{
par = new DocPara(this);
if (isFirst) { par->markFirst(); isFirst=FALSE; }
- m_children.append(par);
+ m_children.push_back(std::unique_ptr<DocPara>(par));
retval=par->parse();
if (retval==0) break;
@@ -4091,8 +4002,6 @@ int DocHtmlListItem::parseXml()
if (par) par->markLast();
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
DBG(("DocHtmlListItem::parseXml() end retval=%x\n",retval));
return retval;
}
@@ -4104,7 +4013,7 @@ int DocHtmlList::parse()
DBG(("DocHtmlList::parse() start\n"));
int retval=RetVal_OK;
int num=1;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
// get next token
int tok=doctokenizerYYlex();
@@ -4124,7 +4033,7 @@ int DocHtmlList::parse()
) // found empty list
{
// add dummy item to obtain valid HTML
- m_children.append(new DocHtmlListItem(this,HtmlAttribList(),1));
+ m_children.push_back(std::make_unique<DocHtmlListItem>(this,HtmlAttribList(),1));
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"empty list!");
retval = RetVal_EndList;
goto endlist;
@@ -4132,7 +4041,7 @@ int DocHtmlList::parse()
else // found some other tag
{
// add dummy item to obtain valid HTML
- m_children.append(new DocHtmlListItem(this,HtmlAttribList(),1));
+ m_children.push_back(std::make_unique<DocHtmlListItem>(this,HtmlAttribList(),1));
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"expected <li> tag but "
"found <%s%s> instead!",g_token->endTag?"/":"",qPrint(g_token->name));
doctokenizerYYpushBackHtmlTag(g_token->name);
@@ -4142,7 +4051,7 @@ int DocHtmlList::parse()
else if (tok==0) // premature end of comment
{
// add dummy item to obtain valid HTML
- m_children.append(new DocHtmlListItem(this,HtmlAttribList(),1));
+ m_children.push_back(std::make_unique<DocHtmlListItem>(this,HtmlAttribList(),1));
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"unexpected end of comment while looking"
" for a html list item");
goto endlist;
@@ -4150,7 +4059,7 @@ int DocHtmlList::parse()
else // token other than html token
{
// add dummy item to obtain valid HTML
- m_children.append(new DocHtmlListItem(this,HtmlAttribList(),1));
+ m_children.push_back(std::make_unique<DocHtmlListItem>(this,HtmlAttribList(),1));
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"expected <li> tag but found %s token instead!",
tokToString(tok));
goto endlist;
@@ -4159,7 +4068,7 @@ int DocHtmlList::parse()
do
{
DocHtmlListItem *li=new DocHtmlListItem(this,g_token->attribs,num++);
- m_children.append(li);
+ m_children.push_back(std::unique_ptr<DocHtmlListItem>(li));
retval=li->parse();
} while (retval==RetVal_ListItem);
@@ -4171,8 +4080,6 @@ int DocHtmlList::parse()
endlist:
DBG(("DocHtmlList::parse() end retval=%x\n",retval));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval==RetVal_EndList ? RetVal_OK : retval;
}
@@ -4181,7 +4088,7 @@ int DocHtmlList::parseXml()
DBG(("DocHtmlList::parseXml() start\n"));
int retval=RetVal_OK;
int num=1;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
// get next token
int tok=doctokenizerYYlex();
@@ -4220,7 +4127,7 @@ int DocHtmlList::parseXml()
do
{
DocHtmlListItem *li=new DocHtmlListItem(this,g_token->attribs,num++);
- m_children.append(li);
+ m_children.push_back(std::unique_ptr<DocHtmlListItem>(li));
retval=li->parseXml();
if (retval==0) break;
//printf("retval=%x g_token->name=%s\n",retval,qPrint(g_token->name));
@@ -4234,8 +4141,6 @@ int DocHtmlList::parseXml()
endlist:
DBG(("DocHtmlList::parseXml() end retval=%x\n",retval));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval==RetVal_EndList ||
(retval==RetVal_CloseXml || g_token->name=="list") ?
RetVal_OK : retval;
@@ -4247,7 +4152,7 @@ int DocHtmlBlockQuote::parse()
{
DBG(("DocHtmlBlockQuote::parse() start\n"));
int retval=0;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
// parse one or more paragraphs
bool isFirst=TRUE;
@@ -4256,14 +4161,12 @@ int DocHtmlBlockQuote::parse()
{
par = new DocPara(this);
if (isFirst) { par->markFirst(); isFirst=FALSE; }
- m_children.append(par);
+ m_children.push_back(std::unique_ptr<DocPara>(par));
retval=par->parse();
}
while (retval==TK_NEWPARA);
if (par) par->markLast();
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
DBG(("DocHtmlBlockQuote::parse() end retval=%x\n",retval));
return (retval==RetVal_EndBlockQuote) ? RetVal_OK : retval;
}
@@ -4274,7 +4177,7 @@ int DocParBlock::parse()
{
DBG(("DocParBlock::parse() start\n"));
int retval=0;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
// parse one or more paragraphs
bool isFirst=TRUE;
@@ -4283,14 +4186,12 @@ int DocParBlock::parse()
{
par = new DocPara(this);
if (isFirst) { par->markFirst(); isFirst=FALSE; }
- m_children.append(par);
+ m_children.push_back(std::unique_ptr<DocPara>(par));
retval=par->parse();
}
while (retval==TK_NEWPARA);
if (par) par->markLast();
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
DBG(("DocParBlock::parse() end retval=%x\n",retval));
return (retval==RetVal_EndBlockQuote) ? RetVal_OK : retval;
}
@@ -4299,12 +4200,10 @@ int DocParBlock::parse()
int DocSimpleListItem::parse()
{
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
int rv=m_paragraph->parse();
m_paragraph->markFirst();
m_paragraph->markLast();
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return rv;
}
@@ -4312,16 +4211,14 @@ int DocSimpleListItem::parse()
int DocSimpleList::parse()
{
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
int rv;
do
{
DocSimpleListItem *li=new DocSimpleListItem(this);
- m_children.append(li);
+ m_children.push_back(std::unique_ptr<DocSimpleListItem>(li));
rv=li->parse();
} while (rv==RetVal_ListItem);
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return (rv!=TK_NEWPARA) ? rv : RetVal_OK;
}
@@ -4336,7 +4233,7 @@ DocAutoListItem::DocAutoListItem(DocNode *parent,int indent,int num)
int DocAutoListItem::parse()
{
int retval = RetVal_OK;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
// first parse any number of paragraphs
bool isFirst=TRUE;
@@ -4348,7 +4245,7 @@ int DocAutoListItem::parse()
retval=par->parse();
if (!par->isEmpty())
{
- m_children.append(par);
+ m_children.push_back(std::unique_ptr<DocPara>(par));
if (lastPar) lastPar->markLast(FALSE);
lastPar=par;
}
@@ -4361,8 +4258,6 @@ int DocAutoListItem::parse()
} while (retval==TK_NEWPARA && g_token->indent>m_indent);
if (lastPar) lastPar->markLast();
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
//printf("DocAutoListItem: retval=%d indent=%d\n",retval,g_token->indent);
return retval;
}
@@ -4381,7 +4276,7 @@ int DocAutoList::parse()
{
int retval = RetVal_OK;
int num=1;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
doctokenizerYYstartAutoList();
// first item or sub list => create new list
do
@@ -4391,12 +4286,12 @@ int DocAutoList::parse()
num=g_token->id; // override num with real number given
}
DocAutoListItem *li = new DocAutoListItem(this,m_indent,num++);
- m_children.append(li);
+ m_children.push_back(std::unique_ptr<DocAutoListItem>(li));
retval=li->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
@@ -4406,8 +4301,6 @@ int DocAutoList::parse()
);
doctokenizerYYendAutoList();
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval;
}
@@ -4416,7 +4309,7 @@ int DocAutoList::parse()
void DocTitle::parse()
{
DBG(("DocTitle::parse() start\n"));
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
doctokenizerYYsetStateTitle();
int tok;
while ((tok=doctokenizerYYlex()))
@@ -4429,13 +4322,11 @@ void DocTitle::parse()
doctokenizerYYsetStatePara();
handlePendingStyleCommands(this,m_children);
DBG(("DocTitle::parse() end\n"));
- DocNode *n = g_nodeStack.pop();
- ASSERT(n==this);
}
void DocTitle::parseFromString(const QCString &text)
{
- m_children.append(new DocWord(this,text));
+ m_children.push_back(std::make_unique<DocWord>(this,text));
}
//--------------------------------------------------------------------------
@@ -4456,16 +4347,14 @@ void DocSimpleSect::accept(DocVisitor *v)
{
v->visitPre(this);
if (m_title) m_title->accept(v);
- QListIterator<DocNode> cli(m_children);
- DocNode *n;
- for (cli.toFirst();(n=cli.current());++cli) n->accept(v);
+ for (const auto &n : m_children) n->accept(v);
v->visitPost(this);
}
int DocSimpleSect::parse(bool userTitle,bool needsSeparator)
{
DBG(("DocSimpleSect::parse() start\n"));
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
// handle case for user defined title
if (userTitle)
@@ -4476,32 +4365,30 @@ int DocSimpleSect::parse(bool userTitle,bool needsSeparator)
// add new paragraph as child
DocPara *par = new DocPara(this);
- if (m_children.isEmpty())
+ if (m_children.empty())
{
par->markFirst();
}
else
{
- ASSERT(m_children.getLast()->kind()==DocNode::Kind_Para);
- ((DocPara *)m_children.getLast())->markLast(FALSE);
+ ASSERT(m_children.back()->kind()==DocNode::Kind_Para);
+ ((DocPara *)m_children.back().get())->markLast(FALSE);
}
par->markLast();
- if (needsSeparator) m_children.append(new DocSimpleSectSep(this));
- m_children.append(par);
+ if (needsSeparator) m_children.push_back(std::make_unique<DocSimpleSectSep>(this));
+ m_children.push_back(std::unique_ptr<DocPara>(par));
// parse the contents of the paragraph
int retval = par->parse();
DBG(("DocSimpleSect::parse() end retval=%d\n",retval));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval; // 0==EOF, TK_NEWPARA, TK_LISTITEM, TK_ENDLIST, RetVal_SimpleSec
}
int DocSimpleSect::parseRcs()
{
DBG(("DocSimpleSect::parseRcs() start\n"));
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
m_title = new DocTitle(this);
m_title->parseFromString(g_token->name);
@@ -4512,32 +4399,30 @@ int DocSimpleSect::parseRcs()
docParserPopContext(); // this will restore the old g_token
DBG(("DocSimpleSect::parseRcs()\n"));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return RetVal_OK;
}
int DocSimpleSect::parseXml()
{
DBG(("DocSimpleSect::parse() start\n"));
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
int retval = RetVal_OK;
for (;;)
{
// add new paragraph as child
DocPara *par = new DocPara(this);
- if (m_children.isEmpty())
+ if (m_children.empty())
{
par->markFirst();
}
else
{
- ASSERT(m_children.getLast()->kind()==DocNode::Kind_Para);
- ((DocPara *)m_children.getLast())->markLast(FALSE);
+ ASSERT(m_children.back()->kind()==DocNode::Kind_Para);
+ ((DocPara *)m_children.back().get())->markLast(FALSE);
}
par->markLast();
- m_children.append(par);
+ m_children.push_back(std::unique_ptr<DocPara>(par));
// parse the contents of the paragraph
retval = par->parse();
@@ -4550,22 +4435,20 @@ int DocSimpleSect::parseXml()
}
DBG(("DocSimpleSect::parseXml() end retval=%d\n",retval));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval;
}
void DocSimpleSect::appendLinkWord(const QCString &word)
{
DocPara *p;
- if (m_children.isEmpty() || m_children.getLast()->kind()!=DocNode::Kind_Para)
+ if (m_children.empty() || m_children.back()->kind()!=DocNode::Kind_Para)
{
p = new DocPara(this);
- m_children.append(p);
+ m_children.push_back(std::unique_ptr<DocPara>(p));
}
else
{
- p = (DocPara *)m_children.getLast();
+ p = (DocPara *)m_children.back().get();
// Comma-separate <seealso> links.
p->injectToken(TK_WORD,",");
@@ -4609,7 +4492,7 @@ int DocParamList::parse(const QCString &cmdName)
{
int retval=RetVal_OK;
DBG(("DocParamList::parse() start\n"));
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
DocPara *par=0;
QCString saveCmdName = cmdName;
@@ -4618,7 +4501,7 @@ int DocParamList::parse(const QCString &cmdName)
{
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"expected whitespace after \\%s command",
qPrint(saveCmdName));
- retval=0;
+ retval=RetVal_EndParBlock;
goto endparamlist;
}
doctokenizerYYsetStateParam();
@@ -4633,13 +4516,13 @@ int DocParamList::parse(const QCString &cmdName)
handleParameterType(this,m_paramTypes,g_token->name.left(typeSeparator));
g_token->name = g_token->name.mid(typeSeparator+1);
g_hasParamCommand=TRUE;
- checkArgumentName(g_token->name);
+ checkArgumentName(g_token->name.str());
((DocParamSect*)parent())->m_hasTypeSpecifier=TRUE;
}
else
{
g_hasParamCommand=TRUE;
- checkArgumentName(g_token->name);
+ checkArgumentName(g_token->name.str());
}
}
else if (m_type==DocParamSect::RetVal)
@@ -4656,27 +4539,28 @@ int DocParamList::parse(const QCString &cmdName)
{
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"unexpected end of comment block while parsing the "
"argument of command %s",qPrint(saveCmdName));
- retval=0;
+ retval=RetVal_EndParBlock;
goto endparamlist;
}
if (tok!=TK_WHITESPACE) /* premature end of comment block */
{
- warn_doc_error(g_fileName,getDoctokinizerLineNr(),"unexpected token in comment block while parsing the "
- "argument of command %s",qPrint(saveCmdName));
- retval=0;
+ if (tok!=TK_NEWPARA) /* empty param description */
+ {
+ warn_doc_error(g_fileName,getDoctokinizerLineNr(),"unexpected token in comment block while parsing the "
+ "argument of command %s",qPrint(saveCmdName));
+ }
+ retval=RetVal_EndParBlock;
goto endparamlist;
}
par = new DocPara(this);
- m_paragraphs.append(par);
+ m_paragraphs.push_back(std::unique_ptr<DocPara>(par));
retval = par->parse();
par->markFirst();
par->markLast();
endparamlist:
DBG(("DocParamList::parse() end retval=%d\n",retval));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval;
}
@@ -4684,13 +4568,13 @@ int DocParamList::parseXml(const QCString &paramName)
{
int retval=RetVal_OK;
DBG(("DocParamList::parseXml() start\n"));
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
g_token->name = paramName;
if (m_type==DocParamSect::Param)
{
g_hasParamCommand=TRUE;
- checkArgumentName(g_token->name);
+ checkArgumentName(g_token->name.str());
}
else if (m_type==DocParamSect::RetVal)
{
@@ -4712,16 +4596,16 @@ int DocParamList::parseXml(const QCString &paramName)
}
else // append the paragraph to the list
{
- if (m_paragraphs.isEmpty())
+ if (m_paragraphs.empty())
{
par->markFirst();
}
else
{
- m_paragraphs.getLast()->markLast(FALSE);
+ m_paragraphs.back()->markLast(FALSE);
}
par->markLast();
- m_paragraphs.append(par);
+ m_paragraphs.push_back(std::unique_ptr<DocPara>(par));
}
if (retval == 0) break;
@@ -4743,8 +4627,6 @@ int DocParamList::parseXml(const QCString &paramName)
DBG(("DocParamList::parse() end retval=%d\n",retval));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval;
}
@@ -4754,7 +4636,7 @@ int DocParamSect::parse(const QCString &cmdName,bool xmlContext, Direction d)
{
int retval=RetVal_OK;
DBG(("DocParamSect::parse() start\n"));
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
if (d!=Unspecified)
{
@@ -4762,18 +4644,18 @@ int DocParamSect::parse(const QCString &cmdName,bool xmlContext, Direction d)
}
DocParamList *pl = new DocParamList(this,m_type,d);
- if (m_children.isEmpty())
+ if (m_children.empty())
{
pl->markFirst();
pl->markLast();
}
else
{
- ASSERT(m_children.getLast()->kind()==DocNode::Kind_ParamList);
- ((DocParamList *)m_children.getLast())->markLast(FALSE);
+ ASSERT(m_children.back()->kind()==DocNode::Kind_ParamList);
+ ((DocParamList *)m_children.back().get())->markLast(FALSE);
pl->markLast();
}
- m_children.append(pl);
+ m_children.push_back(std::unique_ptr<DocParamList>(pl));
if (xmlContext)
{
retval = pl->parseXml(cmdName);
@@ -4788,8 +4670,6 @@ int DocParamSect::parse(const QCString &cmdName,bool xmlContext, Direction d)
}
DBG(("DocParamSect::parse() end retval=%d\n",retval));
- DocNode *n=g_nodeStack.pop();
- ASSERT(n==this);
return retval;
}
@@ -4799,19 +4679,19 @@ int DocPara::handleSimpleSection(DocSimpleSect::Type t, bool xmlContext)
{
DocSimpleSect *ss=0;
bool needsSeparator = FALSE;
- if (!m_children.isEmpty() && // previous element
- m_children.getLast()->kind()==Kind_SimpleSect && // was a simple sect
- ((DocSimpleSect *)m_children.getLast())->type()==t && // of same type
+ if (!m_children.empty() && // previous element
+ m_children.back()->kind()==Kind_SimpleSect && // was a simple sect
+ ((DocSimpleSect *)m_children.back().get())->type()==t && // of same type
t!=DocSimpleSect::User) // but not user defined
{
// append to previous section
- ss=(DocSimpleSect *)m_children.getLast();
+ ss=(DocSimpleSect *)m_children.back().get();
needsSeparator = TRUE;
}
else // start new section
{
ss=new DocSimpleSect(this,t);
- m_children.append(ss);
+ m_children.push_back(std::unique_ptr<DocSimpleSect>(ss));
}
int rv = RetVal_OK;
if (xmlContext)
@@ -4831,17 +4711,17 @@ int DocPara::handleParamSection(const QCString &cmdName,
int direction=DocParamSect::Unspecified)
{
DocParamSect *ps=0;
- if (!m_children.isEmpty() && // previous element
- m_children.getLast()->kind()==Kind_ParamSect && // was a param sect
- ((DocParamSect *)m_children.getLast())->type()==t) // of same type
+ if (!m_children.empty() && // previous element
+ m_children.back()->kind()==Kind_ParamSect && // was a param sect
+ ((DocParamSect *)m_children.back().get())->type()==t) // of same type
{
// append to previous section
- ps=(DocParamSect *)m_children.getLast();
+ ps=(DocParamSect *)m_children.back().get();
}
else // start new section
{
ps=new DocParamSect(this,t);
- m_children.append(ps);
+ m_children.push_back(std::unique_ptr<DocParamSect>(ps));
}
int rv=ps->parse(cmdName,xmlContext,(DocParamSect::Direction)direction);
return (rv!=TK_NEWPARA) ? rv : RetVal_OK;
@@ -4872,9 +4752,9 @@ void DocPara::handleCite()
return;
}
g_token->sectionId = g_token->name;
- DocCite *cite = new DocCite(this,g_token->name,g_context);
- m_children.append(cite);
- //cite->parse();
+ m_children.push_back(
+ std::make_unique<DocCite>(
+ this,g_token->name,g_context));
doctokenizerYYsetStatePara();
}
@@ -4903,8 +4783,9 @@ void DocPara::handleEmoji()
tokToString(tok),qPrint("emoji"));
return;
}
- DocEmoji *emoji = new DocEmoji(this,g_token->name);
- m_children.append(emoji);
+ m_children.push_back(
+ std::make_unique<DocEmoji>(
+ this,g_token->name));
doctokenizerYYsetStatePara();
}
@@ -4919,7 +4800,7 @@ int DocPara::handleXRefItem()
DocXRefItem *ref = new DocXRefItem(this,g_token->id,g_token->name);
if (ref->parse())
{
- m_children.append(ref);
+ m_children.push_back(std::unique_ptr<DocXRefItem>(ref));
}
else
{
@@ -4957,10 +4838,8 @@ void DocPara::handleIncludeOperator(const QCString &cmdName,DocIncOperator::Type
return;
}
DocIncOperator *op = new DocIncOperator(this,t,g_token->name,g_context,g_isExample,g_exampleName);
- QListIterator<DocNode> it(m_children);
- DocNode *n1 = it.toLast();
- --it;
- DocNode *n2 = n1!=0 ? it.current() : 0;
+ DocNode *n1 = m_children.size()>=1 ? m_children.at(m_children.size()-1).get() : 0;
+ DocNode *n2 = m_children.size()>=2 ? m_children.at(m_children.size()-2).get() : 0;
bool isFirst = n1==0 || // no last node
(n1->kind()!=DocNode::Kind_IncOperator &&
n1->kind()!=DocNode::Kind_WhiteSpace
@@ -4980,7 +4859,7 @@ void DocPara::handleIncludeOperator(const QCString &cmdName,DocIncOperator::Type
{
((DocIncOperator *)n2)->markLast(FALSE);
}
- m_children.append(op);
+ m_children.push_back(std::unique_ptr<DocIncOperator>(op));
op->parse();
}
@@ -5070,7 +4949,7 @@ void DocPara::handleImage(const QCString &cmdName)
}
HtmlAttribList attrList;
DocImage *img = new DocImage(this,attrList,findAndCopyImage(g_token->name,t),t,"",inlineImage);
- m_children.append(img);
+ m_children.push_back(std::unique_ptr<DocImage>(img));
img->parse();
}
@@ -5098,7 +4977,7 @@ void DocPara::handleFile(const QCString &cmdName)
T *df = new T(this,name,g_context);
if (df->parse())
{
- m_children.append(df);
+ m_children.push_back(std::unique_ptr<T>(df));
}
else
{
@@ -5109,7 +4988,7 @@ void DocPara::handleFile(const QCString &cmdName)
void DocPara::handleVhdlFlow()
{
DocVhdlFlow *vf = new DocVhdlFlow(this);
- m_children.append(vf);
+ m_children.push_back(std::unique_ptr<DocVhdlFlow>(vf));
vf->parse();
}
@@ -5133,11 +5012,11 @@ void DocPara::handleLink(const QCString &cmdName,bool isJavaLink)
}
doctokenizerYYsetStatePara();
DocLink *lnk = new DocLink(this,g_token->name);
- m_children.append(lnk);
+ m_children.push_back(std::unique_ptr<DocLink>(lnk));
QCString leftOver = lnk->parse(isJavaLink);
if (!leftOver.isEmpty())
{
- m_children.append(new DocWord(this,leftOver));
+ m_children.push_back(std::make_unique<DocWord>(this,leftOver));
}
}
@@ -5162,7 +5041,7 @@ void DocPara::handleRef(const QCString &cmdName)
goto endref;
}
ref = new DocRef(this,g_token->name,g_context);
- m_children.append(ref);
+ m_children.push_back(std::unique_ptr<DocRef>(ref));
ref->parse();
endref:
doctokenizerYYsetStatePara();
@@ -5179,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;
}
@@ -5260,16 +5143,21 @@ void DocPara::handleInclude(const QCString &cmdName,DocInclude::Type t)
inc_line = lineBlock(inc_text, blockId);
inc_text = extractBlock(inc_text, blockId);
}
+
+ Markdown markdown(fileName,inc_line);
+ QCString strippedDoc = stripIndentation(inc_text);
+ QCString processedDoc = Config_getBool(MARKDOWN_SUPPORT) ? markdown.process(strippedDoc,inc_line) : strippedDoc;
+
docParserPushContext();
g_fileName = fileName;
setDoctokinizerLineNr(inc_line);
- internalValidatingParseDoc(this,m_children,inc_text);
+ internalValidatingParseDoc(this,m_children,processedDoc);
docParserPopContext();
}
else
{
DocInclude *inc = new DocInclude(this,fileName,g_context,t,g_isExample,g_exampleName,blockId,isBlock);
- m_children.append(inc);
+ m_children.push_back(std::unique_ptr<DocInclude>(inc));
inc->parse();
}
}
@@ -5307,7 +5195,7 @@ void DocPara::handleSection(const QCString &cmdName)
int DocPara::handleHtmlHeader(const HtmlAttribList &tagHtmlAttribs,int level)
{
DocHtmlHeader *header = new DocHtmlHeader(this,tagHtmlAttribs,level);
- m_children.append(header);
+ m_children.push_back(std::unique_ptr<DocHtmlHeader>(header));
int retval = header->parse();
return (retval==RetVal_OK) ? TK_NEWPARA : retval;
}
@@ -5340,7 +5228,7 @@ int DocPara::handleStartCode()
if (g_token->verb.at(i)=='\n') li=i+1;
i++;
}
- m_children.append(new DocVerbatim(this,g_context,stripIndentation(g_token->verb.mid(li)),DocVerbatim::Code,g_isExample,g_exampleName,FALSE,lang));
+ m_children.push_back(std::make_unique<DocVerbatim>(this,g_context,stripIndentation(g_token->verb.mid(li)),DocVerbatim::Code,g_isExample,g_exampleName,FALSE,lang));
if (retval==0) warn_doc_error(g_fileName,getDoctokinizerLineNr(),"code section ended without end marker");
doctokenizerYYsetStatePara();
return retval;
@@ -5350,11 +5238,11 @@ void DocPara::handleInheritDoc()
{
if (g_memberDef) // inheriting docs from a member
{
- MemberDef *reMd = g_memberDef->reimplements();
+ const MemberDef *reMd = g_memberDef->reimplements();
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)
@@ -5362,12 +5250,12 @@ void DocPara::handleInheritDoc()
g_context=g_scope->name();
}
g_memberDef=reMd;
- g_styleStack.clear();
- g_nodeStack.clear();
- g_copyStack.append(reMd);
+ while (!g_styleStack.empty()) g_styleStack.pop();
+ while (!g_nodeStack.empty()) g_nodeStack.pop();
+ g_copyStack.push_back(reMd);
internalValidatingParseDoc(this,m_children,reMd->briefDescription());
internalValidatingParseDoc(this,m_children,reMd->documentation());
- g_copyStack.remove(reMd);
+ g_copyStack.pop_back();
docParserPopContext(TRUE);
g_memberDef = thisMd;
}
@@ -5383,80 +5271,80 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
switch (cmdId)
{
case CMD_UNKNOWN:
- m_children.append(new DocWord(this,TK_COMMAND_CHAR(tok) + cmdName));
- warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Found unknown command '%c%s'",TK_COMMAND_CHAR(tok),qPrint(cmdName));
+ m_children.push_back(std::make_unique<DocWord>(this,TK_COMMAND_CHAR(tok) + cmdName));
+ warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Found unknown command '%s%s'",TK_COMMAND_CHAR(tok),qPrint(cmdName));
break;
case CMD_EMPHASIS:
- m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,cmdName,TRUE));
+ m_children.push_back(std::make_unique<DocStyleChange>(this,(uint)g_nodeStack.size(),DocStyleChange::Italic,cmdName,TRUE));
retval=handleStyleArgument(this,m_children,cmdName);
- m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,cmdName,FALSE));
- if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," "));
+ m_children.push_back(std::make_unique<DocStyleChange>(this,(uint)g_nodeStack.size(),DocStyleChange::Italic,cmdName,FALSE));
+ if (retval!=TK_WORD) m_children.push_back(std::make_unique<DocWhiteSpace>(this," "));
break;
case CMD_BOLD:
- m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Bold,cmdName,TRUE));
+ m_children.push_back(std::make_unique<DocStyleChange>(this,(uint)g_nodeStack.size(),DocStyleChange::Bold,cmdName,TRUE));
retval=handleStyleArgument(this,m_children,cmdName);
- m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Bold,cmdName,FALSE));
- if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," "));
+ m_children.push_back(std::make_unique<DocStyleChange>(this,(uint)g_nodeStack.size(),DocStyleChange::Bold,cmdName,FALSE));
+ if (retval!=TK_WORD) m_children.push_back(std::make_unique<DocWhiteSpace>(this," "));
break;
case CMD_CODE:
- m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,cmdName,TRUE));
+ m_children.push_back(std::make_unique<DocStyleChange>(this,(uint)g_nodeStack.size(),DocStyleChange::Code,cmdName,TRUE));
retval=handleStyleArgument(this,m_children,cmdName);
- m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,cmdName,FALSE));
- if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," "));
+ m_children.push_back(std::make_unique<DocStyleChange>(this,(uint)g_nodeStack.size(),DocStyleChange::Code,cmdName,FALSE));
+ if (retval!=TK_WORD) m_children.push_back(std::make_unique<DocWhiteSpace>(this," "));
break;
case CMD_BSLASH:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_BSlash));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_BSlash));
break;
case CMD_AT:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_At));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_At));
break;
case CMD_LESS:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Less));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Less));
break;
case CMD_GREATER:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Greater));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Greater));
break;
case CMD_AMP:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Amp));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Amp));
break;
case CMD_DOLLAR:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Dollar));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Dollar));
break;
case CMD_HASH:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Hash));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Hash));
break;
case CMD_PIPE:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Pipe));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Pipe));
break;
case CMD_DCOLON:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_DoubleColon));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_DoubleColon));
break;
case CMD_PERCENT:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Percent));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Percent));
break;
case CMD_NDASH:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Minus));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Minus));
break;
case CMD_MDASH:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Minus));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Minus));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Minus));
break;
case CMD_QUOTE:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Quot));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Quot));
break;
case CMD_PUNT:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Dot));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Dot));
break;
case CMD_PLUS:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Plus));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Plus));
break;
case CMD_MINUS:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Minus));
break;
case CMD_EQUAL:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Equal));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Equal));
break;
case CMD_SA:
g_inSeeBlock=TRUE;
@@ -5512,7 +5400,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
case CMD_LI:
{
DocSimpleList *sl=new DocSimpleList(this);
- m_children.append(sl);
+ m_children.push_back(std::unique_ptr<DocSimpleList>(sl));
retval = sl->parse();
}
break;
@@ -5550,7 +5438,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
{
doctokenizerYYsetStateHtmlOnly();
retval = doctokenizerYYlex();
- m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::HtmlOnly,g_isExample,g_exampleName,g_token->name=="block"));
+ m_children.push_back(std::make_unique<DocVerbatim>(this,g_context,g_token->verb,DocVerbatim::HtmlOnly,g_isExample,g_exampleName,g_token->name=="block"));
if (retval==0) warn_doc_error(g_fileName,getDoctokinizerLineNr(),"htmlonly section ended without end marker");
doctokenizerYYsetStatePara();
}
@@ -5559,7 +5447,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
{
doctokenizerYYsetStateManOnly();
retval = doctokenizerYYlex();
- m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::ManOnly,g_isExample,g_exampleName));
+ m_children.push_back(std::make_unique<DocVerbatim>(this,g_context,g_token->verb,DocVerbatim::ManOnly,g_isExample,g_exampleName));
if (retval==0) warn_doc_error(g_fileName,getDoctokinizerLineNr(),"manonly section ended without end marker");
doctokenizerYYsetStatePara();
}
@@ -5568,7 +5456,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
{
doctokenizerYYsetStateRtfOnly();
retval = doctokenizerYYlex();
- m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::RtfOnly,g_isExample,g_exampleName));
+ m_children.push_back(std::make_unique<DocVerbatim>(this,g_context,g_token->verb,DocVerbatim::RtfOnly,g_isExample,g_exampleName));
if (retval==0) warn_doc_error(g_fileName,getDoctokinizerLineNr(),"rtfonly section ended without end marker");
doctokenizerYYsetStatePara();
}
@@ -5577,7 +5465,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
{
doctokenizerYYsetStateLatexOnly();
retval = doctokenizerYYlex();
- m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::LatexOnly,g_isExample,g_exampleName));
+ m_children.push_back(std::make_unique<DocVerbatim>(this,g_context,g_token->verb,DocVerbatim::LatexOnly,g_isExample,g_exampleName));
if (retval==0) warn_doc_error(g_fileName,getDoctokinizerLineNr(),"latexonly section ended without end marker");
doctokenizerYYsetStatePara();
}
@@ -5586,7 +5474,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
{
doctokenizerYYsetStateXmlOnly();
retval = doctokenizerYYlex();
- m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::XmlOnly,g_isExample,g_exampleName));
+ m_children.push_back(std::make_unique<DocVerbatim>(this,g_context,g_token->verb,DocVerbatim::XmlOnly,g_isExample,g_exampleName));
if (retval==0) warn_doc_error(g_fileName,getDoctokinizerLineNr(),"xmlonly section ended without end marker");
doctokenizerYYsetStatePara();
}
@@ -5595,7 +5483,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
{
doctokenizerYYsetStateDbOnly();
retval = doctokenizerYYlex();
- m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::DocbookOnly,g_isExample,g_exampleName));
+ m_children.push_back(std::make_unique<DocVerbatim>(this,g_context,g_token->verb,DocVerbatim::DocbookOnly,g_isExample,g_exampleName));
if (retval==0) warn_doc_error(g_fileName,getDoctokinizerLineNr(),"docbookonly section ended without end marker");
doctokenizerYYsetStatePara();
}
@@ -5604,7 +5492,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
{
doctokenizerYYsetStateVerbatim();
retval = doctokenizerYYlex();
- m_children.append(new DocVerbatim(this,g_context,g_token->verb,DocVerbatim::Verbatim,g_isExample,g_exampleName));
+ m_children.push_back(std::make_unique<DocVerbatim>(this,g_context,g_token->verb,DocVerbatim::Verbatim,g_isExample,g_exampleName));
if (retval==0) warn_doc_error(g_fileName,getDoctokinizerLineNr(),"verbatim section ended without end marker");
doctokenizerYYsetStatePara();
}
@@ -5620,7 +5508,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
dv->setText(g_token->verb);
dv->setWidth(width);
dv->setHeight(height);
- m_children.append(dv);
+ m_children.push_back(std::unique_ptr<DocVerbatim>(dv));
if (retval==0) warn_doc_error(g_fileName,getDoctokinizerLineNr(),"dot section ended without end marker");
doctokenizerYYsetStatePara();
}
@@ -5636,7 +5524,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
dv->setText(g_token->verb);
dv->setWidth(width);
dv->setHeight(height);
- m_children.append(dv);
+ m_children.push_back(std::unique_ptr<DocVerbatim>(dv));
if (retval==0) warn_doc_error(g_fileName,getDoctokinizerLineNr(),"msc section ended without end marker");
doctokenizerYYsetStatePara();
}
@@ -5664,7 +5552,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
}
else
{
- m_children.append(dv);
+ m_children.push_back(std::unique_ptr<DocVerbatim>(dv));
}
if (retval==0) warn_doc_error(g_fileName,getDoctokinizerLineNr(),"startuml section ended without end marker");
doctokenizerYYsetStatePara();
@@ -5704,8 +5592,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
break;
case CMD_LINEBREAK:
{
- DocLineBreak *lb = new DocLineBreak(this);
- m_children.append(lb);
+ m_children.push_back(std::make_unique<DocLineBreak>(this));
}
break;
case CMD_ANCHOR:
@@ -5713,7 +5600,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
DocAnchor *anchor = handleAnchor(this);
if (anchor)
{
- m_children.append(anchor);
+ m_children.push_back(std::unique_ptr<DocAnchor>(anchor));
}
}
break;
@@ -5722,7 +5609,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
DocIndexEntry *ie = new DocIndexEntry(this,
g_scope!=Doxygen::globalScope?g_scope:0,
g_memberDef);
- m_children.append(ie);
+ m_children.push_back(std::unique_ptr<DocIndexEntry>(ie));
retval = ie->parse();
}
break;
@@ -5735,7 +5622,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
case CMD_PARBLOCK:
{
DocParBlock *block = new DocParBlock(this);
- m_children.append(block);
+ m_children.push_back(std::unique_ptr<DocParBlock>(block));
retval = block->parse();
}
break;
@@ -5833,7 +5720,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
case CMD_SECREFLIST:
{
DocSecRefList *list = new DocSecRefList(this);
- m_children.append(list);
+ m_children.push_back(std::unique_ptr<DocSecRefList>(list));
list->parse();
}
break;
@@ -5845,8 +5732,9 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
break;
case CMD_FORMULA:
{
- DocFormula *form=new DocFormula(this,g_token->id);
- m_children.append(form);
+ m_children.push_back(
+ std::make_unique<DocFormula>(
+ this,g_token->id));
}
break;
//case CMD_LANGSWITCH:
@@ -5858,7 +5746,7 @@ int DocPara::handleCommand(const QCString &cmdName, const int tok)
DocInternalRef *ref = handleInternalRef(this);
if (ref)
{
- m_children.append(ref);
+ m_children.push_back(std::unique_ptr<DocInternalRef>(ref));
ref->parse();
}
doctokenizerYYsetStatePara();
@@ -5887,13 +5775,11 @@ static bool findAttribute(const HtmlAttribList &tagHtmlAttribs,
QCString *result)
{
- HtmlAttribListIterator li(tagHtmlAttribs);
- HtmlAttrib *opt;
- for (li.toFirst();(opt=li.current());++li)
+ for (const auto &opt : tagHtmlAttribs)
{
- if (opt->name==attrName)
+ if (opt.name==attrName)
{
- *result = opt->value;
+ *result = opt.value;
return TRUE;
}
}
@@ -5909,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)
{
@@ -5917,7 +5803,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
if (!g_token->emptyTag)
{
DocHtmlList *list = new DocHtmlList(this,tagHtmlAttribs,DocHtmlList::Unordered);
- m_children.append(list);
+ m_children.push_back(std::unique_ptr<DocHtmlList>(list));
retval=list->parse();
}
break;
@@ -5925,7 +5811,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
if (!g_token->emptyTag)
{
DocHtmlList *list = new DocHtmlList(this,tagHtmlAttribs,DocHtmlList::Ordered);
- m_children.append(list);
+ m_children.push_back(std::unique_ptr<DocHtmlList>(list));
retval=list->parse();
}
break;
@@ -6006,7 +5892,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
if (!g_token->emptyTag)
{
DocHtmlDescList *list = new DocHtmlDescList(this,tagHtmlAttribs);
- m_children.append(list);
+ m_children.push_back(std::unique_ptr<DocHtmlDescList>(list));
retval=list->parse();
}
break;
@@ -6020,7 +5906,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
if (!g_token->emptyTag)
{
DocHtmlTable *table = new DocHtmlTable(this,tagHtmlAttribs);
- m_children.append(table);
+ m_children.push_back(std::unique_ptr<DocHtmlTable>(table));
retval=table->parse();
}
break;
@@ -6038,14 +5924,12 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
break;
case HTML_BR:
{
- DocLineBreak *lb = new DocLineBreak(this,tagHtmlAttribs);
- m_children.append(lb);
+ m_children.push_back(std::make_unique<DocLineBreak>(this,tagHtmlAttribs));
}
break;
case HTML_HR:
{
- DocHorRuler *hr = new DocHorRuler(this,tagHtmlAttribs);
- m_children.append(hr);
+ m_children.push_back(std::make_unique<DocHorRuler>(this,tagHtmlAttribs));
}
break;
case HTML_A:
@@ -6078,7 +5962,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
if (!g_token->emptyTag)
{
DocHtmlBlockQuote *block = new DocHtmlBlockQuote(this,tagHtmlAttribs);
- m_children.append(block);
+ m_children.push_back(std::unique_ptr<DocHtmlBlockQuote>(block));
retval = block->parse();
}
break;
@@ -6090,7 +5974,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
// fall through
case XML_VALUE:
case XML_PARA:
- if (!m_children.isEmpty())
+ if (!m_children.empty())
{
retval = TK_NEWPARA;
}
@@ -6137,11 +6021,11 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
QCString paramName;
if (findAttribute(tagHtmlAttribs,"name",&paramName))
{
- //printf("paramName=%s\n",paramName.data());
- m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,tagName,TRUE));
- m_children.append(new DocWord(this,paramName));
- m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Italic,tagName,FALSE));
- if (retval!=TK_WORD) m_children.append(new DocWhiteSpace(this," "));
+ //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));
+ if (retval!=TK_WORD) m_children.push_back(std::make_unique<DocWhiteSpace>(this," "));
}
else
{
@@ -6185,7 +6069,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
g_hasReturnCommand=TRUE;
break;
case XML_TERM:
- //m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Bold,TRUE));
+ //m_children.push_back(std::make_unique<DocStyleChange>(this,(uint)g_nodeStack.size(),DocStyleChange::Bold,TRUE));
if (insideTable(this))
{
retval=RetVal_TableCell;
@@ -6217,11 +6101,11 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
//ref->parse();
doctokenizerYYsetStatePara();
DocLink *lnk = new DocLink(this,cref);
- m_children.append(lnk);
+ m_children.push_back(std::unique_ptr<DocLink>(lnk));
QCString leftOver = lnk->parse(FALSE,TRUE);
if (!leftOver.isEmpty())
{
- m_children.append(new DocWord(this,leftOver));
+ m_children.push_back(std::make_unique<DocWord>(this,leftOver));
}
}
}
@@ -6230,9 +6114,9 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
bool inSeeBlock = g_inSeeBlock;
g_token->name = cref;
g_inSeeBlock = TRUE;
- m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,tagName,TRUE));
+ m_children.push_back(std::make_unique<DocStyleChange>(this,(uint)g_nodeStack.size(),DocStyleChange::Code,tagName,TRUE));
handleLinkedWord(this,m_children,TRUE);
- m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Code,tagName,FALSE));
+ m_children.push_back(std::make_unique<DocStyleChange>(this,(uint)g_nodeStack.size(),DocStyleChange::Code,tagName,FALSE));
g_inSeeBlock = inSeeBlock;
}
else
@@ -6250,20 +6134,18 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
unescapeCRef(cref);
// Look for an existing "see" section
DocSimpleSect *ss=0;
- QListIterator<DocNode> cli(m_children);
- DocNode *n;
- for (cli.toFirst();(n=cli.current());++cli)
+ for (const auto &n : m_children)
{
- if (n->kind()==Kind_SimpleSect && ((DocSimpleSect *)n)->type()==DocSimpleSect::See)
+ if (n->kind()==Kind_SimpleSect && ((DocSimpleSect *)n.get())->type()==DocSimpleSect::See)
{
- ss = (DocSimpleSect *)n;
+ ss = (DocSimpleSect *)n.get();
}
}
if (!ss) // start new section
{
ss=new DocSimpleSect(this,DocSimpleSect::See);
- m_children.append(ss);
+ m_children.push_back(std::unique_ptr<DocSimpleSect>(ss));
}
ss->appendLinkWord(cref);
@@ -6288,13 +6170,13 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
if (type=="table")
{
DocHtmlTable *table = new DocHtmlTable(this,emptyList);
- m_children.append(table);
+ m_children.push_back(std::unique_ptr<DocHtmlTable>(table));
retval=table->parseXml();
}
else
{
DocHtmlList *list = new DocHtmlList(this,emptyList,listType);
- m_children.append(list);
+ m_children.push_back(std::unique_ptr<DocHtmlList>(list));
retval=list->parseXml();
}
}
@@ -6306,7 +6188,7 @@ int DocPara::handleHtmlStartTag(const QCString &tagName,const HtmlAttribList &ta
break;
case HTML_UNKNOWN:
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Unsupported xml/html tag <%s> found", qPrint(tagName));
- m_children.append(new DocWord(this, "<"+tagName+g_token->attribsStr+">"));
+ m_children.push_back(std::make_unique<DocWord>(this, "<"+tagName+g_token->attribsStr+">"));
break;
case XML_INHERITDOC:
handleInheritDoc();
@@ -6476,7 +6358,7 @@ int DocPara::handleHtmlEndTag(const QCString &tagName)
break;
case XML_TERM:
- //m_children.append(new DocStyleChange(this,g_nodeStack.count(),DocStyleChange::Bold,FALSE));
+ //m_children.push_back(std::make_unique<DocStyleChange>(this,(uint)g_nodeStack.size(),DocStyleChange::Bold,FALSE));
break;
case XML_SUMMARY:
case XML_REMARKS:
@@ -6507,7 +6389,7 @@ int DocPara::handleHtmlEndTag(const QCString &tagName)
break;
case HTML_UNKNOWN:
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Unsupported xml/html tag </%s> found", qPrint(tagName));
- m_children.append(new DocWord(this,"</"+tagName+">"));
+ m_children.push_back(std::make_unique<DocWord>(this,"</"+tagName+">"));
break;
default:
// we should not get here!
@@ -6521,7 +6403,7 @@ int DocPara::handleHtmlEndTag(const QCString &tagName)
int DocPara::parse()
{
DBG(("DocPara::parse() start\n"));
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
// handle style commands "inherited" from the previous paragraph
handleInitialStyleCommands(this,m_children);
int tok;
@@ -6540,13 +6422,13 @@ reparsetoken:
switch(tok)
{
case TK_WORD:
- m_children.append(new DocWord(this,g_token->name));
+ m_children.push_back(std::make_unique<DocWord>(this,g_token->name));
break;
case TK_LNKWORD:
handleLinkedWord(this,m_children);
break;
case TK_URL:
- m_children.append(new DocURL(this,g_token->name,g_token->isEMailAddr));
+ m_children.push_back(std::make_unique<DocURL>(this,g_token->name,g_token->isEMailAddr));
break;
case TK_WHITESPACE:
{
@@ -6555,9 +6437,9 @@ reparsetoken:
if (insidePRE(this) || // all whitespace is relevant
(
// remove leading whitespace
- !m_children.isEmpty() &&
+ !m_children.empty() &&
// and whitespace after certain constructs
- (k=m_children.getLast()->kind())!=DocNode::Kind_HtmlDescList &&
+ (k=m_children.back()->kind())!=DocNode::Kind_HtmlDescList &&
k!=DocNode::Kind_HtmlTable &&
k!=DocNode::Kind_HtmlList &&
k!=DocNode::Kind_SimpleSect &&
@@ -6571,7 +6453,7 @@ reparsetoken:
)
)
{
- m_children.append(new DocWhiteSpace(this,g_token->chars));
+ m_children.push_back(std::make_unique<DocWhiteSpace>(this,g_token->chars));
}
}
break;
@@ -6608,7 +6490,7 @@ reparsetoken:
{
al = new DocAutoList(this,g_token->indent,
g_token->isEnumList,depth);
- m_children.append(al);
+ m_children.push_back(std::unique_ptr<DocAutoList>(al));
retval = al->parse();
} while (retval==TK_LISTITEM && // new list
al->indent()==g_token->indent // at same indent level
@@ -6694,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;
}
@@ -6779,7 +6661,7 @@ reparsetoken:
DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name);
if (s!=DocSymbol::Sym_Unknown)
{
- m_children.append(new DocSymbol(this,s));
+ m_children.push_back(std::make_unique<DocSymbol>(this,s));
}
else
{
@@ -6813,7 +6695,7 @@ reparsetoken:
// see if we are in a simple list
DocSimpleSect *ss=new DocSimpleSect(this,DocSimpleSect::Rcs);
- m_children.append(ss);
+ m_children.push_back(std::unique_ptr<DocSimpleSect>(ss));
ss->parseRcs();
}
break;
@@ -6826,9 +6708,8 @@ reparsetoken:
retval=0;
endparagraph:
handlePendingStyleCommands(this,m_children);
- DocNode *n = g_nodeStack.pop();
- ASSERT(n==this);
DBG(("DocPara::parse() end retval=%x\n",retval));
+ const DocNode *n = g_nodeStack.top();
if (!g_token->endTag && n->kind()==DocNode::Kind_Para &&
retval==TK_NEWPARA && g_token->name.lower() == "p")
{
@@ -6847,7 +6728,7 @@ int DocSection::parse()
{
DBG(("DocSection::parse() start %s level=%d\n",qPrint(g_token->sectionId),m_level));
int retval=RetVal_OK;
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
if (!m_id.isEmpty())
{
@@ -6871,7 +6752,7 @@ int DocSection::parse()
retval=par->parse();
if (!par->isEmpty())
{
- m_children.append(par);
+ m_children.push_back(std::unique_ptr<DocPara>(par));
lastPar=par;
}
else
@@ -6885,7 +6766,7 @@ int DocSection::parse()
if (retval==RetVal_Internal)
{
DocInternal *in = new DocInternal(this);
- m_children.append(in);
+ m_children.push_back(std::unique_ptr<DocInternal>(in));
retval = in->parse(m_level+1);
if (retval==RetVal_EndInternal)
{
@@ -6912,8 +6793,8 @@ int DocSection::parse()
while (retval==RetVal_Subsection) // more sections follow
{
DocSection *s=new DocSection(this,
- QMIN(2+Doxygen::subpageNestingLevel,5),g_token->sectionId);
- m_children.append(s);
+ std::min(2+Doxygen::subpageNestingLevel,5),g_token->sectionId);
+ m_children.push_back(std::unique_ptr<DocSection>(s));
retval = s->parse();
}
break;
@@ -6926,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);
- m_children.append(s);
+ 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]);
@@ -6940,8 +6821,8 @@ int DocSection::parse()
while (retval==RetVal_Paragraph) // more sections follow
{
DocSection *s=new DocSection(this,
- QMIN(4+Doxygen::subpageNestingLevel,5),g_token->sectionId);
- m_children.append(s);
+ std::min(4+Doxygen::subpageNestingLevel,5),g_token->sectionId);
+ m_children.push_back(std::unique_ptr<DocSection>(s));
retval = s->parse();
}
if (!(m_level<Doxygen::subpageNestingLevel+3 && (retval == RetVal_Subsection || retval == RetVal_Subsubsection))) break;
@@ -6962,8 +6843,6 @@ int DocSection::parse()
);
DBG(("DocSection::parse() end: retval=%x\n",retval));
- DocNode *n = g_nodeStack.pop();
- ASSERT(n==this);
return retval;
}
@@ -6972,7 +6851,7 @@ int DocSection::parse()
void DocText::parse()
{
DBG(("DocText::parse() start\n"));
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
doctokenizerYYsetStateText();
int tok;
@@ -6981,17 +6860,17 @@ void DocText::parse()
switch(tok)
{
case TK_WORD:
- m_children.append(new DocWord(this,g_token->name));
+ m_children.push_back(std::make_unique<DocWord>(this,g_token->name));
break;
case TK_WHITESPACE:
- m_children.append(new DocWhiteSpace(this,g_token->chars));
+ m_children.push_back(std::make_unique<DocWhiteSpace>(this,g_token->chars));
break;
case TK_SYMBOL:
{
DocSymbol::SymType s = DocSymbol::decodeSymbol(g_token->name);
if (s!=DocSymbol::Sym_Unknown)
{
- m_children.append(new DocSymbol(this,s));
+ m_children.push_back(std::make_unique<DocSymbol>(this,s));
}
else
{
@@ -7006,55 +6885,55 @@ void DocText::parse()
switch (Mappers::cmdMapper->map(g_token->name))
{
case CMD_BSLASH:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_BSlash));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_BSlash));
break;
case CMD_AT:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_At));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_At));
break;
case CMD_LESS:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Less));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Less));
break;
case CMD_GREATER:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Greater));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Greater));
break;
case CMD_AMP:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Amp));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Amp));
break;
case CMD_DOLLAR:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Dollar));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Dollar));
break;
case CMD_HASH:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Hash));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Hash));
break;
case CMD_DCOLON:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_DoubleColon));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_DoubleColon));
break;
case CMD_PERCENT:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Percent));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Percent));
break;
case CMD_NDASH:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Minus));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Minus));
break;
case CMD_MDASH:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Minus));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Minus));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Minus));
break;
case CMD_QUOTE:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Quot));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Quot));
break;
case CMD_PUNT:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Dot));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Dot));
break;
case CMD_PLUS:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Plus));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Plus));
break;
case CMD_MINUS:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Minus));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Minus));
break;
case CMD_EQUAL:
- m_children.append(new DocSymbol(this,DocSymbol::Sym_Equal));
+ m_children.push_back(std::make_unique<DocSymbol>(this,DocSymbol::Sym_Equal));
break;
default:
warn_doc_error(g_fileName,getDoctokinizerLineNr(),"Unexpected command '%s' found",
@@ -7071,8 +6950,6 @@ void DocText::parse()
handleUnclosedStyleCommands();
- DocNode *n = g_nodeStack.pop();
- ASSERT(n==this);
DBG(("DocText::parse() end\n"));
}
@@ -7082,7 +6959,7 @@ void DocText::parse()
void DocRoot::parse()
{
DBG(("DocRoot::parse() start\n"));
- g_nodeStack.push(this);
+ auto ns = AutoNodeStack(this);
doctokenizerYYsetStatePara();
int retval=0;
@@ -7094,9 +6971,9 @@ void DocRoot::parse()
DocPara *par = new DocPara(this);
if (isFirst) { par->markFirst(); isFirst=FALSE; }
retval=par->parse();
- if (!par->isEmpty() || par->attribs().count()>0)
+ if (!par->isEmpty() || !par->attribs().empty())
{
- m_children.append(par);
+ m_children.push_back(std::unique_ptr<DocPara>(par));
lastPar=par;
}
else
@@ -7117,8 +6994,8 @@ void DocRoot::parse()
if (sec)
{
DocSection *s=new DocSection(this,
- QMIN(4+Doxygen::subpageNestingLevel,5),g_token->sectionId);
- m_children.append(s);
+ std::min(4+Doxygen::subpageNestingLevel,5),g_token->sectionId);
+ m_children.push_back(std::unique_ptr<DocSection>(s));
retval = s->parse();
}
else
@@ -7146,8 +7023,8 @@ void DocRoot::parse()
if (sec)
{
DocSection *s=new DocSection(this,
- QMIN(3+Doxygen::subpageNestingLevel,5),g_token->sectionId);
- m_children.append(s);
+ std::min(3+Doxygen::subpageNestingLevel,5),g_token->sectionId);
+ m_children.push_back(std::unique_ptr<DocSection>(s));
retval = s->parse();
}
else
@@ -7177,8 +7054,8 @@ void DocRoot::parse()
if (sec)
{
DocSection *s=new DocSection(this,
- QMIN(2+Doxygen::subpageNestingLevel,5),g_token->sectionId);
- m_children.append(s);
+ std::min(2+Doxygen::subpageNestingLevel,5),g_token->sectionId);
+ m_children.push_back(std::unique_ptr<DocSection>(s));
retval = s->parse();
}
else
@@ -7201,7 +7078,7 @@ void DocRoot::parse()
if (retval==RetVal_Internal)
{
DocInternal *in = new DocInternal(this);
- m_children.append(in);
+ m_children.push_back(std::unique_ptr<DocInternal>(in));
retval = in->parse(1);
}
} while (retval!=0 && retval!=RetVal_Section);
@@ -7217,8 +7094,8 @@ void DocRoot::parse()
if (sec)
{
DocSection *s=new DocSection(this,
- QMIN(1+Doxygen::subpageNestingLevel,5),g_token->sectionId);
- m_children.append(s);
+ std::min(1+Doxygen::subpageNestingLevel,5),g_token->sectionId);
+ m_children.push_back(std::unique_ptr<DocSection>(s));
retval = s->parse();
}
else
@@ -7236,8 +7113,6 @@ void DocRoot::parse()
handleUnclosedStyleCommands();
- DocNode *n = g_nodeStack.pop();
- ASSERT(n==this);
DBG(("DocRoot::parse() end\n"));
}
@@ -7291,10 +7166,8 @@ static QCString extractCopyDocId(const char *data, uint &j, uint len)
j+=9;
}
e=j;
- 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]);
+ QCString id(data+s,e-s);
+ //printf("extractCopyDocId='%s' input='%s'\n",qPrint(id),&data[s]);
return id;
}
@@ -7334,7 +7207,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;
}
@@ -7345,7 +7218,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;
}
@@ -7376,37 +7249,38 @@ 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);
- if (g_copyStack.findRef(def)==-1) // definition not parsed earlier
+ //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
{
- g_copyStack.append(def);
+ g_copyStack.push_back(def);
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.remove(def);
+ g_copyStack.pop_back();
}
else
{
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;
@@ -7438,139 +7312,18 @@ static QCString processCopyDoc(const char *data,uint &len)
buf.addChar(0);
return buf.get();
}
-//---------------------------------------------------------------------------
-QString::Direction getTextDirByConfig(const QString &text)
-{
- QCString configDir = Config_getEnum(OUTPUT_TEXT_DIRECTION);
- if (configDir == "None")
- return QString::DirNeutral;
- if (configDir == "Context")
- return text.basicDirection();
- if (configDir == "LTR")
- {
- QString::Direction textDir = text.direction();
- if (textDir == QString::DirMixed)
- return QString::DirLTR;
- return textDir;
- }
- if (configDir == "RTL")
- {
- QString::Direction textDir = text.direction();
- if (textDir == QString::DirMixed)
- return QString::DirRTL;
- return textDir;
- }
- return QString::DirNeutral;
-}
-
-QString::Direction getTextDirByConfig(const DocNode *node)
-{
- QCString configDir = Config_getEnum(OUTPUT_TEXT_DIRECTION);
- if (configDir == "None")
- return QString::DirNeutral;
- if (configDir == "Context")
- return node->getTextBasicDir();
- if (configDir == "LTR")
- {
- QString::Direction textDir = node->getTextDir();
- if (textDir == QString::DirMixed)
- return QString::DirLTR;
- return textDir;
- }
- if (configDir == "RTL")
- {
- QString::Direction textDir = node->getTextDir();
- if (textDir == QString::DirMixed)
- return QString::DirRTL;
- return textDir;
- }
- return QString::DirNeutral;
-}
-QString::Direction getTextDirByConfig(const DocPara *para, int nodeIndex)
-{
- QCString configDir = Config_getEnum(OUTPUT_TEXT_DIRECTION);
- if (configDir == "None")
- return QString::DirNeutral;
- if (configDir == "Context")
- return para->getTextBasicDir(nodeIndex);
- if (configDir == "LTR")
- {
- QString::Direction textDir = para->getTextDir(nodeIndex);
- if (textDir == QString::DirMixed)
- return QString::DirLTR;
- return textDir;
- }
- if (configDir == "RTL")
- {
- QString::Direction textDir = para->getTextDir(nodeIndex);
- if (textDir == QString::DirMixed)
- return QString::DirRTL;
- return textDir;
- }
- return QString::DirNeutral;
-}
-
-QCString getDirHtmlClassOfNode(QString::Direction textDir, const QCString &initValue)
-{
- QCString classFromDir;
- if (textDir == QString::DirLTR)
- classFromDir = "DocNodeLTR";
- else if (textDir == QString::DirRTL)
- classFromDir = "DocNodeRTL";
- else
- classFromDir = "";
-
- if (initValue && !classFromDir.isEmpty())
- return QCString(" class=\"") + initValue + " " + classFromDir + "\"";
- if (initValue)
- return QCString(" class=\"") + initValue + "\"";
- if (!classFromDir.isEmpty())
- return QCString(" class=\"") + classFromDir + "\"";
- return "";
-}
-
-QCString getDirHtmlClassOfPage(QCString pageTitle)
-{
- QCString result = "";
- result += " class=\"PageDoc";
- QString::Direction titleDir = getTextDirByConfig(pageTitle);
- if (titleDir == QString::DirLTR)
- result += " PageDocLTR-title";
- else if (titleDir == QString::DirRTL)
- result += " PageDocRTL-title";
- result += "\"";
- return result;
-}
-
-QCString getHtmlDirEmbeddingChar(QString::Direction textDir)
-{
- if (textDir == QString::DirLTR)
- return "&#x202A;";
- if (textDir == QString::DirRTL)
- return "&#x202B;";
- return "";
-}
-
-QCString getJsDirEmbeddingChar(QString::Direction textDir)
-{
- if (textDir == QString::DirLTR)
- return "\\u202A";
- if (textDir == QString::DirRTL)
- return "\\u202B";
- return "";
-}
//---------------------------------------------------------------------------
-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);
@@ -7705,11 +7458,11 @@ 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;
- g_nodeStack.clear();
- g_styleStack.clear();
- g_initialStyleStack.clear();
+ while (!g_nodeStack.empty()) g_nodeStack.pop();
+ while (!g_styleStack.empty()) g_styleStack.pop();
+ while (!g_initialStyleStack.empty()) g_initialStyleStack.pop();
g_inSeeBlock = FALSE;
g_xmlComment = FALSE;
g_insideHtmlLink = FALSE;
@@ -7720,22 +7473,20 @@ DocRoot *validatingParseDoc(const char *fileName,int startLine,
g_exampleName = exampleName;
g_hasParamCommand = FALSE;
g_hasReturnCommand = FALSE;
- g_retvalsFound.setAutoDelete(FALSE);
g_retvalsFound.clear();
- g_paramsFound.setAutoDelete(FALSE);
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);
@@ -7761,13 +7512,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();
@@ -7779,9 +7530,9 @@ DocText *validatingParseText(const char *input)
g_fileName = "<parseText>";
g_relPath = "";
g_memberDef = 0;
- g_nodeStack.clear();
- g_styleStack.clear();
- g_initialStyleStack.clear();
+ while (!g_nodeStack.empty()) g_nodeStack.pop();
+ while (!g_styleStack.empty()) g_styleStack.pop();
+ while (!g_initialStyleStack.empty()) g_initialStyleStack.pop();
g_inSeeBlock = FALSE;
g_xmlComment = FALSE;
g_insideHtmlLink = FALSE;
@@ -7792,18 +7543,16 @@ DocText *validatingParseText(const char *input)
g_exampleName = "";
g_hasParamCommand = FALSE;
g_hasReturnCommand = FALSE;
- g_retvalsFound.setAutoDelete(FALSE);
g_retvalsFound.clear();
- g_paramsFound.setAutoDelete(FALSE);
g_paramsFound.clear();
g_searchUrl="";
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();
@@ -7822,9 +7571,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 1dc6b3f..3de54bd 100644
--- a/src/docparser.h
+++ b/src/docparser.h
@@ -20,11 +20,10 @@
#define _DOCPARSER_H
#include <stdio.h>
+#include <vector>
+#include <memory>
-#include <qlist.h>
-#include <qstring.h>
-#include <qcstring.h>
-
+#include "qcstring.h"
#include "docvisitor.h"
#include "htmlattrib.h"
@@ -34,15 +33,6 @@ class Definition;
class MemberGroup;
//---------------------------------------------------------------------------
-QString::Direction getTextDirByConfig(const QString &text);
-QString::Direction getTextDirByConfig(const DocNode *node);
-QString::Direction getTextDirByConfig(const DocPara *para, int nodeIndex);
-QCString getDirHtmlClassOfNode(QString::Direction textDir, const QCString &initValue="");
-QCString getDirHtmlClassOfPage(QCString pageTitle);
-QCString getHtmlDirEmbeddingChar(QString::Direction textDir);
-QCString getJsDirEmbeddingChar(QString::Direction textDir);
-//---------------------------------------------------------------------------
-
/*! Main entry point for the documentation parser.
* @param fileName File in which the documentation block is found (or the
@@ -66,22 +56,22 @@ QCString getJsDirEmbeddingChar(QString::Direction textDir);
* @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);
//---------------------------------------------------------------------------
@@ -169,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; }
@@ -181,59 +168,27 @@ class DocNode
bool m_insidePre = false;
};
+using DocNodeList = std::vector< std::unique_ptr<DocNode> >;
+
/** Default accept implementation for compound nodes in the abstract
* syntax tree.
*/
-template<class T> class CompAccept : public DocNode
+template<class T>
+class CompAccept : public DocNode
{
public:
- CompAccept() { m_children.setAutoDelete(TRUE); }
void accept(DocVisitor *v)
{
T *obj = dynamic_cast<T *>(this);
v->visitPre(obj);
- QListIterator<DocNode> cli(m_children);
- DocNode *n;
- for (cli.toFirst();(n=cli.current());++cli) n->accept(v);
+ for (const auto &n : m_children) n->accept(v);
v->visitPost(obj);
}
- const QList<DocNode> &children() const { return m_children; }
- QList<DocNode> &children() { return m_children; }
- QString::Direction getTextDir(uint nodeIndex) const
- {
- unsigned char resultDir = QString::DirNeutral;
- for (uint i = nodeIndex; i < m_children.count(); i++)
- {
- DocNode* node = m_children.at(i);
- QString::Direction nodeDir = node->getTextDir();
- resultDir |= (unsigned char)nodeDir;
- if (resultDir == QString::DirMixed)
- return QString::DirMixed;
- }
- return static_cast<QString::Direction>(resultDir);
- }
- QString::Direction getTextBasicDir(uint nodeIndex) const
- {
- for (uint i = nodeIndex; i < m_children.count(); i++)
- {
- DocNode* node = m_children.at(i);
- QString::Direction nodeDir = node->getTextBasicDir();
- if (nodeDir != QString::DirNeutral)
- return nodeDir;
- }
- return QString::DirNeutral;
- }
- virtual QString::Direction getTextDir() const
- {
- return getTextDir(0);
- }
- virtual QString::Direction getTextBasicDir() const
- {
- return getTextBasicDir(0);
- }
+ const DocNodeList &children() const { return m_children; }
+ DocNodeList &children() { return m_children; }
protected:
- QList<DocNode> m_children;
+ DocNodeList m_children;
};
@@ -246,8 +201,6 @@ class DocWord : public DocNode
QCString word() const { return m_word; }
Kind kind() const { return Kind_Word; }
void accept(DocVisitor *v) { v->visit(this); }
- virtual QString::Direction getTextDir() const { return QString(word()).direction(); };
- virtual QString::Direction getTextBasicDir() const { return QString(word()).basicDirection(); };
private:
QCString m_word;
@@ -269,8 +222,6 @@ class DocLinkedWord : public DocNode
QCString anchor() const { return m_anchor; }
QCString tooltip() const { return m_tooltip; }
void accept(DocVisitor *v) { v->visit(this); }
- virtual QString::Direction getTextDir() const { return QString(word()).direction(); };
- virtual QString::Direction getTextBasicDir() const { return QString(word()).basicDirection(); };
private:
QCString m_word;
@@ -291,8 +242,6 @@ class DocURL : public DocNode
Kind kind() const { return Kind_URL; }
void accept(DocVisitor *v) { v->visit(this); }
bool isEmail() const { return m_isEmail; }
- virtual QString::Direction getTextDir() const { return QString::DirLTR; };
- virtual QString::Direction getTextBasicDir() const { return QString::DirLTR; };
private:
QCString m_url;
@@ -555,11 +504,11 @@ class DocVerbatim : public DocNode
QCString relPath() const { return m_relPath; }
QCString language() const { return m_lang; }
bool isBlock() const { return m_isBlock; }
- bool hasCaption() const { return !m_children.isEmpty(); }
+ bool hasCaption() const { return !m_children.empty(); }
QCString width() const { return m_width; }
QCString height() const { return m_height; }
- const QList<DocNode> &children() const { return m_children; }
- QList<DocNode> &children() { return m_children; }
+ const DocNodeList &children() const { return m_children; }
+ DocNodeList &children() { return m_children; }
void setText(const QCString &t) { m_text=t; }
void setWidth(const QCString &w) { m_width=w; }
void setHeight(const QCString &h) { m_height=h; }
@@ -575,7 +524,7 @@ class DocVerbatim : public DocNode
bool m_isBlock = false;
QCString m_width;
QCString m_height;
- QList<DocNode> m_children;
+ DocNodeList m_children;
};
@@ -587,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; }
@@ -599,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; }
@@ -756,7 +705,7 @@ class DocTitle : public CompAccept<DocTitle>
void parse();
void parseFromString(const QCString &title);
Kind kind() const { return Kind_Title; }
- bool hasTitle() const { return !m_children.isEmpty(); }
+ bool hasTitle() const { return !m_children.empty(); }
private:
};
@@ -765,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; }
@@ -793,7 +742,7 @@ class DocImage : public CompAccept<DocImage>
Kind kind() const { return Kind_Image; }
Type type() const { return m_type; }
QCString name() const { return m_name; }
- bool hasCaption() const { return !m_children.isEmpty(); }
+ bool hasCaption() const { return !m_children.empty(); }
QCString width() const { return m_width; }
QCString height() const { return m_height; }
QCString relPath() const { return m_relPath; }
@@ -824,7 +773,7 @@ class DocDotFile : public CompAccept<DocDotFile>
QCString name() const { return m_name; }
QCString file() const { return m_file; }
QCString relPath() const { return m_relPath; }
- bool hasCaption() const { return !m_children.isEmpty(); }
+ bool hasCaption() const { return !m_children.empty(); }
QCString width() const { return m_width; }
QCString height() const { return m_height; }
QCString context() const { return m_context; }
@@ -847,7 +796,7 @@ class DocMscFile : public CompAccept<DocMscFile>
QCString name() const { return m_name; }
QCString file() const { return m_file; }
QCString relPath() const { return m_relPath; }
- bool hasCaption() const { return !m_children.isEmpty(); }
+ bool hasCaption() const { return !m_children.empty(); }
QCString width() const { return m_width; }
QCString height() const { return m_height; }
QCString context() const { return m_context; }
@@ -870,7 +819,7 @@ class DocDiaFile : public CompAccept<DocDiaFile>
QCString name() const { return m_name; }
QCString file() const { return m_file; }
QCString relPath() const { return m_relPath; }
- bool hasCaption() const { return !m_children.isEmpty(); }
+ bool hasCaption() const { return !m_children.empty(); }
QCString width() const { return m_width; }
QCString height() const { return m_height; }
QCString context() const { return m_context; }
@@ -890,7 +839,7 @@ class DocVhdlFlow : public CompAccept<DocVhdlFlow>
DocVhdlFlow(DocNode *parent);
void parse();
Kind kind() const { return Kind_VhdlFlow; }
- bool hasCaption() { return !m_children.isEmpty(); }
+ bool hasCaption() { return !m_children.empty(); }
private:
};
@@ -926,7 +875,7 @@ class DocRef : public CompAccept<DocRef>
QCString ref() const { return m_ref; }
QCString anchor() const { return m_anchor; }
QCString targetTitle() const { return m_text; }
- bool hasLinkText() const { return !m_children.isEmpty(); }
+ bool hasLinkText() const { return !m_children.empty(); }
bool refToAnchor() const { return m_refType==Anchor; }
bool refToSection() const { return m_refType==Section; }
bool refToTable() const { return m_refType==Table; }
@@ -1201,7 +1150,7 @@ class DocPara : public CompAccept<DocPara>
m_isFirst(FALSE), m_isLast(FALSE) { m_parent = parent; }
int parse();
Kind kind() const { return Kind_Para; }
- bool isEmpty() const { return m_children.isEmpty(); }
+ bool isEmpty() const { return m_children.empty(); }
void markFirst(bool v=TRUE) { m_isFirst=v; }
void markLast(bool v=TRUE) { m_isLast=v; }
bool isFirst() const { return m_isFirst; }
@@ -1240,21 +1189,21 @@ class DocPara : public CompAccept<DocPara>
HtmlAttribList m_attribs;
};
+using DocParaList = std::vector< std::unique_ptr<DocPara> >;
+
/** Node representing a parameter list. */
class DocParamList : public DocNode
{
public:
DocParamList(DocNode *parent,DocParamSect::Type t,DocParamSect::Direction d)
- : m_type(t), m_dir(d), m_isFirst(TRUE), m_isLast(TRUE)
- { m_paragraphs.setAutoDelete(TRUE);
- m_params.setAutoDelete(TRUE);
- m_paramTypes.setAutoDelete(TRUE);
+ : m_type(t), m_dir(d)
+ {
m_parent = parent;
}
virtual ~DocParamList() { }
Kind kind() const { return Kind_ParamList; }
- const QList<DocNode> &parameters() { return m_params; }
- const QList<DocNode> &paramTypes() { return m_paramTypes; }
+ DocNodeList &parameters() { return m_params; }
+ DocNodeList &paramTypes() { return m_paramTypes; }
DocParamSect::Type type() const { return m_type; }
DocParamSect::Direction direction() const { return m_dir; }
void markFirst(bool b=TRUE) { m_isFirst=b; }
@@ -1264,18 +1213,16 @@ class DocParamList : public DocNode
void accept(DocVisitor *v)
{
v->visitPre(this);
- QListIterator<DocPara> cli(m_paragraphs);
- DocNode *n;
- for (cli.toFirst();(n=cli.current());++cli) n->accept(v);
+ for (const auto &n : m_paragraphs) n->accept(v);
v->visitPost(this);
}
int parse(const QCString &cmdName);
int parseXml(const QCString &paramName);
private:
- QList<DocPara> m_paragraphs;
- QList<DocNode> m_params;
- QList<DocNode> m_paramTypes;
+ DocParaList m_paragraphs;
+ DocNodeList m_params;
+ DocNodeList m_paramTypes;
DocParamSect::Type m_type = DocParamSect::Unknown;
DocParamSect::Direction m_dir = DocParamSect::Unspecified;
bool m_isFirst = false;
@@ -1390,26 +1337,24 @@ class DocHtmlRow : public CompAccept<DocHtmlRow>
{
friend class DocHtmlTable;
public:
- DocHtmlRow(DocNode *parent,const HtmlAttribList &attribs) :
- m_attribs(attribs) { m_parent = parent; }
- Kind kind() const { return Kind_HtmlRow; }
- uint numCells() const { return m_children.count(); }
+ DocHtmlRow(DocNode *parent,const HtmlAttribList &attribs)
+ : m_attribs(attribs) { m_parent = parent; }
+ Kind kind() const { return Kind_HtmlRow; }
+ size_t numCells() const { return m_children.size(); }
const HtmlAttribList &attribs() const { return m_attribs; }
int parse();
int parseXml(bool header);
- bool isHeading() const { // a row is a table heading if all cells are marked as such
- bool heading=TRUE;
- QListIterator<DocNode> it(m_children);
- DocNode *n;
- for (;(n=it.current());++it)
- {
- if (n->kind()==Kind_HtmlCell)
+ bool isHeading() const { // a row is a table heading if all cells are marked as such
+ bool heading=TRUE;
+ for (const auto &n : m_children)
{
- heading = heading && ((DocHtmlCell*)n)->isHeading();
+ if (n->kind()==Kind_HtmlCell)
+ {
+ heading = heading && ((DocHtmlCell*)n.get())->isHeading();
+ }
}
+ return !m_children.empty() && heading;
}
- return m_children.count()>0 && heading;
- }
void setVisibleCells(uint n) { m_visibleCells = n; }
uint visibleCells() const { return m_visibleCells; }
uint rowIndex() const { return m_rowIdx; }
@@ -1429,25 +1374,24 @@ class DocHtmlTable : public CompAccept<DocHtmlTable>
: m_attribs(attribs) { m_caption=0; m_numCols=0; m_parent = parent; }
~DocHtmlTable() { delete m_caption; }
Kind kind() const { return Kind_HtmlTable; }
- uint numRows() const { return m_children.count(); }
+ size_t numRows() const { return m_children.size(); }
bool hasCaption() { return m_caption!=0; }
const HtmlAttribList &attribs() const { return m_attribs; }
int parse();
int parseXml();
- uint numColumns() const { return m_numCols; }
+ size_t numColumns() const { return m_numCols; }
void accept(DocVisitor *v);
DocHtmlCaption *caption() const { return m_caption; }
DocHtmlRow *firstRow() const {
- DocNode *n = m_children.getFirst();
- if (n && n->kind()==Kind_HtmlRow) return (DocHtmlRow*)n;
- return 0;
+ return (!m_children.empty() && m_children.front()->kind()==Kind_HtmlRow) ?
+ (DocHtmlRow*)m_children.front().get() : 0;
}
private:
void computeTableGrid();
DocHtmlCaption *m_caption = 0;
HtmlAttribList m_attribs;
- uint m_numCols = 0;
+ size_t m_numCols = 0;
};
/** Node representing an HTML blockquote */
@@ -1471,7 +1415,7 @@ class DocText : public CompAccept<DocText>
DocText() {}
Kind kind() const { return Kind_Text; }
void parse();
- bool isEmpty() const { return m_children.isEmpty(); }
+ bool isEmpty() const { return m_children.empty(); }
};
/** Root node of documentation tree */
@@ -1483,7 +1427,7 @@ class DocRoot : public CompAccept<DocRoot>
void parse();
bool indent() const { return m_indent; }
bool singleLine() const { return m_singleLine; }
- bool isEmpty() const { return m_children.isEmpty(); }
+ bool isEmpty() const { return m_children.empty(); }
private:
bool m_indent = false;
diff --git a/src/docsets.cpp b/src/docsets.cpp
index c59ca76..bf589c4 100644
--- a/src/docsets.cpp
+++ b/src/docsets.cpp
@@ -1,6 +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
@@ -13,7 +13,10 @@
*
*/
-#include <qfile.h>
+#include <set>
+#include <stack>
+#include <fstream>
+
#include "docsets.h"
#include "config.h"
#include "message.h"
@@ -24,20 +27,26 @@
#include "memberdef.h"
#include "namespacedef.h"
#include "util.h"
+#include "textstream.h"
+
+struct DocSets::Private
+{
+ QCString indent();
+ std::ofstream ntf;
+ TextStream nts;
+ std::ofstream ttf;
+ TextStream tts;
+ std::stack<bool> indentStack;
+ std::set<std::string> scopes;
+};
+
-DocSets::DocSets() : m_nodes(17), m_scopes(17)
+DocSets::DocSets() : p(std::make_unique<Private>())
{
- m_nf = 0;
- m_tf = 0;
- m_dc = 0;
- m_id = 0;
- m_nodes.setAutoDelete(TRUE);
}
DocSets::~DocSets()
{
- delete m_nf;
- delete m_tf;
}
void DocSets::initialize()
@@ -58,220 +67,209 @@ 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";
- m_nf = new QFile(notes);
- if (!m_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";
- m_nts.setDevice(m_nf);
- m_nts << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
- m_nts << "<DocSetNodes version=\"1.0\">" << endl;
- m_nts << " <TOC>" << endl;
- m_nts << " <Node>" << endl;
- m_nts << " <Name>Root</Name>" << endl;
- m_nts << " <Path>" << indexName << Doxygen::htmlFileExtension << "</Path>" << endl;
- m_nts << " <Subnodes>" << endl;
- m_dc = 1;
- m_firstNode.resize(m_dc);
- m_firstNode.at(0)=TRUE;
+ 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";
- m_tf = new QFile(tokens);
- if (!m_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));
}
- m_tts.setDevice(m_tf);
- m_tts << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
- m_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 (!m_firstNode.at(m_dc-1))
+ if (!p->indentStack.top())
{
- m_nts << indent() << " </Node>" << endl;
+ p->nts << p->indent() << " </Node>\n";
}
- m_dc--;
- m_nts << " </Subnodes>" << endl;
- m_nts << " </Node>" << endl;
- m_nts << " </TOC>" << endl;
- m_nts << "</DocSetNodes>" << endl;
- m_nf->close();
- delete m_nf;
- m_nf=0;
+ p->indentStack.pop();
+ p->nts << " </Subnodes>\n";
+ p->nts << " </Node>\n";
+ p->nts << " </TOC>\n";
+ p->nts << "</DocSetNodes>\n";
+ p->nts.flush();
+ p->ntf.close();
- m_tts << "</Tokens>" << endl;
- m_tf->close();
- delete m_tf;
- m_tf=0;
+ p->tts << "</Tokens>\n";
+ p->tts.flush();
+ p->ttf.close();
}
-QCString DocSets::indent()
+QCString DocSets::Private::indent()
{
QCString result;
- result.fill(' ',(m_dc+2)*2);
+ result.fill(' ',static_cast<int>(indentStack.size()+2)*2);
return result;
}
void DocSets::incContentsDepth()
{
- //printf("DocSets::incContentsDepth() m_dc=%d\n",m_dc);
- ++m_dc;
- m_nts << indent() << "<Subnodes>" << endl;
- m_firstNode.resize(m_dc);
- if (m_dc>0)
- {
- m_firstNode.at(m_dc-1)=TRUE;
- }
+ //printf("DocSets::incContentsDepth() depth=%zu\n",p->indentStack.size());
+ p->nts << p->indent() << "<Subnodes>\n";
+ p->indentStack.push(true);
}
void DocSets::decContentsDepth()
{
- if (!m_firstNode.at(m_dc-1))
+ if (!p->indentStack.top())
{
- m_nts << indent() << " </Node>" << endl;
+ p->nts << p->indent() << " </Node>\n";
}
- m_nts << indent() << "</Subnodes>" << endl;
- --m_dc;
- //printf("DocSets::decContentsDepth() m_dc=%d\n",m_dc);
+ 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*/)
{
(void)isDir;
- //printf("DocSets::addContentsItem(%s) m_dc=%d\n",name,m_dc);
+ //printf("DocSets::addContentsItem(%s) depth=%zu\n",name,p->indentStack.size());
if (ref==0)
{
- if (!m_firstNode.at(m_dc-1))
+ if (!p->indentStack.top())
{
- m_nts << indent() << " </Node>" << endl;
+ p->nts << p->indent() << " </Node>\n";
}
- m_firstNode.at(m_dc-1)=FALSE;
- m_nts << indent() << " <Node>" << endl;
- m_nts << indent() << " <Name>" << convertToXML(name) << "</Name>" << endl;
- if (file && file[0]=='^') // URL marker
+ p->indentStack.top()=false;
+ p->nts << p->indent() << " <Node>\n";
+ p->nts << p->indent() << " <Name>" << convertToXML(name) << "</Name>\n";
+ if (!file.isEmpty() && file[0]=='^') // URL marker
{
- m_nts << indent() << " <URL>" << convertToXML(&file[1])
- << "</URL>" << endl;
+ p->nts << p->indent() << " <URL>" << convertToXML(&file[1])
+ << "</URL>\n";
}
else // relative file
{
- m_nts << indent() << " <Path>";
- if (file && file[0]=='!') // user specified file
+ p->nts << p->indent() << " <Path>";
+ if (!file.isEmpty() && file[0]=='!') // user specified file
{
- m_nts << convertToXML(&file[1]);
+ p->nts << convertToXML(&file[1]);
}
- else if (file) // doxygen generated file
+ else if (!file.isEmpty()) // doxygen generated file
{
- m_nts << file << Doxygen::htmlFileExtension;
+ p->nts << file << Doxygen::htmlFileExtension;
}
- m_nts << "</Path>" << endl;
- if (file && anchor)
+ p->nts << "</Path>\n";
+ if (!file.isEmpty() && !anchor.isEmpty())
{
- m_nts << 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;
@@ -330,6 +328,7 @@ void DocSets::addIndexItem(const Definition *context,const MemberDef *md,
case SrcLangExt_SQL: lang="sql"; break; // Sql
case SrcLangExt_Markdown:lang="markdown"; break; // Markdown
case SrcLangExt_Slice: lang="slice"; break; // Slice
+ case SrcLangExt_Lex: lang="lex"; break; // Lex
case SrcLangExt_Unknown: lang="unknown"; break; // should not happen!
}
@@ -421,7 +420,7 @@ void DocSets::addIndexItem(const Definition *context,const MemberDef *md,
decl = fd->name();
}
}
- writeToken(m_tts,md,type,lang,scope,md->anchor(),decl);
+ writeToken(p->tts,md,type,lang,scope,md->anchor(),decl);
}
else if (context && context->isLinkable())
{
@@ -465,7 +464,7 @@ void DocSets::addIndexItem(const Definition *context,const MemberDef *md,
{
type = "cl";
}
- IncludeInfo *ii = cd->includeInfo();
+ const IncludeInfo *ii = cd->includeInfo();
if (ii)
{
decl=ii->includeName;
@@ -476,59 +475,59 @@ void DocSets::addIndexItem(const Definition *context,const MemberDef *md,
scope = nd->name();
type = "ns";
}
- if (m_scopes.find(context->getOutputFileBase())==0)
+ if (p->scopes.find(context->getOutputFileBase().str())==p->scopes.end())
{
- writeToken(m_tts,context,type,lang,scope,0,decl);
- m_scopes.append(context->getOutputFileBase(),(void*)0x8);
+ 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 0d75bfd..03146f1 100644
--- a/src/docsets.h
+++ b/src/docsets.h
@@ -1,10 +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.
*
@@ -16,16 +16,17 @@
#ifndef DOCSETS_H
#define DOCSETS_H
-#include "sortdict.h"
-#include "ftextstream.h"
+#include <memory>
+
#include "index.h"
-class QFile;
+class TextStream;
+
class Definition;
/** A class that generates docset files.
*
- * These files can be used to create context help
+ * These files can be used to create context help
* for use within Apple's Xcode 3.0 development environment
*/
class DocSets : public IndexIntf
@@ -39,47 +40,28 @@ 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);
- struct NodeDef
- {
- NodeDef(bool d,const QCString &n,const QCString &r,
- const QCString &f,const QCString &a,int i) :
- isDir(d), name(n), ref(r), file(f), anchor(a),id(i) {}
- bool isDir;
- QCString name;
- QCString ref;
- QCString file;
- QCString anchor;
- int id;
- };
- QCString indent();
- QFile *m_nf;
- QFile *m_tf;
- FTextStream m_nts;
- FTextStream m_tts;
- int m_dc;
- int m_id;
- QArray<bool> m_firstNode;
- SDict<NodeDef> m_nodes;
- SDict<void> m_scopes;
+ const QCString &scope=QCString(), const QCString &anchor=QCString(),
+ const QCString &decl=QCString());
+ struct Private;
+ std::unique_ptr<Private> p;
+
};
#endif /* DOCSETS_H */
diff --git a/src/doctokenizer.h b/src/doctokenizer.h
index 235b403..02dbecd 100644
--- a/src/doctokenizer.h
+++ b/src/doctokenizer.h
@@ -19,10 +19,10 @@
#ifndef _DOCTOKENIZER_H
#define _DOCTOKENIZER_H
-#include <qcstring.h>
-#include <qlist.h>
#include <stdio.h>
+
#include "htmlattrib.h"
+#include "qcstring.h"
class Definition;
@@ -124,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();
@@ -157,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 63a49ca..bfbc345 100644
--- a/src/doctokenizer.l
+++ b/src/doctokenizer.l
@@ -25,12 +25,9 @@
%{
#include <ctype.h>
-
-#include <qfile.h>
-#include <qstring.h>
-#include <qstack.h>
-#include <qdict.h>
-#include <qregexp.h>
+#include <stack>
+#include <string>
+#include <cassert>
#include "doctokenizer.h"
#include "cmdmapper.h"
@@ -42,6 +39,7 @@
#include "doxygen.h"
#include "portable.h"
#include "cite.h"
+#include "regex.h"
#define YY_NO_INPUT 1
#define YY_NO_UNISTD_H 1
@@ -72,6 +70,8 @@ static int g_autoListLevel;
struct DocLexerContext
{
+ DocLexerContext(TokenInfo *tk,int r,int lvl,yy_size_t pos,const char *s,YY_BUFFER_STATE bs)
+ : token(tk), rule(r), autoListLevel(lvl), inputPos(pos), inputString(s), state(bs) {}
TokenInfo *token;
int rule;
int autoListLevel;
@@ -80,7 +80,7 @@ struct DocLexerContext
YY_BUFFER_STATE state;
};
-static QStack<DocLexerContext> g_lexerStack;
+static std::stack< std::unique_ptr<DocLexerContext> > g_lexerStack;
static int g_yyLineNr = 0;
@@ -94,39 +94,34 @@ static const char *stateToString(int state);
void doctokenizerYYpushContext()
{
- DocLexerContext *ctx = new DocLexerContext;
- ctx->rule = YY_START;
- ctx->autoListLevel = g_autoListLevel;
- ctx->token = g_token;
- ctx->inputPos = g_inputPos;
- ctx->inputString = g_inputString;
- ctx->state = YY_CURRENT_BUFFER;
- g_lexerStack.push(ctx);
+ g_lexerStack.push(
+ std::make_unique<DocLexerContext>(
+ g_token,YY_START,g_autoListLevel,g_inputPos,g_inputString,YY_CURRENT_BUFFER));
yy_switch_to_buffer(yy_create_buffer(doctokenizerYYin, YY_BUF_SIZE));
}
bool doctokenizerYYpopContext()
{
- if (g_lexerStack.isEmpty()) return FALSE;
- DocLexerContext *ctx = g_lexerStack.pop();
+ if (g_lexerStack.empty()) return FALSE;
+ const auto &ctx = g_lexerStack.top();
g_autoListLevel = ctx->autoListLevel;
g_inputPos = ctx->inputPos;
g_inputString = ctx->inputString;
yy_delete_buffer(YY_CURRENT_BUFFER);
yy_switch_to_buffer(ctx->state);
BEGIN(ctx->rule);
- delete ctx;
+ g_lexerStack.pop();
return TRUE;
}
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
@@ -158,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++)
@@ -185,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)
{
@@ -193,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)
@@ -205,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;
@@ -297,8 +293,8 @@ static void handleHtmlTag()
{
}
//printf("=====> Adding option name=<%s> value=<%s>\n",
- // opt.name.data(),opt.value.data());
- g_token->attribs.append(&opt);
+ // qPrint(opt.name),qPrint(opt.value));
+ g_token->attribs.push_back(opt);
}
g_token->attribsStr = tagText.mid(startAttribList,i-startAttribList);
}
@@ -369,6 +365,7 @@ CMD ("\\"|"@")
WS [ \t\r\n]
NONWS [^ \t\r\n]
BLANK [ \t\r]
+BLANKopt {BLANK}*
ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
PHPTYPE [\\:a-z_A-Z0-9\x80-\xFF\-]+
@@ -378,7 +375,7 @@ CITEID {CITESCHAR}{CITEECHAR}*("."{CITESCHAR}{CITEECHAR}*)*|"\""{CITESCHAR}{C
MAILADDR ("mailto:")?[a-z_A-Z0-9.+-]+"@"[a-z_A-Z0-9-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-]+
MAILWS [\t a-z_A-Z0-9+-]
MAILADDR2 {MAILWS}+{BLANK}+("at"|"AT"|"_at_"|"_AT_"){BLANK}+{MAILWS}+("dot"|"DOT"|"_dot_"|"_DOT_"){BLANK}+{MAILWS}+
-OPTSTARS ("//"{BLANK}*)?"*"*{BLANK}*
+OPTSTARS ("/""/"{BLANK}*)?"*"*{BLANK}*
LISTITEM {BLANK}*[-]("#")?{WS}
MLISTITEM {BLANK}*[+*]{WS}
OLISTITEM {BLANK}*[1-9][0-9]*"."{BLANK}
@@ -502,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);
@@ -517,9 +515,12 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
else
{
lineCount(yytext,yyleng);
- QCString text=yytext;
- static QRegExp re("[*+]");
- int listPos = text.findRev(re);
+ 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);
@@ -533,23 +534,26 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
}
else
{
- QCString text=yytext;
- static QRegExp re("[1-9]");
- int digitPos = text.find(re);
- int dotPos = text.find('.',digitPos);
- g_token->isEnumList = TRUE;
- g_token->id = atoi(QCString(yytext).mid(digitPos,dotPos-digitPos));
- g_token->indent = computeIndent(yytext,digitPos);
+ 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,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 */
@@ -560,12 +564,15 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
else
{
lineCount(yytext,yyleng);
- QCString text=extractPartAfterNewLine(yytext);
- static QRegExp re("[*+]");
- int markPos = text.findRev(re);
+ 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,markPos);
+ g_token->indent = computeIndent(text.c_str(),markPos);
return TK_LISTITEM;
}
}
@@ -577,30 +584,33 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
else
{
lineCount(yytext,yyleng);
- QCString text=extractPartAfterNewLine(yytext);
- static QRegExp re("[1-9]");
- int digitPos = text.find(re);
- int dotPos = text.find('.',digitPos);
- g_token->isEnumList = TRUE;
- g_token->id = atoi(QCString(text).mid(digitPos,dotPos-digitPos));
- g_token->indent = computeIndent(text,digitPos);
+ 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(),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}+ {
+<St_Para>"{"{BLANK}*"@link"/{WS}+ {
g_token->name = "javalink";
return TK_COMMAND_AT;
}
@@ -713,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));
@@ -812,7 +822,7 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
}
lineCount(yytext,yyleng);
}
-<St_Para>({BLANK}*(\n|"\\ilinebr"))+{BLANK}*(\n|"\\ilinebr"){BLANK}* {
+<St_Para,St_Param>({BLANK}*(\n|"\\ilinebr"))+{BLANK}*(\n|"\\ilinebr"){BLANK}* {
lineCount(yytext,yyleng);
if (g_insidePre)
{
@@ -821,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++)
@@ -969,11 +979,11 @@ RCSID "$"("Author"|"Date"|"Header"|"Id"|"Locker"|"Log"|"Name"|"RCSfile"|"Revisio
g_token->sectionId = QCString(yytext).stripWhiteSpace();
return RetVal_OK;
}
-<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANK}*/\n { // case 4: plain file name specified without title or attributes
+<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANKopt}/\n { // case 4: plain file name specified without title or attributes
g_token->sectionId = QCString(yytext).stripWhiteSpace();
return RetVal_OK;
}
-<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANK}*/"\\ilinebr" { // case 5: plain file name specified without title or attributes
+<St_PlantUMLOpt>{BLANK}*{FILEMASK}{BLANKopt}/"\\ilinebr" { // case 5: plain file name specified without title or attributes
g_token->sectionId = QCString(yytext).stripWhiteSpace();
return RetVal_OK;
}
@@ -1229,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;
@@ -1245,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;
@@ -1296,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;
}
@@ -1339,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
{
@@ -1425,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);
}
@@ -1500,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;
@@ -1513,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;
@@ -1719,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 d46d8c0..506c9f8 100644
--- a/src/docvisitor.cpp
+++ b/src/docvisitor.cpp
@@ -14,6 +14,7 @@
#include <unordered_map>
+#include <stack>
#include "parserintf.h"
#include "docvisitor.h"
@@ -25,6 +26,7 @@ struct DocVisitor::Private
{
int id;
std::unordered_map< std::string, std::unique_ptr<CodeParserInterface> > parserFactoryMap;
+ std::stack<bool> hidden;
};
DocVisitor::DocVisitor(int id) : m_p(std::make_unique<Private>())
@@ -36,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.
@@ -56,3 +58,16 @@ int DocVisitor::id() const
{
return m_p->id;
}
+
+void DocVisitor::pushHidden(bool hide)
+{
+ m_p->hidden.push(hide);
+}
+
+bool DocVisitor::popHidden()
+{
+ if (m_p->hidden.empty()) return false;
+ bool v = m_p->hidden.top();
+ m_p->hidden.pop();
+ return v;
+}
diff --git a/src/docvisitor.h b/src/docvisitor.h
index 4d4b263..b19e76e 100644
--- a/src/docvisitor.h
+++ b/src/docvisitor.h
@@ -1,6 +1,6 @@
/******************************************************************************
*
- * Copyright (C) 1997-2020 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
@@ -18,6 +18,8 @@
#include <memory>
+#include "qcstring.h"
+
// ids
const int DocVisitor_Html = 0;
const int DocVisitor_Latex = 1;
@@ -95,7 +97,9 @@ 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();
/*! @name Visitor functions for leaf nodes
* @{
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 d14c38a..219d1d5 100644
--- a/src/dot.h
+++ b/src/dot.h
@@ -16,18 +16,16 @@
#ifndef DOT_H
#define DOT_H
-#include <qcstring.h>
#include <map>
-#include "sortdict.h"
-
+#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
@@ -35,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:
@@ -50,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 cbd62ef..1f77e33 100644
--- a/src/dotcallgraph.cpp
+++ b/src/dotcallgraph.cpp
@@ -36,10 +36,11 @@ void DotCallGraph::buildGraph(DotNode *n,const MemberDef *md,int distance)
if (rmd->showInCallGraph())
{
QCString uniqueId = getUniqueId(rmd);
- DotNode *bn = m_usedNodes->find(uniqueId);
- if (bn) // file is already a node in the graph
+ auto it = m_usedNodes.find(uniqueId.str());
+ if (it!=m_usedNodes.end()) // file is already a node in the graph
{
- n->addChild(bn,0,0,0);
+ DotNode *bn = it->second;
+ n->addChild(bn,0,0);
bn->addParent(n);
bn->setDistance(distance);
}
@@ -56,17 +57,17 @@ void DotCallGraph::buildGraph(DotNode *n,const MemberDef *md,int distance)
name = rmd->qualifiedName();
}
QCString tooltip = rmd->briefDescriptionAsTooltip();
- bn = new DotNode(
+ DotNode *bn = new DotNode(
getNextNodeNumber(),
linkToText(rmd->getLanguage(),name,FALSE),
tooltip,
uniqueId,
0 //distance
);
- n->addChild(bn,0,0,0);
+ n->addChild(bn,0,0);
bn->addParent(n);
bn->setDistance(distance);
- m_usedNodes->insert(uniqueId,bn);
+ m_usedNodes.insert(std::make_pair(uniqueId.str(),bn));
buildGraph(bn,rmd,distance+1);
}
@@ -74,48 +75,40 @@ void DotCallGraph::buildGraph(DotNode *n,const MemberDef *md,int distance)
}
}
-void DotCallGraph::determineVisibleNodes(QList<DotNode> &queue, int &maxNodes)
+void DotCallGraph::determineVisibleNodes(DotNodeDeque &queue, int &maxNodes)
{
- while (queue.count()>0 && maxNodes>0)
+ while (!queue.empty() && maxNodes>0)
{
- DotNode *n = queue.take(0);
+ DotNode *n = queue.front();
+ queue.pop_front();
if (!n->isVisible() && n->distance()<=Config_getInt(MAX_DOT_GRAPH_DEPTH)) // not yet processed
{
n->markAsVisible();
maxNodes--;
// add direct children
- if (n->children())
+ for (const auto &dn : n->children())
{
- QListIterator<DotNode> li(*n->children());
- DotNode *dn;
- for (li.toFirst();(dn=li.current());++li)
- {
- queue.append(dn);
- }
+ queue.push_back(dn);
}
}
}
}
-void DotCallGraph::determineTruncatedNodes(QList<DotNode> &queue)
+void DotCallGraph::determineTruncatedNodes(DotNodeDeque &queue)
{
- while (queue.count()>0)
+ while (!queue.empty())
{
- DotNode *n = queue.take(0);
+ DotNode *n = queue.front();
+ queue.pop_front();
if (n->isVisible() && n->isTruncated()==DotNode::Unknown)
{
bool truncated = FALSE;
- if (n->children())
+ for (const auto &dn : n->children())
{
- QListIterator<DotNode> li(*n->children());
- const DotNode *dn;
- for (li.toFirst();(dn=li.current());++li)
- {
- if (!dn->isVisible())
- truncated = TRUE;
- else
- queue.append(dn);
- }
+ if (!dn->isVisible())
+ truncated = TRUE;
+ else
+ queue.push_back(dn);
}
n->markAsTruncated(truncated);
}
@@ -141,27 +134,25 @@ 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);
- m_usedNodes = new QDict<DotNode>(1009);
- m_usedNodes->insert(uniqueId,m_startNode);
+ m_usedNodes.insert(std::make_pair(uniqueId.str(),m_startNode));
buildGraph(m_startNode,md,1);
int maxNodes = Config_getInt(DOT_GRAPH_MAX_NODES);
- QList<DotNode> openNodeQueue;
- openNodeQueue.append(m_startNode);
+ DotNodeDeque openNodeQueue;
+ openNodeQueue.push_back(m_startNode);
determineVisibleNodes(openNodeQueue,maxNodes);
openNodeQueue.clear();
- openNodeQueue.append(m_startNode);
+ openNodeQueue.push_back(m_startNode);
determineTruncatedNodes(openNodeQueue);
}
DotCallGraph::~DotCallGraph()
{
DotNode::deleteNodes(m_startNode);
- delete m_usedNodes;
}
QCString DotCallGraph::getBaseName() const
@@ -188,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);
@@ -201,7 +192,7 @@ QCString DotCallGraph::writeGraph(
bool DotCallGraph::isTrivial() const
{
- return m_startNode->children()==0;
+ return m_startNode->children().empty();
}
bool DotCallGraph::isTooBig() const
@@ -211,6 +202,6 @@ bool DotCallGraph::isTooBig() const
int DotCallGraph::numNodes() const
{
- return m_startNode->children() ? m_startNode->children()->count() : 0;
+ return (int)m_startNode->children().size();
}
diff --git a/src/dotcallgraph.h b/src/dotcallgraph.h
index bba976c..e8361a2 100644
--- a/src/dotcallgraph.h
+++ b/src/dotcallgraph.h
@@ -16,8 +16,8 @@
#ifndef DOTCALLGRAPH_H
#define DOTCALLGRAPH_H
+#include "dotnode.h"
#include "dotgraph.h"
-#include "ftextstream.h"
#include "memberdef.h"
/** Representation of an call graph */
@@ -29,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:
@@ -41,10 +41,10 @@ class DotCallGraph : public DotGraph
private:
void buildGraph(DotNode *n,const MemberDef *md,int distance);
- void determineVisibleNodes(QList<DotNode> &queue, int &maxNodes);
- void determineTruncatedNodes(QList<DotNode> &queue);
+ void determineVisibleNodes(DotNodeDeque &queue, int &maxNodes);
+ void determineTruncatedNodes(DotNodeDeque &queue);
DotNode *m_startNode;
- QDict<DotNode> *m_usedNodes;
+ DotNodeMap m_usedNodes;
bool m_inverse;
QCString m_diskName;
const Definition * m_scope;
diff --git a/src/dotclassgraph.cpp b/src/dotclassgraph.cpp
index e719d79..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,10 +53,11 @@ 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);
- DotNode *bn = m_usedNodes->find(fullName);
- if (bn) // class already inserted
+ // 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
{
+ DotNode *bn = it->second;
if (base)
{
n->addChild(bn,prot,edgeStyle,label);
@@ -65,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
{
@@ -81,10 +85,10 @@ void DotClassGraph::addClass(const ClassDef *cd,DotNode *n,int prot,
}
}
QCString tooltip = cd->briefDescriptionAsTooltip();
- bn = new DotNode(getNextNodeNumber(),
+ DotNode *bn = new DotNode(getNextNodeNumber(),
displayName,
tooltip,
- tmp_url.data(),
+ tmp_url,
FALSE, // rootNode
cd
);
@@ -99,44 +103,38 @@ void DotClassGraph::addClass(const ClassDef *cd,DotNode *n,int prot,
n->addParent(bn);
}
bn->setDistance(distance);
- m_usedNodes->insert(fullName,bn);
+ 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);
}
}
-void DotClassGraph::determineTruncatedNodes(QList<DotNode> &queue,bool includeParents)
+void DotClassGraph::determineTruncatedNodes(DotNodeDeque &queue,bool includeParents)
{
- while (queue.count()>0)
+ while (!queue.empty())
{
- DotNode *n = queue.take(0);
+ DotNode *n = queue.front();
+ queue.pop_front();
if (n->isVisible() && n->isTruncated()==DotNode::Unknown)
{
bool truncated = FALSE;
- if (n->children())
+ for (const auto &dn : n->children())
{
- QListIterator<DotNode> li(*n->children());
- const DotNode *dn;
- for (li.toFirst();(dn=li.current());++li)
- {
- if (!dn->isVisible())
- truncated = TRUE;
- else
- queue.append(dn);
- }
+ if (!dn->isVisible())
+ truncated = TRUE;
+ else
+ queue.push_back(dn);
}
- if (n->parents() && includeParents)
+ if (includeParents)
{
- QListIterator<DotNode> li(*n->parents());
- const DotNode *dn;
- for (li.toFirst();(dn=li.current());++li)
+ for (const auto &dn : n->parents())
{
if (!dn->isVisible())
truncated = TRUE;
else
- queue.append(dn);
+ queue.push_back(dn);
}
}
n->markAsTruncated(truncated);
@@ -147,19 +145,20 @@ void DotClassGraph::determineTruncatedNodes(QList<DotNode> &queue,bool includePa
bool DotClassGraph::determineVisibleNodes(DotNode *rootNode,
int maxNodes,bool includeParents)
{
- QList<DotNode> childQueue;
- QList<DotNode> parentQueue;
+ DotNodeDeque childQueue;
+ DotNodeDeque parentQueue;
IntVector childTreeWidth;
IntVector parentTreeWidth;
- childQueue.append(rootNode);
- if (includeParents) parentQueue.append(rootNode);
+ childQueue.push_back(rootNode);
+ if (includeParents) parentQueue.push_back(rootNode);
bool firstNode=TRUE; // flag to force reprocessing rootNode in the parent loop
// despite being marked visible in the child loop
- while ((childQueue.count()>0 || parentQueue.count()>0) && maxNodes>0)
+ while ((!childQueue.empty() || !parentQueue.empty()) && maxNodes>0)
{
- if (childQueue.count()>0)
+ if (!childQueue.empty())
{
- DotNode *n = childQueue.take(0);
+ DotNode *n = childQueue.front();
+ childQueue.pop_front();
int distance = n->distance();
if (!n->isVisible() && distance<=Config_getInt(MAX_DOT_GRAPH_DEPTH)) // not yet processed
{
@@ -168,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();
@@ -176,20 +175,16 @@ bool DotClassGraph::determineVisibleNodes(DotNode *rootNode,
n->markAsVisible();
maxNodes--;
// add direct children
- if (n->children())
+ for (const auto &dn : n->children())
{
- QListIterator<DotNode> li(*n->children());
- const DotNode *dn;
- for (li.toFirst();(dn=li.current());++li)
- {
- childQueue.append(dn);
- }
+ childQueue.push_back(dn);
}
}
}
- if (includeParents && parentQueue.count()>0)
+ if (includeParents && !parentQueue.empty())
{
- DotNode *n = parentQueue.take(0);
+ DotNode *n = parentQueue.front();
+ parentQueue.pop_front();
if ((!n->isVisible() || firstNode) && n->distance()<=Config_getInt(MAX_DOT_GRAPH_DEPTH)) // not yet processed
{
firstNode=FALSE;
@@ -199,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();
@@ -207,21 +202,16 @@ bool DotClassGraph::determineVisibleNodes(DotNode *rootNode,
n->markAsVisible();
maxNodes--;
// add direct parents
- if (n->parents())
+ for (const auto &dn : n->parents())
{
- QListIterator<DotNode> li(*n->parents());
- const DotNode *dn;
- for (li.toFirst();(dn=li.current());++li)
- {
- parentQueue.append(dn);
- }
+ parentQueue.push_back(dn);
}
}
}
}
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++)
{
@@ -260,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)
@@ -268,43 +258,30 @@ 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)
{
// ---- Add usage relations
- UsesClassDict *dict =
- base ? cd->usedImplementationClasses() :
- cd->usedByImplementationClasses()
- ;
- if (dict)
+ const UsesClassList &list = base ? cd->usedImplementationClasses() :
+ cd->usedByImplementationClasses() ;
+ for (const auto &ucd : list)
{
- UsesClassDictIterator ucdi(*dict);
- UsesClassDef *ucd;
- for (;(ucd=ucdi.current());++ucdi)
- {
- //printf("addClass: %s templSpec=%s\n",ucd->classDef->name().data(),ucd->templSpecifiers.data());
- addClass(ucd->classDef,n,EdgeInfo::Purple,joinLabels(ucd->accessors),0,
- ucd->templSpecifiers,base,distance);
- }
+ //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);
}
}
if (Config_getBool(TEMPLATE_RELATIONS) && base)
{
- ConstraintClassDict *dict = cd->templateTypeConstraints();
- if (dict)
+ for (const auto &ccd : cd->templateTypeConstraints())
{
- ConstraintClassDictIterator ccdi(*dict);
- ConstraintClassDef *ccd;
- for (;(ccd=ccdi.current());++ccdi)
- {
- //printf("addClass: %s templSpec=%s\n",ucd->classDef->name().data(),ucd->templSpecifiers.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);
}
}
@@ -317,30 +294,18 @@ void DotClassGraph::buildGraph(const ClassDef *cd,DotNode *n,bool base,int dista
const ClassDef *templMaster=cd->templateMaster();
if (templMaster)
{
- QDictIterator<ClassDef> cli(*templMaster->getTemplateInstances());
- const ClassDef *templInstance;
- for (;(templInstance=cli.current());++cli)
+ for (const auto &ti : templMaster->getTemplateInstances())
+ if (ti.classDef==cd)
{
- if (templInstance==cd)
- {
- addClass(templMaster,n,EdgeInfo::Orange,cli.currentKey(),0,
- 0,TRUE,distance);
- }
+ addClass(templMaster,n,EdgeInfo::Orange,ti.templSpec,QCString(),QCString(),TRUE,distance);
}
}
}
else // template relations for super classes
{
- const QDict<ClassDef> *templInstances = cd->getTemplateInstances();
- if (templInstances)
+ for (const auto &ti : cd->getTemplateInstances())
{
- QDictIterator<ClassDef> cli(*templInstances);
- const ClassDef *templInstance;
- for (;(templInstance=cli.current());++cli)
- {
- addClass(templInstance,n,EdgeInfo::Orange,cli.currentKey(),0,
- 0,FALSE,distance);
- }
+ addClass(ti.classDef,n,EdgeInfo::Orange,ti.templSpec,QCString(),QCString(),FALSE,distance);
}
}
}
@@ -348,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())
@@ -364,20 +329,19 @@ 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
);
m_startNode->setDistance(0);
- m_usedNodes = new QDict<DotNode>(1009);
- m_usedNodes->insert(className,m_startNode);
+ m_usedNodes.insert(std::make_pair(className.str(),m_startNode));
buildGraph(cd,m_startNode,TRUE,1);
if (t==Inheritance) buildGraph(cd,m_startNode,FALSE,1);
m_lrRank = determineVisibleNodes(m_startNode,Config_getInt(DOT_GRAPH_MAX_NODES),t==Inheritance);
- QList<DotNode> openNodeQueue;
- openNodeQueue.append(m_startNode);
+ DotNodeDeque openNodeQueue;
+ openNodeQueue.push_back(m_startNode);
determineTruncatedNodes(openNodeQueue,t==Inheritance);
m_collabFileName = cd->collaborationGraphFileName();
@@ -387,9 +351,9 @@ DotClassGraph::DotClassGraph(const ClassDef *cd,GraphType t)
bool DotClassGraph::isTrivial() const
{
if (m_graphType==Inheritance)
- return m_startNode->children()==0 && m_startNode->parents()==0;
+ return m_startNode->children().empty() && m_startNode->parents().empty();
else
- return !Config_getBool(UML_LOOK) && m_startNode->children()==0;
+ return !Config_getBool(UML_LOOK) && m_startNode->children().empty();
}
bool DotClassGraph::isTooBig() const
@@ -400,10 +364,10 @@ bool DotClassGraph::isTooBig() const
int DotClassGraph::numNodes() const
{
int numNodes = 0;
- numNodes+= m_startNode->children() ? m_startNode->children()->count() : 0;
+ numNodes+= (int)m_startNode->children().size();
if (m_graphType==Inheritance)
{
- numNodes+= m_startNode->parents() ? m_startNode->parents()->count() : 0;
+ numNodes+= (int)m_startNode->parents().size();
}
return numNodes;
}
@@ -411,7 +375,6 @@ int DotClassGraph::numNodes() const
DotClassGraph::~DotClassGraph()
{
DotNode::deleteNodes(m_startNode);
- delete m_usedNodes;
}
QCString DotClassGraph::getBaseName() const
@@ -481,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)
@@ -496,32 +459,26 @@ QCString DotClassGraph::writeGraph(FTextStream &out,
//--------------------------------------------------------------------
-void DotClassGraph::writeXML(FTextStream &t)
+void DotClassGraph::writeXML(TextStream &t)
{
- QDictIterator<DotNode> dni(*m_usedNodes);
- DotNode *node;
- for (;(node=dni.current());++dni)
+ for (const auto &kv : m_usedNodes)
{
- node->writeXML(t,TRUE);
+ kv.second->writeXML(t,TRUE);
}
}
-void DotClassGraph::writeDocbook(FTextStream &t)
+void DotClassGraph::writeDocbook(TextStream &t)
{
- QDictIterator<DotNode> dni(*m_usedNodes);
- DotNode *node;
- for (;(node=dni.current());++dni)
+ for (const auto &kv : m_usedNodes)
{
- node->writeDocbook(t,TRUE);
+ kv.second->writeDocbook(t,TRUE);
}
}
-void DotClassGraph::writeDEF(FTextStream &t)
+void DotClassGraph::writeDEF(TextStream &t)
{
- QDictIterator<DotNode> dni(*m_usedNodes);
- DotNode *node;
- for (;(node=dni.current());++dni)
+ for (const auto &kv : m_usedNodes)
{
- node->writeDEF(t);
+ kv.second->writeDEF(t);
}
}
diff --git a/src/dotclassgraph.h b/src/dotclassgraph.h
index 1874f54..6ccba08 100644
--- a/src/dotclassgraph.h
+++ b/src/dotclassgraph.h
@@ -17,9 +17,11 @@
#define DOTCLASSGRAPH_H
#include "classdef.h"
-
+#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;
@@ -46,13 +48,13 @@ protected:
private:
void buildGraph(const ClassDef *cd,DotNode *n,bool base,int distance);
bool determineVisibleNodes(DotNode *rootNode,int maxNodes,bool includeParents);
- void determineTruncatedNodes(QList<DotNode> &queue,bool includeParents);
- void addClass(const ClassDef *cd,DotNode *n,int prot,const char *label,
- const char *usedName,const char *templSpec,
+ void determineTruncatedNodes(DotNodeDeque &queue,bool includeParents);
+ 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;
- QDict<DotNode> * m_usedNodes;
+ DotNodeMap m_usedNodes;
GraphType m_graphType;
QCString m_collabFileName;
QCString m_inheritFileName;
diff --git a/src/dotdirdeps.cpp b/src/dotdirdeps.cpp
index da6364f..12236a0 100644
--- a/src/dotdirdeps.cpp
+++ b/src/dotdirdeps.cpp
@@ -13,13 +13,15 @@
*
*/
-#include "dotdirdeps.h"
+#include <sstream>
-#include "ftextstream.h"
+#include "dotdirdeps.h"
#include "util.h"
#include "doxygen.h"
#include "config.h"
+using DirDefMap = std::map<std::string,const DirDef *>;
+
/**
* Puts DOT code for drawing directory to stream and adds it to the list.
* @param[in,out] outStream stream to which the DOT code is written to
@@ -27,8 +29,8 @@
* @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,
- QDict<DirDef> &directoriesInGraph)
+static void drawDirectory(TextStream &outStream, const DirDef *const directory, const bool fillBackground,
+ DirDefMap &directoriesInGraph)
{
outStream << " " << directory->getOutputFileBase() << " [shape=box "
"label=\"" << directory->shortName() << "\" ";
@@ -41,10 +43,10 @@ static void drawDirectory(FTextStream &outStream, const DirDef *const directory,
outStream << "color=\"red\" ";
}
outStream << "URL=\"" << directory->getOutputFileBase() << Doxygen::htmlFileExtension << "\"];\n";
- directoriesInGraph.insert(directory->getOutputFileBase(), 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);
@@ -57,9 +59,9 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
t << " node [ fontsize=\"" << fontSize << "\", fontname=\"" << fontName << "\"];\n";
t << " edge [ labelfontsize=\"" << fontSize << "\", labelfontname=\"" << fontName << "\"];\n";
- QDict<DirDef> dirsInGraph(257);
+ DirDefMap dirsInGraph;
- dirsInGraph.insert(dd->getOutputFileBase(),dd);
+ dirsInGraph.insert(std::make_pair(dd->getOutputFileBase().str(),dd));
std::vector<const DirDef *> usedDirsNotDrawn;
for(const auto& usedDir : dd->usedDirs())
@@ -122,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)
{
@@ -130,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())
@@ -148,27 +150,26 @@ void writeDotDirDepGraph(FTextStream &t,const DirDef *dd,bool linkRelations)
}
// add relations between all selected directories
- const DirDef *dir;
- QDictIterator<DirDef> di(dirsInGraph);
- for (;(dir=di.current());++di) // foreach dir in the graph
+ for (const auto &kv : dirsInGraph) // foreach dir in the graph
{
+ const DirDef *dir = kv.second;
for (const auto &udir : dir->usedDirs())
{
const DirDef *usedDir=udir->dir();
if ((dir!=dd || !udir->inherited()) && // only show direct dependencies for this dir
(usedDir!=dd || !udir->inherited()) && // only show direct dependencies for this dir
!usedDir->isParentOf(dir) && // don't point to own parent
- dirsInGraph.find(usedDir->getOutputFileBase())) // only point to nodes that are in the graph
+ dirsInGraph.find(usedDir->getOutputFileBase().str())!=dirsInGraph.end()) // only point to nodes that are in the graph
{
QCString relationName;
relationName.sprintf("dir_%06d_%06d",dir->dirCount(),usedDir->dirCount());
Doxygen::dirRelations.add(relationName,
std::make_unique<DirRelation>(
relationName,dir,udir.get()));
- int nrefs = udir->filePairs().count();
+ size_t nrefs = udir->filePairs().size();
t << " " << dir->getOutputFileBase() << "->"
<< usedDir->getOutputFileBase();
- t << " [headlabel=\"" << nrefs << "\", labeldistance=1.5";
+ t << " [headlabel=\"" << (uint)nrefs << "\", labeldistance=1.5";
if (linkRelations)
{
t << " headhref=\"" << relationName << Doxygen::htmlFileExtension << "\"";
@@ -198,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
@@ -213,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 285c0bb..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,50 +211,43 @@ 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)
{
- m_maps.setAutoDelete(TRUE);
}
bool DotFilePatcher::isSVGFile() const
@@ -266,30 +258,16 @@ bool DotFilePatcher::isSVGFile() const
int DotFilePatcher::addMap(const QCString &mapFile,const QCString &relPath,
bool urlOnly,const QCString &context,const QCString &label)
{
- int id = m_maps.count();
- Map *map = new Map;
- map->mapFile = mapFile;
- map->relPath = relPath;
- map->urlOnly = urlOnly;
- map->context = context;
- map->label = label;
- map->zoomable = FALSE;
- map->graphId = -1;
- m_maps.append(map);
+ int id = (int)m_maps.size();
+ m_maps.emplace_back(mapFile,relPath,urlOnly,context,label);
return id;
}
int DotFilePatcher::addFigure(const QCString &baseName,
const QCString &figureName,bool heightCheck)
{
- int id = m_maps.count();
- Map *map = new Map;
- map->mapFile = figureName;
- map->urlOnly = heightCheck;
- map->label = baseName;
- map->zoomable = FALSE;
- map->graphId = -1;
- m_maps.append(map);
+ int id = (int)m_maps.size();
+ m_maps.emplace_back(figureName,"",heightCheck,"",baseName);
return id;
}
@@ -297,14 +275,8 @@ int DotFilePatcher::addSVGConversion(const QCString &relPath,bool urlOnly,
const QCString &context,bool zoomable,
int graphId)
{
- int id = m_maps.count();
- Map *map = new Map;
- map->relPath = relPath;
- map->urlOnly = urlOnly;
- map->context = context;
- map->zoomable = zoomable;
- map->graphId = graphId;
- m_maps.append(map);
+ int id = (int)m_maps.size();
+ m_maps.emplace_back("",relPath,urlOnly,context,"",zoomable,graphId);
return id;
}
@@ -312,74 +284,61 @@ int DotFilePatcher::addSVGObject(const QCString &baseName,
const QCString &absImgName,
const QCString &relPath)
{
- int id = m_maps.count();
- Map *map = new Map;
- map->mapFile = absImgName;
- map->relPath = relPath;
- map->label = baseName;
- map->zoomable = FALSE;
- map->graphId = -1;
- m_maps.append(map);
+ int id = (int)m_maps.size();
+ m_maps.emplace_back(absImgName,relPath,false,"",baseName);
return id;
}
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;
QCString relPath;
if (isSVGFile)
{
- Map *map = m_maps.at(0); // there is only one 'map' for a SVG file
- interactiveSVG_local = interactiveSVG_local && map->zoomable;
- graphId = map->graphId;
- relPath = map->relPath;
+ const Map &map = m_maps.front(); // there is only one 'map' for a SVG file
+ interactiveSVG_local = interactiveSVG_local && map.zoomable;
+ 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)
@@ -418,8 +377,8 @@ bool DotFilePatcher::run() const
// unless we are inside the header of the SVG.
// Then we replace it with another header.
{
- Map *map = m_maps.at(0); // there is only one 'map' for a SVG file
- t << replaceRef(line,map->relPath,map->urlOnly,map->context,"_top");
+ const Map &map = m_maps.front(); // there is only one 'map' for a SVG file
+ t << replaceRef(line,map.relPath,map.urlOnly,map.context,"_top");
}
}
else if ((i=line.find("<!-- SVG"))!=-1 || (i=line.find("[!-- SVG"))!=-1)
@@ -428,21 +387,21 @@ bool DotFilePatcher::run() const
int mapId=-1;
t << line.left(i);
int n = sscanf(line.data()+i+1,"!-- SVG %d",&mapId);
- if (n==1 && mapId>=0 && mapId<(int)m_maps.count())
+ if (n==1 && mapId>=0 && mapId<(int)m_maps.size())
{
- int e = QMAX(line.find("--]"),line.find("-->"));
- Map *map = m_maps.at(mapId);
+ 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);
- if (!writeSVGFigureLink(t,map->relPath,map->label,map->mapFile))
+ // 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);
}
}
@@ -451,24 +410,23 @@ bool DotFilePatcher::run() const
int mapId=-1;
t << line.left(i);
int n = sscanf(line.data()+i,"<!-- MAP %d",&mapId);
- if (n==1 && mapId>=0 && mapId<(int)m_maps.count())
+ if (n==1 && mapId>=0 && mapId<(int)m_maps.size())
{
- QGString result;
- FTextStream tt(&result);
- Map *map = m_maps.at(mapId);
+ 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());
- convertMapFile(tt,map->mapFile,map->relPath,map->urlOnly,map->context);
- if (!result.isEmpty())
+ // mapId,qPrint(m_patchFile),qPrint(map.mapFile));
+ convertMapFile(tt,map.mapFile,map.relPath,map.urlOnly,map.context);
+ 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);
}
}
@@ -476,13 +434,13 @@ 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);
- if (n==1 && mapId>=0 && mapId<(int)m_maps.count())
+ //printf("line='%s' n=%d\n",qPrint(line)+i,n);
+ if (n==1 && mapId>=0 && mapId<(int)m_maps.size())
{
- Map *map = m_maps.at(mapId);
+ 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());
- if (!writeVecGfxFigure(t,map->label,map->mapFile))
+ // mapId,qPrint(m_patchFile),qPrint(map.mapFile));
+ if (!writeVecGfxFigure(t,map.label,map.mapFile))
{
err("problem writing FIG %d figure!\n",mapId);
return FALSE;
@@ -490,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;
}
}
@@ -505,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);
- Map *map = m_maps.at(0); // there is only one 'map' for a SVG file
- to << replaceRef(line,map->relPath,map->urlOnly,map->context,"_top");
+ std::string line = lineStr+'\n';
+ const Map &map = m_maps.front(); // there is only one 'map' for a SVG file
+ 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;
}
@@ -548,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;
@@ -630,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 b68208d..af2c855 100644
--- a/src/dotfilepatcher.h
+++ b/src/dotfilepatcher.h
@@ -16,17 +16,17 @@
#ifndef DOTFILEPATCHER_H
#define DOTFILEPATCHER_H
+#include <vector>
+
#include "qcstring.h"
-#include "qlist.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);
@@ -41,19 +41,23 @@ 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:
struct Map
{
+ Map(const QCString &mf,const QCString &rp,bool uo,const QCString &ctx,
+ const QCString &lab,bool zoom=false,int gId=-1) :
+ mapFile(mf), relPath(rp), urlOnly(uo), context(ctx),
+ label(lab), zoomable(zoom), graphId(gId) {}
QCString mapFile;
QCString relPath;
bool urlOnly;
@@ -62,7 +66,7 @@ class DotFilePatcher
bool zoomable;
int graphId;
};
- QList<Map> m_maps;
+ std::vector<Map> m_maps;
QCString m_patchFile;
};
diff --git a/src/dotgfxhierarchytable.cpp b/src/dotgfxhierarchytable.cpp
index c535acf..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,35 +96,37 @@ 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
{
const auto &bn = it->second;
root = bn.get();
- if (n->children()==0 || n->children()->findRef(bn.get())==-1) // no arrow yet
+ const auto &children = n->children();
+ auto child_it = std::find(children.begin(),children.end(),bn.get());
+ if (child_it==children.end()) // no arrow yet
{
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
// );
@@ -147,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())
@@ -175,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
)
@@ -199,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)));
@@ -218,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)
{
@@ -239,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();
@@ -258,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 287793e..37a1587 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);
+ char md5stored[33];
+ f.read(md5stored,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,15 +139,15 @@ 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);
+ char sigStr[33];
uchar md5_sig[16];
// calculate md5
MD5Buffer((const unsigned char*)m_theGraph.data(), m_theGraph.length(), md5_sig);
// convert result to a string
- MD5SigToString(md5_sig, sigStr.rawData(), 33);
+ MD5SigToString(md5_sig, sigStr);
// already queued files are processed again in case the output format has changed
@@ -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,31 +304,31 @@ 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);
- if (renderParents && root->parents())
+ if (renderParents)
{
- QListIterator<DotNode> dnli(*root->parents());
- const DotNode *pn;
- for (dnli.toFirst();(pn=dnli.current());++dnli)
+ for (const auto &pn : root->parents())
{
if (pn->isVisible())
{
+ const auto &children = pn->children();
+ auto child_it = std::find(children.begin(),children.end(),root);
+ size_t index = child_it - children.begin();
root->writeArrow(md5stream, // stream
gt, // graph type
format, // output format
pn, // child node
- pn->edgeInfo()->at(pn->children()->findRef(root)), // edge info
+ &pn->edgeInfo()[index], // edge info
FALSE, // topDown?
backArrows // point back?
);
@@ -344,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 1b632ce..d409d50 100644
--- a/src/dotgroupcollaboration.cpp
+++ b/src/dotgroupcollaboration.cpp
@@ -14,24 +14,21 @@
*/
#include "dotgroupcollaboration.h"
-
-#include "dotnode.h"
#include "classlist.h"
#include "doxygen.h"
#include "namespacedef.h"
#include "pagedef.h"
#include "util.h"
#include "config.h"
+#include "textstream.h"
DotGroupCollaboration::DotGroupCollaboration(const GroupDef* gd)
{
QCString tmp_url = gd->getReference()+"$"+gd->getOutputFileBase();
- m_usedNodes = new QDict<DotNode>(1009);
QCString tooltip = gd->briefDescriptionAsTooltip();
m_rootNode = new DotNode(getNextNodeNumber(), gd->groupTitle(), tooltip, tmp_url, TRUE );
m_rootNode->markAsVisible();
- m_usedNodes->insert(gd->name(), m_rootNode );
- m_edges.setAutoDelete(TRUE);
+ m_usedNodes.insert(std::make_pair(gd->name().str(), m_rootNode));
m_diskName = gd->getOutputFileBase();
@@ -40,17 +37,11 @@ DotGroupCollaboration::DotGroupCollaboration(const GroupDef* gd)
DotGroupCollaboration::~DotGroupCollaboration()
{
- // delete all created Nodes saved in m_usedNodes:QDict
- if(m_usedNodes != NULL)
+ // delete all created Nodes saved in m_usedNodes map
+ for (const auto &kv : m_usedNodes)
{
- QDictIterator<DotNode> it(*m_usedNodes);
- for(;it.current(); ++it)
- {
- delete it.current();
- }
+ delete kv.second;
}
-
- delete m_usedNodes;
}
void DotGroupCollaboration::buildGraph(const GroupDef* gd)
@@ -62,14 +53,19 @@ void DotGroupCollaboration::buildGraph(const GroupDef* gd)
// Write parents
for (const auto &d : gd->partOfGroups())
{
- DotNode* nnode = m_usedNodes->find(d->name());
- if ( !nnode )
+ DotNode *nnode = 0;
+ auto it = m_usedNodes.find(d->name().str());
+ if ( it==m_usedNodes.end())
{ // add node
tmp_url = d->getReference()+"$"+d->getOutputFileBase();
QCString tooltip = d->briefDescriptionAsTooltip();
nnode = new DotNode(getNextNodeNumber(), d->groupTitle(), tooltip, tmp_url );
nnode->markAsVisible();
- m_usedNodes->insert(d->name(), nnode );
+ m_usedNodes.insert(std::make_pair(d->name().str(), nnode));
+ }
+ else
+ {
+ nnode = it->second;
}
tmp_url = "";
addEdge( nnode, m_rootNode, DotGroupCollaboration::thierarchy, tmp_url, tmp_url );
@@ -78,14 +74,19 @@ void DotGroupCollaboration::buildGraph(const GroupDef* gd)
// Add subgroups
for (const auto &def : gd->getSubGroups())
{
- DotNode* nnode = m_usedNodes->find(def->name());
- if ( !nnode )
+ DotNode *nnode = 0;
+ auto it = m_usedNodes.find(def->name().str());
+ if ( it==m_usedNodes.end())
{ // add node
tmp_url = def->getReference()+"$"+def->getOutputFileBase();
QCString tooltip = def->briefDescriptionAsTooltip();
nnode = new DotNode(getNextNodeNumber(), def->groupTitle(), tooltip, tmp_url );
nnode->markAsVisible();
- m_usedNodes->insert(def->name(), nnode );
+ m_usedNodes.insert(std::make_pair(def->name().str(), nnode));
+ }
+ else
+ {
+ nnode = it->second;
}
tmp_url = "";
addEdge( m_rootNode, nnode, DotGroupCollaboration::thierarchy, tmp_url, tmp_url );
@@ -116,15 +117,10 @@ void DotGroupCollaboration::buildGraph(const GroupDef* gd)
}
// Add files
- if ( gd->getFiles() && gd->getFiles()->count() )
+ for (const auto &def : gd->getFiles())
{
- QListIterator<FileDef> defli(*gd->getFiles());
- const FileDef *def;
- for (;(def=defli.current());++defli)
- {
- tmp_url = def->getReference()+"$"+def->getOutputFileBase()+Doxygen::htmlFileExtension;
- addCollaborationMember( def, tmp_url, DotGroupCollaboration::tfile );
- }
+ tmp_url = def->getReference()+"$"+def->getOutputFileBase()+Doxygen::htmlFileExtension;
+ addCollaborationMember( def, tmp_url, DotGroupCollaboration::tfile );
}
// Add pages
@@ -147,10 +143,8 @@ void DotGroupCollaboration::buildGraph(const GroupDef* gd)
void DotGroupCollaboration::addMemberList( MemberList* ml )
{
- if ( !( ml && ml->count()) ) return;
- MemberListIterator defli(*ml);
- MemberDef *def;
- for (;(def=defli.current());++defli)
+ if ( ml==0 || ml->empty() ) return;
+ for (const auto &def : *ml)
{
QCString tmp_url = def->getReference()+"$"+def->getOutputFileBase()+Doxygen::htmlFileExtension
+"#"+def->anchor();
@@ -163,30 +157,23 @@ DotGroupCollaboration::Edge* DotGroupCollaboration::addEdge(
const QCString& _label, const QCString& _url )
{
// search a existing link.
- QListIterator<Edge> lli(m_edges);
- Edge* newEdge = 0;
- for ( lli.toFirst(); (newEdge=lli.current()); ++lli)
- {
- if ( newEdge->pNStart==_pNStart &&
- newEdge->pNEnd==_pNEnd &&
- newEdge->eType==_eType
- )
- { // edge already found
- break;
- }
- }
- if ( newEdge==0 ) // new link
+ auto it = std::find_if(m_edges.begin(),m_edges.end(),
+ [&_pNStart,&_pNEnd,&_eType](const auto &edge)
+ { return edge->pNStart==_pNStart && edge->pNEnd==_pNEnd && edge->eType==_eType; });
+
+ if (it==m_edges.end()) // new link
{
- newEdge = new Edge(_pNStart,_pNEnd,_eType);
- m_edges.append( newEdge );
+ m_edges.emplace_back(std::make_unique<Edge>(_pNStart,_pNEnd,_eType));
+ it = m_edges.end()-1;
}
- if (!_label.isEmpty())
+ if (!_label.isEmpty()) // add label
{
- newEdge->links.append(new Link(_label,_url));
+ (*it)->links.emplace_back(_label,_url);
}
- return newEdge;
+ // return found or added edge
+ return (*it).get();
}
void DotGroupCollaboration::addCollaborationMember(
@@ -196,7 +183,8 @@ void DotGroupCollaboration::addCollaborationMember(
QCString tmp_str;
for (const auto &d : def->partOfGroups())
{
- DotNode* nnode = m_usedNodes->find(d->name());
+ auto it = m_usedNodes.find(d->name().str());
+ DotNode* nnode = it!=m_usedNodes.end() ? it->second : 0;
if ( nnode != m_rootNode )
{
if ( nnode==0 )
@@ -205,7 +193,7 @@ void DotGroupCollaboration::addCollaborationMember(
QCString tooltip = d->briefDescriptionAsTooltip();
nnode = new DotNode(getNextNodeNumber(), d->groupTitle(), tooltip, tmp_str );
nnode->markAsVisible();
- m_usedNodes->insert(d->name(), nnode );
+ m_usedNodes.insert(std::make_pair(d->name().str(), nnode));
}
tmp_str = def->qualifiedName();
addEdge( m_rootNode, nnode, eType, tmp_str, url );
@@ -220,33 +208,30 @@ QCString DotGroupCollaboration::getBaseName() const
void DotGroupCollaboration::computeTheGraph()
{
- FTextStream md5stream(&m_theGraph);
+ TextStream md5stream;
writeGraphHeader(md5stream,m_rootNode->label());
// clean write flags
- QDictIterator<DotNode> dni(*m_usedNodes);
- DotNode *pn;
- for (dni.toFirst();(pn=dni.current());++dni)
+ for (const auto &kv : m_usedNodes)
{
- pn->clearWriteFlag();
+ kv.second->clearWriteFlag();
}
// write other nodes.
- for (dni.toFirst();(pn=dni.current());++dni)
+ for (const auto &kv : m_usedNodes)
{
- pn->write(md5stream,Inheritance,m_graphFormat,TRUE,FALSE,FALSE);
+ kv.second->write(md5stream,Inheritance,m_graphFormat,TRUE,FALSE,FALSE);
}
// write edges
- QListIterator<Edge> eli(m_edges);
- Edge* edge;
- for (eli.toFirst();(edge=eli.current());++eli)
+ for (const auto &edge : m_edges)
{
edge->write( md5stream );
}
writeGraphFooter(md5stream);
+ m_theGraph = md5stream.str();
}
QCString DotGroupCollaboration::getMapLabel() const
@@ -254,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;
@@ -264,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"
@@ -281,34 +266,31 @@ void DotGroupCollaboration::Edge::write( FTextStream &t ) const
t << "Node" << pNEnd->number();
t << " [shape=plaintext";
- if (links.count()>0) // there are links
+ if (!links.empty()) // there are links
{
t << ", ";
// HTML-like edge labels crash on my Mac with Graphviz 2.0! and
// are not supported by older version of dot.
//
//t << label=<<TABLE BORDER=\"0\" CELLBORDER=\"0\">";
- //QListIterator<Link> lli(links);
- //Link *link;
- //for( lli.toFirst(); (link=lli.current()); ++lli)
+ //for (const auto &link : links)
//{
// t << "<TR><TD";
- // if ( !link->url.isEmpty() )
- // t << " HREF=\"" << link->url << "\"";
- // t << ">" << link->label << "</TD></TR>";
+ // if ( !link.url.isEmpty() )
+ // t << " HREF=\"" << link.url << "\"";
+ // t << ">" << DotNode::convertLabel(link->label) << "</TD></TR>";
//}
//t << "</TABLE>>";
t << "label=\"";
- QListIterator<Link> lli(links);
- Link *link;
bool first=TRUE;
int count=0;
const int maxLabels = 10;
- for( lli.toFirst(); (link=lli.current()) && count<maxLabels; ++lli,++count)
+ for (const auto &link : links)
{
if (first) first=FALSE; else t << "\\n";
- t << DotNode::convertLabel(link->label);
+ t << DotNode::convertLabel(link.label);
+ count++;
}
if (count==maxLabels) t << "\\n...";
t << "\"";
@@ -324,15 +306,15 @@ void DotGroupCollaboration::Edge::write( FTextStream &t ) const
break;
}
t << ", " << arrowStyle;
- t << "];" << endl;
+ t << "];\n";
}
bool DotGroupCollaboration::isTrivial() const
{
- return m_usedNodes->count() <= 1;
+ 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);
@@ -345,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 539637f..872e7f7 100644
--- a/src/dotgroupcollaboration.h
+++ b/src/dotgroupcollaboration.h
@@ -16,18 +16,20 @@
#ifndef DOTGROUPCOLLABORATION_H
#define DOTGROUPCOLLABORATION_H
+#include "dotnode.h"
#include "dotgraph.h"
-#include "qlist.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;
};
@@ -58,28 +60,27 @@ class DotGroupCollaboration : public DotGraph
struct Edge
{
Edge(DotNode *start,DotNode *end,EdgeType type)
- : pNStart(start), pNEnd(end), eType(type)
- { links.setAutoDelete(TRUE); }
+ : pNStart(start), pNEnd(end), eType(type) {}
DotNode* pNStart;
DotNode* pNEnd;
EdgeType eType;
- QList<Link> links;
- void write( FTextStream &t ) const;
+ std::vector<Link> links;
+ 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 );
DotNode *m_rootNode;
- QDict<DotNode> *m_usedNodes;
+ DotNodeMap m_usedNodes;
QCString m_diskName;
- QList<Edge> m_edges;
+ std::vector< std::unique_ptr<Edge> > m_edges;
};
#endif
diff --git a/src/dotincldepgraph.cpp b/src/dotincldepgraph.cpp
index 05a96d9..5a2f7ca 100644
--- a/src/dotincldepgraph.cpp
+++ b/src/dotincldepgraph.cpp
@@ -17,113 +17,102 @@
#include "dotnode.h"
#include "util.h"
#include "config.h"
+#include "textstream.h"
void DotInclDepGraph::buildGraph(DotNode *n,const FileDef *fd,int distance)
{
- QList<IncludeInfo> *includeFiles = m_inverse ? fd->includedByFileList() : fd->includeFileList();
- if (includeFiles)
+ const IncludeInfoList &includeFiles = m_inverse ? fd->includedByFileList() : fd->includeFileList();
+ for (const auto &ii : includeFiles)
{
- QListIterator<IncludeInfo> ili(*includeFiles);
- IncludeInfo *ii;
- for (;(ii=ili.current());++ili)
+ const FileDef *bfd = ii.fileDef;
+ QCString in = ii.includeName;
+ //printf(">>>> in='%s' bfd=%p\n",qPrint(ii->includeName),bfd);
+ bool doc=TRUE,src=FALSE;
+ if (bfd)
{
- const FileDef *bfd = ii->fileDef;
- QCString in = ii->includeName;
- //printf(">>>> in='%s' bfd=%p\n",ii->includeName.data(),bfd);
- bool doc=TRUE,src=FALSE;
- if (bfd)
+ in = bfd->absFilePath();
+ doc = bfd->isLinkable() && !bfd->isHidden();
+ src = bfd->generateSourceFile();
+ }
+ if (doc || src || !Config_getBool(HIDE_UNDOC_RELATIONS))
+ {
+ QCString url="";
+ if (bfd) url=bfd->getOutputFileBase();
+ if (!doc && src)
{
- in = bfd->absFilePath();
- doc = bfd->isLinkable() && !bfd->isHidden();
- src = bfd->generateSourceFile();
+ url=bfd->getSourceFileBase();
}
- if (doc || src || !Config_getBool(HIDE_UNDOC_RELATIONS))
+ auto it = m_usedNodes.find(in.str());
+ if (it!=m_usedNodes.end()) // file is already a node in the graph
{
- QCString url="";
- if (bfd) url=bfd->getOutputFileBase().copy();
- if (!doc && src)
- {
- url=bfd->getSourceFileBase();
- }
- DotNode *bn = m_usedNodes->find(in);
- if (bn) // file is already a node in the graph
- {
- n->addChild(bn,0,0,0);
- bn->addParent(n);
- bn->setDistance(distance);
- }
- else
+ DotNode *bn = it->second;
+ n->addChild(bn,0,0);
+ bn->addParent(n);
+ bn->setDistance(distance);
+ }
+ else
+ {
+ QCString tmp_url;
+ QCString tooltip;
+ if (bfd)
{
- QCString tmp_url;
- QCString tooltip;
- if (bfd)
- {
- tmp_url=doc || src ? bfd->getReference()+"$"+url : QCString();
- tooltip = bfd->briefDescriptionAsTooltip();
- }
- bn = new DotNode(getNextNodeNumber(),// n
- ii->includeName, // label
- tooltip, // tip
- tmp_url, // url
- FALSE, // rootNode
- 0); // cd
- n->addChild(bn,0,0,0);
- bn->addParent(n);
- m_usedNodes->insert(in,bn);
- bn->setDistance(distance);
-
- if (bfd) buildGraph(bn,bfd,distance+1);
+ tmp_url=doc || src ? bfd->getReference()+"$"+url : QCString();
+ tooltip = bfd->briefDescriptionAsTooltip();
}
+ DotNode *bn = new DotNode(getNextNodeNumber(),// n
+ ii.includeName, // label
+ tooltip, // tip
+ tmp_url, // url
+ FALSE, // rootNode
+ 0); // cd
+ n->addChild(bn,0,0);
+ bn->addParent(n);
+ m_usedNodes.insert(std::make_pair(in.str(),bn));
+ bn->setDistance(distance);
+
+ if (bfd) buildGraph(bn,bfd,distance+1);
}
}
}
}
-void DotInclDepGraph::determineVisibleNodes(QList<DotNode> &queue, int &maxNodes)
+void DotInclDepGraph::determineVisibleNodes(DotNodeDeque &queue, int &maxNodes)
{
- while (queue.count()>0 && maxNodes>0)
+ while (!queue.empty() && maxNodes>0)
{
- DotNode *n = queue.take(0);
+ DotNode *n = queue.front();
+ queue.pop_front();
if (!n->isVisible() && n->distance()<=Config_getInt(MAX_DOT_GRAPH_DEPTH)) // not yet processed
{
n->markAsVisible();
maxNodes--;
// add direct children
- if (n->children())
+ for (const auto &dn : n->children())
{
- QListIterator<DotNode> li(*n->children());
- const DotNode *dn;
- for (li.toFirst();(dn=li.current());++li)
- {
- queue.append(dn);
- }
+ queue.push_back(dn);
}
}
}
}
-void DotInclDepGraph::determineTruncatedNodes(QList<DotNode> &queue)
+void DotInclDepGraph::determineTruncatedNodes(DotNodeDeque &queue)
{
- while (queue.count()>0)
+ while (!queue.empty())
{
- DotNode *n = queue.take(0);
+ DotNode *n = queue.front();
+ queue.pop_front();
if (n->isVisible() && n->isTruncated()==DotNode::Unknown)
{
bool truncated = FALSE;
- if (n->children())
+ for (const auto &dn : n->children())
{
- QListIterator<DotNode> li(*n->children());
- const DotNode *dn;
- for (li.toFirst();(dn=li.current());++li)
+ if (!dn->isVisible())
+ {
+ truncated = TRUE;
+ }
+ else
{
- if (!dn->isVisible())
- {
- truncated = TRUE;
- }
- else
- {
- queue.append(dn);
- }
+ queue.push_back(dn);
}
}
n->markAsTruncated(truncated);
@@ -142,26 +131,24 @@ 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 = new QDict<DotNode>(1009);
- m_usedNodes->insert(fd->absFilePath(),m_startNode);
+ m_usedNodes.insert(std::make_pair(fd->absFilePath().str(),m_startNode));
buildGraph(m_startNode,fd,1);
int maxNodes = Config_getInt(DOT_GRAPH_MAX_NODES);
- QList<DotNode> openNodeQueue;
- openNodeQueue.append(m_startNode);
+ DotNodeDeque openNodeQueue;
+ openNodeQueue.push_back(m_startNode);
determineVisibleNodes(openNodeQueue,maxNodes);
openNodeQueue.clear();
- openNodeQueue.append(m_startNode);
+ openNodeQueue.push_back(m_startNode);
determineTruncatedNodes(openNodeQueue);
}
DotInclDepGraph::~DotInclDepGraph()
{
DotNode::deleteNodes(m_startNode);
- delete m_usedNodes;
}
QCString DotInclDepGraph::getBaseName() const
@@ -194,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)
{
@@ -208,7 +195,7 @@ QCString DotInclDepGraph::writeGraph(FTextStream &out,
bool DotInclDepGraph::isTrivial() const
{
- return m_startNode->children()==0;
+ return m_startNode->children().empty();
}
bool DotInclDepGraph::isTooBig() const
@@ -218,25 +205,21 @@ bool DotInclDepGraph::isTooBig() const
int DotInclDepGraph::numNodes() const
{
- return m_startNode->children() ? m_startNode->children()->count() : 0;
+ return (int)m_startNode->children().size();
}
-void DotInclDepGraph::writeXML(FTextStream &t)
+void DotInclDepGraph::writeXML(TextStream &t)
{
- QDictIterator<DotNode> dni(*m_usedNodes);
- DotNode *node;
- for (;(node=dni.current());++dni)
+ for (const auto &kv : m_usedNodes)
{
- node->writeXML(t,FALSE);
+ kv.second->writeXML(t,FALSE);
}
}
-void DotInclDepGraph::writeDocbook(FTextStream &t)
+void DotInclDepGraph::writeDocbook(TextStream &t)
{
- QDictIterator<DotNode> dni(*m_usedNodes);
- DotNode *node;
- for (;(node=dni.current());++dni)
+ for (const auto &kv : m_usedNodes)
{
- node->writeDocbook(t,FALSE);
+ kv.second->writeDocbook(t,FALSE);
}
}
diff --git a/src/dotincldepgraph.h b/src/dotincldepgraph.h
index 5807ce8..a0e58bf 100644
--- a/src/dotincldepgraph.h
+++ b/src/dotincldepgraph.h
@@ -19,22 +19,25 @@
#include "qcstring.h"
#include "filedef.h"
+#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;
@@ -44,11 +47,11 @@ class DotInclDepGraph : public DotGraph
private:
QCString diskName() const;
void buildGraph(DotNode *n,const FileDef *fd,int distance);
- void determineVisibleNodes(QList<DotNode> &queue,int &maxNodes);
- void determineTruncatedNodes(QList<DotNode> &queue);
+ void determineVisibleNodes(DotNodeDeque &queue,int &maxNodes);
+ void determineTruncatedNodes(DotNodeDeque &queue);
DotNode *m_startNode;
- QDict<DotNode> *m_usedNodes;
+ DotNodeMap m_usedNodes;
QCString m_inclDepFileName;
QCString m_inclByDepFileName;
bool m_inverse;
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 06de5f4..bfc7c08 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,16 +138,14 @@ static QCString escapeTooltip(const QCString &tooltip)
return result;
}
-static void writeBoxMemberList(FTextStream &t,
- char prot,MemberList *ml,const ClassDef *scope,
+static void writeBoxMemberList(TextStream &t,
+ char prot,const MemberList *ml,const ClassDef *scope,
bool isStatic=FALSE,const StringUnorderedSet *skipNames=nullptr)
{
if (ml)
{
- MemberListIterator mlia(*ml);
- MemberDef *mma;
int totalCount=0;
- for (mlia.toFirst();(mma = mlia.current());++mlia)
+ for (const auto &mma : *ml)
{
if (mma->getClassDef()==scope &&
(skipNames==nullptr || skipNames->find(mma->name().str())==std::end(*skipNames)))
@@ -158,7 +155,7 @@ static void writeBoxMemberList(FTextStream &t,
}
int count=0;
- for (mlia.toFirst();(mma = mlia.current());++mlia)
+ for (const auto &mma : *ml)
{
if (mma->getClassDef() == scope &&
(skipNames==nullptr || skipNames->find(mma->name().str())==std::end(*skipNames)))
@@ -199,9 +196,9 @@ static void writeBoxMemberList(FTextStream &t,
// write member groups within the memberlist
for (const auto &mg : ml->getMemberGroupList())
{
- if (mg->members())
+ if (!mg->members().empty())
{
- writeBoxMemberList(t,prot,mg->members(),scope,isStatic,skipNames);
+ writeBoxMemberList(t,prot,&mg->members(),scope,isStatic,skipNames);
}
}
}
@@ -289,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)
@@ -302,85 +299,58 @@ DotNode::DotNode(int n,const char *lab,const char *tip, const char *url,
DotNode::~DotNode()
{
- delete m_children;
- delete m_parents;
- delete m_edgeInfo;
}
void DotNode::addChild(DotNode *n,
int edgeColor,
int edgeStyle,
- const char *edgeLab,
- const char *edgeURL,
+ const QCString &edgeLab,
+ const QCString &edgeURL,
int edgeLabCol
)
{
- if (m_children==0)
- {
- m_children = new QList<DotNode>;
- m_edgeInfo = new QList<EdgeInfo>;
- m_edgeInfo->setAutoDelete(TRUE);
- }
- m_children->append(n);
- EdgeInfo *ei = new EdgeInfo(
+ m_children.push_back(n);
+ m_edgeInfo.emplace_back(
edgeColor,
edgeStyle,
edgeLab,
edgeURL,
edgeLabCol==-1 ? edgeColor : edgeLabCol);
- m_edgeInfo->append(ei);
}
void DotNode::addParent(DotNode *n)
{
- if (m_parents==0)
- {
- m_parents = new QList<DotNode>;
- }
- m_parents->append(n);
+ m_parents.push_back(n);
}
void DotNode::removeChild(DotNode *n)
{
- if (m_children) m_children->remove(n);
+ auto it = std::find(m_children.begin(),m_children.end(),n);
+ if (it!=m_children.end()) m_children.erase(it);
}
void DotNode::removeParent(DotNode *n)
{
- if (m_parents) m_parents->remove(n);
+ auto it = std::find(m_parents.begin(),m_parents.end(),n);
+ if (it!=m_parents.end()) m_parents.erase(it);
}
-void DotNode::deleteNode(DotNodeList &deletedList,SDict<DotNode> *skipNodes)
+void DotNode::deleteNode(DotNodeRefVector &deletedList)
{
if (m_deleted) return; // avoid recursive loops in case the graph has cycles
m_deleted=TRUE;
- if (m_parents!=0) // delete all parent nodes of this node
+ // delete all parent nodes of this node
+ for (const auto &pn : m_parents)
{
- QListIterator<DotNode> dnlip(*m_parents);
- DotNode *pn;
- for (dnlip.toFirst();(pn=dnlip.current());++dnlip)
- {
- //pn->removeChild(this);
- pn->deleteNode(deletedList,skipNodes);
- }
+ pn->deleteNode(deletedList);
}
- if (m_children!=0) // delete all child nodes of this node
+ // delete all child nodes of this node
+ for (const auto &cn : m_children)
{
- QListIterator<DotNode> dnlic(*m_children);
- DotNode *cn;
- for (dnlic.toFirst();(cn=dnlic.current());++dnlic)
- {
- //cn->removeParent(this);
- cn->deleteNode(deletedList,skipNodes);
- }
+ cn->deleteNode(deletedList);
}
// add this node to the list of deleted nodes.
- //printf("skipNodes=%p find(%p)=%p\n",skipNodes,this,skipNodes ? skipNodes->find((int)this) : 0);
- if (skipNodes==0 || skipNodes->find((char*)this)==0)
- {
- //printf("deleting\n");
- deletedList.append(this);
- }
+ deletedList.push_back(this);
}
void DotNode::setDistance(int distance)
@@ -390,23 +360,24 @@ void DotNode::setDistance(int distance)
inline int DotNode::findParent( DotNode *n )
{
- if ( !m_parents ) return -1;
- return m_parents->find(n);
+ auto it = std::find(m_parents.begin(),m_parents.end(),n);
+ return it!=m_parents.end() ? static_cast<int>(it-m_parents.begin()) : -1;
}
/*! helper function that deletes all nodes in a connected graph, given
* one of the graph's nodes
*/
-void DotNode::deleteNodes(DotNode *node,SDict<DotNode> *skipNodes)
+void DotNode::deleteNodes(DotNode *node)
{
- //printf("deleteNodes skipNodes=%p\n",skipNodes);
- static DotNodeList deletedNodes;
- deletedNodes.setAutoDelete(TRUE);
- node->deleteNode(deletedNodes,skipNodes); // collect nodes to be deleted.
- deletedNodes.clear(); // actually remove the nodes.
+ DotNodeRefVector deletedNodes;
+ node->deleteNode(deletedNodes); // collect nodes to be deleted.
+ for (const auto &dotNode : deletedNodes)
+ {
+ delete dotNode;
+ }
}
-void DotNode::writeBox(FTextStream &t,
+void DotNode::writeBox(TextStream &t,
GraphType gt,
GraphOutputFormat /*format*/,
bool hasNonReachableChildren) const
@@ -421,31 +392,26 @@ void DotNode::writeBox(FTextStream &t,
// add names shown as relations to a set, so we don't show
// them as attributes as well
StringUnorderedSet arrowNames;
- if (m_edgeInfo)
+ // for each edge
+ for (const auto &ei : m_edgeInfo)
{
- // for each edge
- QListIterator<EdgeInfo> li(*m_edgeInfo);
- EdgeInfo *ei;
- for (li.toFirst();(ei=li.current());++li)
+ if (!ei.label().isEmpty()) // labels joined by \n
{
- if (!ei->label().isEmpty()) // labels joined by \n
+ int i=ei.label().find('\n');
+ int p=0;
+ QCString lab;
+ while ((i=ei.label().find('\n',p))!=-1)
{
- int i=ei->label().find('\n');
- int p=0;
- QCString lab;
- while ((i=ei->label().find('\n',p))!=-1)
- {
- lab = stripProtectionPrefix(ei->label().mid(p,i-p));
- arrowNames.insert(lab.str());
- p=i+1;
- }
- lab = stripProtectionPrefix(ei->label().right(ei->label().length()-p));
+ lab = stripProtectionPrefix(ei.label().mid(p,i-p));
arrowNames.insert(lab.str());
+ p=i+1;
}
+ lab = stripProtectionPrefix(ei.label().right(ei.label().length()-p));
+ arrowNames.insert(lab.str());
}
}
- //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)
{
@@ -481,9 +447,9 @@ void DotNode::writeBox(FTextStream &t,
{
for (const auto &mg : m_classDef->getMemberGroups())
{
- if (mg->members())
+ if (!mg->members().empty())
{
- writeBoxMemberList(t,'*',mg->members(),m_classDef,FALSE,&arrowNames);
+ writeBoxMemberList(t,'*',&mg->members(),m_classDef,FALSE,&arrowNames);
}
}
}
@@ -533,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,
@@ -582,245 +548,219 @@ 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);
m_written=TRUE;
- QList<DotNode> *nl = toChildren ? m_children : m_parents;
- if (nl)
+ if (toChildren)
{
- if (toChildren)
+ auto it = m_edgeInfo.begin();
+ for (const auto &cn : m_children)
{
- QListIterator<DotNode> dnli1(*nl);
- QListIterator<EdgeInfo> dnli2(*m_edgeInfo);
- const DotNode *cn;
- for (dnli1.toFirst();(cn=dnli1.current());++dnli1,++dnli2)
+ if (cn->isVisible())
{
- if (cn->isVisible())
- {
- //printf("write arrow %s%s%s\n",label().data(),backArrows?"<-":"->",cn->label().data());
- writeArrow(t,gt,format,cn,dnli2.current(),topDown,backArrows);
- }
- cn->write(t,gt,format,topDown,toChildren,backArrows);
+ //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);
+ ++it;
}
- else // render parents
+ }
+ else // render parents
+ {
+ for (const auto &pn : m_parents)
{
- QListIterator<DotNode> dnli(*nl);
- DotNode *pn;
- for (dnli.toFirst();(pn=dnli.current());++dnli)
+ if (pn->isVisible())
{
- if (pn->isVisible())
- {
- //printf("write arrow %s%s%s\n",label().data(),backArrows?"<-":"->",pn->label().data());
- writeArrow(t,
- gt,
- format,
- pn,
- pn->edgeInfo()->at(pn->children()->findRef(this)),
- FALSE,
- backArrows
- );
- }
- pn->write(t,gt,format,TRUE,FALSE,backArrows);
+ const auto &children = pn->children();
+ auto child_it = std::find(children.begin(),children.end(),this);
+ size_t index = child_it - children.begin();
+ //printf("write arrow %s%s%s\n",qPrint(label()),backArrows?"<-":"->",qPrint(pn->label()));
+ writeArrow(t,
+ gt,
+ format,
+ pn,
+ &pn->edgeInfo()[index],
+ FALSE,
+ backArrows
+ );
}
+ 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);
- const char *refPtr = url.data();
- char *urlPtr = strchr(url.rawData(),'$');
- if (urlPtr)
+ int dollarPos = url.find('$');
+ if (dollarPos!=-1)
{
- *urlPtr++='\0';
- t << " <link refid=\"" << convertToXML(urlPtr) << "\"";
- if (*refPtr!='\0')
+ t << " <link refid=\"" << convertToXML(url.mid(dollarPos+1)) << "\"";
+ if (dollarPos>0)
{
- t << " external=\"" << convertToXML(refPtr) << "\"";
+ t << " external=\"" << convertToXML(url.left(dollarPos)) << "\"";
}
- t << "/>" << endl;
+ t << "/>\n";
}
}
- if (m_children)
+ auto it = m_edgeInfo.begin();
+ for (const auto &childNode : m_children)
{
- QListIterator<DotNode> nli(*m_children);
- QListIterator<EdgeInfo> eli(*m_edgeInfo);
- DotNode *childNode;
- EdgeInfo *edgeInfo;
- for (;(childNode=nli.current());++nli,++eli)
- {
- edgeInfo=eli.current();
- t << " <childnode refid=\"" << childNode->number() << "\" relation=\"";
- if (isClassGraph)
- {
- switch(edgeInfo->color())
- {
- case EdgeInfo::Blue: t << "public-inheritance"; break;
- case EdgeInfo::Green: t << "protected-inheritance"; break;
- case EdgeInfo::Red: t << "private-inheritance"; break;
- case EdgeInfo::Purple: t << "usage"; break;
- case EdgeInfo::Orange: t << "template-instance"; break;
- case EdgeInfo::Orange2: t << "type-constraint"; break;
- case EdgeInfo::Grey: ASSERT(0); break;
- }
- }
- else // include graph
+ const EdgeInfo &edgeInfo = *it;
+ t << " <childnode refid=\"" << childNode->number() << "\" relation=\"";
+ if (isClassGraph)
+ {
+ switch(edgeInfo.color())
{
- t << "include";
+ case EdgeInfo::Blue: t << "public-inheritance"; break;
+ case EdgeInfo::Green: t << "protected-inheritance"; break;
+ case EdgeInfo::Red: t << "private-inheritance"; break;
+ case EdgeInfo::Purple: t << "usage"; break;
+ case EdgeInfo::Orange: t << "template-instance"; break;
+ case EdgeInfo::Orange2: t << "type-constraint"; break;
+ case EdgeInfo::Grey: ASSERT(0); break;
}
- t << "\">" << endl;
- if (!edgeInfo->label().isEmpty())
+ }
+ else // include graph
+ {
+ t << "include";
+ }
+ t << "\">\n";
+ if (!edgeInfo.label().isEmpty())
+ {
+ int p=0;
+ int ni;
+ while ((ni=edgeInfo.label().find('\n',p))!=-1)
{
- int p=0;
- int ni;
- while ((ni=edgeInfo->label().find('\n',p))!=-1)
- {
- t << " <edgelabel>"
- << convertToXML(edgeInfo->label().mid(p,ni-p))
- << "</edgelabel>" << endl;
- p=ni+1;
- }
t << " <edgelabel>"
- << convertToXML(edgeInfo->label().right(edgeInfo->label().length()-p))
- << "</edgelabel>" << endl;
+ << convertToXML(edgeInfo.label().mid(p,ni-p))
+ << "</edgelabel>\n";
+ p=ni+1;
}
- t << " </childnode>" << endl;
+ t << " <edgelabel>"
+ << convertToXML(edgeInfo.label().right(edgeInfo.label().length()-p))
+ << "</edgelabel>\n";
}
+ 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);
- const char *refPtr = url.data();
- char *urlPtr = strchr(url.rawData(),'$');
- if (urlPtr)
+ int dollarPos = url.find('$');
+ if (dollarPos!=-1)
{
- *urlPtr++='\0';
- t << " <link refid=\"" << convertToXML(urlPtr) << "\"";
- if (*refPtr!='\0')
+ t << " <link refid=\"" << convertToXML(url.mid(dollarPos+1)) << "\"";
+ if (dollarPos>0)
{
- t << " external=\"" << convertToXML(refPtr) << "\"";
+ t << " external=\"" << convertToXML(url.left(dollarPos)) << "\"";
}
- t << "/>" << endl;
+ t << "/>\n";
}
}
- if (m_children)
+ auto it = m_edgeInfo.begin();
+ for (const auto &childNode : m_children)
{
- QListIterator<DotNode> nli(*m_children);
- QListIterator<EdgeInfo> eli(*m_edgeInfo);
- DotNode *childNode;
- EdgeInfo *edgeInfo;
- for (;(childNode=nli.current());++nli,++eli)
- {
- edgeInfo=eli.current();
- t << " <childnode refid=\"" << childNode->number() << "\" relation=\"";
- if (isClassGraph)
- {
- switch(edgeInfo->color())
- {
- case EdgeInfo::Blue: t << "public-inheritance"; break;
- case EdgeInfo::Green: t << "protected-inheritance"; break;
- case EdgeInfo::Red: t << "private-inheritance"; break;
- case EdgeInfo::Purple: t << "usage"; break;
- case EdgeInfo::Orange: t << "template-instance"; break;
- case EdgeInfo::Orange2: t << "type-constraint"; break;
- case EdgeInfo::Grey: ASSERT(0); break;
- }
- }
- else // include graph
+ const EdgeInfo &edgeInfo = *it;
+ t << " <childnode refid=\"" << childNode->number() << "\" relation=\"";
+ if (isClassGraph)
+ {
+ switch(edgeInfo.color())
{
- t << "include";
+ case EdgeInfo::Blue: t << "public-inheritance"; break;
+ case EdgeInfo::Green: t << "protected-inheritance"; break;
+ case EdgeInfo::Red: t << "private-inheritance"; break;
+ case EdgeInfo::Purple: t << "usage"; break;
+ case EdgeInfo::Orange: t << "template-instance"; break;
+ case EdgeInfo::Orange2: t << "type-constraint"; break;
+ case EdgeInfo::Grey: ASSERT(0); break;
}
- t << "\">" << endl;
- if (!edgeInfo->label().isEmpty())
+ }
+ else // include graph
+ {
+ t << "include";
+ }
+ t << "\">\n";
+ if (!edgeInfo.label().isEmpty())
+ {
+ int p=0;
+ int ni;
+ while ((ni=edgeInfo.label().find('\n',p))!=-1)
{
- int p=0;
- int ni;
- while ((ni=edgeInfo->label().find('\n',p))!=-1)
- {
- t << " <edgelabel>"
- << convertToXML(edgeInfo->label().mid(p,ni-p))
- << "</edgelabel>" << endl;
- p=ni+1;
- }
t << " <edgelabel>"
- << convertToXML(edgeInfo->label().right(edgeInfo->label().length()-p))
- << "</edgelabel>" << endl;
+ << convertToXML(edgeInfo.label().mid(p,ni-p))
+ << "</edgelabel>\n";
+ p=ni+1;
}
- t << " </childnode>" << endl;
+ t << " <edgelabel>"
+ << convertToXML(edgeInfo.label().right(edgeInfo.label().length()-p))
+ << "</edgelabel>\n";
}
+ 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())
{
QCString url(m_url);
- const char *refPtr = url.data();
- char *urlPtr = strchr(url.rawData(),'$');
- if (urlPtr)
+ int dollarPos = url.find('$');
+ if (dollarPos!=-1)
{
- *urlPtr++='\0';
- t << nodePrefix << "link = {" << endl << " "
- << nodePrefix << "link-id = '" << urlPtr << "';" << endl;
-
- if (*refPtr!='\0')
+ t << nodePrefix << "link = {\n" << " "
+ << nodePrefix << "link-id = '" << url.mid(dollarPos+1) << "';\n";
+ if (dollarPos>0)
{
t << " " << nodePrefix << "link-external = '"
- << refPtr << "';" << endl;
+ << url.left(dollarPos) << "';\n";
}
- t << " };" << endl;
+ t << " };\n";
}
}
- if (m_children)
+ auto it = m_edgeInfo.begin();
+ for (const auto &childNode : m_children)
{
- QListIterator<DotNode> nli(*m_children);
- QListIterator<EdgeInfo> eli(*m_edgeInfo);
- DotNode *childNode;
- EdgeInfo *edgeInfo;
- for (;(childNode=nli.current());++nli,++eli)
- {
- edgeInfo=eli.current();
- t << " node-child = {" << endl;
- t << " child-id = '" << childNode->number() << "';" << endl;
- t << " relation = ";
-
- switch(edgeInfo->color())
- {
+ const EdgeInfo &edgeInfo = *it;
+ t << " node-child = {\n";
+ t << " child-id = '" << childNode->number() << "';\n";
+ t << " relation = ";
+
+ switch (edgeInfo.color())
+ {
case EdgeInfo::Blue: t << "public-inheritance"; break;
case EdgeInfo::Green: t << "protected-inheritance"; break;
case EdgeInfo::Red: t << "private-inheritance"; break;
@@ -828,82 +768,50 @@ void DotNode::writeDEF(FTextStream &t) const
case EdgeInfo::Orange: t << "template-instance"; break;
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 << " }; /* node-child */" << endl;
- } /* for (;childNode...) */
+ if (!edgeInfo.label().isEmpty())
+ {
+ t << " edgelabel = <<_EnD_oF_dEf_TeXt_\n"
+ << edgeInfo.label() << "\n"
+ << "_EnD_oF_dEf_TeXt_;\n";
+ }
+ t << " }; /* node-child */\n";
+ ++it;
}
- t << " }; /* node */" << endl;
+ t << " }; /* node */\n";
}
void DotNode::clearWriteFlag()
{
m_written=FALSE;
- if (m_parents!=0)
- {
- QListIterator<DotNode> dnlip(*m_parents);
- DotNode *pn;
- for (dnlip.toFirst();(pn=dnlip.current());++dnlip)
- {
- if (pn->isWritten())
- {
- pn->clearWriteFlag();
- }
- }
- }
- if (m_children!=0)
- {
- QListIterator<DotNode> dnlic(*m_children);
- DotNode *cn;
- for (dnlic.toFirst();(cn=dnlic.current());++dnlic)
- {
- if (cn->isWritten())
- {
- cn->clearWriteFlag();
- }
- }
- }
+ for (const auto &pn : m_parents) if (pn->isWritten()) pn->clearWriteFlag();
+ for (const auto &cn : m_children) if (cn->isWritten()) cn->clearWriteFlag();
}
void DotNode::colorConnectedNodes(int curColor)
{
- if (m_children)
+ for (const auto &cn : m_children)
{
- QListIterator<DotNode> dnlic(*m_children);
- DotNode *cn;
- for (dnlic.toFirst();(cn=dnlic.current());++dnlic)
+ if (cn->subgraphId()==-1) // uncolored child node
{
- if (cn->subgraphId()==-1) // uncolored child node
- {
- cn->setSubgraphId(curColor);
- cn->markAsVisible();
- cn->colorConnectedNodes(curColor);
- //printf("coloring node %s (%p): %d\n",cn->label().data(),cn,cn->subgraphId());
- }
+ cn->setSubgraphId(curColor);
+ cn->markAsVisible();
+ cn->colorConnectedNodes(curColor);
+ //printf("coloring node %s (%p): %d\n",qPrint(cn->label()),cn,cn->subgraphId());
}
}
- if (m_parents)
+ for (const auto &pn : m_parents)
{
- QListIterator<DotNode> dnlip(*m_parents);
- DotNode *pn;
- for (dnlip.toFirst();(pn=dnlip.current());++dnlip)
+ if (pn->subgraphId()==-1) // uncolored parent node
{
- if (pn->subgraphId()==-1) // uncolored parent node
- {
- pn->setSubgraphId(curColor);
- pn->markAsVisible();
- pn->colorConnectedNodes(curColor);
- //printf("coloring node %s (%p): %d\n",pn->label().data(),pn,pn->subgraphId());
- }
+ pn->setSubgraphId(curColor);
+ pn->markAsVisible();
+ pn->colorConnectedNodes(curColor);
+ //printf("coloring node %s (%p): %d\n",qPrint(pn->label()),pn,pn->subgraphId());
}
}
}
@@ -911,17 +819,12 @@ void DotNode::colorConnectedNodes(int curColor)
void DotNode::renumberNodes(int &number)
{
m_number = number++;
- if (m_children)
+ for (const auto &cn : m_children)
{
- QListIterator<DotNode> dnlic(*m_children);
- DotNode *cn;
- for (dnlic.toFirst();(cn=dnlic.current());++dnlic)
+ if (!cn->isRenumbered())
{
- if (!cn->isRenumbered())
- {
- cn->markRenumbered();
- cn->renumberNodes(number);
- }
+ cn->markRenumbered();
+ cn->renumberNodes(number);
}
}
}
@@ -929,44 +832,27 @@ void DotNode::renumberNodes(int &number)
const DotNode *DotNode::findDocNode() const
{
if (!m_url.isEmpty()) return this;
- //printf("findDocNode(): '%s'\n",m_label.data());
- if (m_parents)
+ //printf("findDocNode(): '%s'\n",qPrint(m_label));
+ for (const auto &pn : m_parents)
{
- QListIterator<DotNode> dnli(*m_parents);
- DotNode *pn;
- for (dnli.toFirst();(pn=dnli.current());++dnli)
+ if (!pn->hasDocumentation())
{
- if (!pn->hasDocumentation())
- {
- pn->markHasDocumentation();
- const DotNode *dn = pn->findDocNode();
- if (dn) return dn;
- }
+ pn->markHasDocumentation();
+ const DotNode *dn = pn->findDocNode();
+ if (dn) return dn;
}
}
- if (m_children)
+ for (const auto &cn : m_children)
{
- QListIterator<DotNode> dnli(*m_children);
- DotNode *cn;
- for (dnli.toFirst();(cn=dnli.current());++dnli)
+ if (!cn->hasDocumentation())
{
- if (!cn->hasDocumentation())
- {
- cn->markHasDocumentation();
- const DotNode *dn = cn->findDocNode();
- if (dn) return dn;
- }
+ cn->markHasDocumentation();
+ const DotNode *dn = cn->findDocNode();
+ if (dn) return dn;
}
}
return 0;
}
-//--------------------------------------------------------------
-
-int DotNodeList::compareValues(const DotNode *n1,const DotNode *n2) const
-{
- return qstricmp(n1->label(),n2->label());
-}
-
diff --git a/src/dotnode.h b/src/dotnode.h
index 92f268e..cd1e75b 100644
--- a/src/dotnode.h
+++ b/src/dotnode.h
@@ -16,13 +16,16 @@
#ifndef DOTNODE_H
#define DOTNODE_H
-#include "sortdict.h"
+#include <vector>
+#include <map>
+#include <deque>
+#include <iostream>
#include "dotgraph.h"
class ClassDef;
-class DotNodeList;
-class FTextStream;
+class DotNode;
+class TextStream;
/** Attributes of an edge of a dot graph */
class EdgeInfo
@@ -30,7 +33,7 @@ class EdgeInfo
public:
enum Colors { Blue=0, Green=1, Red=2, Purple=3, Grey=4, Orange=5, Orange2=6 };
enum Styles { Solid=0, Dashed=1 };
- EdgeInfo(int color,int style,const QCString &lab,const QCString &url,int labColor)
+ EdgeInfo(int color,int style,const QCString &lab,const QCString &url,int labColor)
: m_color(color), m_style(style), m_label(lab), m_url(url), m_labColor(labColor) {}
~EdgeInfo() {}
int color() const { return m_color; }
@@ -46,13 +49,16 @@ class EdgeInfo
int m_labColor;
};
+using DotNodeRefVector = std::vector<DotNode*>;
+using EdgeInfoVector = std::vector<EdgeInfo>;
+
/** A node in a dot graph */
class DotNode
{
public:
- static void deleteNodes(DotNode* node, SDict<DotNode>* skipNodes = 0);
+ 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();
@@ -61,23 +67,23 @@ 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(DotNodeList &deletedList,SDict<DotNode> *skipNodes=0);
+ void deleteNode(DotNodeRefVector &deletedList);
void removeChild(DotNode *n);
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; }
@@ -101,18 +107,18 @@ class DotNode
const DotNode *findDocNode() const; // only works for acyclic graphs!
void markAsVisible(bool b=TRUE) { m_visible=b; }
void markAsTruncated(bool b=TRUE) { m_truncated=b ? Truncated : Untruncated; }
- const QList<DotNode> *children() const { return m_children; }
- const QList<DotNode> *parents() const { return m_parents; }
- const QList<EdgeInfo> *edgeInfo() const { return m_edgeInfo; }
+ const DotNodeRefVector &children() const { return m_children; }
+ const DotNodeRefVector &parents() const { return m_parents; }
+ const EdgeInfoVector &edgeInfo() const { return m_edgeInfo; }
private:
int m_number;
QCString m_label; //!< label text
QCString m_tooltip; //!< node's tooltip
QCString m_url; //!< url of the node (format: remote$local)
- QList<DotNode> *m_parents = 0; //!< list of parent nodes (incoming arrows)
- QList<DotNode> *m_children = 0; //!< list of child nodes (outgoing arrows)
- QList<EdgeInfo> *m_edgeInfo = 0; //!< edge info for each child
+ DotNodeRefVector m_parents; //!< list of parent nodes (incoming arrows)
+ DotNodeRefVector m_children; //!< list of child nodes (outgoing arrows)
+ EdgeInfoVector m_edgeInfo; //!< edge info for each child
bool m_deleted = false; //!< used to mark a node as deleted
mutable bool m_written = false; //!< used to mark a node as written
bool m_hasDoc = false; //!< used to mark a node as documented
@@ -125,14 +131,12 @@ class DotNode
int m_subgraphId = -1;
};
-/** Class representing a list of DotNode objects. */
-class DotNodeList : public QList<DotNode>
+class DotNodeMap : public std::map<std::string,DotNode*>
+{
+};
+
+class DotNodeDeque : public std::deque<DotNode*>
{
- public:
- DotNodeList() : QList<DotNode>() {}
- ~DotNodeList() {}
- private:
- int compareValues(const DotNode *n1,const DotNode *n2) const;
};
#endif
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 f3e5ef0..1706ed1 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -13,26 +13,18 @@
*
*/
-#include <locale.h>
-
-#include <qfileinfo.h>
-#include <qfile.h>
-#include <qdir.h>
-#include <qdict.h>
-#include <qregexp.h>
-#include <qstrlist.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
-#include <qtextcodec.h>
#include <errno.h>
-#include <qptrdict.h>
-#include <qtextstream.h>
#include <algorithm>
#include <unordered_map>
#include <memory>
#include <cinttypes>
+#include <chrono>
+#include <clocale>
+#include <locale>
#include "version.h"
#include "doxygen.h"
@@ -79,6 +71,8 @@
#include "fortranscanner.h"
#include "xmlcode.h"
#include "sqlcode.h"
+#include "lexcode.h"
+#include "lexscanner.h"
#include "code.h"
#include "portable.h"
#include "vhdljjparser.h"
@@ -107,6 +101,18 @@
#include "threadpool.h"
#include "clangparser.h"
#include "symbolresolver.h"
+#include "regex.h"
+#include "fileinfo.h"
+#include "dir.h"
+#include "conceptdef.h"
+
+#if USE_SQLITE3
+#include <sqlite3.h>
+#endif
+
+#if USE_LIBCLANG
+#include <clang/Basic/Version.h>
+#endif
// provided by the generated file resources.cpp
extern void initResources();
@@ -119,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;
@@ -126,7 +133,7 @@ FileNameLinkedMap *Doxygen::inputNameLinkedMap = 0;
GroupLinkedMap *Doxygen::groupLinkedMap = 0;
PageLinkedMap *Doxygen::pageLinkedMap = 0;
PageLinkedMap *Doxygen::exampleLinkedMap = 0;
-StringDict Doxygen::aliasDict(257); // aliases
+StringMap Doxygen::aliasMap; // aliases
StringSet Doxygen::inputPaths;
FileNameLinkedMap *Doxygen::includeNameLinkedMap = 0; // include names
FileNameLinkedMap *Doxygen::exampleNameLinkedMap = 0; // examples
@@ -135,7 +142,7 @@ FileNameLinkedMap *Doxygen::dotFileNameLinkedMap = 0; // dot files
FileNameLinkedMap *Doxygen::mscFileNameLinkedMap = 0; // msc files
FileNameLinkedMap *Doxygen::diaFileNameLinkedMap = 0; // dia files
StringUnorderedMap Doxygen::namespaceAliasMap; // all namespace aliases
-StringDict Doxygen::tagDestinationDict(257); // all tag locations
+StringMap Doxygen::tagDestinationMap; // all tag locations
StringUnorderedSet Doxygen::expandAsDefinedSet; // all macros that should be expanded
MemberGroupInfoMap Doxygen::memberGroupInfoMap; // dictionary of the member groups heading
std::unique_ptr<PageDef> Doxygen::mainPage;
@@ -145,7 +152,6 @@ bool Doxygen::parseSourcesNeeded = FALSE;
SearchIndexIntf *Doxygen::searchIndex=0;
SymbolMap<Definition> Doxygen::symbolMap;
ClangUsrMap *Doxygen::clangUsrMap = 0;
-bool Doxygen::outputToWizard=FALSE;
Cache<std::string,LookupInfo> *Doxygen::lookupCache;
DirLinkedMap *Doxygen::dirLinkedMap;
DirRelationLinkedMap Doxygen::dirRelations;
@@ -164,9 +170,9 @@ bool Doxygen::clangAssistedParsing = FALSE;
// locally accessible globals
static std::multimap< std::string, const Entry* > g_classEntries;
static StringVector g_inputFiles;
-static QDict<void> g_compoundKeywordDict(7); // keywords recognised as compounds
+static StringSet g_compoundKeywords; // keywords recognised as compounds
static OutputList *g_outputList = 0; // list of output generating objects
-static QDict<FileDef> g_usingDeclarations(1009); // used classes
+static StringSet g_usingDeclarations; // used classes
static bool g_successfulRun = FALSE;
static bool g_dumpSymbolMap = FALSE;
static bool g_useOutputTemplate = FALSE;
@@ -179,6 +185,7 @@ void clearAll()
Doxygen::classLinkedMap->clear();
Doxygen::hiddenClassLinkedMap->clear();
+ Doxygen::conceptLinkedMap->clear();
Doxygen::namespaceLinkedMap->clear();
Doxygen::pageLinkedMap->clear();
Doxygen::exampleLinkedMap->clear();
@@ -189,7 +196,7 @@ void clearAll()
Doxygen::dotFileNameLinkedMap->clear();
Doxygen::mscFileNameLinkedMap->clear();
Doxygen::diaFileNameLinkedMap->clear();
- Doxygen::tagDestinationDict.clear();
+ Doxygen::tagDestinationMap.clear();
SectionManager::instance().clear();
CitationManager::instance().clear();
Doxygen::mainPage.reset();
@@ -199,17 +206,18 @@ void clearAll()
class Statistics
{
public:
- Statistics() { stats.setAutoDelete(TRUE); }
+ Statistics() {}
void begin(const char *name)
{
msg("%s", name);
- stat *entry= new stat(name,0);
- stats.append(entry);
- time.restart();
+ stats.emplace_back(name,0);
+ startTime = std::chrono::steady_clock::now();
}
void end()
{
- stats.getLast()->elapsed=((double)time.elapsed())/1000.0;
+ std::chrono::steady_clock::time_point endTime = std::chrono::steady_clock::now();
+ stats.back().elapsed = std::chrono::duration_cast<
+ std::chrono::microseconds>(endTime - startTime).count()/1000000.0;
}
void print()
{
@@ -220,11 +228,9 @@ class Statistics
restore=TRUE;
}
msg("----------------------\n");
- QListIterator<stat> sli(stats);
- stat *s;
- for ( sli.toFirst(); (s=sli.current()); ++sli )
+ for (const auto &s : stats)
{
- msg("Spent %.3f seconds in %s",s->elapsed,s->name);
+ msg("Spent %.6f seconds in %s",s.elapsed,s.name);
}
if (restore) Debug::setFlag("time");
}
@@ -233,47 +239,15 @@ class Statistics
{
const char *name;
double elapsed;
- stat() : name(NULL),elapsed(0) {}
+ //stat() : name(NULL),elapsed(0) {}
stat(const char *n, double el) : name(n),elapsed(el) {}
};
- QList<stat> stats;
- QTime time;
+ std::vector<stat> stats;
+ std::chrono::steady_clock::time_point startTime;
} g_s;
-void statistics()
-{
-#if 0
- fprintf(stderr,"--- inputNameLinkedMap stats ----\n");
- Doxygen::inputNameLinkedMap->statistics();
- fprintf(stderr,"--- includeNameDict stats ----\n");
- Doxygen::includeNameDict->statistics();
- fprintf(stderr,"--- exampleNameDict stats ----\n");
- Doxygen::exampleNameDict->statistics();
- fprintf(stderr,"--- imageNameDict stats ----\n");
- Doxygen::imageNameDict->statistics();
- fprintf(stderr,"--- dotFileNameDict stats ----\n");
- Doxygen::dotFileNameDict->statistics();
- fprintf(stderr,"--- mscFileNameDict stats ----\n");
- Doxygen::mscFileNameDict->statistics();
- fprintf(stderr,"--- diaFileNameDict stats ----\n");
- Doxygen::diaFileNameDict->statistics();
- fprintf(stderr,"--- memGrpInfoDict stats ----\n");
- Doxygen::memGrpInfoDict.statistics();
-#endif
- //fprintf(stderr,"--- g_excludeNameDict stats ----\n");
- //g_excludeNameDict.statistics();
- fprintf(stderr,"--- aliasDict stats ----\n");
- Doxygen::aliasDict.statistics();
- fprintf(stderr,"--- tagDestinationDict stats ----\n");
- Doxygen::tagDestinationDict.statistics();
- fprintf(stderr,"--- g_compoundKeywordDict stats ----\n");
- g_compoundKeywordDict.statistics();
-}
-
-
-
-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,
@@ -291,12 +265,13 @@ enum FindBaseClassRelation_Mode
Undocumented
};
+
static bool findClassRelation(
const Entry *root,
Definition *context,
ClassDefMutable *cd,
const BaseInfo *bi,
- QDict<int> *templateNames,
+ const TemplateNameMap &templateNames,
/*bool insertUndocumented*/
FindBaseClassRelation_Mode mode,
bool isArtificial
@@ -333,7 +308,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())
{
@@ -374,7 +349,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)
{
@@ -473,7 +448,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);
}
}
@@ -512,7 +487,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");
@@ -530,13 +505,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 ",
@@ -552,13 +526,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() ||
@@ -567,7 +542,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;
@@ -585,7 +560,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
)
@@ -606,7 +581,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
@@ -666,7 +641,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))
)
@@ -688,14 +663,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);
}
@@ -703,11 +678,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
@@ -730,7 +705,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;
}
@@ -738,11 +713,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;
@@ -766,7 +741,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,
@@ -811,7 +786,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);
@@ -827,7 +802,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)
@@ -845,7 +820,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;
@@ -859,28 +834,25 @@ static Definition *findScopeFromQualifiedName(NamespaceDefMutable *startScope,co
// the scope relations!
// Therefore loop through all used classes and see if there is a right
// scope match between the used class and nestedNameSpecifier.
- QDictIterator<FileDef> ui(g_usingDeclarations);
- FileDef *usedFd;
- for (ui.toFirst();(usedFd=ui.current());++ui)
+ for (const auto &usedName : g_usingDeclarations)
{
//printf("Checking using class %s\n",ui.currentKey());
- if (rightScopeMatch(ui.currentKey(),nestedNameSpecifier))
+ if (rightScopeMatch(usedName.c_str(),nestedNameSpecifier))
{
// ui.currentKey() is the fully qualified name of nestedNameSpecifier
// so use this instead.
- QCString fqn = QCString(ui.currentKey())+
- scope.right(scope.length()-p);
+ 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:
@@ -888,7 +860,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;
}
@@ -1013,7 +985,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);
//}
@@ -1041,6 +1013,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));
@@ -1055,7 +1031,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;
@@ -1085,7 +1061,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>(
@@ -1103,14 +1079,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);
@@ -1144,9 +1121,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);
@@ -1183,6 +1160,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;
@@ -1197,7 +1316,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;
};
@@ -1208,13 +1327,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)
{
@@ -1253,7 +1372,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);
//}
}
}
@@ -1275,7 +1394,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);
@@ -1292,7 +1411,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)
);
}
}
@@ -1308,7 +1427,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())
{
@@ -1319,7 +1438,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);
@@ -1338,7 +1457,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>(
@@ -1380,11 +1499,9 @@ static ClassDefMutable *createTagLessInstance(const ClassDef *rootCd,const Class
MemberList *ml = templ->getMemberList(MemberListType_pubAttribs);
if (ml)
{
- MemberListIterator li(*ml);
- MemberDef *md;
- for (li.toFirst();(md=li.current());++li)
+ 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,
@@ -1397,6 +1514,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());
@@ -1421,35 +1539,33 @@ 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);
if (ml)
{
- MemberListIterator li(*ml);
- MemberDef *md;
- for (li.toFirst();(md=li.current());++li)
+ for (const auto &md : *ml)
{
QCString type = md->typeString();
if (type.find("::@")!=-1) // member of tag less struct/union
{
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
@@ -1462,9 +1578,7 @@ static void processTagLessClasses(const ClassDef *rootCd,
MemberList *pml = tagParentCd->getMemberList(MemberListType_pubAttribs);
if (pml)
{
- MemberListIterator pli(*pml);
- MemberDef *pmd;
- for (pli.toFirst();(pmd=pli.current());++pli)
+ for (const auto &pmd : *pml)
{
MemberDefMutable *pmdm = toMemberDefMutable(pmd);
if (pmdm && pmd->name()==md->name())
@@ -1534,7 +1648,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)
@@ -1545,8 +1659,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
{
@@ -1588,7 +1702,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,
@@ -1625,7 +1739,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.
{
@@ -1705,7 +1819,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)=="::")
{
@@ -1741,7 +1855,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;
@@ -1779,7 +1893,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)
@@ -1787,18 +1901,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,
@@ -1809,7 +1923,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);
@@ -1817,9 +1931,6 @@ static void findUsingDirectives(const Entry *root)
nd->setMetaData(root->metaData);
nd->setInline((root->spec&Entry::Inline)!=0);
- //QListIterator<Grouping> gli(*root->groups);
- //Grouping *g;
- //for (;(g=gli.current());++gli)
for (const Grouping &g : root->groups)
{
GroupDef *gd=0;
@@ -1854,15 +1965,7 @@ static void buildListOfUsingDecls(const Entry *root)
)
{
QCString name = substitute(root->name,".","::");
-
- if (g_usingDeclarations.find(name)==0)
- {
- FileDef *fd = root->fileDef();
- if (fd)
- {
- g_usingDeclarations.insert(name,fd);
- }
- }
+ g_usingDeclarations.insert(name.str());
}
for (const auto &e : root->children()) buildListOfUsingDecls(e.get());
}
@@ -1875,7 +1978,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())
{
@@ -1915,7 +2018,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",
@@ -1941,12 +2044,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);
}
}
@@ -1963,14 +2066,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)
{
@@ -1980,14 +2083,14 @@ 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)
{
for (auto &mi : *mni)
{
- MemberDef *md = mi->memberDef();
+ const MemberDef *md = mi->memberDef();
if (md && md->protection()!=Private)
{
//printf("found member %s\n",mni->memberName());
@@ -2029,6 +2132,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());
@@ -2058,7 +2162,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);
}
}
@@ -2095,7 +2199,7 @@ static MemberDef *addVariableToClass(
qPrint(args),
root->protection,
fromAnnScope,
- qPrint(root->initializer)
+ qPrint(root->initializer.str())
);
QCString def;
@@ -2146,7 +2250,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 &&
@@ -2194,7 +2298,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);
@@ -2211,7 +2316,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);
@@ -2219,7 +2324,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);
@@ -2265,12 +2370,12 @@ static MemberDef *addVariableToFile(
{
ttype.stripPrefix("struct ");
ttype.stripPrefix("union ");
- static QRegExp re("[a-z_A-Z][a-z_A-Z0-9]*");
- int l,s;
- s = re.match(ttype,0,&l);
- if (s>=0)
+ static const reg::Ex re(R"(\a\w*)");
+ reg::Match match;
+ std::string typ = ttype.str();
+ if (reg::search(typ,match,re))
{
- QCString typeValue = ttype.mid(s,l);
+ QCString typeValue = match.str();
ClassDefMutable *cd = getClassMutable(typeValue);
if (cd)
{
@@ -2417,7 +2522,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) };
@@ -2429,7 +2534,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);
@@ -2477,27 +2583,36 @@ static MemberDef *addVariableToFile(
* \returns -1 if this is not a function pointer variable or
* the index at which the closing brace of (...*name) was found.
*/
-static int findFunctionPtr(const QCString &type,int lang, int *pLength=0)
+static int findFunctionPtr(const std::string &type,SrcLangExt lang, int *pLength=0)
{
if (lang == SrcLangExt_Fortran || lang == SrcLangExt_VHDL)
{
return -1; // Fortran and VHDL do not have function pointers
}
- static const QRegExp re("([^)]*[\\*\\^][^)]*)");
- int i=-1,l;
- int bb=type.find('<');
- int be=type.findRev('>');
- if (!type.isEmpty() && // return type is non-empty
- (i=re.match(type,0,&l))!=-1 && // contains (...*...)
- type.find("operator")==-1 && // not an operator
- (type.find(")(")==-1 || type.find("typedef ")!=-1) &&
- // not a function pointer return type
+
+ static const reg::Ex re(R"(\([^)]*[*^][^)]*\))");
+ reg::Match match;
+ size_t i=std::string::npos;
+ size_t l=0;
+ if (reg::search(type,match,re)) // contains (...*...)
+ {
+ i = match.position();
+ l = match.length();
+ }
+ size_t bb=type.find('<');
+ size_t be=type.rfind('>');
+
+ if (!type.empty() && // return type is non-empty
+ i!=std::string::npos && // contains (...*...)
+ type.find("operator")==std::string::npos && // not an operator
+ (type.find(")(")==std::string::npos || type.find("typedef ")!=std::string::npos) &&
+ // not a function pointer return type
!(bb<i && i<be) // bug665855: avoid treating "typedef A<void (T*)> type" as a function pointer
)
{
- if (pLength) *pLength=l;
- //printf("findFunctionPtr=%d\n",i);
- return i;
+ if (pLength) *pLength=(int)l;
+ //printf("findFunctionPtr=%d\n",(int)i);
+ return (int)i;
}
else
{
@@ -2512,8 +2627,6 @@ static int findFunctionPtr(const QCString &type,int lang, int *pLength=0)
*/
static bool isVarWithConstructor(const Entry *root)
{
- static QRegExp initChars("[0-9\"'&*!^]+");
- static QRegExp idChars("[a-z_A-Z][a-z_A-Z0-9]*");
bool result=FALSE;
bool typeIsClass = false;
bool typePtrType = false;
@@ -2523,7 +2636,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;
@@ -2570,9 +2683,12 @@ static bool isVarWithConstructor(const Entry *root)
}
for (const Argument &a : root->argList)
{
+ static const reg::Ex initChars(R"([\d"'&*!^]+)");
+ reg::Match match;
if (!a.name.isEmpty() || !a.defval.isEmpty())
{
- if (a.name.find(initChars)==0)
+ std::string name = a.name.str();
+ if (reg::search(name,match,initChars) && match.position()==0)
{
result=TRUE;
}
@@ -2601,24 +2717,24 @@ static bool isVarWithConstructor(const Entry *root)
result=FALSE; // argument is a typedef
goto done;
}
- if (a.type.find(initChars)==0)
+ std::string atype = a.type.str();
+ if (reg::search(atype,match,initChars) && match.position()==0)
{
result=TRUE; // argument type starts with typical initializer char
goto done;
}
- QCString resType=resolveTypeDef(ctx,a.type);
- if (resType.isEmpty()) resType=a.type;
- int len;
- if (idChars.match(resType,0,&len)==0) // resType starts with identifier
+ std::string resType=resolveTypeDef(ctx,a.type).str();
+ if (resType.empty()) resType=atype;
+ static const reg::Ex idChars(R"(\a\w*)");
+ if (reg::search(resType,match,idChars) && match.position()==0) // resType starts with identifier
{
- resType=resType.left(len);
+ resType=match.str();
//printf("resType=%s\n",resType.data());
if (resType=="int" || resType=="long" ||
resType=="float" || resType=="double" ||
- resType=="char" ||
+ resType=="char" || resType=="void" ||
resType=="signed" || resType=="unsigned" ||
- resType=="const" || resType=="volatile" ||
- resType=="void")
+ resType=="const" || resType=="volatile" )
{
result=FALSE; // type keyword -> function prototype
goto done;
@@ -2629,8 +2745,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;
}
@@ -2648,7 +2764,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;
@@ -2661,23 +2777,23 @@ static void addVariable(const Entry *root,int isFuncPtr=-1)
// type="" name="int *" args="(var[10])"
type=name;
- static const QRegExp reName("[a-z_A-Z][a-z_A-Z0-9]*");
- int l=0;
- int j=0;
- int i=args.isEmpty() ? -1 : reName.match(args,0,&l);
- if (i!=-1)
+ std::string sargs = args.str();
+ static const reg::Ex reName(R"(\a\w*)");
+ reg::Match match;
+ if (reg::search(sargs,match,reName))
{
- name=args.mid(i,l);
- j=args.find(')',i+l)-i-l;
- if (j >= 0) args=args.mid(i+l,j);
+ name = match.str(); // e.g. 'var' in '(var[10])'
+ sargs = match.suffix().str(); // e.g. '[10]) in '(var[10])'
+ size_t j = sargs.find(')');
+ 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
{
int i=isFuncPtr;
- if (i==-1 && (root->spec&Entry::Alias)==0) i=findFunctionPtr(type,root->lang); // for typedefs isFuncPtr is not yet set
+ if (i==-1 && (root->spec&Entry::Alias)==0) i=findFunctionPtr(type.str(),root->lang); // for typedefs isFuncPtr is not yet set
Debug::print(Debug::Variables,0," functionPtr? %s\n",i!=-1?"yes":"no");
if (i!=-1) // function pointer
{
@@ -2691,7 +2807,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));
}
}
}
@@ -2798,7 +2914,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)
@@ -2832,8 +2948,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
@@ -2847,7 +2963,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);
}
@@ -2858,7 +2974,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
@@ -2911,15 +3027,15 @@ 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_compoundKeywordDict.find(root->type)==0) &&
+ (root->type.isEmpty() || g_compoundKeywords.find(root->type.str())==g_compoundKeywords.end()) &&
(
(root->section==Entry::VARIABLE_SEC // it's a variable
) ||
(root->section==Entry::FUNCTION_SEC && // or maybe a function pointer variable
- (isFuncPtr=findFunctionPtr(root->type,root->lang))!=-1
+ (isFuncPtr=findFunctionPtr(root->type.str(),root->lang))!=-1
) ||
(root->section==Entry::FUNCTION_SEC && // class variable initialized by constructor
isVarWithConstructor(root)
@@ -2995,7 +3111,9 @@ static void addInterfaceOrServiceToServiceOrSingleton(
// "optional" interface/service get Protected which turns into dashed line
BaseInfo base(rname,
(root->spec & (Entry::Optional)) ? Protected : Public,Normal);
- findClassRelation(root,cd,cd,&base,0,DocumentedOnly,true) || findClassRelation(root,cd,cd,&base,0,Undocumented,true);
+ TemplateNameMap templateNames;
+ findClassRelation(root,cd,cd,&base,templateNames,DocumentedOnly,true) ||
+ findClassRelation(root,cd,cd,&base,templateNames,Undocumented,true);
// add file to list of used files
cd->insertUsedFile(fd);
@@ -3082,24 +3200,8 @@ static void addMethodToClass(const Entry *root,ClassDefMutable *cd,
{
FileDef *fd=root->fileDef();
- int l;
- static QRegExp re("([a-z_A-Z0-9: ]*[ &*]+[ ]*");
QCString type = rtype;
QCString args = rargs;
- int ts=type.find('<');
- int te=type.findRev('>');
- int i=re.match(type,0,&l);
- if (i!=-1 && ts!=-1 && ts<te && ts<i && i<te) // avoid changing A<int(int*)>, see bug 677315
- {
- i=-1;
- }
-
- if (cd->getLanguage()==SrcLangExt_Cpp && // only C has pointers
- !type.isEmpty() && (root->spec&Entry::Alias)==0 && i!=-1) // function variable
- {
- args+=type.right(type.length()-i-l);
- type=type.left(i+l);
- }
QCString name=removeRedundantWhiteSpace(rname);
if (name.left(2)=="::") name=name.right(name.length()-2);
@@ -3112,6 +3214,7 @@ static void addMethodToClass(const Entry *root,ClassDefMutable *cd,
else mtype=MemberType_Function;
// strip redundant template specifier for constructors
+ int i = -1;
int j = -1;
if ((fd==0 || fd->getLanguage()==SrcLangExt_Cpp) &&
name.left(9)!="operator " && // not operator
@@ -3130,7 +3233,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
@@ -3154,6 +3257,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);
@@ -3223,7 +3327,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));
}
@@ -3235,7 +3339,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);
@@ -3263,6 +3367,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
@@ -3341,7 +3446,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));
}
@@ -3373,7 +3478,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)
@@ -3419,21 +3524,9 @@ static void buildFunctionList(const Entry *root)
}
}
- static QRegExp re("([a-z_A-Z0-9: ]*[ &*]+[ ]*");
- int ts=root->type.find('<');
- int te=root->type.findRev('>');
- int ti;
if (!root->parent()->name.isEmpty() &&
(root->parent()->section & Entry::COMPOUND_MASK) &&
- cd &&
- // do some fuzzy things to exclude function pointers
- (root->type.isEmpty() ||
- ((ti=root->type.find(re,0))==-1 || // type does not contain ..(..*
- (ts!=-1 && ts<te && ts<ti && ti<te) || // outside of < ... >
- root->args.find(")[")!=-1) || // and args not )[.. -> function pointer
- root->type.find(")(")!=-1 || root->type.find("operator")!=-1 || // type contains ..)(.. and not "operator"
- cd->getLanguage()!=SrcLangExt_Cpp // language other than C
- )
+ cd
)
{
Debug::print(Debug::Functions,0," --> member %s of class %s!\n",
@@ -3467,7 +3560,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))
@@ -3475,14 +3568,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();
@@ -3490,6 +3583,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())
@@ -3500,6 +3594,10 @@ static void buildFunctionList(const Entry *root)
{
matchingReturnTypes = FALSE;
}
+ if (md->requiresClause()!=root->req)
+ {
+ sameRequiresClause = FALSE;
+ }
}
bool staticsInDifferentFiles =
@@ -3511,6 +3609,7 @@ static void buildFunctionList(const Entry *root)
FALSE) &&
sameNumTemplateArgs &&
matchingReturnTypes &&
+ sameRequiresClause &&
!staticsInDifferentFiles
)
{
@@ -3520,7 +3619,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
@@ -3535,7 +3634,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)
{
@@ -3630,7 +3729,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
{
@@ -3832,7 +3931,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
{
@@ -3850,7 +3949,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())
@@ -3872,26 +3971,26 @@ static void transferRelatedFunctionDocumentation()
* Example: A template class A with template arguments <R,S,T>
* that inherits from B<T,T,S> will have T and S in the dictionary.
*/
-static QDict<int> *getTemplateArgumentsInName(const ArgumentList &templateArguments,const QCString &name)
+static TemplateNameMap getTemplateArgumentsInName(const ArgumentList &templateArguments,const std::string &name)
{
- QDict<int> *templateNames = new QDict<int>(17);
- templateNames->setAutoDelete(TRUE);
- static QRegExp re("[a-z_A-Z][a-z_A-Z0-9:]*");
+ std::map<std::string,int> templateNames;
int count=0;
for (const Argument &arg : templateArguments)
{
- int i,p=0,l;
- while ((i=re.match(name,p,&l))!=-1)
+ static const reg::Ex re(R"(\a[\w:]*)");
+ reg::Iterator it(name,re);
+ reg::Iterator end;
+ for (; it!=end ; ++it)
{
- QCString n = name.mid(i,l);
- if (n==arg.name)
+ const auto &match = *it;
+ std::string n = match.str();
+ if (n==arg.name.str())
{
- if (templateNames->find(n)==0)
+ if (templateNames.find(n)==templateNames.end())
{
- templateNames->insert(n,new int(count));
+ templateNames.insert(std::make_pair(n,count));
}
}
- p=i+l;
}
}
return templateNames;
@@ -3925,11 +4024,11 @@ 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>",
- // Doxygen::classSDict->find(name)
+ // qPrint(name),
+ // context ? qPrint(context->name()) : "<none>",
+ // cd ? qPrint(cd->name()) : "<none>",
+ // result ? qPrint(result->name()) : "<none>",
+ // Doxygen::classLinkedMap->find(name)
// );
return result;
}
@@ -3941,7 +4040,7 @@ static void findUsedClassesForClass(const Entry *root,
ClassDefMutable *instanceCd,
bool isArtificial,
const std::unique_ptr<ArgumentList> &actualArgs = std::unique_ptr<ArgumentList>(),
- QDict<int> *templateNames=0
+ const TemplateNameMap &templateNames = TemplateNameMap()
)
{
const ArgumentList &formalArgs = masterCd->templateArguments();
@@ -3949,10 +4048,10 @@ static void findUsedClassesForClass(const Entry *root,
{
for (auto &mi : *mni)
{
- MemberDef *md=mi->memberDef();
+ 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())
@@ -3966,14 +4065,14 @@ static void findUsedClassesForClass(const Entry *root,
// the type can contain template variables, replace them if present
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();
@@ -3989,16 +4088,15 @@ 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));
- bool delTempNames=FALSE;
- if (templateNames==0)
+ TemplateNameMap formTemplateNames;
+ if (templateNames.empty())
{
- templateNames = getTemplateArgumentsInName(formalArgs,usedName);
- delTempNames=TRUE;
+ formTemplateNames = getTemplateArgumentsInName(formalArgs,usedName.str());
}
BaseInfo bi(usedName,Public,Normal);
- findClassRelation(root,context,instanceCd,&bi,templateNames,TemplateInstances,isArtificial);
+ findClassRelation(root,context,instanceCd,&bi,formTemplateNames,TemplateInstances,isArtificial);
for (const Argument &arg : masterCd->templateArguments())
{
@@ -4020,7 +4118,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());
@@ -4045,7 +4143,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)
{
@@ -4059,11 +4157,6 @@ static void findUsedClassesForClass(const Entry *root,
}
}
}
- if (delTempNames)
- {
- delete templateNames;
- templateNames=0;
- }
}
if (!found && !type.isEmpty()) // used class is not documented in any scope
{
@@ -4114,7 +4207,7 @@ static void findBaseClassesForClass(
FindBaseClassRelation_Mode mode,
bool isArtificial,
const std::unique_ptr<ArgumentList> &actualArgs = std::unique_ptr<ArgumentList>(),
- QDict<int> *templateNames=0
+ const TemplateNameMap &templateNames=TemplateNameMap()
)
{
// The base class could ofcouse also be a non-nested class
@@ -4122,21 +4215,20 @@ 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);
- bool delTempNames=FALSE;
- if (templateNames==0)
+ // qPrint(masterCd->localName()),qPrint(bi.name),actualArgs ? (int)actualArgs->size() : -1);
+ TemplateNameMap formTemplateNames;
+ if (templateNames.empty())
{
- templateNames = getTemplateArgumentsInName(formalArgs,bi.name);
- delTempNames=TRUE;
+ formTemplateNames = getTemplateArgumentsInName(formalArgs,bi.name.str());
}
BaseInfo tbi = bi;
tbi.name = substituteTemplateArgumentsInString(bi.name,formalArgs,actualArgs);
- //printf("bi->name=%s tbi.name=%s\n",bi->name.data(),tbi.name.data());
+ //printf("bi->name=%s tbi.name=%s\n",qPrint(bi->name),qPrint(tbi.name));
if (mode==DocumentedOnly)
{
// find a documented base class in the correct scope
- if (!findClassRelation(root,context,instanceCd,&tbi,templateNames,DocumentedOnly,isArtificial))
+ if (!findClassRelation(root,context,instanceCd,&tbi,formTemplateNames,DocumentedOnly,isArtificial))
{
// 1.8.2: decided to show inheritance relations even if not documented,
// we do make them artificial, so they do not appear in the index
@@ -4144,18 +4236,13 @@ static void findBaseClassesForClass(
bool b = Config_getBool(HIDE_UNDOC_RELATIONS) ? TRUE : isArtificial;
//{
// no documented base class -> try to find an undocumented one
- findClassRelation(root,context,instanceCd,&tbi,templateNames,Undocumented,b);
+ findClassRelation(root,context,instanceCd,&tbi,formTemplateNames,Undocumented,b);
//}
}
}
else if (mode==TemplateInstances)
{
- findClassRelation(root,context,instanceCd,&tbi,templateNames,TemplateInstances,isArtificial);
- }
- if (delTempNames)
- {
- delete templateNames;
- templateNames=0;
+ findClassRelation(root,context,instanceCd,&tbi,formTemplateNames,TemplateInstances,isArtificial);
}
}
}
@@ -4165,21 +4252,16 @@ static void findBaseClassesForClass(
static void findTemplateInstanceRelation(const Entry *root,
Definition *context,
ClassDefMutable *templateClass,const QCString &templSpec,
- QDict<int> *templateNames,
+ const TemplateNameMap &templateNames,
bool isArtificial)
{
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());
- //if (templateNames)
+ // qPrint(templateClass->name()),qPrint(templSpec));
+ //for (const auto &kv : templNames)
//{
- // QDictIterator<int> qdi(*templateNames);
- // int *tempArgIndex;
- // for (;(tempArgIndex=qdi.current());++qdi)
- // {
- // printf("(%s->%d) ",qdi.currentKey(),*tempArgIndex);
- // }
+ // printf("(%s->%d) ",kv.first.c_str(),kv.second);
//}
//printf("\n");
@@ -4194,10 +4276,7 @@ static void findTemplateInstanceRelation(const Entry *root,
root->fileName,root->startLine,root->startColumn,templSpec,freshInstance));
if (instanceClass)
{
- if (isArtificial)
- {
- instanceClass->setArtificial(TRUE);
- }
+ instanceClass->setArtificial(TRUE);
instanceClass->setLanguage(root->lang);
if (freshInstance)
@@ -4207,7 +4286,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;
@@ -4221,7 +4300,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
@@ -4322,10 +4401,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;
@@ -4357,27 +4436,22 @@ static bool findClassRelation(
Definition *context,
ClassDefMutable *cd,
const BaseInfo *bi,
- QDict<int> *templateNames,
+ const TemplateNameMap &templateNames,
FindBaseClassRelation_Mode mode,
bool isArtificial
)
{
//printf("findClassRelation(class=%s base=%s templateNames=",
- // cd->name().data(),bi->name.data());
- //if (templateNames)
+ // qPrint(cd->name()),qPrint(bi->name));
+ //for (const auto &kv : templateNames)
//{
- // QDictIterator<int> qdi(*templateNames);
- // int *tempArgIndex;
- // for (;(tempArgIndex=qdi.current());++qdi)
- // {
- // printf("(%s->%d) ",qdi.currentKey(),*tempArgIndex);
- // }
+ // printf("(%s->%d) ",kv.first.c_str(),kv.second);
//}
//printf("\n");
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);
@@ -4389,12 +4463,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)
@@ -4414,12 +4488,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())!='<'
@@ -4464,7 +4538,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
@@ -4473,7 +4547,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)
{
@@ -4506,7 +4580,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;
}
@@ -4515,14 +4589,14 @@ 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());
found = baseClass!=0 && baseClass!=cd;
}
}
- bool isATemplateArgument = templateNames!=0 && templateNames->find(biName)!=0;
+ bool isATemplateArgument = templateNames.find(biName.str())!=templateNames.end();
// make templSpec canonical
// warning: the following line doesn't work for Mixin classes (see bug 560623)
// templSpec = getCanonicalTemplateSpec(cd, cd->getFileDef(), templSpec);
@@ -4561,7 +4635,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;
@@ -4576,7 +4650,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())
);
}
}
@@ -4611,7 +4685,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(
@@ -4678,7 +4752,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
@@ -4778,7 +4852,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);
}
}
@@ -4831,7 +4905,7 @@ static void computeClassRelations()
warn_undoc(
root->fileName,root->startLine,
"Compound %s is not documented.",
- root->name.data()
+ qPrint(root->name)
);
}
}
@@ -4846,19 +4920,16 @@ static void computeTemplateClassRelations()
bName=stripTemplateSpecifiersFromScope(bName);
ClassDefMutable *cd=getClassMutable(bName);
// strip any anonymous scopes first
- QDict<ClassDef> *templInstances = 0;
- if (cd && (templInstances=cd->getTemplateInstances()))
+ if (cd && !cd->getTemplateInstances().empty())
{
Debug::print(Debug::Classes,0," Template class %s : \n",qPrint(cd->name()));
- QDictIterator<ClassDef> tdi(*templInstances);
- ClassDef *itcd;
- for (tdi.toFirst();(itcd=tdi.current());++tdi) // for each template instance
+ for (const auto &ti : cd->getTemplateInstances()) // for each template instance
{
- ClassDefMutable *tcd=toClassDefMutable(itcd);
+ ClassDefMutable *tcd=toClassDefMutable(ti.classDef);
if (tcd)
{
Debug::print(Debug::Classes,0," Template instance %s : \n",qPrint(tcd->name()));
- QCString templSpec = tdi.currentKey();
+ QCString templSpec = ti.templSpec;
std::unique_ptr<ArgumentList> templArgs = stringToArgumentList(tcd->getLanguage(),templSpec);
for (const BaseInfo &bi : root->extends)
{
@@ -4867,16 +4938,14 @@ static void computeTemplateClassRelations()
const ArgumentList &tl = cd->templateArguments();
if (!tl.empty())
{
- QDict<int> *baseClassNames = tcd->getTemplateBaseClassNames();
- QDict<int> *templateNames = getTemplateArgumentsInName(tl,bi.name);
+ TemplateNameMap baseClassNames = tcd->getTemplateBaseClassNames();
+ TemplateNameMap templateNames = getTemplateArgumentsInName(tl,bi.name.str());
// for each template name that we inherit from we need to
// substitute the formal with the actual arguments
- QDict<int> *actualTemplateNames = new QDict<int>(17);
- actualTemplateNames->setAutoDelete(TRUE);
- QDictIterator<int> qdi(*templateNames);
- for (qdi.toFirst();qdi.current();++qdi)
+ TemplateNameMap actualTemplateNames;
+ for (const auto &tn_kv : templateNames)
{
- int templIndex = *qdi.current();
+ int templIndex = tn_kv.second;
Argument actArg;
bool hasActArg=FALSE;
if (templIndex<(int)templArgs->size())
@@ -4885,15 +4954,13 @@ static void computeTemplateClassRelations()
hasActArg=TRUE;
}
if (hasActArg &&
- baseClassNames!=0 &&
- baseClassNames->find(actArg.type)!=0 &&
- actualTemplateNames->find(actArg.type)==0
+ baseClassNames.find(actArg.type.str())!=baseClassNames.end() &&
+ actualTemplateNames.find(actArg.type.str())==actualTemplateNames.end()
)
{
- actualTemplateNames->insert(actArg.type,new int(templIndex));
+ actualTemplateNames.insert(std::make_pair(actArg.type.str(),templIndex));
}
}
- delete templateNames;
tbi.name = substituteTemplateArgumentsInString(bi.name,tl,templArgs);
// find a documented base class in the correct scope
@@ -4902,7 +4969,6 @@ static void computeTemplateClassRelations()
// no documented base class -> try to find an undocumented one
findClassRelation(root,cd,tcd,&tbi,actualTemplateNames,Undocumented,TRUE);
}
- delete actualTemplateNames;
}
}
}
@@ -4992,7 +5058,7 @@ static void addListReferences()
addRefItem(xrefItems,
name,
theTranslator->trPage(TRUE,TRUE),
- name,pd->title(),0,0);
+ name,pd->title(),QCString(),0);
}
}
@@ -5007,7 +5073,7 @@ static void addListReferences()
addRefItem(xrefItems,
name,
theTranslator->trDir(TRUE,TRUE),
- name,dd->displayName(),0,0);
+ name,dd->displayName(),QCString(),0);
}
}
@@ -5027,7 +5093,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
@@ -5035,7 +5101,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 ");
@@ -5112,13 +5178,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);
@@ -5156,13 +5227,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);
}
}
@@ -5173,7 +5244,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);
@@ -5188,11 +5259,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,
@@ -5268,7 +5339,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)
{
@@ -5312,8 +5383,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
@@ -5326,13 +5397,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;
@@ -5365,7 +5437,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!
@@ -5379,7 +5451,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)
);
}
}
@@ -5416,18 +5488,23 @@ static bool scopeIsTemplate(const Definition *d)
static QCString substituteTemplatesInString(
const ArgumentLists &srcTempArgLists,
const ArgumentLists &dstTempArgLists,
- const QCString &src
+ const std::string &src
)
{
- QCString dst;
- QRegExp re( "[A-Za-z_][A-Za-z_0-9]*");
- //printf("type=%s\n",sa->type.data());
- int i,p=0,l;
- while ((i=re.match(src,p,&l))!=-1) // for each word in srcType
- {
+ std::string dst;
+ static const reg::Ex re(R"(\a\w*)");
+ reg::Iterator it(src,re);
+ reg::Iterator end;
+ //printf("type=%s\n",qPrint(sa->type));
+ size_t p=0;
+ for (; it!=end ; ++it) // for each word in srcType
+ {
+ const auto &match = *it;
+ size_t i = match.position();
+ size_t l = match.length();
bool found=FALSE;
- dst+=src.mid(p,i-p);
- QCString name=src.mid(i,l);
+ dst+=src.substr(p,i-p);
+ std::string name=match.str();
auto srcIt = srcTempArgLists.begin();
auto dstIt = dstTempArgLists.begin();
@@ -5453,9 +5530,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())
{
@@ -5470,7 +5547,7 @@ static QCString substituteTemplatesInString(
}
if (!tdaName.isEmpty())
{
- name=tdaName; // substitute
+ name=tdaName.str(); // substitute
found=TRUE;
}
}
@@ -5478,17 +5555,17 @@ 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;
p=i+l;
}
- dst+=src.right(src.length()-p);
+ dst+=src.substr(p);
//printf(" substituteTemplatesInString(%s)=%s\n",
- // src.data(),dst.data());
+ // qPrint(src),qPrint(dst));
return dst;
}
@@ -5502,8 +5579,8 @@ static void substituteTemplatesInArgList(
auto dstIt = dst.begin();
for (const Argument &sa : src)
{
- QCString dstType = substituteTemplatesInString(srcTempArgLists,dstTempArgLists,sa.type);
- QCString dstArray = substituteTemplatesInString(srcTempArgLists,dstTempArgLists,sa.array);
+ QCString dstType = substituteTemplatesInString(srcTempArgLists,dstTempArgLists,sa.type.str());
+ QCString dstArray = substituteTemplatesInString(srcTempArgLists,dstTempArgLists,sa.array.str());
if (dstIt == dst.end())
{
Argument da = sa;
@@ -5525,9 +5602,9 @@ static void substituteTemplatesInArgList(
dst.setPureSpecifier(src.pureSpecifier());
dst.setTrailingReturnType(substituteTemplatesInString(
srcTempArgLists,dstTempArgLists,
- src.trailingReturnType()));
+ src.trailingReturnType().str()));
//printf("substituteTemplatesInArgList: replacing %s with %s\n",
- // argListToString(src).data(),argListToString(dst).data()
+ // qPrint(argListToString(src)),qPrint(argListToString(dst))
// );
}
@@ -5539,13 +5616,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,
@@ -5623,13 +5700,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
@@ -5640,7 +5717,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)
@@ -5665,12 +5742,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();
@@ -5739,8 +5816,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;
@@ -5821,7 +5897,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();
@@ -5883,7 +5959,7 @@ static void addMemberFunction(const Entry *root,
warnMsg+='\n';
}
- QCString fullFuncDecl=funcDecl.copy();
+ QCString fullFuncDecl=funcDecl;
if (isFunc) fullFuncDecl+=argListToString(root->argList,TRUE);
warnMsg+=" ";
@@ -5907,7 +5983,7 @@ static void addMemberFunction(const Entry *root,
warnMsg+='\n';
warnMsg+=" ";
}
- if (md->typeString())
+ if (!md->typeString().isEmpty())
{
warnMsg+=md->typeString();
warnMsg+=' ';
@@ -5915,8 +5991,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()) +
@@ -5929,7 +6004,7 @@ static void addMemberFunction(const Entry *root,
}
}
}
- warn_simple(root->fileName,root->startLine,warnMsg);
+ warn_simple(root->fileName,root->startLine,qPrint(warnMsg));
}
}
@@ -5965,7 +6040,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);
@@ -6023,7 +6098,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,
@@ -6152,17 +6227,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
{
@@ -6172,14 +6247,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;
@@ -6247,12 +6322,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())
@@ -6275,7 +6350,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);
@@ -6292,9 +6367,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))
{
@@ -6375,7 +6450,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
@@ -6435,7 +6510,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
@@ -6446,11 +6521,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)
);
}
}
@@ -6460,7 +6535,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
@@ -6511,7 +6586,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);
}
@@ -6539,7 +6614,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:
@@ -6580,7 +6655,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
@@ -6654,18 +6729,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)
);
}
}
@@ -6675,7 +6750,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)
);
}
}
@@ -6690,14 +6765,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));
}
}
}
@@ -6714,27 +6789,27 @@ 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;
QCString args = root->args;
if ( // detect func variable/typedef to func ptr
- (i=findFunctionPtr(type,root->lang,&l))!=-1
+ (i=findFunctionPtr(type.str(),root->lang,&l))!=-1
)
{
//printf("Fixing function pointer!\n");
// 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))
@@ -6743,12 +6818,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,
@@ -6772,7 +6847,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,
@@ -6786,16 +6861,16 @@ static void filterMemberDocumentation(const Entry *root,const QCString relates)
||
(root->section==Entry::VARIABLE_SEC && // variable
!type.isEmpty() && // with a type
- g_compoundKeywordDict.find(type)==0 // that is not a keyword
+ g_compoundKeywords.find(type.str())==g_compoundKeywords.end() // that is not a keyword
// (to skip forward declaration of class etc.)
)
)
)
{
//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")
{
@@ -6838,8 +6913,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,
@@ -6905,7 +6980,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,
@@ -6933,7 +7008,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;
@@ -6964,13 +7039,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;
@@ -6992,7 +7067,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,
@@ -7006,16 +7081,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;
@@ -7074,7 +7149,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);
@@ -7100,7 +7175,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;
@@ -7130,34 +7205,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)
{
@@ -7191,7 +7266,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())
{
@@ -7208,7 +7283,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();
@@ -7225,7 +7300,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);
@@ -7238,7 +7314,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)))
@@ -7250,7 +7326,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();
@@ -7285,7 +7361,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
}
@@ -7328,7 +7404,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);
}
@@ -7366,7 +7442,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
{
@@ -7383,10 +7459,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())
{
@@ -7438,7 +7514,7 @@ static void findEnumDocumentation(const Entry *root)
{
warn(root->fileName,root->startLine,
"Documentation for undefined enum '%s' found.",
- name.data()
+ qPrint(name)
);
}
}
@@ -7459,17 +7535,11 @@ static void findDEV(const MemberNameLinkedMap &mnsd)
MemberDefMutable *md = toMemberDefMutable(imd.get());
if (md && md->isEnumerate()) // member is an enum
{
- const MemberList *fmdl = md->enumFieldList();
int documentedEnumValues=0;
- if (fmdl) // enum has values
+ // for each enum value
+ for (const auto &fmd : md->enumFieldList())
{
- MemberListIterator fmni(*fmdl);
- MemberDef *fmd;
- // for each enum value
- for (fmni.toFirst();(fmd=fmni.current());++fmni)
- {
- if (fmd->isLinkableInProject()) documentedEnumValues++;
- }
+ if (fmd->isLinkableInProject()) documentedEnumValues++;
}
// at least one enum value is documented
if (documentedEnumValues>0) md->setDocumentedEnumValues(TRUE);
@@ -7577,8 +7647,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 ||
@@ -7594,8 +7664,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,
@@ -7605,15 +7675,13 @@ static void computeMemberRelations()
)
{
//printf("match!\n");
- MemberDef *rmd;
- if ((rmd=md->reimplements())==0 ||
- minClassDistance(mcd,bmcd)<minClassDistance(mcd,rmd->getClassDef())
- )
+ const MemberDef *rmd = md->reimplements();
+ if (rmd==0 || minClassDistance(mcd,bmcd)<minClassDistance(mcd,rmd->getClassDef()))
{
//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
@@ -7637,19 +7705,12 @@ static void createTemplateInstanceMembers()
for (const auto &cd : *Doxygen::classLinkedMap)
{
// that is a template
- QDict<ClassDef> *templInstances = cd->getTemplateInstances();
- if (templInstances)
+ for (const auto &ti : cd->getTemplateInstances())
{
- QDictIterator<ClassDef> qdi(*templInstances);
- ClassDef *tcd=0;
- // for each instance of the template
- for (qdi.toFirst();(tcd=qdi.current());++qdi)
+ ClassDefMutable *tcdm = toClassDefMutable(ti.classDef);
+ if (tcdm)
{
- ClassDefMutable *tcdm = toClassDefMutable(tcd);
- if (tcdm)
- {
- tcdm->addMembersToTemplateInstance(cd.get(),cd->templateArguments(),qdi.currentKey());
- }
+ tcdm->addMembersToTemplateInstance(cd.get(),cd->templateArguments(),ti.templSpec);
}
}
}
@@ -7670,7 +7731,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());
}
}
@@ -7691,7 +7752,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();
}
}
@@ -7742,7 +7803,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());
@@ -7751,7 +7812,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());
}
@@ -7759,7 +7820,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;
@@ -7769,7 +7830,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);
@@ -7777,7 +7838,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);
@@ -7798,7 +7859,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());
@@ -7808,7 +7869,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());
@@ -7847,12 +7908,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;
@@ -7888,7 +7949,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);
@@ -7896,7 +7957,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);
}
}
@@ -7921,7 +7982,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);
}
}
@@ -7942,6 +8003,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)
{
@@ -7958,8 +8028,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 &&
@@ -7969,7 +8039,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());
}
}
@@ -7980,7 +8050,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);
@@ -7991,7 +8061,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());
}
}
@@ -8012,7 +8082,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(),"") };
@@ -8156,7 +8226,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
@@ -8167,7 +8237,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);
@@ -8186,6 +8256,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)
@@ -8194,15 +8285,15 @@ 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
- MemberDef *bmd = md->reimplements();
+ const MemberDef *bmd = md->reimplements();
while (bmd && bmd->documentation().isEmpty() &&
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
@@ -8331,6 +8422,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)
{
@@ -8479,19 +8579,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));
}
@@ -8562,10 +8662,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
@@ -8575,7 +8675,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
@@ -8583,7 +8683,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)
);
}
}
@@ -8600,7 +8700,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('/');
@@ -8616,7 +8716,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)
@@ -8625,7 +8725,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
@@ -8636,7 +8736,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);
@@ -8645,7 +8745,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());
@@ -8675,7 +8775,7 @@ static void buildPageList(Entry *root)
"page",
name,
title,
- 0,0
+ QCString(),0
);
}
for (const auto &e : root->children()) buildPageList(e.get());
@@ -8689,8 +8789,9 @@ 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";
QCString indexName="index";
Doxygen::mainPage.reset(createPageDef(root->docFile,root->docLine,
@@ -8708,12 +8809,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
@@ -8733,7 +8834,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());
@@ -8772,13 +8873,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()));
}
}
}
@@ -8797,7 +8898,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();
}
@@ -8811,8 +8912,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
@@ -8831,7 +8932,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
@@ -8859,12 +8960,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));
}
}
@@ -8882,7 +8983,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;
@@ -8902,7 +9003,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
@@ -8932,8 +9033,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())
{
@@ -8950,14 +9051,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())
@@ -8996,23 +9097,6 @@ static void generateGroupDocs()
}
//----------------------------------------------------------------------------
-
-//static void generatePackageDocs()
-//{
-// writePackageIndex(*g_outputList);
-//
-// if (Doxygen::packageDict.count()>0)
-// {
-// PackageSDict::Iterator pdi(Doxygen::packageDict);
-// PackageDef *pd;
-// for (pdi.toFirst();(pd=pdi.current());++pdi)
-// {
-// pd->writeDocumentation(*g_outputList);
-// }
-// }
-//}
-
-//----------------------------------------------------------------------------
// generate module pages
static void generateNamespaceClassDocs(const ClassLinkedRefMap &classList)
@@ -9030,7 +9114,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);
@@ -9040,6 +9124,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);
@@ -9054,7 +9152,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);
}
}
@@ -9066,6 +9164,7 @@ static void generateNamespaceDocs()
generateNamespaceClassDocs(nd->getStructs());
generateNamespaceClassDocs(nd->getExceptions());
}
+ generateNamespaceConceptDocs(nd->getConcepts());
}
}
@@ -9097,72 +9196,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('=');
@@ -9171,29 +9258,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);
- Doxygen::tagDestinationDict.insert(fi.absFilePath().utf8(),new QCString(destName));
- //printf("insert tagDestination %s->%s\n",fi.fileName().data(),destName.data());
+ FileInfo fi(fileName.str());
+ Doxygen::tagDestinationMap.insert(
+ 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());
}
//----------------------------------------------------------------------------
@@ -9202,22 +9290,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);
}
}
}
@@ -9229,37 +9317,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);
}
}
}
@@ -9270,38 +9358,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);
}
}
}
@@ -9343,7 +9430,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
@@ -9375,7 +9462,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());
}
}
@@ -9386,7 +9473,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;
@@ -9405,7 +9492,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;
@@ -9420,8 +9507,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))
@@ -9430,16 +9517,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')
@@ -9689,14 +9777,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;
- QDict<void> nonSymlinks;
- QDict<void> known;
- QCString result = path;
+ StringSet nonSymlinks;
+ StringSet known;
+ QCString result(path);
QCString oldPrefix = "/";
do
{
@@ -9710,16 +9797,16 @@ static QCString resolveSymlink(QCString path)
sepPos = result.find('/',sepPos+1);
#endif
QCString prefix = sepPos==-1 ? result : result.left(sepPos);
- if (nonSymlinks.find(prefix)==0)
+ 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)
{
@@ -9729,10 +9816,10 @@ 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)) return QCString(); // recursive symlink!
- known.insert(result,(void*)0x8);
+ if (known.find(result.str())!=known.end()) return std::string(); // recursive symlink!
+ known.insert(result.str());
if (isRelative)
{
sepPos = oldPos;
@@ -9745,14 +9832,14 @@ static QCString resolveSymlink(QCString path)
}
else
{
- nonSymlinks.insert(prefix,(void*)0x8);
+ nonSymlinks.insert(prefix.str());
oldPrefix = prefix;
}
oldPos = sepPos;
}
}
while (sepPos!=-1);
- return QDir::cleanDirPath(result).data();
+ return Dir::cleanDirPath(result.str());
}
static std::mutex g_pathsVisitedMutex;
@@ -9764,7 +9851,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,
@@ -9777,84 +9864,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;
}
@@ -9862,7 +9937,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,
@@ -9877,80 +9952,70 @@ 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;
}
//----------------------------------------------------------------------------
static void expandAliases()
{
- QDictIterator<QCString> adi(Doxygen::aliasDict);
- QCString *s;
- for (adi.toFirst();(s=adi.current());++adi)
+ for (auto &kv : Doxygen::aliasMap)
{
- *s = expandAlias(adi.currentKey(),*s);
+ kv.second = expandAlias(kv.first,kv.second);
}
}
@@ -9958,11 +10023,10 @@ static void expandAliases()
static void escapeAliases()
{
- QDictIterator<QCString> adi(Doxygen::aliasDict);
- QCString *s;
- for (adi.toFirst();(s=adi.current());++adi)
+ for (auto &kv : Doxygen::aliasMap)
{
- QCString value=*s,newValue;
+ QCString value(kv.second);
+ QCString newValue;
int in,p=0;
// for each \n in the alias command value
while ((in=value.find("\\n",p))!=-1)
@@ -9985,7 +10049,6 @@ static void escapeAliases()
p=in+2;
}
newValue+=value.mid(p,value.length()-p);
- *s=newValue;
p = 0;
newValue = "";
while ((in=value.find("^^",p))!=-1)
@@ -9995,8 +10058,8 @@ static void escapeAliases()
p=in+2;
}
newValue+=value.mid(p,value.length()-p);
- *s=newValue;
- //printf("Alias %s has value %s\n",adi.currentKey().data(),s->data());
+ kv.second=newValue.str();
+ //printf("Alias %s has value %s\n",kv.first.c_str(),qPrint(newValue));
}
}
@@ -10005,30 +10068,26 @@ static void escapeAliases()
void readAliases()
{
// add aliases to a dictionary
- Doxygen::aliasDict.setAutoDelete(TRUE);
const StringVector &aliasList = Config_getList(ALIASES);
- for (const auto &s : aliasList)
+ for (const auto &al : aliasList)
{
- QCString alias=s.c_str();
- if (Doxygen::aliasDict[alias]==0)
+ QCString alias(al);
+ int i=alias.find('=');
+ if (i>0)
{
- 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",qPrint(name),qPrint(value));
+ if (!name.isEmpty())
{
- 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());
- if (!name.isEmpty())
+ auto it = Doxygen::aliasMap.find(name.str());
+ if (it==Doxygen::aliasMap.end()) // insert new alias
{
- QCString *dn=Doxygen::aliasDict[name];
- if (dn==0) // insert new alias
- {
- Doxygen::aliasDict.insert(name,new QCString(value));
- }
- else // overwrite previous alias
- {
- *dn=value;
- }
+ Doxygen::aliasMap.insert(std::make_pair(name.str(),value.str()));
+ }
+ else // overwrite previous alias
+ {
+ it->second=value.str();
}
}
}
@@ -10039,7 +10098,7 @@ void readAliases()
//----------------------------------------------------------------------------
-static void dumpSymbol(FTextStream &t,Definition *d)
+static void dumpSymbol(TextStream &t,Definition *d)
{
QCString anchor;
if (d->definitionType()==Definition::TypeMember)
@@ -10058,15 +10117,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);
@@ -10079,7 +10138,7 @@ static void devUsage()
{
msg("Developer parameters:\n");
msg(" -m dump symbol map\n");
- msg(" -b output to wizard\n");
+ msg(" -b making messages output unbuffered\n");
msg(" -T activates output generation via Django like template\n");
msg(" -d <level> enable a debug level, such as (multiple invocations of -d are possible):\n");
Debug::printFlags();
@@ -10087,40 +10146,73 @@ static void devUsage()
//----------------------------------------------------------------------------
+// print the version of doxygen
+
+static void version(const bool extended)
+{
+ QCString versionString = getFullVersion();
+ msg("%s\n",qPrint(versionString));
+ if (extended)
+ {
+ QCString extVers;
+#if USE_SQLITE3
+ if (!extVers.isEmpty()) extVers+= ", ";
+ extVers += "sqlite3 ";
+ extVers += sqlite3_libversion();
+#endif
+#if USE_LIBCLANG
+ if (!extVers.isEmpty()) extVers+= ", ";
+ extVers += "clang support ";
+ extVers += CLANG_VERSION_STRING;
+#endif
+#if MULTITHREADED_SOURCE_GENERATOR
+ if (!extVers.isEmpty()) extVers+= ", ";
+ extVers += "multi-threaded support ";
+#endif
+ if (!extVers.isEmpty())
+ {
+ int lastComma = extVers.findRev(',');
+ if (lastComma != -1) extVers = extVers.replace(lastComma,1," and");
+ msg(" with %s.\n",qPrint(extVers));
+ }
+ }
+}
+
+//----------------------------------------------------------------------------
// 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");
msg("If - is used for configFile doxygen will write / read the configuration to /from standard output / input.\n\n");
- msg("-v print version string\n");
+ msg("-v print version string, -V print extended version information\n");
}
//----------------------------------------------------------------------------
@@ -10143,9 +10235,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 &) {}
};
@@ -10157,11 +10249,11 @@ 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);
- setlocale(LC_ALL,"");
- setlocale(LC_CTYPE,"C"); // to get isspace(0xA0)==0, needed for UTF-8
- setlocale(LC_NUMERIC,"C");
+ 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");
Portable::correct_path();
@@ -10186,6 +10278,8 @@ void initDoxygen()
make_parser_factory<SQLCodeParser>());
Doxygen::parserManager->registerParser("md", make_parser_factory<MarkdownOutlineParser>(),
make_parser_factory<FileCodeParser>());
+ Doxygen::parserManager->registerParser("lex", make_parser_factory<LexOutlineParser>(),
+ make_parser_factory<LexCodeParser>());
// register any additional parsers here...
@@ -10203,10 +10297,11 @@ 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
- Doxygen::tagDestinationDict.setAutoDelete(TRUE);
+ //Doxygen::tagDestinationDict.setAutoDelete(TRUE);
Doxygen::indexList = new IndexList;
// initialisation of these globals depends on
@@ -10224,13 +10319,13 @@ void initDoxygen()
* Initialize some global constants
**************************************************************************/
- g_compoundKeywordDict.insert("template class",(void *)8);
- g_compoundKeywordDict.insert("template struct",(void *)8);
- g_compoundKeywordDict.insert("class",(void *)8);
- g_compoundKeywordDict.insert("struct",(void *)8);
- g_compoundKeywordDict.insert("union",(void *)8);
- g_compoundKeywordDict.insert("interface",(void *)8);
- g_compoundKeywordDict.insert("exception",(void *)8);
+ g_compoundKeywords.insert("template class");
+ g_compoundKeywords.insert("template struct");
+ g_compoundKeywords.insert("class");
+ g_compoundKeywords.insert("struct");
+ g_compoundKeywords.insert("union");
+ g_compoundKeywords.insert("interface");
+ g_compoundKeywords.insert("exception");
}
void cleanUpDoxygen()
@@ -10264,7 +10359,7 @@ void cleanUpDoxygen()
DotManager::deleteInstance();
}
-static int computeIdealCacheParam(uint v)
+static int computeIdealCacheParam(size_t v)
{
//printf("computeIdealCacheParam(v=%u)\n",v);
@@ -10273,7 +10368,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)
@@ -10285,11 +10380,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;
@@ -10320,7 +10415,7 @@ void readConfiguration(int argc, char **argv)
break;
case 'd':
debugLabel=getArg(argc,argv,optind);
- if (!debugLabel)
+ if (debugLabel.isEmpty())
{
devUsage();
cleanUpDoxygen();
@@ -10329,7 +10424,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);
@@ -10346,13 +10441,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)
{
@@ -10360,10 +10455,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);
@@ -10374,13 +10470,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)
{
@@ -10388,10 +10484,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);
@@ -10402,13 +10499,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)
{
@@ -10416,18 +10513,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");
@@ -10450,31 +10548,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))
@@ -10496,30 +10597,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);
}
@@ -10528,7 +10632,12 @@ void readConfiguration(int argc, char **argv)
g_dumpSymbolMap = TRUE;
break;
case 'v':
- msg("%s\n",versionString.data());
+ version(false);
+ cleanUpDoxygen();
+ exit(0);
+ break;
+ case 'V':
+ version(true);
cleanUpDoxygen();
exit(0);
break;
@@ -10540,7 +10649,14 @@ void readConfiguration(int argc, char **argv)
}
else if (qstrcmp(&argv[optind][2],"version")==0)
{
- msg("%s\n",versionString.data());
+ version(false);
+ cleanUpDoxygen();
+ exit(0);
+ }
+ else if ((qstrcmp(&argv[optind][2],"Version")==0) ||
+ (qstrcmp(&argv[optind][2],"VERSION")==0))
+ {
+ version(true);
cleanUpDoxygen();
exit(0);
}
@@ -10553,7 +10669,6 @@ void readConfiguration(int argc, char **argv)
break;
case 'b':
setvbuf(stdout,NULL,_IONBF,0);
- Doxygen::outputToWizard=TRUE;
break;
case 'T':
msg("Warning: this option activates output generation via Django like template files. "
@@ -10580,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())
@@ -10604,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];
@@ -10633,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);
}
@@ -10653,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());
}
@@ -10683,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. */
@@ -10721,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));
}
}
}
@@ -10751,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);
@@ -10767,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)
@@ -10801,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)
{
@@ -10822,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());
}
}
}
@@ -10869,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);
}
@@ -11088,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
@@ -11096,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());
}
/**************************************************************************
@@ -11214,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));
}
}
@@ -11237,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));
}
/**************************************************************************
@@ -11254,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();
@@ -11342,12 +11446,15 @@ void parseInput()
g_s.begin("Building file list...\n");
buildFileList(root.get());
g_s.end();
- //generateFileTree();
g_s.begin("Building class list...\n");
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();
@@ -11367,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());
@@ -11495,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;
};
@@ -11518,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(),
@@ -11531,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();
@@ -11648,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)
{
@@ -11695,11 +11813,11 @@ void generateOutput()
bool generateQhp = Config_getBool(GENERATE_QHP);
bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
bool generateDocSet = Config_getBool(GENERATE_DOCSET);
- if (generateEclipseHelp) Doxygen::indexList->addIndex(new EclipseHelp);
- if (generateHtmlHelp) Doxygen::indexList->addIndex(new HtmlHelp);
- if (generateQhp) Doxygen::indexList->addIndex(new Qhp);
- if (generateTreeView) Doxygen::indexList->addIndex(new FTVHelp(TRUE));
- if (generateDocSet) Doxygen::indexList->addIndex(new DocSets);
+ if (generateEclipseHelp) Doxygen::indexList->addIndex<EclipseHelp>();
+ if (generateHtmlHelp) Doxygen::indexList->addIndex<HtmlHelp>();
+ if (generateQhp) Doxygen::indexList->addIndex<Qhp>();
+ if (generateTreeView) Doxygen::indexList->addIndex<FTVHelp>(TRUE);
+ if (generateDocSet) Doxygen::indexList->addIndex<DocSets>();
Doxygen::indexList->initialize();
HtmlGenerator::writeTabData();
}
@@ -11757,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
@@ -11820,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();
@@ -11893,7 +12015,7 @@ void generateOutput()
{
searchDataFile="searchdata.xml";
}
- if (!Portable::isAbsolutePath(searchDataFile))
+ if (!Portable::isAbsolutePath(searchDataFile.data()))
{
searchDataFile.prepend(Config_getString(OUTPUT_DIRECTORY)+"/");
}
@@ -11919,7 +12041,7 @@ void generateOutput()
warn_flush();
g_s.begin("Running plantuml with JAVA...\n");
- PlantumlManager::instance()->run();
+ PlantumlManager::instance().run();
g_s.end();
warn_flush();
@@ -11959,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();
}
@@ -11979,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();
}
@@ -12001,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);
@@ -12009,7 +12131,7 @@ void generateOutput()
if (Debug::isFlagSet(Debug::Time))
{
- msg("Total elapsed time: %.3f seconds\n(of which %.3f seconds waiting for external tools to finish)\n",
+ msg("Total elapsed time: %.6f seconds\n(of which %.6f seconds waiting for external tools to finish)\n",
((double)Debug::elapsedTime()),
Portable::getSysElapsedTime()
);
@@ -12028,11 +12150,10 @@ void generateOutput()
cleanUpDoxygen();
finalizeSearchIndexer();
- QDir thisDir;
- thisDir.remove(Doxygen::filterDBFileName);
+ Dir thisDir;
+ thisDir.remove(Doxygen::filterDBFileName.str());
finishWarnExit();
Config::deinit();
- QTextCodec::deleteAllCodecs();
delete Doxygen::clangUsrMap;
g_successfulRun=TRUE;
}
diff --git a/src/doxygen.h b/src/doxygen.h
index 1886c0e..f090f1f 100644
--- a/src/doxygen.h
+++ b/src/doxygen.h
@@ -16,14 +16,7 @@
#ifndef DOXYGEN_H
#define DOXYGEN_H
-#include <qdatetime.h>
-#include <qstrlist.h>
-#include <qdict.h>
-#include <qintdict.h>
-
#include "containers.h"
-#include "ftextstream.h"
-#include "sortdict.h"
#include "membergroup.h"
#include "dirdef.h"
#include "memberlist.h"
@@ -40,7 +33,6 @@ class PageLinkedMap;
class PageDef;
class SearchIndexIntf;
class ParserManager;
-class QFileInfo;
class BufStr;
class CiteDict;
class MemberDef;
@@ -49,6 +41,7 @@ class GroupLinkedMap;
class FileDef;
class ClassDef;
class ClassLinkedMap;
+class ConceptLinkedMap;
class MemberNameLinkedMap;
class FileNameLinkedMap;
class NamespaceLinkedMap;
@@ -62,16 +55,6 @@ class Preprocessor;
struct MemberGroupInfo;
class NamespaceDefMutable;
-typedef QList<QCString> StringList;
-typedef QListIterator<QCString> StringListIterator;
-
-class StringDict : public QDict<QCString>
-{
- public:
- StringDict(uint size=17) : QDict<QCString>(size) {}
- virtual ~StringDict() {}
-};
-
struct LookupInfo
{
LookupInfo() = default;
@@ -94,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;
@@ -111,8 +95,8 @@ class Doxygen
static StringUnorderedMap namespaceAliasMap;
static GroupLinkedMap *groupLinkedMap;
static NamespaceLinkedMap *namespaceLinkedMap;
- static StringDict tagDestinationDict;
- static StringDict aliasDict;
+ static StringMap tagDestinationMap;
+ static StringMap aliasMap;
static MemberGroupInfoMap memberGroupInfoMap;
static StringUnorderedSet expandAsDefinedSet;
static NamespaceDefMutable *globalScope;
@@ -121,7 +105,6 @@ class Doxygen
static SearchIndexIntf *searchIndex;
static SymbolMap<Definition> symbolMap;
static ClangUsrMap *clangUsrMap;
- static bool outputToWizard;
static Cache<std::string,LookupInfo> *lookupCache;
static DirLinkedMap *dirLinkedMap;
static DirRelationLinkedMap dirRelations;
@@ -146,7 +129,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 311f748..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
{
@@ -1521,18 +1521,15 @@ EmojiEntityMapper *EmojiEntityMapper::s_instance = 0;
EmojiEntityMapper::EmojiEntityMapper()
{
- m_name2symGh = new QDict<int>(1009);
- m_name2symGh->setAutoDelete(TRUE);
// 2 loops to be able to give precedence to the unicodeName (CLDR)
for (int i = 0; i < g_numEmojiEntities; i++)
{
- m_name2symGh->insert(g_emojiEntities[i].name, new int(i));
+ m_name2symGh.insert(std::make_pair(g_emojiEntities[i].name, i));
}
}
EmojiEntityMapper::~EmojiEntityMapper()
{
- delete m_name2symGh;
}
/** Returns the one and only instance of the Emoji entity mapper */
@@ -1558,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
{
- int *val = m_name2symGh->find(symName);
- return val ? *val : -1;
+ 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 f24a2c0..7ec2519 100644
--- a/src/emoji.h
+++ b/src/emoji.h
@@ -15,10 +15,10 @@
#ifndef EMOJIENTITY_H
#define EMOJIENTITY_H
-#include <qdict.h>
-#include <qfile.h>
+#include <map>
+#include <string>
-class FTextStream;
+class TextStream;
/** @brief Singleton helper class to map emoji entities to other formats */
class EmojiEntityMapper
@@ -28,14 +28,14 @@ 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();
~EmojiEntityMapper();
static EmojiEntityMapper *s_instance;
- QDict<int> *m_name2symGh;
+ std::map<std::string,int> m_name2symGh;
};
#endif
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 2fb2af7..8686636 100644
--- a/src/filedef.cpp
+++ b/src/filedef.cpp
@@ -45,16 +45,18 @@
#include "clangparser.h"
#include "settings.h"
#include "definitionimpl.h"
+#include "conceptdef.h"
//---------------------------------------------------------------------------
using DefinitionLineMap = std::unordered_map<int,const Definition *>;
using MemberDefLineMap = std::unordered_map<int,const MemberDef *>;
+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; }
@@ -83,14 +85,15 @@ class FileDefImpl : public DefinitionMixin<FileDef>
virtual DirDef *getDirDef() const { return m_dir; }
virtual LinkedRefMap<const NamespaceDef> getUsedNamespaces() const;
virtual LinkedRefMap<const ClassDef> getUsedClasses() const { return m_usingDeclList; }
- virtual QList<IncludeInfo> *includeFileList() const { return m_includeList; }
- virtual QList<IncludeInfo> *includedByFileList() const { return m_includedByList; }
+ virtual const IncludeInfoList &includeFileList() const { return m_includeList; }
+ virtual const IncludeInfoList &includedByFileList() const { return m_includedByList; }
virtual void getAllIncludeFilesRecursively(StringVector &incFiles) const;
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;
@@ -103,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);
@@ -111,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; }
@@ -120,8 +124,8 @@ class FileDefImpl : public DefinitionMixin<FileDef>
virtual void combineUsingRelations();
virtual bool generateSourceFile() const;
virtual void sortMemberLists();
- virtual void addIncludeDependency(FileDef *fd,const char *incName,bool local,bool imported);
- virtual void addIncludedByDependency(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();
@@ -142,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);
@@ -149,12 +154,12 @@ 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);
- QDict<IncludeInfo> *m_includeDict;
- QList<IncludeInfo> *m_includeList;
- QDict<IncludeInfo> *m_includedByDict;
- QList<IncludeInfo> *m_includedByList;
+ IncludeInfoMap m_includeMap;
+ IncludeInfoList m_includeList;
+ IncludeInfoMap m_includedByMap;
+ IncludeInfoList m_includedByList;
LinkedRefMap<const NamespaceDef> m_usingDirList;
LinkedRefMap<const ClassDef> m_usingDeclList;
QCString m_path;
@@ -177,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);
}
@@ -192,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 {}
};
//---------------------------------------------------------------------------
@@ -219,26 +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);
- m_includeList = 0;
- m_includeDict = 0;
- m_includedByList = 0;
- m_includedByDict = 0;
+ 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();
@@ -248,10 +249,6 @@ FileDefImpl::FileDefImpl(const char *p,const char *nm,
/*! destroy the file definition */
FileDefImpl::~FileDefImpl()
{
- delete m_includeDict;
- delete m_includeList;
- delete m_includedByDict;
- delete m_includedByList;
}
void FileDefImpl::setDiskName(const QCString &name)
@@ -314,41 +311,32 @@ 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;
- if (m_includeList && m_includeList->count()>0)
+ 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)
{
- QListIterator<IncludeInfo> ili(*m_includeList);
- IncludeInfo *ii;
- for (;(ii=ili.current());++ili)
+ const FileDef *fd=ii.fileDef;
+ if (fd && fd->isLinkable() && !fd->isReference())
{
- FileDef *fd=ii->fileDef;
- if (fd && fd->isLinkable() && !fd->isReference())
- {
- bool isIDLorJava = FALSE;
- SrcLangExt lang = fd->getLanguage();
- isIDLorJava = lang==SrcLangExt_IDL || lang==SrcLangExt_Java;
- const char *locStr = (ii->local || isIDLorJava) ? "yes" : "no";
- const char *impStr = (ii->imported || isIDLorJava) ? "yes" : "no";
- tagFile << " <includes id=\""
- << convertToXML(fd->getOutputFileBase()) << "\" "
- << "name=\"" << convertToXML(fd->name()) << "\" "
- << "local=\"" << locStr << "\" "
- << "imported=\"" << impStr << "\">"
- << convertToXML(ii->includeName)
- << "</includes>"
- << endl;
- }
+ bool isIDLorJava = FALSE;
+ SrcLangExt lang = fd->getLanguage();
+ isIDLorJava = lang==SrcLangExt_IDL || lang==SrcLangExt_Java;
+ const char *locStr = (ii.local || isIDLorJava) ? "yes" : "no";
+ const char *impStr = (ii.imported || isIDLorJava) ? "yes" : "no";
+ tagFile << " <includes id=\""
+ << convertToXML(fd->getOutputFileBase()) << "\" "
+ << "name=\"" << convertToXML(fd->name()) << "\" "
+ << "local=\"" << locStr << "\" "
+ << "imported=\"" << impStr << "\">"
+ << convertToXML(ii.includeName)
+ << "</includes>\n";
}
}
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::File));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::File))
{
switch (lde->kind())
{
@@ -372,20 +360,31 @@ 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";
}
}
}
break;
case LayoutDocEntry::MemberDecl:
{
- LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
+ const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
MemberList * ml = getMemberList(lmd->type);
if (ml)
{
@@ -407,7 +406,7 @@ void FileDefImpl::writeTagFile(FTextStream &tagFile)
}
writeDocAnchorsToTagFile(tagFile);
- tagFile << " </compound>" << endl;
+ tagFile << " </compound>\n";
}
void FileDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title)
@@ -420,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);
@@ -430,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())
@@ -448,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
@@ -474,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
}
@@ -497,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())
{
@@ -517,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();
}
@@ -529,28 +527,26 @@ 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";
}
}
}
void FileDefImpl::writeIncludeFiles(OutputList &ol)
{
- if (m_includeList && m_includeList->count()>0)
+ if (!m_includeList.empty())
{
ol.startTextBlock(TRUE);
- QListIterator<IncludeInfo> ili(*m_includeList);
- IncludeInfo *ii;
- for (;(ii=ili.current());++ili)
+ for (const auto &ii : m_includeList)
{
- FileDef *fd=ii->fileDef;
+ const FileDef *fd=ii.fileDef;
bool isIDLorJava = FALSE;
if (fd)
{
@@ -562,7 +558,7 @@ void FileDefImpl::writeIncludeFiles(OutputList &ol)
{
ol.docify("import ");
}
- else if (ii->imported) // Objective-C include
+ else if (ii.imported) // Objective-C include
{
ol.docify("#import ");
}
@@ -570,12 +566,12 @@ void FileDefImpl::writeIncludeFiles(OutputList &ol)
{
ol.docify("#include ");
}
- if (ii->local || isIDLorJava)
+ if (ii.local || isIDLorJava)
ol.docify("\"");
else
ol.docify("<");
ol.disable(OutputGenerator::Html);
- ol.docify(ii->includeName);
+ ol.docify(ii.includeName);
ol.enableAll();
ol.disableAllBut(OutputGenerator::Html);
@@ -586,15 +582,15 @@ void FileDefImpl::writeIncludeFiles(OutputList &ol)
{
ol.writeObjectLink(fd->getReference(),
fd->generateSourceFile() ? fd->includeName() : fd->getOutputFileBase(),
- 0,ii->includeName);
+ QCString(),ii.includeName);
}
else
{
- ol.docify(ii->includeName);
+ ol.docify(ii.includeName);
}
ol.enableAll();
- if (ii->local || isIDLorJava)
+ if (ii.local || isIDLorJava)
ol.docify("\"");
else
ol.docify(">");
@@ -611,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())
{
@@ -636,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())
{
@@ -660,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();
@@ -686,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()
@@ -756,55 +758,59 @@ void FileDefImpl::writeSummaryLinks(OutputList &ol) const
{
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::File));
- LayoutDocEntry *lde;
bool first=TRUE;
SrcLangExt lang=getLanguage();
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::File))
{
if (lde->kind()==LayoutDocEntry::FileClasses && m_classes.declVisible())
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ 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())
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ 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())
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ 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())
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ 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())
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ 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)
{
- LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
+ const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
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;
}
}
@@ -827,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())
@@ -894,10 +900,7 @@ void FileDefImpl::writeDocumentation(OutputList &ol)
//---------------------------------------- start flexible part -------------------------------
SrcLangExt lang = getLanguage();
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::File));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::File))
{
switch (lde->kind())
{
@@ -921,37 +924,43 @@ void FileDefImpl::writeDocumentation(OutputList &ol)
break;
case LayoutDocEntry::FileClasses:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeClassDeclarations(ol,ls->title(lang),m_classes);
}
break;
case LayoutDocEntry::FileInterfaces:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeClassDeclarations(ol,ls->title(lang),m_interfaces);
}
break;
case LayoutDocEntry::FileStructs:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeClassDeclarations(ol,ls->title(lang),m_structs);
}
break;
case LayoutDocEntry::FileExceptions:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
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:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeNamespaceDeclarations(ol,ls->title(lang),false);
}
break;
case LayoutDocEntry::FileConstantGroups:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeNamespaceDeclarations(ol,ls->title(lang),true);
}
break;
@@ -960,7 +969,7 @@ void FileDefImpl::writeDocumentation(OutputList &ol)
break;
case LayoutDocEntry::MemberDecl:
{
- LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
+ const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
writeMemberDeclarations(ol,lmd->type,lmd->title(lang));
}
break;
@@ -969,7 +978,7 @@ void FileDefImpl::writeDocumentation(OutputList &ol)
break;
case LayoutDocEntry::DetailedDesc:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeDetailedDescription(ol,ls->title(lang));
}
break;
@@ -981,7 +990,7 @@ void FileDefImpl::writeDocumentation(OutputList &ol)
break;
case LayoutDocEntry::MemberDef:
{
- LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
+ const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get();
writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
}
break;
@@ -1001,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:
@@ -1062,9 +1074,7 @@ void FileDefImpl::writeQuickMemberLinks(OutputList &ol,const MemberDef *currentM
MemberList *allMemberList = getMemberList(MemberListType_allMembersList);
if (allMemberList)
{
- MemberListIterator mli(*allMemberList);
- MemberDef *md;
- for (mli.toFirst();(md=mli.current());++mli)
+ for (const auto &md : *allMemberList)
{
if (md->getFileDef()==this && md->getNamespaceDef()==0 && md->isLinkable() && !md->isEnumValue())
{
@@ -1117,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)
@@ -1131,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();
@@ -1146,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();
@@ -1180,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
@@ -1228,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
);
}
}
@@ -1251,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();
}
}
@@ -1262,9 +1272,9 @@ 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->findRef(md)!=-1) // TODO optimize the findRef!
+ if (allMemberList && allMemberList->contains(md))
{
return;
}
@@ -1274,7 +1284,7 @@ void FileDefImpl::insertMember(MemberDef *md)
m_memberLists.emplace_back(std::make_unique<MemberList>(MemberListType_allMembersList));
allMemberList = m_memberLists.back().get();
}
- allMemberList->append(md);
+ allMemberList->push_back(md);
//::addFileMemberNameToIndex(md);
switch (md->memberType())
{
@@ -1312,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);
}
@@ -1345,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)
{
@@ -1368,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;
}
@@ -1390,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;
}
@@ -1404,25 +1420,14 @@ void FileDefImpl::addUsingDeclaration(const ClassDef *cd)
m_usingDeclList.add(cd->qualifiedName(),cd);
}
-void FileDefImpl::addIncludeDependency(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;
- if (!iName.isEmpty() && (!m_includeDict || m_includeDict->find(iName)==0))
+ QCString iName = fd ? fd->absFilePath() : incName;
+ if (!iName.isEmpty() && m_includeMap.find(iName.str())==m_includeMap.end())
{
- if (m_includeDict==0)
- {
- m_includeDict = new QDict<IncludeInfo>(61);
- m_includeList = new QList<IncludeInfo>;
- m_includeList->setAutoDelete(TRUE);
- }
- IncludeInfo *ii = new IncludeInfo;
- ii->fileDef = fd;
- ii->includeName = incName;
- ii->local = local;
- ii->imported = imported;
- m_includeList->append(ii);
- m_includeDict->insert(iName,ii);
+ m_includeList.emplace_back(fd,incName,local,imported);
+ m_includeMap.insert(std::make_pair(iName.str(),&m_includeList.back()));
}
}
@@ -1430,39 +1435,36 @@ 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) // file contains #includes
+ if (!m_includeList.empty()) // file contains #includes
{
{
- QListIterator<IncludeInfo> iii(*m_includeList);
- IncludeInfo *ii;
- for (iii.toFirst();(ii=iii.current());++iii) // foreach #include...
+ for (const auto &ii : m_includeList) // foreach #include...
{
- if (ii->fileDef) // ...that is a known file
+ if (ii.fileDef) // ...that is a known file
{
// recurse into this file
- ii->fileDef->addIncludedUsingDirectives(visitedFiles);
+ const_cast<FileDef*>(ii.fileDef)->addIncludedUsingDirectives(visitedFiles);
}
}
}
{
- QListIterator<IncludeInfo> iii(*m_includeList);
- IncludeInfo *ii;
// iterate through list from last to first
- for (iii.toLast();(ii=iii.current());--iii)
+ for (auto ii_it = m_includeList.rbegin(); ii_it!=m_includeList.rend(); ++ii_it)
{
- if (ii->fileDef && ii->fileDef!=this)
+ const auto &ii = *ii_it;
+ if (ii.fileDef && ii.fileDef!=this)
{
// add using directives
- auto unl = ii->fileDef->getUsedNamespaces();
+ auto unl = ii.fileDef->getUsedNamespaces();
for (auto it = unl.rbegin(); it!=unl.rend(); ++it)
{
const auto *nd = *it;
m_usingDirList.prepend(nd->qualifiedName(),nd);
}
// add using declarations
- auto udl = ii->fileDef->getUsedClasses();
+ auto udl = ii.fileDef->getUsedClasses();
for (auto it = udl.rbegin(); it!=udl.rend(); ++it)
{
const auto *cd = *it;
@@ -1472,37 +1474,26 @@ 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(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;
- if (!iName.isEmpty() && (m_includedByDict==0 || m_includedByDict->find(iName)==0))
+ QCString iName = fd ? fd->absFilePath() : incName;
+ if (!iName.isEmpty() && m_includedByMap.find(iName.str())==m_includedByMap.end())
{
- if (m_includedByDict==0)
- {
- m_includedByDict = new QDict<IncludeInfo>(61);
- m_includedByList = new QList<IncludeInfo>;
- m_includedByList->setAutoDelete(TRUE);
- }
- IncludeInfo *ii = new IncludeInfo;
- ii->fileDef = fd;
- ii->includeName = incName;
- ii->local = local;
- ii->imported = imported;
- m_includedByList->append(ii);
- m_includedByDict->insert(iName,ii);
+ m_includedByList.emplace_back(fd,incName,local,imported);
+ m_includedByMap.insert(std::make_pair(iName.str(),&m_includedByList.back()));
}
}
bool FileDefImpl::isIncluded(const QCString &name) const
{
if (name.isEmpty()) return FALSE;
- return m_includeDict!=0 && m_includeDict->find(name)!=0;
+ return m_includeMap.find(name.str())!=m_includeMap.end();
}
bool FileDefImpl::generateSourceFile() const
@@ -1525,7 +1516,7 @@ void FileDefImpl::addListReferences()
getOutputFileBase(),
theTranslator->trFile(TRUE,TRUE),
getOutputFileBase(),name(),
- 0,
+ QCString(),
0
);
}
@@ -1544,244 +1535,6 @@ void FileDefImpl::addListReferences()
//-------------------------------------------------------------------
-static int findMatchingPart(const QCString &path,const QCString dir)
-{
- int si1;
- int pos1=0,pos2=0;
- while ((si1=path.find('/',pos1))!=-1)
- {
- int si2=dir.find('/',pos2);
- //printf(" found slash at pos %d in path %d: %s<->%s\n",si1,si2,
- // path.mid(pos1,si1-pos2).data(),dir.mid(pos2).data());
- if (si2==-1 && path.mid(pos1,si1-pos2)==dir.mid(pos2)) // match at end
- {
- return dir.length();
- }
- if (si1!=si2 || path.mid(pos1,si1-pos2)!=dir.mid(pos2,si2-pos2)) // no match in middle
- {
- return QMAX(pos1-1,0);
- }
- pos1=si1+1;
- pos2=si2+1;
- }
- return 0;
-}
-
-static Directory *findDirNode(Directory *root,const QCString &name)
-{
- QListIterator<DirEntry> dli(root->children());
- DirEntry *de;
- for (dli.toFirst();(de=dli.current());++dli)
- {
- if (de->kind()==DirEntry::Dir)
- {
- Directory *dir = (Directory *)de;
- QCString dirName=dir->name();
- int sp=findMatchingPart(name,dirName);
- //printf("findMatchingPart(%s,%s)=%d\n",name.data(),dirName.data(),sp);
- if (sp>0) // match found
- {
- if ((uint)sp==dirName.length()) // whole directory matches
- {
- // recurse into the directory
- return findDirNode(dir,name.mid(dirName.length()+1));
- }
- else // partial match => we need to split the path into three parts
- {
- QCString baseName =dirName.left(sp);
- QCString oldBranchName=dirName.mid(sp+1);
- QCString newBranchName=name.mid(sp+1);
- // strip file name from path
- int newIndex=newBranchName.findRev('/');
- if (newIndex>0) newBranchName=newBranchName.left(newIndex);
-
- //printf("Splitting off part in new branch \n"
- // "base=%s old=%s new=%s\n",
- // baseName.data(),
- // oldBranchName.data(),
- // newBranchName.data()
- // );
- Directory *base = new Directory(root,baseName);
- Directory *newBranch = new Directory(base,newBranchName);
- dir->reParent(base);
- dir->rename(oldBranchName);
- base->addChild(dir);
- base->addChild(newBranch);
- dir->setLast(FALSE);
- // remove DirEntry container from list (without deleting it)
- root->children().setAutoDelete(FALSE);
- root->children().removeRef(dir);
- root->children().setAutoDelete(TRUE);
- // add new branch to the root
- if (!root->children().isEmpty())
- {
- root->children().getLast()->setLast(FALSE);
- }
- root->addChild(base);
- return newBranch;
- }
- }
- }
- }
- int si=name.findRev('/');
- if (si==-1) // no subdir
- {
- return root; // put the file under the root node.
- }
- else // need to create a subdir
- {
- QCString baseName = name.left(si);
- //printf("new subdir %s\n",baseName.data());
- Directory *newBranch = new Directory(root,baseName);
- if (!root->children().isEmpty())
- {
- root->children().getLast()->setLast(FALSE);
- }
- root->addChild(newBranch);
- return newBranch;
- }
-}
-
-static void mergeFileDef(Directory *root,FileDef *fd)
-{
- QCString filePath = fd->absFilePath();
- //printf("merging %s\n",filePath.data());
- Directory *dirNode = findDirNode(root,filePath);
- if (!dirNode->children().isEmpty())
- {
- dirNode->children().getLast()->setLast(FALSE);
- }
- DirEntry *e=new DirEntry(dirNode,fd);
- dirNode->addChild(e);
-}
-
-#if 0
-static void generateIndent(QTextStream &t,DirEntry *de,int level)
-{
- if (de->parent())
- {
- generateIndent(t,de->parent(),level+1);
- }
- // from the root up to node n do...
- if (level==0) // item before a dir or document
- {
- if (de->isLast())
- {
- if (de->kind()==DirEntry::Dir)
- {
- t << "<img " << FTV_IMGATTRIBS(plastnode) << "/>";
- }
- else
- {
- t << "<img " << FTV_IMGATTRIBS(lastnode) << "/>";
- }
- }
- else
- {
- if (de->kind()==DirEntry::Dir)
- {
- t << "<img " << FTV_IMGATTRIBS(pnode) << "/>";
- }
- else
- {
- t << "<img " << FTV_IMGATTRIBS(node) << "/>";
- }
- }
- }
- else // item at another level
- {
- if (de->isLast())
- {
- t << "<img " << FTV_IMGATTRIBS(blank) << "/>";
- }
- else
- {
- t << "<img " << FTV_IMGATTRIBS(vertline) << "/>";
- }
- }
-}
-
-static void writeDirTreeNode(QTextStream &t,Directory *root,int level)
-{
- QCString indent;
- indent.fill(' ',level*2);
- QListIterator<DirEntry> dli(root->children());
- DirEntry *de;
- for (dli.toFirst();(de=dli.current());++dli)
- {
- t << indent << "<p>";
- generateIndent(t,de,0);
- if (de->kind()==DirEntry::Dir)
- {
- Directory *dir=(Directory *)de;
- //printf("%s [dir]: %s (last=%d,dir=%d)\n",indent.data(),dir->name().data(),dir->isLast(),dir->kind()==DirEntry::Dir);
- t << "<img " << FTV_IMGATTRIBS(folderclosed) << "/>";
- t << dir->name();
- t << "</p>\n";
- t << indent << "<div>\n";
- writeDirTreeNode(t,dir,level+1);
- t << indent << "</div>\n";
- }
- else
- {
- //printf("%s [file]: %s (last=%d,dir=%d)\n",indent.data(),de->file()->name().data(),de->isLast(),de->kind()==DirEntry::Dir);
- t << "<img " << FTV_IMGATTRIBS(doc) << "/>";
- t << de->file()->name();
- t << "</p>\n";
- }
- }
-}
-#endif
-
-static void addDirsAsGroups(Directory *root,GroupDef *parent,int level)
-{
- GroupDef *gd=0;
- if (root->kind()==DirEntry::Dir)
- {
- gd = Doxygen::groupLinkedMap->add(root->path(),
- std::unique_ptr<GroupDef>(
- createGroupDef("[generated]",
- 1,
- root->path(), // name
- root->name() // title
- )));
- if (parent)
- {
- parent->addGroup(gd);
- gd->makePartOfGroup(parent);
- }
- }
- QListIterator<DirEntry> dli(root->children());
- DirEntry *de;
- for (dli.toFirst();(de=dli.current());++dli)
- {
- if (de->kind()==DirEntry::Dir)
- {
- addDirsAsGroups((Directory *)de,gd,level+1);
- }
- }
-}
-
-void generateFileTree()
-{
- Directory *root=new Directory(0,"root");
- root->setLast(TRUE);
- for (const auto &fn : *Doxygen::inputNameLinkedMap)
- {
- for (const auto &fd : *fn)
- {
- mergeFileDef(root,fd.get());
- }
- }
- //t << "<div class=\"directory\">\n";
- //writeDirTreeNode(t,root,0);
- //t << "</div>\n";
- addDirsAsGroups(root,0,0);
- delete root;
-}
-
-//-------------------------------------------------------------------
-
void FileDefImpl::combineUsingRelations()
{
LinkedRefMap<const NamespaceDef> usingDirList = m_usingDirList;
@@ -1826,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;
@@ -1845,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;
}
}
@@ -1885,7 +1638,7 @@ void FileDefImpl::addMemberToList(MemberListType lt,MemberDef *md)
ml->setNeedsSorting(
((ml->listType()&MemberListType_declarationLists) && sortBriefDocs) ||
((ml->listType()&MemberListType_documentationLists) && sortMemberDocs));
- ml->append(md);
+ ml->push_back(md);
if (lt&MemberListType_documentationLists)
{
ml->setInFile(TRUE);
@@ -1909,8 +1662,8 @@ void FileDefImpl::sortMemberLists()
for (const auto &mg : m_memberGroups)
{
- MemberList *mlg = mg->members();
- if (mlg->needsSorting()) { mlg->sort(); mlg->setNeedsSorting(FALSE); }
+ MemberList &mlg = const_cast<MemberList&>(mg->members());
+ if (mlg.needsSorting()) { mlg.sort(); mlg.setNeedsSorting(FALSE); }
}
if (Config_getBool(SORT_BRIEF_DOCS))
@@ -1961,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());
}
}
}
@@ -1981,20 +1734,15 @@ bool FileDefImpl::isLinkableInProject() const
static void getAllIncludeFilesRecursively(
StringUnorderedSet &filesVisited,const FileDef *fd,StringVector &incFiles)
{
- if (fd->includeFileList())
+ for (const auto &ii : fd->includeFileList())
{
- QListIterator<IncludeInfo> iii(*fd->includeFileList());
- IncludeInfo *ii;
- for (iii.toFirst();(ii=iii.current());++iii)
+ if (ii.fileDef && !ii.fileDef->isReference() &&
+ filesVisited.find(ii.fileDef->absFilePath().str())==filesVisited.end())
{
- if (ii->fileDef && !ii->fileDef->isReference() &&
- filesVisited.find(ii->fileDef->absFilePath().str())==filesVisited.end())
- {
- //printf("FileDefImpl::addIncludeDependency(%s)\n",ii->fileDef->absFilePath().data());
- incFiles.push_back(ii->fileDef->absFilePath().str());
- filesVisited.insert(ii->fileDef->absFilePath().str());
- getAllIncludeFilesRecursively(filesVisited,ii->fileDef,incFiles);
- }
+ //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);
}
}
}
@@ -2051,6 +1799,13 @@ int FileDefImpl::numDecMembers() const
return ml ? ml->numDecMembers() : 0;
}
+// -----------------------
+
+bool compareFileDefs(const FileDef *fd1, const FileDef *fd2)
+{
+ return qstricmp(fd1->name(),fd2->name()) < 0;
+}
+
// --- Cast functions
FileDef *toFileDef(Definition *d)
diff --git a/src/filedef.h b/src/filedef.h
index ba18c2b..7019485 100644
--- a/src/filedef.h
+++ b/src/filedef.h
@@ -21,26 +21,23 @@
#include <set>
#include "index.h"
-#include <qlist.h>
-#include <qintdict.h>
-#include <qdict.h>
#include "definition.h"
-#include "sortdict.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
@@ -50,14 +47,21 @@ using FileDefSet = std::set<const FileDef*>;
/** Class representing the data associated with a \#include statement. */
struct IncludeInfo
{
- IncludeInfo() : fileDef(0), local(FALSE), imported(FALSE) {}
- ~IncludeInfo() {}
- FileDef *fileDef;
+ IncludeInfo() {}
+ IncludeInfo(const FileDef *fd,const QCString &in,bool loc,bool imp)
+ : fileDef(fd), includeName(in), local(loc), imported(imp) {}
+ const FileDef *fileDef = 0;
QCString includeName;
- bool local;
- bool imported;
+ bool local = false;
+ bool imported = false;
};
+class IncludeInfoList : public std::vector<IncludeInfo>
+{
+};
+
+bool compareFileDefs(const FileDef *fd1, const FileDef *fd2);
+
/** A model of a file symbol.
*
* An object of this class contains all file information that is gathered.
@@ -122,8 +126,8 @@ class FileDef : public DefinitionMutable, public Definition
virtual DirDef *getDirDef() const = 0;
virtual LinkedRefMap<const NamespaceDef> getUsedNamespaces() const = 0;
virtual LinkedRefMap<const ClassDef> getUsedClasses() const = 0;
- virtual QList<IncludeInfo> *includeFileList() const = 0;
- virtual QList<IncludeInfo> *includedByFileList() const = 0;
+ virtual const IncludeInfoList &includeFileList() const = 0;
+ virtual const IncludeInfoList &includedByFileList() const = 0;
virtual void getAllIncludeFilesRecursively(StringVector &incFiles) const = 0;
virtual MemberList *getMemberList(MemberListType lt) const = 0;
@@ -131,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;
@@ -152,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;
@@ -162,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;
@@ -175,8 +181,8 @@ class FileDef : public DefinitionMutable, public Definition
virtual bool generateSourceFile() const = 0;
virtual void sortMemberLists() = 0;
- virtual void addIncludeDependency(FileDef *fd,const char *incName,bool local,bool imported) = 0;
- virtual void addIncludedByDependency(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;
@@ -186,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
@@ -196,91 +202,16 @@ const FileDef *toFileDef(const Definition *d);
// ------------------
-/** Class representing a list of FileDef objects. */
-class FileList : public QList<FileDef>
-{
- public:
- FileList() : m_pathName("tmp") {}
- FileList(const char *path) : QList<FileDef>(), m_pathName(path) {}
- ~FileList() {}
- QCString path() const { return m_pathName; }
- private:
- int compareValues(const FileDef *md1,const FileDef *md2) const
- {
- return qstricmp(md1->name(),md2->name());
- }
- QCString m_pathName;
-};
-
-class OutputNameList : public QList<FileList>
-{
- public:
- OutputNameList() : QList<FileList>() {}
- ~OutputNameList() {}
- private:
- int compareValues(const FileList *fl1,const FileList *fl2) const
- {
- return qstricmp(fl1->path(),fl2->path());
- }
-};
-
-class OutputNameDict : public QDict<FileList>
-{
- public:
- OutputNameDict(uint size) : QDict<FileList>(size) {}
- ~OutputNameDict() {}
-};
-
-class Directory;
-
-/** Class representing an entry (file or sub directory) in a directory */
-class DirEntry
+class FileList : public std::vector<const FileDef *>
{
- public:
- enum EntryKind { Dir, File };
- DirEntry(DirEntry *parent,FileDef *fd)
- : m_parent(parent), m_name(fd->name()), m_kind(File), m_fd(fd),
- m_isLast(FALSE) { }
- DirEntry(DirEntry *parent,QCString name)
- : m_parent(parent), m_name(name), m_kind(Dir),
- m_fd(0), m_isLast(FALSE) { }
- virtual ~DirEntry() { }
- EntryKind kind() const { return m_kind; }
- FileDef *file() const { return m_fd; }
- bool isLast() const { return m_isLast; }
- void setLast(bool b) { m_isLast=b; }
- DirEntry *parent() const { return m_parent; }
- QCString name() const { return m_name; }
- QCString path() const { return parent() ? parent()->path()+"/"+name() : name(); }
-
- protected:
- DirEntry *m_parent;
- QCString m_name;
-
- private:
- EntryKind m_kind;
- FileDef *m_fd;
- bool m_isLast;
};
-/** Class representing a directory tree of DirEntry objects. */
-class Directory : public DirEntry
+struct FilesInDir
{
- public:
- Directory(Directory *parent,const QCString &name)
- : DirEntry(parent,name)
- { m_children.setAutoDelete(TRUE); }
- virtual ~Directory() {}
- void addChild(DirEntry *d) { m_children.append(d); d->setLast(TRUE); }
- QList<DirEntry> &children() { return m_children; }
- void rename(const QCString &name) { m_name=name; }
- void reParent(Directory *parent) { m_parent=parent; }
-
- private:
- QList<DirEntry> m_children;
+ FilesInDir(const QCString &p) : path(p) {}
+ QCString path;
+ std::vector<const FileDef *> files;
};
-void generateFileTree();
-
#endif
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 8ba9729..2e5aef9 100644
--- a/src/formula.cpp
+++ b/src/formula.cpp
@@ -16,25 +16,23 @@
#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 <qtextstream.h>
-#include <qdir.h>
+#include "fileinfo.h"
+#include "dir.h"
#include <map>
#include <vector>
#include <string>
#include <utility>
+#include <fstream>
// TODO: remove these dependencies
#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,52 +68,42 @@ FormulaManager &FormulaManager::instance()
return fm;
}
-void FormulaManager::readFormulas(const char *dir,bool doCompare)
+void FormulaManager::readFormulas(const QCString &dir,bool doCompare)
{
- QFile f(QCString(dir)+"/formula.repository");
- if (f.open(IO_ReadOnly)) // open repository
+ std::ifstream f(dir.str()+"/formula.repository",std::ifstream::in);
+ if (f.is_open())
{
uint formulaCount=0;
msg("Reading formula repository...\n");
- QTextStream t(&f);
- QCString line;
+ std::string line;
int lineNr=1;
- while (!t.eof())
+ while (getline(f,line))
{
- line=t.readLine().utf8();
- // old format: \_form#<digits>:formula
- // new format: \_form#<digits>=<digits>x<digits>:formula
- int hi=line.find('#');
- int ei=line.find('=');
- int se=line.find(':'); // find name and text separator.
- if (hi==-1 || se==-1 || hi>se)
+ // format: \_form#<digits>=<digits>x<digits>:formula
+ size_t hi=line.find('#');
+ size_t ei=line.find('=');
+ 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
{
- QCString formName = line.left(se);
- QCString formText = line.right(line.length()-se-1);
+ std::string formName = line.substr(0,se); // '\_form#<digits>=<digits>x<digits>' part
+ std::string formText = line.substr(se+1); // 'formula' part
int w=-1,h=-1;
- if (ei!=-1 && ei>hi && ei<se) // new format
- {
- int xi=formName.find('x',ei);
- if (xi!=-1)
- {
- w=formName.mid(ei+1,xi-ei-1).toInt();
- h=formName.mid(xi+1).toInt();
- }
- formName = formName.left(ei);
- }
- else
+ size_t xi=formName.find('x',ei);
+ if (xi!=std::string::npos)
{
- ei=formName.length();
+ w=std::stoi(formName.substr(ei+1,xi-ei-1)); // digits from '=<digits>x' part as int
+ h=std::stoi(formName.substr(xi+1)); // digits from 'x<digits>' part as int
}
+ formName = formName.substr(0,ei); // keep only the '\_form#<digits>' part
if (doCompare)
{
- int formId = formName.mid(hi+1,ei-hi-1).toInt();
- QCString storedFormText = FormulaManager::instance().findFormula(formId);
+ int formId = std::stoi(formName.substr(hi+1));
+ std::string storedFormText = FormulaManager::instance().findFormula(formId);
if (storedFormText!=formText)
{
term("discrepancy between formula repositories! Remove "
@@ -123,13 +111,10 @@ void FormulaManager::readFormulas(const char *dir,bool doCompare)
}
formulaCount++;
}
- else
+ int id = addFormula(formText);
+ if (w!=-1 && h!=-1)
{
- int id = addFormula(formText);
- if (w!=-1 && h!=-1)
- {
- p->storeDisplaySize(id,w,h);
- }
+ p->storeDisplaySize(id,w,h);
}
}
lineNr++;
@@ -142,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
@@ -214,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();
@@ -228,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)
{
@@ -265,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);
@@ -285,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();
@@ -299,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();
@@ -316,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();
@@ -345,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();
@@ -396,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;
}
@@ -409,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++;
}
@@ -450,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);
@@ -462,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()
@@ -476,28 +454,27 @@ void FormulaManager::clear()
p->formulaMap.clear();
}
-int FormulaManager::addFormula(const char *formulaText)
+int FormulaManager::addFormula(const std::string &formulaText)
{
- std::string key = toStdString(formulaText);
- auto it = p->formulaMap.find(key);
+ auto it = p->formulaMap.find(formulaText);
if (it!=p->formulaMap.end()) // already stored
{
return it->second;
}
// store new formula
int id = (int)p->formulas.size();
- p->formulaMap.insert(std::pair<std::string,int>(key,id));
- p->formulas.push_back(key);
+ p->formulaMap.insert(std::pair<std::string,int>(formulaText,id));
+ p->formulas.push_back(formulaText);
return id;
}
-QCString FormulaManager::findFormula(int formulaId) const
+std::string FormulaManager::findFormula(int formulaId) const
{
if (formulaId>=0 && formulaId<(int)p->formulas.size())
{
- return p->formulas[formulaId].c_str();
+ return p->formulas[formulaId];
}
- return QCString();
+ return std::string();
}
bool FormulaManager::hasFormulas() const
@@ -512,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
@@ -535,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();
@@ -576,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 4bd90af..9baeb24 100644
--- a/src/formula.h
+++ b/src/formula.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,9 @@
#define FORMULA_H
#include <memory>
-#include <qcstring.h>
+#include <string>
+
+#include "qcstring.h"
/*! Manager class to handle formulas */
class FormulaManager
@@ -34,11 +36,11 @@ 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 char *formulaText);
- void generateImages(const char *outputDir,Format format,HighDPI hd = HighDPI::Off) const;
- QCString findFormula(int formulaId) const;
+ int addFormula(const std::string &formulaText);
+ 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;
private:
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 df6acf4..c7c4d89 100644
--- a/src/fortrancode.l
+++ b/src/fortrancode.l
@@ -42,18 +42,13 @@
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
-#include <qregexp.h>
-#include <qdir.h>
-#include <qcstringlist.h>
-#include "entry.h"
+
#include "doxygen.h"
#include "message.h"
#include "outputlist.h"
#include "util.h"
#include "membername.h"
-#include "searchindex.h"
#include "defargs.h"
-#include "memberlist.h"
#include "config.h"
#include "groupdef.h"
#include "classlist.h"
@@ -99,17 +94,15 @@ class UseEntry
{
public:
QCString module; // just for debug
- QCStringList onlyNames; /* entries of the ONLY-part */
+ std::vector<QCString> onlyNames; /* entries of the ONLY-part */
};
/**
module name -> list of ONLY/remote entries
(module name = name of the module, which can be accessed via use-directive)
*/
-class UseSDict : public SDict<UseEntry>
+class UseMap : public std::map<std::string,UseEntry>
{
- public:
- UseSDict() : SDict<UseEntry>(17) {}
};
/**
@@ -118,7 +111,7 @@ class UseSDict : public SDict<UseEntry>
class Scope
{
public:
- QCStringList useNames; //!< contains names of used modules
+ std::vector<QCString> useNames; //!< contains names of used modules
StringUnorderedSet localVars; //!< contains names of local variables
StringUnorderedSet externalVars; //!< contains names of external entities
};
@@ -131,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
- UseSDict * useMembers= 0; //!< info about used modules
- UseEntry * useEntry = 0; //!< current use statement info
- QList<Scope> scopeStack;
+ 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,35 +174,36 @@ static const char *stateToString(int state);
static bool getFortranNamespaceDefs(const QCString &mname,
NamespaceDef *&cd);
static bool getFortranTypeDefs(const QCString &tname, const QCString &moduleName,
- ClassDef *&cd, UseSDict *usedict=0);
+ ClassDef *&cd, const UseMap &useMap);
//----------------------------------------------------------------------------
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,UseSDict *usedict, // dictionary with used modules
- const char *memberText, // exact member text
+static bool getLink(yyscan_t yyscanner,const UseMap &useMap, // map with used modules
+ 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);
static void addUse(yyscan_t yyscanner,const QCString &moduleName);
static void addLocalVar(yyscan_t yyscanner,const QCString &varName);
static MemberDef *getFortranDefs(yyscan_t yyscanner,const QCString &memberName, const QCString &moduleName,
- UseSDict *usedict=0);
+ const UseMap &useMap);
static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size);
@@ -328,7 +322,7 @@ LANGUAGE_BIND_SPEC BIND{BS}"("{BS}C{BS}(,{BS}NAME{BS}"="{BS}"\""(.*)"\""{BS})?")
codifyLines(yyscanner,yytext);
endFontClass(yyscanner);
}
-<Start>^{BS}"namelist"/[//] { // Namelist specification
+<Start>^{BS}"namelist"/[/] { // Namelist specification
startFontClass(yyscanner,"keywordtype");
codifyLines(yyscanner,yytext);
endFontClass(yyscanner);
@@ -349,19 +343,16 @@ 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);
yyextra->insideBody=FALSE;
/* append module name to use dict */
- yyextra->useEntry = new UseEntry();
- //yyextra->useEntry->module = yytext;
- //yyextra->useMembers->append(yytext, yyextra->useEntry);
- //addUse(yytext);
- yyextra->useEntry->module = tmp;
- yyextra->useMembers->append(tmp, yyextra->useEntry);
+ yyextra->useEntry = UseEntry();
+ yyextra->useEntry.module = tmp;
+ yyextra->useMembers.insert(std::make_pair(tmp.str(), yyextra->useEntry));
addUse(yyscanner,tmp);
}
<Use,UseOnly,Import>{BS},{BS} { codifyLines(yyscanner,yytext); }
@@ -369,9 +360,9 @@ 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.append(tmp);
+ yyextra->useEntry.onlyNames.push_back(tmp);
yyextra->insideBody=TRUE;
generateLink(yyscanner,*yyextra->code, yytext);
yyextra->insideBody=FALSE;
@@ -440,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;
@@ -514,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} {
@@ -536,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 &&
@@ -562,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);
@@ -576,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);
@@ -647,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;
}
}
@@ -750,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;
@@ -801,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)
@@ -811,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));
}
}
<*>. {
@@ -825,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) {
@@ -880,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;
}
}
@@ -901,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)
@@ -924,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;
@@ -944,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));
}
}
@@ -983,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)
@@ -1001,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;
}
}
@@ -1018,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);
@@ -1032,18 +1024,17 @@ static void writeMultiLineCodeLink(yyscan_t yyscanner,CodeOutputInterface &ol,
tooltip = d->briefDescriptionAsTooltip();
}
bool done=FALSE;
- char *p=(char *)text;
+ const char *p=text.data();
while (!done)
{
- char *sp=p;
+ const char *sp=p;
char c;
while ((c=*p++) && c!='\n') { }
if (c=='\n')
{
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,p-sp-1),tooltip);
nextCodeLine(yyscanner);
}
else
@@ -1077,11 +1068,11 @@ static bool getFortranNamespaceDefs(const QCString &mname,
@param tname the name of the type
@param moduleName name of enclosing module or null, if global entry
@param cd the entry, if found or null
- @param usedict dictionary of data of USE-statement
+ @param useMap map of data of USE-statement
@returns true, if type is found
*/
static bool getFortranTypeDefs(const QCString &tname, const QCString &moduleName,
- ClassDef *&cd, UseSDict *usedict)
+ ClassDef *&cd, const UseMap &useMap)
{
if (tname.isEmpty()) return FALSE; /* empty name => nothing to link */
@@ -1093,17 +1084,16 @@ 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;
}
else
{
- UseEntry *use;
- for (UseSDict::Iterator di(*usedict); (use=di.current()); ++di)
+ for (const auto &kv : useMap)
{
- if ((cd= Doxygen::classLinkedMap->find(use->module+"::"+tname)))
+ if ((cd= Doxygen::classLinkedMap->find(kv.second.module+"::"+tname)))
{
//cout << "=== type found in used module" << endl;
return TRUE;
@@ -1116,25 +1106,25 @@ static bool getFortranTypeDefs(const QCString &tname, const QCString &moduleName
/**
searches for definition of function memberName
+ @param yyscanner the scanner data to be used
@param memberName the name of the function/variable
@param moduleName name of enclosing module or null, if global entry
- @param usedict array of data of USE-statement
+ @param useMap map of data of USE-statement
@returns MemberDef pointer, if found, or nullptr otherwise
*/
static MemberDef *getFortranDefs(yyscan_t yyscanner,const QCString &memberName, const QCString &moduleName,
- UseSDict *usedict)
+ const UseMap &useMap)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (memberName.isEmpty()) return nullptr; /* empty name => nothing to link */
// look in local variables
- QListIterator<Scope> it(yyextra->scopeStack);
- Scope *scope;
- for (it.toLast();(scope=it.current());--it)
+ for (auto it = yyextra->scopeStack.rbegin(); it!=yyextra->scopeStack.rend(); ++it)
{
+ const Scope &scope = *it;
std::string lowMemName = memberName.lower().str();
- if (scope->localVars.find(lowMemName)!=std::end(scope->localVars) && // local var
- scope->externalVars.find(lowMemName)==std::end(scope->externalVars)) // and not external
+ if (scope.localVars .find(lowMemName)!=std::end(scope.localVars) && // local var
+ scope.externalVars.find(lowMemName)==std::end(scope.externalVars)) // and not external
{
return nullptr;
}
@@ -1177,22 +1167,22 @@ static MemberDef *getFortranDefs(yyscan_t yyscanner,const QCString &memberName,
else
{ // else search in used modules
QCString usedModuleName= nspace->name();
- UseEntry *ue= usedict->find(usedModuleName);
- if (ue)
+ auto use_it = useMap.find(usedModuleName.str());
+ if (use_it!=useMap.end())
{
+ const UseEntry &ue = use_it->second;
// check if only-list exists and if current entry exists is this list
- QCStringList &only= ue->onlyNames;
- if (only.isEmpty())
+ if (ue.onlyNames.empty())
{
//cout << " found in module " << usedModuleName << " entry " << memberName << endl;
return md.get(); // whole module used
}
else
{
- for ( QCStringList::Iterator lit = only.begin(); lit != only.end(); ++lit)
+ for ( const auto &name : ue.onlyNames)
{
//cout << " search in only: " << usedModuleName << ":: " << memberName << "==" << (*it)<< endl;
- if (memberName == *lit)
+ if (memberName == name)
{
return md.get(); // found in ONLY-part of use list
}
@@ -1211,7 +1201,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;
@@ -1220,16 +1210,16 @@ static bool getGenericProcedureLink(yyscan_t yyscanner,const ClassDef *cd,
return FALSE;
}
-static bool getLink(yyscan_t yyscanner,UseSDict *usedict, // dictionary with used modules
- const char *memberText, // exact member text
+static bool getLink(yyscan_t yyscanner,const UseMap &useMap, // dictionary with used modules
+ 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;
QCString memberName= removeRedundantWhiteSpace(memberText);
- if ((md=getFortranDefs(yyscanner,memberName, yyextra->currentModule, usedict)) && md->isLinkable())
+ if ((md=getFortranDefs(yyscanner,memberName, yyextra->currentModule, useMap)) && md->isLinkable())
{
if (md->isVariable() && (md->getLanguage()!=SrcLangExt_Fortran)) return FALSE; // Non Fortran variables aren't handled yet,
// see also linkifyText in util.cpp
@@ -1245,8 +1235,8 @@ static bool getLink(yyscan_t yyscanner,UseSDict *usedict, // dictionary with use
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;
}
}
@@ -1254,36 +1244,36 @@ static bool getLink(yyscan_t yyscanner,UseSDict *usedict, // dictionary with use
}
-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;
}
@@ -1291,12 +1281,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)
{
@@ -1324,8 +1319,7 @@ static void startScope(yyscan_t yyscanner)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
DBG_CTX((stderr, "===> startScope %s",yytext));
- Scope *scope = new Scope;
- yyextra->scopeStack.append(scope);
+ yyextra->scopeStack.push_back(Scope());
}
/** end scope */
@@ -1333,36 +1327,35 @@ static void endScope(yyscan_t yyscanner)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
DBG_CTX((stderr,"===> endScope %s",yytext));
- if (yyextra->scopeStack.isEmpty())
+ if (yyextra->scopeStack.empty())
{
DBG_CTX((stderr,"WARNING: fortrancode.l: stack empty!\n"));
return;
}
- Scope *scope = yyextra->scopeStack.getLast();
- yyextra->scopeStack.removeLast();
- for ( QCStringList::Iterator it = scope->useNames.begin(); it != scope->useNames.end(); ++it)
+ Scope &scope = yyextra->scopeStack.back();
+ for ( const auto &name : scope.useNames)
{
- yyextra->useMembers->remove(*it);
+ yyextra->useMembers.erase(name.str());
}
- delete scope;
+ yyextra->scopeStack.pop_back();
}
static void addUse(yyscan_t yyscanner,const QCString &moduleName)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- if (!yyextra->scopeStack.isEmpty())
- yyextra->scopeStack.getLast()->useNames.append(moduleName);
+ if (!yyextra->scopeStack.empty())
+ yyextra->scopeStack.back().useNames.push_back(moduleName);
}
static void addLocalVar(yyscan_t yyscanner,const QCString &varName)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- if (!yyextra->scopeStack.isEmpty())
+ if (!yyextra->scopeStack.empty())
{
std::string lowVarName = varName.lower().str();
- yyextra->scopeStack.getLast()->localVars.insert(lowVarName);
- if (yyextra->isExternal) yyextra->scopeStack.getLast()->externalVars.insert(lowVarName);
+ yyextra->scopeStack.back().localVars.insert(lowVarName);
+ if (yyextra->isExternal) yyextra->scopeStack.back().externalVars.insert(lowVarName);
}
}
@@ -1418,12 +1411,10 @@ FortranCodeParser::FortranCodeParser(FortranFormat format) : p(std::make_unique<
fortrancodeYYset_debug(1,p->yyscanner);
#endif
resetCodeParserState();
- p->state.useMembers = new UseSDict;
}
FortranCodeParser::~FortranCodeParser()
{
- delete p->state.useMembers;
fortrancodeYYlex_destroy(p->yyscanner);
}
@@ -1438,11 +1429,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,
@@ -1464,9 +1455,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;
@@ -1495,11 +1486,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;
@@ -1529,7 +1520,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 99e1f9a..328612a 100644..100755
--- a/src/fortranscanner.l
+++ b/src/fortranscanner.l
@@ -6,32 +6,32 @@
* based on the work of 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.
*
* Documents produced by Doxygen are derivative works derived from the
* input used in their production; they are not affected by this license.
*
- */
+ */
/* Developer notes.
*
- * - Consider using startScope(), endScope() functions with module, program,
+ * - Consider using startScope(), endScope() functions with module, program,
* subroutine or any other scope in fortran program.
*
* - Symbol yyextra->modifiers (attributes) are collected using SymbolModifiers |= operator during
* substructure parsing. When substructure ends all yyextra->modifiers are applied to actual
* entries in applyModifiers() functions.
- *
+ *
* - How case insensitiveness should be handled in code?
* On one side we have arg->name and entry->name, on another side modifierMap[name].
* In entries and arguments case is the same as in code, in modifier map case is lowered and
* then it is compared to lowered entry/argument names.
*
* - Do not like constructs like aa{BS} or {BS}bb. Should try to handle blank space
- * with separate rule?: It seems it is often necessary, because we may parse something like
+ * with separate rule?: It seems it is often necessary, because we may parse something like
* "functionA" or "MyInterface". So constructs like '(^|[ \t])interface({BS_}{ID})?/[ \t\n]'
* are desired.
*
@@ -49,18 +49,13 @@
%{
#include <map>
+#include <vector>
-#include <stdio.h>
+#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <ctype.h>
-#include <qarray.h>
-#include <qstack.h>
-#include <qregexp.h>
-#include <qfile.h>
-#include <qmap.h>
-
#include "fortranscanner.h"
#include "entry.h"
#include "message.h"
@@ -69,7 +64,7 @@
#include "util.h"
#include "defargs.h"
#include "language.h"
-#include "commentscan.h"
+#include "commentscan.h"
#include "pre.h"
#include "arguments.h"
#include "debug.h"
@@ -131,11 +126,11 @@ struct SymbolModifiers
//ostream& operator<<(ostream& out, const SymbolModifiers& mdfs);
-static const char *directionStrs[] =
+static const char *directionStrs[] =
{
"", "intent(in)", "intent(out)", "intent(inout)"
};
-static const char *directionParam[] =
+static const char *directionParam[] =
{
"", "[in]", "[out]", "[in,out]"
};
@@ -156,7 +151,7 @@ struct CommentInPrepass
struct fortranscannerYY_state
{
- OutlineParserInterface * thisParser;
+ OutlineParserInterface * thisParser;
CommentScanner commentScanner;
const char * inputString;
int inputPosition;
@@ -166,7 +161,7 @@ struct fortranscannerYY_state
unsigned int inputPositionPrepass;
int lineCountPrepass = 0;
EntryList subrCurrent;
- QList<CommentInPrepass> comments;
+ std::vector<CommentInPrepass> comments;
YY_BUFFER_STATE * includeStack = NULL;
int includeStackPtr = 0;
int includeStackCnt = 0;
@@ -211,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);
@@ -221,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);
@@ -231,9 +226,9 @@ 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 CommentInPrepass* locatePrepassComment(yyscan_t yyscanner,int from, int to);
+static const CommentInPrepass* locatePrepassComment(yyscan_t yyscanner,int from, int to);
static void updateVariablePrepassComment(yyscan_t yyscanner,int from, int to);
static void newLine(yyscan_t yyscanner);
static void initEntry(yyscan_t yyscanner);
@@ -366,24 +361,24 @@ SCOPENAME ({ID}{BS}"::"{BS})*
// Only take input after initial ampersand
yyextra->inputStringPrepass+=(const char*)(yytext+(indexStart+1));
-
+
//printf("BUFFER:%s\n", (const char*)yyextra->inputStringPrepass);
pushBuffer(yyscanner,yyextra->inputStringPrepass);
- yyextra->colNr = 0;
+ yyextra->colNr = 0;
yy_pop_state(yyscanner);
- }
- else
+ }
+ else
{ // simple line
yyextra->colNr = 0;
REJECT;
}
}
- else
+ else
{ // ----- line with continuation
- if (YY_START != Prepass)
+ if (YY_START != Prepass)
{
- yyextra->comments.setAutoDelete(TRUE);
yyextra->comments.clear();
+ yyextra->inputStringPrepass=QCString();
yy_push_state(Prepass,yyscanner);
}
@@ -399,7 +394,7 @@ SCOPENAME ({ID}{BS}"::"{BS})*
}
- /*------ ignore strings that are not initialization strings */
+ /*------ ignore strings that are not initialization strings */
<String>\"|\' { // string ends with next quote without previous backspace
if (yytext[0]!=yyextra->stringStartSymbol)
{
@@ -440,20 +435,20 @@ SCOPENAME ({ID}{BS}"::"{BS})*
{ yyextra->colNr -= (int)yyleng;
REJECT;
} // "!" is ignored in strings
- // skip comment line (without docu yyextra->comments "!>" "!<" )
+ // skip comment line (without docu yyextra->comments "!>" "!<" )
/* ignore further "!" and ignore yyextra->comments in Strings */
- if ((YY_START != StrIgnore) && (YY_START != String))
+ if ((YY_START != StrIgnore) && (YY_START != String))
{
yy_push_state(YY_START,yyscanner);
- BEGIN(StrIgnore);
+ BEGIN(StrIgnore);
yyextra->debugStr="*!";
DBG_CTX((stderr,"start comment %d\n",yyextra->lineNr));
- }
+ }
}
<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; }
+<StrIgnore>. { yyextra->debugStr+=yytext; }
/*------ use handling ------------------------------------------------------------*/
@@ -461,35 +456,35 @@ 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);
}
-<Use>{ID} {
+<Use>{ID} {
DBG_CTX((stderr,"using dir %s\n",yytext));
yyextra->current->name=yytext;
yyextra->current->name=yyextra->current->name.lower();
- yyextra->current->fileName = yyextra->fileName;
+ yyextra->current->fileName = yyextra->fileName;
yyextra->current->section=Entry::USINGDIR_SEC;
yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
- yyextra->current->lang = SrcLangExt_Fortran;
+ yyextra->current->lang = SrcLangExt_Fortran;
yy_pop_state(yyscanner);
}
-<Use>{ID}/, {
+<Use>{ID}/, {
yyextra->useModuleName=yytext;
yyextra->useModuleName=yyextra->useModuleName.lower();
}
-<Use>,{BS}"ONLY" { BEGIN(UseOnly);
- }
+<Use>,{BS}"ONLY" { BEGIN(UseOnly);
+ }
<UseOnly>{BS},{BS} {}
<UseOnly>{ID} {
yyextra->current->name= yyextra->useModuleName+"::"+yytext;
yyextra->current->name=yyextra->current->name.lower();
- yyextra->current->fileName = yyextra->fileName;
+ yyextra->current->fileName = yyextra->fileName;
yyextra->current->section=Entry::USINGDECL_SEC;
yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
- yyextra->current->lang = SrcLangExt_Fortran;
+ yyextra->current->lang = SrcLangExt_Fortran;
}
<Use,UseOnly>"\n" {
yyextra->colNr -= 1;
@@ -547,12 +542,12 @@ SCOPENAME ({ID}{BS}"::"{BS})*
}
yyextra->current->section = Entry::FUNCTION_SEC ;
- yyextra->current->name = yytext;
+ yyextra->current->name = yytext;
yyextra->moduleProcedures.push_back(yyextra->current);
addCurrentEntry(yyscanner,true);
}
<ModuleProcedure>"\n" { yyextra->colNr -= 1;
- unput(*yytext);
+ unput(*yytext);
yy_pop_state(yyscanner);
}
<InterfaceBody>. {}
@@ -561,7 +556,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
}
}
@@ -569,7 +564,7 @@ SCOPENAME ({ID}{BS}"::"{BS})*
<SubprogBody>^{BS}{CONTAINS}/({BS}|\n|!|;) { BEGIN(SubprogBodyContains); }
<TypedefBody>^{BS}{CONTAINS}/({BS}|\n|!|;) { BEGIN(TypedefBodyContains); }
- /*------ module handling ------------------------------------------------------------*/
+ /*------ module handling ------------------------------------------------------------*/
<Start>block{BS}data{BS}{ID_} { //
yyextra->vtype = V_IGNORE;
yy_push_state(BlockData,yyscanner);
@@ -617,12 +612,12 @@ SCOPENAME ({ID}{BS}"::"{BS})*
yyextra->global_scope = INVALID_ENTRY; // signal that the yyextra->global_scope has already been used.
}
}
-<Module>{ID} {
- addModule(yyscanner,yytext, TRUE);
+<Module>{ID} {
+ addModule(yyscanner, QCString(yytext), TRUE);
BEGIN(ModuleBody);
}
-<Program>{ID} {
- addModule(yyscanner,yytext, FALSE);
+<Program>{ID} {
+ addModule(yyscanner, QCString(yytext), FALSE);
BEGIN(ModuleBody);
}
@@ -640,7 +635,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
}
@@ -677,11 +672,11 @@ private {
yyextra->current->spec |= Entry::Struct;
yyextra->current->name = yytext;
yyextra->current->fileName = yyextra->fileName;
- yyextra->current->bodyLine = yyextra->lineNr;
+ yyextra->current->bodyLine = yyextra->lineNr;
yyextra->current->startLine = yyextra->lineNr;
/* if type is part of a module, mod name is necessary for output */
- if (yyextra->current_root &&
+ if (yyextra->current_root &&
(yyextra->current_root->section == Entry::CLASS_SEC ||
yyextra->current_root->section == Entry::NAMESPACE_SEC))
{
@@ -689,7 +684,7 @@ private {
}
addCurrentEntry(yyscanner,true);
- startScope(yyscanner,yyextra->last_entry.get());
+ startScope(yyscanner,yyextra->last_entry.get());
BEGIN(TypedefBody);
}
}
@@ -799,7 +794,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);
@@ -808,7 +803,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;
@@ -819,7 +814,7 @@ private {
{ATTR_STMT}/{BS_}{ID} |
{ATTR_STMT}/{BS}"::" {
/* attribute statement starts */
- DBG_CTX((stderr,"5=========> Attribute statement: %s\n", yytext));
+ DBG_CTX((stderr,"5=========> Attribute statement: %s\n", yytext));
QCString tmp = yytext;
yyextra->currentModifiers |= tmp.stripWhiteSpace();
yyextra->argType="";
@@ -841,8 +836,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;
@@ -878,7 +873,7 @@ private {
yyextra->argName= name;
yyextra->vtype= V_IGNORE;
- if (!yyextra->argType.isEmpty() && yyextra->current_root->section!=Entry::FUNCTION_SEC)
+ if (!yyextra->argType.isEmpty() && yyextra->current_root->section!=Entry::FUNCTION_SEC)
{ // new variable entry
yyextra->vtype = V_VARIABLE;
yyextra->current->section = Entry::VARIABLE_SEC;
@@ -899,15 +894,15 @@ private {
{
addCurrentEntry(yyscanner,true);
}
- }
+ }
else if (!yyextra->argType.isEmpty())
- { // declaration of parameter list: add type for corr. parameter
+ { // declaration of parameter list: add type for corr. parameter
Argument *parameter = getParameter(yyscanner,yyextra->argName);
- if (parameter)
+ if (parameter)
{
yyextra->vtype= V_PARAMETER;
if (!yyextra->argType.isNull()) parameter->type=yyextra->argType.stripWhiteSpace();
- if (!yyextra->docBlock.isNull())
+ if (!yyextra->docBlock.isNull())
{
subrHandleCommentBlock(yyscanner,yyextra->docBlock,TRUE);
}
@@ -948,7 +943,7 @@ private {
}
if (yyextra->current_root->type.length() > 0) yyextra->current_root->type += " ";
yyextra->current_root->type += "function";
- if (!yyextra->docBlock.isNull())
+ if (!yyextra->docBlock.isNull())
{
subrHandleCommentBlockResult(yyscanner,yyextra->docBlock,TRUE);
}
@@ -970,7 +965,7 @@ private {
// unexpectedly passed to the next member.
yyextra->current->doc.resize(0);
yyextra->current->brief.resize(0);
- }
+ }
}
<Variable>{ARGS} { /* dimension of the previous entry. */
QCString name(yyextra->argName);
@@ -996,7 +991,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);
}
@@ -1004,7 +999,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);
}
@@ -1036,11 +1031,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
@@ -1052,21 +1047,21 @@ 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);
}
<Initialization>. { yyextra->initializer+=yytext; }
-
+
<*>{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
}
@@ -1084,7 +1079,7 @@ private {
yyextra->current->fileName = yyextra->fileName;
yyextra->current->startLine = yyextra->lineNr;
yyextra->current->bodyLine = yyextra->lineNr;
- if ((yyextra->current_root) &&
+ if ((yyextra->current_root) &&
(yyextra->current_root->section == Entry::CLASS_SEC ||
yyextra->current_root->section == Entry::NAMESPACE_SEC))
{
@@ -1092,7 +1087,7 @@ private {
}
addCurrentEntry(yyscanner,true);
- startScope(yyscanner,yyextra->last_entry.get());
+ startScope(yyscanner,yyextra->last_entry.get());
BEGIN( Enum ) ;
}
<Enum>"end"{BS}"enum" {
@@ -1106,7 +1101,7 @@ private {
}
/*------ fortran subroutine/function handling ------------------------------------------------------------*/
/* Start is initial condition */
-
+
<Start,ModuleBody,SubprogBody,InterfaceBody,ModuleBodyContains,SubprogBodyContains>^{BS}({PREFIX}{BS_})?{TYPE_SPEC}{BS}({PREFIX}{BS_})?/{SUBPROG}{BS_} {
if (yyextra->ifType == IF_ABSTRACT || yyextra->ifType == IF_SPECIFIC)
{
@@ -1154,7 +1149,8 @@ private {
if (yyextra->ifType == IF_ABSTRACT || yyextra->ifType == IF_SPECIFIC)
{
- yyextra->current_root->name.replace(QRegExp("\\$interface\\$"), yytext);
+ yyextra->current_root->name = substitute(
+ yyextra->current_root->name, "$interface$", yytext);
}
BEGIN(Parameterlist);
@@ -1168,8 +1164,8 @@ private {
BEGIN(SubprogBody);
}
<Parameterlist>{COMMA}|{BS} { yyextra->current->args += yytext;
- CommentInPrepass *c = locatePrepassComment(yyscanner,yyextra->colNr-(int)yyleng, yyextra->colNr);
- if (c!=NULL)
+ const CommentInPrepass *c = locatePrepassComment(yyscanner,yyextra->colNr-(int)yyleng, yyextra->colNr);
+ if (c)
{
if (!yyextra->current->argList.empty())
{
@@ -1180,7 +1176,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;
@@ -1224,7 +1220,7 @@ private {
yyextra->colNr -= (int)yyleng;
REJECT;
} // "!" is ignored in strings
- // skip comment line (without docu yyextra->comments "!>" "!<" )
+ // skip comment line (without docu yyextra->comments "!>" "!<" )
/* ignore further "!" and ignore yyextra->comments in Strings */
if ((YY_START != StrIgnore) && (YY_START != String))
{
@@ -1261,11 +1257,11 @@ private {
// switch back
yyextra->current = tmp_entry;
}
- else if (yyextra->vtype == V_PARAMETER)
+ else if (yyextra->vtype == V_PARAMETER)
{
subrHandleCommentBlock(yyscanner,yyextra->docBlock,TRUE);
}
- else if (yyextra->vtype == V_RESULT)
+ else if (yyextra->vtype == V_RESULT)
{
subrHandleCommentBlockResult(yyscanner,yyextra->docBlock,TRUE);
}
@@ -1304,14 +1300,14 @@ private {
<Prototype>{BS}{SUBPROG}{BS_} {
BEGIN(PrototypeSubprog);
}
-<Prototype,PrototypeSubprog>{BS}{SCOPENAME}?{BS}{ID} {
+<Prototype,PrototypeSubprog>{BS}{SCOPENAME}?{BS}{ID} {
yyextra->current->name = QCString(yytext).lower();
yyextra->current->name.stripWhiteSpace();
BEGIN(PrototypeArgs);
}
<PrototypeArgs>{
"("|")"|","|{BS_} { yyextra->current->args += yytext; }
-{ID} { yyextra->current->args += yytext;
+{ID} { yyextra->current->args += yytext;
Argument a;
a.name = QCString(yytext).lower();
yyextra->current->argList.push_back(a);
@@ -1353,7 +1349,7 @@ private {
<*>. {
//yyextra->debugStr+=yytext;
//printf("I:%c\n", *yytext);
- } // ignore remaining text
+ } // ignore remaining text
/**********************************************************************************/
/**********************************************************************************/
@@ -1361,7 +1357,7 @@ private {
%%
//----------------------------------------------------------------------------
-static void newLine(yyscan_t yyscanner)
+static void newLine(yyscan_t yyscanner)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
yyextra->lineNr++;
@@ -1370,32 +1366,32 @@ static void newLine(yyscan_t yyscanner)
yyextra->comments.clear();
}
-static CommentInPrepass* locatePrepassComment(yyscan_t yyscanner,int from, int to)
+static const CommentInPrepass *locatePrepassComment(yyscan_t yyscanner,int from, int to)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
//printf("Locate %d-%d\n", from, to);
- for (uint i=0; i<yyextra->comments.count(); i++)
+ for (const auto &cip : yyextra->comments)
{ // todo: optimize
- int c = yyextra->comments.at(i)->column;
+ int c = cip.column;
//printf("Candidate %d\n", c);
if (c>=from && c<=to)
{
// comment for previous variable or parameter
- return yyextra->comments.at(i);
+ return &cip;
}
}
- return NULL;
+ return 0;
}
static void updateVariablePrepassComment(yyscan_t yyscanner,int from, int to)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- CommentInPrepass *c = locatePrepassComment(yyscanner,from, to);
- if (c!=NULL && yyextra->vtype == V_VARIABLE)
+ const CommentInPrepass *c = locatePrepassComment(yyscanner,from, to);
+ if (c && yyextra->vtype == V_VARIABLE)
{
yyextra->last_entry->brief = c->str;
- }
- else if (c!=NULL && yyextra->vtype == V_PARAMETER)
+ }
+ else if (c && yyextra->vtype == V_PARAMETER)
{
Argument *parameter = getParameter(yyscanner,yyextra->argName);
if (parameter) parameter->docs = c->str;
@@ -1420,7 +1416,7 @@ static int getAmpersandAtTheStart(const char *buf, int length)
return -1;
}
-/* Returns ampersand index, comment start index or -1 if neither exist.*/
+/* Returns ampersand index, comment start index or -1 if neither exist.*/
static int getAmpOrExclAtTheEnd(const char *buf, int length, char ch)
{
// Avoid ampersands in string and yyextra->comments
@@ -1493,9 +1489,8 @@ void truncatePrepass(yyscan_t yyscanner,int index)
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
int length = yyextra->inputStringPrepass.length();
for (int i=index+1; i<length; i++) {
- if (yyextra->inputStringPrepass[i]=='!' && i<length-1 && yyextra->inputStringPrepass[i+1]=='<') { // save comment
- struct CommentInPrepass *c=new CommentInPrepass(index, yyextra->inputStringPrepass.right(length-i-2));
- yyextra->comments.append(c);
+ if (yyextra->inputStringPrepass[i]=='!' && i<length-1 && yyextra->inputStringPrepass[i+1]=='<') { // save comment
+ yyextra->comments.emplace_back(index, yyextra->inputStringPrepass.right(length-i-2));
}
}
yyextra->inputStringPrepass.truncate(index);
@@ -1641,8 +1636,8 @@ const char* prepassFixedForm(const char* contents, int *hasContLine)
{
if (!inSingle)
{
- inDouble = !inDouble;
- if (inDouble) thisQuote = c;
+ inDouble = !inDouble;
+ if (inDouble) thisQuote = c;
else thisQuote = '\0';
}
break;
@@ -1711,7 +1706,7 @@ const char* prepassFixedForm(const char* contents, int *hasContLine)
newContents[j]=c; // , just handle like space
}
prevLineLength=0;
- }
+ }
else if ((column > fixedCommentAfter) && !commented)
{
// first non commented non blank character after position fixedCommentAfter
@@ -1732,8 +1727,8 @@ const char* prepassFixedForm(const char* contents, int *hasContLine)
newContents[j]=c;
commented = TRUE;
}
- }
- else
+ }
+ else
{
if (!commented) fullCommentLine=FALSE;
newContents[j]=c;
@@ -1759,7 +1754,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)
@@ -1768,10 +1763,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)
@@ -1784,7 +1778,7 @@ static void popBuffer(yyscan_t yyscanner)
}
/** used to copy entry to an interface module procedure */
-static void copyEntry(std::shared_ptr<Entry> dest, const std::shared_ptr<Entry> &src)
+static void copyEntry(std::shared_ptr<Entry> dest, const std::shared_ptr<Entry> &src)
{
dest->type = src->type;
dest->fileName = src->fileName;
@@ -1797,9 +1791,10 @@ static void copyEntry(std::shared_ptr<Entry> dest, const std::shared_ptr<Entry>
dest->brief = src->brief;
}
-/** fill empty interface module procedures with info from
- corresponding module subprogs
- @TODO: handle procedures in used modules
+/** fill empty interface module procedures with info from
+ corresponding module subprogs
+
+ TODO: handle procedures in used modules
*/
void resolveModuleProcedures(yyscan_t yyscanner,Entry *current_root)
{
@@ -1809,7 +1804,7 @@ void resolveModuleProcedures(yyscan_t yyscanner,Entry *current_root)
// check all entries in this module
for (const auto &ce2 : current_root->children())
{
- if (ce1->name == ce2->name)
+ if (ce1->name == ce2->name)
{
copyEntry(ce1, ce2);
}
@@ -1819,16 +1814,16 @@ 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("(");
- if (start != -1)
+ if (start != -1)
{
extracted.remove(0, start+1);
}
int end = extracted.findRev(")");
- if (end != -1)
+ if (end != -1)
{
int length = extracted.length();
extracted.remove(end, length);
@@ -1839,7 +1834,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)
@@ -1894,11 +1889,11 @@ SymbolModifiers& SymbolModifiers::operator|=(QCString mdfStringArg)
QCString mdfString = mdfStringArg.lower();
SymbolModifiers newMdf;
- if (mdfString.find("dimension")==0)
+ if (mdfString.find("dimension")==0)
{
newMdf.dimension=mdfString;
}
- else if (mdfString.contains("intent"))
+ else if (mdfString.contains("intent"))
{
QCString tmp = extractFromParens(mdfString);
bool isin = tmp.contains("in");
@@ -1907,47 +1902,47 @@ SymbolModifiers& SymbolModifiers::operator|=(QCString mdfStringArg)
else if (isin) newMdf.direction = SymbolModifiers::IN;
else if (isout) newMdf.direction = SymbolModifiers::OUT;
}
- else if (mdfString=="public")
+ else if (mdfString=="public")
{
newMdf.protection = SymbolModifiers::PUBLIC;
}
- else if (mdfString=="private")
+ else if (mdfString=="private")
{
newMdf.protection = SymbolModifiers::PRIVATE;
}
- else if (mdfString=="protected")
+ else if (mdfString=="protected")
{
newMdf.protect = TRUE;
}
- else if (mdfString=="optional")
+ else if (mdfString=="optional")
{
newMdf.optional = TRUE;
}
- else if (mdfString=="allocatable")
+ else if (mdfString=="allocatable")
{
newMdf.allocatable = TRUE;
}
- else if (mdfString=="external")
+ else if (mdfString=="external")
{
newMdf.external = TRUE;
}
- else if (mdfString=="intrinsic")
+ else if (mdfString=="intrinsic")
{
newMdf.intrinsic = TRUE;
}
- else if (mdfString=="parameter")
+ else if (mdfString=="parameter")
{
newMdf.parameter = TRUE;
}
- else if (mdfString=="pointer")
+ else if (mdfString=="pointer")
{
newMdf.pointer = TRUE;
}
- else if (mdfString=="target")
+ else if (mdfString=="target")
{
newMdf.target = TRUE;
}
- else if (mdfString=="save")
+ else if (mdfString=="save")
{
newMdf.save = TRUE;
}
@@ -2021,29 +2016,29 @@ static Argument *findArgument(Entry* subprog, QCString name, bool byTypeName = F
/*! Apply yyextra->modifiers stored in \a mdfs to the \a typeName string. */
-static QCString applyModifiers(QCString typeName, const SymbolModifiers& mdfs)
+static QCString applyModifiers(QCString typeName, const SymbolModifiers& mdfs)
{
- if (!mdfs.dimension.isNull())
+ if (!mdfs.dimension.isNull())
{
if (!typeName.isEmpty()) typeName += ", ";
typeName += mdfs.dimension;
}
- if (mdfs.direction!=SymbolModifiers::NONE_D)
+ if (mdfs.direction!=SymbolModifiers::NONE_D)
{
if (!typeName.isEmpty()) typeName += ", ";
typeName += directionStrs[mdfs.direction];
}
- if (mdfs.optional)
+ if (mdfs.optional)
{
if (!typeName.isEmpty()) typeName += ", ";
typeName += "optional";
}
- if (mdfs.allocatable)
+ if (mdfs.allocatable)
{
if (!typeName.isEmpty()) typeName += ", ";
typeName += "allocatable";
}
- if (mdfs.external)
+ if (mdfs.external)
{
if (!typeName.contains("external"))
{
@@ -2051,47 +2046,47 @@ static QCString applyModifiers(QCString typeName, const SymbolModifiers& mdfs)
typeName += "external";
}
}
- if (mdfs.intrinsic)
+ if (mdfs.intrinsic)
{
if (!typeName.isEmpty()) typeName += ", ";
typeName += "intrinsic";
}
- if (mdfs.parameter)
+ if (mdfs.parameter)
{
if (!typeName.isEmpty()) typeName += ", ";
typeName += "parameter";
}
- if (mdfs.pointer)
+ if (mdfs.pointer)
{
if (!typeName.isEmpty()) typeName += ", ";
typeName += "pointer";
}
- if (mdfs.target)
+ if (mdfs.target)
{
if (!typeName.isEmpty()) typeName += ", ";
typeName += "target";
}
- if (mdfs.save)
+ if (mdfs.save)
{
if (!typeName.isEmpty()) typeName += ", ";
typeName += "save";
}
- if (mdfs.deferred)
+ if (mdfs.deferred)
{
if (!typeName.isEmpty()) typeName += ", ";
typeName += "deferred";
}
- if (mdfs.nonoverridable)
+ if (mdfs.nonoverridable)
{
if (!typeName.isEmpty()) typeName += ", ";
typeName += "non_overridable";
}
- if (mdfs.nopass)
+ if (mdfs.nopass)
{
if (!typeName.isEmpty()) typeName += ", ";
typeName += "nopass";
}
- if (mdfs.pass)
+ if (mdfs.pass)
{
if (!typeName.isEmpty()) typeName += ", ";
typeName += "pass";
@@ -2160,7 +2155,7 @@ static void applyModifiers(Entry *ent, const SymbolModifiers& mdfs)
* starting module, interface, function or other program block.
* \see endScope()
*/
-static void startScope(yyscan_t yyscanner,Entry *scope)
+static void startScope(yyscan_t yyscanner,Entry *scope)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
//cout<<"start scope: "<<scope->name<<endl;
@@ -2199,13 +2194,13 @@ static bool endScope(yyscan_t yyscanner,Entry *scope, bool isGlobalRoot)
// update variables or subprogram arguments with yyextra->modifiers
std::map<std::string,SymbolModifiers>& mdfsMap = yyextra->modifiers[scope];
- if (scope->section == Entry::FUNCTION_SEC)
+ if (scope->section == Entry::FUNCTION_SEC)
{
// 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)
{
@@ -2223,11 +2218,11 @@ static bool endScope(yyscan_t yyscanner,Entry *scope, bool isGlobalRoot)
}
}
- if (scope->section == Entry::CLASS_SEC)
+ if (scope->section == Entry::CLASS_SEC)
{ // was INTERFACE_SEC
- if (scope->parent()->section == Entry::FUNCTION_SEC)
+ if (scope->parent()->section == Entry::FUNCTION_SEC)
{ // interface within function
- // iterate functions of interface and
+ // iterate functions of interface and
// try to find types for dummy(ie. argument) procedures.
//cout<<"Search in "<<scope->name<<endl;
int count = 0;
@@ -2239,7 +2234,7 @@ static bool endScope(yyscan_t yyscanner,Entry *scope, bool isGlobalRoot)
continue;
Argument *arg = findArgument(scope->parent(), ce->name, TRUE);
- if (arg != 0)
+ if (arg != 0)
{
// set type of dummy procedure argument to interface
arg->name = arg->type;
@@ -2256,9 +2251,9 @@ static bool endScope(yyscan_t yyscanner,Entry *scope, bool isGlobalRoot)
return TRUE;
}
}
- }
- if (scope->section!=Entry::FUNCTION_SEC)
- { // not function section
+ }
+ if (scope->section!=Entry::FUNCTION_SEC)
+ { // not function section
// iterate variables: get and apply yyextra->modifiers
for (const auto &ce : scope->children())
{
@@ -2309,7 +2304,7 @@ static void initEntry(yyscan_t yyscanner)
yyextra->current->mtype = Method;
yyextra->current->virt = Normal;
yyextra->current->stat = FALSE;
- yyextra->current->lang = SrcLangExt_Fortran;
+ yyextra->current->lang = SrcLangExt_Fortran;
yyextra->commentScanner.initGroupInfo(yyextra->current.get());
}
@@ -2320,30 +2315,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;
@@ -2358,10 +2353,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();
@@ -2379,13 +2374,13 @@ static void addSubprogram(yyscan_t yyscanner,const char *text)
/*! Adds interface to the root entry.
* \note Code was brought to this procedure from the parser,
* because there was/is idea to use it in several parts of the parser.
- */
+ */
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
}
@@ -2410,15 +2405,15 @@ static void addInterface(yyscan_t yyscanner,QCString name, InterfaceType type)
}
/* if type is part of a module, mod name is necessary for output */
- if ((yyextra->current_root) &&
+ if ((yyextra->current_root) &&
(yyextra->current_root->section == Entry::CLASS_SEC ||
- yyextra->current_root->section == Entry::NAMESPACE_SEC))
+ yyextra->current_root->section == Entry::NAMESPACE_SEC))
{
yyextra->current->name= yyextra->current_root->name + "::" + yyextra->current->name;
}
yyextra->current->fileName = yyextra->fileName;
- yyextra->current->bodyLine = yyextra->lineNr;
+ yyextra->current->bodyLine = yyextra->lineNr;
yyextra->current->startLine = yyextra->lineNr;
addCurrentEntry(yyscanner,true);
}
@@ -2431,7 +2426,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)
{
@@ -2472,7 +2467,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;
@@ -2484,7 +2479,7 @@ static void handleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool brief
processedDoc, // text
yyextra->fileName, // file
lineNr,
- yyextra->docBlockInBody ? FALSE : brief,
+ yyextra->docBlockInBody ? FALSE : brief,
yyextra->docBlockInBody ? FALSE : yyextra->docBlockJavaStyle,
yyextra->docBlockInBody,
yyextra->defaultProtection,
@@ -2537,16 +2532,16 @@ static void subrHandleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool b
// in case of empty documentation or (now) just name, consider it as no documentation
if (!loc_doc.isEmpty() && (loc_doc.lower() != yyextra->argName.lower()))
{
- handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[SymbolModifiers::IN] + " " +
+ handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[SymbolModifiers::IN] + " " +
yyextra->argName + " " + loc_doc,brief);
}
}
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());
- handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[dir1] + " " +
+ 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);
}
}
@@ -2563,14 +2558,14 @@ static void subrHandleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool b
yyextra->current = tmp_entry;
return;
}
- handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[SymbolModifiers::OUT] + " " +
+ handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[SymbolModifiers::OUT] + " " +
yyextra->argName + " " + loc_doc,brief);
}
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());
- handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[dir1] + " " +
+ 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);
}
}
@@ -2584,22 +2579,22 @@ static void subrHandleCommentBlock(yyscan_t yyscanner,const QCString &doc,bool b
loc_doc.stripWhiteSpace();
if (!loc_doc.isEmpty() && (loc_doc.lower() != yyextra->argName.lower()))
{
- handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[SymbolModifiers::INOUT] + " " +
+ handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[SymbolModifiers::INOUT] + " " +
yyextra->argName + " " + loc_doc,brief);
}
}
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());
- handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[dir1] + " " +
+ 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);
}
}
// analogous to the [in] case; here no direction specified
else if (!loc_doc.isEmpty() && (loc_doc.lower() != yyextra->argName.lower()))
{
- handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[dir1] + " " +
+ handleCommentBlock(yyscanner,QCString("\n\n@param ") + directionParam[dir1] + " " +
yyextra->argName + " " + loc_doc,brief);
}
@@ -2639,20 +2634,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
@@ -2661,15 +2655,15 @@ static void parseMain(yyscan_t yyscanner, const char *fileName,const char *fileB
yyextra->isFixedForm = recognizeFixedForm(fileBuf,format);
- if (yyextra->isFixedForm)
+ 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);
@@ -2687,9 +2681,9 @@ static void parseMain(yyscan_t yyscanner, const char *fileName,const char *fileB
yyextra->inputString = tmpBuf;
}
- yyextra->lineNr= 1 ;
+ 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
@@ -2698,12 +2692,12 @@ static void parseMain(yyscan_t yyscanner, const char *fileName,const char *fileB
// add entry for the file
yyextra->current = std::make_shared<Entry>();
- yyextra->current->lang = SrcLangExt_Fortran;
+ yyextra->current->lang = SrcLangExt_Fortran;
yyextra->current->name = yyextra->fileName;
yyextra->current->section = Entry::SOURCE_SEC;
yyextra->file_root = yyextra->current;
yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
- yyextra->current->lang = SrcLangExt_Fortran;
+ yyextra->current->lang = SrcLangExt_Fortran;
fortranscannerYYrestart( 0, yyscanner );
{
@@ -2718,9 +2712,9 @@ static void parseMain(yyscan_t yyscanner, const char *fileName,const char *fileB
endScope(yyscanner,yyextra->current_root, TRUE); // TRUE - global root
}
- //debugCompounds(rt); //debug
+ //debugCompounds(rt); //debug
- rt->program.resize(0);
+ rt->program.str(std::string());
//delete yyextra->current; yyextra->current=0;
yyextra->moduleProcedures.clear();
if (tmpBuf)
@@ -2765,19 +2759,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
@@ -2785,11 +2779,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);
@@ -2799,20 +2792,20 @@ void FortranOutlineParser::parsePrototype(const char *text)
//----------------------------------------------------------------------------
-static void scanner_abort(yyscan_t yyscanner)
+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;
for (const auto &ce : yyextra->global_root->children())
{
if (ce == yyextra->file_root) start=TRUE;
- if (start) ce->reset();
- }
+ if (start) ce->reset();
+ }
// dummy call to avoid compiler warning
(void)yy_top_state(yyscanner);
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 5b6a9ca..0000000
--- a/src/ftextstream.h
+++ /dev/null
@@ -1,77 +0,0 @@
-#ifndef FTEXTSTREAM_H
-#define FTEXTSTREAM_H
-
-#include <stdio.h>
-
-#include <qiodevice.h>
-#include <qstring.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 c8edeb2..24ed957 100644
--- a/src/ftvhelp.cpp
+++ b/src/ftvhelp.cpp
@@ -20,9 +20,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include <qlist.h>
-#include <qdict.h>
-#include <qfileinfo.h>
+#include <algorithm>
#include "ftvhelp.h"
#include "config.h"
@@ -39,8 +37,6 @@
#include "util.h"
#include "resourcemgr.h"
-#define MAX_INDENT 1024
-
static int folderId=1;
const char *JAVASCRIPT_LICENSE_TEXT = R"LIC(/*
@@ -71,11 +67,12 @@ 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) { children.setAutoDelete(TRUE); }
+ def(df) {}
+ ~FTVNode() { for (const auto &child : children) delete child; }
int computeTreeDepth(int level) const;
int numNodesAtLevel(int level,int maxLevel) const;
bool isLast;
@@ -85,7 +82,7 @@ struct FTVNode
QCString anchor;
QCString name;
int index;
- QList<FTVNode> children;
+ std::vector<FTVNode*> children;
FTVNode *parent;
bool separateIndex;
bool addToNavIndex;
@@ -95,11 +92,9 @@ struct FTVNode
int FTVNode::computeTreeDepth(int level) const
{
int maxDepth=level;
- QListIterator<FTVNode> li(children);
- FTVNode *n;
- for (;(n=li.current());++li)
+ for (const auto &n : children)
{
- if (n->children.count()>0)
+ if (!n->children.empty())
{
int d = n->computeTreeDepth(level+1);
if (d>maxDepth) maxDepth=d;
@@ -114,9 +109,7 @@ int FTVNode::numNodesAtLevel(int level,int maxLevel) const
if (level<maxLevel)
{
num++; // this node
- QListIterator<FTVNode> li(children);
- FTVNode *n;
- for (;(n=li.current());++li)
+ for (const auto &n : children)
{
num+=n->numNodesAtLevel(level+1,maxLevel);
}
@@ -133,8 +126,7 @@ int FTVNode::numNodesAtLevel(int level,int maxLevel) const
FTVHelp::FTVHelp(bool TLI)
{
/* initial depth */
- m_indentNodes = new QList<FTVNode>[MAX_INDENT];
- m_indentNodes[0].setAutoDelete(TRUE);
+ m_indentNodes.resize(1);
m_indent=0;
m_topLevelIndex = TLI;
}
@@ -142,7 +134,15 @@ FTVHelp::FTVHelp(bool TLI)
/*! Destroys the ftv help object. */
FTVHelp::~FTVHelp()
{
- delete[] m_indentNodes;
+ for (auto &idx : m_indentNodes)
+ {
+ for (auto &n : idx)
+ {
+ delete n;
+ }
+ idx.clear();
+ }
+ m_indentNodes.clear();
}
/*! This will create a folder tree view table of contents file (tree.js).
@@ -169,7 +169,7 @@ void FTVHelp::incContentsDepth()
{
//printf("%p: incContentsDepth() indent=%d\n",this,m_indent);
m_indent++;
- ASSERT(m_indent<MAX_INDENT);
+ m_indentNodes.resize(m_indent+1);
}
/*! Decrease the level of the contents hierarchy.
@@ -183,15 +183,16 @@ void FTVHelp::decContentsDepth()
if (m_indent>0)
{
m_indent--;
- QList<FTVNode> *nl = &m_indentNodes[m_indent];
- FTVNode *parent = nl->getLast();
- if (parent)
+ std::vector<FTVNode*> &nl = m_indentNodes[m_indent];
+ if (!nl.empty())
{
- QList<FTVNode> *children = &m_indentNodes[m_indent+1];
- while (!children->isEmpty())
+ FTVNode *parent = nl.back();
+ std::vector<FTVNode*> &children = m_indentNodes[m_indent+1];
+ for (const auto &child : children)
{
- parent->children.append(children->take(0));
+ parent->children.push_back(child);
}
+ children.clear();
}
}
}
@@ -207,30 +208,32 @@ 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
)
{
//printf("%p: m_indent=%d addContentsItem(%s,%s,%s,%s)\n",this,m_indent,name,ref,file,anchor);
- QList<FTVNode> *nl = &m_indentNodes[m_indent];
+ std::vector<FTVNode*> &nl = m_indentNodes[m_indent];
FTVNode *newNode = new FTVNode(isDir,ref,file,anchor,name,separateIndex,addToNavIndex,def);
- if (!nl->isEmpty())
+ if (!nl.empty())
{
- nl->getLast()->isLast=FALSE;
+ nl.back()->isLast=FALSE;
}
- nl->append(newNode);
- newNode->index = nl->count()-1;
+ nl.push_back(newNode);
+ newNode->index = static_cast<int>(nl.size()-1);
if (m_indent>0)
{
- QList<FTVNode> *pnl = &m_indentNodes[m_indent-1];
- newNode->parent = pnl->getLast();
+ std::vector<FTVNode*> &pnl = m_indentNodes[m_indent-1];
+ if (!pnl.empty())
+ {
+ newNode->parent = pnl.back();
+ }
}
-
}
static QCString node2URL(const FTVNode *n,bool overruleFile=FALSE,bool srcLink=FALSE)
@@ -276,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;
@@ -296,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
{
@@ -341,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);
@@ -380,11 +383,9 @@ static char compoundIcon(const ClassDef *cd)
return icon;
}
-void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,int maxLevel,int &index)
+void FTVHelp::generateTree(TextStream &t, const std::vector<FTVNode*> &nl,int level,int maxLevel,int &index)
{
- QListIterator<FTVNode> nli(nl);
- FTVNode *n;
- for (nli.toFirst();(n=nli.current());++nli)
+ for (const auto &n : nl)
{
t << "<tr id=\"row_" << generateIndentLabel(n,0) << "\"";
if ((index&1)==0) // even row
@@ -436,7 +437,7 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in
{
generateBriefDoc(t,n->def);
}
- t << "</td></tr>" << endl;
+ t << "</td></tr>\n";
folderId++;
generateTree(t,n->children,level+1,maxLevel,index);
}
@@ -478,6 +479,10 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in
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>";
@@ -496,7 +501,7 @@ void FTVHelp::generateTree(FTextStream &t, const QList<FTVNode> &nl,int level,in
{
generateBriefDoc(t,n->def);
}
- t << "</td></tr>" << endl;
+ t << "</td></tr>\n";
}
}
}
@@ -510,17 +515,8 @@ struct NavIndexEntry
QCString path;
};
-class NavIndexEntryList : public QList<NavIndexEntry>
+class NavIndexEntryList : public std::vector<NavIndexEntry>
{
- public:
- NavIndexEntryList() : QList<NavIndexEntry>() { setAutoDelete(TRUE); }
- ~NavIndexEntryList() {}
- private:
- int compareValues(const NavIndexEntry *item1,const NavIndexEntry *item2) const
- {
- // sort list based on url
- return qstrcmp(item1->url,item2->url);
- }
};
static QCString pathToNode(const FTVNode *leaf,const FTVNode *n)
@@ -542,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
{
@@ -565,25 +561,23 @@ static QCString convertFileId2Var(const QCString &fileId)
return substitute(varId,"-","_");
}
-static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t,
- const QList<FTVNode> &nl,int level,bool &first)
+static bool generateJSTree(NavIndexEntryList &navIndex,TextStream &t,
+ const std::vector<FTVNode*> &nl,int level,bool &first)
{
static QCString htmlOutput = Config_getString(HTML_OUTPUT);
QCString indentStr;
indentStr.fill(' ',level*2);
bool found=FALSE;
- QListIterator<FTVNode> nli(nl);
- const FTVNode *n;
- for (nli.toFirst();(n=nli.current());++nli)
+ 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;
@@ -596,16 +590,16 @@ static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t,
doc = fileVisibleInIndex(fd,src);
if (doc)
{
- navIndex.append(new NavIndexEntry(node2URL(n,TRUE,FALSE),pathToNode(n,n)));
+ navIndex.emplace_back(node2URL(n,TRUE,FALSE),pathToNode(n,n));
}
if (src)
{
- navIndex.append(new NavIndexEntry(node2URL(n,TRUE,TRUE),pathToNode(n,n)));
+ navIndex.emplace_back(node2URL(n,TRUE,TRUE),pathToNode(n,n));
}
}
else
{
- navIndex.append(new NavIndexEntry(node2URL(n),pathToNode(n,n)));
+ navIndex.emplace_back(node2URL(n),pathToNode(n,n));
}
}
@@ -614,10 +608,10 @@ static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t,
bool firstChild=TRUE;
t << indentStr << " [ ";
generateJSLink(t,n);
- if (n->children.count()>0) // write children to separate file for dynamic loading
+ 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;
}
@@ -625,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
@@ -649,26 +645,26 @@ static bool generateJSTree(NavIndexEntryList &navIndex,FTextStream &t,
if (emptySection)
t << "null ]";
else
- t << endl << indentStr << " ] ]";
+ t << "\n" << indentStr << " ] ]";
}
}
return found;
}
-static void generateJSNavTree(const QList<FTVNode> &nodeList)
+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())
@@ -690,75 +686,74 @@ static void generateJSNavTree(const QList<FTVNode> &nodeList)
t << "\"index" << Doxygen::htmlFileExtension << "\", ";
// add special entry for index page
- navIndex.append(new NavIndexEntry("index"+Doxygen::htmlFileExtension,""));
+ navIndex.emplace_back("index"+Doxygen::htmlFileExtension,"");
// related page index is written as a child of index.html, so add this as well
- navIndex.append(new NavIndexEntry("pages"+Doxygen::htmlFileExtension,""));
+ navIndex.emplace_back("pages"+Doxygen::htmlFileExtension,"");
bool first=TRUE;
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)
- navIndex.sort();
+ std::sort(navIndex.begin(),navIndex.end(),[](const auto &n1,const auto &n2)
+ { 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;
- QListIterator<NavIndexEntry> li(navIndex);
- NavIndexEntry *e;
+ t << "var NAVTREEINDEX =\n";
+ t << "[\n";
+ tsidx << "var NAVTREEINDEX" << subIndex << " =\n";
+ tsidx << "{\n";
first=TRUE;
- for (li.toFirst();(e=li.current());) // for each entry
+ auto it = navIndex.begin();
+ while (it!=navIndex.end())
{
+ const NavIndexEntry &e = *it;
if (elemCount==0)
{
if (!first)
{
- t << "," << endl;
+ t << ",\n";
}
else
{
first=FALSE;
}
- t << "\"" << e->url << "\"";
+ t << "\"" << e.url << "\"";
}
- tsidx << "\"" << e->url << "\":[" << e->path << "]";
- ++li;
- if (li.current() && elemCount<maxElemCount-1) tsidx << ","; // not last entry
- tsidx << endl;
+ tsidx << "\"" << e.url << "\":[" << e.path << "]";
+ ++it;
+ if (it!=navIndex.end() && elemCount<maxElemCount-1) tsidx << ","; // not last entry
+ tsidx << "\n";
elemCount++;
- if (li.current() && elemCount>=maxElemCount) // switch to new sub-index
+ 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);
}
@@ -790,16 +785,14 @@ 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";
- QListIterator<FTVNode> li(m_indentNodes[0]);
- FTVNode *n;
int d=1, depth=1;
- for (;(n=li.current());++li)
+ for (const auto &n : m_indentNodes[0])
{
- if (n->children.count()>0)
+ if (!n->children.empty())
{
d = n->computeTreeDepth(2);
if (d>depth) depth=d;
@@ -824,7 +817,7 @@ void FTVHelp::generateTreeViewInline(FTextStream &t)
for (int i=1;i<=depth;i++)
{
int num=0;
- for (li.toFirst();(n=li.current());++li)
+ for (const auto &n : m_indentNodes[0])
{
num+=n->numNodesAtLevel(0,i);
}
@@ -841,7 +834,7 @@ void FTVHelp::generateTreeViewInline(FTextStream &t)
}
//printf("preferred depth=%d\n",preferredDepth);
- if (m_indentNodes[0].count())
+ if (!m_indentNodes[0].empty())
{
t << "<table class=\"directory\">\n";
int index=0;
diff --git a/src/ftvhelp.h b/src/ftvhelp.h
index 42fe707..196b01c 100644
--- a/src/ftvhelp.h
+++ b/src/ftvhelp.h
@@ -1,6 +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
@@ -24,13 +24,12 @@
#ifndef FTVHELP_H
#define FTVHELP_H
-#include <qlist.h>
+#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,30 +43,27 @@ 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 QList<FTVNode> &nl,int level,int maxLevel,int &index);
- //bool generateJSTree(FTextStream &tidx,FTextStream &t,const QList<FTVNode> &nl,int level,bool &first);
- //bool generateJSTreeTopLevel(FTextStream &tidx,FTextStream &t,const QList<FTVNode> &nl,int level,bool &first);
+ 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 generateJSLink(FTextStream &t,FTVNode *n);
- QList<FTVNode> *m_indentNodes;
+ 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 d8526d9..a1ed4d5 100644
--- a/src/groupdef.cpp
+++ b/src/groupdef.cpp
@@ -19,7 +19,6 @@
#include <vector>
#include <ctype.h>
-#include <qregexp.h>
#include "groupdef.h"
#include "classdef.h"
@@ -46,36 +45,38 @@
#include "dirdef.h"
#include "config.h"
#include "definitionimpl.h"
+#include "regex.h"
//---------------------------------------------------------------------------
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);
virtual void addExample(const PageDef *def);
virtual void addDir(DirDef *dd);
- virtual bool insertMember(MemberDef *def,bool docOnly=FALSE);
+ virtual bool insertMember(const MemberDef *def,bool docOnly=FALSE);
virtual void removeMember(MemberDef *md);
virtual bool findGroup(const GroupDef *def) const; // true if def is a subgroup of this group
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;
@@ -100,8 +101,9 @@ class GroupDefImpl : public DefinitionMixin<GroupDef>
/* user defined member groups */
virtual const MemberGroupList &getMemberGroups() const { return m_memberGroups; }
- virtual FileList * getFiles() const { return m_fileList; }
+ 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; }
@@ -112,7 +114,7 @@ class GroupDefImpl : public DefinitionMixin<GroupDef>
private:
void addMemberListToGroup(MemberList *,bool (MemberDef::*)() const);
- void addMemberToList(MemberListType lt,MemberDef *md);
+ void addMemberToList(MemberListType lt,const MemberDef *md);
void writeMemberDeclarations(OutputList &ol,MemberListType lt,const QCString &title);
void writeMemberDocumentation(OutputList &ol,MemberListType lt,const QCString &title);
void removeMemberFromList(MemberListType lt,MemberDef *md);
@@ -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);
@@ -138,14 +141,15 @@ class GroupDefImpl : public DefinitionMixin<GroupDef>
QCString m_title; // title of the group
bool m_titleSet; // true if title is not the same as the name
QCString m_fileName; // base name of the generated file
- FileList * m_fileList; // list of files in the group
+ 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
PageLinkedRefMap m_examples; // list of examples in the group
DirList m_dirList; // list of directories in the group
- MemberList * m_allMemberList;
+ MemberList m_allMemberList;
MemberNameInfoLinkedMap m_allMemberNameInfoLinkedMap;
Definition * m_groupScope;
MemberLists m_memberLists;
@@ -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)
{
- m_fileList = new FileList;
- if (refFileName)
+ if (!refFileName.isEmpty())
{
m_fileName=stripExtension(refFileName);
}
@@ -177,8 +181,6 @@ GroupDefImpl::GroupDefImpl(const char *df,int dl,const char *na,const char *t,
}
setGroupTitle( t );
- m_allMemberList = new MemberList(MemberListType_allMembersList);
-
//visited = 0;
m_groupScope = 0;
m_subGrouping=Config_getBool(SUBGROUPING);
@@ -186,13 +188,11 @@ GroupDefImpl::GroupDefImpl(const char *df,int dl,const char *na,const char *t,
GroupDefImpl::~GroupDefImpl()
{
- delete m_fileList;
- delete m_allMemberList;
}
-void GroupDefImpl::setGroupTitle( const char *t )
+void GroupDefImpl::setGroupTitle( const QCString &t )
{
- if ( t && *t )
+ if ( !t.isEmpty())
{
m_title = t;
m_titleSet = TRUE;
@@ -239,9 +239,12 @@ void GroupDefImpl::addFile(const FileDef *def)
if (def->isHidden()) return;
updateLanguage(def);
if (sortBriefDocs)
- m_fileList->inSort(def);
+ m_fileList.insert( std::upper_bound( m_fileList.begin(), m_fileList.end(), def,
+ [](const auto &fd1, const auto &fd2)
+ { return qstricmp(fd1->name(),fd2->name())<0; }),
+ def);
else
- m_fileList->append(def);
+ m_fileList.push_back(def);
}
bool GroupDefImpl::addClass(const ClassDef *cd)
@@ -257,10 +260,23 @@ 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());
if (def->isHidden()) return false;
- if (m_namespaces.find(def->name())!=0)
+ if (m_namespaces.find(def->name())==0)
{
updateLanguage(def);
m_namespaces.add(def->name(),def);
@@ -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);
}
@@ -308,11 +324,11 @@ void GroupDefImpl::addMembersToMemberGroup()
}
-bool GroupDefImpl::insertMember(MemberDef *md,bool docOnly)
+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)
{
@@ -352,7 +368,7 @@ bool GroupDefImpl::insertMember(MemberDef *md,bool docOnly)
}
mni->push_back(std::make_unique<MemberInfo>(md,md->protection(),md->virtualness(),FALSE));
//printf("Added member!\n");
- m_allMemberList->append(md);
+ m_allMemberList.push_back(md);
switch(md->memberType())
{
case MemberType_Variable:
@@ -454,16 +470,16 @@ bool GroupDefImpl::insertMember(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
@@ -581,11 +597,11 @@ void GroupDefImpl::countMembers()
size_t GroupDefImpl::numDocMembers() const
{
- return m_fileList->count()+
+ return m_fileList.size()+
m_classes.size()+
m_namespaces.size()+
m_groups.size()+
- m_allMemberList->count()+
+ m_allMemberList.size()+
m_pages.size()+
m_examples.size();
}
@@ -594,19 +610,16 @@ size_t GroupDefImpl::numDocMembers() const
void GroupDefImpl::computeAnchors()
{
//printf("GroupDefImpl::computeAnchors()\n");
- m_allMemberList->setAnchors();
+ 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;
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::Group));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ 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())
{
@@ -617,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";
}
}
}
@@ -629,23 +654,18 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile)
if (nd->isLinkableInProject())
{
tagFile << " <namespace>" << convertToXML(nd->name())
- << "</namespace>" << endl;
+ << "</namespace>\n";
}
}
}
break;
case LayoutDocEntry::GroupFiles:
{
- if (m_fileList)
+ for (const auto &fd : m_fileList)
{
- QListIterator<FileDef> it(*m_fileList);
- FileDef *fd;
- for (;(fd=it.current());++it)
+ if (fd->isLinkableInProject())
{
- if (fd->isLinkableInProject())
- {
- tagFile << " <file>" << convertToXML(fd->name()) << "</file>" << endl;
- }
+ tagFile << " <file>" << convertToXML(fd->name()) << "</file>\n";
}
}
}
@@ -657,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";
}
}
}
@@ -668,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";
}
}
}
@@ -679,14 +699,14 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile)
{
if (gd->isVisible())
{
- tagFile << " <subgroup>" << convertToXML(gd->name()) << "</subgroup>" << endl;
+ tagFile << " <subgroup>" << convertToXML(gd->name()) << "</subgroup>\n";
}
}
}
break;
case LayoutDocEntry::MemberDecl:
{
- LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
+ const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
MemberList * ml = getMemberList(lmd->type);
if (ml)
{
@@ -707,7 +727,7 @@ void GroupDefImpl::writeTagFile(FTextStream &tagFile)
}
}
writeDocAnchorsToTagFile(tagFile);
- tagFile << " </compound>" << endl;
+ tagFile << " </compound>\n";
}
void GroupDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title)
@@ -725,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
@@ -741,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) &&
@@ -762,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));
}
}
}
@@ -780,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();
@@ -797,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();
}
@@ -816,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();
@@ -832,31 +852,29 @@ void GroupDefImpl::writeGroupGraph(OutputList &ol)
void GroupDefImpl::writeFiles(OutputList &ol,const QCString &title)
{
// write list of files
- if (m_fileList->count()>0)
+ if (!m_fileList.empty())
{
ol.startMemberHeader("files");
ol.parseText(title);
ol.endMemberHeader();
ol.startMemberList();
- QListIterator<FileDef> it(*m_fileList);
- FileDef *fd;
- for (;(fd=it.current());++it)
+ for (const auto &fd : m_fileList)
{
if (!fd->hasDocumentation()) continue;
ol.startMemberDeclaration();
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();
}
@@ -892,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();
@@ -924,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();
@@ -946,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);
@@ -966,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();
}
}
@@ -1029,36 +1053,35 @@ void GroupDefImpl::writeSummaryLinks(OutputList &ol) const
{
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::Group));
- LayoutDocEntry *lde;
bool first=TRUE;
SrcLangExt lang = getLanguage();
- for (eli.toFirst();(lde=eli.current());++eli)
+ 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->count()>0) ||
+ 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())
)
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ 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)
{
- LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
+ const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
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;
}
}
@@ -1103,24 +1126,24 @@ void GroupDefImpl::writeDocumentation(OutputList &ol)
if (Doxygen::searchIndex)
{
Doxygen::searchIndex->setCurrentDoc(this,anchor(),FALSE);
- static QRegExp we("[a-zA-Z_][-a-zA-Z_0-9]*");
- int i=0,p=0,l=0;
- while ((i=we.match(m_title,p,&l))!=-1) // foreach word in the title
+ std::string title = m_title.str();
+ static const reg::Ex re(R"(\a[\w-]*)");
+ reg::Iterator it(title,re);
+ reg::Iterator end;
+ for (; it!=end ; ++it)
{
- Doxygen::searchIndex->addWord(m_title.mid(i,l),TRUE);
- p=i+l;
+ const auto &match = *it;
+ std::string matchStr = match.str();
+ Doxygen::searchIndex->addWord(matchStr.c_str(),TRUE);
}
}
- Doxygen::indexList->addIndexItem(this,0,0,m_title);
+ Doxygen::indexList->addIndexItem(this,0,QCString(),m_title);
//---------------------------------------- start flexible part -------------------------------
SrcLangExt lang=getLanguage();
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::Group));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Group))
{
switch (lde->kind())
{
@@ -1132,10 +1155,16 @@ void GroupDefImpl::writeDocumentation(OutputList &ol)
break;
case LayoutDocEntry::GroupClasses:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
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);
@@ -1143,7 +1172,7 @@ void GroupDefImpl::writeDocumentation(OutputList &ol)
break;
case LayoutDocEntry::GroupNamespaces:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeNamespaces(ol,ls->title(lang));
}
break;
@@ -1152,7 +1181,7 @@ void GroupDefImpl::writeDocumentation(OutputList &ol)
break;
case LayoutDocEntry::MemberDecl:
{
- LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
+ const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
writeMemberDeclarations(ol,lmd->type,lmd->title(lang));
}
break;
@@ -1161,7 +1190,7 @@ void GroupDefImpl::writeDocumentation(OutputList &ol)
break;
case LayoutDocEntry::DetailedDesc:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeDetailedDescription(ol,ls->title(lang));
}
break;
@@ -1170,7 +1199,7 @@ void GroupDefImpl::writeDocumentation(OutputList &ol)
break;
case LayoutDocEntry::MemberDef:
{
- LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
+ const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get();
writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
}
break;
@@ -1179,7 +1208,7 @@ void GroupDefImpl::writeDocumentation(OutputList &ol)
break;
case LayoutDocEntry::GroupNestedGroups:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeNestedGroups(ol,ls->title(lang));
}
break;
@@ -1188,13 +1217,13 @@ void GroupDefImpl::writeDocumentation(OutputList &ol)
break;
case LayoutDocEntry::GroupDirs:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeDirs(ol,ls->title(lang));
}
break;
case LayoutDocEntry::GroupFiles:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeFiles(ol,ls->title(lang));
}
break;
@@ -1214,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:
@@ -1246,7 +1278,7 @@ void GroupDefImpl::writeDocumentation(OutputList &ol)
if (Config_getBool(SEPARATE_MEMBER_PAGES))
{
- m_allMemberList->sort();
+ m_allMemberList.sort();
writeMemberPages(ol);
}
@@ -1275,9 +1307,7 @@ void GroupDefImpl::writeQuickMemberLinks(OutputList &ol,const MemberDef *current
ol.writeString(" <div class=\"navtab\">\n");
ol.writeString(" <table>\n");
- MemberListIterator mli(*m_allMemberList);
- MemberDef *md;
- for (mli.toFirst();(md=mli.current());++mli)
+ for (const auto *md : m_allMemberList)
{
if (md->getGroupDef()==this && md->isLinkable() && !md->isEnumValue())
{
@@ -1322,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()=%d\n",root->groups.size());
+ //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'\n",s->data());
+ //printf("group '%s' gd=%p\n",qPrint(g.groupname),(void*)gd);
if (gd && gd->addNamespace(nd))
{
NamespaceDefMutable *ndm = toNamespaceDefMutable(nd);
@@ -1341,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()));
}
}
}
@@ -1352,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);
@@ -1373,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))
{
@@ -1392,8 +1440,8 @@ void addGroupToGroups(const Entry *root,GroupDef *subGroup)
/*! Add a member to the group with the highest priority */
void addMemberToGroups(const Entry *root,MemberDef *md)
{
- //printf("addMemberToGroups: Root %p = %s, md %p=%s groups=%d\n",
- // root, root->name.data(), md, md->name().data(), root->groups->count() );
+ //printf("addMemberToGroups: Root %p = %s, md %p=%s groups=%zu\n",
+ // 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;
@@ -1407,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())
);
}
@@ -1455,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())
);
}
}
@@ -1475,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)
{
@@ -1506,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());
}
}
}
@@ -1524,7 +1572,7 @@ void GroupDefImpl::addListReferences()
getOutputFileBase(),
theTranslator->trGroup(TRUE,TRUE),
getOutputFileBase(),name(),
- 0,
+ QCString(),
0
);
}
@@ -1541,7 +1589,7 @@ void GroupDefImpl::addListReferences()
}
}
-void GroupDefImpl::addMemberToList(MemberListType lt,MemberDef *md)
+void GroupDefImpl::addMemberToList(MemberListType lt,const MemberDef *md)
{
static bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
static bool sortMemberDocs = Config_getBool(SORT_MEMBER_DOCS);
@@ -1550,7 +1598,7 @@ void GroupDefImpl::addMemberToList(MemberListType lt,MemberDef *md)
ml->setNeedsSorting(
((ml->listType()&MemberListType_declarationLists) && sortBriefDocs) ||
((ml->listType()&MemberListType_documentationLists) && sortMemberDocs));
- ml->append(md);
+ ml->push_back(md);
}
// performs a partial reordering to group elements together with the same scope
@@ -1669,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());
}
}
@@ -1690,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 624a680..587c709 100644
--- a/src/groupdef.h
+++ b/src/groupdef.h
@@ -20,7 +20,6 @@
#include <memory>
-#include "sortdict.h"
#include "definition.h"
#include "dirdef.h"
#include "layout.h"
@@ -31,20 +30,20 @@ class MemberList;
class MemberLists;
class FileList;
class ClassLinkedRefMap;
+class ConceptLinkedRefMap;
class NamespaceLinkedRefMap;
class FileDef;
class ClassDef;
+class ConceptDef;
class NamespaceDef;
class GroupList;
class OutputList;
-class NamespaceSDict;
class PageLinkedRefMap;
class PageDef;
class DirDef;
class FTVHelp;
class Entry;
class MemberDef;
-class FTextStream;
/** A model of a group of symbols. */
class GroupDef : public DefinitionMutable, public Definition
@@ -56,23 +55,24 @@ 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;
virtual void addExample(const PageDef *def) = 0;
virtual void addDir(DirDef *dd) = 0;
- virtual bool insertMember(MemberDef *def,bool docOnly=FALSE) = 0;
+ virtual bool insertMember(const MemberDef *def,bool docOnly=FALSE) = 0;
virtual void removeMember(MemberDef *md) = 0;
virtual bool findGroup(const GroupDef *def) const = 0;
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,8 +97,9 @@ class GroupDef : public DefinitionMutable, public Definition
/* user defined member groups */
virtual const MemberGroupList &getMemberGroups() const = 0;
- virtual FileList * getFiles() const = 0;
+ 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;
@@ -109,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
@@ -128,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 2f8075b..8c532ca 100644
--- a/src/growbuf.h
+++ b/src/growbuf.h
@@ -3,8 +3,9 @@
#include <stdlib.h>
#include <string.h>
+#include <string>
-#define GROW_AMOUNT 1024
+#define GROW_AMOUNT 1024*4
/** Class representing a string buffer optimised for growing. */
class GrowBuf
@@ -13,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); }
@@ -27,6 +59,15 @@ class GrowBuf
m_pos+=l;
}
}
+ void addStr(const std::string &s) {
+ if (!s.empty())
+ {
+ uint l=(uint)s.length();
+ if (m_pos+l>=m_len) { m_len+=l+GROW_AMOUNT; m_str = (char*)realloc(m_str,m_len); }
+ strcpy(&m_str[m_pos],s.c_str());
+ m_pos+=l;
+ }
+ }
void addStr(const char *s) {
if (s)
{
@@ -46,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 0c3a9af..cb7b99c 100644
--- a/src/htags.cpp
+++ b/src/htags.cpp
@@ -15,20 +15,20 @@
#include <stdio.h>
-#include <qdir.h>
-#include <qdict.h>
+#include <unordered_map>
+#include <string>
#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 QDict<QCString> g_symbolDict(10007);
+static Dir g_inputDir;
+static std::unordered_map<std::string,std::string> g_symbolMap;
/*! constructs command line of htags(1) and executes it.
* \retval TRUE success
@@ -43,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",
@@ -86,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)
@@ -96,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;
}
@@ -109,9 +108,9 @@ 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 using QDict.
+ * Construct FILEMAP dictionary.
*
* In FILEMAP, URL includes 'html' suffix but we cut it off according
* to the method of FileDef class.
@@ -123,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)
{
@@ -141,19 +137,18 @@ bool Htags::loadFilemap(const QCString &htmlDir)
QCString value = line.mid(sep+1).stripWhiteSpace();
int ext=value.findRev('.');
if (ext!=-1) value=value.left(ext); // strip extension
- g_symbolDict.setAutoDelete(TRUE);
- g_symbolDict.insert(key,new QCString(value));
- //printf("Key/Value=(%s,%s)\n",key.data(),value.data());
+ g_symbolMap.insert(std::make_pair(key.str(),value.str()));
+ //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.
@@ -163,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)
{
@@ -171,11 +166,11 @@ QCString Htags::path2URL(const QCString &path)
}
if (!symName.isEmpty())
{
- QCString *result = g_symbolDict[symName];
- //printf("path2URL=%s symName=%s result=%p\n",path.data(),symName.data(),result);
- if (result)
+ auto it = g_symbolMap.find(symName.str());
+ //printf("path2URL=%s symName=%s result=%p\n",qPrint(path),qPrint(symName),result);
+ if (it!=g_symbolMap.end())
{
- url = "HTML/" + *result;
+ url = QCString("HTML/"+it->second);
}
}
return url;
diff --git a/src/htmlattrib.h b/src/htmlattrib.h
index 66d5325..9e22520 100644
--- a/src/htmlattrib.h
+++ b/src/htmlattrib.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.
*
@@ -15,63 +15,20 @@
#ifndef _HTMLATTRIB_H
#define _HTMLATTRIB_H
-#include <qcstring.h>
-#include <qlist.h>
+#include <vector>
+
+#include "qcstring.h"
-/*! A Html option. A name, value pair */
+/*! \brief Class representing a HTML attribute. */
struct HtmlAttrib
{
QCString name;
QCString value;
};
-/*! @brief A list of Html attributes.
- *
- * The Html attributes are deeply copied into the list.
- */
-class HtmlAttribList : public QList<HtmlAttrib>
-{
- public:
- HtmlAttribList() : QList<HtmlAttrib>() { setAutoDelete(TRUE); }
- ~HtmlAttribList() { clear(); }
- HtmlAttribList(const HtmlAttribList &l) : QList<HtmlAttrib>()
- { operator=(l); }
- HtmlAttribList &operator=(const HtmlAttribList &l)
- { clear(); QList<HtmlAttrib>::operator=(l); return *this; }
- QCString find(const QCString name) const
- {
- QListIterator<HtmlAttrib> it(*this);
- QCString result;
- HtmlAttrib *attr;
- for (;(attr=it.current());++it)
- {
- if (attr->name==name) return attr->value;
- }
- return result;
- }
- QCString toString() const
- {
- QListIterator<HtmlAttrib> it(*this);
- QCString result;
- HtmlAttrib *attr;
- for (;(attr=it.current());++it)
- {
- result+=" "+attr->name+"=\""+attr->value+"\"";
- }
- return result;
- }
- private:
- HtmlAttrib *newValue( HtmlAttrib *v ) const
- { return new HtmlAttrib(*v); }
- void deleteValue(HtmlAttrib *v) const
- { delete v; }
-};
-
-/*! @brief Html attribute list iterator */
-class HtmlAttribListIterator : public QListIterator<HtmlAttrib>
+/*! \brief Class representing a list of HTML attributes. */
+class HtmlAttribList : public std::vector<HtmlAttrib>
{
- public:
- HtmlAttribListIterator(const HtmlAttribList &l) : QListIterator<HtmlAttrib>(l) {}
};
#endif
diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp
index b93a2c4..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"};
@@ -102,7 +102,7 @@ static QCString convertIndexWordToAnchor(const QCString &word)
return result;
}
-static bool mustBeOutsideParagraph(DocNode *n)
+static bool mustBeOutsideParagraph(const DocNode *n)
{
switch (n->kind())
{
@@ -157,7 +157,7 @@ static bool mustBeOutsideParagraph(DocNode *n)
return FALSE;
}
-static bool isDocVerbatimVisible(DocVerbatim *s)
+static bool isDocVerbatimVisible(const DocVerbatim *s)
{
switch(s->type())
{
@@ -172,7 +172,7 @@ static bool isDocVerbatimVisible(DocVerbatim *s)
}
}
-static bool isDocIncludeVisible(DocInclude *s)
+static bool isDocIncludeVisible(const DocInclude *s)
{
switch (s->type())
{
@@ -188,7 +188,7 @@ static bool isDocIncludeVisible(DocInclude *s)
}
}
-static bool isDocIncOperatorVisible(DocIncOperator *s)
+static bool isDocIncOperatorVisible(const DocIncOperator *s)
{
switch (s->type())
{
@@ -199,7 +199,7 @@ static bool isDocIncOperatorVisible(DocIncOperator *s)
}
}
-static bool isInvisibleNode(DocNode *node)
+static bool isInvisibleNode(const DocNode *node)
{
return (node->kind()==DocNode::Kind_WhiteSpace)
|| // skip over image nodes that are not for HTML output
@@ -213,30 +213,19 @@ static bool isInvisibleNode(DocNode *node)
;
}
-static void mergeHtmlAttributes(const HtmlAttribList &attribs, HtmlAttribList *mergeInto)
+static void mergeHtmlAttributes(const HtmlAttribList &attribs, HtmlAttribList &mergeInto)
{
- HtmlAttribListIterator li(attribs);
- HtmlAttrib *att;
- for (li.toFirst();(att=li.current());++li)
+ for (const auto &att : attribs)
{
- HtmlAttribListIterator ml(*mergeInto);
- HtmlAttrib *opt;
- bool found = false;
- for (ml.toFirst();(opt=ml.current());++ml)
+ auto it = std::find_if(mergeInto.begin(),mergeInto.end(),
+ [&att](const auto &opt) { return opt.name==att.name; });
+ if (it!=mergeInto.end()) // attribute name already in mergeInto
{
- if (opt->name == att -> name)
- {
- found = true;
- break;
- }
+ it->value = it->value + " " + att.value;
}
- if (found)
+ else // attribute name not yet in mergeInto
{
- opt->value = opt->value + " " + att->value;
- }
- else
- {
- mergeInto->append(att);
+ mergeInto.push_back(att);
}
}
}
@@ -244,31 +233,29 @@ static void mergeHtmlAttributes(const HtmlAttribList &attribs, HtmlAttribList *m
static QCString htmlAttribsToString(const HtmlAttribList &attribs, QCString *pAltValue = 0)
{
QCString result;
- HtmlAttribListIterator li(attribs);
- HtmlAttrib *att;
- for (li.toFirst();(att=li.current());++li)
+ for (const auto &att : attribs)
{
- if (!att->value.isEmpty()) // ignore attribute without values as they
+ if (!att.value.isEmpty()) // ignore attribute without values as they
// are not XHTML compliant, with the exception
// of the alt attribute with the img tag
{
- if (att->name=="alt" && pAltValue) // optionally return the value of alt separately
+ if (att.name=="alt" && pAltValue) // optionally return the value of alt separately
// need to convert <img> to <object> for SVG images,
// which do not support the alt attribute
{
- *pAltValue = att->value;
+ *pAltValue = att.value;
}
else
{
result+=" ";
- result+=att->name;
- result+="=\""+convertToXML(att->value)+"\"";
+ result+=att.name;
+ result+="=\""+convertToXML(att.value)+"\"";
}
}
- else if (att->name=="nowrap") // In XHTML, attribute minimization is forbidden, and the nowrap attribute must be defined as <td nowrap="nowrap">.
+ else if (att.name=="nowrap") // In XHTML, attribute minimization is forbidden, and the nowrap attribute must be defined as <td nowrap="nowrap">.
{
result+=" ";
- result+=att->name;
+ result+=att.name;
result+="=\"nowrap\"";
}
}
@@ -277,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)
@@ -291,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());
}
@@ -299,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();
@@ -484,29 +471,27 @@ 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";
}
}
-static void visitCaption(HtmlDocVisitor *parent, QList<DocNode> children)
+static void visitCaption(HtmlDocVisitor *parent, DocNodeList &children)
{
- QListIterator<DocNode> cli(children);
- DocNode *n;
- for (cli.toFirst();(n=cli.current());++cli) n->accept(parent);
+ for (const auto &n : children) n->accept(parent);
}
void HtmlDocVisitor::visit(DocVerbatim *s)
@@ -569,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);
}
@@ -603,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
{
@@ -617,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);
}
@@ -642,13 +628,13 @@ 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;
+ QCString baseName = PlantumlManager::instance().writePlantUMLSource(htmlOutput,s->exampleFile(),s->text(),format);
+ 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;
@@ -691,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(),
@@ -760,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()),
@@ -792,12 +778,12 @@ 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);
if (!m_hide) m_ci.startCodeFragment("DoxyCode");
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
QCString locLangExt = getFileNameExtension(op->includeFileName());
@@ -805,14 +791,14 @@ void HtmlDocVisitor::visit(DocIncOperator *op)
SrcLangExt langExt = getLanguageFromFileName(locLangExt);
if (op->type()!=DocIncOperator::Skip)
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide)
{
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,
@@ -831,18 +817,18 @@ void HtmlDocVisitor::visit(DocIncOperator *op)
);
if (fd) delete fd;
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
if (op->isLast())
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide) m_ci.endCodeFragment("DoxyCode");
forceStartParagraph(op);
}
else
{
- if (!m_hide) m_t << endl;
+ if (!m_hide) m_t << "\n";
}
}
@@ -853,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))
@@ -902,7 +888,7 @@ void HtmlDocVisitor::visit(DocFormula *f)
}
if (bDisplay)
{
- m_t << endl << "</p>" << endl;
+ m_t << "\n</p>\n";
forceStartParagraph(f);
}
}
@@ -916,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)
@@ -972,13 +958,12 @@ void HtmlDocVisitor::visitPre(DocAutoList *l)
// A.
// 1. (repeat)...
//
- m_t << "<ol type=\"" << types[l->depth() % NUM_HTML_LIST_TYPES] << "\"";
+ m_t << "<ol type=\"" << types[l->depth() % NUM_HTML_LIST_TYPES] << "\">";
}
else
{
- m_t << "<ul";
+ m_t << "<ul>";
}
- m_t << getDirHtmlClassOfNode(getTextDirByConfig(l)) << ">";
if (!l->isPreformatted()) m_t << "\n";
}
@@ -1014,21 +999,22 @@ void HtmlDocVisitor::visitPost(DocAutoListItem *li)
template<class T>
bool isFirstChildNode(T *parent, DocNode *node)
{
- return parent->children().getFirst()==node;
+ return !parent->children().empty() && parent->children().front().get()==node;
}
template<class T>
bool isLastChildNode(T *parent, DocNode *node)
{
- return parent->children().getLast()==node;
+ return !parent->children().empty() && parent->children().back().get()==node;
}
bool isSeparatedParagraph(DocSimpleSect *parent,DocPara *par)
{
- QList<DocNode> nodes = parent->children();
- int i = nodes.findRef(par);
- if (i==-1) return FALSE;
- int count = parent->children().count();
+ const DocNodeList &nodes = parent->children();
+ auto it = std::find_if(nodes.begin(),nodes.end(),[par](const auto &n) { return n.get()==par; });
+ if (it==nodes.end()) return FALSE;
+ size_t i = it - nodes.begin();
+ size_t count = parent->children().size();
if (count>1 && i==0) // first node
{
if (nodes.at(i+1)->kind()==DocNode::Kind_SimpleSectSep)
@@ -1243,20 +1229,18 @@ void HtmlDocVisitor::visitPre(DocPara *p)
// if the first element of a paragraph is something that should be outside of
// the paragraph (<ul>,<dl>,<table>,..) then that will already started the
// paragraph and we don't need to do it here
- bool paragraphAlreadyStarted = false;
- uint nodeIndex = 0;
- if (p && nodeIndex<p->children().count())
+ size_t nodeIndex = 0;
+ if (p && nodeIndex<p->children().size())
{
- while (nodeIndex<p->children().count() && isInvisibleNode(p->children().at(nodeIndex)))
+ while (nodeIndex<p->children().size() && isInvisibleNode(p->children().at(nodeIndex).get()))
{
nodeIndex++;
}
- if (nodeIndex<p->children().count())
+ if (nodeIndex<p->children().size())
{
- DocNode *n = p->children().at(nodeIndex);
+ const DocNode *n = p->children().at(nodeIndex).get();
if (mustBeOutsideParagraph(n))
{
- paragraphAlreadyStarted = true;
needsTag = FALSE;
}
}
@@ -1275,9 +1259,7 @@ void HtmlDocVisitor::visitPre(DocPara *p)
//printf(" needsTag=%d\n",needsTag);
// write the paragraph tag (if needed)
if (needsTag)
- m_t << "<p" << getDirHtmlClassOfNode(getTextDirByConfig(p), contexts[t]) << htmlAttribsToString(p->attribs()) << ">";
- else if(!paragraphAlreadyStarted)
- m_t << getHtmlDirEmbeddingChar(getTextDirByConfig(p)) << htmlAttribsToString(p->attribs());
+ m_t << "<p class=\"" << contexts[t] << "\"" << htmlAttribsToString(p->attribs()) << ">";
}
void HtmlDocVisitor::visitPost(DocPara *p)
@@ -1316,16 +1298,16 @@ void HtmlDocVisitor::visitPost(DocPara *p)
// if the last element of a paragraph is something that should be outside of
// the paragraph (<ul>,<dl>,<table>) then that will already have ended the
// paragraph and we don't need to do it here
- int nodeIndex = p->children().count()-1;
- if (nodeIndex>=0)
+ if (!p->children().empty())
{
- while (nodeIndex>=0 && isInvisibleNode(p->children().at(nodeIndex)))
+ int nodeIndex = static_cast<int>(p->children().size()-1);
+ while (nodeIndex>=0 && isInvisibleNode(p->children().at(nodeIndex).get()))
{
nodeIndex--;
}
if (nodeIndex>=0)
{
- DocNode *n = p->children().at(nodeIndex);
+ const DocNode *n = p->children().at(nodeIndex).get();
if (mustBeOutsideParagraph(n))
{
needsTag = FALSE;
@@ -1357,10 +1339,7 @@ void HtmlDocVisitor::visitPre(DocSimpleSect *s)
{
if (m_hide) return;
forceEndParagraph(s);
- if (s->type() != DocSimpleSect::Return)
- m_t << "<dl" << getDirHtmlClassOfNode(getTextDirByConfig(s), "section " + s->typeString()) << "><dt>";
- else
- m_t << "<dl class=\"section " << s->typeString() << "\"><dt>";
+ m_t << "<dl class=\"section " << s->typeString() << "\"><dt>";
switch(s->type())
{
case DocSimpleSect::See:
@@ -1456,10 +1435,10 @@ void HtmlDocVisitor::visitPre(DocSection *s)
{
if (m_hide) return;
forceEndParagraph(s);
- m_t << "<h" << s->level() << getDirHtmlClassOfNode(getTextDirByConfig(s->title())) << ">";
+ 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";
}
@@ -1480,7 +1459,7 @@ void HtmlDocVisitor::visitPre(DocHtmlList *s)
{
m_t << "<ul" << htmlAttribsToString(s->attribs());
}
- m_t << getDirHtmlClassOfNode(getTextDirByConfig(s)) << ">\n";
+ m_t << ">\n";
}
void HtmlDocVisitor::visitPost(DocHtmlList *s)
@@ -1528,9 +1507,7 @@ void HtmlDocVisitor::visitPost(DocHtmlDescList *dl)
void HtmlDocVisitor::visitPre(DocHtmlDescTitle *dt)
{
if (m_hide) return;
- m_t << "<dt" << htmlAttribsToString(dt->attribs())
- << getDirHtmlClassOfNode(getTextDirByConfig(dt))
- << ">";
+ m_t << "<dt" << htmlAttribsToString(dt->attribs()) << ">";
}
void HtmlDocVisitor::visitPost(DocHtmlDescTitle *)
@@ -1542,9 +1519,7 @@ void HtmlDocVisitor::visitPost(DocHtmlDescTitle *)
void HtmlDocVisitor::visitPre(DocHtmlDescData *dd)
{
if (m_hide) return;
- m_t << "<dd" << htmlAttribsToString(dd->attribs())
- << getDirHtmlClassOfNode(getTextDirByConfig(dd))
- << ">";
+ m_t << "<dd" << htmlAttribsToString(dd->attribs()) << ">";
}
void HtmlDocVisitor::visitPost(DocHtmlDescData *)
@@ -1571,21 +1546,11 @@ void HtmlDocVisitor::visitPre(DocHtmlTable *t)
QCString attrs = htmlAttribsToString(t->attribs());
if (attrs.isEmpty())
{
- m_t << "<table";
- if(t->hasCaption())
- m_t << getDirHtmlClassOfNode(getTextDirByConfig(t->caption()), "doxtable");
- else
- m_t << getDirHtmlClassOfNode(getTextDirByConfig(t), "doxtable");
- m_t << ">\n";
+ m_t << "<table class=\"doxtable\">\n";
}
else
{
- m_t << "<table";
- if (t->hasCaption())
- m_t << getDirHtmlClassOfNode(getTextDirByConfig(t->caption()));
- else
- m_t << getDirHtmlClassOfNode(getTextDirByConfig(t));
- m_t << htmlAttribsToString(t->attribs()) << ">\n";
+ m_t << "<table" << htmlAttribsToString(t->attribs()) << ">\n";
}
}
@@ -1643,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 *)
@@ -1677,10 +1642,7 @@ void HtmlDocVisitor::visitPre(DocHtmlHeader *header)
{
if (m_hide) return;
forceEndParagraph(header);
- m_t << "<h" << header->level()
- << htmlAttribsToString(header->attribs())
- << getDirHtmlClassOfNode(getTextDirByConfig(header))
- << ">";
+ m_t << "<h" << header->level() << htmlAttribsToString(header->attribs()) << ">";
}
void HtmlDocVisitor::visitPost(DocHtmlHeader *header)
@@ -1709,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())
{
@@ -1727,10 +1689,10 @@ void HtmlDocVisitor::visitPre(DocImage *img)
HtmlAttrib opt;
opt.name = "style";
opt.value = "pointer-events: none;";
- extraAttribs.append(&opt);
+ extraAttribs.push_back(opt);
}
QCString alt;
- mergeHtmlAttributes(img->attribs(),&extraAttribs);
+ mergeHtmlAttributes(img->attribs(),extraAttribs);
QCString attrs = htmlAttribsToString(extraAttribs,&alt);
QCString src;
if (url.isEmpty())
@@ -1751,7 +1713,7 @@ void HtmlDocVisitor::visitPre(DocImage *img)
}
else
{
- m_t << ">" << alt << "</object>" << endl;
+ m_t << ">" << alt << "</object>\n";
}
}
else
@@ -1774,8 +1736,7 @@ void HtmlDocVisitor::visitPre(DocImage *img)
}
else
{
- m_t << "<div class=\"caption\">" << endl;
- m_t << getHtmlDirEmbeddingChar(getTextDirByConfig(img));
+ m_t << "<div class=\"caption\">\n";
}
}
else if (inlineImage)
@@ -1785,7 +1746,7 @@ void HtmlDocVisitor::visitPre(DocImage *img)
}
else // other format -> skip
{
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
}
@@ -1809,24 +1770,24 @@ void HtmlDocVisitor::visitPost(DocImage *img)
}
if (!inlineImage) // end <div class="image">
{
- m_t << "</div>" << endl;
+ m_t << "</div>\n";
forceStartParagraph(img);
}
}
else // other format
{
- popEnabled();
+ m_hide = popHidden();
}
}
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";
}
}
@@ -1835,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)
@@ -1855,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)
@@ -1875,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)
@@ -1929,37 +1890,18 @@ 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);
}
-//void HtmlDocVisitor::visitPre(DocLanguage *l)
-//{
-// QCString langId = Config_getEnum(OUTPUT_LANGUAGE);
-// if (l->id().lower()!=langId.lower())
-// {
-// pushEnabled();
-// m_hide = TRUE;
-// }
-//}
-//
-//void HtmlDocVisitor::visitPost(DocLanguage *l)
-//{
-// QCString langId = Config_getEnum(OUTPUT_LANGUAGE);
-// if (l->id().lower()!=langId.lower())
-// {
-// popEnabled();
-// }
-//}
-
void HtmlDocVisitor::visitPre(DocParamSect *s)
{
if (m_hide) return;
@@ -1989,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);
}
@@ -2037,41 +1979,35 @@ void HtmlDocVisitor::visitPre(DocParamList *pl)
if (sect && sect->hasTypeSpecifier())
{
m_t << "<td class=\"paramtype\">";
- QListIterator<DocNode> li(pl->paramTypes());
- DocNode *type;
- for (li.toFirst();(type=li.current());++li)
+ for (const auto &type : pl->paramTypes())
{
if (type->kind()==DocNode::Kind_Word)
{
- visit((DocWord*)type);
+ visit((DocWord*)type.get());
}
else if (type->kind()==DocNode::Kind_LinkedWord)
{
- visit((DocLinkedWord*)type);
+ visit((DocLinkedWord*)type.get());
}
else if (type->kind()==DocNode::Kind_Sep)
{
- m_t << "&#160;" << ((DocSeparator *)type)->chars() << "&#160;";
+ m_t << "&#160;" << ((DocSeparator *)type.get())->chars() << "&#160;";
}
}
m_t << "</td>";
}
m_t << "<td class=\"paramname\">";
- //QStrListIterator li(pl->parameters());
- //const char *s;
- QListIterator<DocNode> li(pl->parameters());
- DocNode *param;
bool first=TRUE;
- for (li.toFirst();(param=li.current());++li)
+ for (const auto &param : pl->parameters())
{
if (!first) m_t << ","; else first=FALSE;
if (param->kind()==DocNode::Kind_Word)
{
- visit((DocWord*)param);
+ visit((DocWord*)param.get());
}
else if (param->kind()==DocNode::Kind_LinkedWord)
{
- visit((DocLinkedWord*)param);
+ visit((DocLinkedWord*)param.get());
}
}
m_t << "</td><td>";
@@ -2081,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)
@@ -2093,8 +2029,7 @@ void HtmlDocVisitor::visitPre(DocXRefItem *x)
bool anonymousEnum = x->file()=="@";
if (!anonymousEnum)
{
- m_t << "<dl" << getDirHtmlClassOfNode(getTextDirByConfig(x), x->key())
- << "><dt><b><a class=\"el\" href=\""
+ m_t << "<dl class=\"" << x->key() << "\"><dt><b><a class=\"el\" href=\""
<< x->relPath() << addHtmlExtensionIfMissing(x->file())
<< "#" << x->anchor() << "\">";
}
@@ -2112,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 *)
@@ -2142,22 +2077,13 @@ void HtmlDocVisitor::visitPre(DocHtmlBlockQuote *b)
if (m_hide) return;
forceEndParagraph(b);
QCString attrs = htmlAttribsToString(b->attribs());
- if (attrs.isEmpty())
- {
- m_t << "<blockquote" << getDirHtmlClassOfNode(getTextDirByConfig(b), "doxtable")
- << ">\n";
- }
- else
- {
- m_t << "<blockquote" << getDirHtmlClassOfNode(getTextDirByConfig(b))
- << htmlAttribsToString(b->attribs()) << ">\n";
- }
+ m_t << "<blockquote class=\"doxtable\"" << htmlAttribsToString(b->attribs()) << ">\n";
}
void HtmlDocVisitor::visitPost(DocHtmlBlockQuote *b)
{
if (m_hide) return;
- m_t << "</blockquote>" << endl;
+ m_t << "</blockquote>\n";
forceStartParagraph(b);
}
@@ -2171,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())
{
@@ -2204,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)
{
@@ -2241,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)
{
@@ -2281,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\" ";
@@ -2308,19 +2234,6 @@ void HtmlDocVisitor::endLink()
m_t << "</a>";
}
-void HtmlDocVisitor::pushEnabled()
-{
- m_enabled.push(new bool(m_hide));
-}
-
-void HtmlDocVisitor::popEnabled()
-{
- bool *v=m_enabled.pop();
- ASSERT(v!=0);
- m_hide = *v;
- delete v;
-}
-
void HtmlDocVisitor::writeDotFile(const QCString &fn,const QCString &relPath,
const QCString &context)
{
@@ -2382,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,
@@ -2403,16 +2316,16 @@ void HtmlDocVisitor::writePlantUMLFile(const QCString &fileName,
QCString imgExt = getDotImageExtension();
if (imgExt=="svg")
{
- PlantumlManager::instance()->generatePlantUMLOutput(fileName,outDir,PlantumlManager::PUML_SVG);
- //m_t << "<iframe scrolling=\"no\" frameborder=\"0\" src=\"" << relPath << baseName << ".svg" << "\" />" << endl;
+ PlantumlManager::instance().generatePlantUMLOutput(fileName,outDir,PlantumlManager::PUML_SVG);
+ //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;
+ PlantumlManager::instance().generatePlantUMLOutput(fileName,outDir,PlantumlManager::PUML_BITMAP);
+ m_t << "<img src=\"" << relPath << baseName << ".png" << "\" />\n";
}
}
@@ -2428,7 +2341,7 @@ static bool insideStyleChangeThatIsOutsideParagraph(DocPara *para,int nodeIndex)
bool styleOutsideParagraph=FALSE;
while (nodeIndex>=0 && !styleOutsideParagraph)
{
- DocNode *n = para->children().at(nodeIndex);
+ DocNode *n = para->children().at(nodeIndex).get();
if (n->kind()==DocNode::Kind_StyleChange)
{
DocStyleChange *sc = (DocStyleChange*)n;
@@ -2462,15 +2375,18 @@ void HtmlDocVisitor::forceEndParagraph(DocNode *n)
if (n->parent() && n->parent()->kind()==DocNode::Kind_Para)
{
DocPara *para = (DocPara*)n->parent();
- int nodeIndex = para->children().findRef(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 = static_cast<int>(it - children.begin());
nodeIndex--;
if (nodeIndex<0) return; // first node in paragraph
- while (nodeIndex>=0 && isInvisibleNode(para->children().at(nodeIndex)))
+ while (nodeIndex>=0 && isInvisibleNode(children.at(nodeIndex).get()))
{
- nodeIndex--;
+ nodeIndex--;
}
if (nodeIndex<0) return; // first visible node in paragraph
- n = para->children().at(nodeIndex);
+ n = children.at(nodeIndex).get();
if (mustBeOutsideParagraph(n)) return; // previous node already outside paragraph context
nodeIndex--;
bool styleOutsideParagraph=insideStyleChangeThatIsOutsideParagraph(para,nodeIndex);
@@ -2495,19 +2411,22 @@ void HtmlDocVisitor::forceStartParagraph(DocNode *n)
if (n->parent() && n->parent()->kind()==DocNode::Kind_Para) // if we are inside a paragraph
{
DocPara *para = (DocPara*)n->parent();
- int nodeIndex = para->children().findRef(n);
- int numNodes = para->children().count();
+ 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 = static_cast<int>(it - children.begin());
+ int numNodes = static_cast<int>(para->children().size());
bool styleOutsideParagraph=insideStyleChangeThatIsOutsideParagraph(para,nodeIndex);
if (styleOutsideParagraph) return;
nodeIndex++;
if (nodeIndex==numNodes) return; // last node
- while (nodeIndex<numNodes && isInvisibleNode(para->children().at(nodeIndex)))
+ while (nodeIndex<numNodes && isInvisibleNode(para->children().at(nodeIndex).get()))
{
nodeIndex++;
}
if (nodeIndex<numNodes)
{
- n = para->children().at(nodeIndex);
+ n = para->children().at(nodeIndex).get();
if (mustBeOutsideParagraph(n)) return; // next element also outside paragraph
}
else
@@ -2522,10 +2441,7 @@ void HtmlDocVisitor::forceStartParagraph(DocNode *n)
if (isFirst && isLast) needsTag = FALSE;
//printf("forceStart first=%d last=%d needsTag=%d\n",isFirst,isLast,needsTag);
- if (needsTag)
- m_t << "<p" << getDirHtmlClassOfNode(getTextDirByConfig(para, nodeIndex)) << ">";
- else
- m_t << getHtmlDirEmbeddingChar(getTextDirByConfig(para, nodeIndex));
+ if (needsTag) m_t << "<p>";
}
}
diff --git a/src/htmldocvisitor.h b/src/htmldocvisitor.h
index c994bac..287088d 100644
--- a/src/htmldocvisitor.h
+++ b/src/htmldocvisitor.h
@@ -1,13 +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,25 +17,24 @@
#define _HTMLDOCVISITOR_H
#include "docvisitor.h"
-#include <qstack.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
//--------------------------------------
-
+
void visit(DocWord *);
void visit(DocLinkedWord *);
void visit(DocWhiteSpace *);
@@ -60,7 +56,7 @@ class HtmlDocVisitor : public DocVisitor
//--------------------------------------
// visitor functions for compound nodes
//--------------------------------------
-
+
void visitPre(DocAutoList *);
void visitPost(DocAutoList *);
void visitPre(DocAutoListItem *);
@@ -139,12 +135,12 @@ class HtmlDocVisitor : public DocVisitor
private:
//--------------------------------------
- // helper functions
+ // helper functions
//--------------------------------------
-
+
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 = "");
@@ -154,9 +150,6 @@ class HtmlDocVisitor : public DocVisitor
void writeDiaFile(const QCString &fileName,const QCString &relPath,const QCString &context);
void writePlantUMLFile(const QCString &fileName,const QCString &relPath,const QCString &context);
- void pushEnabled();
- void popEnabled();
-
void forceEndParagraph(DocNode *n);
void forceStartParagraph(DocNode *n);
@@ -164,11 +157,10 @@ class HtmlDocVisitor : public DocVisitor
// state variables
//--------------------------------------
- FTextStream &m_t;
+ TextStream &m_t;
CodeOutputInterface &m_ci;
bool m_insidePre;
bool m_hide;
- QStack<bool> m_enabled;
const Definition *m_ctx;
QCString m_langExt;
};
diff --git a/src/htmlentity.cpp b/src/htmlentity.cpp
index ae2d8f1..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;
@@ -325,18 +325,16 @@ HtmlEntityMapper *HtmlEntityMapper::s_instance = 0;
HtmlEntityMapper::HtmlEntityMapper()
{
- m_name2sym = new QDict<int>(1009);
- m_name2sym->setAutoDelete(TRUE);
+
for (int i = 0; i < g_numHtmlEntities; i++)
{
- m_name2sym->insert(g_htmlEntities[i].item,new int(g_htmlEntities[i].symb));
+ m_name2sym.insert(std::make_pair(g_htmlEntities[i].item,g_htmlEntities[i].symb));
}
validate();
}
HtmlEntityMapper::~HtmlEntityMapper()
{
- delete m_name2sym;
}
/** Returns the one and only instance of the HTML entity mapper */
@@ -472,11 +470,11 @@ const DocSymbol::PerlSymb *HtmlEntityMapper::perl(DocSymbol::SymType symb) const
*/
DocSymbol::SymType HtmlEntityMapper::name2sym(const QCString &symName) const
{
- int *pSymb = m_name2sym->find(symName);
- return pSymb ? ((DocSymbol::SymType)*pSymb) : DocSymbol::Sym_Unknown;
+ auto it = m_name2sym.find(symName.str());
+ 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 7e54066..cbdc0a1 100644
--- a/src/htmlentity.h
+++ b/src/htmlentity.h
@@ -15,10 +15,12 @@
#ifndef HTMLENTITY_H
#define HTMLENTITY_H
-#include <qdict.h>
+#include <unordered_map>
+#include <string>
+
#include "docparser.h"
-class FTextStream;
+class TextStream;
/** @brief Singleton helper class to map html entities to other formats */
class HtmlEntityMapper
@@ -35,13 +37,13 @@ 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();
~HtmlEntityMapper();
static HtmlEntityMapper *s_instance;
- QDict<int> *m_name2sym;
+ std::unordered_map<std::string,DocSymbol::SymType> m_name2sym;
};
#endif
diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp
index a9032b1..ea20707 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,9 +17,8 @@
#include <assert.h>
#include <mutex>
+#include <sstream>
-#include <qdir.h>
-#include <qregexp.h>
#include "message.h"
#include "htmlgen.h"
#include "config.h"
@@ -52,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)
@@ -64,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";
@@ -86,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";
@@ -142,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();
@@ -299,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);
@@ -309,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,
@@ -347,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
{
@@ -360,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
{
@@ -436,44 +436,109 @@ static QCString substituteHtmlKeywords(const QCString &str,
if (mathJax)
{
+ QCString mathJaxVersion = Config_getEnum(MATHJAX_VERSION);
QCString path = Config_getString(MATHJAX_RELPATH);
if (path.isEmpty() || path.left(2)=="..") // relative path
{
path.prepend(relPath);
}
- mathJaxJs = "<script type=\"text/x-mathjax-config\">\n"
- " MathJax.Hub.Config({\n"
- " extensions: [\"tex2jax.js\"";
- const StringVector &mathJaxExtensions = Config_getList(MATHJAX_EXTENSIONS);
- for (const auto &s : mathJaxExtensions)
- {
- mathJaxJs+= ", \""+QCString(s.c_str())+".js\"";
- }
- if (mathJaxFormat.isEmpty())
- {
- mathJaxFormat = "HTML-CSS";
- }
- mathJaxJs += "],\n"
- " jax: [\"input/TeX\",\"output/"+mathJaxFormat+"\"],\n"
- "});\n";
- if (!g_mathjax_code.isEmpty())
+
+ if (mathJaxVersion == "MathJax_3")
{
- mathJaxJs += g_mathjax_code;
- mathJaxJs += "\n";
+ mathJaxJs += "<script>\n"
+ " window.MathJax = {\n"
+ " options: {\n"
+ " ignoreHtmlClass: 'tex2jax_ignore',\n"
+ " processHtmlClass: 'tex2jax_process'\n"
+ " },\n";
+ const StringVector &mathJaxExtensions = Config_getList(MATHJAX_EXTENSIONS);
+ if (!mathJaxExtensions.empty() || !g_latex_macro.isEmpty())
+ {
+ mathJaxJs+= " tex: {\n"
+ " packages: ['base'";
+ if (!g_latex_macro.isEmpty())
+ {
+ mathJaxJs+= ",'newcommand'";
+ }
+ for (const auto &s : mathJaxExtensions)
+ {
+ mathJaxJs+= ",'"+QCString(s.c_str())+"'";
+ }
+ mathJaxJs += "]\n"
+ " },\n"
+ " tex: {\n"
+ " macros: {}\n"
+ " }\n";
+ }
+ mathJaxJs += " };\n";
+ mathJaxJs += "</script>\n";
+
+ if (!g_latex_macro.isEmpty())
+ {
+ mathJaxJs += "<script>\n"
+ " Object.assign(MathJax.tex.macros, {\n";
+ mathJaxJs += g_latex_macro;
+ mathJaxJs += "\n"
+ " });\n"
+ "</script>\n";
+ }
+
+ // MATHJAX_CODEFILE
+ if (!g_mathjax_code.isEmpty())
+ {
+ mathJaxJs += "<script>\n";
+ mathJaxJs += g_mathjax_code;
+ mathJaxJs += "\n";
+ mathJaxJs += "</script>\n";
+ }
+
+
+ mathJaxJs += "<script type=\"text/javascript\" id=\"MathJax-script\" async=\"async\" src=\"" + path;
+ if (mathJaxFormat == "chtml")
+ {
+ mathJaxJs += "es5/tex-chtml.js\"></script>\n" ;
+ }
+ else if (mathJaxFormat == "SVG")
+ {
+ mathJaxJs += "es5/tex-svg.js\"></script>\n" ;
+ }
}
- mathJaxJs += "</script>\n";
- if (!g_latex_macro.isEmpty())
+ else
{
- mathJaxJs += "<script type=\"text/x-mathjax-config\">\n"
- " MathJax.Hub.Config({\n"
- " TeX: { Macros: {\n";
- mathJaxJs += g_latex_macro;
- mathJaxJs += "\n"
- " } }\n"
- "});\n"
- "</script>\n";
+ mathJaxJs = "<script type=\"text/x-mathjax-config\">\n"
+ " MathJax.Hub.Config({\n"
+ " extensions: [\"tex2jax.js\"";
+ const StringVector &mathJaxExtensions = Config_getList(MATHJAX_EXTENSIONS);
+ for (const auto &s : mathJaxExtensions)
+ {
+ mathJaxJs+= ", \""+QCString(s.c_str())+".js\"";
+ }
+ if (mathJaxFormat.isEmpty())
+ {
+ mathJaxFormat = "HTML-CSS";
+ }
+ mathJaxJs += "],\n"
+ " jax: [\"input/TeX\",\"output/"+mathJaxFormat+"\"],\n"
+ "});\n";
+ if (!g_mathjax_code.isEmpty())
+ {
+ mathJaxJs += g_mathjax_code;
+ mathJaxJs += "\n";
+ }
+ mathJaxJs += "</script>\n";
+ if (!g_latex_macro.isEmpty())
+ {
+ mathJaxJs += "<script type=\"text/x-mathjax-config\">\n"
+ " MathJax.Hub.Config({\n"
+ " TeX: { Macros: {\n";
+ mathJaxJs += g_latex_macro;
+ mathJaxJs += "\n"
+ " } }\n"
+ "});\n"
+ "</script>\n";
+ }
+ mathJaxJs += "<script type=\"text/javascript\" async=\"async\" src=\"" + path + "MathJax.js\"></script>\n";
}
- mathJaxJs += "<script type=\"text/javascript\" async=\"async\" src=\"" + path + "MathJax.js\"></script>\n";
}
// first substitute generic keywords
@@ -511,20 +576,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)
@@ -532,12 +590,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)
@@ -586,7 +644,7 @@ void HtmlCodeGenerator::codify(const char *str)
}
else
{
- p=writeUtf8Char(m_t,p-1);
+ p=writeUTF8Char(m_t,p-1);
m_col++;
}
}
@@ -596,13 +654,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)
{
@@ -643,10 +701,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];
@@ -660,9 +717,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
{
@@ -673,21 +730,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();
@@ -698,18 +754,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)
{
@@ -732,13 +788,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);
@@ -786,76 +842,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)
{
}
@@ -879,16 +929,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
{
@@ -898,7 +948,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
{
@@ -910,10 +960,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);
@@ -937,15 +987,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"
@@ -986,7 +1036,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);
@@ -1012,10 +1062,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))
{
@@ -1035,39 +1085,35 @@ 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);
+ //printf("HtmlGenerator::startFile(%s)\n",qPrint(name));
m_relPath = relativePathToRoot(name);
QCString fileName = addHtmlExtensionIfMissing(name);
m_lastTitle=title;
startPlainFile(fileName);
m_codeGen.setId(id);
- m_codeGen.setTextStream(t);
m_codeGen.setRelativePath(m_relPath);
{
std::lock_guard<std::mutex> lock(g_indexLock);
@@ -1075,26 +1121,26 @@ void HtmlGenerator::startFile(const char *name,const char *,
}
m_lastFile = fileName;
- t << substituteHtmlKeywords(g_header,convertToHtml(filterTitle(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);
@@ -1119,11 +1165,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;
@@ -1149,18 +1195,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()
@@ -1170,12 +1216,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)
@@ -1189,42 +1235,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());
}
}
}
@@ -1238,160 +1283,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\">";
}
}
@@ -1399,79 +1444,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;
}
}
}
@@ -1487,7 +1532,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 -->";
@@ -1497,23 +1542,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);
@@ -1521,21 +1566,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);
@@ -1543,163 +1588,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!
@@ -1707,365 +1758,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()
@@ -2078,18 +2126,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 &)
{
}
@@ -2098,86 +2146,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)
{
@@ -2197,7 +2245,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)
{
@@ -2210,7 +2258,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)
{
@@ -2220,14 +2268,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";
}
@@ -2245,6 +2293,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;
@@ -2272,20 +2321,18 @@ 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)
{
- QListIterator<LayoutNavEntry> li(root->children());
- LayoutNavEntry *entry;
int count=0;
- for (li.toFirst();(entry=li.current());++li)
+ for (const auto &entry : root->children())
{
if (entry->visible() && quickLinkVisible(entry->kind())) count++;
}
if (count>0) // at least one item is visible
{
startQuickIndexList(t,FALSE);
- for (li.toFirst();(entry=li.current());++li)
+ for (const auto &entry : root->children())
{
if (entry->visible() && quickLinkVisible(entry->kind()))
{
@@ -2294,7 +2341,7 @@ static void renderQuickLinksAsTree(FTextStream &t,const QCString &relPath,Layout
t << fixSpaces(entry->title());
t << "</span></a>\n";
// recursive into child list
- renderQuickLinksAsTree(t,relPath,entry);
+ renderQuickLinksAsTree(t,relPath,entry.get());
t << "</li>";
}
}
@@ -2303,7 +2350,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)
{
@@ -2311,28 +2358,25 @@ static void renderQuickLinksAsTabs(FTextStream &t,const QCString &relPath,
{
renderQuickLinksAsTabs(t,relPath,hlEntry->parent(),kind,highlightParent,highlightSearch);
}
- if (hlEntry->parent() && hlEntry->parent()->children().count()>0) // draw tabs for row containing hlEntry
+ if (hlEntry->parent() && !hlEntry->parent()->children().empty()) // draw tabs for row containing hlEntry
{
bool topLevel = hlEntry->parent()->parent()==0;
- QListIterator<LayoutNavEntry> li(hlEntry->parent()->children());
- LayoutNavEntry *entry;
-
int count=0;
- for (li.toFirst();(entry=li.current());++li)
+ for (const auto &entry : hlEntry->parent()->children())
{
if (entry->visible() && quickLinkVisible(entry->kind())) count++;
}
if (count>0) // at least one item is visible
{
startQuickIndexList(t,TRUE,topLevel);
- for (li.toFirst();(entry=li.current());++li)
+ for (const auto &entry : hlEntry->parent()->children())
{
if (entry->visible() && quickLinkVisible(entry->kind()))
{
QCString url = entry->url();
startQuickIndexItem(t,url,
- entry==hlEntry &&
- (entry->children().count()>0 ||
+ entry.get()==hlEntry &&
+ (!entry->children().empty() ||
(entry->kind()==kind && !highlightParent)
),
TRUE,relPath);
@@ -2375,9 +2419,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);
@@ -2397,6 +2441,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;
@@ -2413,6 +2458,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;
@@ -2438,16 +2485,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)
@@ -2462,20 +2509,20 @@ 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...
{
highlightParent=TRUE;
- hlEntry = root->children().getFirst();
+ hlEntry = root->children().front().get();
if (hlEntry==0)
{
return; // argl, empty index!
@@ -2483,7 +2530,7 @@ static void writeDefaultQuickLinks(FTextStream &t,bool compact,
}
if (kind==LayoutNavEntry::UserGroup)
{
- LayoutNavEntry *e = hlEntry->children().getFirst();
+ LayoutNavEntry *e = hlEntry->children().front().get();
if (e)
{
hlEntry = e;
@@ -2499,10 +2546,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;
@@ -2510,62 +2557,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" << getDirHtmlClassOfPage(pageTitle) << ">";
+ 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
@@ -2578,10 +2625,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";
@@ -2602,20 +2649,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\", \""
@@ -2624,11 +2672,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";
@@ -2644,16 +2692,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));
}
}
@@ -2662,14 +2712,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\", \""
@@ -2678,7 +2728,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";
@@ -2690,38 +2740,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);
@@ -2735,207 +2787,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=\"";
@@ -2948,49 +3000,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)
{
@@ -2998,7 +3050,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 af511bb..9887616 100644
--- a/src/htmlhelp.cpp
+++ b/src/htmlhelp.cpp
@@ -19,9 +19,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <qregexp.h>
-#include <qfile.h>
-#include <qfileinfo.h>
#include "htmlhelp.h"
#include "config.h"
@@ -34,6 +31,8 @@
#include "filedef.h"
#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
- m_fromUtf8 = portable_iconv_open(str,"UTF-8");
+ QCString str = Config_getString(CHM_INDEX_ENCODING);
+ if (str.isEmpty()) str = "CP1250"; // use safe and likely default
+ m_fromUtf8 = portable_iconv_open(str.data(),"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()
@@ -74,7 +73,7 @@ class HtmlHelpRecoder
QCString output(oSize);
size_t iLeft = iSize;
size_t oLeft = oSize;
- char *iPtr = s.rawData();
+ const char *iPtr = s.data();
char *oPtr = output.rawData();
if (!portable_iconv(m_fromUtf8,&iPtr,&iLeft,&oPtr,&oLeft))
{
@@ -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,17 +149,27 @@ 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)
{
- QCString key = level1;
- if (level2) key+= (QCString)"?" + level2;
- if (key.find(QRegExp("@[0-9]+"))!=-1) // skip anonymous stuff
+ static const reg::Ex re(R"(@\d+)");
+ std::string key = level1.str();
+ if (!level2.isEmpty()) key+= std::string("?") + level2.str();
+ if (reg::search(key,re)) // skip anonymous stuff
{
return;
}
- m_map.add(key+anchor,key,url,anchor,hasLink,reversed);
+ std::string key_anchor;
+ if (!anchor.isEmpty())
+ {
+ key_anchor = key+anchor.str();
+ }
+ else
+ {
+ key_anchor = key;
+ }
+ m_map.add(key_anchor.c_str(),key.c_str(),url,anchor,hasLink,reversed);
}
static QCString field2URL(const IndexField *f,bool checkReversed)
@@ -200,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),
@@ -224,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>
@@ -277,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)
@@ -294,7 +303,7 @@ void HtmlHelpIndex::writeFields(FTextStream &t)
"</OBJECT>\n";
}
}
- if (level2Started) t << " </UL>" << endl;
+ if (level2Started) t << " </UL>\n";
}
//----------------------------------------------------------------------------
@@ -304,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;
@@ -437,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"
@@ -453,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"
@@ -477,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
@@ -490,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;
@@ -513,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
@@ -534,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
@@ -575,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);
@@ -584,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();
@@ -625,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 */)
@@ -646,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";
@@ -659,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 << "\">";
}
@@ -678,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)
{
@@ -698,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 435321a..cbeea87 100644
--- a/src/image.h
+++ b/src/image.h
@@ -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.
*
@@ -18,7 +18,9 @@
#ifndef _IMAGE_H
#define _IMAGE_H
-#include <qglobal.h>
+
+#include "types.h"
+#include "qcstring.h"
/** Class representing a bitmap image generated by doxygen. */
class Image
@@ -26,24 +28,24 @@ class Image
public:
Image(uint w,uint h);
~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;
uint m_height;
@@ -58,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 c71e8fb..99942f1 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,15 +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 <qtextstream.h>
-#include <qdatetime.h>
-#include <qdir.h>
-#include <qregexp.h>
#include "message.h"
#include "index.h"
@@ -53,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
@@ -72,6 +67,7 @@ int hierarchyExceptions;
int documentedFiles;
int documentedGroups;
int documentedNamespaces;
+int documentedConcepts;
int indexedPages;
int documentedClassMembers[CMHL_Total];
int documentedFileMembers[FMHL_Total];
@@ -85,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);
@@ -107,6 +104,7 @@ void countDataStructures()
countRelatedPages(documentedPages,indexedPages); // "pages"
documentedGroups = countGroups(); // "modules"
documentedNamespaces = countNamespaces(); // "namespaces"
+ documentedConcepts = countConcepts(); // "concepts"
documentedDirs = countDirs(); // "dirs"
// "globals"
// "namespacemembers"
@@ -192,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;
@@ -219,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);
@@ -228,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);
@@ -250,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();
}
@@ -298,7 +296,8 @@ static bool memberVisibleInIndex(const MemberDef *md)
bool extractStatic = Config_getBool(EXTRACT_STATIC);
return (!isAnonymous &&
(!hideUndocMembers || md->hasDocumentation()) &&
- (!md->isStatic() || extractStatic)
+ (!md->isStatic() || extractStatic) &&
+ md->isLinkable()
);
}
@@ -306,17 +305,17 @@ static void writeMemberToIndex(const Definition *def,const MemberDef *md,bool ad
{
bool isAnonymous = md->isAnonymous();
bool hideUndocMembers = Config_getBool(HIDE_UNDOC_MEMBERS);
- const MemberList *enumList = md->enumFieldList();
- bool isDir = enumList!=0 && md->isEnumerate();
+ const MemberList &enumList = md->enumFieldList();
+ bool isDir = !enumList.empty() && md->isEnumerate();
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)
{
@@ -324,9 +323,7 @@ static void writeMemberToIndex(const Definition *def,const MemberDef *md,bool ad
{
Doxygen::indexList->incContentsDepth();
}
- MemberListIterator emli(*enumList);
- MemberDef *emd;
- for (emli.toFirst();(emd=emli.current());++emli)
+ for (const auto &emd : enumList)
{
if (!hideUndocMembers || emd->hasDocumentation())
{
@@ -353,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,
@@ -366,23 +365,28 @@ 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();
- QListIterator<LayoutDocEntry> eli(LayoutDocManager::instance().docEntries(part));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(part))
{
- if (lde->kind()==LayoutDocEntry::MemberDef)
+ auto kind = lde->kind();
+ if (kind==LayoutDocEntry::MemberDef)
{
- LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
+ const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get();
MemberList *ml = def->getMemberList(lmd->type);
if (ml)
{
- MemberListIterator mi(*ml);
- MemberDef *md;
- for (mi.toFirst();(md=mi.current());++mi)
+ for (const auto &md : *ml)
{
if (memberVisibleInIndex(md))
{
@@ -391,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())
@@ -402,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();
@@ -459,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());
@@ -490,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)
{
@@ -538,9 +556,7 @@ static bool dirHasVisibleChildren(const DirDef *dd)
{
if (dd->hasDocumentation()) return TRUE;
- QListIterator<FileDef> fli(*dd->getFiles());
- FileDef *fd;
- for (fli.toFirst();(fd=fli.current());++fli)
+ for (const auto &fd : dd->getFiles())
{
bool genSourceFile;
if (fileVisibleInIndex(fd,genSourceFile))
@@ -570,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;
}
@@ -581,20 +597,20 @@ static void writeDirTreeNode(OutputList &ol, const DirDef *dd, int level, FTVHel
}
static bool tocExpand = TRUE; //Config_getBool(TOC_EXPAND);
- bool isDir = dd->subDirs().size()>0 || // there are subdirs
+ bool isDir = !dd->subDirs().empty() || // there are subdirs
(tocExpand && // or toc expand and
- dd->getFiles() && dd->getFiles()->count()>0 // there are files
+ !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();
}
@@ -620,13 +636,10 @@ static void writeDirTreeNode(OutputList &ol, const DirDef *dd, int level, FTVHel
endIndexHierarchy(ol,level+1);
}
- FileList *fileList=dd->getFiles();
int fileCount=0;
- if (fileList && fileList->count()>0)
+ if (!dd->getFiles().empty())
{
- QListIterator<FileDef> it(*fileList);
- FileDef *fd;
- for (;(fd=it.current());++it)
+ for (const auto &fd : dd->getFiles())
{
//static bool allExternals = Config_getBool(ALLEXTERNALS);
//if ((allExternals && fd->isLinkable()) || fd->isLinkableInProject())
@@ -646,7 +659,7 @@ static void writeDirTreeNode(OutputList &ol, const DirDef *dd, int level, FTVHel
if (fileCount>0)
{
startIndexHierarchy(ol,level+1);
- for (it.toFirst();(fd=it.current());++it)
+ for (const auto &fd : dd->getFiles())
{
bool doc,src;
doc = fileVisibleInIndex(fd,src);
@@ -669,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);
}
}
}
@@ -682,9 +695,7 @@ static void writeDirTreeNode(OutputList &ol, const DirDef *dd, int level, FTVHel
// write files of this directory
if (fileCount>0)
{
- QListIterator<FileDef> it(*fileList);
- FileDef *fd;
- for (;(fd=it.current());++it)
+ for (const auto &fd : dd->getFiles())
{
//static bool allExternals = Config_getBool(ALLEXTERNALS);
//if ((allExternals && fd->isLinkable()) || fd->isLinkableInProject())
@@ -692,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);
}
}
}
@@ -753,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());
}
}
}
@@ -790,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()
// );
@@ -828,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());
@@ -854,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)
@@ -955,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();
@@ -969,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();
@@ -1002,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;
}
@@ -1032,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();
@@ -1063,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();
@@ -1075,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();
@@ -1109,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;
}
@@ -1139,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();
@@ -1170,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();
@@ -1182,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();
@@ -1216,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;
}
@@ -1246,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();
@@ -1288,9 +1297,9 @@ static void countFiles(int &htmlFiles,int &files)
}
}
-static void writeSingleFileIndex(OutputList &ol,FileDef *fd)
+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();
@@ -1299,7 +1308,7 @@ static void writeSingleFileIndex(OutputList &ol,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())
@@ -1312,7 +1321,7 @@ static void writeSingleFileIndex(OutputList &ol,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());
@@ -1325,7 +1334,7 @@ static void writeSingleFileIndex(OutputList &ol,FileDef *fd)
ol.endBold();
//if (addToIndex)
//{
- // Doxygen::indexList->addContentsItem(FALSE,fullName,0,0,0);
+ // Doxygen::indexList->addContentsItem(FALSE,fullName,QCString(),QCString(),QCString());
//}
}
if (src)
@@ -1333,7 +1342,7 @@ static void writeSingleFileIndex(OutputList &ol,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("]");
@@ -1352,7 +1361,7 @@ static void writeSingleFileIndex(OutputList &ol,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)
@@ -1381,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();
}
@@ -1409,12 +1418,12 @@ static void writeFileIndex(OutputList &ol)
ol.pushGeneratorState();
ol.disable(OutputGenerator::Html);
- OutputNameDict outputNameDict(1009);
- OutputNameList outputNameList;
- outputNameList.setAutoDelete(TRUE);
-
+ ol.startIndexList();
if (Config_getBool(FULL_PATH_NAMES))
{
+ std::unordered_map<std::string,size_t> pathMap;
+ std::vector<FilesInDir> outputFiles;
+
// re-sort input files in (dir,file) output order instead of (file,dir) input order
for (const auto &fn : *Doxygen::inputNameLinkedMap)
{
@@ -1422,36 +1431,33 @@ static void writeFileIndex(OutputList &ol)
{
QCString path=fd->getPath();
if (path.isEmpty()) path="[external]";
- FileList *fl = outputNameDict.find(path);
- if (fl)
+ auto it = pathMap.find(path.str());
+ if (it!=pathMap.end()) // existing path -> append
{
- fl->append(fd.get());
- //printf("+ inserting %s---%s\n",fd->getPath().data(),fd->name().data());
+ outputFiles.at(it->second).files.push_back(fd.get());
}
- else
+ else // new path -> create path entry + append
{
- //printf("o inserting %s---%s\n",fd->getPath().data(),fd->name().data());
- fl = new FileList(path);
- fl->append(fd.get());
- outputNameList.append(fl);
- outputNameDict.insert(path,fl);
+ pathMap.insert(std::make_pair(path.str(),outputFiles.size()));
+ outputFiles.emplace_back(path);
+ outputFiles.back().files.push_back(fd.get());
}
}
}
- }
- ol.startIndexList();
- if (Config_getBool(FULL_PATH_NAMES))
- {
- outputNameList.sort();
- QListIterator<FileList> fnli(outputNameList);
- FileList *fl;
- for (fnli.toFirst();(fl=fnli.current());++fnli)
+ // sort the files by path
+ std::sort(outputFiles.begin(),
+ outputFiles.end(),
+ [](const auto &fp1,const auto &fp2) { return qstricmp(fp1.path,fp2.path)<0; });
+ // sort the files inside the directory by name
+ for (auto &fp : outputFiles)
+ {
+ std::sort(fp.files.begin(), fp.files.end(), compareFileDefs);
+ }
+ // write the results
+ for (const auto &fp : outputFiles)
{
- fl->sort();
- QListIterator<FileDef> it(*fl);
- FileDef *fd;
- for (;(fd=it.current());++it)
+ for (const auto &fd : fp.files)
{
writeSingleFileIndex(ol,fd);
}
@@ -1461,7 +1467,7 @@ static void writeFileIndex(OutputList &ol)
{
for (const auto &fn : *Doxygen::inputNameLinkedMap)
{
- for (const auto &fd : *fn)
+ for (const auto &fd : *fn)
{
writeSingleFileIndex(ol,fd.get());
}
@@ -1480,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();
@@ -1510,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; }
@@ -1533,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);
}
}
@@ -1559,7 +1576,8 @@ static void writeClassTree(const ListType &cl,FTVHelp *ftv,bool addToIndex,bool
{
ftv->addContentsItem(count>0,cd->displayName(FALSE),cd->getReference(),
cd->getOutputFileBase(),cd->anchor(),FALSE,TRUE,cd);
- if ((cd->getOuterScope()==0 ||
+ if (addToIndex &&
+ (cd->getOuterScope()==0 ||
cd->getOuterScope()->definitionType()!=Definition::TypeClass
)
)
@@ -1567,7 +1585,7 @@ static void writeClassTree(const ListType &cl,FTVHelp *ftv,bool addToIndex,bool
addMembersToIndex(cd,LayoutDocManager::Class,
cd->displayName(FALSE),
cd->anchor(),
- addToIndex && cd->partOfGroups().empty() && !cd->isSimple());
+ cd->partOfGroups().empty() && !cd->isSimple());
}
if (count>0)
{
@@ -1583,19 +1601,15 @@ static void writeClassTree(const ListType &cl,FTVHelp *ftv,bool addToIndex,bool
static int countVisibleMembers(const NamespaceDef *nd)
{
int count=0;
- QListIterator<LayoutDocEntry> eli(LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
{
if (lde->kind()==LayoutDocEntry::MemberDef)
{
- LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
+ const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get();
MemberList *ml = nd->getMemberList(lmd->type);
if (ml)
{
- MemberListIterator mi(*ml);
- MemberDef *md;
- for (mi.toFirst();(md=mi.current());++mi)
+ for (const auto &md : *ml)
{
if (memberVisibleInIndex(md))
{
@@ -1610,21 +1624,17 @@ static int countVisibleMembers(const NamespaceDef *nd)
static void writeNamespaceMembers(const NamespaceDef *nd,bool addToIndex)
{
- QListIterator<LayoutDocEntry> eli(LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
{
if (lde->kind()==LayoutDocEntry::MemberDef)
{
- LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
+ const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get();
MemberList *ml = nd->getMemberList(lmd->type);
if (ml)
{
- MemberListIterator mi(*ml);
- MemberDef *md;
- for (mi.toFirst();(md=mi.current());++mi)
+ 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);
@@ -1635,6 +1645,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);
@@ -1646,11 +1657,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;
@@ -1667,25 +1679,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);
+ writeClassTree(nd->getClasses(),ftv,addToIndex,FALSE,ClassDef::Class);
+ writeConceptList(nd->getConcepts(),ftv,addToIndex);
writeNamespaceMembers(nd,addToIndex);
ftv->decContentsDepth();
}
@@ -1728,7 +1739,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;
@@ -1744,7 +1755,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)
{
@@ -1818,10 +1829,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)));
@@ -1848,11 +1859,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();
@@ -1867,7 +1878,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)
@@ -1891,15 +1902,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)
{
@@ -1982,10 +1992,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);
@@ -1997,7 +2007,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)
@@ -2020,10 +2030,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))
@@ -2086,13 +2096,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));
}
}
}
@@ -2105,9 +2114,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);
@@ -2126,12 +2135,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());
@@ -2139,8 +2149,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() })));
}
}
}
@@ -2206,7 +2215,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
{
@@ -2234,15 +2243,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();
@@ -2263,15 +2272,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();
@@ -2292,15 +2301,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();
@@ -2321,15 +2330,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();
@@ -2384,11 +2393,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();
@@ -2417,16 +2426,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();
@@ -2497,7 +2505,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();
@@ -2511,7 +2519,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();
@@ -2525,7 +2533,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();
@@ -2546,7 +2554,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
@@ -2587,7 +2595,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))) &&
@@ -2668,9 +2676,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" ||
@@ -2746,9 +2755,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);
@@ -2813,9 +2823,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);
@@ -2930,7 +2941,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;
};
@@ -2980,8 +2991,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();
}
@@ -2992,23 +3003,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))
{
@@ -3029,7 +3040,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);
}
}
@@ -3083,7 +3094,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);
@@ -3107,7 +3118,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;
};
@@ -3157,8 +3168,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();
}
@@ -3169,23 +3180,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);
@@ -3254,7 +3265,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);
@@ -3278,7 +3289,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;
};
@@ -3331,8 +3342,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();
}
@@ -3343,23 +3354,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);
@@ -3428,7 +3439,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);
@@ -3461,17 +3472,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();
}
@@ -3486,18 +3497,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()),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();
@@ -3540,14 +3551,14 @@ static bool mainPageHasOwnTitle()
QCString title;
if (Doxygen::mainPage)
{
- title = filterTitle(Doxygen::mainPage->title());
+ title = filterTitle(Doxygen::mainPage->title().str());
}
return !projectName.isEmpty() && mainPageHasTitle() && qstricmp(title,projectName)!=0;
}
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;
@@ -3562,22 +3573,22 @@ static void writePages(const PageDef *pd,FTVHelp *ftv)
if (pd->title().isEmpty())
pageTitle=pd->name();
else
- pageTitle=filterTitle(pd->title());
+ pageTitle=filterTitle(pd->title().str());
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();
@@ -3600,7 +3611,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()));
}
//----------------------------------------------------------------------------
@@ -3612,10 +3623,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());
@@ -3633,10 +3644,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;
}
@@ -3699,10 +3709,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>");
@@ -3711,11 +3721,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
@@ -3739,7 +3749,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;
}
@@ -3752,7 +3762,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();
@@ -3763,27 +3773,28 @@ static void writeGroupTreeNode(OutputList &ol, const GroupDef *gd, int level, FT
{
if (ml->listType()&MemberListType_documentationLists)
{
- numSubItems += ml->count();
+ numSubItems += ml->size();
}
}
numSubItems += gd->getNamespaces().size();
numSubItems += gd->getClasses().size();
- numSubItems += gd->getFiles()->count();
+ 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();
}
@@ -3804,39 +3815,33 @@ static void writeGroupTreeNode(OutputList &ol, const GroupDef *gd, int level, FT
ol.endTypewriter();
}
- QListIterator<LayoutDocEntry> eli(LayoutDocManager::instance().docEntries(LayoutDocManager::Group));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Group))
{
if (lde->kind()==LayoutDocEntry::MemberDef && addToIndex)
{
- LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
+ const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get();
MemberList *ml = gd->getMemberList(lmd->type);
if (ml)
{
- MemberListIterator mi(*ml);
- MemberDef *md;
- for (mi.toFirst();(md=mi.current());++mi)
+ for (const auto &md : *ml)
{
- const MemberList *enumList = md->enumFieldList();
- isDir = enumList!=0 && md->isEnumerate();
+ const MemberList &enumList = md->enumFieldList();
+ isDir = !enumList.empty() && md->isEnumerate();
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)
{
Doxygen::indexList->incContentsDepth();
- MemberListIterator emli(*enumList);
- MemberDef *emd;
- for (emli.toFirst();(emd=emli.current());++emli)
+ for (const auto &emd : enumList)
{
if (emd->isVisible())
{
Doxygen::indexList->addContentsItem(FALSE,
- emd->name(),emd->getReference(),emd->getOutputFileBase(),
+ emd->qualifiedName(),emd->getReference(),emd->getOutputFileBase(),
emd->anchor(),FALSE,addToIndex);
}
}
@@ -3852,21 +3857,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);
}
}
}
@@ -3877,22 +3876,32 @@ 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);
}
}
}
else if (lde->kind()==LayoutDocEntry::GroupFiles && addToIndex)
{
- QListIterator<FileDef> it(*gd->getFiles());
- FileDef *fd;
- for (;(fd=it.current());++it)
+ for (const auto &fd : gd->getFiles())
{
if (fd->isVisible())
{
Doxygen::indexList->addContentsItem(FALSE,
fd->displayName(),fd->getReference(),
- fd->getOutputFileBase(),0,FALSE,FALSE);
+ fd->getOutputFileBase(),QCString(),FALSE,FALSE);
}
}
}
@@ -3904,7 +3913,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);
}
}
}
@@ -3921,7 +3930,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)
@@ -3999,10 +4008,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());
@@ -4032,16 +4041,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)
{
@@ -4058,28 +4066,231 @@ 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();
- QListIterator<LayoutNavEntry> li(lne->children());
- LayoutNavEntry *entry;
int count=0;
- for (li.toFirst();(entry=li.current());++li)
+ for (const auto &entry: lne->children())
{
if (entry->visible()) count++;
}
if (count>0)
{
ol.writeString("<ul>\n");
- for (li.toFirst();(entry=li.current());++li)
+ for (const auto &entry: lne->children())
{
if (entry->visible())
{
@@ -4117,7 +4328,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;
@@ -4128,11 +4339,11 @@ static void writeIndex(OutputList &ol)
}
else if (Doxygen::mainPage)
{
- title = filterTitle(Doxygen::mainPage->title());
+ title = filterTitle(Doxygen::mainPage->title().str());
}
QCString indexName="index";
- ol.startFile(indexName,0,title);
+ ol.startFile(indexName,QCString(),title);
if (Doxygen::mainPage)
{
@@ -4140,7 +4351,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())
{
@@ -4151,7 +4362,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);
@@ -4174,10 +4385,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;
}
}
@@ -4186,21 +4397,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)
@@ -4214,7 +4425,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();
@@ -4231,7 +4442,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);
@@ -4249,7 +4460,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);
@@ -4308,7 +4519,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;
@@ -4342,6 +4553,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);
@@ -4413,6 +4630,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);
@@ -4456,12 +4679,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);
@@ -4472,26 +4695,24 @@ static void writeIndex(OutputList &ol)
ol.popGeneratorState();
}
-static QArray<bool> indexWritten;
+static std::vector<bool> indexWritten;
-static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry> &entries)
+static void writeIndexHierarchyEntries(OutputList &ol,const LayoutNavEntryList &entries)
{
static bool sliceOpt = Config_getBool(OPTIMIZE_OUTPUT_SLICE);
- QListIterator<LayoutNavEntry> li(entries);
- LayoutNavEntry *lne;
- for (li.toFirst();(lne=li.current());++li)
+ for (const auto &lne : entries)
{
LayoutNavEntry::Kind kind = lne->kind();
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))
@@ -4517,11 +4738,11 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry
{
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;
}
- if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Namespaces)!=lne) // for backward compatibility with old layout file
+ if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Namespaces)!=lne.get()) // for backward compatibility with old layout file
{
msg("Generating namespace index...\n");
writeNamespaceIndex(ol);
@@ -4546,16 +4767,20 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry
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;
}
- if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Classes)!=lne) // for backward compatibility with old layout file
+ if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Classes)!=lne.get()) // for backward compatibility with old layout file
{
msg("Generating annotated compound index...\n");
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);
@@ -4583,7 +4808,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry
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;
}
@@ -4617,7 +4842,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry
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;
}
@@ -4639,7 +4864,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry
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;
}
@@ -4677,11 +4902,11 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry
{
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;
}
- if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Files)!=lne) // for backward compatibility with old layout file
+ if (LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Files)!=lne.get()) // for backward compatibility with old layout file
{
msg("Generating file index...\n");
writeFileIndex(ol);
@@ -4717,7 +4942,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry
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:
@@ -4728,7 +4953,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry
{
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
{
@@ -4738,17 +4963,17 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry
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;
}
- writeUserGroupStubPage(ol,lne);
+ writeUserGroupStubPage(ol,lne.get());
break;
case LayoutNavEntry::None:
assert(kind != LayoutNavEntry::None); // should never happen, means not properly initialized
@@ -4774,7 +4999,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry
break;
}
}
- //printf("ending %s kind=%d\n",lne->title().data(),lne->kind());
+ //printf("ending %s kind=%d\n",qPrint(lne->title()),lne->kind());
}
}
@@ -4793,6 +5018,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;
@@ -4821,7 +5047,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))
@@ -4838,8 +5064,8 @@ void renderMemberIndicesAsJs(FTextStream &t,
t << "children:[";
firstMember=FALSE;
}
- t << endl << "{text:\"" << convertToJSString(getInfo(i)->title) << "\",url:\""
- << convertToJSString(getInfo(i)->fname+Doxygen::htmlFileExtension, false) << "\"";
+ 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...
// quick alphabetical index
@@ -4851,14 +5077,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;
@@ -4867,7 +5093,7 @@ void renderMemberIndicesAsJs(FTextStream &t,
else // other pages of multi page index
anchor=fullName+"_"+is+extension+"#index_";
t << "{text:\"" << convertToJSString(ci) << "\",url:\""
- << convertToJSString(anchor+convertToId(is), false) << "\"}";
+ << convertToJSString(anchor+convertToId(is)) << "\"}";
firstLetter=FALSE;
}
t << "]";
@@ -4881,12 +5107,10 @@ void renderMemberIndicesAsJs(FTextStream &t,
}
}
-static bool renderQuickLinksAsJs(FTextStream &t,LayoutNavEntry *root,bool first)
+static bool renderQuickLinksAsJs(std::ostream &t,LayoutNavEntry *root,bool first)
{
- QListIterator<LayoutNavEntry> li(root->children());
- LayoutNavEntry *entry;
int count=0;
- for (li.toFirst();(entry=li.current());++li)
+ for (const auto &entry : root->children())
{
if (entry->visible() && quickLinkVisible(entry->kind())) count++;
}
@@ -4894,16 +5118,16 @@ static bool renderQuickLinksAsJs(FTextStream &t,LayoutNavEntry *root,bool first)
{
bool firstChild = TRUE;
if (!first) t << ",";
- t << "children:[" << endl;
- for (li.toFirst();(entry=li.current());++li)
+ 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:\""
- << convertToJSString(url, false) << "\"";
+ << convertToJSString(url) << "\"";
bool hasChildren=FALSE;
if (entry->kind()==LayoutNavEntry::NamespaceMembers)
{
@@ -4922,7 +5146,7 @@ static bool renderQuickLinksAsJs(FTextStream &t,LayoutNavEntry *root,bool first)
}
else // recursive into child list
{
- hasChildren = renderQuickLinksAsJs(t,entry,FALSE);
+ hasChildren = renderQuickLinksAsJs(t,entry.get(),FALSE);
}
if (hasChildren) t << "]";
t << "}";
@@ -4936,16 +5160,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 5088c46..a10cbc9 100644
--- a/src/index.h
+++ b/src/index.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
@@ -19,14 +17,15 @@
#define INDEX_H
#include <utility>
-#include <qlist.h>
-#include <qcstring.h>
+#include <vector>
+#include <memory>
+
+#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.
@@ -55,7 +54,7 @@ class IndexIntf
class IndexList : public IndexIntf
{
private:
- QList<IndexIntf> m_intfs;
+ std::vector< std::unique_ptr<IndexIntf> > m_intfs;
// For each index format we forward the method call.
// We use C++11 variadic templates and perfect forwarding to implement foreach() generically,
@@ -63,19 +62,21 @@ class IndexList : public IndexIntf
template<class... Ts,class... As>
void foreach(void (IndexIntf::*methodPtr)(Ts...),As&&... args)
{
- QListIterator<IndexIntf> li(m_intfs);
- for (li.toFirst();li.current();++li)
+ for (const auto &intf : m_intfs)
{
- (li.current()->*methodPtr)(std::forward<As>(args)...);
+ (intf.get()->*methodPtr)(std::forward<As>(args)...);
}
}
public:
/** Creates a list of indexes */
- IndexList() { m_intfs.setAutoDelete(TRUE); m_enabled=TRUE; }
- /** Add an index generator to the list */
- void addIndex(IndexIntf *intf)
- { m_intfs.append(intf); }
+ IndexList() { m_enabled=TRUE; }
+
+ /** Add an index generator to the list, using a syntax similar to std::make_unique<T>() */
+ template<class T,class... As>
+ void addIndex(As&&... args)
+ { m_intfs.push_back(std::make_unique<T>(std::forward<As>(args)...)); }
+
void disable()
{ m_enabled = FALSE; }
void enable()
@@ -92,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:
@@ -118,6 +119,7 @@ enum IndexSections
isModuleIndex,
isDirIndex,
isNamespaceIndex,
+ isConceptIndex,
isClassHierarchyIndex,
isCompoundIndex,
isFileIndex,
@@ -126,6 +128,7 @@ enum IndexSections
isDirDocumentation,
isNamespaceDocumentation,
isClassDocumentation,
+ isConceptDocumentation,
isFileDocumentation,
isExampleDocumentation,
isPageDocumentation,
@@ -144,6 +147,7 @@ enum HighlightedItem
HLI_InterfaceHierarchy,
HLI_ExceptionHierarchy,
HLI_Classes,
+ HLI_Concepts,
HLI_Interfaces,
HLI_Structs,
HLI_Exceptions,
@@ -161,6 +165,7 @@ enum HighlightedItem
HLI_UserGroup,
HLI_ClassVisible,
+ HLI_ConceptVisible,
HLI_InterfaceVisible,
HLI_StructVisible,
HLI_ExceptionVisible,
@@ -237,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];
@@ -245,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 e6c9363..589cb0b 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)
{
@@ -140,11 +143,9 @@ static void visitPostEnd(FTextStream &t, bool hasCaption, bool inlineImage = FAL
}
-static void visitCaption(LatexDocVisitor *parent, QList<DocNode> children)
+static void visitCaption(LatexDocVisitor *parent, const DocNodeList &children)
{
- QListIterator<DocNode> cli(children);
- DocNode *n;
- for (cli.toFirst();(n=cli.current());++cli) n->accept(parent);
+ for (const auto &n : children) n->accept(parent);
}
QCString LatexDocVisitor::escapeMakeIndexChars(const char *s)
@@ -175,13 +176,12 @@ 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)
{
- m_tableStateStack.setAutoDelete(TRUE);
}
//--------------------------------------
@@ -378,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;
@@ -406,32 +406,33 @@ 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;
case DocVerbatim::PlantUML:
{
QCString latexOutput = Config_getString(LATEX_OUTPUT);
- QCString baseName = PlantumlManager::instance()->writePlantUMLSource(latexOutput,s->exampleFile(),s->text(),PlantumlManager::PUML_EPS);
+ QCString baseName = PlantumlManager::instance().writePlantUMLSource(latexOutput,s->exampleFile(),s->text(),PlantumlManager::PUML_EPS);
writePlantUMLFile(baseName, s);
}
@@ -442,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";
}
}
@@ -459,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,
@@ -524,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(),
@@ -555,11 +556,11 @@ 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");
- pushEnabled();
+ pushHidden(m_hide);
m_hide = TRUE;
}
QCString locLangExt = getFileNameExtension(op->includeFileName());
@@ -567,14 +568,14 @@ void LatexDocVisitor::visit(DocIncOperator *op)
SrcLangExt langExt = getLanguageFromFileName(locLangExt);
if (op->type()!=DocIncOperator::Skip)
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide)
{
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,
@@ -588,17 +589,17 @@ void LatexDocVisitor::visit(DocIncOperator *op)
);
if (fd) delete fd;
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
if (op->isLast())
{
- popEnabled();
+ m_hide=popHidden();
if (!m_hide) m_ci.endCodeFragment("DoxyCodeInclude");
}
else
{
- if (!m_hide) m_t << endl;
+ if (!m_hide) m_t << "\n";
}
}
@@ -705,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 *)
@@ -876,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 *)
@@ -903,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 *)
@@ -915,7 +916,53 @@ void LatexDocVisitor::visitPre(DocHtmlList *s)
{
if (m_hide) return;
if (s->type()==DocHtmlList::Ordered)
+ {
+ bool first = true;
m_t << "\n\\begin{DoxyEnumerate}";
+ for (const auto &opt : s->attribs())
+ {
+ if (opt.name=="type")
+ {
+ if (opt.value=="1")
+ {
+ m_t << (first ? "[": ",");
+ m_t << "label=\\arabic*";
+ first = false;
+ }
+ else if (opt.value=="a")
+ {
+ m_t << (first ? "[": ",");
+ m_t << "label=\\enumalphalphcnt*";
+ first = false;
+ }
+ else if (opt.value=="A")
+ {
+ m_t << (first ? "[": ",");
+ m_t << "label=\\enumAlphAlphcnt*";
+ first = false;
+ }
+ else if (opt.value=="i")
+ {
+ m_t << (first ? "[": ",");
+ m_t << "label=\\roman*";
+ first = false;
+ }
+ else if (opt.value=="I")
+ {
+ m_t << (first ? "[": ",");
+ m_t << "label=\\Roman*";
+ first = false;
+ }
+ }
+ else if (opt.name=="start")
+ {
+ m_t << (first ? "[": ",");
+ m_t << "start=" << opt.value;
+ first = false;
+ }
+ }
+ if (!first) m_t << "]\n";
+ }
else
m_t << "\n\\begin{DoxyItemize}";
}
@@ -948,23 +995,36 @@ void LatexDocVisitor::visitPost(DocHtmlListItem *)
//void LatexDocVisitor::visitPost(DocHtmlPre *)
//{
// m_insidePre=FALSE;
-// m_t << "\\end{alltt}\\normalsize " << endl;
+// m_t << "\\end{alltt}\\normalsize \n";
//}
+
+static bool classEqualsReflist(const DocNode *n)
+{
+ if (n->kind()==DocNode::Kind_HtmlDescList)
+ {
+ HtmlAttribList attrs = ((DocHtmlDescList *)n)->attribs();
+ auto it = std::find_if(attrs.begin(),attrs.end(),
+ [](const auto &att) { return att.name=="class"; });
+ if (it!=attrs.end() && it->value == "reflist") return true;
+ }
+ return false;
+}
+
+
static bool listIsNested(const DocNode *n)
{
bool isNested=false;
if (n)
{
- if (n->kind()==DocNode::Kind_HtmlDescList && ((DocHtmlDescList *)n)->attribs().find("class") == "reflist") return false;
+ if (classEqualsReflist(n)) return false;
n = n->parent();
}
while (n && !isNested)
{
if (n->kind()==DocNode::Kind_HtmlDescList)
{
- QCString val = ((DocHtmlDescList *)n)->attribs().find("class");
- isNested = (val!="reflist");
+ isNested = !classEqualsReflist(n);
}
n = n->parent();
}
@@ -974,8 +1034,7 @@ static bool listIsNested(const DocNode *n)
void LatexDocVisitor::visitPre(DocHtmlDescList *dl)
{
if (m_hide) return;
- QCString val = dl->attribs().find("class");
- if (val=="reflist")
+ if (classEqualsReflist(dl))
{
m_t << "\n\\begin{DoxyRefList}";
}
@@ -989,8 +1048,7 @@ void LatexDocVisitor::visitPre(DocHtmlDescList *dl)
void LatexDocVisitor::visitPost(DocHtmlDescList *dl)
{
if (m_hide) return;
- QCString val = dl->attribs().find("class");
- if (val=="reflist")
+ if (classEqualsReflist(dl))
{
m_t << "\n\\end{DoxyRefList}";
}
@@ -1033,7 +1091,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))
{
@@ -1046,7 +1104,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))
{
@@ -1072,10 +1130,10 @@ void LatexDocVisitor::visitPre(DocHtmlTable *t)
m_t << "\\hypertarget{" << stripPath(c->file()) << "_" << c->anchor()
<< "}{}";
}
- m_t << endl;
+ m_t << "\n";
}
- writeStartTableCommand(m_t,t->parent(),t->numColumns());
+ writeStartTableCommand(m_t,t->parent(),(uint)t->numColumns());
if (t->hasCaption())
{
@@ -1087,7 +1145,7 @@ void LatexDocVisitor::visitPre(DocHtmlTable *t)
m_t << "\\\\\n";
}
- setNumCols(t->numColumns());
+ setNumCols((uint)t->numColumns());
m_t << "\\hline\n";
// check if first row is a heading and then render the row already here
@@ -1135,20 +1193,18 @@ void LatexDocVisitor::visitPost(DocHtmlRow *row)
int c=currentColumn();
while (c<=numCols()) // end of row while inside a row span?
{
- uint i;
- for (i=0;i<rowSpans().count();i++)
+ for (const auto &span : rowSpans())
{
- ActiveRowSpan *span = rowSpans().at(i);
//printf(" found row span: column=%d rs=%d cs=%d rowIdx=%d cell->rowIdx=%d i=%d c=%d\n",
// span->column, span->rowSpan,span->colSpan,row->rowIndex(),span->cell->rowIndex(),i,c);
- if (span->rowSpan>0 && span->column==c && // we are at a cell in a row span
- row->rowIndex()>span->cell->rowIndex() // but not the row that started the span
+ if (span.rowSpan>0 && span.column==c && // we are at a cell in a row span
+ row->rowIndex()>span.cell->rowIndex() // but not the row that started the span
)
{
m_t << "&";
- if (span->colSpan>1) // row span is also part of a column span
+ if (span.colSpan>1) // row span is also part of a column span
{
- m_t << "\\multicolumn{" << span->colSpan << "}{";
+ m_t << "\\multicolumn{" << span.colSpan << "}{";
m_t << "}|}{}";
}
else // solitary row span
@@ -1163,23 +1219,21 @@ void LatexDocVisitor::visitPost(DocHtmlRow *row)
m_t << "\\\\";
int col = 1;
- uint i;
- for (i=0;i<rowSpans().count();i++)
+ for (auto &span : rowSpans())
{
- ActiveRowSpan *span = rowSpans().at(i);
- if (span->rowSpan>0) span->rowSpan--;
- if (span->rowSpan<=0)
+ if (span.rowSpan>0) span.rowSpan--;
+ if (span.rowSpan<=0)
{
// inactive span
}
- else if (span->column>col)
+ else if (span.column>col)
{
- m_t << "\\cline{" << col << "-" << (span->column-1) << "}";
- col = span->column+span->colSpan;
+ m_t << "\\cline{" << col << "-" << (span.column-1) << "}";
+ col = span.column+span.colSpan;
}
else
{
- col = span->column+span->colSpan;
+ col = span.column+span.colSpan;
}
}
@@ -1195,14 +1249,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";
}
}
}
@@ -1220,21 +1274,19 @@ void LatexDocVisitor::visitPre(DocHtmlCell *c)
setCurrentColumn(currentColumn()+1);
//Skip columns that span from above.
- uint i;
- for (i=0;i<rowSpans().count();i++)
+ for (const auto &span : rowSpans())
{
- ActiveRowSpan *span = rowSpans().at(i);
- if (span->rowSpan>0 && span->column==currentColumn())
+ if (span.rowSpan>0 && span.column==currentColumn())
{
- if (row && span->colSpan>1)
+ if (row && span.colSpan>1)
{
- m_t << "\\multicolumn{" << span->colSpan << "}{";
+ m_t << "\\multicolumn{" << span.colSpan << "}{";
if (currentColumn() /*c->columnIndex()*/==1) // add extra | for first column
{
m_t << "|";
}
m_t << "l|}{" << (c->isHeading()? "\\columncolor{\\tableheadbgcolor}" : "") << "}"; // alignment not relevant, empty column
- setCurrentColumn(currentColumn()+span->colSpan);
+ setCurrentColumn(currentColumn()+span.colSpan);
}
else
{
@@ -1274,7 +1326,7 @@ void LatexDocVisitor::visitPre(DocHtmlCell *c)
//printf("adding row span: cell={r=%d c=%d rs=%d cs=%d} curCol=%d\n",
// c->rowIndex(),c->columnIndex(),c->rowSpan(),c->colSpan(),
// currentColumn());
- addRowSpan(new ActiveRowSpan(c,rs,cs,currentColumn()));
+ addRowSpan(ActiveRowSpan(c,rs,cs,currentColumn()));
m_t << "\\multirow{" << rs << "}{*}{";
}
if (a==DocHtmlCell::Center)
@@ -1326,7 +1378,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)
@@ -1373,7 +1425,7 @@ void LatexDocVisitor::visitPre(DocImage *img)
}
else // other format -> skip
{
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
}
@@ -1387,7 +1439,7 @@ void LatexDocVisitor::visitPost(DocImage *img)
}
else // other format
{
- popEnabled();
+ m_hide = popHidden();
}
}
@@ -1444,7 +1496,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
{
@@ -1458,7 +1510,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
{
@@ -1485,23 +1537,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)
@@ -1601,42 +1653,36 @@ void LatexDocVisitor::visitPre(DocParamList *pl)
}
if (sect && sect->hasTypeSpecifier())
{
- QListIterator<DocNode> li(pl->paramTypes());
- DocNode *type;
- for (li.toFirst();(type=li.current());++li)
+ for (const auto &type : pl->paramTypes())
{
if (type->kind()==DocNode::Kind_Word)
{
- visit((DocWord*)type);
+ visit((DocWord*)type.get());
}
else if (type->kind()==DocNode::Kind_LinkedWord)
{
- visit((DocLinkedWord*)type);
+ visit((DocLinkedWord*)type.get());
}
else if (type->kind()==DocNode::Kind_Sep)
{
- m_t << " " << ((DocSeparator *)type)->chars() << " ";
+ m_t << " " << ((DocSeparator *)type.get())->chars() << " ";
}
}
if (useTable) m_t << " & ";
}
m_t << "{\\em ";
- //QStrListIterator li(pl->parameters());
- //const char *s;
- QListIterator<DocNode> li(pl->parameters());
- DocNode *param;
bool first=TRUE;
- for (li.toFirst();(param=li.current());++li)
+ for (const auto &param : pl->parameters())
{
if (!first) m_t << ","; else first=FALSE;
m_insideItem=TRUE;
if (param->kind()==DocNode::Kind_Word)
{
- visit((DocWord*)param);
+ visit((DocWord*)param.get());
}
else if (param->kind()==DocNode::Kind_LinkedWord)
{
- visit((DocLinkedWord*)param);
+ visit((DocLinkedWord*)param.get());
}
m_insideItem=FALSE;
}
@@ -1665,8 +1711,8 @@ void LatexDocVisitor::visitPost(DocParamList *pl)
parentType==DocParamSect::TemplateParam;
if (useTable)
{
- m_t << "\\\\" << endl
- << "\\hline" << endl;
+ m_t << "\\\\\n"
+ << "\\hline\n";
}
}
@@ -1677,7 +1723,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)
@@ -1702,19 +1748,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 *)
@@ -1728,13 +1774,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 *)
@@ -1757,7 +1803,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,
@@ -1821,19 +1867,6 @@ void LatexDocVisitor::endLink(const QCString &ref,const QCString &file,const QCS
}
}
-void LatexDocVisitor::pushEnabled()
-{
- m_enabled.push(new bool(m_hide));
-}
-
-void LatexDocVisitor::popEnabled()
-{
- bool *v=m_enabled.pop();
- ASSERT(v!=0);
- m_hide = *v;
- delete v;
-}
-
void LatexDocVisitor::startDotFile(const QCString &fileName,
const QCString &width,
const QCString &height,
@@ -1963,7 +1996,7 @@ void LatexDocVisitor::writePlantUMLFile(const QCString &baseName, DocVerbatim *s
shortName=shortName.right(shortName.length()-i-1);
}
QCString outDir = Config_getString(LATEX_OUTPUT);
- PlantumlManager::instance()->generatePlantUMLOutput(baseName,outDir,PlantumlManager::PUML_EPS);
+ PlantumlManager::instance().generatePlantUMLOutput(baseName,outDir,PlantumlManager::PUML_EPS);
visitPreStart(m_t, s->hasCaption(), shortName, s->width(), s->height());
visitCaption(this, s->children());
visitPostEnd(m_t, s->hasCaption());
diff --git a/src/latexdocvisitor.h b/src/latexdocvisitor.h
index 003d780..696147f 100644
--- a/src/latexdocvisitor.h
+++ b/src/latexdocvisitor.h
@@ -1,9 +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,20 +16,20 @@
#ifndef _LATEXDOCVISITOR_H
#define _LATEXDOCVISITOR_H
+#include <stack>
+
+#include "qcstring.h"
#include "docvisitor.h"
-#include <qstack.h>
-#include <qcstring.h>
-#include <qlist.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
@@ -149,13 +146,13 @@ class LatexDocVisitor : public DocVisitor
int column;
};
- typedef QList<ActiveRowSpan> RowSpanList;
+ typedef std::vector<ActiveRowSpan> RowSpanList;
//--------------------------------------
// 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,
@@ -176,97 +173,90 @@ class LatexDocVisitor : public DocVisitor
void writeDiaFile(const QCString &fileName, DocVerbatim *s);
void writePlantUMLFile(const QCString &fileName, DocVerbatim *s);
- void pushEnabled();
- void popEnabled();
-
//--------------------------------------
// state variables
//--------------------------------------
- FTextStream &m_t;
+ TextStream &m_t;
LatexCodeGenerator &m_ci;
bool m_insidePre;
bool m_insideItem;
bool m_hide;
bool m_hideCaption;
bool m_insideTabbing;
- QStack<bool> m_enabled;
QCString m_langExt;
struct TableState
{
- TableState() : numCols(0), currentColumn(0), inRowSpan(FALSE),
- inColSpan(FALSE), firstRow(FALSE)
- { rowSpans.setAutoDelete(TRUE); }
RowSpanList rowSpans;
- int numCols;
- int currentColumn;
- bool inRowSpan;
- bool inColSpan;
- bool firstRow;
+ int numCols = 0;
+ int currentColumn = 0;
+ bool inRowSpan = false;
+ bool inColSpan = false;
+ bool firstRow = false;
};
- QStack<TableState> m_tableStateStack; // needed for nested tables
+ std::stack<TableState> m_tableStateStack; // needed for nested tables
RowSpanList m_emptyRowSpanList;
void pushTableState()
{
- m_tableStateStack.push(new TableState);
+ m_tableStateStack.push(TableState());
}
void popTableState()
{
- delete m_tableStateStack.pop();
+ m_tableStateStack.pop();
}
int currentColumn() const
{
- return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->currentColumn : 0;
+ return !m_tableStateStack.empty() ? m_tableStateStack.top().currentColumn : 0;
}
void setCurrentColumn(int col)
{
- if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->currentColumn = col;
+ if (!m_tableStateStack.empty()) m_tableStateStack.top().currentColumn = col;
}
int numCols() const
{
- return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->numCols : 0;
+ return !m_tableStateStack.empty() ? m_tableStateStack.top().numCols : 0;
}
void setNumCols(int num)
{
- if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->numCols = num;
+ if (!m_tableStateStack.empty()) m_tableStateStack.top().numCols = num;
}
bool inRowSpan() const
{
- return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->inRowSpan : FALSE;
+ return !m_tableStateStack.empty() ? m_tableStateStack.top().inRowSpan : FALSE;
}
void setInRowSpan(bool b)
{
- if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->inRowSpan = b;
+ if (!m_tableStateStack.empty()) m_tableStateStack.top().inRowSpan = b;
}
bool inColSpan() const
{
- return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->inColSpan : FALSE;
+ return !m_tableStateStack.empty() ? m_tableStateStack.top().inColSpan : FALSE;
}
void setInColSpan(bool b)
{
- if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->inColSpan = b;
+ if (!m_tableStateStack.empty()) m_tableStateStack.top().inColSpan = b;
}
bool firstRow() const
{
- return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->firstRow : FALSE;
+ return !m_tableStateStack.empty() ? m_tableStateStack.top().firstRow : FALSE;
}
void setFirstRow(bool b)
{
- if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->firstRow = b;
+ if (!m_tableStateStack.empty()) m_tableStateStack.top().firstRow = b;
}
- const RowSpanList &rowSpans()
+ RowSpanList &rowSpans()
{
- return !m_tableStateStack.isEmpty() ? m_tableStateStack.top()->rowSpans : m_emptyRowSpanList;
+ return !m_tableStateStack.empty() ? m_tableStateStack.top().rowSpans : m_emptyRowSpanList;
}
- void addRowSpan(ActiveRowSpan *span)
+ void addRowSpan(ActiveRowSpan &&span)
{
- if (!m_tableStateStack.isEmpty()) m_tableStateStack.top()->rowSpans.append(span);
+ if (!m_tableStateStack.empty()) m_tableStateStack.top().rowSpans.push_back(std::move(span));
}
bool insideTable() const
{
- return !m_tableStateStack.isEmpty();
+ return !m_tableStateStack.empty();
}
};
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 5cac7e1..7c368be 100644
--- a/src/layout.cpp
+++ b/src/layout.cpp
@@ -16,9 +16,9 @@
*
*/
+#include <array>
+
#include <assert.h>
-#include <qfile.h>
-#include <qfileinfo.h>
#include "layout.h"
#include "message.h"
@@ -30,6 +30,7 @@
#include "config.h"
#include "xml.h"
#include "resourcemgr.h"
+#include "debug.h"
inline QCString compileOptions(const QCString &def)
{
@@ -91,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";
@@ -100,20 +101,18 @@ 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;
- QListIterator<LayoutNavEntry> li(m_children);
- LayoutNavEntry *entry;
- for (li.toFirst();(entry=li.current());++li)
+ for (const auto &entry : m_children)
{
// depth first search, needed to find the entry furthest from the
// root in case an entry is in the tree twice
result = entry->find(kind,file);
if (result) return result;
- if (entry->kind()==kind && (file==0 || entry->baseFile()==file))
+ if (entry->kind()==kind && (file==QCString() || entry->baseFile()==file))
{
- return entry;
+ return entry.get();
}
}
return result;
@@ -134,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())
{
@@ -151,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;
}
@@ -196,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)
{
@@ -215,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,
@@ -228,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,
@@ -320,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(),
@@ -511,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;
@@ -586,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);
@@ -974,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)
@@ -1017,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()
@@ -1136,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()
@@ -1256,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,
@@ -1441,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())
{
@@ -1451,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+"/")
@@ -1483,17 +1539,12 @@ int LayoutParser::m_userGroupCount=0;
class LayoutDocManager::Private
{
public:
- QList<LayoutDocEntry> docEntries[LayoutDocManager::NrParts];
+ std::array<LayoutDocEntryList,LayoutDocManager::NrParts> docEntries;
LayoutNavEntry *rootNav;
};
LayoutDocManager::LayoutDocManager() : d(std::make_unique<Private>())
{
- int i;
- for (i=0;i<LayoutDocManager::NrParts;i++)
- {
- d->docEntries[i].setAutoDelete(TRUE);
- }
d->rootNav = new LayoutNavEntry;
}
@@ -1508,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);
+ parser.parse("layout_default.xml",layout_default.data(),Debug::isFlagSet(Debug::Lex));
}
LayoutDocManager::~LayoutDocManager()
@@ -1522,7 +1573,7 @@ LayoutDocManager & LayoutDocManager::instance()
return *theInstance;
}
-const QList<LayoutDocEntry> &LayoutDocManager::docEntries(LayoutDocManager::LayoutPart part) const
+const LayoutDocEntryList &LayoutDocManager::docEntries(LayoutDocManager::LayoutPart part) const
{
return d->docEntries[(int)part];
}
@@ -1534,7 +1585,7 @@ LayoutNavEntry* LayoutDocManager::rootNavEntry() const
void LayoutDocManager::addEntry(LayoutDocManager::LayoutPart p,LayoutDocEntry *e)
{
- d->docEntries[(int)p].append(e);
+ d->docEntries[(int)p].push_back(std::unique_ptr<LayoutDocEntry>(e));
}
void LayoutDocManager::clear(LayoutDocManager::LayoutPart p)
@@ -1542,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;
@@ -1551,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));
+ 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 68d5c6e..04fdf52 100644
--- a/src/layout.h
+++ b/src/layout.h
@@ -20,12 +20,12 @@
#define LAYOUT_H
#include <memory>
-#include <qlist.h>
+#include <vector>
#include "types.h"
class LayoutParser;
+struct LayoutNavEntry;
class MemberList;
-class QTextStream;
/** @brief Base class representing a piece of a documentation page */
struct LayoutDocEntry
@@ -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,
@@ -116,6 +119,8 @@ private:
QCString m_title;
};
+using LayoutNavEntryList = std::vector< std::unique_ptr<LayoutNavEntry> >;
+
/** @brief Base class for the layout of a navigation item at the top of the HTML pages. */
struct LayoutNavEntry
{
@@ -128,6 +133,7 @@ struct LayoutNavEntry
Namespaces,
NamespaceList,
NamespaceMembers,
+ Concepts,
Classes,
ClassList,
ClassIndex,
@@ -152,10 +158,13 @@ struct LayoutNavEntry
UserGroup
};
LayoutNavEntry(LayoutNavEntry *parent,Kind k,bool vs,const QCString &bf,
- const QCString &tl,const QCString &intro,bool prepend=FALSE)
+ const QCString &tl,const QCString &intro,bool prepend=false)
: m_parent(parent), m_kind(k), m_visible(vs), m_baseFile(bf), m_title(tl), m_intro(intro)
- { m_children.setAutoDelete(TRUE);
- if (parent) { if (prepend) parent->prependChild(this); else parent->addChild(this); }
+ {
+ if (parent)
+ {
+ if (prepend) parent->prependChild(this); else parent->addChild(this);
+ }
}
LayoutNavEntry *parent() const { return m_parent; }
Kind kind() const { return m_kind; }
@@ -165,10 +174,10 @@ struct LayoutNavEntry
QCString url() const;
bool visible() { return m_visible; }
void clear() { m_children.clear(); }
- void addChild(LayoutNavEntry *e) { m_children.append(e); }
- void prependChild(LayoutNavEntry *e) { m_children.prepend(e); }
- const QList<LayoutNavEntry> &children() const { return m_children; }
- LayoutNavEntry *find(LayoutNavEntry::Kind k,const char *file=0) const;
+ 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 QCString &file=QCString()) const;
private:
LayoutNavEntry() : m_parent(0), m_kind(None), m_visible(FALSE) {}
@@ -178,10 +187,12 @@ struct LayoutNavEntry
QCString m_baseFile;
QCString m_title;
QCString m_intro;
- QList<LayoutNavEntry> m_children;
+ LayoutNavEntryList m_children;
friend class LayoutDocManager;
};
+using LayoutDocEntryList = std::vector< std::unique_ptr<LayoutDocEntry> >;
+
/** @brief Singleton providing access to the (user configurable) layout of the documentation */
class LayoutDocManager
{
@@ -189,20 +200,20 @@ class LayoutDocManager
public:
enum LayoutPart
{
- Class, Namespace, File, Group, Directory,
+ Class, Concept, Namespace, File, Group, Directory,
NrParts
};
/** Returns a reference to this singleton. */
static LayoutDocManager &instance();
/** Returns the list of LayoutDocEntry's in representation order for a given page identified by @a part. */
- const QList<LayoutDocEntry> &docEntries(LayoutPart part) const;
+ const LayoutDocEntryList &docEntries(LayoutPart part) const;
/** returns the (invisible) root of the navigation tree. */
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);
@@ -213,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
new file mode 100644
index 0000000..b64b691
--- /dev/null
+++ b/src/lexcode.h
@@ -0,0 +1,57 @@
+/******************************************************************************
+ *
+ * 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 LEXCODE_H
+#define LEXCODE_H
+
+#include "parserintf.h"
+
+class CodeOutputInterface;
+class FileDef;
+class MemberDef;
+class QCString;
+class Definition;
+
+/** LEX code scanner.
+ */
+class LexCodeParser : public CodeParserInterface
+{
+ public:
+ LexCodeParser();
+ virtual ~LexCodeParser();
+ void parseCode(CodeOutputInterface &codeOutIntf,
+ const QCString &scopeName,
+ const QCString &input,
+ SrcLangExt,
+ bool isExampleBlock,
+ const QCString &exampleName=QCString(),
+ FileDef *fileDef=0,
+ int startLine=-1,
+ int endLine=-1,
+ bool inlineFragment=FALSE,
+ const MemberDef *memberDef=0,
+ bool showLineNumbers=TRUE,
+ const Definition *searchCtx=0,
+ bool collectXRefs=TRUE
+ );
+ void resetCodeParserState();
+ private:
+ struct Private;
+ std::unique_ptr<Private> p;
+};
+
+
+#endif
diff --git a/src/lexcode.l b/src/lexcode.l
new file mode 100644
index 0000000..4cfb636
--- /dev/null
+++ b/src/lexcode.l
@@ -0,0 +1,1267 @@
+/******************************************************************************
+ *
+ * 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.
+ *
+ */
+
+%option never-interactive
+%option prefix="lexcodeYY"
+%option noyywrap
+%option reentrant
+%option extra-type="struct lexcodeYY_state *"
+%top{
+#include <stdint.h>
+}
+
+%{
+
+#include <stdio.h>
+
+#include "config.h"
+#include "doxygen.h"
+#include "outputgen.h"
+#include "code.h"
+#include "lexcode.h"
+#include "filedef.h"
+#include "message.h"
+
+#define YY_NEVER_INTERACTIVE 1
+#define YY_NO_INPUT 1
+#define YY_NO_UNISTD_H 1
+
+#define USE_STATE2STRING 0
+
+struct lexcodeYY_state
+{
+ CodeOutputInterface * code;
+ CCodeParser ccodeParser;
+ const char *inputString; //!< the code fragment as text
+ yy_size_t inputPosition; //!< read offset during parsing
+ int inputLines; //!< number of line in the code fragment
+ int yyLineNr; //!< current line number
+ bool needsTermination;
+
+ bool lineNumbers = FALSE;
+ const Definition *searchCtx;
+ bool collectXRefs = FALSE;
+
+ int lastContext = 0;
+ int lastCContext = 0;
+ int lastStringContext = 0;
+ int docBlockContext = 0;
+ int lastPreLineCtrlContext = 0;
+ int lastRawStringContext = 0;
+ int curlyCount = 0;
+
+ QCString rulesPatternBuffer;
+ QCString CCodeBuffer;
+ int startCCodeLine = -1;
+ int roundCount = 0;
+ bool insideCode = FALSE;
+ QCString delimiter;
+ QCString docBlockName;
+ uint fencedSize = 0;
+ bool nestedComment = false;
+
+ bool exampleBlock;
+ QCString exampleName;
+ QCString classScope;
+
+ FileDef *sourceFileDef;
+ const Definition *currentDefinition;
+ const MemberDef *currentMemberDef;
+ bool includeCodeFragment;
+ const char *currentFontClass;
+};
+
+#if USE_STATE2STRING
+static const char *stateToString(int state);
+#endif
+
+static void setCurrentDoc(yyscan_t yyscanner,const QCString &anchor);
+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 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);
+static void lineCount(yyscan_t yyscanner);
+static void handleCCode(yyscan_t yyscanner);
+
+#undef YY_INPUT
+#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
+
+%}
+
+nl (\r\n|\r|\n)
+ws [ \t]
+nws [^ \t\n]
+TopStart "%top{"{nl}
+TopEnd "}"{nl}
+LiteralStart "%{"{nl}
+LiteralEnd "%}"{nl}
+RulesStart "%%"{nl}
+RulesEnd "%%"{nl}
+RulesSharp "<"[^>\n]*">"
+RulesCurly "{"[^{}\n]*"}"
+StartSquare "["
+StartDouble "\""
+StartRound "("
+StartRoundQuest "(?"
+EscapeRulesCharOpen "\\["|"\\<"|"\\{"|"\\("|"\\\""|"\\ "|"\\\\"
+EscapeRulesCharClose "\\]"|"\\>"|"\\}"|"\\)"
+EscapeRulesChar {EscapeRulesCharOpen}|{EscapeRulesCharClose}
+
+CMD ("\\"|"@")
+BN [ \t\n\r]
+BL [ \t\r]*"\n"
+B [ \t]
+Bopt {B}*
+ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
+PRE [pP][rR][eE]
+CODE [cC][oO][dD][eE]
+RAWBEGIN (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"("
+RAWEND ")"[^ \t\(\)\\]{0,16}\"
+CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
+CHARCE "[:"[^:]*":]"
+
+ /* no comment start / end signs inside square brackets */
+NCOMM [^/\*]
+ // C start comment
+CCS "/\*"
+ // C end comment
+CCE "*\/"
+ // Cpp comment
+CPPC "/\/"
+ // doxygen start comment
+DCOMM ("/\*!"|"/\**"|"/\/!"|"/\/\/")
+
+ // Optional any character
+ANYopt .*
+ // Optional all but newline
+NONLopt [^\n]*
+
+%x DefSection
+%x DefSectionLine
+%x RulesSectionInit
+%x RulesPattern
+%x RulesDouble
+%x RulesRoundDouble
+%x RulesSquare
+%x RulesRoundSquare
+%x RulesRound
+%x RulesRoundQuest
+%x UserSection
+
+%x TopSection
+%x LiteralSection
+
+%x COMMENT
+
+%x SkipCurly
+%x SkipCurlyEndDoc
+%x PreLineCtrl
+%x DocLine
+%x DocBlock
+%x DocCopyBlock
+%x SkipString
+%x RawString
+%x SkipComment
+%x SkipCxxComment
+%x Comment
+
+%%
+
+<*>\x0d
+<DefSection>^{TopStart} {
+ handleCCode(yyscanner);
+ codifyLines(yyscanner,yytext);
+ yyextra->lastContext = YY_START;
+ yyextra->startCCodeLine=yyextra->yyLineNr;
+ BEGIN (TopSection);
+ }
+<DefSection>^{LiteralStart} {
+ handleCCode(yyscanner);
+ codifyLines(yyscanner,yytext);
+ yyextra->lastContext = YY_START;
+ yyextra->startCCodeLine=yyextra->yyLineNr;
+ BEGIN (LiteralSection);
+ }
+<TopSection>^{TopEnd} {
+ handleCCode(yyscanner);
+ codifyLines(yyscanner,yytext);
+ BEGIN( yyextra->lastContext ) ;
+ }
+<TopSection>.*{nl} {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->yyLineNr++;
+ }
+<LiteralSection>^{LiteralEnd} {
+ handleCCode(yyscanner);
+ codifyLines(yyscanner,yytext);
+ BEGIN( yyextra->lastContext ) ;
+ }
+<LiteralSection>.*{nl} {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->yyLineNr++;
+ }
+<DefSection>{CPPC}.*{nl} {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->yyLineNr++;
+ }
+<DefSection>^{ws}*{CCS} {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->lastContext = YY_START;
+ BEGIN(COMMENT);
+ }
+<COMMENT>{CCE}{ws}*{nl} {
+ yyextra->CCodeBuffer+=yytext;
+ yyextra->yyLineNr++;
+ handleCCode(yyscanner);
+ BEGIN(yyextra->lastContext);
+ }
+<COMMENT>{CCE} {
+ yyextra->CCodeBuffer+=yytext;
+ handleCCode(yyscanner);
+ BEGIN(yyextra->lastContext);
+ }
+<COMMENT>[^*\n]+ {
+ yyextra->CCodeBuffer += yytext;
+ }
+<COMMENT>{CPPC}|{CCS} {
+ yyextra->CCodeBuffer += yytext;
+ }
+<COMMENT>{nl} {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->yyLineNr++;
+ }
+<COMMENT>. {
+ yyextra->CCodeBuffer += yytext;
+ }
+<DefSection>^{nl} {
+ handleCCode(yyscanner);
+ codifyLines(yyscanner,yytext);
+ yyextra->startCCodeLine=yyextra->yyLineNr;
+ }
+<DefSection>^{ws}.*{nl} {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->yyLineNr++;
+ }
+<DefSection>^{RulesStart} {
+ handleCCode(yyscanner);
+ codifyLines(yyscanner,yytext);
+ yyextra->startCCodeLine=yyextra->yyLineNr;
+ BEGIN (RulesSectionInit);
+ }
+<DefSection>^{nws} {
+ handleCCode(yyscanner);
+ codifyLines(yyscanner,yytext);
+ BEGIN(DefSectionLine);
+ }
+<DefSectionLine>.*{nl} {
+ codifyLines(yyscanner,yytext);
+ yyextra->startCCodeLine=yyextra->yyLineNr;
+ BEGIN(DefSection);
+ }
+<RulesSectionInit,RulesPattern>^{RulesEnd} {
+ handleCCode(yyscanner);
+ codifyLines(yyscanner,yytext);
+ yyextra->startCCodeLine=yyextra->yyLineNr;
+ BEGIN (UserSection);
+ }
+<RulesSectionInit>^{nws} {
+ handleCCode(yyscanner);
+ unput(*yytext);
+ BEGIN(RulesPattern);
+ }
+<RulesSectionInit>{nl} {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->yyLineNr++;
+ }
+<RulesSectionInit>^{ws}.*{nl} {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->yyLineNr++;
+ }
+<RulesPattern>"<<EOF>>" {
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<RulesPattern>{EscapeRulesChar} {
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<RulesPattern>{RulesSharp} {
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<RulesPattern>{RulesCurly} {
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<RulesPattern>{StartDouble} {
+ yyextra->rulesPatternBuffer += yytext;
+ yyextra->lastContext = YY_START;
+ BEGIN(RulesDouble);
+ }
+<RulesDouble,RulesRoundDouble>"\\\\" {
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<RulesDouble,RulesRoundDouble>"\\\"" {
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<RulesDouble>"\"" {
+ yyextra->rulesPatternBuffer += yytext;
+ BEGIN( yyextra->lastContext ) ;
+ }
+<RulesRoundDouble>"\"" {
+ yyextra->rulesPatternBuffer += yytext;
+ BEGIN(RulesRound) ;
+ }
+<RulesDouble,RulesRoundDouble>. {
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<RulesPattern>{StartSquare} {
+ yyextra->rulesPatternBuffer += yytext;
+ yyextra->lastContext = YY_START;
+ BEGIN(RulesSquare);
+ }
+<RulesSquare,RulesRoundSquare>{CHARCE} {
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<RulesSquare,RulesRoundSquare>"\\[" |
+<RulesSquare,RulesRoundSquare>"\\]" {
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<RulesSquare>"]" {
+ yyextra->rulesPatternBuffer += yytext;
+ BEGIN(RulesPattern) ;
+ }
+<RulesRoundSquare>"]" {
+ yyextra->rulesPatternBuffer += yytext;
+ BEGIN(RulesRound) ;
+ }
+<RulesSquare,RulesRoundSquare>"\\\\" {
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<RulesSquare,RulesRoundSquare>. {
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<RulesPattern>{StartRoundQuest} {
+ yyextra->rulesPatternBuffer += yytext;
+ yyextra->lastContext = YY_START;
+ BEGIN(RulesRoundQuest);
+ }
+<RulesRoundQuest>{nl} {
+ yyextra->rulesPatternBuffer += yytext;
+ if (!yyextra->rulesPatternBuffer.isEmpty())
+ {
+ startFontClass(yyscanner,"stringliteral");
+ codifyLines(yyscanner,yyextra->rulesPatternBuffer.data());
+ yyextra->rulesPatternBuffer.resize(0);
+ endFontClass(yyscanner);
+ }
+ }
+<RulesRoundQuest>[^)] {
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<RulesRoundQuest>")" {
+ yyextra->rulesPatternBuffer += yytext;
+ BEGIN(yyextra->lastContext);
+ }
+<RulesPattern>{StartRound} {
+ yyextra->roundCount++;
+ yyextra->rulesPatternBuffer += yytext;
+ yyextra->lastContext = YY_START;
+ BEGIN(RulesRound);
+ }
+<RulesRound>{RulesCurly} {
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<RulesRound>{StartSquare} {
+ yyextra->rulesPatternBuffer += yytext;
+ BEGIN(RulesRoundSquare);
+ }
+<RulesRound>{StartDouble} {
+ yyextra->rulesPatternBuffer += yytext;
+ BEGIN(RulesRoundDouble);
+ }
+<RulesRound>{EscapeRulesChar} {
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<RulesRound>"(" {
+ yyextra->roundCount++;
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<RulesRound>")" {
+ yyextra->roundCount--;
+ yyextra->rulesPatternBuffer += yytext;
+ if (!yyextra->roundCount) BEGIN( yyextra->lastContext ) ;
+ }
+<RulesRound>{nl} {
+ yyextra->rulesPatternBuffer += yytext;
+ yyextra->yyLineNr++;
+ }
+<RulesRound>{ws} {
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<RulesRound>. {
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<RulesPattern>{ws}+"|" {
+ if (!yyextra->rulesPatternBuffer.isEmpty())
+ {
+ startFontClass(yyscanner,"stringliteral");
+ codifyLines(yyscanner,yyextra->rulesPatternBuffer);
+ yyextra->rulesPatternBuffer.resize(0);
+ endFontClass(yyscanner);
+ }
+ codifyLines(yyscanner,yytext);
+ yyextra->startCCodeLine=yyextra->yyLineNr;
+ yyextra->curlyCount = 0;
+ BEGIN(SkipCurly);
+ }
+<RulesPattern>^{ws}*{nl} {
+ codifyLines(yyscanner,"\n");
+ }
+<RulesPattern>^{ws}+ {
+ codifyLines(yyscanner,yytext);
+ }
+<RulesPattern>({ws}|{nl}) {
+ unput(*yytext);
+ if (!yyextra->rulesPatternBuffer.isEmpty())
+ {
+ startFontClass(yyscanner,"stringliteral");
+ codifyLines(yyscanner,yyextra->rulesPatternBuffer);
+ yyextra->rulesPatternBuffer.resize(0);
+ endFontClass(yyscanner);
+ }
+ yyextra->startCCodeLine=yyextra->yyLineNr;
+ yyextra->curlyCount = 0;
+ BEGIN(SkipCurly);
+ }
+<RulesPattern>"\\\\" {
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<RulesPattern>{CCS} {
+ if (!yyextra->rulesPatternBuffer.isEmpty())
+ {
+ startFontClass(yyscanner,"stringliteral");
+ codifyLines(yyscanner,yyextra->rulesPatternBuffer);
+ yyextra->rulesPatternBuffer.resize(0);
+ endFontClass(yyscanner);
+ }
+ yyextra->CCodeBuffer += yytext;
+ yyextra->lastContext = YY_START;
+ BEGIN(COMMENT);
+ }
+<RulesPattern>. {
+ yyextra->rulesPatternBuffer += yytext;
+ }
+<SkipCurly>{B}*"#"{B}+[0-9]+{B}+/"\"" { /* line control directive */
+ yyextra->CCodeBuffer += yytext;
+ yyextra->lastPreLineCtrlContext = YY_START;
+ BEGIN( PreLineCtrl );
+ }
+<PreLineCtrl>"\""[^\n\"]*"\"" {
+ yyextra->CCodeBuffer += yytext;
+ }
+<PreLineCtrl>. {
+ yyextra->CCodeBuffer += yytext;
+ }
+<PreLineCtrl>\n {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->yyLineNr++;
+ BEGIN( yyextra->lastPreLineCtrlContext );
+ }
+<SkipCurly>"{" {
+ yyextra->CCodeBuffer += yytext;
+ ++yyextra->curlyCount ;
+ }
+<SkipCurly>"}"/{BN}*{DCOMM}"<!--" | /* see bug710917 */
+<SkipCurly>"}" {
+ yyextra->CCodeBuffer += yytext;
+ lineCount(yyscanner);
+ if( yyextra->curlyCount )
+ {
+ --yyextra->curlyCount ;
+ }
+ }
+<SkipCurly>"}"{BN}*{DCOMM}"<" {
+ yyextra->CCodeBuffer += yytext;
+ lineCount(yyscanner);
+ if ( yyextra->curlyCount )
+ {
+ --yyextra->curlyCount ;
+ }
+ else
+ {
+ yyextra->docBlockContext = SkipCurlyEndDoc;
+ if (yytext[yyleng-3]=='/')
+ {
+ BEGIN( DocLine );
+ }
+ else
+ {
+ BEGIN( DocBlock );
+ }
+ }
+ }
+<SkipCurly>\" {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->lastStringContext=SkipCurly;
+ BEGIN( SkipString );
+ }
+<SkipCurly>^{B}*"#" {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->lastPreLineCtrlContext = YY_START;
+ BEGIN( PreLineCtrl );
+ }
+<SkipCurly>{B}*{RAWBEGIN} {
+ QCString raw=QCString(yytext).stripWhiteSpace();
+ yyextra->delimiter = raw.mid(2);
+ yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
+ yyextra->lastRawStringContext = YY_START;
+ yyextra->CCodeBuffer += yytext;
+ BEGIN(RawString);
+ }
+<SkipCurly>[^\n#"'@\\/{}<]+ {
+ yyextra->CCodeBuffer += yytext;
+ }
+<SkipCurly>{CCS} {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->lastCContext = YY_START;
+ BEGIN(SkipComment);
+ }
+<SkipCurly>{CPPC} {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->lastCContext = YY_START;
+ BEGIN(SkipCxxComment);
+ }
+<SkipCurly>{CHARLIT} {
+ yyextra->CCodeBuffer += yytext;
+ }
+<SkipCurly>\' {
+ yyextra->CCodeBuffer += yytext;
+ }
+<SkipCurly>. {
+ yyextra->CCodeBuffer += yytext;
+ }
+<SkipCurly>({CPPC}{B}*)?{CCS}"!" {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->docBlockContext = YY_START;
+ BEGIN( DocBlock );
+ }
+<SkipCurly>{CCS}"*"[*]+{BL} {
+ bool javadocBanner = Config_getBool(JAVADOC_BANNER);
+ yyextra->CCodeBuffer += yytext;
+ yyextra->yyLineNr++;
+ if( javadocBanner )
+ {
+ yyextra->docBlockContext = YY_START;
+ BEGIN( DocBlock );
+ }
+ else
+ {
+ BEGIN( Comment ) ;
+ }
+ }
+<SkipCurly>({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->docBlockContext = YY_START;
+ BEGIN( DocBlock );
+ }
+<SkipCurly>{CPPC}"!" {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->docBlockContext = YY_START;
+ BEGIN( DocLine );
+ }
+<SkipCurly>{CPPC}"/"/[^/] {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->docBlockContext = YY_START;
+ BEGIN( DocLine );
+ }
+
+<SkipCurly>\n {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->yyLineNr++;
+ if (yyextra->curlyCount<=0)
+ {
+ handleCCode(yyscanner);
+ BEGIN(RulesPattern);
+ }
+ }
+<SkipString>\\. {
+ yyextra->CCodeBuffer += yytext;
+ }
+<SkipString>\" {
+ yyextra->CCodeBuffer += yytext;
+ BEGIN( yyextra->lastStringContext );
+ }
+<SkipString>{CCS}|{CCE}|{CPPC} {
+ yyextra->CCodeBuffer += yytext;
+ }
+<SkipString>\n {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->yyLineNr++;
+ }
+<SkipString>. {
+ yyextra->CCodeBuffer += yytext;
+ }
+<SkipCxxComment>.*"\\\n" { // line continuation
+ yyextra->CCodeBuffer += yytext;
+ yyextra->yyLineNr++;
+ }
+<SkipCxxComment>{ANYopt}/\n {
+ yyextra->CCodeBuffer += yytext;
+ BEGIN( yyextra->lastCContext ) ;
+ }
+<Comment>{BN}+ {
+ yyextra->CCodeBuffer += yytext ;
+ lineCount(yyscanner);
+ }
+<Comment>{CCS} { yyextra->CCodeBuffer += yytext ; }
+<Comment>{CPPC} { yyextra->CCodeBuffer += yytext ; }
+<Comment>{CMD}("code"|"verbatim") {
+ yyextra->insideCode=TRUE;
+ yyextra->CCodeBuffer += yytext ;
+ }
+<Comment>{CMD}("endcode"|"endverbatim") {
+ yyextra->insideCode=FALSE;
+ 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 ; }
+
+<SkipComment>{CPPC}|{CCS} {
+ yyextra->CCodeBuffer += yytext;
+ }
+<SkipComment>[^\*\n]+ {
+ yyextra->CCodeBuffer += yytext;
+ }
+<SkipComment>\n {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->yyLineNr++;
+ }
+<SkipComment>{B}*{CCE} {
+ yyextra->CCodeBuffer += yytext;
+ BEGIN( yyextra->lastCContext );
+ }
+<SkipComment>"*" {
+ yyextra->CCodeBuffer += yytext;
+ }
+<RawString>{RAWEND} {
+ yyextra->CCodeBuffer += yytext;
+ QCString delimiter = yytext+1;
+ delimiter=delimiter.left(delimiter.length()-1);
+ if (delimiter==yyextra->delimiter)
+ {
+ BEGIN(yyextra->lastRawStringContext);
+ }
+ }
+<RawString>[^)\n]+ {
+ yyextra->CCodeBuffer += yytext;
+ }
+<RawString>. {
+ yyextra->CCodeBuffer += yytext;
+ }
+<RawString>\n {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->yyLineNr++;
+ }
+
+
+ /* ---- Single line comments ------ */
+<DocLine>[^\n]*"\n"[ \t]*{CPPC}[/!][<]? { // continuation of multiline C++-style comment
+ yyextra->CCodeBuffer += yytext;
+ lineCount(yyscanner);
+ }
+<DocLine>{B}*{CPPC}"/"[/]+{Bopt}/"\n" { // ignore marker line (see bug700345)
+ 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;
+ BEGIN( yyextra->docBlockContext );
+ }
+<DocLine>{NONLopt}/"\n" { // whole line
+ yyextra->CCodeBuffer += yytext;
+ BEGIN( yyextra->docBlockContext );
+ }
+
+ /* ---- Comments blocks ------ */
+
+<DocBlock>"*"*{CCE} { // end of comment block
+ yyextra->CCodeBuffer += yytext;
+ BEGIN(yyextra->docBlockContext);
+ }
+<DocBlock>^{B}*"*"+/[^/] {
+ yyextra->CCodeBuffer += yytext;
+ }
+<DocBlock>^{B}*({CPPC})?{B}*"*"+/[^/a-z_A-Z0-9*] { // start of a comment line
+ yyextra->CCodeBuffer += yytext;
+ }
+<DocBlock>^{B}*({CPPC}){B}* { // strip embedded C++ comments if at the start of a line
+ yyextra->CCodeBuffer += yytext;
+ }
+<DocBlock>{CPPC} { // slashes in the middle of a comment block
+ yyextra->CCodeBuffer += yytext;
+ }
+<DocBlock>{CCS} { // start of a new comment in the
+ // middle of a comment block
+ yyextra->CCodeBuffer += yytext;
+ }
+<DocBlock>({CMD}{CMD}){ID}/[^a-z_A-Z0-9] { // escaped command
+ yyextra->CCodeBuffer += yytext;
+ }
+<DocBlock>{CMD}("f$"|"f["|"f{") {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->docBlockName=&yytext[1];
+ if (yyextra->docBlockName.at(1)=='{')
+ {
+ yyextra->docBlockName.at(1)='}';
+ }
+ yyextra->fencedSize=0;
+ yyextra->nestedComment=FALSE;
+ BEGIN(DocCopyBlock);
+ }
+<DocBlock>{B}*"<"{PRE}">" {
+ 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->docBlockName=&yytext[1];
+ yyextra->fencedSize=0;
+ yyextra->nestedComment=FALSE;
+ BEGIN(DocCopyBlock);
+ }
+<DocBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
+ yyextra->CCodeBuffer += yytext;
+ QCString pat = substitute(yytext,"*"," ");
+ yyextra->docBlockName="~~~";
+ yyextra->fencedSize=pat.stripWhiteSpace().length();
+ yyextra->nestedComment=FALSE;
+ BEGIN(DocCopyBlock);
+ }
+<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
+ yyextra->CCodeBuffer += yytext;
+ QCString pat = substitute(yytext,"*"," ");
+ yyextra->docBlockName="```";
+ yyextra->fencedSize=pat.stripWhiteSpace().length();
+ yyextra->nestedComment=FALSE;
+ BEGIN(DocCopyBlock);
+ }
+<DocBlock>{B}*"<code>" {
+ REJECT;
+ }
+<DocBlock>[^@*~\/\\\n]+ { // any character that isn't special
+ yyextra->CCodeBuffer += yytext;
+ }
+<DocBlock>\n { // newline
+ yyextra->CCodeBuffer += yytext;
+ lineCount(yyscanner);
+ }
+<DocBlock>. { // command block
+ yyextra->CCodeBuffer += yytext;
+ }
+ /* ---- Copy verbatim sections ------ */
+
+<DocCopyBlock>"</"{PRE}">" { // end of a <pre> block
+ yyextra->CCodeBuffer += yytext;
+ if (yyextra->docBlockName=="<pre>")
+ {
+ BEGIN(DocBlock);
+ }
+ }
+<DocCopyBlock>"</"{CODE}">" { // end of a <code> block
+ yyextra->CCodeBuffer += yytext;
+ if (yyextra->docBlockName=="<code>")
+ {
+ BEGIN(DocBlock);
+ }
+ }
+<DocCopyBlock>[\\@]("f$"|"f]"|"f}") {
+ 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;
+ if (&yytext[4]==yyextra->docBlockName)
+ {
+ BEGIN(DocBlock);
+ }
+ }
+<DocCopyBlock>^{B}*"*"+/{BN}+ { // start of a comment line
+ yyextra->CCodeBuffer += yytext;
+ if (yyextra->docBlockName=="verbatim")
+ {
+ REJECT;
+ }
+ else if (yyextra->docBlockName=="code")
+ {
+ REJECT;
+ }
+ else
+ {
+ yyextra->CCodeBuffer += yytext;
+ }
+ }
+<DocCopyBlock>^{B}*"*"+/{B}+"*"{BN}* { // start of a comment line with two *'s
+ if (yyextra->docBlockName=="code")
+ {
+ yyextra->CCodeBuffer += yytext;
+ }
+ else
+ {
+ REJECT;
+ }
+ }
+<DocCopyBlock>^{B}*"*"+/({ID}|"(") { // Assume *var or *(... is part of source code (see bug723516)
+ if (yyextra->docBlockName=="code")
+ {
+ yyextra->CCodeBuffer += yytext;
+ }
+ else
+ {
+ REJECT;
+ }
+ }
+<DocCopyBlock>^{B}*"*"+/{BN}* { // start of a comment line with one *
+ if (yyextra->docBlockName=="code")
+ {
+ if (yyextra->nestedComment) // keep * it is part of the code
+ {
+ yyextra->CCodeBuffer += yytext;
+ }
+ else // remove * it is part of the comment block
+ {
+ yyextra->CCodeBuffer += yytext;
+ }
+ }
+ else
+ {
+ REJECT;
+ }
+ }
+<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
+ yyextra->CCodeBuffer += yytext;
+ QCString pat = substitute(yytext,"*"," ");
+ if (yyextra->fencedSize==pat.stripWhiteSpace().length())
+ {
+ BEGIN(DocBlock);
+ }
+ }
+<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
+ yyextra->CCodeBuffer += yytext;
+ QCString pat = substitute(yytext,"*"," ");
+ if (yyextra->fencedSize==pat.stripWhiteSpace().length())
+ {
+ BEGIN(DocBlock);
+ }
+ }
+<DocCopyBlock>[^\<@/\*\]~\$\\\n]+ { // any character that is not special
+ yyextra->CCodeBuffer += yytext;
+ }
+<DocCopyBlock>{CCS}|{CCE}|{CPPC} {
+ if (yytext[1]=='*')
+ {
+ yyextra->nestedComment=TRUE;
+ }
+ else if (yytext[0]=='*')
+ {
+ yyextra->nestedComment=FALSE;
+ }
+ yyextra->CCodeBuffer += yytext;
+ }
+<DocCopyBlock>\n { // newline
+ yyextra->CCodeBuffer += yytext;
+ lineCount(yyscanner);
+ }
+<DocCopyBlock>. { // any other character
+ yyextra->CCodeBuffer += yytext;
+ }
+<SkipCurlyEndDoc>"}"{BN}*{DCOMM}"<" { // desc is followed by another one
+ yyextra->docBlockContext = SkipCurlyEndDoc;
+ yyextra->CCodeBuffer += yytext;
+ if (yytext[yyleng-3]=='/')
+ {
+ BEGIN( DocLine );
+ }
+ else
+ {
+ BEGIN( DocBlock );
+ }
+ }
+<SkipCurlyEndDoc>"}" {
+ yyextra->CCodeBuffer += yytext;
+ BEGIN(SkipCurly);
+ }
+
+<UserSection>.*{nl} {
+ yyextra->CCodeBuffer += yytext;
+ yyextra->yyLineNr++;
+ }
+ /*
+<*>. { fprintf(stderr,"Lex code scanner Def rule for %s: #%s#\n",stateToString(YY_START),yytext);}
+<*>{nl} { fprintf(stderr,"Lex code scanner Def rule for newline %s: #%s#\n",stateToString(YY_START),yytext); yyextra->yyLineNr++;}
+ */
+<*><<EOF>> {
+ handleCCode(yyscanner);
+ yyterminate();
+ }
+%%
+
+static void setCurrentDoc(yyscan_t yyscanner,const QCString &anchor)
+{
+ struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+ if (Doxygen::searchIndex)
+ {
+ if (yyextra->searchCtx)
+ {
+ yyextra->code->setCurrentDoc(yyextra->searchCtx,yyextra->searchCtx->anchor(),false);
+ }
+ else
+ {
+ yyextra->code->setCurrentDoc(yyextra->sourceFileDef,anchor,true);
+ }
+ }
+}
+
+/*! start a new line of code, inserting a line number if yyextra->sourceFileDef
+ * is true. If a definition starts at the current line, then the line
+ * number is linked to the documentation of that definition.
+ */
+static void startCodeLine(yyscan_t yyscanner)
+{
+ struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+ if (yyextra->sourceFileDef && yyextra->lineNumbers)
+ {
+ const Definition *d = yyextra->sourceFileDef->getSourceDefinition(yyextra->yyLineNr);
+
+ if (!yyextra->includeCodeFragment && d)
+ {
+ yyextra->currentDefinition = d;
+ yyextra->currentMemberDef = yyextra->sourceFileDef->getSourceMember(yyextra->yyLineNr);
+ yyextra->classScope = d->name();
+ QCString lineAnchor;
+ lineAnchor.sprintf("l%05d",yyextra->yyLineNr);
+ if (yyextra->currentMemberDef)
+ {
+ yyextra->code->writeLineNumber(yyextra->currentMemberDef->getReference(),
+ yyextra->currentMemberDef->getOutputFileBase(),
+ yyextra->currentMemberDef->anchor(),yyextra->yyLineNr);
+ setCurrentDoc(yyscanner,lineAnchor);
+ }
+ else
+ {
+ yyextra->code->writeLineNumber(d->getReference(),
+ d->getOutputFileBase(),
+ QCString(),yyextra->yyLineNr);
+ setCurrentDoc(yyscanner,lineAnchor);
+ }
+ }
+ else
+ {
+ yyextra->code->writeLineNumber(QCString(),QCString(),QCString(),yyextra->yyLineNr);
+ }
+ }
+
+ yyextra->code->startCodeLine(yyextra->sourceFileDef && yyextra->lineNumbers);
+
+ if (yyextra->currentFontClass)
+ {
+ yyextra->code->startFontClass(yyextra->currentFontClass);
+ }
+}
+
+static void endFontClass(yyscan_t yyscanner)
+{
+ struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+ if (yyextra->currentFontClass)
+ {
+ yyextra->code->endFontClass();
+ yyextra->currentFontClass=0;
+ }
+}
+
+static void endCodeLine(yyscan_t yyscanner)
+{
+ struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+ endFontClass(yyscanner);
+ yyextra->code->endCodeLine();
+}
+
+static void nextCodeLine(yyscan_t yyscanner)
+{
+ struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+ const char *fc = yyextra->currentFontClass;
+ endCodeLine(yyscanner);
+ if (yyextra->yyLineNr<yyextra->inputLines)
+ {
+ yyextra->currentFontClass = fc;
+ startCodeLine(yyscanner);
+ }
+}
+
+static void codifyLines(yyscan_t yyscanner,const QCString &text)
+{
+ struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+ if (text.isEmpty()) return;
+ const char *p=text.data(),*sp=p;
+ char c;
+ bool done=false;
+ while (!done)
+ {
+ sp=p;
+ while ((c=*p++) && c!='\n') { }
+ if (c=='\n')
+ {
+ yyextra->yyLineNr++;
+ int l = (int)(p-sp-1);
+ char *tmp = (char*)malloc(l+1);
+ memcpy(tmp,sp,l);
+ tmp[l]='\0';
+ yyextra->code->codify(tmp);
+ if (p)
+ {
+ nextCodeLine(yyscanner);
+ }
+ else
+ {
+ endCodeLine(yyscanner);
+ done=true;
+ }
+ free(tmp);
+ }
+ else
+ {
+ yyextra->code->codify(sp);
+ done=true;
+ }
+ }
+ yyextra->startCCodeLine = yyextra->yyLineNr;
+}
+
+static void startFontClass(yyscan_t yyscanner,const char *s)
+{
+ struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+ endFontClass(yyscanner);
+ if (!yyextra->currentFontClass || !s || strcmp(yyextra->currentFontClass,s))
+ {
+ endFontClass(yyscanner);
+ yyextra->code->startFontClass(s);
+ yyextra->currentFontClass=s;
+ }
+}
+
+/*! counts the number of lines in the input */
+static int countLines(yyscan_t yyscanner)
+{
+ struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+ const char *p=yyextra->inputString;
+ char c;
+ int count=1;
+ while ((c=*p))
+ {
+ p++ ;
+ if (c=='\n') count++;
+ }
+ if (p>yyextra->inputString && *(p-1)!='\n')
+ { // last line does not end with a \n, so we add an extra
+ // line and explicitly terminate the line after parsing.
+ count++,
+ yyextra->needsTermination=true;
+ }
+ return count;
+}
+
+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 inputPosition = yyextra->inputPosition;
+ const char *s = yyextra->inputString + inputPosition;
+ yy_size_t c=0;
+ while( c < max_size && *s )
+ {
+ *buf++ = *s++;
+ c++;
+ }
+ yyextra->inputPosition += c;
+ return c;
+}
+
+static void lineCount(yyscan_t yyscanner)
+{
+ struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+ const char *p;
+ for (p = yytext ; *p ; ++p )
+ {
+ if (*p=='\n')
+ {
+ yyextra->yyLineNr++;
+ }
+ }
+}
+
+static void handleCCode(yyscan_t yyscanner)
+{
+ struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+ if (yyextra->CCodeBuffer.isEmpty()) return;
+
+ yyextra->ccodeParser.setStartCodeLine(false);
+ yyextra->ccodeParser.parseCode(*yyextra->code,
+ yyextra->classScope,
+ yyextra->CCodeBuffer,
+ SrcLangExt_Cpp,
+ yyextra->exampleBlock,
+ yyextra->exampleName,
+ yyextra->sourceFileDef,
+ yyextra->startCCodeLine,
+ -1, /* endLine will be calculated in called routine */
+ yyextra->includeCodeFragment,
+ yyextra->currentMemberDef,
+ yyextra->lineNumbers,
+ yyextra->searchCtx,
+ yyextra->collectXRefs
+ );
+ yyextra->CCodeBuffer.resize(0);
+ yyextra->ccodeParser.setStartCodeLine(true);
+ yyextra->yyLineNr--;
+ codifyLines(yyscanner,"\n");
+ return;
+}
+
+// public interface -----------------------------------------------------------
+
+struct LexCodeParser::Private
+{
+ yyscan_t yyscanner;
+ lexcodeYY_state state;
+};
+
+LexCodeParser::LexCodeParser() : p(std::make_unique<Private>())
+{
+ lexcodeYYlex_init_extra(&p->state, &p->yyscanner);
+#ifdef FLEX_DEBUG
+ lexcodeYYset_debug(1,p->yyscanner);
+#endif
+ resetCodeParserState();
+}
+
+LexCodeParser::~LexCodeParser()
+{
+ lexcodeYYlex_destroy(p->yyscanner);
+}
+
+void LexCodeParser::resetCodeParserState()
+{
+ struct yyguts_t *yyg = (struct yyguts_t*)p->yyscanner;
+ yyextra->currentDefinition = 0;
+ yyextra->currentMemberDef = 0;
+}
+
+void LexCodeParser::parseCode(CodeOutputInterface &codeOutIntf,
+ const QCString &scopeName,
+ const QCString &input,
+ SrcLangExt,
+ bool isExampleBlock,
+ const QCString &exampleName,
+ FileDef *fileDef,
+ int startLine,
+ int endLine,
+ bool inlineFragment,
+ const MemberDef *memberDef,
+ bool showLineNumbers,
+ const Definition *searchCtx,
+ bool collectXRefs
+ )
+{
+ yyscan_t yyscanner = p->yyscanner;
+ struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+
+ if (input.isEmpty()) return;
+
+ printlex(yy_flex_debug, true, __FILE__, fileDef ? qPrint(fileDef->fileName()): NULL);
+
+ yyextra->code = &codeOutIntf;
+ yyextra->inputString = input.data();
+ yyextra->inputPosition = 0;
+ yyextra->currentFontClass = 0;
+ yyextra->needsTermination = false;
+
+ yyextra->classScope=scopeName;
+ yyextra->currentMemberDef=memberDef;
+ yyextra->searchCtx=searchCtx;
+ yyextra->collectXRefs=collectXRefs;
+
+ if (startLine!=-1)
+ yyextra->yyLineNr = startLine;
+ else
+ yyextra->yyLineNr = 1;
+
+ if (endLine!=-1)
+ yyextra->inputLines = endLine+1;
+ else
+ yyextra->inputLines = yyextra->yyLineNr + countLines(yyscanner) - 1;
+
+ yyextra->startCCodeLine = yyextra->yyLineNr;
+ yyextra->exampleBlock = isExampleBlock;
+ yyextra->exampleName = exampleName;
+ yyextra->sourceFileDef = fileDef;
+ yyextra->lineNumbers = fileDef!=0 && showLineNumbers;
+
+ bool cleanupSourceDef = false;
+
+ if (isExampleBlock && fileDef==0)
+ {
+ // create a dummy filedef for the example
+ yyextra->sourceFileDef = createFileDef(QCString(),!exampleName.isEmpty() ? exampleName : QCString("generated"));
+ cleanupSourceDef = true;
+ }
+
+ if (yyextra->sourceFileDef)
+ {
+ setCurrentDoc(yyscanner,"l00001");
+ }
+
+ yyextra->includeCodeFragment = inlineFragment;
+ // Starts line 1 on the output
+ startCodeLine(yyscanner);
+
+ lexcodeYYrestart( 0, yyscanner );
+ BEGIN( DefSection );
+ lexcodeYYlex(yyscanner);
+
+ if (yyextra->needsTermination)
+ {
+ endCodeLine(yyscanner);
+ }
+ if (cleanupSourceDef)
+ {
+ // delete the temporary file definition used for this example
+ delete yyextra->sourceFileDef;
+ yyextra->sourceFileDef=0;
+ }
+
+ printlex(yy_flex_debug, false, __FILE__, fileDef ? qPrint(fileDef->fileName()): NULL);
+}
+
+//---------------------------------------------------------------------------------
+
+#if USE_STATE2STRING
+#include "lexcode.l.h"
+#endif
diff --git a/src/lexscanner.h b/src/lexscanner.h
new file mode 100644
index 0000000..dbb1f56
--- /dev/null
+++ b/src/lexscanner.h
@@ -0,0 +1,43 @@
+/******************************************************************************
+ *
+ *
+ *
+ * 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 SCANNER_LEX_H
+#define SCANNER_LEX_H
+
+#include "parserintf.h"
+
+/** \brief Lex language parser using state-based lexical scanning.
+ *
+ * This is the Lex language parser for doxygen.
+ */
+class LexOutlineParser : public OutlineParserInterface
+{
+ public:
+ LexOutlineParser();
+ ~LexOutlineParser();
+ 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 QCString &text){}
+
+ private:
+ struct Private;
+ std::unique_ptr<Private> p;
+};
+#endif
diff --git a/src/lexscanner.l b/src/lexscanner.l
new file mode 100644
index 0000000..cd06464
--- /dev/null
+++ b/src/lexscanner.l
@@ -0,0 +1,1016 @@
+/*****************************************************************************
+ *
+ * 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.
+ *
+ */
+%option never-interactive
+%option prefix="lexscannerYY"
+%option reentrant
+%option extra-type="struct lexscannerYY_state *"
+%option noyywrap
+
+%top{
+#include <stdint.h>
+}
+
+%{
+
+/*
+ * includes
+ */
+
+#include <algorithm>
+#include <vector>
+#include <utility>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <ctype.h>
+
+#include "config.h"
+#include "lexscanner.h"
+#include "entry.h"
+#include "message.h"
+#include "util.h"
+#include "scanner.h"
+
+#define YY_NO_INPUT 1
+#define YY_NO_UNISTD_H 1
+
+#define USE_STATE2STRING 0
+
+#define repeatChar(chr, cnt) std::string(cnt, chr).c_str()
+
+struct lexscannerYY_state
+{
+ COutlineParser cOutlineParser;
+ const char * inputString = 0;
+ int inputPosition = 0;
+
+ int lastContext = 0;
+ int lastCContext = 0;
+ int lastStringContext = 0;
+ int docBlockContext = 0;
+ int lastPreLineCtrlContext = 0;
+ int lastRawStringContext = 0;
+ int curlyCount = 0;
+
+ bool insideCode = FALSE;
+ QCString delimiter;
+ QCString docBlockName;
+ uint fencedSize = 0;
+ bool nestedComment = false;
+
+ QCString prefix = "yy";
+ bool reentrant = false;
+ bool bison_bridge = false;
+ bool bison_locations = false;
+ QCString cCodeBuffer;
+ int roundCount = 0;
+
+ QCString yyFileName;
+ ClangTUParser *clangParser = 0;
+
+ std::shared_ptr<Entry> current;
+ std::shared_ptr<Entry> current_root;
+ SrcLangExt language;
+};
+
+#if USE_STATE2STRING
+static const char *stateToString(int state);
+#endif
+//-----------------------------------------------------------------------------
+
+// forward declarations for statefull functions
+static void handleCCode(yyscan_t yyscanner);
+static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size);
+
+/* ----------------------------------------------------------------- */
+#undef YY_INPUT
+#define YY_INPUT(buf,result,max_size) result=yyread(yyscanner,buf,max_size);
+
+%}
+
+nl (\r\n|\r|\n)
+ws [ \t]
+nws [^ \t\n]
+TopStart "%top{"{nl}
+TopEnd "}"{nl}
+LiteralStart "%{"{nl}
+LiteralEnd "%}"{nl}
+Option "%option"
+RulesStart "%%"{nl}
+RulesEnd "%%"{nl}
+RulesSharp "<"[^>\n]*">"
+RulesCurly "{"[^{}\n]*"}"
+StartSquare "["
+StartDouble "\""
+StartRound "("
+StartRoundQuest "(?"
+EscapeRulesCharOpen "\\["|"\\<"|"\\{"|"\\("|"\\\""|"\\ "|"\\\\"
+EscapeRulesCharClose "\\]"|"\\>"|"\\}"|"\\)"
+EscapeRulesChar {EscapeRulesCharOpen}|{EscapeRulesCharClose}
+
+CMD ("\\"|"@")
+BN [ \t\n\r]
+BL [ \t\r]*"\n"
+B [ \t]
+Bopt {B}*
+ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
+PRE [pP][rR][eE]
+CODE [cC][oO][dD][eE]
+RAWBEGIN (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"("
+RAWEND ")"[^ \t\(\)\\]{0,16}\"
+CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
+CHARCE "[:"[^:]*":]"
+ /* no comment start / end signs inside square brackets */
+NCOMM [^/\*]
+ // C start comment
+CCS "/\*"
+ // C end comment
+CCE "*\/"
+ // Cpp comment
+CPPC "/\/"
+ // doxygen start comment
+DCOMM ("/\*!"|"/\**"|"/\/!"|"/\/\/")
+
+ // Optional any character
+ANYopt .*
+ // Optional all but newline
+NONLopt [^\n]*
+
+%x DefSection
+%x Option
+%x OptPrefix
+%x DefSectionLine
+%x RulesSectionInit
+%x RulesPattern
+%x RulesDouble
+%x RulesRoundDouble
+%x RulesSquare
+%x RulesRoundSquare
+%x RulesRound
+%x RulesRoundQuest
+%x UserSection
+
+%x TopSection
+%x LiteralSection
+
+%x COMMENT
+
+%x SkipCurly
+%x SkipCurlyEndDoc
+%x PreLineCtrl
+%x DocLine
+%x DocBlock
+%x DocCopyBlock
+%x SkipString
+%x RawString
+%x SkipComment
+%x SkipCxxComment
+%x Comment
+
+%%
+
+<*>\x0d
+<DefSection>{Option} {
+ BEGIN (Option);
+ }
+<Option>"prefix"{ws}*"="{ws}* {
+ BEGIN (OptPrefix);
+ }
+<OptPrefix>"\""[^\"]*"\"" {
+ yyextra->prefix = yytext;
+ yyextra->prefix = yyextra->prefix.mid(1,yyleng-2);
+ BEGIN (Option);
+ }
+<Option>"reentrant" {
+ yyextra-> reentrant = true;
+ }
+<Option>"bison-bridge" {
+ yyextra-> bison_bridge = true;
+ }
+<Option>"bison-locations" {
+ yyextra-> bison_bridge = true;
+ yyextra-> bison_locations = true;
+ }
+<Option>{nws}+
+<Option>{ws}+
+<Option>{nl} {
+ yyextra->cCodeBuffer += yytext;
+ BEGIN (DefSection);
+ }
+<DefSection>^{RulesStart} {
+ {
+ bool fill = false;
+ yyextra->cCodeBuffer += "int " + yyextra->prefix + "lex (";
+ if (yyextra->bison_bridge )
+ {
+ if (fill) yyextra->cCodeBuffer += ",";
+ yyextra->cCodeBuffer += "YYSTYPE * yylval_param";
+ fill = true;
+ }
+ if (yyextra->bison_locations)
+ {
+ if (fill) yyextra->cCodeBuffer += ",";
+ yyextra->cCodeBuffer += "YYLTYPE * yylloc_param";
+ fill = true;
+ }
+ if (yyextra->reentrant)
+ {
+ if (fill) yyextra->cCodeBuffer += ",";
+ yyextra->cCodeBuffer += "yyscan_t yyscanner";
+ fill = true;
+ }
+ if (!yyextra->bison_bridge && !yyextra->bison_locations && !yyextra->reentrant)
+ {
+ yyextra->cCodeBuffer += "void";
+ }
+ yyextra->cCodeBuffer += ") {\n";
+ }
+ BEGIN (RulesSectionInit);
+ }
+<DefSection>^{TopStart} {
+ yyextra->cCodeBuffer += "\n";
+ yyextra->lastContext = YY_START;
+ BEGIN (TopSection);
+ }
+<DefSection>^{LiteralStart} {
+ yyextra->cCodeBuffer += "\n";
+ yyextra->lastContext = YY_START;
+ BEGIN (LiteralSection);
+ }
+<TopSection>^{TopEnd} {
+ yyextra->cCodeBuffer += "\n";
+ BEGIN( yyextra->lastContext ) ;
+ }
+<TopSection>.*{nl} {
+ yyextra->cCodeBuffer += yytext;
+ }
+<LiteralSection>^{LiteralEnd} {
+ yyextra->cCodeBuffer += "\n";
+ BEGIN( yyextra->lastContext ) ;
+ }
+<LiteralSection>.*{nl} {
+ yyextra->cCodeBuffer += yytext;
+ }
+<DefSection>^{nws} {
+ BEGIN(DefSectionLine);
+ }
+<DefSection>{CPPC}.*{nl} {
+ yyextra->cCodeBuffer += yytext;
+ }
+<DefSection>^{ws}*{CCS} {
+ yyextra->cCodeBuffer += yytext;
+ yyextra->lastContext = YY_START;
+ BEGIN(COMMENT);
+ }
+<COMMENT>{CCE}{ws}*{nl} {
+ yyextra->cCodeBuffer+=yytext;
+ BEGIN(yyextra->lastContext);
+ }
+<COMMENT>{CCE} {
+ yyextra->cCodeBuffer+=yytext;
+ BEGIN(yyextra->lastContext);
+ }
+<COMMENT>[^*\n]+ {
+ yyextra->cCodeBuffer += yytext;
+ }
+<COMMENT>{CPPC}|{CCS} {
+ yyextra->cCodeBuffer += yytext;
+ }
+<COMMENT>{nl} {
+ yyextra->cCodeBuffer += yytext;
+ }
+<COMMENT>. {
+ yyextra->cCodeBuffer += yytext;
+ }
+<DefSection>^{nl} {
+ yyextra->cCodeBuffer += "\n";
+ }
+<DefSection>^{ws}.*{nl} {
+ yyextra->cCodeBuffer += yytext;
+ }
+<DefSectionLine>.*{nl} {
+ yyextra->cCodeBuffer += "\n";
+ BEGIN(DefSection);
+ }
+<RulesSectionInit,RulesPattern>^{RulesEnd} {
+ yyextra->cCodeBuffer += "}\n";
+ BEGIN (UserSection);
+ }
+<RulesSectionInit>^{nws} {
+ unput(*yytext);
+ BEGIN(RulesPattern);
+ }
+<RulesSectionInit>^{ws}.*{nl} {
+ yyextra->cCodeBuffer += yytext;
+ }
+<RulesSectionInit>^{nl} {
+ yyextra->cCodeBuffer += yytext;
+ }
+<RulesPattern>"<<EOF>>" {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<RulesPattern>{EscapeRulesChar} {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<RulesPattern>{RulesSharp} {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<RulesPattern>{RulesCurly} {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<RulesPattern>{StartDouble} {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->lastContext = YY_START;
+ BEGIN(RulesDouble);
+ }
+<RulesDouble,RulesRoundDouble>"\\\\" {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<RulesDouble,RulesRoundDouble>"\\\"" {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<RulesDouble>"\"" {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ BEGIN( yyextra->lastContext ) ;
+ }
+<RulesRoundDouble>"\"" {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ BEGIN(RulesRound) ;
+ }
+<RulesDouble,RulesRoundDouble>. {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<RulesPattern>{StartSquare} {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->lastContext = YY_START;
+ BEGIN(RulesSquare);
+ }
+<RulesSquare,RulesRoundSquare>{CHARCE} {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<RulesSquare,RulesRoundSquare>"\\[" |
+<RulesSquare,RulesRoundSquare>"\\]" {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<RulesSquare>"]" {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ BEGIN(RulesPattern);
+ }
+<RulesRoundSquare>"]" {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ BEGIN(RulesRound) ;
+ }
+<RulesSquare,RulesRoundSquare>"\\\\" {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<RulesSquare,RulesRoundSquare>. {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<RulesPattern>{StartRoundQuest} {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->lastContext = YY_START;
+ BEGIN(RulesRoundQuest);
+ }
+<RulesRoundQuest>{nl} {
+ yyextra->cCodeBuffer += "\n";
+ }
+<RulesRoundQuest>[^)] {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<RulesRoundQuest>")" {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ BEGIN(yyextra->lastContext);
+ }
+<RulesPattern>{StartRound} {
+ yyextra->roundCount++;
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->lastContext = YY_START;
+ BEGIN(RulesRound);
+ }
+<RulesRound>{RulesCurly} {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<RulesRound>{StartSquare} {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ BEGIN(RulesRoundSquare);
+ }
+<RulesRound>{StartDouble} {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ BEGIN(RulesRoundDouble);
+ }
+<RulesRound>{EscapeRulesChar} {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<RulesRound>"(" {
+ yyextra->roundCount++;
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<RulesRound>")" {
+ yyextra->roundCount--;
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ if (!yyextra->roundCount) BEGIN( yyextra->lastContext ) ;
+ }
+<RulesRound>{nl} {
+ yyextra->cCodeBuffer += "\n";
+ }
+<RulesRound>{ws} {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<RulesRound>. {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<RulesPattern>{ws}+"|" {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ yyextra->curlyCount = 0;
+ BEGIN(SkipCurly);
+ }
+<RulesPattern>^{ws}*{nl} {
+ yyextra->cCodeBuffer += "\n";
+ }
+<RulesPattern>^{ws}+ {
+ }
+
+<RulesPattern>({ws}|{nl}) {
+ unput(*yytext);
+ yyextra->curlyCount = 0;
+ BEGIN(SkipCurly);
+ }
+<RulesPattern>"\\\\" {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<RulesPattern>{CCS} {
+ yyextra->cCodeBuffer += yytext;
+ yyextra->lastContext = YY_START;
+ BEGIN(COMMENT);
+ }
+<RulesPattern>. {
+ yyextra->cCodeBuffer += repeatChar(' ', yyleng);
+ }
+<SkipCurly>{B}*"#"{B}+[0-9]+{B}+/"\"" { /* line control directive */
+ yyextra->cCodeBuffer += yytext;
+ yyextra->lastPreLineCtrlContext = YY_START;
+ BEGIN( PreLineCtrl );
+ }
+<PreLineCtrl>"\""[^\n\"]*"\"" {
+ yyextra->cCodeBuffer += yytext;
+ }
+<PreLineCtrl>. {
+ yyextra->cCodeBuffer += yytext;
+ }
+<PreLineCtrl>\n {
+ yyextra->cCodeBuffer += yytext;
+ BEGIN( yyextra->lastPreLineCtrlContext );
+ }
+<SkipCurly>"{" {
+ yyextra->cCodeBuffer += yytext;
+ ++yyextra->curlyCount ;
+ }
+<SkipCurly>"}"/{BN}*{DCOMM}"<!--" | /* see bug710917 */
+<SkipCurly>"}" {
+ yyextra->cCodeBuffer += yytext;
+ if( yyextra->curlyCount )
+ {
+ --yyextra->curlyCount ;
+ }
+ }
+<SkipCurly>"}"{BN}*{DCOMM}"<" {
+ yyextra->cCodeBuffer += yytext;
+ if ( yyextra->curlyCount )
+ {
+ --yyextra->curlyCount ;
+ }
+ else
+ {
+ yyextra->docBlockContext = SkipCurlyEndDoc;
+ if (yytext[yyleng-3]=='/')
+ {
+ BEGIN( DocLine );
+ }
+ else
+ {
+ BEGIN( DocBlock );
+ }
+ }
+ }
+<SkipCurly>\" {
+ yyextra->cCodeBuffer += yytext;
+ yyextra->lastStringContext=SkipCurly;
+ BEGIN( SkipString );
+ }
+<SkipCurly>^{B}*"#" {
+ yyextra->cCodeBuffer += yytext;
+ yyextra->lastPreLineCtrlContext = YY_START;
+ BEGIN( PreLineCtrl );
+ }
+<SkipCurly>{B}*{RAWBEGIN} {
+ QCString raw=QCString(yytext).stripWhiteSpace();
+ yyextra->delimiter = raw.mid(2);
+ yyextra->delimiter=yyextra->delimiter.left(yyextra->delimiter.length()-1);
+ yyextra->lastRawStringContext = YY_START;
+ yyextra->cCodeBuffer += yytext;
+ BEGIN(RawString);
+ }
+<SkipCurly>[^\n#"'@\\/{}<]+ {
+ yyextra->cCodeBuffer += yytext;
+ }
+<SkipCurly>{CCS} {
+ yyextra->cCodeBuffer += yytext;
+ yyextra->lastCContext = YY_START;
+ BEGIN(SkipComment);
+ }
+<SkipCurly>{CPPC} {
+ yyextra->cCodeBuffer += yytext;
+ yyextra->lastCContext = YY_START;
+ BEGIN(SkipCxxComment);
+ }
+<SkipCurly>{CHARLIT} {
+ yyextra->cCodeBuffer += yytext;
+ }
+<SkipCurly>\' {
+ yyextra->cCodeBuffer += yytext;
+ }
+<SkipCurly>. {
+ yyextra->cCodeBuffer += yytext;
+ }
+<SkipCurly>({CPPC}{B}*)?{CCS}"!" {
+ yyextra->cCodeBuffer += yytext;
+ yyextra->docBlockContext = YY_START;
+ BEGIN( DocBlock );
+ }
+<SkipCurly>{CCS}"*"[*]+{BL} {
+ bool javadocBanner = Config_getBool(JAVADOC_BANNER);
+ yyextra->cCodeBuffer += yytext;
+ if( javadocBanner )
+ {
+ yyextra->docBlockContext = YY_START;
+ BEGIN( DocBlock );
+ }
+ else
+ {
+ BEGIN( Comment ) ;
+ }
+ }
+<SkipCurly>({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
+ yyextra->cCodeBuffer += yytext;
+ yyextra->docBlockContext = YY_START;
+ BEGIN( DocBlock );
+ }
+<SkipCurly>{CPPC}"!" {
+ yyextra->cCodeBuffer += yytext;
+ yyextra->docBlockContext = YY_START;
+ BEGIN( DocLine );
+ }
+<SkipCurly>{CPPC}"/"/[^/] {
+ yyextra->cCodeBuffer += yytext;
+ yyextra->docBlockContext = YY_START;
+ BEGIN( DocLine );
+ }
+
+<SkipCurly>\n {
+ yyextra->cCodeBuffer += yytext;
+ if (yyextra->curlyCount<=0)
+ {
+ BEGIN(RulesPattern);
+ }
+ }
+<SkipString>\\. {
+ yyextra->cCodeBuffer += yytext;
+ }
+<SkipString>\" {
+ yyextra->cCodeBuffer += yytext;
+ BEGIN( yyextra->lastStringContext );
+ }
+<SkipString>{CCS}|{CCE}|{CPPC} {
+ yyextra->cCodeBuffer += yytext;
+ }
+<SkipString>\n {
+ yyextra->cCodeBuffer += yytext;
+ }
+<SkipString>. {
+ yyextra->cCodeBuffer += yytext;
+ }
+<SkipCxxComment>.*"\\\n" { // line continuation
+ yyextra->cCodeBuffer += yytext;
+ }
+<SkipCxxComment>{ANYopt}/\n {
+ yyextra->cCodeBuffer += yytext;
+ BEGIN( yyextra->lastCContext ) ;
+ }
+<Comment>{BN}+ {
+ yyextra->cCodeBuffer += yytext ;
+ }
+<Comment>{CCS} { yyextra->cCodeBuffer += yytext ; }
+<Comment>{CPPC} { yyextra->cCodeBuffer += yytext ; }
+<Comment>{CMD}("code"|"verbatim") {
+ yyextra->insideCode=TRUE;
+ yyextra->cCodeBuffer += yytext ;
+ }
+<Comment>{CMD}("endcode"|"endverbatim") {
+ yyextra->insideCode=FALSE;
+ 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 ; }
+
+<SkipComment>{CPPC}|{CCS} {
+ yyextra->cCodeBuffer += yytext;
+ }
+<SkipComment>[^\*\n]+ {
+ yyextra->cCodeBuffer += yytext;
+ }
+<SkipComment>\n {
+ yyextra->cCodeBuffer += yytext;
+ }
+<SkipComment>{B}*{CCE} {
+ yyextra->cCodeBuffer += yytext;
+ BEGIN( yyextra->lastCContext );
+ }
+<SkipComment>"*" {
+ yyextra->cCodeBuffer += yytext;
+ }
+<RawString>{RAWEND} {
+ yyextra->cCodeBuffer += yytext;
+ QCString delimiter = yytext+1;
+ delimiter=delimiter.left(delimiter.length()-1);
+ if (delimiter==yyextra->delimiter)
+ {
+ BEGIN(yyextra->lastRawStringContext);
+ }
+ }
+<RawString>[^)\n]+ {
+ yyextra->cCodeBuffer += yytext;
+ }
+<RawString>. {
+ yyextra->cCodeBuffer += yytext;
+ }
+<RawString>\n {
+ yyextra->cCodeBuffer += yytext;
+ }
+
+
+ /* ---- Single line comments ------ */
+<DocLine>[^\n]*"\n"[ \t]*{CPPC}[/!][<]? { // continuation of multiline C++-style comment
+ yyextra->cCodeBuffer += yytext;
+ }
+<DocLine>{B}*{CPPC}"/"[/]+{Bopt}/"\n" { // ignore marker line (see bug700345)
+ 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;
+ BEGIN( yyextra->docBlockContext );
+ }
+<DocLine>{NONLopt}/"\n" { // whole line
+ yyextra->cCodeBuffer += yytext;
+ BEGIN( yyextra->docBlockContext );
+ }
+
+ /* ---- Comments blocks ------ */
+
+<DocBlock>"*"*{CCE} { // end of comment block
+ yyextra->cCodeBuffer += yytext;
+ BEGIN(yyextra->docBlockContext);
+ }
+<DocBlock>^{B}*"*"+/[^/] {
+ yyextra->cCodeBuffer += yytext;
+ }
+<DocBlock>^{B}*({CPPC})?{B}*"*"+/[^/a-z_A-Z0-9*] { // start of a comment line
+ yyextra->cCodeBuffer += yytext;
+ }
+<DocBlock>^{B}*({CPPC}){B}* { // strip embedded C++ comments if at the start of a line
+ yyextra->cCodeBuffer += yytext;
+ }
+<DocBlock>{CPPC} { // slashes in the middle of a comment block
+ yyextra->cCodeBuffer += yytext;
+ }
+<DocBlock>{CCS} { // start of a new comment in the
+ // middle of a comment block
+ yyextra->cCodeBuffer += yytext;
+ }
+<DocBlock>({CMD}{CMD}){ID}/[^a-z_A-Z0-9] { // escaped command
+ yyextra->cCodeBuffer += yytext;
+ }
+<DocBlock>{CMD}("f$"|"f["|"f{") {
+ yyextra->cCodeBuffer += yytext;
+ yyextra->docBlockName=&yytext[1];
+ if (yyextra->docBlockName.at(1)=='{')
+ {
+ yyextra->docBlockName.at(1)='}';
+ }
+ yyextra->fencedSize=0;
+ yyextra->nestedComment=FALSE;
+ BEGIN(DocCopyBlock);
+ }
+<DocBlock>{B}*"<"{PRE}">" {
+ 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->docBlockName=&yytext[1];
+ yyextra->fencedSize=0;
+ yyextra->nestedComment=FALSE;
+ BEGIN(DocCopyBlock);
+ }
+<DocBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
+ yyextra->cCodeBuffer += yytext;
+ QCString pat = substitute(yytext,"*"," ");
+ yyextra->docBlockName="~~~";
+ yyextra->fencedSize=pat.stripWhiteSpace().length();
+ yyextra->nestedComment=FALSE;
+ BEGIN(DocCopyBlock);
+ }
+<DocBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
+ yyextra->cCodeBuffer += yytext;
+ QCString pat = substitute(yytext,"*"," ");
+ yyextra->docBlockName="```";
+ yyextra->fencedSize=pat.stripWhiteSpace().length();
+ yyextra->nestedComment=FALSE;
+ BEGIN(DocCopyBlock);
+ }
+<DocBlock>{B}*"<code>" {
+ REJECT;
+ }
+<DocBlock>[^@*~\/\\\n]+ { // any character that isn't special
+ yyextra->cCodeBuffer += yytext;
+ }
+<DocBlock>\n { // newline
+ yyextra->cCodeBuffer += yytext;
+ }
+<DocBlock>. { // command block
+ yyextra->cCodeBuffer += yytext;
+ }
+ /* ---- Copy verbatim sections ------ */
+
+<DocCopyBlock>"</"{PRE}">" { // end of a <pre> block
+ yyextra->cCodeBuffer += yytext;
+ if (yyextra->docBlockName=="<pre>")
+ {
+ BEGIN(DocBlock);
+ }
+ }
+<DocCopyBlock>"</"{CODE}">" { // end of a <code> block
+ yyextra->cCodeBuffer += yytext;
+ if (yyextra->docBlockName=="<code>")
+ {
+ BEGIN(DocBlock);
+ }
+ }
+<DocCopyBlock>[\\@]("f$"|"f]"|"f}") {
+ 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;
+ if (&yytext[4]==yyextra->docBlockName)
+ {
+ BEGIN(DocBlock);
+ }
+ }
+<DocCopyBlock>^{B}*"*"+/{BN}+ { // start of a comment line
+ yyextra->cCodeBuffer += yytext;
+ if (yyextra->docBlockName=="verbatim")
+ {
+ REJECT;
+ }
+ else if (yyextra->docBlockName=="code")
+ {
+ REJECT;
+ }
+ else
+ {
+ yyextra->cCodeBuffer += yytext;
+ }
+ }
+<DocCopyBlock>^{B}*"*"+/{B}+"*"{BN}* { // start of a comment line with two *'s
+ if (yyextra->docBlockName=="code")
+ {
+ yyextra->cCodeBuffer += yytext;
+ }
+ else
+ {
+ REJECT;
+ }
+ }
+<DocCopyBlock>^{B}*"*"+/({ID}|"(") { // Assume *var or *(... is part of source code (see bug723516)
+ if (yyextra->docBlockName=="code")
+ {
+ yyextra->cCodeBuffer += yytext;
+ }
+ else
+ {
+ REJECT;
+ }
+ }
+<DocCopyBlock>^{B}*"*"+/{BN}* { // start of a comment line with one *
+ if (yyextra->docBlockName=="code")
+ {
+ if (yyextra->nestedComment) // keep * it is part of the code
+ {
+ yyextra->cCodeBuffer += yytext;
+ }
+ else // remove * it is part of the comment block
+ {
+ yyextra->cCodeBuffer += yytext;
+ }
+ }
+ else
+ {
+ REJECT;
+ }
+ }
+<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
+ yyextra->cCodeBuffer += yytext;
+ QCString pat = substitute(yytext,"*"," ");
+ if (yyextra->fencedSize==pat.stripWhiteSpace().length())
+ {
+ BEGIN(DocBlock);
+ }
+ }
+<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"```"[`]* {
+ yyextra->cCodeBuffer += yytext;
+ QCString pat = substitute(yytext,"*"," ");
+ if (yyextra->fencedSize==pat.stripWhiteSpace().length())
+ {
+ BEGIN(DocBlock);
+ }
+ }
+<DocCopyBlock>[^\<@/\*\]~\$\\\n]+ { // any character that is not special
+ yyextra->cCodeBuffer += yytext;
+ }
+<DocCopyBlock>{CCS}|{CCE}|{CPPC} {
+ if (yytext[1]=='*')
+ {
+ yyextra->nestedComment=TRUE;
+ }
+ else if (yytext[0]=='*')
+ {
+ yyextra->nestedComment=FALSE;
+ }
+ yyextra->cCodeBuffer += yytext;
+ }
+<DocCopyBlock>\n { // newline
+ yyextra->cCodeBuffer += yytext;
+ }
+<DocCopyBlock>. { // any other character
+ yyextra->cCodeBuffer += yytext;
+ }
+<SkipCurlyEndDoc>"}"{BN}*{DCOMM}"<" { // desc is followed by another one
+ yyextra->docBlockContext = SkipCurlyEndDoc;
+ yyextra->cCodeBuffer += yytext;
+ if (yytext[yyleng-3]=='/')
+ {
+ BEGIN( DocLine );
+ }
+ else
+ {
+ BEGIN( DocBlock );
+ }
+ }
+<SkipCurlyEndDoc>"}" {
+ yyextra->cCodeBuffer += yytext;
+ BEGIN(SkipCurly);
+ }
+
+<UserSection>.*{nl} {
+ yyextra->cCodeBuffer += yytext;
+ }
+
+
+ /*
+<*>. { fprintf(stderr,"Lex scanner Def rule for %s: #%s#\n",stateToString(YY_START),yytext);}
+<*>{nl} { fprintf(stderr,"Lex scanner Def rule for newline %s: #%s#\n",stateToString(YY_START),yytext);}
+ */
+<*><<EOF>> {
+ handleCCode(yyscanner);
+ yyterminate();
+ }
+%%
+
+//----------------------------------------------------------------------------
+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 c=0;
+ while( c < max_size && yyextra->inputString[yyextra->inputPosition] )
+ {
+ *buf = yyextra->inputString[yyextra->inputPosition++] ;
+ //printf("%d (%c)\n",*buf,*buf);
+ c++; buf++;
+ }
+ return c;
+}
+
+//-----------------------------------------------------------------------------
+
+static void parseMain(yyscan_t yyscanner,
+ const QCString &fileName,
+ const char *fileBuf,
+ const std::shared_ptr<Entry> &rt,
+ ClangTUParser *clangParser)
+{
+ struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+
+ yyextra->inputString = fileBuf;
+ yyextra->inputPosition = 0;
+ lexscannerYYrestart(0,yyscanner);
+
+ yyextra->current_root = rt;
+ yyextra->yyFileName = fileName;
+ yyextra->clangParser = clangParser;
+ yyextra->language = getLanguageFromFileName(yyextra->yyFileName);
+ rt->lang = yyextra->language;
+ msg("Parsing file %s...\n",qPrint(yyextra->yyFileName));
+
+ yyextra->current_root = rt;
+ yyextra->current = std::make_shared<Entry>();
+ int sec=guessSection(yyextra->yyFileName);
+ if (sec)
+ {
+ yyextra->current->name = yyextra->yyFileName;
+ yyextra->current->section = sec;
+ yyextra->current_root->moveToSubEntryAndRefresh(yyextra->current);
+ }
+ yyextra->current->reset();
+ BEGIN( DefSection );
+
+ lexscannerYYlex(yyscanner);
+
+ rt->program.str(std::string());
+}
+
+//----------------------------------------------------------------------------
+
+
+static void handleCCode(yyscan_t yyscanner)
+{
+ struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
+
+ if (yyextra->cCodeBuffer.isEmpty()) return;
+ yyextra->cOutlineParser.parseInput(yyextra->yyFileName,
+ yyextra->cCodeBuffer.data(),
+ yyextra->current_root,
+ yyextra->clangParser);
+ yyextra->cCodeBuffer.resize(0);
+ return;
+}
+//----------------------------------------------------------------------------
+
+struct LexOutlineParser::Private
+{
+ yyscan_t yyscanner;
+ lexscannerYY_state state;
+};
+
+LexOutlineParser::LexOutlineParser() : p(std::make_unique<LexOutlineParser::Private>())
+{
+ lexscannerYYlex_init_extra(&p->state,&p->yyscanner);
+#ifdef FLEX_DEBUG
+ lexscannerYYset_debug(1,p->yyscanner);
+#endif
+}
+
+LexOutlineParser::~LexOutlineParser()
+{
+ lexscannerYYlex_destroy(p->yyscanner);
+}
+
+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__, qPrint(fileName));
+
+ ::parseMain(p->yyscanner,fileName,fileBuf,root,clangParser);
+
+ printlex(yy_flex_debug, FALSE, __FILE__, qPrint(fileName));
+}
+
+
+//----------------------------------------------------------------------------
+
+#if USE_STATE2STRING
+#include "lexscanner.l.h"
+#endif
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 875cd14..93ae712 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,12 @@
#include "filedef.h"
#include "htmlentity.h"
#include "emoji.h"
+#include "fileinfo.h"
+
+ManListItemInfo man_listItemInfo[man_maxIndentLevels];
-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 +113,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 +169,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 +200,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 +250,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 +268,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 +290,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 +307,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 +327,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 +353,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,28 +373,28 @@ 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";
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide = TRUE;
}
if (op->type()!=DocIncOperator::Skip)
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide)
{
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,
@@ -407,23 +408,23 @@ void ManDocVisitor::visit(DocIncOperator *op)
);
if (fd) delete fd;
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
if (op->isLast())
{
- popEnabled();
+ 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 +467,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 +475,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 +485,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 +509,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 +528,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 +572,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 +593,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 +617,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;
}
@@ -644,20 +645,35 @@ void ManDocVisitor::visitPost(DocSection *)
{
}
-void ManDocVisitor::visitPre(DocHtmlList *)
+void ManDocVisitor::visitPre(DocHtmlList *l)
{
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";
+ man_listItemInfo[m_indent].number = 1;
+ man_listItemInfo[m_indent].type = '1';
+ for (const auto &opt : l->attribs())
+ {
+ if (opt.name=="type")
+ {
+ man_listItemInfo[m_indent].type = opt.value[0];
+ }
+ if (opt.name=="start")
+ {
+ bool ok;
+ int val = opt.value.toInt(&ok);
+ if (ok) man_listItemInfo[m_indent].number = val;
+ }
+ }
}
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,41 +681,63 @@ 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)
{
- m_t << li->itemNumber() << ".\" " << m_indent+2;
+ switch (man_listItemInfo[m_indent].type)
+ {
+ case '1':
+ m_t << man_listItemInfo[m_indent].number;
+ break;
+ case 'a':
+ m_t << integerToAlpha(man_listItemInfo[m_indent].number,false);
+ break;
+ case 'A':
+ m_t << integerToAlpha(man_listItemInfo[m_indent].number);
+ break;
+ case 'i':
+ m_t << integerToRoman(man_listItemInfo[m_indent].number,false);
+ break;
+ case 'I':
+ m_t << integerToRoman(man_listItemInfo[m_indent].number);
+ break;
+ default:
+ m_t << man_listItemInfo[m_indent].number;
+ break;
+ }
+ m_t << ".\" " << m_indent+2;
+ man_listItemInfo[m_indent].number++;
}
else // bullet list
{
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 +748,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 +764,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 +811,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 +841,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 +849,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 +915,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 +937,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 +946,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 +963,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;
}
@@ -942,21 +980,17 @@ void ManDocVisitor::visitPre(DocParamList *pl)
{
if (m_hide) return;
m_t << "\\fI";
- //QStrListIterator li(pl->parameters());
- //const char *s;
- QListIterator<DocNode> li(pl->parameters());
- DocNode *param;
bool first=TRUE;
- for (li.toFirst();(param=li.current());++li)
+ for (const auto &param : pl->parameters())
{
if (!first) m_t << ","; else first=FALSE;
if (param->kind()==DocNode::Kind_Word)
{
- visit((DocWord*)param);
+ visit((DocWord*)param.get());
}
else if (param->kind()==DocNode::Kind_LinkedWord)
{
- visit((DocLinkedWord*)param);
+ visit((DocLinkedWord*)param.get());
}
}
m_t << "\\fP ";
@@ -967,8 +1001,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";
}
}
@@ -978,22 +1012,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;
}
@@ -1022,18 +1056,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;
}
@@ -1054,11 +1088,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++))
{
@@ -1073,16 +1107,3 @@ void ManDocVisitor::filter(const char *str)
}
}
-void ManDocVisitor::pushEnabled()
-{
- m_enabled.push(new bool(m_hide));
-}
-
-void ManDocVisitor::popEnabled()
-{
- bool *v=m_enabled.pop();
- ASSERT(v!=0);
- m_hide = *v;
- delete v;
-}
-
diff --git a/src/mandocvisitor.h b/src/mandocvisitor.h
index fa65424..332ca70 100644
--- a/src/mandocvisitor.h
+++ b/src/mandocvisitor.h
@@ -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.
*
@@ -19,23 +19,24 @@
#ifndef _MANDOCVISITOR_H
#define _MANDOCVISITOR_H
+#include <iostream>
+
+#include "qcstring.h"
#include "docvisitor.h"
-#include <qstack.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
//--------------------------------------
-
+
void visit(DocWord *);
void visit(DocLinkedWord *);
void visit(DocWhiteSpace *);
@@ -57,7 +58,7 @@ class ManDocVisitor : public DocVisitor
//--------------------------------------
// visitor functions for compound nodes
//--------------------------------------
-
+
void visitPre(DocAutoList *);
void visitPost(DocAutoList *);
void visitPre(DocAutoListItem *);
@@ -140,26 +141,31 @@ class ManDocVisitor : public DocVisitor
private:
//--------------------------------------
- // helper functions
+ // helper functions
//--------------------------------------
-
- void filter(const char *str);
- void pushEnabled();
- void popEnabled();
+ void filter(const QCString &str);
//--------------------------------------
// state variables
//--------------------------------------
- FTextStream &m_t;
+ TextStream &m_t;
CodeOutputInterface &m_ci;
bool m_insidePre;
bool m_hide;
bool m_firstCol;
int m_indent;
- QStack<bool> m_enabled;
QCString m_langExt;
};
+struct ManListItemInfo
+{
+ int number;
+ char type;
+};
+
+const int man_maxIndentLevels = 13;
+
+extern ManListItemInfo man_listItemInfo[man_maxIndentLevels];
#endif
diff --git a/src/mangen.cpp b/src/mangen.cpp
index e58aa6e..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,69 +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.setEncoding(QTextStream::UnicodeUTF8);
- 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;
}
@@ -507,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;
@@ -521,7 +518,7 @@ void ManGenerator::endDescForItem()
void ManGenerator::endDescItem()
{
- t << "\" 1c" << endl;
+ m_t << "\" 1c\n";
m_firstCol=TRUE;
}
@@ -542,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;
}
}
@@ -566,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;
}
@@ -587,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 )
{
@@ -609,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 )
{
@@ -633,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;
@@ -643,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;
}
@@ -658,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;
}
@@ -678,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;
}
@@ -698,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;
}
@@ -729,7 +726,7 @@ void ManGenerator::endConstraintParam()
{
endEmphasis();
endItemListItem();
- t << " : ";
+ m_t << " : ";
}
void ManGenerator::startConstraintType()
@@ -748,7 +745,7 @@ void ManGenerator::startConstraintDocs()
void ManGenerator::endConstraintDocs()
{
- t << endl; m_firstCol=TRUE;
+ m_t << "\n"; m_firstCol=TRUE;
}
void ManGenerator::endConstraintList()
@@ -760,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;
}
@@ -775,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());
@@ -786,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;
}
@@ -804,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()
@@ -823,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;
}
@@ -833,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 2bc8206..4627e73 100644
--- a/src/markdown.cpp
+++ b/src/markdown.cpp
@@ -32,12 +32,10 @@
*/
#include <stdio.h>
-#include <qglobal.h>
-#include <qregexp.h>
-#include <qfileinfo.h>
#include <unordered_map>
#include <functional>
+#include <atomic>
#include "markdown.h"
#include "growbuf.h"
@@ -51,6 +49,9 @@
#include "section.h"
#include "message.h"
#include "portable.h"
+#include "regex.h"
+#include "fileinfo.h"
+#include "utf8.h"
#if !defined(NDEBUG)
#define ENABLE_TRACING
@@ -68,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++)
{
@@ -97,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++;
}
}
@@ -107,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,...)
@@ -115,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);
@@ -124,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;
};
@@ -172,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;
@@ -213,14 +214,34 @@ inline int isNewline(const char *data)
return 0;
}
+// escape double quotes in string
+static QCString escapeDoubleQuotes(const QCString &s)
+{
+ TRACE(s);
+ if (s.isEmpty()) return s;
+ GrowBuf growBuf;
+ const char *p=s.data();
+ char c,pc='\0';
+ while ((c=*p++))
+ {
+ switch (c)
+ {
+ case '"': if (pc!='\\') { growBuf.addChar('\\'); } growBuf.addChar(c); break;
+ default: growBuf.addChar(c); break;
+ }
+ pc=c;
+ }
+ growBuf.addChar(0);
+ return growBuf.get();
+}
// 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++))
{
@@ -242,11 +263,9 @@ 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);
- result.at(size)='\0';
+ result = QCString(data,(uint)size);
}
/** helper function to convert presence of left and/or right alignment markers
@@ -414,7 +433,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;
}
@@ -676,13 +695,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;
}
@@ -702,7 +721,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;
}
@@ -775,13 +794,13 @@ void Markdown::writeMarkdownImage(const char *fmt, bool explicitTitle,
if (!explicitTitle && !content.isEmpty())
{
m_out.addStr(" \"");
- m_out.addStr(content);
+ m_out.addStr(escapeDoubleQuotes(content));
m_out.addStr("\"");
}
else if ((content.isEmpty() || explicitTitle) && !title.isEmpty())
{
m_out.addStr(" \"");
- m_out.addStr(title);
+ m_out.addStr(escapeDoubleQuotes(title));
m_out.addStr("\"");
}
else
@@ -841,7 +860,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 ]
@@ -890,7 +909,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);
@@ -920,7 +939,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
{
@@ -947,7 +966,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
{
@@ -960,11 +979,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++;
@@ -973,7 +992,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;
@@ -1049,16 +1068,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();
@@ -1092,12 +1111,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;
}
}
@@ -1165,7 +1184,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)
@@ -1207,7 +1226,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);
@@ -1344,7 +1363,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++;
@@ -1365,7 +1384,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;
@@ -1410,7 +1429,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",
@@ -1450,16 +1469,16 @@ static int isHRuler(const char *data,int size)
static QCString extractTitleId(QCString &title, int level)
{
- TRACE(title.data());
- //static QRegExp r1("^[a-z_A-Z][a-z_A-Z0-9\\-]*:");
- static QRegExp r2("\\{#[a-z_A-Z][a-z_A-Z0-9\\-]*\\}");
- int l=0;
- int i = r2.match(title,0,&l);
- if (i!=-1 && title.mid(i+l).stripWhiteSpace().isEmpty()) // found {#id} style id
- {
- QCString id = title.mid(i+2,l-3);
- title = title.left(i);
- //printf("found id='%s' title='%s'\n",id.data(),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;
+ std::string ti = title.str();
+ if (reg::search(ti,match,r2))
+ {
+ std::string id = match[1].str();
+ title = title.left((int)match.position());
+ //printf("found match id='%s' title=%s\n",id.c_str(),qPrint(title));
return id;
}
if ((level > 0) && (level <= Config_getInt(TOC_INCLUDE_HEADINGS)))
@@ -1467,10 +1486,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 "";
}
@@ -1620,7 +1639,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;
}
@@ -1710,8 +1729,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))
@@ -2156,7 +2175,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;
@@ -2169,7 +2188,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++;
@@ -2233,10 +2252,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;
}
@@ -2276,7 +2295,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,
@@ -2296,7 +2315,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();
@@ -2312,7 +2331,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;
@@ -2348,14 +2367,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();
@@ -2420,7 +2439,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);
@@ -2440,7 +2459,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())
@@ -2470,7 +2489,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;
@@ -2479,8 +2498,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;
@@ -2515,7 +2534,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
@@ -2531,7 +2550,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)
@@ -2554,7 +2573,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;
@@ -2597,13 +2616,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();
@@ -2638,23 +2657,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)
+ int bytes = getUTF8CharNumBytes(c);
+ for (int j=0;j<bytes-1 && c;j++)
{
- m_out.addChar(data[i++]); // 3 bytes
- }
- if (((uchar)c&0xF0)==0xF0 && i<size)
- {
- m_out.addChar(data[i++]); // 4 byres
+ m_out.addChar(c);
+ c = data[i++];
}
+ m_out.addChar(c);
}
}
else
@@ -2682,19 +2699,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()));
@@ -2710,7 +2727,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;
}
@@ -2719,8 +2736,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;
@@ -2750,7 +2768,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*/)
@@ -2768,7 +2786,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();
@@ -2777,8 +2795,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 ");
@@ -2835,7 +2853,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 8f09347..dc5d095 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -13,10 +13,10 @@
*
*/
+
#include <stdio.h>
-#include <qglobal.h>
-#include <qregexp.h>
#include <assert.h>
+
#include "md5.h"
#include "memberdef.h"
#include "membername.h"
@@ -36,7 +36,6 @@
#include "dotcallgraph.h"
#include "searchindex.h"
#include "parserintf.h"
-
#include "vhdldocgen.h"
#include "arguments.h"
#include "memberlist.h"
@@ -44,17 +43,18 @@
#include "filedef.h"
#include "config.h"
#include "definitionimpl.h"
+#include "regex.h"
//-----------------------------------------------------------------------------
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;
@@ -183,15 +183,15 @@ class MemberDefImpl : public DefinitionMixin<MemberDefMutable>
virtual bool isDetailedSectionLinkable() const;
virtual bool isFriendClass() const;
virtual bool isDocumentedFriendClass() const;
- virtual MemberDef *reimplements() const;
- virtual MemberList *reimplementedBy() const;
+ virtual const MemberDef *reimplements() const;
+ virtual const MemberList &reimplementedBy() const;
virtual bool isReimplementedBy(const ClassDef *cd) const;
virtual ClassDef *relatedAlso() const;
virtual bool hasDocumentedEnumValues() const;
virtual const MemberDef *getAnonymousEnumType() const;
virtual bool isDocsForDefinition() const;
virtual const MemberDef *getEnumScope() const;
- virtual const MemberList *enumFieldList() const;
+ virtual const MemberList &enumFieldList() const;
virtual void setEnumBaseType(const QCString &type);
virtual QCString enumBaseType() const;
virtual bool hasExamples() const;
@@ -212,7 +212,7 @@ class MemberDefImpl : public DefinitionMixin<MemberDefMutable>
virtual bool visibleMemberGroup(bool hideNoHeader) const;
virtual bool hasReferencesRelation() const;
virtual bool hasReferencedByRelation() const;
- virtual MemberDef *templateMaster() const;
+ virtual const MemberDef *templateMaster() const;
virtual QCString getScopeString() const;
virtual ClassDef *getClassDefOfAnonymousType() const;
virtual bool isTypedefValCached() const;
@@ -221,14 +221,15 @@ class MemberDefImpl : public DefinitionMixin<MemberDefMutable>
virtual QCString getCachedResolvedTypedef() const;
virtual MemberDef *memberDefinition() const;
virtual MemberDef *memberDeclaration() const;
- virtual MemberDef *inheritsDocsFrom() const;
+ virtual const MemberDef *inheritsDocsFrom() const;
virtual const MemberDef *getGroupAlias() const;
virtual ClassDef *category() const;
- virtual MemberDef *categoryRelation() const;
+ 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,37 +238,37 @@ 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(MemberDef *md);
+ virtual void setInheritsDocsFrom(const MemberDef *md);
virtual void setTagInfo(const TagInfo *i);
- virtual void setArgsString(const char *as);
- virtual void setReimplements(MemberDef *md);
- virtual void insertReimplementedBy(MemberDef *md);
+ virtual void setArgsString(const QCString &as);
+ virtual void setReimplements(const MemberDef *md);
+ virtual void insertReimplementedBy(const MemberDef *md);
virtual void setRelatedAlso(ClassDef *cd);
- virtual void insertEnumField(MemberDef *md);
- virtual void setEnumScope(MemberDef *md,bool livesInsideEnum=FALSE);
- virtual void setEnumClassScope(ClassDef *cd);
+ virtual void insertEnumField(const MemberDef *md);
+ virtual void setEnumScope(const MemberDef *md,bool livesInsideEnum=FALSE);
+ 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);
@@ -287,7 +288,7 @@ class MemberDefImpl : public DefinitionMixin<MemberDefMutable>
virtual void enableCallerGraph(bool e);
virtual void enableReferencedByRelation(bool e);
virtual void enableReferencesRelation(bool e);
- virtual void setTemplateMaster(MemberDef *mt);
+ virtual void setTemplateMaster(const MemberDef *mt);
virtual void addListReference(Definition *d);
virtual void setDocsForDefinition(bool b);
virtual void setGroupAlias(const MemberDef *md);
@@ -297,25 +298,26 @@ class MemberDefImpl : public DefinitionMixin<MemberDefMutable>
virtual void setMemberDefinition(MemberDef *md);
virtual void setMemberDeclaration(MemberDef *md);
virtual void setAnonymousUsed() const;
- virtual void copyArgumentNames(MemberDef *bmd);
+ virtual void copyArgumentNames(const MemberDef *bmd);
virtual void setCategory(ClassDef *);
- virtual void setCategoryRelation(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 setCategoryRelation(const MemberDef *);
+ 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(); }
@@ -633,9 +637,9 @@ class MemberDefAliasImpl : public DefinitionAliasMixin<MemberDef>
{ return getMdAlias()->isFriendClass(); }
virtual bool isDocumentedFriendClass() const
{ return getMdAlias()->isDocumentedFriendClass(); }
- virtual MemberDef *reimplements() const
+ virtual const MemberDef *reimplements() const
{ return getMdAlias()->reimplements(); }
- virtual MemberList *reimplementedBy() const
+ virtual const MemberList &reimplementedBy() const
{ return getMdAlias()->reimplementedBy(); }
virtual bool isReimplementedBy(const ClassDef *cd) const
{ return getMdAlias()->isReimplementedBy(cd); }
@@ -649,7 +653,7 @@ class MemberDefAliasImpl : public DefinitionAliasMixin<MemberDef>
{ return getMdAlias()->isDocsForDefinition(); }
virtual const MemberDef *getEnumScope() const
{ return getMdAlias()->getEnumScope(); }
- virtual const MemberList *enumFieldList() const
+ virtual const MemberList &enumFieldList() const
{ return getMdAlias()->enumFieldList(); }
virtual QCString enumBaseType() const
{ return getMdAlias()->enumBaseType(); }
@@ -687,7 +691,7 @@ class MemberDefAliasImpl : public DefinitionAliasMixin<MemberDef>
{ return getMdAlias()->hasReferencesRelation(); }
virtual bool hasReferencedByRelation() const
{ return getMdAlias()->hasReferencedByRelation(); }
- virtual MemberDef *templateMaster() const
+ virtual const MemberDef *templateMaster() const
{ return getMdAlias()->templateMaster(); }
virtual QCString getScopeString() const
{ return getMdAlias()->getScopeString(); }
@@ -705,20 +709,20 @@ class MemberDefAliasImpl : public DefinitionAliasMixin<MemberDef>
{ return getMdAlias()->memberDefinition(); }
virtual MemberDef *memberDeclaration() const
{ return getMdAlias()->memberDeclaration(); }
- virtual MemberDef *inheritsDocsFrom() const
+ virtual const MemberDef *inheritsDocsFrom() const
{ return getMdAlias()->inheritsDocsFrom(); }
virtual const MemberDef *getGroupAlias() const
{ return getMdAlias()->getGroupAlias(); }
virtual ClassDef *category() const
{ return getMdAlias()->category(); }
- virtual MemberDef *categoryRelation() const
+ virtual const MemberDef *categoryRelation() const
{ return getMdAlias()->categoryRelation(); }
virtual QCString displayName(bool b=TRUE) const
{ 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)
{
@@ -920,27 +926,12 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
ol.startParameterName(TRUE);
}
}
- QRegExp re(")("),res("(.*\\*");
- int vp=a.type.find(re);
- int wp=a.type.find(res);
-
- // use the following to put the function pointer type before the name
- bool hasFuncPtrType=FALSE;
if (!a.attrib.isEmpty() && !md->isObjCMethod()) // argument has an IDL attribute
{
ol.docify(a.attrib+" ");
}
- if (hasFuncPtrType) // argument type is a function pointer
- {
- //printf("a.type='%s' a.name='%s'\n",a.type.data(),a.name.data());
- QCString n=a.type.left(vp);
- if (hasFuncPtrType) n=a.type.left(wp);
- if (md->isObjCMethod()) { n.prepend("("); n.append(")"); }
- if (!cName.isEmpty()) n=addTemplateNames(n,scope->name(),cName);
- linkifyText(TextGeneratorOLImpl(ol),scope,md->getBodyDef(),md,n);
- }
- else // non-function pointer type
+
{
QCString n=a.type;
if (md->isObjCMethod()) { n.prepend("("); n.append(")"); }
@@ -950,6 +941,7 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
linkifyText(TextGeneratorOLImpl(ol),scope,md->getBodyDef(),md,n);
}
}
+
if (!isDefine)
{
if (paramTypeStarted)
@@ -959,16 +951,8 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
}
ol.startParameterName(defArgList.size()<2);
}
- if (hasFuncPtrType)
- {
- ol.docify(a.type.mid(wp,vp-wp));
- }
if (!a.name.isEmpty() || a.type=="...") // argument has a name
{
- //if (!hasFuncPtrType)
- //{
- // ol.docify(" ");
- //}
ol.disable(OutputGenerator::Latex);
ol.disable(OutputGenerator::Docbook);
ol.disable(OutputGenerator::Html);
@@ -992,12 +976,6 @@ static bool writeDefArgumentList(OutputList &ol,const Definition *scope,const Me
{
ol.docify(a.array);
}
- if (hasFuncPtrType) // write the part of the argument type
- // that comes after the name
- {
- linkifyText(TextGeneratorOLImpl(ol),scope,md->getBodyDef(),
- md,a.type.right(a.type.length()-vp));
- }
if (!a.defval.isEmpty()) // write the default value
{
QCString n=a.defval;
@@ -1019,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
@@ -1051,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());
}
@@ -1089,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)
{
@@ -1100,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);
}
@@ -1109,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
{
@@ -1147,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("> ");
-}
-
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
@@ -1176,23 +1134,23 @@ 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
const FileDef *fileDef = 0; // member of file definition
const NamespaceDef *nspace = 0; // the namespace this member is in.
- MemberDef *enumScope = 0; // the enclosing scope, if this is an enum field
+ const MemberDef *enumScope = 0; // the enclosing scope, if this is an enum field
bool livesInsideEnum = false;
const MemberDef *annEnumType = 0; // the anonymous enum that is the type of this member
- MemberList *enumFields = 0; // enumeration fields
+ MemberList enumFields; // enumeration fields
- MemberDef *redefines = 0; // the members that this member redefines
- MemberList *redefinedBy = 0; // the list of members that redefine this one
+ const MemberDef *redefines = 0; // the members that this member redefines
+ MemberList redefinedBy; // the list of members that redefine this one
MemberDef *memDef = 0; // member definition for this declaration
MemberDef *memDec = 0; // member declaration for this definition
@@ -1217,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
@@ -1230,7 +1189,7 @@ class MemberDefImpl::IMPL
ArgumentList tArgList; // template argument list of function template
ArgumentList typeConstraints; // type constraints for template parameters
- MemberDef *templateMaster;
+ const MemberDef *templateMaster;
ArgumentLists defTmpArgLists; // lists of template argument lists
// (for template functions in nested template classes)
@@ -1262,7 +1221,7 @@ class MemberDefImpl::IMPL
//QCString inbodyDocs;
// documentation inheritance
- MemberDef *docProvider = 0;
+ const MemberDef *docProvider = 0;
// to store the output file base from tag files
QCString explicitOutputFileBase;
@@ -1292,49 +1251,38 @@ class MemberDefImpl::IMPL
// definition.
// FALSE => block is put before declaration.
ClassDef *category = 0;
- MemberDef *categoryRelation = 0;
+ const MemberDef *categoryRelation = 0;
QCString declFileName;
- int declLine = 0;
- int declColumn = 0;
+ int declLine = -1;
+ int declColumn = -1;
int numberOfFlowKW = 0;
};
-MemberDefImpl::IMPL::IMPL() :
- enumFields(0),
- redefinedBy(0),
- category(0),
- categoryRelation(0),
- declLine(-1),
- declColumn(-1),
- numberOfFlowKW(0)
+MemberDefImpl::IMPL::IMPL() : enumFields(MemberListType_enumFields)
{
}
MemberDefImpl::IMPL::~IMPL()
{
- delete redefinedBy;
- delete enumFields;
}
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;
fileDef=0;
redefines=0;
relatedAlso=0;
- redefinedBy=0;
accessorClass=0;
nspace=0;
memDef=0;
memDec=0;
group=0;
grpId=-1;
- enumFields=0;
enumScope=0;
livesInsideEnum=FALSE;
hasCallGraph = FALSE;
@@ -1381,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;
@@ -1426,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);
@@ -1454,28 +1402,6 @@ MemberDef *MemberDefImpl::deepCopy() const
MemberDefImpl *result = new MemberDefImpl(*this);
// first copy everything by reference
*result->m_impl = *m_impl;
- // clear pointers owned by object
- result->m_impl->redefinedBy= 0;
- result->m_impl->enumFields=0;
- // replace pointers owned by the object by deep copies
- if (m_impl->redefinedBy)
- {
- MemberListIterator mli(*m_impl->redefinedBy);
- MemberDef *md;
- for (mli.toFirst();(md=mli.current());++mli)
- {
- result->insertReimplementedBy(md);
- }
- }
- if (m_impl->enumFields)
- {
- MemberListIterator mli(*m_impl->enumFields);
- MemberDef *md;
- for (mli.toFirst();(md=mli.current());++mli)
- {
- result->insertEnumField(md);
- }
- }
result->m_impl->defArgList = m_impl->defArgList;
result->m_impl->tArgList = m_impl->tArgList;
result->m_impl->typeConstraints = m_impl->typeConstraints;
@@ -1512,12 +1438,12 @@ MemberDefImpl::~MemberDefImpl()
m_impl=0;
}
-void MemberDefImpl::setReimplements(MemberDef *md)
+void MemberDefImpl::setReimplements(const MemberDef *md)
{
m_impl->redefines = md;
}
-void MemberDefImpl::insertReimplementedBy(MemberDef *md)
+void MemberDefImpl::insertReimplementedBy(const MemberDef *md)
{
if (m_impl->templateMaster)
{
@@ -1527,30 +1453,27 @@ void MemberDefImpl::insertReimplementedBy(MemberDef *md)
mdm->insertReimplementedBy(md);
}
}
- if (m_impl->redefinedBy==0) m_impl->redefinedBy = new MemberList(MemberListType_redefinedBy);
- if (m_impl->redefinedBy->findRef(md)==-1)
+ if (!m_impl->redefinedBy.contains(md))
{
- m_impl->redefinedBy->inSort(md);
+ m_impl->redefinedBy.inSort(md);
}
}
-MemberDef *MemberDefImpl::reimplements() const
+const MemberDef *MemberDefImpl::reimplements() const
{
return m_impl->redefines;
}
-MemberList *MemberDefImpl::reimplementedBy() const
+const MemberList &MemberDefImpl::reimplementedBy() const
{
return m_impl->redefinedBy;
}
bool MemberDefImpl::isReimplementedBy(const ClassDef *cd) const
{
- if (cd && m_impl->redefinedBy)
+ if (cd)
{
- MemberListIterator mi(*m_impl->redefinedBy);
- MemberDef *md;
- for (mi.toFirst();(md=mi.current());++mi)
+ for (const auto &md : m_impl->redefinedBy)
{
const ClassDef *mcd = md->getClassDef();
if (mcd)
@@ -1565,15 +1488,14 @@ bool MemberDefImpl::isReimplementedBy(const ClassDef *cd) const
return FALSE;
}
-void MemberDefImpl::insertEnumField(MemberDef *md)
+void MemberDefImpl::insertEnumField(const MemberDef *md)
{
- if (m_impl->enumFields==0) m_impl->enumFields=new MemberList(MemberListType_enumFields);
- m_impl->enumFields->append(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));
}
@@ -1589,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();
@@ -1708,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");
@@ -1781,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;
@@ -1892,6 +1814,8 @@ void MemberDefImpl::writeLink(OutputList &ol,
*/
ClassDef *MemberDefImpl::getClassDefOfAnonymousType() const
{
+ //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;
@@ -1908,20 +1832,18 @@ ClassDef *MemberDefImpl::getClassDefOfAnonymousType() const
//if (ltype.left(7)=="static ") ltype=ltype.right(ltype.length()-7);
// strip 'friend' keyword from ltype
ltype.stripPrefix("friend ");
- static QRegExp r("@[0-9]+");
- int l,i=r.match(ltype,0,&l);
- //printf("ltype='%s' i=%d\n",ltype.data(),i);
+
// search for the last anonymous scope in the member type
ClassDef *annoClassDef=0;
- if (i!=-1) // found anonymous scope in type
- {
- int il=i-1,ir=i+l;
- // extract anonymous scope
- while (il>=0 && (isId(ltype.at(il)) || ltype.at(il)==':' || ltype.at(il)=='@')) il--;
- if (il>0) il++; else if (il<0) il=0;
- while (ir<(int)ltype.length() && (isId(ltype.at(ir)) || ltype.at(ir)==':' || ltype.at(ir)=='@')) ir++;
- QCString annName = ltype.mid(il,ir-il);
+ // match expression if it contains at least one @1 marker, e.g.
+ // 'struct A::@1::@2::B' matches 'A::@1::@2::B' but 'struct A::B' does not match.
+ std::string stype = ltype.str();
+ static const reg::Ex r(R"([\w@:]*@\d+[\w@:]*)");
+ reg::Match match;
+ if (reg::search(stype,match,r)) // found anonymous scope in type
+ {
+ QCString annName = match.str();
// if inside a class or namespace try to prepend the scope name
if (!cname.isEmpty() && annName.left(cname.length()+2)!=cname+"::")
@@ -1953,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);
@@ -1963,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
@@ -2073,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.
@@ -2107,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
@@ -2151,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)
@@ -2167,14 +2130,16 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
}
// strip 'friend' keyword from ltype
ltype.stripPrefix("friend ");
- static QRegExp r("@[0-9]+");
-
+ static const reg::Ex r(R"(@\d+)");
+ reg::Match match;
+ std::string stype = ltype.str();
bool endAnonScopeNeeded=FALSE;
- int l,i=r.match(ltype,0,&l);
- if (i!=-1) // member has an anonymous type
+ if (reg::search(stype,match,r)) // member has an anonymous type
{
+ 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
{
@@ -2190,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())
{
@@ -2280,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
@@ -2300,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);
@@ -2348,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
@@ -2356,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
@@ -2367,7 +2332,7 @@ void MemberDefImpl::writeDeclaration(OutputList &ol,
);
}
// *** write exceptions
- if (excpString())
+ if (!excpString().isEmpty())
{
ol.writeString(" ");
ol.docify(excpString());
@@ -2418,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();
@@ -2445,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();
@@ -2466,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)
{
@@ -2481,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())
{
@@ -2593,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();
@@ -2622,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() &&
@@ -2706,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
@@ -2767,7 +2740,7 @@ void MemberDefImpl::_writeCallerGraph(OutputList &ol) const
void MemberDefImpl::_writeReimplements(OutputList &ol) const
{
- MemberDef *bmd=reimplements();
+ const MemberDef *bmd=reimplements();
const ClassDef *bcd=0;
if (bmd && (bcd=bmd->getClassDef()))
{
@@ -2805,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());
@@ -2826,76 +2799,70 @@ void MemberDefImpl::_writeReimplements(OutputList &ol) const
void MemberDefImpl::_writeReimplementedBy(OutputList &ol) const
{
- MemberList *bml=reimplementedBy();
- if (bml)
+ const MemberList &bml=reimplementedBy();
+ size_t count=0;
+ for (const auto &bmd : bml)
{
- MemberListIterator mli(*bml);
- MemberDef *bmd=0;
- uint count=0;
- const ClassDef *bcd=0;
- for (mli.toFirst();(bmd=mli.current()) && (bcd=bmd->getClassDef());++mli)
+ const ClassDef *bcd=bmd->getClassDef();
+ // count the members that directly inherit from md and for
+ // which the member and class are visible in the docs.
+ if ( bcd && bmd->isLinkable() && bcd->isLinkable() )
{
- // count the members that directly inherit from md and for
- // which the member and class are visible in the docs.
- if ( bmd->isLinkable() && bcd->isLinkable() )
- {
- count++;
- }
+ count++;
}
- if (count>0)
+ }
+ if (count>0)
+ {
+ auto replaceFunc = [&bml,&ol](size_t entryIndex)
{
- mli.toFirst();
- // write the list of classes that overwrite this member
- ol.startParagraph();
-
- QCString reimplInLine;
- if (m_impl->virt==Pure || (getClassDef() && getClassDef()->compoundType()==ClassDef::Interface))
+ size_t cnt=0;
+ auto it = bml.begin();
+ // find the entryIndex-th documented entry in the inheritance list.
+ const MemberDef *bmd = 0;
+ const ClassDef *bcd = 0;
+ while (it!=bml.end())
{
- reimplInLine = theTranslator->trImplementedInList(count);
- }
- else
- {
- reimplInLine = theTranslator->trReimplementedInList(count);
- }
- static QRegExp marker("@[0-9]+");
- int index=0,newIndex,matchLen;
- // now replace all markers in reimplInLine with links to the classes
- while ((newIndex=marker.match(reimplInLine,index,&matchLen))!=-1)
- {
- ol.parseText(reimplInLine.mid(index,newIndex-index));
- bool ok;
- uint entryIndex = reimplInLine.mid(newIndex+1,matchLen-1).toUInt(&ok);
- //bmd=bml->at(entryIndex);
-
- count=0;
- // find the entryIndex-th documented entry in the inheritance list.
- for (mli.toLast();(bmd=mli.current()) && (bcd=bmd->getClassDef());--mli)
+ bmd = *it;
+ bcd = bmd->getClassDef();
+ if ( bmd->isLinkable() && bcd->isLinkable())
{
- if ( bmd->isLinkable() && bcd->isLinkable())
- {
- if (count==entryIndex) break;
- count++;
- }
+ if (cnt==entryIndex) break;
+ cnt++;
}
+ ++it;
+ }
- if (ok && bcd && bmd) // write link for marker
- {
- //ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(),
- // bmd->anchor(),bcd->name());
- ol.writeObjectLink(bmd->getReference(),bmd->getOutputFileBase(),
- bmd->anchor(),bcd->displayName());
+ if (bcd && bmd) // write link for marker
+ {
+ //ol.writeObjectLink(bcd->getReference(),bcd->getOutputFileBase(),
+ // bmd->anchor(),bcd->name());
+ ol.writeObjectLink(bmd->getReference(),bmd->getOutputFileBase(),
+ bmd->anchor(),bcd->displayName());
- if (bmd->isLinkableInProject() )
- {
- writePageRef(ol,bmd->getOutputFileBase(),bmd->anchor());
- }
+ if (bmd->isLinkableInProject() )
+ {
+ writePageRef(ol,bmd->getOutputFileBase(),bmd->anchor());
}
- ++mli;
- index=newIndex+matchLen;
}
- ol.parseText(reimplInLine.right(reimplInLine.length()-index));
- ol.endParagraph();
+ };
+
+ QCString reimplInLine;
+ if (m_impl->virt==Pure || (getClassDef() && getClassDef()->compoundType()==ClassDef::Interface))
+ {
+ reimplInLine = theTranslator->trImplementedInList((int)count);
}
+ else
+ {
+ reimplInLine = theTranslator->trReimplementedInList((int)count);
+ }
+
+ // write the list of classes that overwrite this member
+ ol.startParagraph();
+ writeMarkerList(ol,
+ reimplInLine.str(),
+ count,
+ replaceFunc);
+ ol.endParagraph();
}
}
@@ -2904,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;
@@ -2935,7 +2902,7 @@ void MemberDefImpl::_writeCategoryRelation(OutputList &ol) const
i=text.find("@0");
if (i!=-1)
{
- MemberDef *md = m_impl->categoryRelation;
+ const MemberDef *md = m_impl->categoryRelation;
ref = md->getReference();
file = md->getOutputFileBase();
anc = md->anchor();
@@ -2981,65 +2948,59 @@ void MemberDefImpl::_writeEnumValues(OutputList &ol,const Definition *container,
if (isEnumerate())
{
bool first=TRUE;
- const MemberList *fmdl=enumFieldList();
- //printf("** %s: enum values=%d\n",name().data(),fmdl!=0 ? fmdl->count() : 0);
- if (fmdl)
+ //printf("** %s: enum values=%zu\n",qPrint(name()),enumFieldList().size());
+ for (const auto &fmd : enumFieldList())
{
- MemberListIterator it(*fmdl);
- MemberDef *fmd;
- for (;(fmd=it.current());++it)
+ //printf("Enum %p: isLinkable()=%d\n",fmd,fmd->isLinkable());
+ if (fmd->isLinkable())
{
- //printf("Enum %p: isLinkable()=%d\n",fmd,fmd->isLinkable());
- if (fmd->isLinkable())
+ if (first)
{
- if (first)
- {
- ol.startDescTable(theTranslator->trEnumerationValues());
- }
+ ol.startDescTable(theTranslator->trEnumerationValues());
+ }
- ol.startDescTableRow();
- ol.addIndexItem(fmd->name(),ciname);
- ol.addIndexItem(ciname,fmd->name());
+ ol.startDescTableRow();
+ ol.addIndexItem(fmd->name(),ciname);
+ ol.addIndexItem(ciname,fmd->name());
- Doxygen::indexList->addIndexItem(container,fmd);
+ Doxygen::indexList->addIndexItem(container,fmd);
- ol.startDescTableTitle();
- ol.startDoxyAnchor(cfname,cname,fmd->anchor(),fmd->name(),fmd->argsString());
- first=FALSE;
- ol.docify(fmd->name());
- ol.disableAllBut(OutputGenerator::Man);
- ol.writeString(" ");
- ol.enableAll();
- ol.endDoxyAnchor(cfname,fmd->anchor());
- ol.endDescTableTitle();
- ol.startDescTableData();
+ ol.startDescTableTitle();
+ ol.startDoxyAnchor(cfname,cname,fmd->anchor(),fmd->name(),fmd->argsString());
+ first=FALSE;
+ ol.docify(fmd->name());
+ ol.disableAllBut(OutputGenerator::Man);
+ ol.writeString(" ");
+ ol.enableAll();
+ ol.endDoxyAnchor(cfname,fmd->anchor());
+ ol.endDescTableTitle();
+ ol.startDescTableData();
- bool hasBrief = !fmd->briefDescription().isEmpty();
- bool hasDetails = !fmd->documentation().isEmpty();
+ bool hasBrief = !fmd->briefDescription().isEmpty();
+ bool hasDetails = !fmd->documentation().isEmpty();
- if (hasBrief)
- {
- ol.generateDoc(fmd->briefFile(),fmd->briefLine(),
- getOuterScope()?getOuterScope():container,
- fmd,fmd->briefDescription(),TRUE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
- }
- // FIXME:PARA
- //if (!fmd->briefDescription().isEmpty() &&
- // !fmd->documentation().isEmpty())
- //{
- // ol.newParagraph();
- //}
- if (hasDetails)
- {
- ol.generateDoc(fmd->docFile(),fmd->docLine(),
- getOuterScope()?getOuterScope():container,
- fmd,fmd->documentation()+"\n",TRUE,FALSE,
- 0,FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
- }
- ol.endDescTableData();
- ol.endDescTableRow();
+ if (hasBrief)
+ {
+ ol.generateDoc(fmd->briefFile(),fmd->briefLine(),
+ getOuterScope()?getOuterScope():container,
+ fmd,fmd->briefDescription(),TRUE,FALSE,
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
}
+ // FIXME:PARA
+ //if (!fmd->briefDescription().isEmpty() &&
+ // !fmd->documentation().isEmpty())
+ //{
+ // ol.newParagraph();
+ //}
+ if (hasDetails)
+ {
+ ol.generateDoc(fmd->docFile(),fmd->docLine(),
+ getOuterScope()?getOuterScope():container,
+ fmd,fmd->documentation()+"\n",TRUE,FALSE,
+ QCString(),FALSE,FALSE,Config_getBool(MARKDOWN_SUPPORT));
+ }
+ ol.endDescTableData();
+ ol.endDescTableRow();
}
}
if (!first)
@@ -3049,6 +3010,9 @@ void MemberDefImpl::_writeEnumValues(OutputList &ol,const Definition *container,
}
}
+// match from the start of the scope until the last marker
+static const reg::Ex reAnonymous(R"([\w:@]*@\d+)");
+
QCString MemberDefImpl::displayDefinition() const
{
QCString ldef = definition();
@@ -3079,21 +3043,14 @@ QCString MemberDefImpl::displayDefinition() const
ldef=ldef.mid(2);
}
}
- static QRegExp r("@[0-9]+");
- int l,i=r.match(ldef,0,&l);
- if (i!=-1) // replace anonymous parts with { ... }
+
+ std::string sdef = ldef.str();
+ reg::Match match;
+ if (reg::search(sdef,match,reAnonymous))
{
- int si=ldef.find(' '),pi,ei=i+l;
- if (si==-1) si=0;
- while ((pi=r.match(ldef,i+l,&l))!=-1)
- {
- i=pi;
- ei=i+l;
- }
- int ni=ldef.find("::",si);
- if (ni>=ei) ei=ni+2;
- ldef = ldef.left(si) + " { ... } " + ldef.right(ldef.length()-ei);
+ ldef = match.prefix().str() + " { ... } " + match.suffix().str();
}
+
const ClassDef *cd=getClassDef();
if (cd && cd->isObjectiveC())
{
@@ -3113,9 +3070,9 @@ QCString MemberDefImpl::displayDefinition() const
{
ldef=ldef.left(dp+1);
}
- l=ldef.length();
- //printf("start >%s<\n",ldef.data());
- i=l-1;
+ int l=ldef.length();
+ //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--;
if (i>0)
@@ -3124,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();
@@ -3179,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,
@@ -3190,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);
@@ -3231,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)=='@')
@@ -3262,9 +3219,6 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
{
title += "()";
}
- int i=0,l;
- static QRegExp r("@[0-9]+");
-
if (lang == SrcLangExt_Slice)
{
// Remove the container scope from the member name.
@@ -3281,49 +3235,51 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
ol.pushGeneratorState();
bool htmlEndLabelTable=FALSE;
- QStrList sl;
- getLabels(sl,scopedContainer);
+ StringVector sl = getLabels(scopedContainer);
- if ((isVariable() || isTypedef()) && (i=r.match(ldef,0,&l))!=-1)
+ static const reg::Ex r(R"(@\d+)");
+ reg::Match match;
+ std::string sdef = ldef.str();
+ if ((isVariable() || isTypedef()) && reg::search(sdef,match,r))
{
// find enum type and insert it in the definition
- MemberListIterator vmli(*ml);
- MemberDef *vmd;
- bool found=FALSE;
- for ( ; (vmd=vmli.current()) && !found ; ++vmli)
+ bool found=false;
+ for (const auto &vmd : *ml)
{
- if (vmd->isEnumerate() && ldef.mid(i,l)==vmd->name())
+ if (vmd->isEnumerate() && match.str()==vmd->name())
{
ol.startDoxyAnchor(cfname,cname,memAnchor,doxyName,doxyArgs);
ol.startMemberDoc(ciname,name(),memAnchor,name(),memCount,memTotal,showInline);
- linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,ldef.left(i));
+ std::string prefix = match.prefix().str();
+ std::string suffix = match.suffix().str();
+ linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,prefix.c_str());
vmd->writeEnumDeclaration(ol,getClassDef(),getNamespaceDef(),getFileDef(),getGroupDef());
- linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,ldef.right(ldef.length()-i-l));
+ linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,suffix.c_str());
- found=TRUE;
+ found=true;
+ break;
}
}
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
- int si=ldef.find(' '),pi,ei=i+l;
- if (si==-1) si=0;
- while ((pi=r.match(ldef,i+l,&l))!=-1)
+
+ ol.startMemberDocName(isObjCMethod());
+ if (reg::search(sdef,match,reAnonymous))
{
- i=pi;
- ei=i+l;
+ std::string prefix = match.prefix().str();
+ std::string suffix = match.suffix().str();
+ ol.docify(prefix.c_str());
+ ol.docify(" { ... } ");
+ linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,suffix.c_str());
+ }
+ else
+ {
+ linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,ldef);
}
- // first si characters of ldef contain compound type name
- ol.startMemberDocName(isObjCMethod());
- ol.docify(ldef.left(si));
- ol.docify(" { ... } ");
- // last ei characters of ldef contain pointer/reference specifiers
- int ni=ldef.find("::",si);
- if (ni>=ei) ei=ni+2;
- linkifyText(TextGeneratorOLImpl(ol),scopedContainer,getBodyDef(),this,ldef.right(ldef.length()-ei));
}
}
else // not an enum value or anonymous compound
@@ -3352,7 +3308,7 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
{
if (!first) ol.docify(" ");
ol.startMemberDocPrefixItem();
- writeTemplatePrefix(ol,tal);
+ _writeTemplatePrefix(ol,scopedContainer,tal);
ol.endMemberDocPrefixItem();
}
}
@@ -3368,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();
}
}
@@ -3376,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();
@@ -3416,8 +3372,8 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
ldef=ldef.left(dp+1);
}
int dl=ldef.length();
- //printf("start >%s<\n",ldef.data());
- i=dl-1;
+ //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--;
if (i>0)
@@ -3426,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("- ");
}
@@ -3477,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
@@ -3486,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();
}
@@ -3520,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");
@@ -3548,17 +3502,24 @@ 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());
else
ol.parseText(theTranslator->trInitialValue());
ol.endBold();
- auto intf = Doxygen::parserManager->getCodeParser(getDefFileExtension());
+ QCString langCorrected = getDefFileExtension();
+ SrcLangExt srcLangExt = getLanguageFromFileName(getDefFileExtension());
+ if (srcLangExt == SrcLangExt_Lex)
+ {
+ langCorrected = ".doxygen_lex_c";
+ srcLangExt = SrcLangExt_Cpp;
+ }
+ auto intf = Doxygen::parserManager->getCodeParser(langCorrected);
intf->resetCodeParserState();
ol.startCodeFragment("DoxyCode");
- intf->parseCode(ol,scopeName,m_impl->initializer,lang,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");
}
@@ -3584,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();
}
@@ -3601,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())
@@ -3609,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) ||
@@ -3618,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));
}
}
@@ -3646,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)
);
}
@@ -3685,69 +3646,23 @@ void MemberDefImpl::writeDocumentation(const MemberList *ml,
}
// strip scope and field name from the type
-// example: "struct N::S.v.c" will become "struct v"
+// example: "struct N<K::J>::S.v.c" will become "struct v"
static QCString simplifyTypeForTable(const QCString &s)
{
QCString ts=removeAnonymousScopes(s);
if (ts.right(2)=="::") ts = ts.left(ts.length()-2);
- static QRegExp re("[A-Z_a-z0-9]+::");
- int i,l;
- while ((i=re.match(ts,0,&l))!=-1)
+ static const reg::Ex re1(R"(\a\w*::(\a\w*))"); // non-template version
+ static const reg::Ex re2(R"(\a\w*<[^>]*>::(\a\w*))"); // template version
+ reg::Match match;
+ std::string t = ts.str();
+ if (reg::search(t,match,re1) || reg::search(t,match,re2))
{
- ts=ts.left(i)+ts.mid(i+l);
+ ts = match[1].str(); // take the identifier after the last ::
}
- i=ts.findRev('.');
- if (i!=-1) ts = ts.left(i);
- i=ts.findRev('.');
- if (i!=-1) ts = ts.right(ts.length()-i-1);
- //printf("simplifyTypeForTable(%s)->%s\n",s.data(),ts.data());
+ //printf("simplifyTypeForTable(%s)->%s\n",qPrint(s),qPrint(ts));
return ts;
}
-#if 0
-/** Returns the type definition corresponding to a member's return type.
- * @param[in] scope The scope in which to search for the class definition.
- * @param[in] type The string representing the member's return type.
- * @param[in] lang The programming language in which the class is defined.
- * @param[out] start The string position where the class definition name was found.
- * @param[out] length The length of the class definition's name.
- */
-static Definition *getClassFromType(Definition *scope,const QCString &type,SrcLangExt lang,int &start,int &length)
-{
- int pos=0;
- int i;
- QCString name;
- QCString templSpec;
- while ((i=extractClassNameFromType(type,pos,name,templSpec,lang))!=-1)
- {
- ClassDef *cd=0;
- MemberDef *md=0;
- int l = name.length()+templSpec.length();
- if (!templSpec.isEmpty())
- {
- cd = getResolvedClass(scope,0,name+templSpec,&md);
- }
- cd = getResolvedClass(scope,0,name);
- if (cd)
- {
- start=i;
- length=l;
- printf("getClassFromType: type=%s name=%s start=%d length=%d\n",type.data(),name.data(),start,length);
- return cd;
- }
- else if (md)
- {
- start=i;
- length=l;
- printf("getClassFromType: type=%s name=%s start=%d length=%d\n",type.data(),name.data(),start,length);
- return md;
- }
- pos=i+l;
- }
- return 0;
-}
-#endif
-
QCString MemberDefImpl::fieldType() const
{
QCString type = m_impl->accessorType;
@@ -3775,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())
@@ -3820,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());
}
@@ -3841,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 */
@@ -3850,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));
}
@@ -3907,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() &&
@@ -3924,7 +3839,7 @@ void MemberDefImpl::warnIfUndocumented() const
warnIfUndocumentedParams();
}
}
-static QCString stripTrailingReturn(const QCString trailRet)
+static QCString stripTrailingReturn(const QCString &trailRet)
{
QCString ret = trailRet;
@@ -3958,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)
@@ -3981,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
{
@@ -3995,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)
{
@@ -4024,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 ||
@@ -4159,20 +4074,24 @@ 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];
- QCString sigStr(33);
+ char sigStr[33];
MD5Buffer((const unsigned char *)memAnchor.data(),memAnchor.length(),md5_sig);
- MD5SigToString(md5_sig,sigStr.rawData(),33);
- m_impl->anc = "a"+sigStr;
+ MD5SigToString(md5_sig,sigStr);
+ m_impl->anc = QCString("a")+sigStr;
}
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;
@@ -4182,7 +4101,7 @@ void MemberDefImpl::setGroupDef(const GroupDef *gd,Grouping::GroupPri_t pri,
m_isLinkableCached = 0;
}
-void MemberDefImpl::setEnumScope(MemberDef *md,bool livesInsideEnum)
+void MemberDefImpl::setEnumScope(const MemberDef *md,bool livesInsideEnum)
{
m_impl->enumScope=md;
m_impl->livesInsideEnum=livesInsideEnum;
@@ -4214,7 +4133,7 @@ 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())
{
@@ -4256,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
@@ -4272,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();
@@ -4280,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 *)
@@ -4347,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));
}
@@ -4362,7 +4281,7 @@ Specifier MemberDefImpl::virtualness(int count) const
return Normal;
}
Specifier v = m_impl->virt;
- MemberDef *rmd = reimplements();
+ const MemberDef *rmd = reimplements();
while (rmd && v==Normal)
{
v = rmd->virtualness(count+1)==Normal ? Normal : Virtual;
@@ -4371,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=\"";
@@ -4411,45 +4330,39 @@ 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())
{
- MemberList *fmdl=m_impl->enumFields;
- if (fmdl)
+ for (const auto &fmd : m_impl->enumFields)
{
- MemberListIterator mli(*fmdl);
- MemberDef *fmd;
- for (mli.toFirst();(fmd=mli.current());++mli)
+ if (!fmd->isReference())
{
- if (!fmd->isReference())
+ tagFile << " <enumvalue file=\"" << convertToXML(getOutputFileBase()+Doxygen::htmlFileExtension);
+ tagFile << "\" anchor=\"" << convertToXML(fmd->anchor());
+ idStr = fmd->id();
+ if (!idStr.isEmpty())
{
- tagFile << " <enumvalue file=\"" << convertToXML(getOutputFileBase()+Doxygen::htmlFileExtension);
- tagFile << "\" anchor=\"" << convertToXML(fmd->anchor());
- idStr = fmd->id();
- if (!idStr.isEmpty())
- {
- tagFile << "\" clangid=\"" << convertToXML(idStr);
- }
- tagFile << "\">" << convertToXML(fmd->name()) << "</enumvalue>" << endl;
+ tagFile << "\" clangid=\"" << convertToXML(idStr);
}
+ tagFile << "\">" << convertToXML(fmd->name()) << "</enumvalue>\n";
}
}
}
writeDocAnchorsToTagFile(tagFile);
- tagFile << " </member>" << endl;
+ tagFile << " </member>\n";
}
void MemberDefImpl::_computeIsConstructor()
@@ -4543,16 +4456,10 @@ void MemberDefImpl::writeEnumDeclaration(OutputList &typeDecl,
{
int enumMemCount=0;
- MemberList *fmdl=m_impl->enumFields;
uint numVisibleEnumValues=0;
- if (fmdl)
+ for (const auto &fmd : m_impl->enumFields)
{
- MemberListIterator mli(*fmdl);
- MemberDef *fmd;
- for (mli.toFirst();(fmd=mli.current());++mli)
- {
- if (fmd->isBriefSectionVisible()) numVisibleEnumValues++;
- }
+ if (fmd->isBriefSectionVisible()) numVisibleEnumValues++;
}
if (numVisibleEnumValues==0 && !isBriefSectionVisible())
{
@@ -4590,11 +4497,12 @@ void MemberDefImpl::writeEnumDeclaration(OutputList &typeDecl,
if (numVisibleEnumValues>0 && enumValuesPerLine>0)
{
typeDecl.docify("{ ");
- if (fmdl)
+
+ auto it = m_impl->enumFields.begin();
+ if (it!=m_impl->enumFields.end())
{
- MemberListIterator mli(*fmdl);
- MemberDefMutable *fmd=toMemberDefMutable(mli.current());
- bool fmdVisible = fmd ? fmd->isBriefSectionVisible() : TRUE;
+ const MemberDef *fmd=*it;
+ bool fmdVisible = fmd->isBriefSectionVisible();
bool first=true;
while (fmd)
{
@@ -4620,11 +4528,11 @@ void MemberDefImpl::writeEnumDeclaration(OutputList &typeDecl,
typeDecl.popGeneratorState();
}
- if (fmd->hasDocumentation()) // enum value has docs
+ MemberDefMutable *fmdm = toMemberDefMutable(fmd);
+ if (fmdm && fmd->hasDocumentation()) // enum value has docs
{
- //fmd->_writeTagData(compoundType);
- fmd->addToSearchIndex();
- fmd->writeLink(typeDecl,cd,nd,fd,gd);
+ fmdm->addToSearchIndex();
+ fmdm->writeLink(typeDecl,cd,nd,fd,gd);
}
else // no docs for this enum value
{
@@ -4642,8 +4550,15 @@ void MemberDefImpl::writeEnumDeclaration(OutputList &typeDecl,
}
bool prevVisible = fmdVisible;
- ++mli;
- fmd=toMemberDefMutable(mli.current());
+ ++it;
+ if (it!=m_impl->enumFields.end())
+ {
+ fmd=*it;
+ }
+ else
+ {
+ fmd=0;
+ }
if (prevVisible)
{
typeDecl.disable(OutputGenerator::Man);
@@ -4679,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;
@@ -4736,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();
@@ -4786,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);
@@ -4810,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;
}
@@ -4875,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;
}
@@ -4895,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;
}
@@ -5297,7 +5212,7 @@ bool MemberDefImpl::isConstExpr() const
return (m_impl->memSpec&Entry::ConstExpr)!=0;
}
-const MemberList *MemberDefImpl::enumFieldList() const
+const MemberList &MemberDefImpl::enumFieldList() const
{
return m_impl->enumFields;
}
@@ -5430,7 +5345,7 @@ bool MemberDefImpl::hasReferencesRelation() const
return m_impl->hasReferencesRelation;
}
-MemberDef *MemberDefImpl::templateMaster() const
+const MemberDef *MemberDefImpl::templateMaster() const
{
return m_impl->templateMaster;
}
@@ -5452,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;
}
@@ -5466,7 +5381,7 @@ MemberDef *MemberDefImpl::memberDeclaration() const
return m_impl->memDec;
}
-MemberDef *MemberDefImpl::inheritsDocsFrom() const
+const MemberDef *MemberDefImpl::inheritsDocsFrom() const
{
return m_impl->docProvider;
}
@@ -5500,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;
}
@@ -5529,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();
}
@@ -5542,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;
}
@@ -5569,12 +5484,12 @@ void MemberDefImpl::makeForeign()
m_isLinkableCached = 0;
}
-void MemberDefImpl::setInheritsDocsFrom(MemberDef *md)
+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;
}
@@ -5584,7 +5499,7 @@ void MemberDefImpl::setRelatedAlso(ClassDef *cd)
m_impl->relatedAlso=cd;
}
-void MemberDefImpl::setEnumClassScope(ClassDef *cd)
+void MemberDefImpl::setEnumClassScope(const ClassDef *cd)
{
m_impl->classDef = cd;
m_isLinkableCached = 0;
@@ -5660,7 +5575,7 @@ MemberDef *MemberDefImpl::fromAnonymousMember() const
return m_impl->annMemb;
}
-void MemberDefImpl::setTemplateMaster(MemberDef *mt)
+void MemberDefImpl::setTemplateMaster(const MemberDef *mt)
{
m_impl->templateMaster=mt;
m_isLinkableCached = 0;
@@ -5701,12 +5616,12 @@ void MemberDefImpl::setCategory(ClassDef *def)
m_impl->category = def;
}
-MemberDef *MemberDefImpl::categoryRelation() const
+const MemberDef *MemberDefImpl::categoryRelation() const
{
return m_impl->categoryRelation;
}
-void MemberDefImpl::setCategoryRelation(MemberDef *md)
+void MemberDefImpl::setCategoryRelation(const MemberDef *md)
{
m_impl->categoryRelation = md;
}
@@ -5721,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)
{
@@ -5728,10 +5652,10 @@ 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(MemberDef *bmd)
+void MemberDefImpl::copyArgumentNames(const MemberDef *bmd)
{
{
const ArgumentList &srcAl = bmd->argumentList();
@@ -5857,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());
@@ -5877,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))
@@ -6063,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 ff0e300..91b0c6d 100644
--- a/src/memberdef.h
+++ b/src/memberdef.h
@@ -21,7 +21,6 @@
#include <vector>
#include <memory>
-#include <qlist.h>
#include <sys/types.h>
#include "types.h"
@@ -37,10 +36,9 @@ class MemberGroup;
class ExampleList;
class OutputList;
class GroupDef;
-class QTextStream;
-class QStrList;
struct TagInfo;
class MemberDefMutable;
+class MemberGroupList;
/** A model of a class/file/namespace member symbol. */
class MemberDef : public Definition
@@ -66,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;
@@ -86,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;
@@ -200,8 +199,8 @@ class MemberDef : public Definition
virtual bool isFriendClass() const = 0;
virtual bool isDocumentedFriendClass() const = 0;
- virtual MemberDef *reimplements() const = 0;
- virtual MemberList *reimplementedBy() const = 0;
+ virtual const MemberDef *reimplements() const = 0;
+ virtual const MemberList &reimplementedBy() const = 0;
virtual bool isReimplementedBy(const ClassDef *cd) const = 0;
virtual ClassDef *relatedAlso() const = 0;
@@ -210,7 +209,7 @@ class MemberDef : public Definition
virtual const MemberDef *getAnonymousEnumType() const = 0;
virtual bool isDocsForDefinition() const = 0;
virtual const MemberDef *getEnumScope() const = 0;
- virtual const MemberList *enumFieldList() const = 0;
+ virtual const MemberList &enumFieldList() const = 0;
virtual QCString enumBaseType() const = 0;
virtual bool hasExamples() const = 0;
@@ -239,7 +238,7 @@ class MemberDef : public Definition
virtual bool hasReferencesRelation() const = 0;
virtual bool hasReferencedByRelation() const = 0;
- virtual MemberDef *templateMaster() const = 0;
+ virtual const MemberDef *templateMaster() const = 0;
virtual QCString getScopeString() const = 0;
virtual ClassDef *getClassDefOfAnonymousType() const = 0;
@@ -251,18 +250,20 @@ class MemberDef : public Definition
virtual MemberDef *memberDefinition() const = 0;
virtual MemberDef *memberDeclaration() const = 0;
- virtual MemberDef *inheritsDocsFrom() const = 0;
+ virtual const MemberDef *inheritsDocsFrom() const = 0;
virtual const MemberDef *getGroupAlias() const = 0;
virtual ClassDef *category() const = 0;
- virtual MemberDef *categoryRelation() const = 0;
+ virtual const MemberDef *categoryRelation() const = 0;
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;
@@ -277,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;
@@ -298,47 +299,47 @@ 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(MemberDef *md) = 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;
// relation to other members
- virtual void setReimplements(MemberDef *md) = 0;
- virtual void insertReimplementedBy(MemberDef *md) = 0;
+ virtual void setReimplements(const MemberDef *md) = 0;
+ virtual void insertReimplementedBy(const MemberDef *md) = 0;
virtual void setRelatedAlso(ClassDef *cd) = 0;
// enumeration specific members
- virtual void insertEnumField(MemberDef *md) = 0;
- virtual void setEnumScope(MemberDef *md,bool livesInsideEnum=FALSE) = 0;
- virtual void setEnumClassScope(ClassDef *cd) = 0;
+ virtual void insertEnumField(const MemberDef *md) = 0;
+ virtual void setEnumScope(const MemberDef *md,bool livesInsideEnum=FALSE) = 0;
+ virtual void setEnumClassScope(const ClassDef *cd) = 0;
virtual void setDocumentedEnumValues(bool value) = 0;
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;
@@ -351,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;
@@ -370,7 +371,7 @@ class MemberDefMutable : public DefinitionMutable, public MemberDef
virtual void enableReferencedByRelation(bool e) = 0;
virtual void enableReferencesRelation(bool e) = 0;
- virtual void setTemplateMaster(MemberDef *mt) = 0;
+ virtual void setTemplateMaster(const MemberDef *mt) = 0;
virtual void addListReference(Definition *d) = 0;
virtual void setDocsForDefinition(bool b) = 0;
virtual void setGroupAlias(const MemberDef *md) = 0;
@@ -384,17 +385,19 @@ class MemberDefMutable : public DefinitionMutable, public MemberDef
virtual void setMemberDefinition(MemberDef *md) = 0;
virtual void setMemberDeclaration(MemberDef *md) = 0;
- virtual void copyArgumentNames(MemberDef *bmd) = 0;
+ virtual void copyArgumentNames(const MemberDef *bmd) = 0;
virtual void setCategory(ClassDef *) = 0;
- virtual void setCategoryRelation(MemberDef *) = 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 ----
//-----------------------------------------------------------------------------------
@@ -407,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;
@@ -439,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 bd3bf0c..641a317 100644
--- a/src/membergroup.cpp
+++ b/src/membergroup.cpp
@@ -29,32 +29,30 @@
#include "entry.h"
#include "md5.h"
-MemberGroup::MemberGroup(const Definition *container,int id,const char *hdr,const char *d,const char *docFile,int docLine)
- : m_container(container), grpId(id), grpHeader(hdr), doc(d), m_docFile(docFile), m_docLine(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)
{
- static bool sortBriefDocs = Config_getBool(SORT_BRIEF_DOCS);
-
//printf("New member group id=%d header=%s desc=%s\n",id,hdr,d);
- memberList = new MemberList(MemberListType_memberGroup);
- memberList->setNeedsSorting(sortBriefDocs); // detailed sections are already sorted elsewhere.
- //printf("Member group docs='%s'\n",doc.data());
+ memberList->setNeedsSorting(Config_getBool(SORT_BRIEF_DOCS)); // detailed sections are already sorted elsewhere.
+ //printf("Member group docs='%s'\n",qPrint(doc));
}
MemberGroup::~MemberGroup()
{
- delete memberList;
}
-void MemberGroup::insertMember(MemberDef *md)
+void MemberGroup::insertMember(const MemberDef *md)
{
//printf("MemberGroup::insertMember memberList=%p count=%d"
// " member section list: %p: md=%p:%s\n",
// memberList->first() ? memberList->first()->getSectionList() : 0,
// memberList->count(),
// md->getSectionList(),
- // md,md->name().data());
+ // md,qPrint(md->name()));
- MemberDef *firstMd = memberList->getFirst();
+ const MemberDef *firstMd = memberList->empty() ? 0 : memberList->front();
if (inSameSection && firstMd &&
firstMd->getSectionList(m_container)!=md->getSectionList(m_container))
{
@@ -65,7 +63,7 @@ void MemberGroup::insertMember(MemberDef *md)
inDeclSection = const_cast<MemberList*>(md->getSectionList(m_container));
//printf("inDeclSection=%p type=%d\n",inDeclSection,inDeclSection->listType());
}
- memberList->append(md);
+ memberList->push_back(md);
// copy the group of the first member in the memberGroup
GroupDef *gd;
@@ -93,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);
@@ -101,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);
@@ -131,16 +129,14 @@ void MemberGroup::addGroupedInheritedMembers(OutputList &ol,const ClassDef *cd,
const ClassDef *inheritedFrom,const QCString &inheritId) const
{
//printf("** addGroupedInheritedMembers()\n");
- MemberListIterator li(*memberList);
- MemberDef *md;
- for (li.toFirst();(md=li.current());++li)
+ for (const auto &md : *memberList)
{
//printf("matching %d == %d\n",lt,md->getSectionList()->listType());
const MemberList *ml = md->getSectionList(m_container);
if (ml && lt==ml->listType())
{
MemberList mml(lt);
- mml.append(md);
+ mml.push_back(md);
mml.countDecMembers();
mml.writePlainDeclarations(ol,cd,0,0,0,inheritedFrom,inheritId);
}
@@ -151,9 +147,7 @@ int MemberGroup::countGroupedInheritedMembers(MemberListType lt)
{
//printf("** countGroupedInheritedMembers()\n");
int count=0;
- MemberListIterator li(*memberList);
- MemberDef *md;
- for (li.toFirst();(md=li.current());++li)
+ for (const auto &md : *memberList)
{
//printf("matching %d == %d\n",lt,md->getSectionList()->listType());
const MemberList *ml = md->getSectionList(m_container);
@@ -202,27 +196,26 @@ int MemberGroup::countInheritableMembers(const ClassDef *inheritedFrom) const
void MemberGroup::distributeMemberGroupDocumentation()
{
- //printf("MemberGroup::distributeMemberGroupDocumentation() %s\n",grpHeader.data());
- MemberListIterator li(*memberList);
- MemberDef *md;
- for (li.toFirst();(md=li.current());++li)
+ //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 (!md->documentation().isEmpty() ||
- !md->briefDescription().isEmpty() ||
- !md->inbodyDocumentation().isEmpty()
+ if (!smd->documentation().isEmpty() ||
+ !smd->briefDescription().isEmpty() ||
+ !smd->inbodyDocumentation().isEmpty()
)
{
//printf("found it!\n");
+ md = smd;
break;
}
}
if (md) // distribute docs of md to other members of the list
{
- //printf("Member %s has documentation!\n",md->name().data());
- MemberDef *iomd;
- for (li.toFirst();(iomd=li.current());++li)
+ //printf("Member %s has documentation!\n",qPrint(md->name()));
+ for (const auto &iomd : *memberList)
{
MemberDefMutable *omd = toMemberDefMutable(iomd);
if (omd && md!=omd && omd->documentation().isEmpty() &&
@@ -230,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());
@@ -239,57 +232,6 @@ void MemberGroup::distributeMemberGroupDocumentation()
}
}
-#if 0
-int MemberGroup::varCount() const
-{
- return memberList->varCount();
-}
-
-int MemberGroup::funcCount() const
-{
- return memberList->funcCount();
-}
-
-int MemberGroup::enumCount() const
-{
- return memberList->enumCount();
-}
-
-int MemberGroup::enumValueCount() const
-{
- return memberList->enumValueCount();
-}
-
-int MemberGroup::typedefCount() const
-{
- return memberList->typedefCount();
-}
-
-int MemberGroup::sequenceCount() const
-{
- return memberList->sequenceCount();
-}
-
-int MemberGroup::dictionaryCount() const
-{
- return memberList->dictionaryCount();
-}
-
-int MemberGroup::protoCount() const
-{
- return memberList->protoCount();
-}
-
-int MemberGroup::defineCount() const
-{
- return memberList->defineCount();
-}
-
-int MemberGroup::friendCount() const
-{
- return memberList->friendCount();
-}
-#endif
int MemberGroup::numDecMembers() const
{
@@ -320,12 +262,12 @@ void MemberGroup::setInGroup(bool b)
QCString MemberGroup::anchor() const
{
uchar md5_sig[16];
- QCString sigStr(33);
+ char sigStr[33];
QCString locHeader = grpHeader;
if (locHeader.isEmpty()) locHeader="[NOHEADER]";
MD5Buffer((const unsigned char *)locHeader.data(),locHeader.length(),md5_sig);
- MD5SigToString(md5_sig,sigStr.rawData(),33);
- return "amgrp"+sigStr;
+ MD5SigToString(md5_sig,sigStr);
+ return QCString("amgrp")+sigStr;
}
void MemberGroup::addListReferences(Definition *def)
@@ -338,7 +280,7 @@ void MemberGroup::addListReferences(Definition *def)
name,
theTranslator->trGroup(TRUE,TRUE),
name,
- grpHeader,0,def);
+ grpHeader,QCString(),def);
}
}
@@ -353,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 5b0c621..31705c0 100644
--- a/src/membergroup.h
+++ b/src/membergroup.h
@@ -22,8 +22,6 @@
#include <map>
#include <memory>
-#include <qlist.h>
-#include "sortdict.h"
#include "types.h"
#include "reflist.h"
@@ -38,32 +36,32 @@ 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; }
- void insertMember(MemberDef *md);
+ void insertMember(const MemberDef *md);
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;
@@ -87,7 +85,7 @@ class MemberGroup
void setInGroup(bool b);
void addListReferences(Definition *d);
void setRefItems(const RefItemVector &sli);
- MemberList *members() const { return memberList; }
+ const MemberList &members() const { return *memberList.get(); }
QCString anchor() const;
QCString docFile() const { return m_docFile; }
@@ -95,7 +93,7 @@ class MemberGroup
private:
const Definition *m_container;
- MemberList *memberList = 0; // list of all members in the group
+ std::unique_ptr<MemberList> memberList; // list of all members in the group
MemberList *inDeclSection = 0;
int grpId = 0;
QCString grpHeader;
@@ -107,8 +105,13 @@ class MemberGroup
RefItemVector m_xrefListItems;
};
-using MemberGroupRefList = std::vector<MemberGroup *>;
-using MemberGroupList = std::vector< std::unique_ptr<MemberGroup> >;
+class MemberGroupRefList : public std::vector<MemberGroup *>
+{
+};
+
+class MemberGroupList : public std::vector< std::unique_ptr<MemberGroup> >
+{
+};
/** Data collected for a member group */
struct MemberGroupInfo
diff --git a/src/memberlist.cpp b/src/memberlist.cpp
index c71390c..bd89739 100644
--- a/src/memberlist.cpp
+++ b/src/memberlist.cpp
@@ -15,8 +15,6 @@
*
*/
-#include <qregexp.h>
-
#include "memberlist.h"
#include "classdef.h"
#include "message.h"
@@ -75,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());
}
@@ -92,25 +90,18 @@ int genericCompareMembers(const MemberDef *c1,const MemberDef *c2)
return cmp;
}
-int MemberList::compareValues(const MemberDef *c1, const MemberDef *c2) const
-{
- return genericCompareMembers(c1,c2);
-}
-
int MemberList::countInheritableMembers(const ClassDef *inheritedFrom) const
{
int count=0;
- QListIterator<MemberDef> mli(*this);
- const MemberDef *md;
- for (mli.toFirst();(md=mli.current());++mli)
+ for (const auto &md : m_members)
{
if (md->isBriefSectionVisible())
{
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)
{
@@ -128,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;
}
@@ -146,11 +137,9 @@ void MemberList::countDecMembers()
m_typeCnt=m_seqCnt=m_dictCnt=m_protoCnt=m_defCnt=m_friendCnt=0;
*/
m_numDecMembers=0;
- QListIterator<MemberDef> mli(*this);
- MemberDef *md;
- for (mli.toFirst();(md=mli.current());++mli)
+ 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())
@@ -187,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++;
@@ -196,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()));
}
}
}
@@ -227,9 +216,7 @@ void MemberList::countDocMembers()
{
if (m_numDocMembers!=-1) return; // used cached value
m_numDocMembers=0;
- QListIterator<MemberDef> mli(*this);
- MemberDef *md;
- for (mli.toFirst();(md=mli.current());++mli)
+ for (const auto &md : m_members)
{
if (md->isDetailedSectionVisible(m_inGroup,m_inFile) && !md->isAlias())
{
@@ -250,57 +237,10 @@ void MemberList::countDocMembers()
//printf("MemberList::countDocMembers()=%d memberGroupList=%p\n",m_numDocMembers,memberGroupList);
}
-void MemberList::inSort(const MemberDef *md)
-{
- QList<MemberDef>::inSort(md);
-}
-
-void MemberList::append(const MemberDef *md)
-{
- QList<MemberDef>::append(md);
-}
-
-void MemberList::remove(const MemberDef *md)
-{
- QList<MemberDef>::remove(md);
-}
-
-void MemberList::sort()
-{
- QList<MemberDef>::sort();
-}
-
-uint MemberList::count() const
-{
- return QList<MemberDef>::count();
-}
-
-int MemberList::findRef(const MemberDef *md) const
-{
- return QList<MemberDef>::findRef(md);
-}
-
-MemberDef *MemberList::getFirst() const
-{
- return QList<MemberDef>::getFirst();
-}
-
-MemberDef *MemberList::take(uint index)
-{
- return QList<MemberDef>::take(index);
-}
-
-MemberListIterator::MemberListIterator(const MemberList &l) :
- QListIterator<MemberDef>(l)
-{
-}
-
void MemberList::setAnonymousEnumType()
{
//printf("MemberList(%p)::setAnonymousEnumType()\n",this);
- MemberListIterator mli(*this);
- const MemberDef *md;
- for ( ; (md=mli.current()); ++mli )
+ for (const auto &md : m_members)
{
if (md->isBriefSectionVisible())
{
@@ -309,21 +249,15 @@ void MemberList::setAnonymousEnumType()
if (i!=-1) name=name.right(name.length()-i-2);
if (md->memberType()==MemberType_Enumeration && name[0]=='@')
{
- const MemberList *mfl = md->enumFieldList();
- if (mfl)
+ for (const auto &vmd : md->enumFieldList())
{
- MemberListIterator vmli(*mfl);
- MemberDef *vmd;
- for ( ; (vmd=vmli.current()) ; ++vmli)
+ MemberDefMutable *vmdm = toMemberDefMutable(vmd);
+ if (vmdm)
{
- MemberDefMutable *vmdm = toMemberDefMutable(vmd);
- if (vmdm)
+ QCString vtype=vmd->typeString();
+ if ((vtype.find(name))!=-1)
{
- QCString vtype=vmd->typeString();
- if ((vtype.find(name))!=-1)
- {
- vmdm->setAnonymousEnumType(md);
- }
+ vmdm->setAnonymousEnumType(md);
}
}
}
@@ -339,14 +273,12 @@ void MemberList::setAnonymousEnumType()
int MemberList::countEnumValues(const MemberDef *md) const
{
int numEnumValues=0;
- MemberListIterator vmli(*this);
- const MemberDef *vmd;
QCString name(md->name());
int i=name.findRev("::");
if (i!=-1) name=name.right(name.length()-i-2);
if (name[0]=='@')
{
- for ( ; (vmd=vmli.current()) ; ++vmli)
+ for (const auto &vmd : m_members)
{
QCString vtype=vmd->typeString();
if ((vtype.find(name))!=-1)
@@ -360,9 +292,7 @@ int MemberList::countEnumValues(const MemberDef *md) const
bool MemberList::declVisible() const
{
- MemberListIterator mli(*this);
- const MemberDef *md;
- for ( ; (md=mli.current()); ++mli )
+ for (const auto &md : m_members)
{
if (md->isBriefSectionVisible())
{
@@ -410,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");
@@ -430,12 +360,10 @@ void MemberList::writePlainDeclarations(OutputList &ol,
ol.pushGeneratorState();
bool first=TRUE;
- const MemberDef *md;
- MemberListIterator mli(*this);
- for ( ; (md=mli.current()); ++mli )
+ 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())
{
@@ -478,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())
{
@@ -503,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())
{
@@ -557,7 +485,7 @@ void MemberList::writePlainDeclarations(OutputList &ol,
// no variables of the anonymous compound type exist.
if (cd)
{
- for ( mli.toFirst(); (md=mli.current()) ; ++mli )
+ for (const auto &md : m_members)
{
if (md->fromAnonymousScope() && !md->anonymousDeclShown())
{
@@ -604,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
@@ -633,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(),
@@ -644,7 +572,7 @@ void MemberList::writeDeclarations(OutputList &ol,
}
else if (num>numEnumValues)
{
- if (title)
+ if (!title.isEmpty())
{
if (showInline)
{
@@ -664,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)
@@ -700,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)
{
@@ -712,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();
@@ -739,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)
{
@@ -751,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);
@@ -763,45 +686,36 @@ void MemberList::writeDocumentation(OutputList &ol,
}
ol.startMemberDocList();
- MemberListIterator mli(*this);
- const MemberDef *md;
-
+ struct OverloadInfo
+ {
+ uint count = 1;
+ uint total = 0;
+ };
+ std::unordered_map<std::string,OverloadInfo> overloadInfo;
// count the number of overloaded members
- QDict<uint> overloadTotalDict(67);
- QDict<uint> overloadCountDict(67);
- overloadTotalDict.setAutoDelete(TRUE);
- overloadCountDict.setAutoDelete(TRUE);
- for (mli.toFirst() ; (md=mli.current()) ; ++mli)
+ for (const auto &md : m_members)
{
if (md->isDetailedSectionVisible(m_inGroup,container->definitionType()==Definition::TypeFile) &&
!(md->isEnumValue() && !showInline))
{
- uint *pCount = overloadTotalDict.find(md->name());
- if (pCount)
- {
- (*pCount)++;
- }
- else
- {
- overloadTotalDict.insert(md->name(),new uint(1));
- overloadCountDict.insert(md->name(),new uint(1));
- }
+ auto it = overloadInfo.insert(std::make_pair(md->name().str(),OverloadInfo())).first;
+ it->second.total++;
}
}
- for (mli.toFirst() ; (md=mli.current()) ; ++mli)
+ for (const auto &md : m_members)
{
if (md->isDetailedSectionVisible(m_inGroup,container->definitionType()==Definition::TypeFile) &&
!(md->isEnumValue() && !showInline))
{
- uint overloadCount = *overloadTotalDict.find(md->name());
- uint *pCount = overloadCountDict.find(md->name());
+ auto it = overloadInfo.find(md->name().str());
+ uint overloadCount = it->second.total;
+ uint &count = it->second.count;
MemberDefMutable *mdm = toMemberDefMutable(md);
if (mdm)
{
- mdm->writeDocumentation(this,*pCount,overloadCount,ol,scopeName,container,
+ mdm->writeDocumentation(this,count++,overloadCount,ol,scopeName,container,
m_inGroup,showEnumValues,showInline);
- (*pCount)++;
}
}
}
@@ -826,9 +740,7 @@ void MemberList::writeSimpleDocumentation(OutputList &ol,
cd = toClassDef(container);
}
ol.startMemberDocSimple(cd && cd->isJavaEnum());
- MemberListIterator mli(*this);
- const MemberDef *md;
- for ( ; (md=mli.current()) ; ++mli)
+ for (const auto &md : m_members)
{
MemberDefMutable *mdm = toMemberDefMutable(md);
if (mdm)
@@ -841,44 +753,38 @@ 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);
+ struct OverloadInfo
+ {
+ uint count = 1;
+ uint total = 0;
+ };
+ std::unordered_map<std::string,OverloadInfo> overloadInfo;
+
// count the number of overloaded members
- QDict<uint> overloadTotalDict(67);
- QDict<uint> overloadCountDict(67);
- overloadTotalDict.setAutoDelete(TRUE);
- overloadCountDict.setAutoDelete(TRUE);
- MemberListIterator mli(*this);
- const MemberDef *imd;
- for (mli.toFirst() ; (imd=mli.current()) ; ++mli)
+ for (const auto &imd : m_members)
{
MemberDefMutable *md = toMemberDefMutable(imd);
- if (md->isDetailedSectionLinkable())
+ if (md && md->isDetailedSectionLinkable())
{
- uint *pCount = overloadTotalDict.find(md->name());
- if (pCount)
- {
- (*pCount)++;
- }
- else
- {
- overloadTotalDict.insert(md->name(),new uint(1));
- overloadCountDict.insert(md->name(),new uint(1));
- }
+ auto it = overloadInfo.insert(std::make_pair(md->name().str(),OverloadInfo())).first;
+ it->second.total++;
}
}
- for ( mli.toFirst() ; (imd=mli.current()) ; ++mli)
+ for (const auto &imd : m_members)
{
Definition *container_d = toDefinition(const_cast<DefinitionMutable*>(container));
MemberDefMutable *md = toMemberDefMutable(imd);
- if (md->isDetailedSectionLinkable())
+ if (md && md->isDetailedSectionLinkable())
{
- uint overloadCount = *overloadTotalDict.find(md->name());
- uint *pCount = overloadCountDict.find(md->name());
+ auto it = overloadInfo.find(md->name().str());
+ uint overloadCount = it->second.total;
+ uint &count = it->second.count;
QCString diskName=md->getOutputFileBase();
QCString title=md->qualifiedName();
startFile(ol,diskName,md->name(),title,HLI_None,!generateTreeView,diskName);
@@ -891,8 +797,7 @@ void MemberList::writeDocumentationPage(OutputList &ol,
if (generateTreeView)
{
- md->writeDocumentation(this,*pCount,overloadCount,ol,scopeName,container_d,m_inGroup);
- (*pCount)++;
+ md->writeDocumentation(this,count++,overloadCount,ol,scopeName,container_d,m_inGroup);
ol.endContents();
endFileWithNavPath(container_d,ol);
@@ -908,8 +813,7 @@ void MemberList::writeDocumentationPage(OutputList &ol,
ol.writeString(" </td>\n");
ol.writeString(" <td valign=\"top\" class=\"mempage\">\n");
- md->writeDocumentation(this,*pCount,overloadCount,ol,scopeName,container_d,m_inGroup);
- (*pCount)++;
+ md->writeDocumentation(this,count++,overloadCount,ol,scopeName,container_d,m_inGroup);
ol.writeString(" </td>\n");
ol.writeString(" </tr>\n");
@@ -932,26 +836,22 @@ void MemberList::addMemberGroup(MemberGroup *mg)
void MemberList::addListReferences(Definition *def)
{
- MemberListIterator mli(*this);
- MemberDef *imd;
- for ( ; (imd=mli.current()) ; ++mli)
+ for (const auto &imd : m_members)
{
MemberDefMutable *md = toMemberDefMutable(imd);
if (md && !md->isAlias() && (md->getGroupDef()==0 || def->definitionType()==Definition::TypeGroup))
{
md->addListReference(def);
- const MemberList *enumFields = md->enumFieldList();
- if (md->memberType()==MemberType_Enumeration && enumFields)
+ const MemberList &enumFields = md->enumFieldList();
+ if (md->memberType()==MemberType_Enumeration && !enumFields.empty())
{
//printf(" Adding enum values!\n");
- MemberListIterator vmli(*enumFields);
- MemberDef *vmd;
- for ( ; (vmd=vmli.current()) ; ++vmli)
+ for (const auto &vmd : enumFields)
{
MemberDefMutable *vmdm = toMemberDefMutable(vmd);
if (vmdm)
{
- //printf(" adding %s\n",vmd->name().data());
+ //printf(" adding %s\n",qPrint(vmd->name()));
vmdm->addListReference(def);
}
}
@@ -966,9 +866,7 @@ void MemberList::addListReferences(Definition *def)
void MemberList::findSectionsInDocumentation(const Definition *d)
{
- MemberListIterator mli(*this);
- MemberDef *imd;
- for ( ; (imd=mli.current()) ; ++mli)
+ for (const auto &imd : m_members)
{
MemberDefMutable *md = toMemberDefMutable(imd);
if (md)
@@ -1045,11 +943,9 @@ QCString MemberList::listTypeAsString(MemberListType type)
return "";
}
-void MemberList::writeTagFile(FTextStream &tagFile)
+void MemberList::writeTagFile(TextStream &tagFile)
{
- MemberListIterator mli(*this);
- MemberDef *imd;
- for ( ; (imd=mli.current()) ; ++mli)
+ for (const auto &imd : m_members)
{
MemberDefMutable *md = toMemberDefMutable(imd);
if (md)
@@ -1057,11 +953,9 @@ void MemberList::writeTagFile(FTextStream &tagFile)
if (md->getLanguage()!=SrcLangExt_VHDL)
{
md->writeTagFile(tagFile);
- if (md->memberType()==MemberType_Enumeration && md->enumFieldList() && !md->isStrong())
+ if (md->memberType()==MemberType_Enumeration && !md->isStrong())
{
- MemberListIterator vmli(*md->enumFieldList());
- MemberDef *ivmd;
- for ( ; (ivmd=vmli.current()) ; ++vmli)
+ for (const auto &ivmd : md->enumFieldList())
{
MemberDefMutable *vmd = toMemberDefMutable(ivmd);
if (vmd)
@@ -1087,9 +981,7 @@ void MemberList::writeTagFile(FTextStream &tagFile)
void MemberList::setAnchors()
{
//int count=0;
- MemberListIterator mli(*this);
- MemberDef *md;
- for (;(md=mli.current());++mli)
+ for (const auto &md : m_members)
{
MemberDefMutable *mdm = toMemberDefMutable(md);
if (mdm && !md->isReference())
diff --git a/src/memberlist.h b/src/memberlist.h
index 08e2873..33920d5 100644
--- a/src/memberlist.h
+++ b/src/memberlist.h
@@ -19,7 +19,6 @@
#include <vector>
#include <algorithm>
-#include <qlist.h>
#include "memberdef.h"
#include "linkedmap.h"
#include "types.h"
@@ -27,8 +26,10 @@
class GroupDef;
+int genericCompareMembers(const MemberDef *c1,const MemberDef *c2);
+
/** A list of MemberDef objects. */
-class MemberList : private QList<MemberDef>
+class MemberList
{
friend class MemberListIterator;
public:
@@ -38,28 +39,45 @@ class MemberList : private QList<MemberDef>
MemberListType listType() const { return m_listType; }
static QCString listTypeAsString(MemberListType type);
- /* ---- standard QList methods ---- */
- void inSort(const MemberDef *md);
- void append(const MemberDef *md);
- void remove(const MemberDef *md);
- void sort();
- uint count() const;
- int findRef(const MemberDef *md) const;
- MemberDef *getFirst() const;
- MemberDef *take(uint index);
+ /* --- standard vector interface ---- */
+ using Ptr = const MemberDef *;
+ using Vec = std::vector<Ptr>;
+ using iterator = typename Vec::iterator;
+ using const_iterator = typename Vec::const_iterator;
+ void push_back(const MemberDef *md) { m_members.push_back(md); }
+ iterator begin() { return m_members.begin(); }
+ iterator end() { return m_members.end(); }
+ const_iterator begin() const { return m_members.cbegin(); }
+ const_iterator end() const { return m_members.cend(); }
+ bool empty() const { return m_members.empty(); }
+ size_t size() const { return m_members.size(); }
+ Ptr& front() { return m_members.front(); }
+ Ptr& back() { return m_members.back(); }
+
+ /* --- other methods ---- */
+ static bool lessThan(const MemberDef *md1,const MemberDef *md2)
+ {
+ return genericCompareMembers(md1,md2)<0;
+ }
+ void sort()
+ {
+ std::sort(m_members.begin(),m_members.end(),lessThan);
+ }
+ void inSort(const MemberDef *md)
+ {
+ m_members.insert( std::upper_bound( m_members.begin(), m_members.end(), md, lessThan), md);
+ }
+ void remove(const MemberDef *md)
+ {
+ auto it = std::find(m_members.begin(),m_members.end(),md);
+ if (it!=m_members.end()) m_members.erase(it);
+ }
+ bool contains(const MemberDef *md)
+ {
+ auto it = std::find(m_members.begin(),m_members.end(),md);
+ return it!=m_members.end();
+ }
-/*
- int varCount() const { ASSERT(m_numDecMembers!=-1); return m_varCnt; }
- int funcCount() const { ASSERT(m_numDecMembers!=-1); return m_funcCnt; }
- int enumCount() const { ASSERT(m_numDecMembers!=-1); return m_enumCnt; }
- int enumValueCount() const { ASSERT(m_numDecMembers!=-1); return m_enumValCnt; }
- int typedefCount() const { ASSERT(m_numDecMembers!=-1); return m_typeCnt; }
- int sequenceCount() const { ASSERT(m_numDecMembers!=-1); return m_seqCnt; }
- int dictionaryCount() const { ASSERT(m_numDecMembers!=-1); return m_dictCnt; }
- int protoCount() const { ASSERT(m_numDecMembers!=-1); return m_protoCnt; }
- int defineCount() const { ASSERT(m_numDecMembers!=-1); return m_defCnt; }
- int friendCount() const { ASSERT(m_numDecMembers!=-1); return m_friendCnt; }
-*/
int numDecMembers() const { ASSERT(m_numDecMembers!=-1); return m_numDecMembers; }
int numDecEnumValues() const { return m_numDecEnumValues; }
int numDocMembers() const { ASSERT(m_numDocMembers!=-1); return m_numDocMembers; }
@@ -70,19 +88,19 @@ class MemberList : private QList<MemberDef>
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; }
@@ -95,21 +113,7 @@ class MemberList : private QList<MemberDef>
void setAnchors();
private:
- MemberList(const MemberList &) = delete;
- MemberList &operator=(const MemberList &) = delete;
- int compareValues(const MemberDef *item1,const MemberDef *item2) const;
int countEnumValues(const MemberDef *md) const;
- /*
- int m_varCnt;
- int m_funcCnt;
- int m_enumCnt;
- int m_typeCnt;
- int m_seqCnt;
- int m_dictCnt;
- int m_protoCnt;
- int m_defCnt;
- int m_friendCnt;
- */
int m_numDecMembers; // number of members in the brief part of the memberlist
int m_numDecEnumValues;
int m_numDocMembers; // number of members in the detailed part of the memberlist
@@ -119,15 +123,7 @@ class MemberList : private QList<MemberDef>
bool m_inFile; // is this list part of a file definition
MemberListType m_listType;
bool m_needsSorting;
- QDict<int> m_overloadCount;
-};
-
-/** An iterator for MemberDef objects in a MemberList. */
-class MemberListIterator : public QListIterator<MemberDef>
-{
- public:
- MemberListIterator(const MemberList &list);
- virtual ~MemberListIterator() {}
+ Vec m_members;
};
class MemberLinkedRefMap : public LinkedRefMap<const MemberDef>
@@ -153,6 +149,5 @@ class MemberLists : public std::vector< std::unique_ptr<MemberList> >
MemberLists &operator=(const MemberLists &) = delete;
};
-int genericCompareMembers(const MemberDef *c1,const MemberDef *c2);
#endif
diff --git a/src/membername.h b/src/membername.h
index 88d8832..f600c8b 100644
--- a/src/membername.h
+++ b/src/membername.h
@@ -18,9 +18,7 @@
#ifndef MEMBERNAME_H
#define MEMBERNAME_H
-#include <qlist.h>
#include "memberdef.h"
-#include "sortdict.h"
#include "linkedmap.h"
class MemberName
@@ -33,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(); }
@@ -68,12 +66,12 @@ class MemberNameLinkedMap : public LinkedMap<MemberName>
class MemberInfo
{
public:
- MemberInfo(MemberDef *md,Protection p,Specifier v,bool inh) :
+ MemberInfo(const MemberDef *md,Protection p,Specifier v,bool inh) :
m_memberDef(md), m_prot(p), m_virt(v), m_inherited(inh) {}
~MemberInfo() {}
// getters
- MemberDef *memberDef() { return m_memberDef; }
+ const MemberDef *memberDef() { return m_memberDef; }
const MemberDef *memberDef() const { return m_memberDef; }
Protection prot() const { return m_prot; }
Specifier virt() const { return m_virt; }
@@ -88,7 +86,7 @@ class MemberInfo
void setAmbigClass(const ClassDef *cd) { m_ambigClass = cd; }
private:
- MemberDef *m_memberDef;
+ const MemberDef *m_memberDef;
Protection m_prot;
Specifier m_virt;
bool m_inherited;
@@ -105,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 95a7553..c973de6 100644
--- a/src/message.cpp
+++ b/src/message.cpp
@@ -25,12 +25,6 @@
static QCString outputFormat;
static const char *warning_str = "warning: ";
static const char *error_str = "error: ";
-//static int warnFormatOrder; // 1 = $file,$line,$text
-// // 2 = $text,$line,$file
-// // 3 = $line,$text,$file
-// // 4 = $file,$text,$line
-// // 5 = $text,$file,$line
-// // 6 = $line,$file,$text
static FILE *warnFile = stderr;
@@ -47,60 +41,11 @@ static std::mutex g_mutex;
void initWarningFormat()
{
-// int filePos = Config_getString(WARN_FORMAT).find("$file");
-// int linePos = Config_getString(WARN_FORMAT).find("$line");
-// int textPos = Config_getString(WARN_FORMAT).find("$text");
-//
-// // sort items on position (there are 6 cases)
-// warnFormatOrder = 1;
-// if (filePos>linePos && filePos>textPos)
-// {
-// if (linePos>textPos) // $text,$line,$file
-// {
-// warnFormatOrder = 2;
-// }
-// else // $line,$text,$file
-// {
-// warnFormatOrder = 3;
-// }
-// }
-// else if (filePos<linePos && filePos<textPos)
-// {
-// if (linePos>textPos) // $file,$text,$line
-// {
-// warnFormatOrder = 4;
-// }
-// }
-// else if (filePos<linePos && filePos>textPos) // $text,$file,$line
-// {
-// warnFormatOrder = 5;
-// }
-// else // $line,$file,$text
-// {
-// warnFormatOrder = 6;
-// }
-// outputFormat =
-// substitute(
-// substitute(
-// substitute(
-// Config_getString(WARN_FORMAT),
-// "$file","%s"
-// ),
-// "$text","%s"
-// ),
-// "$line","%d"
-// )+'\n';
-
- // replace(QRegExp("\\$file"),"%s").
- // replace(QRegExp("\\$text"),"%s").
- // replace(QRegExp("\\$line"),"%d")+
- // '\n';
-
outputFormat = Config_getString(WARN_FORMAT);
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
{
@@ -134,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;
@@ -177,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
@@ -202,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);
@@ -221,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);
@@ -240,7 +186,15 @@ void warn_undoc(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_incomplete_doc(const QCString &file,int line,const char *fmt, ...)
+{
+ va_list args;
+ va_start(args, fmt);
+ do_warn(Config_getBool(WARN_IF_INCOMPLETE_DOC), file, line, warning_str, fmt, args);
+ va_end(args);
+}
+
+void warn_doc_error(const QCString &file,int line,const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
@@ -266,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 af49632..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,14 +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_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 d0a88f0..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);
@@ -135,7 +140,7 @@ class NamespaceDefImpl : public DefinitionMixin<NamespaceDefMutable>
LinkedRefMap<const NamespaceDef> m_usingDirList;
LinkedRefMap<const ClassDef> m_usingDeclList;
- SDict<Definition> *m_innerCompounds = 0;
+ LinkedRefMap<const Definition> m_innerCompounds;
MemberLinkedRefMap m_allMembers;
MemberLists m_memberLists;
@@ -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);
}
@@ -262,19 +270,18 @@ NamespaceDefImpl::NamespaceDefImpl(const char *df,int dl,int dc,
{
setFileName(name);
}
- m_innerCompounds = new SDict<Definition>(17);
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;
}
@@ -286,7 +293,6 @@ NamespaceDefImpl::NamespaceDefImpl(const char *df,int dl,int dc,
NamespaceDefImpl::~NamespaceDefImpl()
{
- delete m_innerCompounds;
}
void NamespaceDefImpl::setFileName(const QCString &fn)
@@ -329,18 +335,16 @@ void NamespaceDefImpl::findSectionsInDocumentation()
void NamespaceDefImpl::insertUsedFile(FileDef *fd)
{
if (fd==0) return;
- if (files.find(fd)==-1)
+ auto it = std::find(files.begin(),files.end(),fd);
+ if (it==files.end())
{
- if (Config_getBool(SORT_MEMBER_DOCS))
- files.inSort(fd);
- else
- files.append(fd);
+ files.push_back(fd);
}
}
void NamespaceDefImpl::addInnerCompound(const Definition *d)
{
- m_innerCompounds->append(d->localName(),d);
+ m_innerCompounds.add(d->localName(),d);
if (d->definitionType()==Definition::TypeNamespace)
{
insertNamespace(toNamespaceDef(d));
@@ -349,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)
@@ -374,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);
@@ -395,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();
}
}
@@ -447,8 +460,8 @@ void NamespaceDefImpl::insertMember(MemberDef *md)
m_memberLists.emplace_back(std::make_unique<MemberList>(MemberListType_allMembersList));
allMemberList = m_memberLists.back().get();
}
- allMemberList->append(md);
- //printf("%s::m_allMembersDict->append(%s)\n",name().data(),md->localName().data());
+ allMemberList->push_back(md);
+ //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);
@@ -487,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())
@@ -537,20 +550,17 @@ 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";
}
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
{
switch (lde->kind())
{
@@ -560,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";
}
}
}
@@ -585,9 +595,14 @@ void NamespaceDefImpl::writeTagFile(FTextStream &tagFile)
writeClassesToTagFile(tagFile, exceptions);
}
break;
+ case LayoutDocEntry::NamespaceConcepts:
+ {
+ writeConceptsToTagFile(tagFile);
+ }
+ break;
case LayoutDocEntry::MemberDecl:
{
- LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
+ const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
MemberList * ml = getMemberList(lmd->type);
if (ml)
{
@@ -608,7 +623,7 @@ void NamespaceDefImpl::writeTagFile(FTextStream &tagFile)
}
}
writeDocAnchorsToTagFile(tagFile);
- tagFile << " </compound>" << endl;
+ tagFile << " </compound>\n";
}
void NamespaceDefImpl::writeDetailedDescription(OutputList &ol,const QCString &title)
@@ -621,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);
@@ -631,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())
@@ -649,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();
}
@@ -661,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();
@@ -747,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);
@@ -787,55 +807,59 @@ void NamespaceDefImpl::writeSummaryLinks(OutputList &ol) const
{
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace));
- LayoutDocEntry *lde;
bool first=TRUE;
SrcLangExt lang = getLanguage();
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
{
if (lde->kind()==LayoutDocEntry::NamespaceClasses && classes.declVisible())
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ 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())
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ 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())
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ 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())
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ 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())
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ 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)
{
- LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
+ const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
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;
}
}
@@ -861,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";
}
}
}
@@ -909,10 +944,7 @@ void NamespaceDefImpl::writeDocumentation(OutputList &ol)
//---------------------------------------- start flexible part -------------------------------
SrcLangExt lang = getLanguage();
- QListIterator<LayoutDocEntry> eli(
- LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace));
- LayoutDocEntry *lde;
- for (eli.toFirst();(lde=eli.current());++eli)
+ for (const auto &lde : LayoutDocManager::instance().docEntries(LayoutDocManager::Namespace))
{
switch (lde->kind())
{
@@ -924,37 +956,43 @@ void NamespaceDefImpl::writeDocumentation(OutputList &ol)
break;
case LayoutDocEntry::NamespaceClasses:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeClassDeclarations(ol,ls->title(lang),classes);
}
break;
case LayoutDocEntry::NamespaceInterfaces:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeClassDeclarations(ol,ls->title(lang),interfaces);
}
break;
case LayoutDocEntry::NamespaceStructs:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeClassDeclarations(ol,ls->title(lang),structs);
}
break;
case LayoutDocEntry::NamespaceExceptions:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
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:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeNamespaceDeclarations(ol,ls->title(lang),false);
}
break;
case LayoutDocEntry::NamespaceNestedConstantGroups:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeNamespaceDeclarations(ol,ls->title(lang),true);
}
break;
@@ -963,7 +1001,7 @@ void NamespaceDefImpl::writeDocumentation(OutputList &ol)
break;
case LayoutDocEntry::MemberDecl:
{
- LayoutDocEntryMemberDecl *lmd = (LayoutDocEntryMemberDecl*)lde;
+ const LayoutDocEntryMemberDecl *lmd = (const LayoutDocEntryMemberDecl*)lde.get();
writeMemberDeclarations(ol,lmd->type,lmd->title(lang));
}
break;
@@ -972,7 +1010,7 @@ void NamespaceDefImpl::writeDocumentation(OutputList &ol)
break;
case LayoutDocEntry::DetailedDesc:
{
- LayoutDocEntrySection *ls = (LayoutDocEntrySection*)lde;
+ const LayoutDocEntrySection *ls = (const LayoutDocEntrySection*)lde.get();
writeDetailedDescription(ol,ls->title(lang));
}
break;
@@ -984,7 +1022,7 @@ void NamespaceDefImpl::writeDocumentation(OutputList &ol)
break;
case LayoutDocEntry::MemberDef:
{
- LayoutDocEntryMemberDef *lmd = (LayoutDocEntryMemberDef*)lde;
+ const LayoutDocEntryMemberDef *lmd = (const LayoutDocEntryMemberDef*)lde.get();
writeMemberDocumentation(ol,lmd->type,lmd->title(lang));
}
break;
@@ -1001,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:
@@ -1013,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:
@@ -1068,9 +1109,7 @@ void NamespaceDefImpl::writeQuickMemberLinks(OutputList &ol,const MemberDef *cur
MemberList *allMemberList = getMemberList(MemberListType_allMembersList);
if (allMemberList)
{
- MemberListIterator mli(*allMemberList);
- MemberDef *md;
- for (mli.toFirst();(md=mli.current());++mli)
+ for (const auto &md : *allMemberList)
{
if (md->getNamespaceDef()==this && md->isLinkable() && !md->isEnumValue())
{
@@ -1118,13 +1157,13 @@ void NamespaceDefImpl::countMembers()
int NamespaceDefImpl::numDocMembers() const
{
MemberList *allMemberList = getMemberList(MemberListType_allMembersList);
- return (allMemberList ? allMemberList->numDocMembers() : 0) + m_innerCompounds->count();
+ return (allMemberList ? allMemberList->numDocMembers() : 0) + (int)m_innerCompounds.size();
}
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)
@@ -1137,10 +1176,10 @@ 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);
+ const Definition *d = m_innerCompounds.find(n);
if (d==0)
{
if (!m_usingDirList.empty())
@@ -1166,7 +1205,7 @@ void NamespaceDefImpl::addListReferences()
theTranslator->trModule(TRUE,TRUE) :
theTranslator->trNamespace(TRUE,TRUE),
getOutputFileBase(),displayName(),
- 0,
+ QCString(),
this
);
}
@@ -1243,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)
{
@@ -1308,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();
@@ -1333,7 +1372,7 @@ void NamespaceDefImpl::addMemberToList(MemberListType lt,MemberDef *md)
ml->setNeedsSorting(
((ml->listType()&MemberListType_declarationLists) && sortBriefDocs) ||
((ml->listType()&MemberListType_documentationLists) && sortMemberDocs));
- ml->append(md);
+ ml->push_back(md);
if (ml->listType()&MemberListType_declarationLists)
{
@@ -1352,23 +1391,19 @@ void NamespaceDefImpl::sortMemberLists()
if (ml->needsSorting()) { ml->sort(); ml->setNeedsSorting(FALSE); }
}
- if (Config_getBool(SORT_BRIEF_DOCS))
+ auto classComp = [](const ClassLinkedRefMap::Ptr &c1,const ClassLinkedRefMap::Ptr &c2)
{
- auto classComp = [](const ClassLinkedRefMap::Ptr &c1,const ClassLinkedRefMap::Ptr &c2)
- {
- return Config_getBool(SORT_BY_SCOPE_NAME) ?
- qstricmp(c1->name(), c2->name())<0 :
- qstricmp(c1->className(), c2->className())<0;
- };
+ return Config_getBool(SORT_BY_SCOPE_NAME) ?
+ qstricmp(c1->name(), c2->name())<0 :
+ qstricmp(c1->className(), c2->className())<0;
+ };
- std::sort(classes.begin(), classes.end(), classComp);
- std::sort(interfaces.begin(),interfaces.end(),classComp);
- std::sort(structs.begin(), structs.end(), classComp);
- std::sort(exceptions.begin(),exceptions.end(),classComp);
+ std::sort(classes.begin(), classes.end(), classComp);
+ std::sort(interfaces.begin(),interfaces.end(),classComp);
+ std::sort(structs.begin(), structs.end(), classComp);
+ std::sort(exceptions.begin(),exceptions.end(),classComp);
- }
- // TODO: inconsistent: should be only done when SORT_BRIEF_DOCS is enabled...
auto namespaceComp = [](const NamespaceLinkedRefMap::Ptr &n1,const NamespaceLinkedRefMap::Ptr &n2)
{
return qstricmp(n1->name(),n2->name())<0;
@@ -1392,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)
@@ -1464,7 +1499,7 @@ QCString NamespaceDefImpl::compoundTypeString() const
}
else if(lang==SrcLangExt_CSharp)
{
- return "namespace";
+ return "namespace";
}
else if (lang==SrcLangExt_Fortran)
{
@@ -1489,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 e644a32..93fff75 100644
--- a/src/namespacedef.h
+++ b/src/namespacedef.h
@@ -18,7 +18,6 @@
#include <set>
-#include <qstrlist.h>
#include "definition.h"
#include "filedef.h"
#include "linkedmap.h"
@@ -26,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;
@@ -45,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;
};
@@ -72,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;
@@ -96,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;
};
@@ -110,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;
@@ -130,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..709d000 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,29 +50,30 @@ 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);
+ //printf("startPlainFile(%s)\n",qPrint(name));
m_fileName=m_dir+"/"+name;
- m_file.setName(m_fileName);
- if (!m_file.open(IO_WriteOnly))
+ m_file = Portable::fopen(m_fileName.data(),"wb");
+ if (m_file==0)
{
- term("Could not open file %s for writing\n",m_fileName.data());
+ term("Could not open file %s for writing\n",qPrint(m_fileName));
}
- t.setDevice(&m_file);
+ m_t.setFile(m_file);
}
void OutputGenerator::endPlainFile()
{
- t.unsetDevice();
- m_file.close();
+ m_t.flush();
+ m_t.setStream(nullptr);
+ Portable::fclose(m_file);
m_fileName.resize(0);
}
diff --git a/src/outputgen.h b/src/outputgen.h
index 0d64833..53972d4 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;
+ FILE *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 d3cf823..07a1f9e 100644
--- a/src/pagedef.cpp
+++ b/src/pagedef.cpp
@@ -13,8 +13,6 @@
*
*/
-#include <qregexp.h>
-
#include "pagedef.h"
#include "groupdef.h"
#include "docparser.h"
@@ -32,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; }
@@ -59,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;
@@ -73,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)
+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;
@@ -114,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;
}
@@ -146,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())
@@ -159,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";
}
}
@@ -234,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());
}
}
@@ -254,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);
@@ -288,7 +286,7 @@ void PageDefImpl::writeDocumentation(OutputList &ol)
ol.popGeneratorState();
//1.}
- Doxygen::indexList->addIndexItem(this,0,0,filterTitle(title()));
+ Doxygen::indexList->addIndexItem(this,0,QCString(),filterTitle(title().str()));
}
void PageDefImpl::writePageDocumentation(OutputList &ol) const
@@ -310,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 c0a7bf0..1a7b301 100644
--- a/src/pagedef.h
+++ b/src/pagedef.h
@@ -17,11 +17,9 @@
#define PAGEDEF_H
#include "definition.h"
-#include "sortdict.h"
class PageLinkedRefMap;
class OutputList;
-class FTextStream;
/** @brief A model of a page symbol. */
class PageDef : public DefinitionMutable, public Definition
@@ -30,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;
@@ -57,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 2fde2f1..ccb4359 100644
--- a/src/parserintf.h
+++ b/src/parserintf.h
@@ -18,8 +18,6 @@
#ifndef PARSERINTF_H
#define PARSERINTF_H
-#include <qstrlist.h>
-
#include <functional>
#include <memory>
#include <map>
@@ -54,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;
@@ -72,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;
};
@@ -90,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
@@ -110,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,
@@ -149,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)
{
}
@@ -166,7 +164,7 @@ class ParserManager
*/
ParserManager(OutlineParserFactory outlineParserFactory,
CodeParserFactory codeParserFactory)
- : m_defaultParsers(outlineParserFactory,codeParserFactory, "")
+ : m_defaultParsers(outlineParserFactory,codeParserFactory, QCString())
{
}
@@ -178,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;
}
@@ -207,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();
}
@@ -216,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;
}
@@ -232,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 854b3df..3954daa 100644
--- a/src/perlmodgen.cpp
+++ b/src/perlmodgen.cpp
@@ -18,11 +18,10 @@
*/
#include <stdlib.h>
+#include <stack>
-#include <qdir.h>
-#include <qstack.h>
-#include <qdict.h>
-#include <qfile.h>
+#include <fstream>
+#include <iostream>
#include "perlmodgen.h"
#include "docparser.h"
@@ -30,7 +29,6 @@
#include "doxygen.h"
#include "pagedef.h"
#include "memberlist.h"
-#include "ftextstream.h"
#include "arguments.h"
#include "config.h"
#include "groupdef.h"
@@ -44,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;
-}
-
-void PerlModOutputStream::add(const char *s)
-{
- if (m_t != 0)
- (*m_t) << s;
- else
- m_s += s;
+ m_t << c;
+ //if (m_t != 0)
+ // (*m_t) << c;
+ //else
+ // m_s += c;
}
-void PerlModOutputStream::add(QCString &s)
+void PerlModOutputStream::add(const 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
@@ -119,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()
{
@@ -133,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()
{
@@ -149,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:
@@ -192,22 +185,23 @@ private:
int m_indentation;
bool m_blockstart;
- QStack<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.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)
{
@@ -688,9 +687,7 @@ void PerlModDocVisitor::visit(DocVerbatim *s)
if (s->hasCaption())
{
openSubBlock("caption");
- QListIterator<DocNode> cli(s->children());
- DocNode *n;
- for (cli.toFirst();(n=cli.current());++cli) n->accept(this);
+ for (const auto &n : s->children()) n->accept(this);
closeSubBlock();
}
m_output.addFieldQuotedString("content", s->text());
@@ -711,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;
@@ -891,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();
}
@@ -948,6 +930,17 @@ void PerlModDocVisitor::visitPre(DocHtmlList *l)
{
openItem("list");
m_output.addFieldQuotedString("style", (l->type() == DocHtmlList::Ordered) ? "ordered" : "itemized");
+ for (const auto &opt : l->attribs())
+ {
+ if (opt.name=="type")
+ {
+ m_output.addFieldQuotedString("list_type", qPrint(opt.value));
+ }
+ if (opt.name=="start")
+ {
+ m_output.addFieldQuotedString("start", qPrint(opt.value));
+ }
+ }
openSubBlock("content");
}
@@ -1278,14 +1271,14 @@ void PerlModDocVisitor::visitPre(DocParamSect *s)
break;
}
m_output.openHash();
- openOther();
+ //openOther();
openSubBlock(type);
}
void PerlModDocVisitor::visitPost(DocParamSect *)
{
closeSubBlock();
- closeOther();
+ //closeOther();
m_output.closeHash();
}
@@ -1294,25 +1287,21 @@ void PerlModDocVisitor::visitPre(DocParamList *pl)
leaveText();
m_output.openHash()
.openList("parameters");
- //QStrListIterator li(pl->parameters());
- //const char *s;
- QListIterator<DocNode> li(pl->parameters());
- DocNode *param;
- for (li.toFirst();(param=li.current());++li)
+ for (const auto &param : pl->parameters())
{
QCString name;
if (param->kind()==DocNode::Kind_Word)
{
- name = ((DocWord*)param)->word();
+ name = ((DocWord*)param.get())->word();
}
else if (param->kind()==DocNode::Kind_LinkedWord)
{
- name = ((DocLinkedWord*)param)->word();
+ name = ((DocLinkedWord*)param.get())->word();
}
QCString dir = "";
DocParamSect *sect = 0;
- if (pl->parent()->kind()==DocNode::Kind_ParamSect)
+ if (pl->parent() && pl->parent()->kind()==DocNode::Kind_ParamSect)
{
sect=(DocParamSect*)pl->parent();
}
@@ -1380,7 +1369,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");
}
@@ -1427,7 +1416,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");
@@ -1451,8 +1440,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,
@@ -1464,7 +1458,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);
@@ -1504,7 +1498,7 @@ static QCString pathDoxyExec;
void setPerlModDoxyfile(const QCString &qs)
{
pathDoxyfile = qs;
- pathDoxyExec = QDir::currentDirPath().utf8();
+ pathDoxyExec = Dir::currentDirPath();
}
class PerlModGenerator
@@ -1531,16 +1525,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();
@@ -1671,18 +1667,16 @@ 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
{
- const MemberList *enumFields = md->enumFieldList();
- if (enumFields)
+ const MemberList &enumFields = md->enumFieldList();
+ if (!enumFields.empty())
{
m_output.openList("values");
- MemberListIterator emli(*enumFields);
- const MemberDef *emd;
- for (emli.toFirst();(emd=emli.current());++emli)
+ for (const auto &emd : enumFields)
{
m_output.openHash()
.addFieldQuotedString("name", emd->name());
@@ -1700,7 +1694,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);
@@ -1713,14 +1707,13 @@ void PerlModGenerator::generatePerlModForMember(const MemberDef *md,const Defini
.addFieldQuotedString("name", rmd->name())
.closeHash();
- MemberList *rbml = md->reimplementedBy();
- if (rbml)
+ const MemberList &rbml = md->reimplementedBy();
+ if (!rbml.empty())
{
- MemberListIterator mli(*rbml);
m_output.openList("reimplemented_by");
- for (mli.toFirst();(rmd=mli.current());++mli)
+ for (const auto &rbmd : rbml)
m_output.openHash()
- .addFieldQuotedString("name", rmd->name())
+ .addFieldQuotedString("name", rbmd->name())
.closeHash();
m_output.closeList();
}
@@ -1729,19 +1722,17 @@ 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");
- MemberListIterator mli(*ml);
- const MemberDef *md;
- for (mli.toFirst();(md=mli.current());++mli)
+ for (const auto &md : *ml)
{
generatePerlModForMember(md,d);
}
@@ -1784,15 +1775,15 @@ 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())
+ if (!mg->members().empty())
{
m_output.openList("members");
- MemberListIterator mli(*mg->members());
- const MemberDef *md;
- for (mli.toFirst(); (md = mli.current()); ++mli)
+ for (const auto &md : mg->members())
{
generatePerlModForMember(md, d);
}
@@ -1804,6 +1795,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
@@ -1868,23 +1875,7 @@ void PerlModGenerator::generatePerlModForClass(const ClassDef *cd)
m_output.closeList();
}
- 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);
@@ -1946,6 +1937,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
@@ -2018,38 +2025,29 @@ void PerlModGenerator::generatePerlModForFile(const FileDef *fd)
m_output.openHash()
.addFieldQuotedString("name", fd->name());
- IncludeInfo *inc;
m_output.openList("includes");
- if (fd->includeFileList())
+ for (const auto &inc: fd->includeFileList())
{
- QListIterator<IncludeInfo> ili1(*fd->includeFileList());
- for (ili1.toFirst();(inc=ili1.current());++ili1)
+ m_output.openHash()
+ .addFieldQuotedString("name", inc.includeName);
+ if (inc.fileDef && !inc.fileDef->isReference())
{
- m_output.openHash()
- .addFieldQuotedString("name", inc->includeName);
- if (inc->fileDef && !inc->fileDef->isReference())
- {
- m_output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase());
- }
- m_output.closeHash();
+ m_output.addFieldQuotedString("ref", inc.fileDef->getOutputFileBase());
}
+ m_output.closeHash();
}
m_output.closeList();
m_output.openList("included_by");
- if (fd->includedByFileList())
+ for (const auto &inc : fd->includedByFileList())
{
- QListIterator<IncludeInfo> ili2(*fd->includedByFileList());
- for (ili2.toFirst();(inc=ili2.current());++ili2)
+ m_output.openHash()
+ .addFieldQuotedString("name", inc.includeName);
+ if (inc.fileDef && !inc.fileDef->isReference())
{
- m_output.openHash()
- .addFieldQuotedString("name", inc->includeName);
- if (inc->fileDef && !inc->fileDef->isReference())
- {
- m_output.addFieldQuotedString("ref", inc->fileDef->getOutputFileBase());
- }
- m_output.closeHash();
+ m_output.addFieldQuotedString("ref", inc.fileDef->getOutputFileBase());
}
+ m_output.closeHash();
}
m_output.closeList();
@@ -2088,13 +2086,10 @@ void PerlModGenerator::generatePerlModForGroup(const GroupDef *gd)
.addFieldQuotedString("name", gd->name())
.addFieldQuotedString("title", gd->groupTitle());
- FileList *fl = gd->getFiles();
- if (fl)
+ if (!gd->getFiles().empty())
{
m_output.openList("files");
- QListIterator<FileDef> fli(*fl);
- const FileDef *fd;
- for (fli.toFirst();(fd=fli.current());++fli)
+ for (const auto &fd : gd->getFiles())
m_output.openHash()
.addFieldQuotedString("name", fd->name())
.closeHash();
@@ -2169,7 +2164,7 @@ void PerlModGenerator::generatePerlModForPage(PageDef *pd)
const SectionInfo *si = SectionManager::instance().find(pd->name());
if (si)
- m_output.addFieldQuotedString("title4", filterTitle(si->title()));
+ m_output.addFieldQuotedString("title4", filterTitle(si->title().str()));
addPerlModDocBlock(m_output,"detailed",pd->docFile(),pd->docLine(),0,0,pd->documentation());
m_output.closeHash();
@@ -2177,12 +2172,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();
@@ -2191,6 +2185,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());
@@ -2228,56 +2227,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"))
{
@@ -2289,11 +2252,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"
@@ -2473,14 +2435,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" <<
@@ -2570,14 +2531,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"
@@ -2597,11 +2557,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"
@@ -2631,11 +2590,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"
@@ -2754,11 +2712,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"
@@ -2917,11 +2874,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"
@@ -2951,13 +2907,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 d020da0..81f7df8 100644
--- a/src/plantuml.cpp
+++ b/src/plantuml.cpp
@@ -18,14 +18,9 @@
#include "portable.h"
#include "config.h"
#include "doxygen.h"
-#include "index.h"
#include "message.h"
#include "debug.h"
-
-#include <qdir.h>
-#include <qdict.h>
-#include <qlist.h>
-
+#include "fileinfo.h"
QCString PlantumlManager::writePlantUMLSource(const QCString &outDirArg,const QCString &fileName,const QCString &content,OutputFormat format)
{
@@ -84,13 +79,13 @@ QCString PlantumlManager::writePlantUMLSource(const QCString &outDirArg,const QC
uint pos = qcOutDir.findRev("/");
QCString generateType(qcOutDir.right(qcOutDir.length() - (pos + 1)) );
Debug::print(Debug::Plantuml,0,"*** %s generateType: %s\n","writePlantUMLSource",qPrint(generateType));
- PlantumlManager::instance()->insert(generateType,puName,outDir,format,text);
+ PlantumlManager::instance().insert(generateType.str(),puName.str(),outDir,format,text);
Debug::print(Debug::Plantuml,0,"*** %s generateType: %s\n","writePlantUMLSource",qPrint(generateType));
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);
@@ -122,71 +117,26 @@ void PlantumlManager::generatePlantUMLOutput(const char *baseName,const char *ou
//--------------------------------------------------------------------
-PlantumlManager *PlantumlManager::m_theInstance = 0;
-PlantumlManager *PlantumlManager::instance()
+PlantumlManager &PlantumlManager::instance()
{
- if (!m_theInstance)
- {
- m_theInstance = new PlantumlManager;
- QCString outputFilename = Config_getString(OUTPUT_DIRECTORY) + "/" + CACHE_FILENAME;
- QFileInfo fi(outputFilename);
- if (fi.exists())
- {
- m_theInstance->m_cachedPlantumlAllContent = fileToString(outputFilename);
- }
- else
- {
- m_theInstance->m_cachedPlantumlAllContent = "";
- }
- Debug::print(Debug::Plantuml,0,"*** instance() : m_cachedPlantumlAllContent = [%s]\n",qPrint(m_theInstance->m_cachedPlantumlAllContent));
- m_theInstance->m_pngPlantumlContent.clear();
- m_theInstance->m_svgPlantumlContent.clear();
- m_theInstance->m_epsPlantumlContent.clear();
- }
- return m_theInstance;
+ static PlantumlManager theInstance;
+ return theInstance;
}
PlantumlManager::PlantumlManager()
{
-}
-
-PlantumlManager::~PlantumlManager()
-{
- {
- QDictIterator< QList<QCString> > it( m_pngPlantumlFiles); // See QDictIterator
- QList<QCString> *list;
- for (it.toFirst();(list=it.current());++it)
- {
- (*list).clear();
- }
- m_pngPlantumlFiles.clear();
- m_pngPlantumlContent.clear();
- }
- {
- QDictIterator< QList<QCString> > it( m_epsPlantumlFiles); // See QDictIterator
- QList<QCString> *list;
- for (it.toFirst();(list=it.current());++it)
- {
- (*list).clear();
- }
- m_epsPlantumlFiles.clear();
- m_epsPlantumlContent.clear();
- }
+ QCString outputFilename = Config_getString(OUTPUT_DIRECTORY) + "/" + CACHE_FILENAME;
+ FileInfo fi(outputFilename.str());
+ if (fi.exists())
{
- QDictIterator< QList<QCString> > it( m_svgPlantumlFiles); // See QDictIterator
- QList<QCString> *list;
- for (it.toFirst();(list=it.current());++it)
- {
- (*list).clear();
- }
- m_svgPlantumlFiles.clear();
- m_svgPlantumlContent.clear();
+ m_cachedPlantumlAllContent = fileToString(outputFilename);
}
+ Debug::print(Debug::Plantuml,0,"*** instance() : m_cachedPlantumlAllContent = [%s]\n",qPrint(m_cachedPlantumlAllContent));
}
-static void runPlantumlContent(const QDict< QList <QCString> > &plantumlFiles,
- const QDict< PlantumlContent > &plantumlContent,
+static void runPlantumlContent(const PlantumlManager::FilesMap &plantumlFiles,
+ const PlantumlManager::ContentMap &plantumlContent,
PlantumlManager::OutputFormat format)
{
/* example : running: java -Djava.awt.headless=true
@@ -254,43 +204,42 @@ static void runPlantumlContent(const QDict< QList <QCString> > &plantumlFiles,
}
{
- QDictIterator< PlantumlContent > it( plantumlContent); // See QDictIterator
- PlantumlContent *nb;
- for (it.toFirst();(nb=it.current());++it)
+ for (const auto &kv : plantumlContent)
{
- QCString pumlArguments(pumlArgs);
- msg("Generating PlantUML %s Files in %s\n",qPrint(pumlType),qPrint(it.currentKey()));
+ const PlantumlContent &nb = kv.second;
+ QCString pumlArguments = pumlArgs;
+ msg("Generating PlantUML %s Files in %s\n",qPrint(pumlType),kv.first.c_str());
pumlArguments+="-o \"";
- pumlArguments+=nb->outDir.data();
+ pumlArguments+=nb.outDir;
pumlArguments+="\" ";
pumlArguments+="-charset UTF-8 -t";
pumlArguments+=pumlType;
pumlArguments+=" ";
QCString puFileName("");
- puFileName+=nb->outDir.data();
+ puFileName+=nb.outDir;
puFileName+="/";
pumlOutDir=puFileName;
puFileName+="inline_umlgraph_";
puFileName+=pumlType;
- puFileName+=it.currentKey();
+ puFileName+=kv.first.c_str();
puFileName+=".pu";
pumlArguments+="\"";
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);
@@ -298,25 +247,24 @@ static void runPlantumlContent(const QDict< QList <QCString> > &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();
if ( (format==PlantumlManager::PUML_EPS) && (Config_getBool(USE_PDFLATEX)) )
{
Debug::print(Debug::Plantuml,0,"*** %s Running epstopdf\n","PlantumlManager::runPlantumlContent");
- QList<QCString> *list = plantumlFiles[it.currentKey()];
- if (list)
+ auto files_kv = plantumlFiles.find(kv.first);
+ if (files_kv!=plantumlFiles.end())
{
- QListIterator<QCString> li(*list);
- QCString *str_p;
- for (li.toFirst();(str_p=li.current());++li)
+ for (const auto &str : files_kv->second)
{
const int maxCmdLine = 40960;
QCString epstopdfArgs(maxCmdLine);
- epstopdfArgs.sprintf("\"%s%s.eps\" --outfile=\"%s%s.pdf\"",qPrint(pumlOutDir),qPrint(*str_p),qPrint(pumlOutDir),qPrint(*str_p));
+ 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);
}
@@ -336,75 +284,65 @@ 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();
}
-static void print(const QDict< QList <QCString> > &plantumlFiles)
+static void print(const PlantumlManager::FilesMap &plantumlFiles)
{
if (Debug::isFlagSet(Debug::Plantuml))
{
- QDictIterator< QList<QCString> > it( plantumlFiles); // See QDictIterator
- QList<QCString> *list;
- for (it.toFirst();(list=it.current());++it)
+ for (const auto &kv : plantumlFiles)
{
- Debug::print(Debug::Plantuml,0,"*** %s PlantumlFiles key:%s size:%d\n","PlantumlManager::print Files",qPrint(it.currentKey()),(*list).count());
- QListIterator<QCString> li(*list);
- QCString *nb;
- for (li.toFirst();(nb=li.current());++li)
+ Debug::print(Debug::Plantuml,0,"*** %s PlantumlFiles key:%s size:%zu\n","PlantumlManager::print Files",kv.first.c_str(),kv.second.size());
+ for (const auto &s : kv.second)
{
- Debug::print(Debug::Plantuml,0,"*** %s list:%s\n","PlantumlManager::print",qPrint(*nb));
+ Debug::print(Debug::Plantuml,0,"*** %s list:%s\n","PlantumlManager::print",s.c_str());
}
}
}
}
-static void print(const QDict<PlantumlContent> &plantumlContent)
+static void print(const PlantumlManager::ContentMap &plantumlContent)
{
if (Debug::isFlagSet(Debug::Plantuml))
{
- QDictIterator< PlantumlContent > it( plantumlContent); // See QDictIterator
- PlantumlContent *nb;
- for (it.toFirst();(nb=it.current());++it)
+ for (const auto &kv : plantumlContent)
{
- Debug::print(Debug::Plantuml,0,"*** %s PlantumlContent key:%s\n","PlantumlManager::print Content",qPrint(it.currentKey()));
- Debug::print(Debug::Plantuml,0,"*** %s Content :%s\n","PlantumlManager::print",qPrint(nb->content));
+ Debug::print(Debug::Plantuml,0,"*** %s PlantumlContent key:%s\n","PlantumlManager::print Content",kv.first.c_str());
+ Debug::print(Debug::Plantuml,0,"*** %s Content :%s\n","PlantumlManager::print",kv.second.content.data());
}
}
}
-static void addPlantumlFiles(QDict< QList<QCString> > &plantumlFiles,
- const QCString &key , const QCString &value)
+static void addPlantumlFiles(PlantumlManager::FilesMap &plantumlFiles,
+ const std::string &key, const std::string &value)
{
- QList<QCString> *list = plantumlFiles.find(key);
- if (list==0)
+ auto kv = plantumlFiles.find(key);
+ if (kv==plantumlFiles.end())
{
- list = new QList<QCString>;
- plantumlFiles.insert(key,list);
+ kv = plantumlFiles.insert(std::make_pair(key,StringVector())).first;
}
- list->append(new QCString(value));
+ kv->second.push_back(value);
}
-static void addPlantumlContent(QDict< PlantumlContent > &plantumlContent,
- const QCString &key, const QCString &outDir, const QCString &puContent)
+static void addPlantumlContent(PlantumlManager::ContentMap &plantumlContent,
+ const std::string &key, const QCString &outDir, const QCString &puContent)
{
- PlantumlContent* content = plantumlContent.find(key);
- if (content == 0)
+ auto kv = plantumlContent.find(key);
+ if (kv==plantumlContent.end())
{
- content = new PlantumlContent("",outDir);
- plantumlContent.insert(key,content);
+ kv = plantumlContent.insert(std::make_pair(key,PlantumlContent("",outDir))).first;
}
- (content->content)+=puContent;
+ kv->second.content+=puContent;
}
-
-
-void PlantumlManager::insert(const QCString &key, const QCString &value,
+void PlantumlManager::insert(const std::string &key, const std::string &value,
const QCString &outDir,OutputFormat format,const QCString &puContent)
{
int find;
diff --git a/src/plantuml.h b/src/plantuml.h
index f2e9dec..6b439f4 100644
--- a/src/plantuml.h
+++ b/src/plantuml.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.
*
@@ -16,8 +16,11 @@
#ifndef PLANTUML_H
#define PLANTUML_H
-#include <qdict.h>
-#include <qlist.h>
+#include <map>
+#include <string>
+
+#include "containers.h"
+#include "qcstring.h"
#define CACHE_FILENAME "inline_umlgraph_cache_all.pu"
#define DIVIDE_COUNT 4
@@ -26,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 */
@@ -43,7 +42,7 @@ class PlantumlManager
/** Plant UML output image formats */
enum OutputFormat { PUML_BITMAP, PUML_EPS, PUML_SVG };
- static PlantumlManager *instance();
+ static PlantumlManager &instance();
/** Run plant UML tool for all images */
void run();
@@ -62,25 +61,26 @@ 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 >;
private:
PlantumlManager();
- ~PlantumlManager();
- void insert(const QCString &key,
- const QCString &value,
+ void insert(const std::string &key,
+ const std::string &value,
const QCString &outDir,
OutputFormat format,
const QCString &puContent);
- static PlantumlManager *m_theInstance;
- QDict< QList<QCString> > m_pngPlantumlFiles;
- QDict< QList<QCString> > m_svgPlantumlFiles;
- QDict< QList<QCString> > m_epsPlantumlFiles;
- QDict< PlantumlContent > m_pngPlantumlContent; // use circular queue for using multi-processor (multi threading)
- QDict< PlantumlContent > m_svgPlantumlContent;
- QDict< PlantumlContent > m_epsPlantumlContent;
- QCString m_cachedPlantumlAllContent; // read from CACHE_FILENAME file
- QCString m_currentPlantumlAllContent; // processing plantuml then write it into CACHE_FILENAME to reuse the next time as cache information
+
+ FilesMap m_pngPlantumlFiles;
+ FilesMap m_svgPlantumlFiles;
+ FilesMap m_epsPlantumlFiles;
+ ContentMap m_pngPlantumlContent; // use circular queue for using multi-processor (multi threading)
+ ContentMap m_svgPlantumlContent;
+ ContentMap m_epsPlantumlContent;
+ QCString m_cachedPlantumlAllContent; // read from CACHE_FILENAME file
+ QCString m_currentPlantumlAllContent; // processing plantuml then write it into CACHE_FILENAME to reuse the next time as cache information
};
#endif
diff --git a/src/portable.cpp b/src/portable.cpp
index 0ffbd49..60c5189 100644
--- a/src/portable.cpp
+++ b/src/portable.cpp
@@ -1,7 +1,9 @@
#include "portable.h"
+#include "qcstring.h"
#include <stdlib.h>
#include <stdio.h>
+#include <chrono>
#if defined(_WIN32) && !defined(__CYGWIN__)
#undef UNICODE
@@ -15,15 +17,15 @@
extern char **environ;
#endif
+#include <assert.h>
#include <ctype.h>
-#include <qglobal.h>
-#include <qdatetime.h>
-#include <qglobal.h>
-#include <qdir.h>
#include <map>
#include <string>
+#include "fileinfo.h"
+
#include "util.h"
+#include "dir.h"
#ifndef NODEBUG
#include "debug.h"
#endif
@@ -34,13 +36,13 @@ static std::map<std::string,std::string> proc_env = std::map<std::string,std::st
#endif
static double g_sysElapsedTime;
-static QTime g_time;
+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,'/','\\');
@@ -69,7 +71,7 @@ int Portable::system(const char *command,const char *args,bool commandHasConsole
// on Solaris fork() duplicates the memory usage
// so we use vfork instead
-
+
// spawn shell
if ((pid=vfork())<0)
{
@@ -134,20 +136,22 @@ int Portable::system(const char *command,const char *args,bool commandHasConsole
#else // Win32 specific
if (commandHasConsole)
{
- return ::system(fullCmd);
+ return ::system(fullCmd.data());
}
else
{
- // Because ShellExecuteEx can delegate execution to Shell extensions
- // (data sources, context menu handlers, verb implementations) that
- // are activated using Component Object Model (COM), COM should be
- // initialized before ShellExecuteEx is called. Some Shell extensions
- // require the COM single-threaded apartment (STA) type.
+ // Because ShellExecuteEx can delegate execution to Shell extensions
+ // (data sources, context menu handlers, verb implementations) that
+ // are activated using Component Object Model (COM), COM should be
+ // initialized before ShellExecuteEx is called. Some Shell extensions
+ // require the COM single-threaded apartment (STA) type.
// 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
@@ -156,13 +160,13 @@ int Portable::system(const char *command,const char *args,bool commandHasConsole
SHELLEXECUTEINFOW sInfo = {
sizeof(SHELLEXECUTEINFOW), /* structure size */
SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_NO_UI, /* tell us the process
- * handle so we can wait till it's done |
- * do not display msg box if error
+ * handle so we can wait till it's done |
+ * do not display msg box if error
*/
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 */
@@ -176,11 +180,13 @@ 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 */
{
- WaitForSingleObject(sInfo.hProcess,INFINITE);
+ WaitForSingleObject(sInfo.hProcess,INFINITE);
/* get process exit code */
DWORD exitCode;
if (!GetExitCodeProcess(sInfo.hProcess,&exitCode))
@@ -188,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;
}
}
@@ -235,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
}
@@ -303,7 +311,7 @@ portable_off_t Portable::fseek(FILE *f,portable_off_t offset, int whence)
portable_off_t Portable::ftell(FILE *f)
{
#if defined(__MINGW32__)
- return ftello64(f);
+ return ftello64(f);
#elif defined(_WIN32) && !defined(__CYGWIN__)
return _ftelli64(f);
#else
@@ -311,44 +319,57 @@ 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()
+int Portable::fclose(FILE *f)
+{
+ return ::fclose(f);
+}
+
+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)
@@ -356,7 +377,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;
}
@@ -366,19 +387,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
@@ -428,12 +449,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
}
@@ -448,12 +469,14 @@ int Portable::pclose(FILE *stream)
void Portable::sysTimerStart()
{
- g_time.start();
+ g_startTime = std::chrono::steady_clock::now();
}
void Portable::sysTimerStop()
{
- g_sysElapsedTime+=((double)g_time.elapsed())/1000.0;
+ std::chrono::steady_clock::time_point endTime = std::chrono::steady_clock::now();
+ g_sysElapsedTime+= std::chrono::duration_cast<
+ std::chrono::microseconds>(endTime - g_startTime).count()/1000000.0;
}
double Portable::getSysElapsedTime()
@@ -470,19 +493,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 +515,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 +537,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
}
@@ -561,7 +581,7 @@ static const char * portable_memmem (const char *haystack, size_t haystack_len,
const char *Portable::strnstr(const char *haystack, const char *needle, size_t haystack_len)
{
size_t needle_len = strnlen(needle, haystack_len);
- if (needle_len < haystack_len || !needle[needle_len])
+ if (needle_len < haystack_len || !needle[needle_len])
{
const char *x = portable_memmem(haystack, haystack_len, needle, needle_len);
if (x && !memchr(haystack, 0, x - haystack))
@@ -580,3 +600,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,&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..86b1bed 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,40 @@ 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);
+ int fclose(FILE *f);
+ 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 char *tocode, const char *fromcode);
+ size_t portable_iconv (void *cd, const char** inbuf, size_t *inbytesleft,
char* * outbuf, size_t *outbytesleft);
int portable_iconv_close (void *cd);
}
diff --git a/src/portable_c.c b/src/portable_c.c
index 3a79741..fe81844 100644
--- a/src/portable_c.c
+++ b/src/portable_c.c
@@ -13,7 +13,7 @@
// These functions are implemented in a C file, because there are different
// versions of the iconv() prototype, some with a const pointer and some
// without. In C this is just a warning, but in C++ breaks the compilation.
-// Looking at the LIBICONV_VERSION is not enough, since for MACOSX the
+// Looking at the LIBICONV_VERSION is not enough, since for MACOSX the
// const and non-const version exist with the same version of the file.
void * portable_iconv_open(const char* tocode, const char* fromcode)
@@ -21,10 +21,10 @@ void * portable_iconv_open(const char* tocode, const char* fromcode)
return iconv_open(tocode,fromcode);
}
-size_t portable_iconv (void *cd, char** inbuf, size_t *inbytesleft,
+size_t portable_iconv (void *cd, const char** inbuf, size_t *inbytesleft,
char** outbuf, size_t *outbytesleft)
{
- return iconv((iconv_t)cd,inbuf,inbytesleft,outbuf,outbytesleft);
+ return iconv((iconv_t)cd,(char**)inbuf,inbytesleft,outbuf,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 4a86562..580b553 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -34,16 +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 <qregexp.h>
-#include <qfileinfo.h>
-
+#include "qcstring.h"
#include "containers.h"
#include "pre.h"
#include "constexp.h"
@@ -60,6 +58,8 @@
#include "condparser.h"
#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)
{
}
@@ -111,8 +111,8 @@ struct PreIncludeInfo
/** A dictionary of managed Define objects. */
typedef std::map< std::string, Define > DefineMap;
-/** @brief Class that manages the defines available while
- * preprocessing files.
+/** @brief Class that manages the defines available while
+ * preprocessing files.
*/
class DefineManager
{
@@ -122,7 +122,7 @@ class DefineManager
{
public:
/** Creates an empty container for defines */
- DefinesPerFile(DefineManager *parent)
+ DefinesPerFile(DefineManager *parent)
: m_parent(parent)
{
}
@@ -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);
/* ----------------------------------------------------------------- */
@@ -340,11 +341,23 @@ static Define * isDefined(yyscan_t yyscanner,const char *name);
ID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
B [ \t]
+Bopt {B}*
BN [ \t\r\n]
RAWBEGIN (u|U|L|u8)?R\"[^ \t\(\)\\]{0,16}"("
RAWEND ")"[^ \t\(\)\\]{0,16}\"
CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
+ // C start comment
+CCS "/\*"
+ // C end comment
+CCE "*\/"
+ // Cpp comment
+CPPC "/\/"
+ // optional characters after import
+ENDIMPORTopt [^\\\n]*
+ // Optional white space
+WSopt [ \t\r]*
+
%option noyywrap
%x Start
@@ -353,6 +366,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
%x SkipLine
%x SkipString
%x CopyLine
+%x LexCopyLine
%x CopyString
%x CopyStringCs
%x CopyStringFtn
@@ -396,9 +410,14 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
unput(resolveTrigraph(yytext[2]));
}
<Start>^{B}*"#" { BEGIN(Command); yyextra->yyColNr+=(int)yyleng; yyextra->yyMLines=0;}
-<Start>^{B}*/[^#] {
- outputArray(yyscanner,yytext,(int)yyleng);
- BEGIN(CopyLine);
+<Start>^("%top{"|"%{") {
+ if (getLanguageFromFileName(yyextra->yyFileName)!=SrcLangExt_Lex) REJECT
+ outputArray(yyscanner,yytext,yyleng);
+ BEGIN(LexCopyLine);
+ }
+<Start>^{Bopt}/[^#] {
+ 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?
int i;
@@ -439,46 +458,49 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
BEGIN(CopyLine);
}
}
-<CopyLine>"extern"{BN}{0,80}"\"C\""*{BN}{0,80}"{" {
+<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>{RAWBEGIN} {
+<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>"{" { // count brackets inside the main file
- if (yyextra->includeStack.empty())
+<CopyLine,LexCopyLine>"{" { // count brackets inside the main file
+ if (yyextra->includeStack.empty())
{
yyextra->curlyCount++;
}
outputChar(yyscanner,*yytext);
}
-<CopyLine>"}" { // count brackets inside the main file
- if (yyextra->includeStack.empty() && yyextra->curlyCount>0)
+<LexCopyLine>^"%}" {
+ outputArray(yyscanner,yytext,yyleng);
+ }
+<CopyLine,LexCopyLine>"}" { // count brackets inside the main file
+ if (yyextra->includeStack.empty() && yyextra->curlyCount>0)
{
yyextra->curlyCount--;
}
outputChar(yyscanner,*yytext);
}
-<CopyLine>"'"\\[0-7]{1,3}"'" {
- outputArray(yyscanner,yytext,(int)yyleng);
+<CopyLine,LexCopyLine>"'"\\[0-7]{1,3}"'" {
+ outputArray(yyscanner,yytext,yyleng);
}
-<CopyLine>"'"\\."'" {
- outputArray(yyscanner,yytext,(int)yyleng);
+<CopyLine,LexCopyLine>"'"\\."'" {
+ outputArray(yyscanner,yytext,yyleng);
}
-<CopyLine>"'"."'" {
- outputArray(yyscanner,yytext,(int)yyleng);
+<CopyLine,LexCopyLine>"'"."'" {
+ outputArray(yyscanner,yytext,yyleng);
}
-<CopyLine>@\" {
+<CopyLine,LexCopyLine>@\" {
if (getLanguageFromFileName(yyextra->yyFileName)!=SrcLangExt_CSharp) REJECT;
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
BEGIN( CopyStringCs );
}
-<CopyLine>\" {
+<CopyLine,LexCopyLine>\" {
outputChar(yyscanner,*yytext);
if (getLanguageFromFileName(yyextra->yyFileName)!=SrcLangExt_Fortran)
{
@@ -489,46 +511,46 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
BEGIN( CopyStringFtnDouble );
}
}
-<CopyLine>\' {
+<CopyLine,LexCopyLine>\' {
if (getLanguageFromFileName(yyextra->yyFileName)!=SrcLangExt_Fortran) REJECT;
outputChar(yyscanner,*yytext);
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)
@@ -537,12 +559,12 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
}
<CopyRawString>[^)]+ {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<CopyRawString>. {
outputChar(yyscanner,*yytext);
}
-<CopyLine>{ID}/{BN}{0,80}"(" {
+<CopyLine,LexCopyLine>{ID}/{BN}{0,80}"(" {
yyextra->expectGuard = FALSE;
Define *def=0;
//def=yyextra->globalDefineDict->find(yytext);
@@ -566,7 +588,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
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
{
@@ -576,12 +598,12 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
else
{
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
}
-<CopyLine>{ID} {
+<CopyLine,LexCopyLine>{ID} {
Define *def=0;
- if ((yyextra->includeStack.empty() || yyextra->curlyCount>0) &&
+ if ((yyextra->includeStack.empty() || yyextra->curlyCount>0) &&
yyextra->macroExpansion &&
(def=isDefined(yyscanner,yytext)) &&
def->nargs==-1 &&
@@ -589,21 +611,21 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
(!yyextra->expandOnlyPredef || def->isPredefined)
)
{
- QCString result=def->isPredefined ? def->definition : expandMacro(yyscanner,yytext);
- outputArray(yyscanner,result,result.length());
+ QCString result=def->isPredefined ? def->definition : expandMacro(yyscanner,yytext);
+ outputString(yyscanner,result);
}
else
{
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
}
-<CopyLine>"\\"\r?/\n { // strip line continuation characters
+<CopyLine,LexCopyLine>"\\"\r?/\n { // strip line continuation characters
if (getLanguageFromFileName(yyextra->yyFileName)==SrcLangExt_Fortran) outputChar(yyscanner,*yytext);
}
-<CopyLine>. {
+<CopyLine,LexCopyLine>. {
outputChar(yyscanner,*yytext);
}
-<CopyLine>\n {
+<CopyLine,LexCopyLine>\n {
outputChar(yyscanner,'\n');
BEGIN(Start);
yyextra->yyLineNr++;
@@ -619,10 +641,10 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
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
@@ -641,7 +663,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<FindDefineArgs>{CHARLIT} {
yyextra->defArgsStr+=yytext;
}
-<FindDefineArgs>"/*"[*]? {
+<FindDefineArgs>{CCS}[*]? {
yyextra->defArgsStr+=yytext;
BEGIN(ArgCopyCComment);
}
@@ -668,16 +690,16 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<ArgCopyCComment>[^*\n]+ {
yyextra->defArgsStr+=yytext;
}
-<ArgCopyCComment>"*/" {
+<ArgCopyCComment>{CCE} {
yyextra->defArgsStr+=yytext;
BEGIN(FindDefineArgs);
}
-<ArgCopyCComment>\n {
+<ArgCopyCComment>\n {
yyextra->defArgsStr+=' ';
yyextra->yyLineNr++;
outputChar(yyscanner,'\n');
}
-<ArgCopyCComment>. {
+<ArgCopyCComment>. {
yyextra->defArgsStr+=yytext;
}
<ReadString>"\"" {
@@ -690,7 +712,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
BEGIN(FindDefineArgs);
}
-<ReadString>"//"|"/*" {
+<ReadString>{CPPC}|{CCS} {
yyextra->defArgsStr+=yytext;
}
<ReadString>\\/\r?\n { // line continuation
@@ -703,20 +725,20 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
<Command>("include"|"import"){B}+/{ID} {
yyextra->isImported = yytext[1]=='m';
- if (yyextra->macroExpansion)
+ if (yyextra->macroExpansion)
BEGIN(IncludeID);
}
-<Command>("include"|"import"){B}*[<"] {
+<Command>("include"|"import"){B}*[<"] {
yyextra->isImported = yytext[1]=='m';
char c[2];
c[0]=yytext[yyleng-1];c[1]='\0';
yyextra->incName=c;
- BEGIN(Include);
+ BEGIN(Include);
}
-<Command>("cmake")?"define"{B}+ {
- //printf("!!!DefName\n");
+<Command>("cmake")?"define"{B}+ {
+ //printf("!!!DefName\n");
yyextra->yyColNr+=(int)yyleng;
- BEGIN(DefName);
+ BEGIN(DefName);
}
<Command>"ifdef"/{B}*"(" {
incrLevel(yyscanner);
@@ -748,7 +770,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
if (!otherCaseDone(yyscanner))
{
yyextra->guardExpr.resize(0);
- BEGIN(Guard);
+ BEGIN(Guard);
}
else
{
@@ -765,7 +787,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
else
{
setCaseDone(yyscanner,TRUE);
- }
+ }
}
<Command>"undef"{B}+ {
BEGIN(UndefName);
@@ -800,7 +822,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<Command>. {yyextra->yyColNr+=(int)yyleng;}
<UndefName>{ID} {
Define *def;
- if ((def=isDefined(yyscanner,yytext))
+ if ((def=isDefined(yyscanner,yytext))
/*&& !def->isPredefined*/
&& !def->nonRecursive
)
@@ -827,13 +849,13 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<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)
{
BEGIN(Start);
- }
+ }
else
{
yyextra->ifcount=0;
@@ -859,19 +881,19 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<DefinedExpr1,DefinedExpr2>\n { // should not happen, handle anyway
yyextra->yyLineNr++;
yyextra->ifcount=0;
- BEGIN(SkipCPPBlock);
+ BEGIN(SkipCPPBlock);
}
<DefinedExpr2>")" {
BEGIN(Guard);
}
<DefinedExpr1,DefinedExpr2>.
<SkipCPPBlock>^{B}*"#" { BEGIN(SkipCommand); }
-<SkipCPPBlock>^{B}*/[^#] { BEGIN(SkipLine); }
+<SkipCPPBlock>^{Bopt}/[^#] { BEGIN(SkipLine); }
<SkipCPPBlock>\n { yyextra->yyLineNr++; outputChar(yyscanner,'\n'); }
<SkipCPPBlock>.
-<SkipCommand>"if"(("n")?("def"))?/[ \t(!] {
+<SkipCommand>"if"(("n")?("def"))?/[ \t(!] {
incrLevel(yyscanner);
- yyextra->ifcount++;
+ yyextra->ifcount++;
//printf("#if... depth=%d\n",yyextra->ifcount);
}
<SkipCommand>"else" {
@@ -884,7 +906,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
}
<SkipCommand>("elif"|"else"{B}*"if")/[ \t(!] {
- if (yyextra->ifcount==0)
+ if (yyextra->ifcount==0)
{
if (!otherCaseDone(yyscanner))
{
@@ -898,7 +920,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
}
}
-<SkipCommand>"endif" {
+<SkipCommand>"endif" {
yyextra->expectGuard = FALSE;
decrLevel(yyscanner);
if (--yyextra->ifcount<0)
@@ -907,13 +929,13 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
BEGIN(Start);
}
}
-<SkipCommand>\n {
+<SkipCommand>\n {
outputChar(yyscanner,'\n');
- yyextra->yyLineNr++;
+ yyextra->yyLineNr++;
BEGIN(SkipCPPBlock);
}
-<SkipCommand>{ID} { // unknown directive
- BEGIN(SkipLine);
+<SkipCommand>{ID} { // unknown directive
+ BEGIN(SkipLine);
}
<SkipCommand>.
<SkipLine>[^'"/\n]+
@@ -922,21 +944,21 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
BEGIN(SkipString);
}
<SkipLine>.
-<SkipString>"//"/[^\n]* {
+<SkipString>{CPPC}/[^\n]* {
}
-<SkipLine,SkipCommand,SkipCPPBlock>"//"[^\n]* {
+<SkipLine,SkipCommand,SkipCPPBlock>{CPPC}[^\n]* {
yyextra->lastCPPContext=YY_START;
BEGIN(RemoveCPPComment);
}
-<SkipString>"/*"/[^\n]* {
+<SkipString>{CCS}/[^\n]* {
}
-<SkipLine,SkipCommand,SkipCPPBlock>"/*"/[^\n]* {
+<SkipLine,SkipCommand,SkipCPPBlock>{CCS}/[^\n]* {
yyextra->lastCContext=YY_START;
BEGIN(RemoveCComment);
}
<SkipLine>\n {
outputChar(yyscanner,'\n');
- yyextra->yyLineNr++;
+ yyextra->yyLineNr++;
BEGIN(SkipCPPBlock);
}
<SkipString>[^"\\\n]+ { }
@@ -945,7 +967,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
BEGIN(SkipLine);
}
<SkipString>. { }
-<IncludeID>{ID}{B}*/"(" {
+<IncludeID>{ID}{Bopt}/"(" {
yyextra->nospaces=TRUE;
yyextra->roundCount=0;
yyextra->defArgsStr=yytext;
@@ -957,7 +979,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
readIncludeFile(yyscanner,expandMacro(yyscanner,yytext));
BEGIN(Start);
}
-<Include>[^\">\n]+[\">] {
+<Include>[^\">\n]+[\">] {
yyextra->incName+=yytext;
readIncludeFile(yyscanner,yyextra->incName);
if (yyextra->isImported)
@@ -969,10 +991,10 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
BEGIN(Start);
}
}
-<EndImport>[^\\\n]*/\n {
+<EndImport>{ENDIMPORTopt}/\n {
BEGIN(Start);
}
-<EndImport>\\[\r]?"\n" {
+<EndImport>\\[\r]?"\n" {
outputChar(yyscanner,'\n');
yyextra->yyLineNr++;
}
@@ -999,17 +1021,17 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
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);
- yyextra->defText="1";
- yyextra->defLitText="1";
- BEGIN(DefineText);
+ yyextra->defText="1";
+ yyextra->defLitText="1";
+ BEGIN(DefineText);
}
else // define is a guard => hide
{
@@ -1029,11 +1051,11 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
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
@@ -1058,10 +1080,10 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
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);
+ BEGIN(DefineText);
}
<DefineArg>"\\\n" {
yyextra->defExtraSpacing+="\n";
@@ -1070,9 +1092,9 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<DefineArg>","{B}* { yyextra->defArgsStr+=yytext; }
<DefineArg>"("{B}* { yyextra->defArgsStr+=yytext; }
<DefineArg>{B}*")"{B}* {
- yyextra->defArgsStr+=yytext;
+ 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);
@@ -1108,42 +1130,42 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
yyextra->insideComment=FALSE;
}
*/
-<DefineText>"/*"[!*]? {
+<DefineText>{CCS}[!*]? {
yyextra->defText+=yytext;
yyextra->defLitText+=yytext;
yyextra->lastCContext=YY_START;
yyextra->commentCount=1;
BEGIN(CopyCComment);
}
-<DefineText>"//"[!/]? {
- outputArray(yyscanner,yytext,(int)yyleng);
+<DefineText>{CPPC}[!/]? {
+ outputArray(yyscanner,yytext,yyleng);
yyextra->lastCPPContext=YY_START;
yyextra->defLitText+=' ';
BEGIN(SkipCPPComment);
}
-<SkipCComment>[/]?"*/" {
+<SkipCComment>[/]?{CCE} {
if (yytext[0]=='/') outputChar(yyscanner,'/');
outputChar(yyscanner,'*');outputChar(yyscanner,'/');
if (--yyextra->commentCount<=0)
{
- if (yyextra->lastCContext==Start)
+ if (yyextra->lastCContext==Start)
// small hack to make sure that ^... rule will
// match when going to Start... Example: "/*...*/ some stuff..."
{
YY_CURRENT_BUFFER->yy_at_bol=1;
}
- BEGIN(yyextra->lastCContext);
+ BEGIN(yyextra->lastCContext);
}
}
-<SkipCComment>"//"("/")* {
- outputArray(yyscanner,yytext,(int)yyleng);
+<SkipCComment>{CPPC}("/")* {
+ outputArray(yyscanner,yytext,yyleng);
}
-<SkipCComment>"/*" {
+<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);
@@ -1153,7 +1175,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
else
{
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
yyextra->fenceSize=(int)yyleng;
BEGIN(SkipVerbatim);
}
@@ -1166,17 +1188,17 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
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')
@@ -1193,15 +1215,15 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
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;
+ yyextra->ccomment=TRUE;
yyextra->condCtx=YY_START;
BEGIN(CondLineCpp);
}
<SkipCComment>[\\@]"cond"[ \t]+ { // conditional section
- yyextra->ccomment=FALSE;
+ yyextra->ccomment=FALSE;
yyextra->condCtx=YY_START;
BEGIN(CondLineC);
}
@@ -1248,7 +1270,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
BEGIN(yyextra->condCtx);
}
}
-<SkipCComment,SkipCPPComment>[\\@]"cond"[ \t\r]*/\n { // no guard
+<SkipCComment,SkipCPPComment>[\\@]"cond"{WSopt}/\n { // no guard
if (YY_START==SkipCComment)
{
yyextra->ccomment=TRUE;
@@ -1266,15 +1288,15 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<SkipCond>\n { yyextra->yyLineNr++; outputChar(yyscanner,'\n'); }
<SkipCond>. { }
<SkipCond>[^\/\!*\\@\n]+ { }
-<SkipCond>"//"[/!] { yyextra->ccomment=FALSE; }
-<SkipCond>"/*"[*!] { yyextra->ccomment=TRUE; }
+<SkipCond>{CPPC}[/!] { yyextra->ccomment=FALSE; }
+<SkipCond>{CCS}[*!] { yyextra->ccomment=TRUE; }
<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] {
+<SkipCond>[\\@]"endcond"/[^a-z_A-Z0-9\x80-\xFF] {
bool oldSkip = yyextra->skip;
endCondSection(yyscanner);
if (oldSkip && !yyextra->skip)
@@ -1289,13 +1311,13 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<SkipCComment,SkipCPPComment>[\\@]"endcond"/[^a-z_A-Z0-9\x80-\xFF] {
bool oldSkip = yyextra->skip;
endCondSection(yyscanner);
- if (oldSkip && !yyextra->skip)
+ if (oldSkip && !yyextra->skip)
{
BEGIN(yyextra->condCtx);
}
}
<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);
@@ -1306,26 +1328,26 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
}
<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>"*/"|"/*" {
- outputArray(yyscanner,yytext,(int)yyleng);
+<SkipVerbatim>{CCE}|{CCS} {
+ outputArray(yyscanner,yytext,yyleng);
}
<SkipCComment,SkipVerbatim>[^*\\@\x06~`\n\/]+ {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
-<SkipCComment,SkipVerbatim>\n {
+<SkipCComment,SkipVerbatim>\n {
yyextra->yyLineNr++;
outputChar(yyscanner,'\n');
}
@@ -1342,17 +1364,17 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
yyextra->yyLineNr++;
yyextra->yyMLines++;
}
-<CopyCComment>"*/" {
+<CopyCComment>{CCE} {
yyextra->defLitText+=yytext;
yyextra->defText+=yytext;
BEGIN(yyextra->lastCContext);
}
-<CopyCComment>\n {
+<CopyCComment>\n {
yyextra->yyLineNr++;
yyextra->defLitText+=yytext;
yyextra->defText+=' ';
}
-<RemoveCComment>"*/"{B}*"#" { // see bug 594021 for a usecase for this rule
+<RemoveCComment>{CCE}{B}*"#" { // see bug 594021 for a usecase for this rule
if (yyextra->lastCContext==SkipCPPBlock)
{
BEGIN(SkipCommand);
@@ -1362,33 +1384,33 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
REJECT;
}
}
-<RemoveCComment>"*/" { BEGIN(yyextra->lastCContext); }
-<RemoveCComment>"//"
-<RemoveCComment>"/*"
+<RemoveCComment>{CCE} { BEGIN(yyextra->lastCContext); }
+<RemoveCComment>{CPPC}
+<RemoveCComment>{CCS}
<RemoveCComment>[^*\x06\n]+
<RemoveCComment>\n { yyextra->yyLineNr++; outputChar(yyscanner,'\n'); }
<RemoveCComment>.
<SkipCPPComment>[^\n\/\\@]+ {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<SkipCPPComment,RemoveCPPComment>\n {
unput(*yytext);
BEGIN(yyextra->lastCPPContext);
}
-<SkipCPPComment>"/*" {
+<SkipCPPComment>{CCS} {
outputChar(yyscanner,'/');outputChar(yyscanner,'*');
}
-<SkipCPPComment>"//" {
+<SkipCPPComment>{CPPC} {
outputChar(yyscanner,'/');outputChar(yyscanner,'/');
}
<SkipCPPComment>[^\x06\@\\\n]+ {
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
}
<SkipCPPComment>. {
outputChar(yyscanner,*yytext);
}
-<RemoveCPPComment>"/*"
-<RemoveCPPComment>"//"
+<RemoveCPPComment>{CCS}
+<RemoveCPPComment>{CPPC}
<RemoveCPPComment>[^\x06\n]+
<RemoveCPPComment>.
<DefineText>"#" {
@@ -1441,20 +1463,20 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
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());
- if (yyextra->includeStack.empty() || yyextra->curlyCount>0)
+ //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);
}
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)*/)
@@ -1468,13 +1490,13 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
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();
@@ -1486,25 +1508,25 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<DefineText>{B}* { yyextra->defText += ' '; yyextra->defLitText+=yytext; }
<DefineText>{B}*"##"{B}* { yyextra->defText += "##"; yyextra->defLitText+=yytext; }
<DefineText>"@" { yyextra->defText += "@@"; yyextra->defLitText+=yytext; }
-<DefineText>\" {
- yyextra->defText += *yytext;
- yyextra->defLitText+=yytext;
+<DefineText>\" {
+ yyextra->defText += *yytext;
+ yyextra->defLitText+=yytext;
if (!yyextra->insideComment)
{
BEGIN(SkipDoubleQuote);
}
}
<DefineText>\' { yyextra->defText += *yytext;
- yyextra->defLitText+=yytext;
+ yyextra->defLitText+=yytext;
if (!yyextra->insideComment)
{
BEGIN(SkipSingleQuote);
}
}
-<SkipDoubleQuote>"//"[/]? { yyextra->defText += yytext; yyextra->defLitText+=yytext; }
-<SkipDoubleQuote>"/*"[*]? { yyextra->defText += yytext; yyextra->defLitText+=yytext; }
+<SkipDoubleQuote>{CPPC}[/]? { yyextra->defText += yytext; yyextra->defLitText+=yytext; }
+<SkipDoubleQuote>{CCS}[*]? { yyextra->defText += yytext; yyextra->defLitText+=yytext; }
<SkipDoubleQuote>\" {
- yyextra->defText += *yytext; yyextra->defLitText+=yytext;
+ yyextra->defText += *yytext; yyextra->defLitText+=yytext;
BEGIN(DefineText);
}
<SkipSingleQuote,SkipDoubleQuote>\\. {
@@ -1539,13 +1561,13 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
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
+ // 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();
@@ -1582,18 +1604,18 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
yyextra->localDefines.clear();
}
}
-<*>"/*"/"*/" |
-<*>"/*"[*!]? {
+<*>{CCS}/{CCE} |
+<*>{CCS}[*!]? {
if (YY_START==SkipVerbatim || YY_START==SkipCond)
{
REJECT;
}
else
{
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
yyextra->lastCContext=YY_START;
yyextra->commentCount=1;
- if (yyleng==3)
+ if (yyleng==3)
{
yyextra->isSpecialComment = true;
yyextra->lastGuardName.resize(0); // reset guard in case the #define is documented!
@@ -1605,14 +1627,14 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
BEGIN(SkipCComment);
}
}
-<*>"//"[/!]? {
+<*>{CPPC}[/!]? {
if (YY_START==SkipVerbatim || YY_START==SkipCond || getLanguageFromFileName(yyextra->yyFileName)==SrcLangExt_Fortran)
{
REJECT;
}
else
{
- outputArray(yyscanner,yytext,(int)yyleng);
+ outputArray(yyscanner,yytext,yyleng);
yyextra->lastCPPContext=YY_START;
if (yyleng==3)
{
@@ -1626,9 +1648,9 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
BEGIN(SkipCPPComment);
}
}
-<*>\n {
+<*>\n {
outputChar(yyscanner,'\n');
- yyextra->yyLineNr++;
+ yyextra->yyLineNr++;
}
<*>. {
yyextra->expectGuard = FALSE;
@@ -1643,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
@@ -1662,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;
@@ -1673,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();
@@ -1716,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 { ... }
@@ -1750,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))
@@ -1768,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);
@@ -1788,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)
{
@@ -1811,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)
@@ -1829,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];
@@ -1845,23 +1867,23 @@ static QCString extractTrailingComment(const char *s)
{
i--;
while (i>0 && !(s[i-1]=='/' && s[i]=='*')) i--;
- if (i==0)
+ if (i==0)
{
i++;
}
// only /*!< or /**< are treated as a comment for the macro name,
// otherwise the comment is treated as part of the macro definition
- return ((s[i+1]=='*' || s[i+1]=='!') && s[i+2]=='<') ? &s[i-1] : "";
+ return ((s[i+1]=='*' || s[i+1]=='!') && s[i+2]=='<') ? &s[i-1] : "";
}
else
{
return "";
}
- }
+ }
break;
// whitespace or line-continuation
case ' ':
- case '\t':
+ case '\t':
case '\r':
case '\n':
case '\\':
@@ -1935,7 +1957,7 @@ static QCString stringize(const QCString &s)
while (i<s.length() && inString)
{
c=s.at(i++);
- if (c=='"')
+ if (c=='"')
{
result+="\\\"";
inString= pc=='\\';
@@ -1948,43 +1970,60 @@ 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;
}
-/*! Execute all ## operators in expr.
- * If the macro name before or after the operator contains a no-rescan
+/*! Execute all ## operators in expr.
+ * If the macro name before or after the operator contains a no-rescan
* marker (@-) then this is removed (before the concatenated macro name
* may be expanded again.
*/
static void processConcatOperators(QCString &expr)
{
- //printf("processConcatOperators: in='%s'\n",expr.data());
- QRegExp r("[ \\t\\n]*##[ \\t\\n]*");
- int l,n,i=0;
if (expr.isEmpty()) return;
- while ((n=r.match(expr,i,&l))!=-1)
+ //printf("processConcatOperators: in='%s'\n",qPrint(expr));
+ std::string e = expr.str();
+ static const reg::Ex r(R"(\s*##\s*)");
+ reg::Iterator end;
+
+ size_t i=0;
+ for (;;)
{
- //printf("Match: '%s'\n",expr.data()+i);
- if (n+l+1<(int)expr.length() && expr.at(n+l)=='@' && expr.at(n+l+1)=='-')
+ reg::Iterator it(e,r,i);
+ if (it!=end)
{
- // remove no-rescan marker after ID
- l+=2;
+ const auto &match = *it;
+ size_t n = match.position();
+ size_t l = match.length();
+ //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",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;
+ while (k>=0 && isId(e[k])) k--;
+ if (k>0 && e[k]=='-' && e[k-1]=='@')
+ {
+ // remove no-rescan marker before ID
+ e=e.substr(0,k-1)+e.substr(k+1);
+ n-=2;
+ }
+ i=n;
}
- //printf("found '%s'\n",expr.mid(n,l).data());
- // remove the ## operator and the surrounding whitespace
- expr=expr.left(n)+expr.right(expr.length()-n-l);
- int k=n-1;
- while (k>=0 && isId(expr.at(k))) k--;
- if (k>0 && expr.at(k)=='-' && expr.at(k-1)=='@')
+ else
{
- // remove no-rescan marker before ID
- expr=expr.left(k-1)+expr.right(expr.length()-k-1);
- n-=2;
+ break;
}
- i=n;
}
- //printf("processConcatOperators: out='%s'\n",expr.data());
+
+ expr = e;
+
+ //printf("processConcatOperators: out='%s'\n",qPrint(expr));
}
static void returnCharToStream(yyscan_t yyscanner,char c)
@@ -2006,29 +2045,29 @@ static inline void addTillEndOfString(yyscan_t yyscanner,const QCString &expr,QC
}
/*! replaces the function macro \a def whose argument list starts at
- * \a pos in expression \a expr.
+ * \a pos in expression \a expr.
* Notice that this routine may scan beyond the \a expr string if needed.
* In that case the characters will be read from the input file.
- * The replacement string will be returned in \a result and the
+ * The replacement string will be returned in \a result and the
* length of the (unexpanded) argument list is stored in \a len.
- */
+ */
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);
int cc;
- while ((cc=getCurrentChar(yyscanner,expr,rest,j))!=EOF && isspace(cc))
- {
- len++;
- getNextChar(yyscanner,expr,rest,j);
+ while ((cc=getCurrentChar(yyscanner,expr,rest,j))!=EOF && isspace(cc))
+ {
+ len++;
+ getNextChar(yyscanner,expr,rest,j);
}
- if (cc!='(')
- {
- unputChar(yyscanner,expr,rest,j,(char)cc);
- return FALSE;
+ if (cc!='(')
+ {
+ unputChar(yyscanner,expr,rest,j,' ');
+ return FALSE;
}
getNextChar(yyscanner,expr,rest,j); // eat the '(' character
@@ -2048,7 +2087,7 @@ static bool replaceFunctionMacro(yyscan_t yyscanner,const QCString &expr,QCStrin
}
else
{
- while (!done && (argCount<def->nargs || def->varArgs) &&
+ while (!done && (argCount<def->nargs || def->varArgs) &&
((cc=getNextChar(yyscanner,expr,rest,j))!=EOF && cc!=0)
)
{
@@ -2102,21 +2141,21 @@ static bool replaceFunctionMacro(yyscan_t yyscanner,const QCString &expr,QCStrin
done=TRUE;
}
}
- }
+ }
else if (c=='\"') // append literal strings
{
- arg+=c;
+ arg+=c;
bool found=FALSE;
while (!found && (cc=getNextChar(yyscanner,expr,rest,j))!=EOF && cc!=0)
{
found = cc=='"';
if (cc=='\\')
{
- c=(char)cc;
+ c=(char)cc;
arg+=c;
if ((cc=getNextChar(yyscanner,expr,rest,j))==EOF || cc==0) break;
}
- c=(char)cc;
+ c=(char)cc;
arg+=c;
}
}
@@ -2129,14 +2168,14 @@ static bool replaceFunctionMacro(yyscan_t yyscanner,const QCString &expr,QCStrin
found = cc=='\'';
if (cc=='\\')
{
- c=(char)cc;
+ c=(char)cc;
arg+=c;
if ((cc=getNextChar(yyscanner,expr,rest,j))==EOF || cc==0) break;
}
c=(char)cc;
arg+=c;
}
- }
+ }
else if (c=='/') // possible start of a comment
{
char prevChar = '\0';
@@ -2168,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())
{
@@ -2196,7 +2235,7 @@ static bool replaceFunctionMacro(yyscan_t yyscanner,const QCString &expr,QCStrin
k++;
// scan the number
while (k<d.length() && d.at(k)>='0' && d.at(k)<='9') key+=d.at(k++);
- if (!hash)
+ if (!hash)
{
// search for ## forward
l=k;
@@ -2204,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)
@@ -2218,9 +2257,9 @@ 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
+ // if the marker is inside a string (because a # was put
// before the macro name) we must escape " and \ characters
resExpr+=stringize(substArg);
}
@@ -2244,7 +2283,7 @@ static bool replaceFunctionMacro(yyscan_t yyscanner,const QCString &expr,QCStrin
}
else // no marker, just copy
{
- if (!inString && d.at(k)=='\"')
+ if (!inString && d.at(k)=='\"')
{
inString=TRUE; // entering a literal string
}
@@ -2257,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;
}
@@ -2284,13 +2323,13 @@ static int getNextId(const QCString &expr,int p,int *l)
n=p-1;
while (p<(int)expr.length() && isId(expr.at(p))) p++;
*l=p-n;
- return n;
+ return n;
}
else if (c=='"') // skip string
{
char ppc=0,pc=c;
if (p<(int)expr.length()) c=expr.at(p);
- while (p<(int)expr.length() && (c!='"' || (pc=='\\' && ppc!='\\')))
+ while (p<(int)expr.length() && (c!='"' || (pc=='\\' && ppc!='\\')))
// continue as long as no " is found, but ignoring \", but not \\"
{
ppc=pc;
@@ -2304,11 +2343,11 @@ static int getNextId(const QCString &expr,int p,int *l)
{
//printf("Found C comment at p=%d\n",p);
char pc=c;
- if (p<(int)expr.length())
+ if (p<(int)expr.length())
{
c=expr.at(p);
if (c=='*') // Start of C comment
- {
+ {
p++;
while (p<(int)expr.length() && !(pc=='*' && c=='/'))
{
@@ -2332,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;
@@ -2358,18 +2397,18 @@ 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
+ else if (definedTest) // macro name was found after defined
{
if (def) expMacro = " 1 "; else expMacro = " 0 ";
replaced=TRUE;
@@ -2379,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();
@@ -2391,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
{
@@ -2400,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)
{
@@ -2423,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
@@ -2441,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;
}
@@ -2466,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;
}
@@ -2512,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;
@@ -2527,7 +2567,7 @@ static QCString removeIdsAndMarkers(const char *s)
{
if (*(p+1)=='@')
{
- result+=c;
+ result+=c;
}
else if (*(p+1)=='E')
{
@@ -2547,7 +2587,7 @@ static QCString removeIdsAndMarkers(const char *s)
}
else if (c=='d' && !inNum) // identifier starting with a 'd'
{
- if (qstrncmp(p,"defined ",8)==0 || qstrncmp(p,"defined(",8)==0)
+ if (qstrncmp(p,"defined ",8)==0 || qstrncmp(p,"defined(",8)==0)
// defined keyword
{
p+=7; // skip defined
@@ -2599,7 +2639,7 @@ static QCString removeIdsAndMarkers(const char *s)
char pc=c;
c=*++p;
if (c=='*') // start of C comment
- {
+ {
while (*p && !(pc=='*' && c=='/')) // search end of comment
{
pc=c;
@@ -2613,7 +2653,7 @@ static QCString removeIdsAndMarkers(const char *s)
goto nextChar;
}
}
- else
+ else
{
nextChar:
result+=c;
@@ -2623,17 +2663,18 @@ nextChar:
}
}
}
- //printf("removeIdsAndMarkers(%s)=%s\n",s,result.data());
+ //printf("removeIdsAndMarkers(%s)=%s\n",s,qPrint(result));
return result;
}
/*! replaces all occurrences of @@ in \a s by @
- * \par assumption:
+ * \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)
@@ -2646,7 +2687,7 @@ static QCString removeMarkers(const char *s)
{
if (*(p+1)=='@')
{
- result+=c;
+ result+=c;
}
p+=2;
}
@@ -2657,12 +2698,12 @@ static QCString removeMarkers(const char *s)
char pc=c;
c=*++p;
if (c=='*') // start of C comment
- {
+ {
while (*p && !(pc=='*' && c=='/')) // search end of comment
{
- if (*p=='@' && *(p+1)=='@')
+ if (*p=='@' && *(p+1)=='@')
result+=c,p++;
- else
+ else
result+=c;
pc=c;
c=*++p;
@@ -2684,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;
}
@@ -2698,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);
+ //printf("parsing '%s'\n",qPrint(e));
+ return state->constExpParser.parse(state->yyFileName.data(),state->yyLineNr,e.str());
}
/*! expands the macro definition in \a name
@@ -2716,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;
}
@@ -2727,15 +2768,15 @@ static void addDefine(yyscan_t yyscanner)
def.name = state->defName;
def.definition = state->defText.stripWhiteSpace();
def.nargs = state->defArgs;
- def.fileName = state->yyFileName;
+ def.fileName = state->yyFileName;
def.fileDef = state->yyFileDef;
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());
- if (!def.name.isEmpty() &&
+ //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())
{
def.isPredefined=TRUE;
@@ -2751,7 +2792,7 @@ static void addDefine(yyscan_t yyscanner)
static void addMacroDefinition(yyscan_t yyscanner)
{
YY_EXTRA_TYPE state = preYYget_extra(yyscanner);
- if (state->skip) return; // do not add this define as it is inside a
+ if (state->skip) return; // do not add this define as it is inside a
// conditional section (cond command) that is disabled.
Define define;
@@ -2798,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;
}
@@ -2874,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
{
{
@@ -2892,11 +2939,11 @@ static void readIncludeFile(yyscan_t yyscanner,const QCString &inc)
//printf("Found include file!\n");
if (Debug::isFlagSet(Debug::Preprocessor))
{
- for (i=0;i<state->includeStack.size();i++)
+ for (i=0;i<state->includeStack.size();i++)
{
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)
@@ -2927,13 +2974,13 @@ static void readIncludeFile(yyscan_t yyscanner,const QCString &inc)
state->includeStack.emplace_back(fs);
// set the scanner to the include file
- // Deal with file changes due to
+ // 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;
@@ -2968,7 +3015,7 @@ static void readIncludeFile(yyscan_t yyscanner,const QCString &inc)
if (Debug::isFlagSet(Debug::Preprocessor))
{
- for (i=0;i<state->includeStack.size();i++)
+ for (i=0;i<state->includeStack.size();i++)
{
Debug::print(Debug::Preprocessor,0," ");
}
@@ -2984,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));
}
}
}
@@ -2992,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)
{
@@ -3032,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;
@@ -3069,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));
@@ -3089,10 +3136,10 @@ static int getNextChar(yyscan_t yyscanner,const QCString &expr,QCString *rest,ui
return cc;
}
}
-
+
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));
@@ -3115,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++;
@@ -3131,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);
@@ -3145,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;
@@ -3166,36 +3213,35 @@ 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);
// add predefined macros
const StringVector &predefList = Config_getList(PREDEFINED);
- for (const auto &defStr : predefList)
+ for (const auto &ds : predefList)
{
- QCString ds = defStr.c_str();
- int i_equals=ds.find('=');
- int i_obrace=ds.find('(');
- int i_cbrace=ds.find(')');
- bool nonRecursive = i_equals>0 && ds.at(i_equals-1)==':';
+ size_t i_equals=ds.find('=');
+ size_t i_obrace=ds.find('(');
+ size_t i_cbrace=ds.find(')');
+ bool nonRecursive = i_equals!=std::string::npos && i_equals>0 && ds[i_equals-1]==':';
- if ((i_obrace==0) || (i_equals==0) || (i_equals==1 && ds.at(i_equals-1)==':'))
+ if ((i_obrace==0) || (i_equals==0) || (i_equals==1 && ds[i_equals-1]==':'))
{
continue; // no define name
}
if (i_obrace<i_equals && i_cbrace<i_equals &&
- i_obrace!=-1 && i_cbrace!=-1 &&
+ i_obrace!=std::string::npos && i_cbrace!=std::string::npos &&
i_obrace<i_cbrace
) // predefined function macro definition
{
+ static const reg::Ex reId(R"(\a\w*)");
+ reg::Iterator end;
bool varArgs = false;
int count = 0;
- int i,pi,l;
std::map<std::string,int> argMap;
- QRegExp reId("[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*"); // regexp matching an id
- if (ds.mid(i_obrace+1,i_cbrace-i_obrace-1)=="...")
+ if (ds.substr(i_obrace+1,i_cbrace-i_obrace-1)=="...")
{
varArgs = true;
argMap.emplace("__VA_ARGS__",count);
@@ -3203,14 +3249,18 @@ static void initPredefined(yyscan_t yyscanner,const char *fileName)
}
else
{
- //printf("predefined function macro '%s'\n",qPrint(ds.mid(i_obrace+1,i_cbrace-i_obrace-1)));
- i=i_obrace+1;
+ size_t i=i_obrace+1;
+ //printf("predefined function macro '%s'\n",ds.c_str());
+ reg::Iterator it(ds,reId,i);
// gather the formal arguments in a dictionary
- while (i<i_cbrace && (pi=reId.match(ds,i,&l)))
+ while (i<i_cbrace && it!=end)
{
+ const auto &match = *it;
+ size_t pi = match.position();
+ size_t l = match.length();
if (l>0) // see bug375037
{
- argMap.emplace(toStdString(ds.mid(pi,l)),count);
+ argMap.emplace(match.str(),count);
count++;
i=pi+l;
}
@@ -3218,36 +3268,42 @@ static void initPredefined(yyscan_t yyscanner,const char *fileName)
{
i++;
}
+ ++it;
}
}
// strip definition part
- QCString tmp=ds.right(ds.length()-i_equals-1);
- QCString definition;
- i=0;
+ std::string definition;
+ std::string in=ds.substr(i_equals+1);
+ reg::Iterator re_it(in,reId);
+ size_t i=0;
// substitute all occurrences of formal arguments by their
// corresponding markers
- while ((pi=reId.match(tmp,i,&l))!=-1)
+ for (; re_it!=end; ++re_it)
{
- if (pi>i) definition+=tmp.mid(i,pi-i);
- auto it = argMap.find(tmp.mid(pi,l).data());
+ const auto &match = *re_it;
+ size_t pi = match.position();
+ size_t l = match.length();
+ if (pi>i) definition+=in.substr(i,pi-i);
+
+ auto it = argMap.find(match.str());
if (it!=argMap.end())
{
int argIndex = it->second;
QCString marker;
marker.sprintf(" @%d ",argIndex);
- definition+=marker;
+ definition+=marker.str();
}
else
{
- definition+=tmp.mid(pi,l);
+ definition+=match.str();
}
i=pi+l;
}
- if (i<(int)tmp.length()) definition+=tmp.mid(i,tmp.length()-i);
+ definition+=in.substr(i);
// add define definition to the dictionary of defines for this file
- QCString dname = ds.left(i_obrace);
- if (!dname.isEmpty())
+ std::string dname = ds.substr(0,i_obrace);
+ if (!dname.empty())
{
Define def;
def.name = dname;
@@ -3261,27 +3317,23 @@ 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 ((i_obrace==-1 || i_obrace>i_equals) &&
- (i_cbrace==-1 || i_cbrace>i_equals) &&
- !ds.isEmpty() && (int)ds.length()>i_equals
- ) // predefined non-function macro definition
+ else if (!ds.empty()) // predefined non-function macro definition
{
- //printf("predefined normal macro '%s'\n",defStr);
+ //printf("predefined normal macro '%s'\n",ds.c_str());
Define def;
- if (i_equals==-1) // simple define without argument
+ if (i_equals==std::string::npos) // simple define without argument
{
def.name = ds;
def.definition = "1"; // substitute occurrences by 1 (true)
}
else // simple define with argument
{
- int ine=i_equals - (nonRecursive ? 1 : 0);
- def.name = ds.left(ine);
- def.definition = ds.right(ds.length()-i_equals-1);
+ int ine=static_cast<int>(i_equals) - (nonRecursive ? 1 : 0);
+ def.name = ds.substr(0,ine);
+ def.definition = ds.substr(i_equals+1);
}
if (!def.name.isEmpty())
{
@@ -3304,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>())
@@ -3322,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;
@@ -3333,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);
@@ -3355,29 +3407,29 @@ void Preprocessor::processFile(const char *fileName,BufStr &input,BufStr &output
state->inputFileDef = state->yyFileDef;
//yyextra->defineManager.startContext(state->yyFileName);
-
+
initPredefined(yyscanner,fileName);
-
+
state->yyLineNr = 1;
state->yyColNr = 1;
state->ifcount = 0;
BEGIN( Start );
-
+
state->expectGuard = guessSection(fileName)==Entry::HEADER_SEC;
state->guardName.resize(0);
state->lastGuardName.resize(0);
state->guardExpr.resize(0);
-
+
preYYlex(yyscanner);
while (!state->condStack.empty())
{
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)
@@ -3388,19 +3440,20 @@ 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,"---------\n00001 ");
+ Debug::print(Debug::Preprocessor,0,"---------\n");
+ if (!Debug::isFlagSet(Debug::NoLineNo)) Debug::print(Debug::Preprocessor,0,"00001 ");
while (orgPos<newPos)
{
putchar(*orgPos);
- if (*orgPos=='\n') Debug::print(Debug::Preprocessor,0,"%05d ",++line);
+ if (*orgPos=='\n' && !Debug::isFlagSet(Debug::NoLineNo)) Debug::print(Debug::Preprocessor,0,"%05d ",++line);
orgPos++;
}
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)
{
@@ -3414,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));
}
}
@@ -3436,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 7bc5821..d1e6fab 100644
--- a/src/printdocvisitor.h
+++ b/src/printdocvisitor.h
@@ -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.
*
@@ -19,7 +19,6 @@
#ifndef _PRINTDOCVISITOR_H
#define _PRINTDOCVISITOR_H
-#include <qglobal.h>
#include "docvisitor.h"
#include "htmlentity.h"
#include "emoji.h"
@@ -29,27 +28,27 @@
class PrintDocVisitor : public DocVisitor
{
public:
- PrintDocVisitor() : DocVisitor(DocVisitor_Other), m_indent(0),
+ PrintDocVisitor() : DocVisitor(DocVisitor_Other), m_indent(0),
m_needsEnter(FALSE), m_insidePre(FALSE) {}
-
+
//--------------------------------------
-
+
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
{
@@ -85,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 *)
{
@@ -166,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;
@@ -185,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;
@@ -209,8 +208,8 @@ class PrintDocVisitor : public DocVisitor
case DocInclude::VerbInclude: printf("verbinclude"); break;
case DocInclude::Snippet: printf("snippet"); break;
case DocInclude::SnipWithLines: printf("snipwithlines"); break;
- case DocInclude::SnippetDoc:
- case DocInclude::IncludeDoc:
+ case DocInclude::SnippetDoc:
+ case DocInclude::IncludeDoc:
err("Internal inconsistency: found switch SnippetDoc / IncludeDoc in file: %s"
"Please create a bug report\n",__FILE__);
break;
@@ -220,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;
@@ -233,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 *)
{
@@ -251,12 +250,12 @@ 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()));
}
//--------------------------------------
-
+
void visitPre(DocAutoList *l)
{
indent_pre();
@@ -286,12 +285,12 @@ class PrintDocVisitor : public DocVisitor
indent_pre();
printf("<li>\n");
}
- void visitPost(DocAutoListItem *)
+ void visitPost(DocAutoListItem *)
{
indent_post();
printf("</li>\n");
}
- void visitPre(DocPara *)
+ void visitPre(DocPara *)
{
indent_pre();
printf("<para>\n");
@@ -368,7 +367,7 @@ class PrintDocVisitor : public DocVisitor
indent_pre();
printf("<li>\n");
}
- void visitPost(DocSimpleListItem *)
+ void visitPost(DocSimpleListItem *)
{
indent_post();
printf("</li>\n");
@@ -378,7 +377,7 @@ class PrintDocVisitor : public DocVisitor
indent_pre();
printf("<sect%d>\n",s->level());
}
- void visitPost(DocSection *s)
+ void visitPost(DocSection *s)
{
indent_post();
printf("</sect%d>\n",s->level());
@@ -386,9 +385,19 @@ class PrintDocVisitor : public DocVisitor
void visitPre(DocHtmlList *s)
{
indent_pre();
- if (s->type()==DocHtmlList::Ordered) printf("<ol>\n"); else printf("<ul>\n");
+ if (s->type()==DocHtmlList::Ordered)
+ {
+ printf("<ol");
+ for (const auto &opt : s->attribs())
+ {
+ printf(" %s=\"%s\"",qPrint(opt.name),qPrint(opt.value));
+ }
+ printf(">\n");
+ }
+ else printf("<ul>\n");
+
}
- void visitPost(DocHtmlList *s)
+ void visitPost(DocHtmlList *s)
{
indent_post();
if (s->type()==DocHtmlList::Ordered) printf("</ol>\n"); else printf("</ul>\n");
@@ -398,7 +407,7 @@ class PrintDocVisitor : public DocVisitor
indent_pre();
printf("<li>\n");
}
- void visitPost(DocHtmlListItem *)
+ void visitPost(DocHtmlListItem *)
{
indent_post();
printf("</li>\n");
@@ -409,7 +418,7 @@ class PrintDocVisitor : public DocVisitor
// printf("<pre>\n");
// m_insidePre=TRUE;
//}
- //void visitPost(DocHtmlPre *)
+ //void visitPost(DocHtmlPre *)
//{
// m_insidePre=FALSE;
// indent_post();
@@ -420,7 +429,7 @@ class PrintDocVisitor : public DocVisitor
indent_pre();
printf("<dl>\n");
}
- void visitPost(DocHtmlDescList *)
+ void visitPost(DocHtmlDescList *)
{
indent_post();
printf("</dl>\n");
@@ -430,7 +439,7 @@ class PrintDocVisitor : public DocVisitor
indent_pre();
printf("<dt>\n");
}
- void visitPost(DocHtmlDescTitle *)
+ void visitPost(DocHtmlDescTitle *)
{
indent_post();
printf("</dt>\n");
@@ -440,7 +449,7 @@ class PrintDocVisitor : public DocVisitor
indent_pre();
printf("<dd>\n");
}
- void visitPost(DocHtmlDescData *)
+ void visitPost(DocHtmlDescData *)
{
indent_post();
printf("</dd>\n");
@@ -448,10 +457,10 @@ class PrintDocVisitor : public DocVisitor
void visitPre(DocHtmlTable *t)
{
indent_pre();
- printf("<table rows=\"%d\" cols=\"%d\">\n",
+ printf("<table rows=\"%zu\" cols=\"%zu\">\n",
t->numRows(),t->numColumns());
}
- void visitPost(DocHtmlTable *)
+ void visitPost(DocHtmlTable *)
{
indent_post();
printf("</table>\n");
@@ -461,7 +470,7 @@ class PrintDocVisitor : public DocVisitor
indent_pre();
printf("<tr>\n");
}
- void visitPost(DocHtmlRow *)
+ void visitPost(DocHtmlRow *)
{
indent_post();
printf("</tr>\n");
@@ -471,7 +480,7 @@ class PrintDocVisitor : public DocVisitor
indent_pre();
printf("<t%c>\n",c->isHeading()?'h':'d');
}
- void visitPost(DocHtmlCell *c)
+ void visitPost(DocHtmlCell *c)
{
indent_post();
printf("</t%c>\n",c->isHeading()?'h':'d');
@@ -481,7 +490,7 @@ class PrintDocVisitor : public DocVisitor
indent_pre();
printf("<caption>\n");
}
- void visitPost(DocHtmlCaption *)
+ void visitPost(DocHtmlCaption *)
{
indent_post();
printf("</caption>\n");
@@ -491,7 +500,7 @@ class PrintDocVisitor : public DocVisitor
indent_pre();
printf("<internal>\n");
}
- void visitPost(DocInternal *)
+ void visitPost(DocInternal *)
{
indent_post();
printf("</internal>\n");
@@ -499,9 +508,9 @@ 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 *)
+ void visitPost(DocHRef *)
{
indent_post();
printf("</a>\n");
@@ -511,7 +520,7 @@ class PrintDocVisitor : public DocVisitor
indent_pre();
printf("<h%d>\n",header->level());
}
- void visitPost(DocHtmlHeader *header)
+ void visitPost(DocHtmlHeader *header)
{
indent_post();
printf("</h%d>\n",header->level());
@@ -519,7 +528,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;
@@ -527,9 +536,9 @@ 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 *)
+ void visitPost(DocImage *)
{
indent_post();
printf("</image>\n");
@@ -537,9 +546,9 @@ 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 *)
+ void visitPost(DocDotFile *)
{
indent_post();
printf("</dotfile>\n");
@@ -547,9 +556,9 @@ 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 *)
+ void visitPost(DocMscFile *)
{
indent_post();
printf("</mscfile>\n");
@@ -557,7 +566,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 *)
{
@@ -568,9 +577,9 @@ 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 *)
+ void visitPost(DocLink *)
{
indent_post();
printf("</link>\n");
@@ -581,12 +590,12 @@ 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");
}
- void visitPost(DocRef *)
+ void visitPost(DocRef *)
{
indent_post();
printf("</ref>\n");
@@ -594,9 +603,9 @@ 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 *)
+ void visitPost(DocSecRefItem *)
{
indent_post();
printf("</secrefitem>\n");
@@ -606,7 +615,7 @@ class PrintDocVisitor : public DocVisitor
indent_pre();
printf("<secreflist>\n");
}
- void visitPost(DocSecRefList *)
+ void visitPost(DocSecRefList *)
{
indent_post();
printf("</secreflist>\n");
@@ -614,9 +623,9 @@ 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 *)
+ //void visitPost(DocLanguage *)
//{
// indent_post();
// printf("</language>\n");
@@ -624,23 +633,19 @@ class PrintDocVisitor : public DocVisitor
void visitPre(DocParamList *pl)
{
indent_pre();
- //QStrListIterator sli(pl->parameters());
- QListIterator<DocNode> sli(pl->parameters());
- //const char *s;
- DocNode *param;
printf("<parameters>");
- if (sli.count() > 0)
+ if (!pl->parameters().empty())
{
printf("<param>");
- for (sli.toFirst();(param=sli.current());++sli)
+ for (const auto &param : pl->parameters())
{
if (param->kind()==DocNode::Kind_Word)
{
- visit((DocWord*)param);
+ visit((DocWord*)param.get());
}
else if (param->kind()==DocNode::Kind_LinkedWord)
{
- visit((DocLinkedWord*)param);
+ visit((DocLinkedWord*)param.get());
}
else if (param->kind()==DocNode::Kind_Sep)
{
@@ -680,7 +685,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 *)
{
@@ -690,7 +695,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 *)
{
@@ -740,12 +745,12 @@ class PrintDocVisitor : public DocVisitor
private:
// helper functions
- void indent()
- {
+ void indent()
+ {
if (m_needsEnter) printf("\n");
- for (int i=0;i<m_indent;i++) printf(".");
+ for (int i=0;i<m_indent;i++) printf(".");
m_needsEnter=FALSE;
- }
+ }
void indent_leaf()
{
if (!m_needsEnter) indent();
@@ -761,7 +766,7 @@ class PrintDocVisitor : public DocVisitor
m_indent--;
indent();
}
-
+
// member variables
int m_indent;
bool m_needsEnter;
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 65788cc..6acf333 100644
--- a/src/pycode.l
+++ b/src/pycode.l
@@ -69,7 +69,7 @@ struct pycodeYY_state
{
std::unordered_map< std::string, ScopedTypeVariant > codeClassMap;
QCString curClassName;
- QStrList curClassBases;
+ StringVector curClassBases;
CodeOutputInterface * code = 0;
const char * inputString = 0; //!< the code fragment as text
@@ -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);
@@ -172,7 +172,7 @@ NONEMPTYEXP [^ \t\n:]
PARAMNONEMPTY [^ \t\n():]
IDENTIFIER ({LETTER}|"_")({LETTER}|{DIGIT}|"_")*
SCOPE {IDENTIFIER}("."{IDENTIFIER})*
-CALLANY "("[^)]*")"
+CALLANY "("[^)\n]*")"
BORDER ([^A-Za-z0-9])
POUNDCOMMENT "##"
@@ -190,7 +190,7 @@ SHORTSTRINGITEM ({SHORTSTRINGCHAR}|{ESCAPESEQ})
SHORTSTRINGCHAR [^\\\n"]
STRINGLITERAL {STRINGPREFIX}?( {SHORTSTRING} | {LONGSTRING})
STRINGPREFIX ("r"|"u"|"ur"|"R"|"U"|"UR"|"Ur"|"uR")
-KEYWORD ("lambda"|"import"|"class"|"assert"|"with"|"as"|"from"|"global"|"def"|"True"|"False")
+KEYWORD ("lambda"|"import"|"class"|"assert"|"with"|"as"|"from"|"global"|"async"|"def"|"True"|"False")
FLOWKW ("or"|"and"|"is"|"not"|"print"|"for"|"in"|"if"|"try"|"except"|"yield"|"raise"|"break"|"continue"|"pass"|"if"|"return"|"while"|"elif"|"else"|"finally")
QUOTES ("\""[^"]*"\"")
SINGLEQUOTES ("'"[^']*"'")
@@ -247,7 +247,7 @@ KEYWORD_ARGUMENTS {KEYWORD_ITEM}(","{KEYWORD_ITEM})*
KEYWORD_ITEM {IDENTIFIER}"="{EXPRESSION}
POWER {PRIMARY}("**"{U_EXPR})?
U_EXPR ({POWER}|"-"{U_EXPR}|"+"{U_EXPR}|"\~"{U_EXPR})
-M_EXPR ({U_EXPR}|{M_EXPR}"*"{U_EXPR}|{M_EXPR}"//"{U_EXPR}|{M_EXPR}"/"{U_EXPR}|{M_EXPR}"\%"{U_EXPR})
+M_EXPR ({U_EXPR}|{M_EXPR}"*"{U_EXPR}|{M_EXPR}"/""/"{U_EXPR}|{M_EXPR}"/"{U_EXPR}|{M_EXPR}"\%"{U_EXPR})
A_EXPR ({M_EXPR}|{A_EXPR}"+"{M_EXPR}|{A_EXPR}"-"{M_EXPR}
SHIFT_EXPR ({A_EXPR}|{SHIFT_EXPR}("<<"|">>"){A_EXPR})
AND_EXPR ({SHIFT_EXPR}|{AND_EXPR}"\;SPMamp;"{SHIFT_EXPR}
@@ -302,6 +302,12 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBU
endFontClass(yyscanner);
BEGIN( FunctionDec );
}
+ "async"{BB}"def"{BB} {
+ startFontClass(yyscanner,"keyword");
+ codify(yyscanner,yytext);
+ endFontClass(yyscanner);
+ BEGIN( FunctionDec );
+ }
"class"{BB} {
startFontClass(yyscanner,"keyword");
@@ -380,7 +386,7 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBU
// probably be more strict
// about what to accept.
- yyextra->curClassBases.inSort(yytext);
+ yyextra->curClassBases.push_back(yytext);
generateClassOrGlobalLink(yyscanner,*yyextra->code,yytext);
// codify(yyscanner,yytext);
}
@@ -395,10 +401,9 @@ 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);
- char *s=yyextra->curClassBases.first();
- while (s)
+ for (const auto &s : yyextra->curClassBases)
{
const ClassDef *baseDefToAdd = 0;
// find class in the local scope
@@ -410,15 +415,13 @@ TARGET ({IDENTIFIER}|"("{TARGET_LIST}")"|"["{TARGET_LIST}"]"|{ATTRIBU
// Try to find class in global scope
if (baseDefToAdd==0)
{
- baseDefToAdd=yyextra->symbolResolver.resolveClass(yyextra->currentDefinition,s);
+ baseDefToAdd=yyextra->symbolResolver.resolveClass(yyextra->currentDefinition,s.c_str());
}
if (baseDefToAdd && baseDefToAdd->name()!=yyextra->curClassName)
{
var.localDef()->insertBaseClass(baseDefToAdd->name());
}
-
- s=yyextra->curClassBases.next();
}
yyextra->codeClassMap.emplace(std::make_pair(yyextra->curClassName.str(),std::move(var)));
@@ -832,7 +835,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();
@@ -954,7 +957,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)
@@ -966,7 +969,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;
@@ -1021,9 +1024,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);
@@ -1038,14 +1041,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();
}
@@ -1058,7 +1061,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);
@@ -1096,9 +1099,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();
@@ -1110,18 +1114,17 @@ static void writeMultiLineCodeLink(yyscan_t yyscanner,
tooltip = d->briefDescriptionAsTooltip();
}
bool done=FALSE;
- char *p=(char *)text;
+ const char *p=text.data();
while (!done)
{
- char *sp=p;
+ const char *sp=p;
char c;
while ((c=*p++) && c!='\n') { }
if (c=='\n')
{
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,p-sp-1),tooltip);
nextCodeLine(yyscanner);
}
else
@@ -1162,11 +1165,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)
@@ -1197,9 +1201,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;
@@ -1208,7 +1212,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())
{
@@ -1217,7 +1221,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())
{
@@ -1231,10 +1235,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;
}
}
@@ -1244,10 +1248,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);
@@ -1273,7 +1277,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;
@@ -1282,7 +1286,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
@@ -1298,9 +1302,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
{
@@ -1352,10 +1356,10 @@ 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)
{
- MemberDef *mmd = mcd->getMemberByName(locName);
+ const MemberDef *mmd = mcd->getMemberByName(locName);
if (mmd)
{
yyextra->theCallContext.setScope(ScopedTypeVariant(stripClassName(yyscanner,mmd->typeString(),mmd->getOuterScope())));
@@ -1381,7 +1385,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);
@@ -1417,26 +1421,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())
@@ -1461,11 +1465,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() &&
@@ -1482,7 +1486,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
@@ -1499,13 +1503,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)
{
@@ -1555,11 +1559,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,
@@ -1576,9 +1580,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;
@@ -1603,7 +1607,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)
@@ -1636,7 +1640,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 4a9552e..4f331c9 100644
--- a/src/pyscanner.l
+++ b/src/pyscanner.l
@@ -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
@@ -39,12 +37,6 @@
#include <assert.h>
#include <ctype.h>
-#include <qarray.h>
-#include <qstack.h>
-#include <qregexp.h>
-#include <qfile.h>
-#include <qfileinfo.h>
-
#include "pyscanner.h"
#include "entry.h"
#include "message.h"
@@ -56,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
@@ -70,7 +63,6 @@
struct pyscannerYY_state
{
- pyscannerYY_state() : packageNameCache(257) {}
CommentScanner commentScanner;
OutlineParserInterface *thisParser = 0;
const char * inputString = 0;
@@ -94,18 +86,18 @@ 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;
bool importTuple = FALSE;
- QDict<QCString> packageNameCache;
+ StringUnorderedMap packageNameCache;
char atomStart = 0;
char atomEnd = 0;
int atomCount = 0;
QCString moduleScope;
QCString packageName;
- QGString defVal;
+ TextStream defVal;
int braceCount = 0;
bool lexInit = FALSE;
bool packageCommentAllowed = FALSE;
@@ -114,6 +106,7 @@ struct pyscannerYY_state
QCString argType;
bool funcParamsEnd = FALSE;
std::vector<QCString> decorators;
+ QCString programStr;
};
//-----------------------------------------------------------------------------
@@ -141,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);
@@ -261,10 +254,20 @@ STARTDOCSYMS "##"
searchFoundDef(yyscanner);
BEGIN( FunctionDec );
}
+ ^{B}"async"{BB}"def"{BB} { // start of an async function/method definition with indent
+ DBG_CTX((stderr,"Found async def at %d\n",yyextra->yyLineNr));
+ yyextra->indent=computeIndent(yytext);
+ searchFoundDef(yyscanner);
+ BEGIN( FunctionDec );
+ }
"def"{BB} { // start of a function/method definition
searchFoundDef(yyscanner);
BEGIN( FunctionDec );
}
+ "async"{BB}"def"{BB} { // start of a function/method definition
+ searchFoundDef(yyscanner);
+ BEGIN( FunctionDec );
+ }
^{B}"class"{BB} { // start of a class definition with indent
DBG_CTX((stderr,"Found class at %d\n",yyextra->yyLineNr));
@@ -338,6 +341,7 @@ STARTDOCSYMS "##"
yyextra->stat=TRUE;
}
"@"{SCOPE}{CALL}? { // decorator
+ lineCount(yyscanner);
}
{SCRIPTCOMMENT} { // Unix type script comment
if (yyextra->yyLineNr != 1) REJECT;
@@ -455,7 +459,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);
@@ -475,7 +479,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;
@@ -489,7 +493,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;
@@ -551,7 +555,7 @@ STARTDOCSYMS "##"
else
{
incLineNr(yyscanner);
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
}
\n{B}/"##" {
@@ -569,7 +573,7 @@ STARTDOCSYMS "##"
else
{
incLineNr(yyscanner);
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
}
<<EOF>> {
@@ -577,10 +581,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
@@ -590,46 +594,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);
}
@@ -660,7 +664,7 @@ STARTDOCSYMS "##"
}
"->" {
- yyextra->defVal.resize(0);
+ yyextra->defVal.str(std::string());
yyextra->braceCount = 0;
BEGIN(FunctionTypeAnnotation);
}
@@ -697,7 +701,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);
}
@@ -706,7 +710,7 @@ STARTDOCSYMS "##"
BEGIN(FunctionDec);
}
":"{B} {
- yyextra->defVal.resize(0);
+ yyextra->defVal.str(std::string());
yyextra->braceCount = 0;
BEGIN(FunctionAnnotation);
}
@@ -722,42 +726,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;
}
}
@@ -766,12 +770,12 @@ STARTDOCSYMS "##"
"[" |
"(" {
++yyextra->braceCount;
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
}
"}" |
"]" {
--yyextra->braceCount;
- yyextra->defVal+=*yytext;
+ yyextra->defVal << *yytext;
}
")" |
"=" |
@@ -779,7 +783,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);
@@ -788,27 +792,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;
}
}
@@ -817,19 +821,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);
@@ -838,28 +842,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;
}
}
@@ -880,7 +884,7 @@ STARTDOCSYMS "##"
BEGIN(Search);
}
^{BB}/\n { // skip empty line
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
<<EOF>> {
endOfDef(yyscanner);
@@ -901,49 +905,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);
}
@@ -961,7 +965,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+"::");
}
@@ -982,7 +986,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);
}
@@ -1019,17 +1023,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
@@ -1039,12 +1043,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);
}
@@ -1053,7 +1057,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 );
@@ -1065,41 +1069,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;
@@ -1108,7 +1112,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;
@@ -1119,7 +1123,7 @@ STARTDOCSYMS "##"
{
yyextra->current->type = "tuple";
}
- yyextra->current->initializer+=*yytext;
+ yyextra->current->initializer << *yytext;
yyextra->atomStart='(';
yyextra->atomEnd=')';
yyextra->atomCount=1;
@@ -1127,7 +1131,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;
@@ -1135,7 +1139,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;
@@ -1148,9 +1152,6 @@ STARTDOCSYMS "##"
// do something based on the type of the IDENTIFIER
if (yyextra->current->type.isEmpty())
{
- //QListIterator<Entry> eli(*(yyextra->current_root->children()));
- //Entry *child;
- //for (eli.toFirst();(child=eli.yyextra->current());++eli)
for (const auto &child : yyextra->current_root->children())
{
if (child->name == QCString(yytext))
@@ -1161,11 +1162,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');
@@ -1175,14 +1176,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--;
@@ -1195,37 +1196,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);
}
@@ -1285,8 +1286,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)
//{
@@ -1391,7 +1392,7 @@ STARTDOCSYMS "##"
<TripleString>{
{ENDTRIDOUBLEQUOTE} |
{ENDTRISINGLEQUOTE} {
- *yyextra->copyString += yytext;
+ *yyextra->copyString << yytext;
if (yyextra->doubleQuote==(yytext[0]=='"'))
{
BEGIN(yyextra->stringContext);
@@ -1401,14 +1402,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;
}
}
@@ -1463,7 +1464,6 @@ static void initParser(yyscan_t yyscanner)
yyextra->virt = Normal;
yyextra->previous = 0;
yyextra->packageCommentAllowed = TRUE;
- yyextra->packageNameCache.setAutoDelete(TRUE);
}
static void initEntry(yyscan_t yyscanner)
@@ -1534,12 +1534,12 @@ static inline int computeIndent(const char *s)
static QCString findPackageScopeFromPath(yyscan_t yyscanner,const QCString &path)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
- QCString *pScope = yyextra->packageNameCache.find(path);
- if (pScope)
+ auto it = yyextra->packageNameCache.find(path.str());
+ if (it!=yyextra->packageNameCache.end())
{
- return *pScope;
+ 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('/');
@@ -1551,18 +1551,18 @@ static QCString findPackageScopeFromPath(yyscan_t yyscanner,const QCString &path
scope+="::";
}
scope+=path.mid(i+1);
- yyextra->packageNameCache.insert(path,new QCString(scope));
+ yyextra->packageNameCache.insert(std::make_pair(path.str(),scope.str()));
return scope;
}
}
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)
@@ -1571,7 +1571,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);
@@ -1615,7 +1615,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;
@@ -1677,7 +1677,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)
@@ -1755,16 +1755,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)
@@ -1776,7 +1777,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;
@@ -1789,7 +1790,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);
@@ -1801,11 +1804,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;
@@ -1816,15 +1821,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())
@@ -1860,7 +1864,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);
}
@@ -1870,7 +1875,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!");
@@ -1891,7 +1896,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 );
@@ -1938,16 +1943,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);
@@ -1958,10 +1963,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/qtools/qcstring.cpp b/src/qcstring.cpp
index da7a46f..d95687d 100644
--- a/qtools/qcstring.cpp
+++ b/src/qcstring.cpp
@@ -14,16 +14,12 @@
*/
#include "qcstring.h"
-#include "qgstring.h"
-#include <qstring.h>
#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <ctype.h>
-#include <qregexp.h>
-#include <qdatastream.h>
QCString &QCString::sprintf( const char *format, ... )
{
@@ -50,7 +46,7 @@ int QCString::find( char c, int index, bool cs ) const
else
{
pos = data()+index;
- c = tolower((unsigned char)c);
+ c = (char)tolower((unsigned char)c);
while (*pos && tolower((unsigned char)*pos)!=c) pos++;
if (!*pos && c) pos=0; // not found
}
@@ -87,13 +83,6 @@ int QCString::find( const QCString &str, int index, bool cs ) const
return find(str.data(),index,cs);
}
-int QCString::find( const QRegExp &rx, int index ) const
-{
- if ( index < 0 )
- index += length();
- return rx.match( data(), index );
-}
-
int QCString::findRev( char c, int index, bool cs) const
{
const char *b = data();
@@ -120,7 +109,7 @@ int QCString::findRev( char c, int index, bool cs) const
}
else
{
- c = tolower((unsigned char)c);
+ c = (char)tolower((unsigned char)c);
while ( pos>=b && tolower((unsigned char)*pos)!=c) pos--;
}
return pos>=b ? (int)(pos - b) : -1;
@@ -146,20 +135,6 @@ int QCString::findRev( const char *str, int index, bool cs) const
return -1;
}
-int QCString::findRev( const QRegExp &rx, int index ) const
-{
- if ( index < 0 ) // neg index ==> start from end
- index += length();
- if ( (uint)index > length() ) // bad index
- return -1;
- while( index >= 0 ) {
- if ( rx.match( data(), index ) == index )
- return index;
- index--;
- }
- return -1;
-}
-
int QCString::contains( char c, bool cs ) const
{
if (length()==0) return 0;
@@ -171,7 +146,7 @@ int QCString::contains( char c, bool cs ) const
}
else
{
- c = tolower((unsigned char)c);
+ c = (char)tolower((unsigned char)c);
while (*pos)
{
if (tolower((unsigned char)*pos)==c) count++;
@@ -202,23 +177,6 @@ int QCString::contains( const char *str, bool cs ) const
return count;
}
-int QCString::contains( const QRegExp &rx ) const
-{
- if ( isEmpty() )
- return rx.match( data() ) < 0 ? 0 : 1;
- int count = 0;
- int index = -1;
- int len = length();
- while ( index < len-1 ) { // count overlapping matches
- index = rx.match( data(), index+1 );
- if ( index < 0 )
- break;
- count++;
- }
- return count;
-}
-
-
QCString QCString::simplifyWhiteSpace() const
{
if ( isEmpty() ) // nothing to do
@@ -230,9 +188,9 @@ QCString QCString::simplifyWhiteSpace() const
char *first = to;
while ( TRUE )
{
- while ( *from && isspace((uchar) *from) )
+ while ( *from && qisspace(*from) )
from++;
- while ( *from && !isspace((uchar)*from) )
+ while ( *from && !qisspace(*from) )
*to++ = *from++;
if ( *from )
*to++ = 0x20; // ' '
@@ -253,27 +211,6 @@ QCString &QCString::replace( uint index, uint len, const char *s)
return *this;
}
-QCString &QCString::replace( const QRegExp &rx, const char *str )
-{
- if ( isEmpty() )
- return *this;
- int index = 0;
- int slen = qstrlen(str);
- int len;
- while ( index < (int)length() ) {
- index = rx.match( data(), index, &len, FALSE );
- if ( index >= 0 ) {
- replace( index, len, str );
- index += slen;
- if ( !len )
- break; // Avoid infinite loop on 0-length matches, e.g. [a-z]*
- }
- else
- break;
- }
- return *this;
-}
-
static bool ok_in_base( char c, int base )
{
if ( base <= 10 )
@@ -325,7 +262,7 @@ long QCString::toLong(bool *ok,int base) const
int neg = 0;
if ( !p )
goto bye;
- while ( l && isspace(*p) ) // skip leading space
+ while ( l && qisspace(*p) ) // skip leading space
l--,p++;
if ( l && *p == '-' ) {
l--;
@@ -357,7 +294,7 @@ long QCString::toLong(bool *ok,int base) const
}
if ( neg )
val = -val;
- while ( l && isspace(*p) ) // skip trailing space
+ while ( l && qisspace(*p) ) // skip trailing space
l--,p++;
if ( !l )
is_ok = TRUE;
@@ -376,7 +313,7 @@ ulong QCString::toULong(bool *ok,int base) const
bool is_ok = FALSE;
if ( !p )
goto bye;
- while ( l && isspace(*p) ) // skip leading space
+ while ( l && qisspace(*p) ) // skip leading space
l--,p++;
if ( *p == '+' )
l--,p++;
@@ -401,7 +338,7 @@ ulong QCString::toULong(bool *ok,int base) const
p++;
}
- while ( l && isspace(*p) ) // skip trailing space
+ while ( l && qisspace(*p) ) // skip trailing space
l--,p++;
if ( !l )
is_ok = TRUE;
@@ -420,7 +357,7 @@ uint64 QCString::toUInt64(bool *ok,int base) const
bool is_ok = FALSE;
if ( !p )
goto bye;
- while ( l && isspace(*p) ) // skip leading space
+ while ( l && qisspace(*p) ) // skip leading space
l--,p++;
if ( *p == '+' )
l--,p++;
@@ -445,7 +382,7 @@ uint64 QCString::toUInt64(bool *ok,int base) const
p++;
}
- while ( l && isspace(*p) ) // skip trailing space
+ while ( l && qisspace(*p) ) // skip trailing space
l--,p++;
if ( !l )
is_ok = TRUE;
@@ -480,7 +417,6 @@ char *qstrdup( const char *str )
if ( !str )
return 0;
char *dst = new char[qstrlen(str)+1];
- CHECK_PTR( dst );
return strcpy( dst, str );
}
@@ -502,7 +438,7 @@ int qstricmp( const char *str1, const char *str2 )
uchar c;
if ( !s1 || !s2 )
return s1 == s2 ? 0 : (int)(s2 - s1);
- for ( ; !(res = (c=tolower(*s1)) - tolower(*s2)); s1++, s2++ )
+ for ( ; !(res = (c=(char)tolower(*s1)) - tolower(*s2)); s1++, s2++ )
if ( !c ) // strings are equal
break;
return res;
@@ -517,7 +453,7 @@ int qstrnicmp( const char *str1, const char *str2, uint len )
if ( !s1 || !s2 )
return (int)(s2 - s1);
for ( ; len--; s1++, s2++ ) {
- if ( (res = (c=tolower(*s1)) - tolower(*s2)) )
+ if ( (res = (c=(char)tolower(*s1)) - tolower(*s2)) )
return res;
if ( !c ) // strings are equal
break;
@@ -525,68 +461,6 @@ int qstrnicmp( const char *str1, const char *str2, uint len )
return 0;
}
-#ifndef QT_NO_DATASTREAM
-
-QDataStream &operator<<( QDataStream &s, const QByteArray &a )
-{
- return s.writeBytes( a.data(), a.size() );
-}
-
-QDataStream &operator>>( QDataStream &s, QByteArray &a )
-{
- Q_UINT32 len;
- s >> len; // read size of array
- if ( len == 0 || s.eof() ) { // end of file reached
- a.resize( 0 );
- return s;
- }
- if ( !a.resize( (uint)len ) ) { // resize array
-#if defined(CHECK_NULL)
- qWarning( "QDataStream: Not enough memory to read QByteArray" );
-#endif
- len = 0;
- }
- if ( len > 0 ) // not null array
- s.readRawBytes( a.data(), (uint)len );
- return s;
-}
-
-QDataStream &operator<<( QDataStream &s, const QCString &str )
-{
- return s.writeBytes( str.data(), str.size() );
-}
-
-QDataStream &operator>>( QDataStream &s, QCString &str )
-{
- Q_UINT32 len;
- s >> len; // read size of string
- if ( len == 0 || s.eof() ) { // end of file reached
- str.resize( 0 );
- return s;
- }
- if ( !str.resize( (uint)len )) {// resize string
-#if defined(CHECK_NULL)
- qWarning( "QDataStream: Not enough memory to read QCString" );
-#endif
- len = 0;
- }
- if ( len > 0 ) // not null array
- s.readRawBytes( str.rawData(), (uint)len );
- return s;
-}
-
-#endif //QT_NO_DATASTREAM
-
-inline QCString operator+( const QCString &s1, const QGString &s2 )
-{
- return s1.str()+s2.data();
-}
-
-inline QCString operator+( const QGString &s1, const QCString &s2 )
-{
- return s1.data()+s2.str();
-}
-
/// substitute all occurrences of \a src in \a s by \a dst
QCString substitute(const QCString &s,const QCString &src,const QCString &dst)
{
@@ -598,7 +472,7 @@ QCString substitute(const QCString &s,const QCString &src,const QCString &dst)
if (srcLen!=dstLen)
{
int count;
- for (count=0, p=s.data(); (q=strstr(p,src))!=0; p=q+srcLen) 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
@@ -607,13 +481,13 @@ QCString substitute(const QCString &s,const QCString &src,const QCString &dst)
}
QCString result(resLen+1);
char *r;
- for (r=result.rawData(), p=s; (q=strstr(p,src))!=0; p=q+srcLen)
+ 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 (dst) memcpy(r,dst,dstLen);
+ if (dstLen>0) memcpy(r,dst.data(),dstLen);
r+=dstLen;
}
if (r)
@@ -639,7 +513,7 @@ QCString substitute(const QCString &s,const QCString &src,const QCString &dst,in
if (srcLen!=dstLen)
{
int count;
- for (count=0, p=s.data(); (q=strstr(p,src))!=0; p=q+srcLen) 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
@@ -648,13 +522,13 @@ QCString substitute(const QCString &s,const QCString &src,const QCString &dst,in
}
QCString result(resLen+1);
char *r;
- for (r=result.rawData(), p=s; (q=strstr(p,src))!=0; p=q+srcLen)
+ 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,srcLen)==0; seq=1+skip, n+=srcLen)
+ 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
@@ -675,7 +549,7 @@ QCString substitute(const QCString &s,const QCString &src,const QCString &dst,in
continue;
}
- if (dst) memcpy(r,dst,dstLen);
+ if (dstLen>0) memcpy(r,dst.data(),dstLen);
r+=dstLen;
}
qstrcpy(r,p);
diff --git a/qtools/qcstring.h b/src/qcstring.h
index 75bdf29..ba5ac95 100644
--- a/qtools/qcstring.h
+++ b/src/qcstring.h
@@ -17,10 +17,6 @@
#ifndef QCSTRING_H
#define QCSTRING_H
-#ifndef QT_H
-#include "qarray.h"
-#endif // QT_H
-
#include <string>
#include <algorithm>
@@ -29,8 +25,25 @@
#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)\n",#x,__FILE__,__LINE__)
-class QGString;
/*****************************************************************************
Safe and portable C string functions; extensions to standard string.h
@@ -63,38 +76,31 @@ char * qstrncpy(char *dst,const char *src, uint len);
inline int cstrcmp( const char *str1, const char *str2 )
{ return strcmp(str1,str2); }
+inline bool qisempty( const char *s)
+{ return s==0 || *s==0; }
+
inline int qstrcmp( const char *str1, const char *str2 )
-{ return (str1 && str2) ? strcmp(str1,str2) : (int)((intptr_t)str2 - (intptr_t)str1); }
+{ return (str1 && str2) ? strcmp(str1,str2) : // both non-empty
+ (qisempty(str1) && qisempty(str2)) ? 0 : // both empty
+ qisempty(str1) ? -1 : 1; // one empty, other non-empty
+}
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) :
- (int)((intptr_t)str2 - (intptr_t)str1); }
+{ return (str1 && str2) ? strncmp(str1,str2,len) : // both non-empty
+ (qisempty(str1) && qisempty(str2)) ? 0 : // both empty
+ qisempty(str1) ? -1 : 1; // one empty other non-empty
+}
+
+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 );
-/*****************************************************************************
- QByteArray class
- *****************************************************************************/
-
-#if defined(Q_TEMPLATEDLL)
-template class QArray<char>;
-#endif
-typedef QArray<char> QByteArray;
-
-/*****************************************************************************
- QByteArray stream functions
- *****************************************************************************/
-#ifndef QT_NO_DATASTREAM
-QDataStream &operator<<( QDataStream &, const QByteArray & );
-QDataStream &operator>>( QDataStream &, QByteArray & );
-#endif
-
-class QRegExp;
/** This is an alternative implementation of QCString. It provides basically
* the same functions but uses std::string as the underlying string type
@@ -109,7 +115,9 @@ class QCString
QCString( QCString &&s ) = default;
QCString &operator=( QCString &&s ) = default;
- QCString( const std::string &s ) : m_rep(s) {}
+ 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!)
@@ -124,11 +132,11 @@ class QCString
/** 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(); }
@@ -142,13 +150,11 @@ class QCString
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.empty() ? 0 : m_rep.c_str(); }
+ const char *data() const { return m_rep.c_str(); }
/** Returns a writable pointer to the data.
- * @warning if the string is shared it will modifying the string directly and
- * this will overwrite all copies as well!
*/
- char *rawData() const { return m_rep.empty() ? 0 : const_cast<char*>(&m_rep[0]); }
+ char *rawData() { return &m_rep[0]; }
/** Resizes the string to hold \a newlen characters
* (this value should also count the 0-terminator).
@@ -173,34 +179,35 @@ class QCString
return TRUE;
}
- /** Returns a deep copy of the string. */
- QCString copy() const { return *this; }
-
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 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 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;
+ //int contains( const QRegExp &rx ) const;
- bool stripPrefix(const char *prefix)
+ bool stripPrefix(const QCString &prefix)
{
- if (prefix==0 || m_rep.empty()) return FALSE;
- if (m_rep.rfind(prefix,0)==0) // string starts with 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,qstrlen(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
{
@@ -224,33 +231,45 @@ class QCString
QCString lower() const
{
- std::string s = m_rep;
- std::transform(s.begin(),s.end(),s.begin(),
- [](unsigned char c){ return (unsigned char)std::tolower(c); });
- return s;
+ return QCString(convertUTF8ToLower(m_rep));
}
QCString upper() const
{
- std::string s = m_rep;
- std::transform(s.begin(),s.end(),s.begin(),
- [](unsigned char c){ return (unsigned char)std::toupper(c); });
- return s;
+ return QCString(convertUTF8ToUpper(m_rep));
}
QCString stripWhiteSpace() const
{
int sl = (uint)m_rep.size();
- if (sl==0 || (!std::isspace(m_rep[0]) && !std::isspace(m_rep[sl-1]))) return *this;
+ if (sl==0 || (!qisspace(m_rep[0]) && !qisspace(m_rep[sl-1]))) return *this;
int start=0,end=sl-1;
- while (start<sl && std::isspace(m_rep[start])) start++;
+ while (start<sl && qisspace(m_rep[start])) start++;
if (start==sl) return QCString(); // only whitespace
- while (end>start && std::isspace(m_rep[end])) end--;
+ 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;
@@ -277,16 +296,42 @@ class QCString
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();
@@ -295,7 +340,7 @@ class QCString
}
QCString &replace( uint index, uint len, const char *s);
- QCString &replace( const QRegExp &rx, const char *str );
+ //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;
@@ -347,41 +392,75 @@ class QCString
return m_rep.rfind(s,0)==0; // looking "backward" starting and ending at index 0
}
+ bool startsWith( const QCString &s ) const
+ {
+ if (m_rep.empty() || s.isEmpty()) return s.isEmpty();
+ return m_rep.rfind(s.str(),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 *str )
+ QCString &operator+=( const char *s )
{
- if (str) m_rep+=str;
+ 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
+ char &at( uint i)
{
- return const_cast<char&>(m_rep[i]);
+ return m_rep[i];
+ }
+
+ const char &at( uint i) const
+ {
+ return m_rep[i];
}
/** Indexing operator. Equivalent to at(). */
- char &operator[]( int i ) const
+ char &operator[]( int i )
{
- return const_cast<char&>(m_rep[i]);
+ return m_rep[i];
+ }
+
+ const char &operator[]( int i ) const
+ {
+ return m_rep[i];
}
private:
@@ -389,14 +468,6 @@ class QCString
};
/*****************************************************************************
- QCString stream functions
- *****************************************************************************/
-#ifndef QT_NO_DATASTREAM
-QDataStream &operator<<( QDataStream &, const QCString & );
-QDataStream &operator>>( QDataStream &, QCString & );
-#endif
-
-/*****************************************************************************
QCString non-member operators
*****************************************************************************/
@@ -451,38 +522,37 @@ inline QCString operator+( const QCString &s1, const QCString &s2 )
}
-inline QCString operator+( const QCString &s1, const QGString &s2 );
-inline QCString operator+( const QGString &s1, const QCString &s2 );
-
-
inline QCString operator+( const QCString &s1, const char *s2 )
{
QCString tmp(s1);
- tmp += s2;
+ tmp.append(s2);
return tmp;
}
inline QCString operator+( const char *s1, const QCString &s2 )
{
QCString tmp(s1);
- tmp += s2;
+ 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 += c2;
+ tmp.append(c2);
return tmp;
}
inline QCString operator+( char c1, const QCString &s2 )
{
QCString tmp;
- tmp += c1;
- tmp += s2;
+ tmp.append(c1);
+ tmp.append(s2);
return tmp;
}
+#endif
inline const char *qPrint(const char *s)
{
@@ -504,15 +574,57 @@ 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 ss;
+ 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 f75414b..7b591eb 100644
--- a/src/qhpxmlwriter.h
+++ b/src/qhpxmlwriter.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.
*
@@ -17,10 +17,8 @@
#ifndef QHPXMLWRITER_H
#define QHPXMLWRITER_H
-#include <qstring.h>
-#include "ftextstream.h"
-
-class QFile;
+#include <sstream>
+#include "textstream.h"
class QhpXmlWriter
{
@@ -31,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 5840138..9a32449 100644
--- a/src/reflist.cpp
+++ b/src/reflist.cpp
@@ -14,16 +14,14 @@
*/
#include <algorithm>
-
#include <stdio.h>
+
#include "reflist.h"
#include "util.h"
-#include "ftextstream.h"
#include "definition.h"
-#include "sortdict.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)
{
@@ -69,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)
@@ -122,7 +120,7 @@ void RefList::generatePage()
}
doc += "</dl>\n";
//printf("generatePage('%s')\n",doc.data());
- if (cnt>0)
+ if (cnt>0)
{
addRelatedPage(m_listName,m_pageTitle,doc,m_fileName,1,1,RefItemVector(),0,0,TRUE);
}
diff --git a/src/reflist.h b/src/reflist.h
index 0ced63b..6ab360b 100644
--- a/src/reflist.h
+++ b/src/reflist.h
@@ -20,8 +20,7 @@
#include <unordered_map>
#include <memory>
-#include <qintdict.h>
-#include <qlist.h>
+#include "qcstring.h"
#include "linkedmap.h"
class Definition;
@@ -33,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; }
@@ -84,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
new file mode 100644
index 0000000..2a39f63
--- /dev/null
+++ b/src/regex.cpp
@@ -0,0 +1,757 @@
+/******************************************************************************
+ *
+ * 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 "regex.h"
+#include <cstdint>
+#include <vector>
+#include <cctype>
+#include <cassert>
+#include <algorithm>
+
+#define ENABLE_DEBUG 0
+#if ENABLE_DEBUG
+#define DBG(fmt,...) do { fprintf(stderr,fmt,__VA_ARGS__); } while(0)
+#else
+#define DBG(fmt,...) do {} while(0)
+#endif
+
+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.
+ */
+class PToken
+{
+ public:
+ /** The kind of token.
+ *
+ * Ranges per bit mask:
+ * - `0x00FF` from part of a range, except for `0x0000` which is the End marker
+ * - `0x1FFF` built-in ranges
+ * - `0x2FFF` user defined ranges
+ * - `0x4FFF` special operations
+ * - `0x8000` literal character
+ */
+ enum class Kind : uint16_t
+ {
+ End = 0x0000,
+ WhiteSpace = 0x1001, // \s range [ \t\r\n]
+ Digit = 0x1002, // \d range [0-9]
+ Alpha = 0x1003, // \a range [a-z_A-Z\x80-\xFF]
+ AlphaNum = 0x1004, // \w range [a-Z_A-Z0-9\x80-\xFF]
+ CharClass = 0x2001, // []
+ NegCharClass = 0x2002, // [^]
+ BeginOfLine = 0x4001, // ^
+ EndOfLine = 0x4002, // $
+ BeginOfWord = 0x4003, // \<
+ EndOfWord = 0x4004, // \>
+ BeginCapture = 0x4005, // (
+ EndCapture = 0x4006, // )
+ Any = 0x4007, // .
+ Star = 0x4008, // *
+ Optional = 0x4009, // ?
+ Character = 0x8000 // c
+ };
+
+ /** returns a string representation of the tokens kind (useful for debugging). */
+ const char *kindStr() const
+ {
+ if ((m_rep>>16)>=0x1000 || m_rep==0)
+ {
+ switch(static_cast<Kind>((m_rep>>16)))
+ {
+ case Kind::End: return "End";
+ case Kind::Alpha: return "Alpha";
+ case Kind::AlphaNum: return "AlphaNum";
+ case Kind::WhiteSpace: return "WhiteSpace";
+ case Kind::Digit: return "Digit";
+ case Kind::CharClass: return "CharClass";
+ case Kind::NegCharClass: return "NegCharClass";
+ case Kind::Character: return "Character";
+ case Kind::BeginOfLine: return "BeginOfLine";
+ case Kind::EndOfLine: return "EndOfLine";
+ case Kind::BeginOfWord: return "BeginOfWord";
+ case Kind::EndOfWord: return "EndOfWord";
+ case Kind::BeginCapture: return "BeginCapture";
+ case Kind::EndCapture: return "EndCapture";
+ case Kind::Any: return "Any";
+ case Kind::Star: return "Star";
+ case Kind::Optional: return "Optional";
+ }
+ }
+ else
+ {
+ return "Range";
+ }
+ }
+
+ /** Creates a token of kind 'End' */
+ PToken() : m_rep(0) {}
+
+ /** Creates a token of the given kind \a k */
+ explicit PToken(Kind k) : m_rep(static_cast<uint32_t>(k)<<16) {}
+
+ /** Create a token for an ASCII character */
+ PToken(char c) : m_rep((static_cast<uint32_t>(Kind::Character)<<16) |
+ static_cast<uint32_t>(c)) {}
+
+ /** Create a token for a byte of an UTF-8 character */
+ PToken(uint16_t v) : m_rep((static_cast<uint32_t>(Kind::Character)<<16) |
+ static_cast<uint32_t>(v)) {}
+
+ /** Create a token representing a range from one character \a from to another character \a to */
+ PToken(uint16_t from,uint16_t to) : m_rep(static_cast<uint32_t>(from)<<16 | to) {}
+
+ /** Sets the value for a token */
+ void setValue(uint16_t value) { m_rep = (m_rep & 0xFFFF0000) | value; }
+
+ /** Returns the kind of the token */
+ Kind kind() const { return static_cast<Kind>(m_rep>>16); }
+
+ /** Returns the 'from' part of the character range. Only valid if this token represents a range */
+ uint16_t from() const { return m_rep>>16; }
+
+ /** Returns the 'to' part of the character range. Only valid if this token represents a range */
+ uint16_t to() const { return m_rep & 0xFFFF; }
+
+ /** Returns the value for this token */
+ uint16_t value() const { return m_rep & 0xFFFF; }
+
+ /** Returns the value for this token as a ASCII character */
+ char asciiValue() const { return static_cast<char>(m_rep); }
+
+ /** Returns true iff this token represents a range of characters */
+ bool isRange() const { return m_rep!=0 && from()<=to(); }
+
+ /** Returns true iff this token is a positive or negative character class */
+ bool isCharClass() const { return kind()==Kind::CharClass || kind()==Kind::NegCharClass; }
+
+ private:
+ uint32_t m_rep;
+};
+
+/** Private members of a regular expression */
+class Ex::Private
+{
+ public:
+ /** Creates the private part */
+ Private(const std::string &pat) : pattern(pat)
+ {
+ data.reserve(100);
+ }
+ void compile();
+#if ENABLE_DEBUG
+ void dump();
+#endif
+ bool matchAt(size_t tokenPos,const std::string &str,Match &match,size_t pos,int level) const;
+
+ /** Flag indicating the expression was successfully compiled */
+ bool error = false;
+
+ /** The token stream representing the compiled regular expression. */
+ std::vector<PToken> data; // compiled pattern
+
+ /** The pattern string as passed by the user */
+ std::string pattern;
+};
+
+/** Compiles a regular expression passed as a string into a stream of tokens that can be used for
+ * efficient searching.
+ */
+void Ex::Private::compile()
+{
+ error = false;
+ data.clear();
+ if (pattern.empty()) return;
+ const char *start = pattern.c_str();
+ const char *ps = start;
+ char c;
+
+ int prevTokenPos=-1;
+ int tokenPos=0;
+
+ auto addToken = [&](PToken tok)
+ {
+ tokenPos++;
+ data.emplace_back(tok);
+ };
+
+ auto getNextCharacter = [&]() -> PToken
+ {
+ char cs=*ps;
+ PToken result = PToken(cs);
+ if (cs=='\\') // escaped character
+ {
+ ps++;
+ cs=*ps;
+ switch (cs)
+ {
+ case 'n': result = PToken('\n'); break;
+ case 'r': result = PToken('\r'); break;
+ case 't': result = PToken('\t'); break;
+ case 's': result = PToken(PToken::Kind::WhiteSpace); break;
+ case 'a': result = PToken(PToken::Kind::Alpha); break;
+ case 'w': result = PToken(PToken::Kind::AlphaNum); break;
+ case 'd': result = PToken(PToken::Kind::Digit); break;
+ case '<': result = PToken(PToken::Kind::BeginOfWord); break;
+ case '>': result = PToken(PToken::Kind::EndOfWord); break;
+ case 'x':
+ case 'X':
+ {
+ uint16_t v=0;
+ for (int i=0;i<2 && (cs=(*(ps+1)));i++) // 2 hex digits
+ {
+ int d = (cs>='a' && cs<='f') ? cs-'a'+10 :
+ (cs>='A' && cs<='F') ? cs-'A'+10 :
+ (cs>='0' && cs<='9') ? cs-'0' :
+ -1;
+ if (d>=0) { v<<=4; v|=d; ps++; } else break;
+ }
+ result = PToken(v);
+ }
+ break;
+ case '\0': ps--; break; // backslash at the end of the pattern
+ default:
+ result = PToken(cs);
+ break;
+ }
+ }
+ return result;
+ };
+
+ while ((c=*ps))
+ {
+ switch (c)
+ {
+ case '^': // beginning of line (if first character of the pattern)
+ prevTokenPos = tokenPos;
+ addToken(ps==start ? PToken(PToken::Kind::BeginOfLine) :
+ PToken(c));
+ break;
+ case '$': // end of the line (if last character of the pattern)
+ prevTokenPos = tokenPos;
+ addToken(*(ps+1)=='\0' ? PToken(PToken::Kind::EndOfLine) :
+ PToken(c));
+ break;
+ case '.': // any character
+ prevTokenPos = tokenPos;
+ addToken(PToken(PToken::Kind::Any));
+ break;
+ case '(': // begin of capture group
+ prevTokenPos = tokenPos;
+ addToken(PToken(PToken::Kind::BeginCapture));
+ break;
+ case ')': // end of capture group
+ prevTokenPos = tokenPos;
+ addToken(PToken(PToken::Kind::EndCapture));
+ break;
+ case '[': // character class
+ {
+ prevTokenPos = tokenPos;
+ ps++;
+ if (*ps==0) { error=true; return; }
+ bool esc = *ps=='\\';
+ PToken tok = getNextCharacter();
+ ps++;
+ if (!esc && tok.kind()==PToken::Kind::Character &&
+ tok.asciiValue()=='^') // negated character class
+ {
+ addToken(PToken(PToken::Kind::NegCharClass));
+ if (*ps==0) { error=true; return; }
+ tok = getNextCharacter();
+ ps++;
+ }
+ else
+ {
+ addToken(PToken(PToken::Kind::CharClass));
+ }
+ uint16_t numTokens=0;
+ while ((c=*ps))
+ {
+ if (c=='-' && *(ps+1)!=']' && *(ps+1)!=0) // range
+ {
+ getNextCharacter();
+ ps++;
+ PToken endTok = getNextCharacter();
+ ps++;
+ if (tok.value()>endTok.value())
+ {
+ addToken(PToken(endTok.value(),tok.value())); // swap start and end
+ }
+ else
+ {
+ addToken(PToken(tok.value(),endTok.value()));
+ }
+ numTokens++;
+ }
+ else // single char, from==to
+ {
+ if (tok.kind()==PToken::Kind::Character)
+ {
+ addToken(PToken(tok.value(),tok.value()));
+ }
+ else // special token, add as-is since from>to
+ {
+ addToken(tok);
+ }
+ numTokens++;
+ }
+ if (*ps==0) { error=true; return; } // expected at least a ]
+ esc = *ps=='\\';
+ tok = getNextCharacter();
+ if (!esc && tok.kind()==PToken::Kind::Character &&
+ tok.value()==static_cast<uint16_t>(']'))
+ {
+ break; // end of character class
+ }
+ if (*ps==0) { error=true; return; } // no ] found
+ ps++;
+ }
+ // set the value of either NegCharClass or CharClass
+ data[prevTokenPos].setValue(numTokens);
+ }
+ break;
+ case '*': // 0 or more
+ case '+': // 1 or more
+ case '?': // optional: 0 or 1
+ {
+ if (prevTokenPos==-1)
+ {
+ error=true;
+ return;
+ }
+ switch (data[prevTokenPos].kind())
+ {
+ case PToken::Kind::BeginOfLine: // $* or $+ or $?
+ case PToken::Kind::BeginOfWord: // \<* or \<+ or \<?
+ case PToken::Kind::EndOfWord: // \>* or \>+ or \>?
+ case PToken::Kind::Star: // ** or *+ or *?
+ case PToken::Kind::Optional: // ?* or ?+ or ??
+ error=true;
+ return;
+ default: // ok
+ break;
+ }
+ int ddiff = static_cast<int>(tokenPos-prevTokenPos);
+ if (*ps=='+') // convert <pat>+ -> <pat><pat>*
+ {
+ // turn a sequence of token [T1...Tn] followed by '+' into [T1..Tn T1..Tn T*]
+ // ddiff=n ^prevTokenPos
+ data.resize(data.size()+ddiff);
+ std::copy_n(data.begin()+prevTokenPos,ddiff,data.begin()+tokenPos);
+ prevTokenPos+=ddiff;
+ tokenPos+=ddiff;
+ }
+ data.insert(data.begin()+prevTokenPos,
+ c=='?' ? PToken(PToken::Kind::Optional) : PToken(PToken::Kind::Star));
+ tokenPos++;
+ addToken(PToken(PToken::Kind::End));
+ // turn a sequence of tokens [T1 T2 T3] followed by 'T*' or into [T* T1 T2 T3 TEND]
+ // ^prevTokenPos
+ // same for 'T?'.
+ }
+ break;
+ default:
+ prevTokenPos = tokenPos;
+ addToken(getNextCharacter());
+ break;
+ }
+ ps++;
+ }
+ //addToken(PToken(PToken::Kind::End));
+}
+
+#if ENABLE_DEBUG
+/** Dump the compiled token stream for this regular expression. For debugging purposes. */
+void Ex::Private::dump()
+{
+ size_t l = data.size();
+ size_t i =0;
+ DBG("==== compiled token stream for pattern '%s' ===\n",pattern.c_str());
+ while (i<l)
+ {
+ DBG("[%s:%04x]\n",data[i].kindStr(),data[i].value());
+ if (data[i].kind()==PToken::Kind::CharClass || data[i].kind()==PToken::Kind::NegCharClass)
+ {
+ uint16_t num = data[i].value();
+ while (num>0 && i<l)
+ {
+ i++;
+ if (data[i].isRange()) // from-to range
+ {
+ DBG("[%04x(%c)-%04x(%c)]\n",data[i].from(),data[i].from(),data[i].to(),data[i].to());
+ }
+ else // special character like \n or \s
+ {
+ DBG("[%s:%04x]\n",data[i].kindStr(),data[i].value());
+ }
+ num--;
+ }
+ }
+ i++;
+ }
+}
+#endif
+
+/** Internal matching routine.
+ * @param tokenPos Offset into the token stream.
+ * @param str The input string to match against.
+ * @param match The object used to store the matching results.
+ * @param pos The position in the input string to start with matching
+ * @param level Recursion level (used for debugging)
+ */
+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 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];
+ bool negate = tok.kind()==PToken::Kind::NegCharClass;
+ uint16_t numFields = tok.value();
+ bool found = false;
+ for (uint16_t i=0;i<numFields;i++)
+ {
+ tok = data[++tp];
+ // 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 && isspace(c)) ||
+ (tok.kind()==PToken::Kind::Digit && isdigit(c))
+ )
+ {
+ found=true;
+ break;
+ }
+ else // user specified range
+ {
+ uint16_t v = static_cast<uint16_t>(c);
+ if (tok.from()<=v && v<=tok.to())
+ {
+ found=true;
+ break;
+ }
+ }
+ }
+ DBG("matchCharClass(tp=%zu,c=%c (x%02x))=%d\n",tp,c,c,negate?!found:found);
+ return negate ? !found : found;
+ };
+ size_t index = pos;
+ enum SequenceType { Star, Optional };
+ auto processSequence = [this,&tokenPos,&index,&str,&matchCharClass,
+ &isStartIdChar,&isIdChar,&match,&level,&pos](SequenceType type) -> bool
+ {
+ size_t startIndex = index;
+ PToken tok = data[++tokenPos];
+ if (tok.kind()==PToken::Kind::Character) // 'x*' -> eat x's
+ {
+ char c_tok = tok.asciiValue();
+ while (index<=str.length() && str[index]==c_tok) { index++; if (type==Optional) break; }
+ tokenPos++;
+ }
+ else if (tok.isCharClass()) // '[a-f0-4]* -> eat matching characters
+ {
+ while (index<=str.length() && matchCharClass(tokenPos,str[index])) { index++; if (type==Optional) break; }
+ tokenPos+=tok.value()+1; // skip over character ranges + end token
+ }
+ else if (tok.kind()==PToken::Kind::Alpha) // '\a*' -> eat start id characters
+ {
+ while (index<=str.length() && isStartIdChar(str[index])) { index++; if (type==Optional) break; }
+ tokenPos++;
+ }
+ else if (tok.kind()==PToken::Kind::AlphaNum) // '\w*' -> eat id characters
+ {
+ while (index<=str.length() && isIdChar(str[index])) { index++; if (type==Optional) break; }
+ tokenPos++;
+ }
+ else if (tok.kind()==PToken::Kind::WhiteSpace) // '\s*' -> eat spaces
+ {
+ 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() && isdigit(str[index])) { index++; if (type==Optional) break; }
+ tokenPos++;
+ }
+ else if (tok.kind()==PToken::Kind::Any) // '.*' -> eat all
+ {
+ if (type==Optional) index++; else index = str.length();
+ tokenPos++;
+ }
+ tokenPos++; // skip over end marker
+ while ((int)index>=(int)startIndex)
+ {
+ // pattern 'x*xy' should match 'xy' and 'xxxxy'
+ bool found = matchAt(tokenPos,str,match,index,level+1);
+ if (found)
+ {
+ match.setMatch(pos,index-pos+match.length());
+ return true;
+ }
+ index--;
+ }
+ return false;
+ };
+
+ while (tokenPos<data.size())
+ {
+ PToken tok = data[tokenPos];
+ //DBG("loop tokenPos=%zu token=%s\n",tokenPos,tok.kindStr());
+ if (tok.kind()==PToken::Kind::Character) // match literal character
+ {
+ char c_tok = tok.asciiValue();
+ if (index>=str.length() || str[index]!=c_tok) return false; // end of string, or non matching char
+ index++,tokenPos++;
+ }
+ else if (tok.isCharClass())
+ {
+ if (index>=str.length() || !matchCharClass(tokenPos,str[index])) return false;
+ index++,tokenPos+=tok.value()+1; // skip over character ranges + end token
+ }
+ else
+ {
+ switch (tok.kind())
+ {
+ case PToken::Kind::Alpha:
+ if (index>=str.length() || !isStartIdChar(str[index])) return false;
+ index++;
+ break;
+ case PToken::Kind::AlphaNum:
+ if (index>=str.length() || !isIdChar(str[index])) return false;
+ index++;
+ break;
+ case PToken::Kind::WhiteSpace:
+ if (index>=str.length() || !isspace(str[index])) return false;
+ index++;
+ break;
+ case PToken::Kind::Digit:
+ if (index>=str.length() || !isdigit(str[index])) return false;
+ index++;
+ break;
+ case PToken::Kind::BeginOfLine:
+ if (index!=pos) return false;
+ break;
+ case PToken::Kind::EndOfLine:
+ if (index<str.length()) return false;
+ break;
+ case PToken::Kind::BeginOfWord:
+ DBG("BeginOfWord: index=%zu isIdChar(%c)=%d prev.isIdChar(%c)=%d\n",
+ index,str[index],isIdChar(str[index]),
+ index>0?str[index]-1:0,
+ index>0?isIdChar(str[index-1]):-1);
+ if (index>=str.length() ||
+ !isIdChar(str[index]) ||
+ (index>0 && isIdChar(str[index-1]))) return false;
+ break;
+ case PToken::Kind::EndOfWord:
+ DBG("EndOfWord: index=%zu pos=%zu idIdChar(%c)=%d prev.isIsChar(%c)=%d\n",
+ index,pos,str[index],isIdChar(str[index]),
+ index==0 ? 0 : str[index-1],
+ index==0 ? -1 : isIdChar(str[index-1]));
+ if (index<str.length() &&
+ (isIdChar(str[index]) || index==0 || !isIdChar(str[index-1]))) return false;
+ break;
+ case PToken::Kind::BeginCapture:
+ DBG("BeginCapture(%zu)\n",index);
+ match.startCapture(index);
+ break;
+ case PToken::Kind::EndCapture:
+ DBG("EndCapture(%zu)\n",index);
+ match.endCapture(index);
+ break;
+ case PToken::Kind::Any:
+ if (index>=str.length()) return false;
+ index++;
+ break;
+ case PToken::Kind::Star:
+ return processSequence(Star);
+ case PToken::Kind::Optional:
+ return processSequence(Optional);
+ default:
+ return false;
+ }
+ tokenPos++;
+ }
+ }
+ match.setMatch(pos,index-pos);
+ return true;
+}
+
+static std::string wildcard2regex(const std::string &pattern)
+{
+ std::string result="^"; // match start of input
+ char c;
+ const char *p = pattern.c_str();
+ while ((c=*p++))
+ {
+ switch(c)
+ {
+ case '*':
+ result+=".*";
+ break; // '*' => '.*'
+ case '?':
+ result+='.';
+ break; // '?' => '.'
+ case '.':
+ case '+':
+ case '\\':
+ case '$':
+ case '^':
+ case '(':
+ case ')':
+ result+='\\'; result+=c; // escape
+ break;
+ case '[':
+ if (*p=='^') // don't escape ^ after [
+ {
+ result+="[^";
+ p++;
+ }
+ else
+ {
+ result+=c;
+ }
+ break;
+ default: // just copy
+ result+=c;
+ break;
+ }
+ }
+ result+='$'; // match end of input
+ return result;
+}
+
+
+Ex::Ex(const std::string &pattern, Mode mode)
+ : p(std::make_unique<Private>(mode==Mode::RegEx ? pattern : wildcard2regex(pattern)))
+{
+ p->compile();
+#if ENABLE_DEBUG
+ p->dump();
+ assert(!p->error);
+#endif
+}
+
+Ex::~Ex()
+{
+}
+
+bool Ex::match(const std::string &str,Match &match,size_t pos) const
+{
+ bool found=false;
+ if (p->data.size()==0 || p->error) return found;
+ match.init(&str);
+
+ PToken tok = p->data[0];
+ if (tok.kind()==PToken::Kind::BeginOfLine) // only test match at the given position
+ {
+ found = p->matchAt(0,str,match,pos,0);
+ }
+ else
+ {
+ if (tok.kind()==PToken::Kind::Character) // search for the start character
+ {
+ size_t index = str.find(tok.asciiValue(),pos);
+ if (index==std::string::npos)
+ {
+ DBG("Ex::match(str='%s',pos=%zu)=false (no start char '%c')\n",str.c_str(),pos,tok.asciiValue());
+ return false;
+ }
+ DBG("pos=%zu str='%s' char='%c' index=%zu\n",index,str.c_str(),tok.asciiValue(),index);
+ pos=index;
+ }
+ while (pos<str.length()) // search for a match starting at pos
+ {
+ found = p->matchAt(0,str,match,pos,0);
+ if (found) break;
+ pos++;
+ }
+ }
+ DBG("Ex::match(str='%s',pos=%zu)=%d\n",str.c_str(),pos,found);
+ return found;
+}
+
+bool Ex::isValid() const
+{
+ return !p->pattern.empty() && !p->error;
+}
+
+//----------------------------------------------------------------------------------------
+
+bool search(const std::string &str,Match &match,const Ex &re,size_t pos)
+{
+ return re.match(str,match,pos);
+}
+
+bool search(const std::string &str,const Ex &re,size_t pos)
+{
+ Match match;
+ return re.match(str,match,pos);
+}
+
+bool match(const std::string &str,Match &match,const Ex &re)
+{
+ return re.match(str,match,0) && match.position()==0 && match.length()==str.length();
+}
+
+bool match(const std::string &str,const Ex &re)
+{
+ Match match;
+ return re.match(str,match,0) && match.position()==0 && match.length()==str.length();
+}
+
+std::string replace(const std::string &str,const Ex &re,const std::string &replacement)
+{
+ std::string result;
+ Match match;
+ size_t p=0;
+ while (re.match(str,match,p))
+ {
+ size_t i=match.position();
+ size_t l=match.length();
+ if (i>p) result+=str.substr(p,i-p);
+ result+=replacement;
+ p=i+l;
+ }
+ if (p<str.length()) result+=str.substr(p);
+ return result;
+}
+
+}
diff --git a/src/regex.h b/src/regex.h
new file mode 100644
index 0000000..bedc052
--- /dev/null
+++ b/src/regex.h
@@ -0,0 +1,336 @@
+/******************************************************************************
+ *
+ * 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 FREGEX_H
+#define FREGEX_H
+
+#include <memory>
+#include <string>
+#include <vector>
+#include <iterator>
+
+/** Namespace for the regular expression functions */
+namespace reg
+{
+
+class Match;
+
+/** Class representing a regular expression.
+ *
+ * It has a similar API as `std::regex`,
+ * but is much faster (and also somewhat more limited).
+ */
+class Ex
+{
+ public:
+ /** Matching algorithm */
+ enum class Mode
+ {
+ RegEx, /**< full regular expression. */
+ Wildcard /**< simple globbing pattern. */
+ };
+ /** Creates a regular expression object given the pattern as a string.
+ * Two modes of matching are supported: RegEx and Wildcard
+ *
+ * The following special characters are supported in Mode::RegEx mode.
+ * - `c` matches character `c`
+ * - `.` matches any character
+ * - `^` matches the start of the input
+ * - `$` matches the end of the input
+ * - `\<` matches the start of a word
+ * - `\>` matches the end of a word
+ * - `[]` matches a set of characters
+ * - `x*` matches a sequence of zero or more `x`'s
+ * - `x+` matches a sequence of one or more `x`'s
+ * - `x?` matches an optional `x`
+ * - `(` matches the start of a capture range
+ * - `)` matches the ends a capture range
+ * - `\c` to escape a special character, such as `+`, `[`, `*`, `(`, etc.
+ * - `\t` matches a tab character
+ * - `\n` matches a newline character
+ * - `\r` matches a return character
+ * - `\s` matches any whitespace as defined by `std::isspace()`
+ * - `\d` matches any digit as defined by `std::digit()`
+ * - `\a` matches any alphabetical characters, same as `[a-z_A-Z\x80-\xFF]`
+ * - `\w` matches any alpha numercial character, same as `[a-z_A-Z0-9\x80-\xFF]`
+ * - `\xHH` matches a hexadecimal character, e.g. `\xA0` matches character code 160.
+ *
+ * A character range can be used to match a character that falls inside a range
+ * (or set of ranges).
+ * Within the opening `[` and closing `]` brackets of a character ranges the following
+ * is supported:
+ * - `^` if at the start of the range, a character matches if it is \e not in the range,
+ * e.g. `[^\d]` matches any character not a digit
+ * - `-` when placed between 2 characters it defines a range from the first character to the second.
+ * any character that falls in the range will match, e.g. [0-9] matches the digit from 0 to 9.
+ * - `\s`, `\d`, `\a`, and `\w` as explained above.
+ *
+ * @note that special characters `.`, `*`, `?`, `$`, `+`, `[` do not have a special
+ * meaning in a character range. `^` only has a special meaning as the first character.
+ *
+ * @note that capture ranges cannot be nested, and `*`, `+`, and `?` do not work on
+ * capture ranges. e.g. `(abd)?` is not valid. If multiple capture ranges are
+ * specified then some character has to be in between them,
+ * e.g. this does not work `(.*)(a.*)`, but this does `(.*)a(.*)`.
+ *
+ * In Wildcard mode `*` is used to match any sequence of zero or more characters.
+ * The character `?` can be used to match an optional character. Character ranges are
+ * also supported, but other characters like `$` and `+` are just treated as
+ * literal characters.
+ *
+ */
+ Ex(const std::string &pattern, Mode mode=Mode::RegEx);
+
+ /** Destroys the regular expression object. Frees resources. */
+ ~Ex();
+
+ /** Check if a given string matches this regular expression.
+ * @param str The input string to match against.
+ * @param match The match object to hold the matching results.
+ * @param pos The position in the string at which to start the match.
+ * @returns true iff a match is found. Details are stored in the match object.
+ */
+ bool match(const std::string &str,Match &match,size_t pos=0) const;
+ bool isValid() const;
+ private:
+ Ex(const Ex &) = delete;
+ Ex &operator=(const Ex &e) = delete;
+
+ class Private;
+ std::unique_ptr<Private> p;
+};
+
+/** Object representing the match results of a capture range. */
+class SubMatch
+{
+ public:
+ /** Creates a match for a single capture range given a non-owning pointer to the string. */
+ SubMatch(const std::string *str) : m_str(str) {}
+
+ /** Returns the position in the string at which the match starts. */
+ size_t position() const { return m_pos; }
+
+ /** Returns the length of the matching part. */
+ size_t length() const { return m_len; }
+
+ /** Returns the matching part as a string */
+ std::string str() const { return m_str ? m_str->substr(m_pos,m_len) : std::string(); }
+
+ private:
+ friend class Match;
+ void setStart(size_t pos) { m_pos=pos; }
+ void setEnd(size_t pos) { m_len=pos-m_pos; }
+ void setMatch(size_t pos,size_t len) { m_pos=pos; m_len=len; }
+ size_t m_pos = std::string::npos;
+ size_t m_len = std::string::npos;
+ const std::string *m_str = nullptr;
+};
+
+/** Object representing the matching results. It consists of an array of
+ * SubMatch objects. The first entry of the array represents the whole match, any
+ * next elements represent each of the capture ranges.
+ *
+ * For example string `@42` and expression `@(\\d+)` will have two
+ * Submatches, match[0] will point to the input string as a whole, and
+ * match[1] will point to the number 42 only.
+ *
+ */
+class Match
+{
+ public:
+ /** Creates an empty match object */
+ Match() {}
+
+ /** Returns the position of the match or std::string::npos if no position is set. */
+ size_t position() const { return m_subMatches[0].position(); }
+
+ /** Returns the position of the match or std::string::npos if no length is set. */
+ size_t length() const { return m_subMatches[0].length(); }
+
+ /** Return a string representing the matching part. */
+ std::string str() const { return m_subMatches[0].str(); }
+
+ /** Return the part of the string after the match */
+ SubMatch suffix() const { SubMatch m(m_str); m.setMatch(0,position()); return m; }
+
+ /** Return the part of the string before the match */
+ SubMatch prefix() const
+ {
+ SubMatch m(m_str);
+ if (m_str)
+ {
+ size_t e = position()+length();
+ m.setMatch(e,m_str->length()-e);
+ }
+ return m;
+ }
+
+ /** Returns the number of sub matches available in this match. */
+ size_t size() const { return m_subMatches.size(); }
+
+ /** Returns the n-th SubMatch object. Note that there is always 1 SubMatch object
+ * representing the whole match.
+ */
+ const SubMatch &operator[](size_t index) const { return m_subMatches[index]; }
+
+ private:
+ friend class Ex;
+ void init(const std::string *str)
+ {
+ m_subMatches.clear();
+ m_subMatches.emplace_back(str);
+ m_str = str;
+ }
+ void startCapture(size_t index)
+ {
+ if (!m_insideCapture) // when backtracking we can re-entry the capture multiple times
+ // only update the index, example `\s*(x)`
+ {
+ m_captureIndex = m_subMatches.size();
+ m_subMatches.emplace_back(m_str);
+ m_insideCapture = true;
+ }
+ m_subMatches.back().setStart(index);
+ }
+ void endCapture(size_t index)
+ {
+ if (index>m_subMatches.back().position())
+ {
+ m_captureIndex=0;
+ m_subMatches.back().setEnd(index);
+ m_insideCapture = false;
+ }
+ }
+ void setMatch(size_t pos,size_t len)
+ {
+ m_subMatches[m_captureIndex].setMatch(pos,len);
+ }
+
+ std::vector<SubMatch> m_subMatches;
+ size_t m_captureIndex=0;
+ const std::string *m_str = nullptr;
+ bool m_insideCapture=false;
+};
+
+/** Iterator class to iterator through matches.
+ */
+class Iterator
+{
+ public:
+ using value_type = Match;
+ using difference_type = std::ptrdiff_t;
+ using pointer = value_type*;
+ using reference = value_type&;
+ using iterator_category = std::forward_iterator_tag;
+
+ /** Creates an end-of-sequence iterator */
+ Iterator() {}
+
+ /** Creates an iterator for input string \a str, using regular expression \a re to search.
+ * @note the string and regular expression objects should remain valid while iterating.
+ */
+ Iterator(const std::string &str, const Ex &re, size_t pos=0)
+ : m_str(&str), m_re(&re), m_pos(pos) { findNext(); }
+
+ // Iterator holds pointers, so prevent temporaries to be passed as string or
+ // regular expression
+ Iterator(std::string &&str, const Ex &re) = delete;
+ Iterator(const std::string &str, Ex &&re) = delete;
+ Iterator(std::string &&str, Ex &&re) = delete;
+
+ /** Returns true if the iterators point to the same match (or both are end-of-sequence iterators) */
+ bool operator==(const Iterator &rhs) const { return rhs.m_pos==m_pos; }
+
+ /** Returns true if the iterators are not pointing to the same match */
+ bool operator!=(const Iterator &rhs) const { return rhs.m_pos!=m_pos; }
+
+ /** Returns a reference to the current match */
+ const value_type &operator*() const { return m_match; }
+
+ /** Returns a pointer to the current match */
+ const value_type *operator->() const { return &m_match; }
+
+ /** Advances the iterator to the next match. */
+ Iterator &operator++() { findNext(); return *this; }
+
+ private:
+ void findNext()
+ {
+ if (!m_re || !m_str) { m_pos=std::string::npos; return; } // end marker
+ if (m_re->match(*m_str,m_match,m_pos))
+ {
+ m_pos=m_match.position()+m_match.length(); // update m_pos to point beyond last match
+ }
+ else // no more matches, make the iterator point to the 'end-of-sequence'
+ {
+ m_pos=std::string::npos;
+ }
+ }
+ const std::string *m_str = nullptr;
+ const Ex *m_re = nullptr;
+ size_t m_pos = std::string::npos;
+ Match m_match;
+};
+
+/** Search in a given string \a str starting at position \a pos for a match against regular expression \a re.
+ * Returns true iff a match was found.
+ * Details of what part of the string has matched is returned via the \a match object.
+ *
+ * An example to show how to match all identifiers in a string.
+ * @code
+ * static reg::Ex re(R"(\a\w*)");
+ * std::string = u8"void(Func是<B_C::Códe42>(42));";
+ * while (reg::search(str,match,re,pos))
+ * {
+ * std::cout << match.str() << std::endl;
+ * pos=match.position()+match.length();
+ * }
+ * @endcode
+ * produces:
+ * @code
+ * void
+ * Func是
+ * B_C
+ * Códe42
+ * @endcode
+ *
+ * @see Ex::Ex() for details on the regular expression patterns.
+ */
+bool search(const std::string &str,Match &match,const Ex &re,size_t pos=0);
+
+/** Search in a given string \a str starting at position \a pos for a match against regular expression \a re.
+ * Returns true iff a match was found.
+ */
+bool search(const std::string &str,const Ex &re,size_t pos=0);
+
+/** Matches a given string \a str for a match against regular expression \a re.
+ * Returns true iff a match was found for the whole string.
+ * Any capture groups are returned via the \a match object.
+ */
+bool match(const std::string &str,Match &match,const Ex &re);
+
+/** Matches a given string \a str for a match against regular expression \a re.
+ * Returns true iff a match was found for the whole string.
+ */
+bool match(const std::string &str,const Ex &re);
+
+/** Searching in a given input string \a for parts that match regular expression \a re and
+ * replaces those parts by string \a replacement.
+ */
+std::string replace(const std::string &str,const Ex &re,const std::string &replacement);
+
+} // namespace
+
+#endif
diff --git a/src/resourcemgr.cpp b/src/resourcemgr.cpp
index 36ce30d..161e480 100644
--- a/src/resourcemgr.cpp
+++ b/src/resourcemgr.cpp
@@ -14,15 +14,12 @@
*/
#include <map>
-#include <qfile.h>
-#include <qcstring.h>
-#include <qglobal.h>
#include <string.h>
+#include <fstream>
#include "resourcemgr.h"
#include "util.h"
#include "version.h"
-#include "ftextstream.h"
#include "message.h"
#include "config.h"
@@ -54,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;
}
}
@@ -73,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)
{
@@ -83,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;
}
@@ -98,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];
@@ -116,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];
@@ -128,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");
}
@@ -149,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;
}
@@ -163,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 2bd2c29..4e7cfda 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,42 +36,37 @@
#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)
static QCString align(DocHtmlCell *cell)
{
- HtmlAttribList attrs = cell->attribs();
- uint i;
- for (i=0; i<attrs.count(); ++i)
+ for (const auto &attr : cell->attribs())
{
- if (attrs.at(i)->name.lower()=="align")
+ if (attr.name.lower()=="align")
{
- if (attrs.at(i)->value.lower()=="center")
- return "\\qc ";
- else if (attrs.at(i)->value.lower()=="right")
- return "\\qr ";
+ if (attr.value.lower()=="center") return "\\qc ";
+ else if (attr.value.lower()=="right") return "\\qr ";
else return "";
}
}
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);
- StyleData *sd = rtf_Style[n];
- ASSERT(sd!=0);
- return sd->reference();
+ QCString n = name + QCString().setNum(m_indentLevel);
+ StyleData &sd = rtf_Style[n.str()];
+ return sd.reference();
}
void RTFDocVisitor::incIndentLevel()
@@ -198,7 +193,7 @@ void RTFDocVisitor::visit(DocURL *u)
filter(u->url());
m_t << "}"
"}"
- "}" << endl;
+ "}\n";
}
else
{
@@ -213,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;
}
@@ -221,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;
}
@@ -265,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;
}
@@ -274,7 +269,7 @@ void RTFDocVisitor::visit(DocStyleChange *s)
{
m_insidePre=FALSE;
m_t << "\\par";
- m_t << "}" << endl;
+ m_t << "}\n";
}
m_lastIsPara=TRUE;
break;
@@ -283,11 +278,9 @@ void RTFDocVisitor::visit(DocStyleChange *s)
}
}
-static void visitCaption(RTFDocVisitor *parent, QList<DocNode> children)
+static void visitCaption(RTFDocVisitor *parent, const DocNodeList &children)
{
- QListIterator<DocNode> cli(children);
- DocNode *n;
- for (cli.toFirst();(n=cli.current());++cli) n->accept(parent);
+ for (const auto &n : children) n->accept(parent);
}
void RTFDocVisitor::visit(DocVerbatim *s)
@@ -303,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();
@@ -335,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:
@@ -360,32 +357,32 @@ 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:
{
static QCString rtfOutput = Config_getString(RTF_OUTPUT);
- QCString baseName = PlantumlManager::instance()->writePlantUMLSource(rtfOutput,s->exampleFile(),s->text(),PlantumlManager::PUML_BITMAP);
+ QCString baseName = PlantumlManager::instance().writePlantUMLSource(rtfOutput,s->exampleFile(),s->text(),PlantumlManager::PUML_BITMAP);
writePlantUMLFile(baseName, s->hasCaption());
visitCaption(this, s->children());
@@ -413,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;
}
@@ -427,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,
@@ -446,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(),
@@ -464,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:
@@ -478,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(),
@@ -500,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(),
@@ -534,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;
@@ -543,23 +540,23 @@ 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");
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide = TRUE;
}
if (op->type()!=DocIncOperator::Skip)
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide)
{
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,
@@ -573,22 +570,22 @@ void RTFDocVisitor::visit(DocIncOperator *op)
);
if (fd) delete fd;
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
if (op->isLast())
{
- popEnabled();
+ m_hide = popHidden();
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;
}
}
@@ -618,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;
}
@@ -658,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;
@@ -669,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;
@@ -716,7 +713,7 @@ void RTFDocVisitor::visitPost(DocPara *p)
)
)
{
- m_t << "\\par" << endl;
+ m_t << "\\par\n";
m_lastIsPara=TRUE;
}
}
@@ -726,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();
@@ -743,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:
@@ -800,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
@@ -816,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");
@@ -827,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;
}
@@ -836,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;
}
@@ -845,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();
}
@@ -860,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]->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;
}
@@ -883,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;
}
@@ -891,9 +888,23 @@ 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;
+ rtf_listItemInfo[m_indentLevel].type = '1';
+ for (const auto &opt : l->attribs())
+ {
+ if (opt.name=="type")
+ {
+ rtf_listItemInfo[m_indentLevel].type = opt.value[0];
+ }
+ if (opt.name=="start")
+ {
+ bool ok;
+ int val = opt.value.toInt(&ok);
+ if (ok) rtf_listItemInfo[m_indentLevel].number = val;
+ }
+ }
m_lastIsPara=FALSE;
}
@@ -901,7 +912,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;
}
@@ -909,17 +920,38 @@ 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 << rtf_listItemInfo[m_indentLevel].number << ".\\tab ";
+ m_t << getStyle("ListEnum") << "\n";
+ switch (rtf_listItemInfo[m_indentLevel].type)
+ {
+ case '1':
+ m_t << rtf_listItemInfo[m_indentLevel].number;
+ break;
+ case 'a':
+ m_t << integerToAlpha(rtf_listItemInfo[m_indentLevel].number,false);
+ break;
+ case 'A':
+ m_t << integerToAlpha(rtf_listItemInfo[m_indentLevel].number);
+ break;
+ case 'i':
+ m_t << integerToRoman(rtf_listItemInfo[m_indentLevel].number,false);
+ break;
+ case 'I':
+ m_t << integerToRoman(rtf_listItemInfo[m_indentLevel].number);
+ break;
+ default:
+ m_t << rtf_listItemInfo[m_indentLevel].number;
+ break;
+ }
+ m_t << ".\\tab ";
rtf_listItemInfo[m_indentLevel].number++;
}
else
{
- m_t << getStyle("ListBullet") << endl;
+ m_t << getStyle("ListBullet") << "\n";
}
incIndentLevel();
m_lastIsPara=FALSE;
@@ -935,7 +967,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;
}
@@ -944,8 +976,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;
}
@@ -953,9 +985,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;
}
@@ -963,8 +995,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;
}
@@ -981,7 +1013,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;
}
@@ -990,7 +1022,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;
}
@@ -998,8 +1030,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;
}
@@ -1013,21 +1045,21 @@ 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)
{
if (m_hide) return;
DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocHtmlRow)}\n");
- uint i,columnWidth=r->numCells()>0 ? rtf_pageWidth/r->numCells() : 10;
+ uint i,columnWidth=(uint)r->numCells()>0 ? rtf_pageWidth/(uint)r->numCells() : 10;
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 (i=0;i<r->numCells();i++)
{
if (r->isHeading())
@@ -1039,9 +1071,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;
}
@@ -1049,9 +1081,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;
}
@@ -1079,7 +1111,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;
@@ -1157,10 +1189,10 @@ 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]->reference();
+ m_t << rtf_Style[heading.str()].reference();
// make open table of contents entry that will be closed in visitPost method
m_t << "{\\tc\\tcl" << level << " ";
m_lastIsPara=FALSE;
@@ -1172,7 +1204,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;
}
@@ -1181,24 +1213,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";
@@ -1213,7 +1245,7 @@ void RTFDocVisitor::includePicturePreRTF(const QCString name, bool isTypeRTF, bo
}
else // other format -> skip
{
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
}
@@ -1237,18 +1269,18 @@ 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";
}
}
}
else
{
- popEnabled();
+ m_hide = popHidden();
}
}
@@ -1309,7 +1341,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
{
@@ -1341,10 +1373,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;
}
@@ -1354,39 +1386,18 @@ void RTFDocVisitor::visitPost(DocSecRefList *)
DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocSecRefList)}\n");
decIndentLevel();
m_t << "\\par";
- m_t << "}" << endl;
+ m_t << "}\n";
m_lastIsPara=TRUE;
}
-//void RTFDocVisitor::visitPre(DocLanguage *l)
-//{
-// DBG_RTF("{\\comment RTFDocVisitor::visitPre(DocLanguage)}\n");
-// QCString langId = Config_getEnum(OUTPUT_LANGUAGE);
-// if (l->id().lower()!=langId.lower())
-// {
-// pushEnabled();
-// m_hide = TRUE;
-// }
-//}
-//
-//void RTFDocVisitor::visitPost(DocLanguage *l)
-//{
-// DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocLanguage)}\n");
-// QCString langId = Config_getEnum(OUTPUT_LANGUAGE);
-// if (l->id().lower()!=langId.lower())
-// {
-// popEnabled();
-// }
-//}
-
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:
@@ -1401,7 +1412,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 ||
@@ -1418,7 +1429,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 ||
@@ -1427,7 +1438,7 @@ void RTFDocVisitor::visitPost(DocParamSect *s)
{
decIndentLevel();
}
- m_t << "}" << endl;
+ m_t << "}\n";
}
void RTFDocVisitor::visitPre(DocParamList *pl)
@@ -1464,7 +1475,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 "
@@ -1472,9 +1483,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())
@@ -1513,21 +1524,19 @@ void RTFDocVisitor::visitPre(DocParamList *pl)
{
m_t << "{";
}
- QListIterator<DocNode> li(pl->paramTypes());
- DocNode *type;
- for (li.toFirst();(type=li.current());++li)
+ for (const auto &type : pl->paramTypes())
{
if (type->kind()==DocNode::Kind_Word)
{
- visit((DocWord*)type);
+ visit((DocWord*)type.get());
}
else if (type->kind()==DocNode::Kind_LinkedWord)
{
- visit((DocLinkedWord*)type);
+ visit((DocLinkedWord*)type.get());
}
else if (type->kind()==DocNode::Kind_Sep)
{
- m_t << " " << ((DocSeparator *)type)->chars() << " ";
+ m_t << " " << ((DocSeparator *)type.get())->chars() << " ";
}
}
if (useTable)
@@ -1543,21 +1552,17 @@ void RTFDocVisitor::visitPre(DocParamList *pl)
}
m_t << "{\\i ";
- //QStrListIterator li(pl->parameters());
- //const char *s;
- QListIterator<DocNode> li(pl->parameters());
- DocNode *param;
bool first=TRUE;
- for (li.toFirst();(param=li.current());++li)
+ for (const auto &param : pl->parameters())
{
if (!first) m_t << ","; else first=FALSE;
if (param->kind()==DocNode::Kind_Word)
{
- visit((DocWord*)param);
+ visit((DocWord*)param.get());
}
else if (param->kind()==DocNode::Kind_LinkedWord)
{
- visit((DocLinkedWord*)param);
+ visit((DocLinkedWord*)param.get());
}
}
m_t << "} ";
@@ -1587,13 +1592,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;
@@ -1607,12 +1612,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;
@@ -1658,9 +1663,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;
}
@@ -1695,7 +1700,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");
@@ -1705,7 +1710,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;
@@ -1739,11 +1744,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)
@@ -1771,7 +1776,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
{
@@ -1794,11 +1799,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;
}
@@ -1828,19 +1833,6 @@ void RTFDocVisitor::endLink(const QCString &ref)
m_lastIsPara=FALSE;
}
-void RTFDocVisitor::pushEnabled()
-{
- m_enabled.push(new bool(m_hide));
-}
-
-void RTFDocVisitor::popEnabled()
-{
- bool *v=m_enabled.pop();
- ASSERT(v!=0);
- m_hide = *v;
- delete v;
-}
-
void RTFDocVisitor::writeDotFile(DocDotFile *df)
{
writeDotFile(df->file(), df->hasCaption());
@@ -1898,6 +1890,6 @@ void RTFDocVisitor::writePlantUMLFile(const QCString &fileName, bool hasCaption)
baseName=baseName.right(baseName.length()-i-1);
}
QCString outDir = Config_getString(RTF_OUTPUT);
- PlantumlManager::instance()->generatePlantUMLOutput(fileName,outDir,PlantumlManager::PUML_BITMAP);
+ PlantumlManager::instance().generatePlantUMLOutput(fileName,outDir,PlantumlManager::PUML_BITMAP);
includePicturePreRTF(baseName + ".png", true, hasCaption);
}
diff --git a/src/rtfdocvisitor.h b/src/rtfdocvisitor.h
index 82e4453..01be1aa 100644
--- a/src/rtfdocvisitor.h
+++ b/src/rtfdocvisitor.h
@@ -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.
*
@@ -19,23 +19,24 @@
#ifndef _RTFDOCVISITOR_H
#define _RTFDOCVISITOR_H
+#include <iostream>
+
#include "docvisitor.h"
-#include <qstack.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
//--------------------------------------
-
+
void visit(DocWord *);
void visit(DocLinkedWord *);
void visit(DocWhiteSpace *);
@@ -57,7 +58,7 @@ class RTFDocVisitor : public DocVisitor
//--------------------------------------
// visitor functions for compound nodes
//--------------------------------------
-
+
void visitPre(DocAutoList *);
void visitPost(DocAutoList *);
void visitPre(DocAutoListItem *);
@@ -138,20 +139,18 @@ class RTFDocVisitor : public DocVisitor
private:
//--------------------------------------
- // helper functions
+ // 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 pushEnabled();
- void popEnabled();
- 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 *);
@@ -164,12 +163,11 @@ class RTFDocVisitor : public DocVisitor
// state variables
//--------------------------------------
- FTextStream &m_t;
+ TextStream &m_t;
CodeOutputInterface &m_ci;
bool m_insidePre;
bool m_hide;
int m_indentLevel;
- QStack<bool> m_enabled;
bool m_lastIsPara;
QCString m_langExt;
};
diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp
index 94b6893..0fac0b4 100644
--- a/src/rtfgen.cpp
+++ b/src/rtfgen.cpp
@@ -17,12 +17,10 @@
*
*/
+#include <chrono>
+#include <ctime>
#include <stdlib.h>
-#include <qdir.h>
-#include <qregexp.h>
-#include <qtextstream.h>
-
#include "rtfgen.h"
#include "config.h"
#include "message.h"
@@ -47,17 +45,23 @@
#include "classlist.h"
#include "filename.h"
#include "namespacedef.h"
+#include "dir.h"
+#include "utf8.h"
+
//#define DBG_RTF(x) x;
#define DBG_RTF(x)
static QCString dateToRTFDateString()
{
- const QDateTime &d = QDateTime::currentDateTime();
+ auto now = std::chrono::system_clock::now();
+ auto time = std::chrono::system_clock::to_time_t(now);
+ auto tm = *localtime(&time);
+
QCString result;
result.sprintf("\\yr%d\\mo%d\\dy%d\\hr%d\\min%d\\sec%d",
- d.date().year(), d.date().month(), d.date().day(),
- d.time().hour(),d.time().minute(),d.time().second());
+ tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
+ tm.tm_hour, tm.tm_min, tm.tm_sec);
return result;
}
@@ -94,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";
@@ -107,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";
@@ -167,16 +169,15 @@ 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));
}
- rtf_Style.setAutoDelete(TRUE);
// first duplicate strings of rtf_Style_Default
const struct Rtf_Style_Default* def = rtf_Style_Default;
- while(def->reference != 0)
+ while (def->reference)
{
if (def->definition == 0)
{
@@ -184,8 +185,7 @@ void RTFGenerator::init()
}
else
{
- StyleData* styleData = new StyleData(def->reference, def->definition);
- rtf_Style.insert(def->name, styleData);
+ rtf_Style.insert(std::make_pair(def->name, StyleData(def->reference, def->definition)));
}
def++;
}
@@ -207,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');
@@ -219,160 +219,156 @@ 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
- QDictIterator<StyleData> iter(rtf_Style);
- const StyleData* style = 0;
unsigned maxIndex = 0;
- for(; (style = iter.current()); ++iter)
+ for (const auto &kv : rtf_Style)
{
- uint index = style->index();
- if (maxIndex < index) maxIndex = index;
+ uint index = kv.second.index();
+ if (index > maxIndex) maxIndex = index;
}
std::vector<const StyleData*> array(maxIndex + 1, 0);
ASSERT(maxIndex < array.size());
- iter.toFirst();
- for(; (style = iter.current()); ++iter)
+ for (const auto &kv : rtf_Style)
{
- uint index = style->index();
- if (array.at(index) != 0)
+ uint index = kv.second.index();
+ if (array[index] != 0)
{
- QCString key(iter.currentKey());
- msg("Style '%s' redefines \\s%d.\n", key.data(), index);
+ msg("Style '%s' redefines \\s%d.\n", kv.first.c_str(), index);
}
- array.at(index) = style;
+ array[index] = &kv.second;
}
// write array elements
size_t size = array.size();
for(size_t i = 0; i < size; i++)
{
- style = array.at(i);
- if (style != 0)
+ const StyleData *pStyle = array[i];
+ if (pStyle)
{
- t <<"{" << style->reference() << style->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;
@@ -387,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("");
@@ -396,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)
@@ -417,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
@@ -451,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:
@@ -507,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
@@ -563,7 +576,7 @@ void RTFGenerator::startIndexSection(IndexSections is)
break;
case isPageDocumentation2:
{
- t << "{\\tc \\v ";
+ m_t << "{\\tc \\v ";
}
break;
case isEndIndex:
@@ -581,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";
}
}
}
@@ -759,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";
}
}
}
@@ -784,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";
}
}
}
@@ -802,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)
{
@@ -816,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";
}
}
}
@@ -833,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";
}
}
}
@@ -861,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;
// }
//}
@@ -899,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";
}
@@ -939,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();
}
@@ -977,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;
}
@@ -987,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;
}
@@ -996,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;
@@ -1007,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;
//}
@@ -1016,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
{
@@ -1091,7 +1134,7 @@ void RTFGenerator::endHtmlLink()
{
if (Config_getBool(RTF_HYPERLINKS))
{
- t << "}}}" << endl;
+ m_t << "}}}\n";
}
else
{
@@ -1099,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();
@@ -1186,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 ";
}
}
@@ -1315,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
{
@@ -1354,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
{
@@ -1407,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)
//{
@@ -1436,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
@@ -1452,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;
- //printf("RTFGenerator::startMemberDoc() '%s'\n",rtf_Style["Heading4"]->reference());
+ 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());
+ //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)
{
@@ -1681,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]->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)
// {
@@ -1710,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);
//}
@@ -1740,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)
@@ -1755,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;
@@ -1785,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;
@@ -1805,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;
}
}
}
@@ -1830,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)
@@ -1954,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;
@@ -1965,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)
@@ -1978,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()
@@ -2022,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"
@@ -2067,65 +2110,65 @@ 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]->reference();
+ 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]->reference();
+ 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]->reference();
+ 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]->reference();
+ 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]->reference();
+ 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]->reference();
+ return rtf_Style[n.str()].reference();
}
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;
}
@@ -2133,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;
// }
//}
//
@@ -2192,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;
// }
//}
//
@@ -2212,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;
// }
//}
//
@@ -2230,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;
// }
//}
//
@@ -2248,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;
// }
//}
//
@@ -2262,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;
// }
//}
//
@@ -2272,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;
// }
//}
//
@@ -2311,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();
+ const char *inputPtr = s.data();
+ char *outputPtr = &enc[0];
if (!portable_iconv(cd, &inputPtr, &iLeft, &outputPtr, &oLeft))
{
enc.resize(enc.size()-(unsigned int)oLeft);
@@ -2340,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;
@@ -2376,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;
@@ -2392,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)
@@ -2460,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()
@@ -2506,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
@@ -2589,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;
@@ -2768,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
@@ -2821,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)
{
@@ -2940,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);
@@ -3001,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;
}
@@ -3036,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);
@@ -3061,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 98581bb..07bc3dd 100644
--- a/src/rtfstyle.cpp
+++ b/src/rtfstyle.cpp
@@ -1,9 +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
@@ -16,14 +13,12 @@
*
*/
-#include "rtfstyle.h"
-
-#include <qfile.h>
-#include <qtextstream.h>
-#include <stdlib.h>
+#include <string>
+#include <fstream>
+#include "rtfstyle.h"
#include "message.h"
-
+#include "regex.h"
RTFListItemInfo rtf_listItemInfo[rtf_maxIndentLevels];
@@ -38,6 +33,21 @@ QCString rtf_documentType;
QCString rtf_documentId;
QCString rtf_keywords;
+static std::map<std::string,QCString &> g_styleMap =
+{
+ { "Title", rtf_title },
+ { "Subject", rtf_subject },
+ { "Comments", rtf_comments },
+ { "Company", rtf_company },
+ { "LogoFilename", rtf_logoFilename },
+ { "Author", rtf_author },
+ { "Manager", rtf_manager },
+ { "DocumentType", rtf_documentType },
+ { "DocumentId", rtf_documentId },
+ { "Keywords", rtf_keywords }
+};
+
+
char rtf_Style_Reset[] = "\\pard\\plain ";
#define RTF_LatexToc(lvl,nest,nxt,pos,twps) \
@@ -224,171 +234,121 @@ Rtf_Style_Default rtf_Style_Default[] =
}
};
-static const QRegExp s_clause("\\\\s[0-9]+\\s*");
+static const reg::Ex s_clause(R"(\\s(\d+)\s*)"); // match, e.g. '\s30' and capture '30'
-StyleData::StyleData(const char* reference, const char* definition)
+StyleData::StyleData(const std::string &reference, const std::string &definition)
{
- const char *ref = reference;
-
- int start = s_clause.match(ref); ASSERT(start >= 0);
- ref += start;
- m_index = (int)atol(ref + 2); ASSERT(m_index > 0);
-
- m_reference = ref;
+ reg::Match match;
+ if (reg::search(reference,match,s_clause))
+ {
+ m_index = static_cast<int>(std::stoul(match[1].str()));
+ }
+ else // error
+ {
+ m_index = 0;
+ }
+ m_reference = reference;
m_definition = definition;
}
-StyleData::~StyleData()
-{
-}
-
-bool StyleData::setStyle(const char* s, const char* styleName)
+bool StyleData::setStyle(const std::string &command, const std::string &styleName)
{
- static const QRegExp subgroup("^{[^}]*}\\s*");
- static const QRegExp any_clause("^\\\\[a-z][a-z0-9-]*\\s*");
-
- int len = 0; // length of a particular RTF formatting control
- int ref_len = 0; // length of the whole formatting section of a style
- int start = s_clause.match(s, 0, &len);
- if (start < 0)
+ reg::Match match;
+ if (!reg::search(command,match,s_clause))
{
- err("Style sheet '%s' contains no '\\s' clause.\n{%s}\n", styleName, s);
- return FALSE;
- }
- s += start;
- m_index = (int)atol(s + 2); ASSERT(m_index > 0);
-
- // search for the end of pure formatting codes
- const char* end = s + len;
- ref_len = len;
- bool haveNewDefinition = TRUE;
- for(;;)
- {
- if (*end == '{')
- {
- // subgroups are used for \\additive
- if (0 != subgroup.match(end, 0, &len))
- break;
- else
- {
- end += len;
- ref_len += len;
- }
- }
- else if (*end == '\\')
- {
- if (0 == qstrncmp(end, "\\snext", 6))
- break;
- if (0 == qstrncmp(end, "\\sbasedon", 9))
- break;
- if (0 != any_clause.match(end, 0, &len))
- break;
- end += len;
- ref_len += len;
- }
- else if (*end == 0)
- { // no style-definition part, keep default value
- haveNewDefinition = FALSE;
- break;
- }
- else // plain name without leading \\snext
- break;
+ err("Style sheet '%s' contains no '\\s' clause.\n{%s}", styleName.c_str(), command.c_str());
+ return false;
}
- m_reference = s;
- if (haveNewDefinition)
+ m_index = static_cast<int>(std::stoul(match[1].str()));
+
+ size_t index = command.find("\\sbasedon");
+ if (index!=std::string::npos)
{
- m_definition = end;
+ m_reference = command.substr(0,index);
+ m_definition = command.substr(index);
}
- return TRUE;
+
+ return true;
}
-void loadStylesheet(const char *name, QDict<StyleData>& dict)
+
+void loadStylesheet(const QCString &name, StyleDataMap& map)
{
- QFile file(name);
- if (!file.open(IO_ReadOnly))
+ std::ifstream file(name.str());
+ if (!file.is_open())
{
- err("Can't open RTF style sheet file %s. Using defaults.\n",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));
- static const QRegExp separator("[ \t]*=[ \t]*");
uint lineNr=1;
- QTextStream t(&file);
- t.setEncoding(QTextStream::UnicodeUTF8);
- while (!t.eof())
+ for (std::string line ; getline(file,line) ; ) // for each line
{
- QCString s(4096); // string buffer of max line length
- s = t.readLine().stripWhiteSpace().utf8();
- if (s.isEmpty() || s.at(0)=='#') continue; // skip blanks & comments
- int sepLength;
- int sepStart = separator.match(s,0,&sepLength);
- if (sepStart<=0) // no valid assignment statement
- {
- warn(name,lineNr,"Assignment of style sheet name expected!\n");
- continue;
- }
- QCString key=s.left(sepStart);
- if (dict[key]==0) // not a valid style sheet name
+ if (line.empty() || line[0]=='#') continue; // skip blanks & comments
+ static const reg::Ex assignment_splitter(R"(\s*=\s*)");
+ reg::Match match;
+ if (reg::search(line,match,assignment_splitter))
{
- warn(name,lineNr,"Invalid style sheet name %s ignored.\n",key.data());
- continue;
+ std::string key = match.prefix().str();
+ std::string value = match.suffix().str();
+ auto it = map.find(key);
+ if (it!=map.end())
+ {
+ StyleData& styleData = it->second;
+ styleData.setStyle(value,key);
+ }
+ else
+ {
+ warn(name,lineNr,"Unknown style sheet name %s ignored.",key.data());
+ }
}
- StyleData* styleData = dict.find(key);
- if (styleData == 0)
+ else
{
- warn(name,lineNr,"Unknown style sheet name %s ignored.\n",key.data());
- continue;
+ warn(name,lineNr,"Assignment of style sheet name expected line='%s'!",line.c_str());
}
- s+=" "; // add command separator
- styleData->setStyle(s.data() + sepStart + sepLength, key.data());
lineNr++;
}
}
-QDict<StyleData> rtf_Style(257);
+StyleDataMap rtf_Style;
-void loadExtensions(const char *name)
+void loadExtensions(const QCString &name)
{
- QFile file(name);
- if (!file.open(IO_ReadOnly))
+ std::ifstream file(name.str());
+ if (!file.is_open())
{
- err("Can't open RTF extensions file %s. Using defaults.\n",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));
- static const QRegExp separator("[ \t]*=[ \t]*");
uint lineNr=1;
- QTextStream t(&file);
- t.setEncoding(QTextStream::UnicodeUTF8);
- while (!t.eof())
+ for (std::string line ; getline(file,line) ; ) // for each line
{
- QCString s(4096); // string buffer of max line length
- s = t.readLine().stripWhiteSpace().utf8();
- if (s.length()==0 || s.at(0)=='#') continue; // skip blanks & comments
- int sepLength;
- int sepStart = separator.match(s,0,&sepLength);
- if (sepStart<=0) // no valid assignment statement
+ if (line.empty() || line[0]=='#') continue; // skip blanks & comments
+ static const reg::Ex assignment_splitter(R"(\s*=\s*)");
+ reg::Match match;
+ if (reg::search(line,match,assignment_splitter))
+ {
+ std::string key = match.prefix().str();
+ std::string value = match.suffix().str();
+ auto it = g_styleMap.find(key);
+ if (it!=g_styleMap.end())
+ {
+ it->second = value;
+ }
+ else
+ {
+ warn(name,lineNr,"Ignoring unknown extension key '%s'...",key.c_str());
+ }
+ }
+ else
{
- warn(name,lineNr,"Assignment of extension field expected!\n");
- continue;
+ warn(name,lineNr,"Assignment of style sheet name expected!");
}
- QCString key=s.left(sepStart);
- QCString data=s.data() + sepStart + sepLength;
-
- if (key == "Title") rtf_title = data.data();
- if (key == "Subject") rtf_subject = data.data();
- if (key == "Comments") rtf_comments = data.data();
- if (key == "Company") rtf_company = data.data();
- if (key == "LogoFilename") rtf_logoFilename = data.data();
- if (key == "Author") rtf_author = data.data();
- if (key == "Manager") rtf_manager = data.data();
- if (key == "DocumentType") rtf_documentType = data.data();
- if (key == "DocumentId") rtf_documentId = data.data();
- if (key == "Keywords") rtf_keywords = data.data();
lineNr++;
}
}
diff --git a/src/rtfstyle.h b/src/rtfstyle.h
index d45972c..a946b37 100644
--- a/src/rtfstyle.h
+++ b/src/rtfstyle.h
@@ -16,8 +16,10 @@
#ifndef RTFSTYLE_H
#define RTFSTYLE_H
-#include <qregexp.h>
-#include <qdict.h>
+#include <map>
+#include <string>
+
+#include "qcstring.h"
// used for table column width calculation
const int rtf_pageWidth = 8748;
@@ -37,6 +39,7 @@ struct RTFListItemInfo
{
bool isEnum;
int number;
+ char type;
};
const int rtf_maxIndentLevels = 13;
@@ -61,22 +64,24 @@ struct StyleData
// to use a tag in the body of the document only reference is required
public:
- StyleData(const char* reference, const char* definition);
- ~StyleData();
- bool setStyle(const char* s, const char* styleName);
+ StyleData() = default;
+ StyleData(const std::string &reference, const std::string &definition);
+ bool setStyle(const std::string &command, const std::string &styleName);
const char *reference() const { return m_reference.c_str(); }
const char *definition() const { return m_definition.c_str(); }
uint index() const { return m_index; }
private:
- uint m_index; // index in style-sheet, i.e. number in s-clause
+ uint m_index = 0; // index in style-sheet, i.e. number in s-clause
std::string m_reference; // everything required to apply the style
std::string m_definition; // additional tags like \snext and style name
};
-extern QDict<StyleData> rtf_Style;
+using StyleDataMap = std::map<std::string,StyleData>;
+
+extern StyleDataMap rtf_Style;
-void loadExtensions(const char *name);
-void loadStylesheet(const char *name, QDict<StyleData>& dict);
+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 6441165..3281a1e 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -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
@@ -31,16 +29,13 @@
#include <algorithm>
#include <vector>
#include <utility>
+#include <atomic>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <ctype.h>
-#include <qarray.h>
-#include <qregexp.h>
-#include <qfile.h>
-
#include "scanner.h"
#include "entry.h"
#include "message.h"
@@ -54,6 +49,7 @@
#include "clangparser.h"
#include "markdown.h"
+#include "regex.h"
#define YY_NO_INPUT 1
#define YY_NO_UNISTD_H 1
@@ -78,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;
@@ -143,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;
@@ -150,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;
@@ -174,7 +173,7 @@ struct scannerYY_state
QCString briefBackup;
int docBlockContext = 0;
- QGString docBlock;
+ TextStream docBlock;
QCString docBlockName;
bool docBlockInBody = false;
bool docBlockAutoBrief = false;
@@ -194,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;
};
@@ -235,8 +235,10 @@ static yy_size_t yyread(yyscan_t yyscanner,char *buf,yy_size_t max_size);
/* start command character */
CMD ("\\"|"@")
BN [ \t\n\r]
+BNopt {BN}*
BL [ \t\r]*"\n"
B [ \t]
+Bopt {B}*
ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
SCOPENAME "$"?(({ID}?{BN}*"::"{BN}*)*)(((~|!){BN}*)?{ID})
TSCOPE {ID}("<"[a-z_A-Z0-9 \t\*\&,:]*">")?
@@ -256,6 +258,22 @@ LOGICOP "=="|"!="|">"|"<"|">="|"<="|"&&"|"||"|"!"|"<=>"
BITOP "&"|"|"|"^"|"<<"|">>"|"~"
OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
+ /* no comment start / end signs inside square brackets */
+NCOMM [^/\*]
+ // C start comment
+CCS "/\*"
+ // C end comment
+CCE "*\/"
+ // Cpp comment
+CPPC "/\/"
+ // doxygen start comment
+DCOMM ("/\*!"|"/\**"|"/\/!"|"/\/\/")
+
+ // Optional any character
+ANYopt .*
+ // Optional all but newline
+NONLopt [^\n]*
+
%option noyywrap
/* language parsing states */
@@ -368,6 +386,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
%x CopyGString
%x CopyPHPGString
%x CopyRound
+%x CopySharp
%x CopyCurly
%x GCopyRound
%x GCopySquare
@@ -423,6 +442,12 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
%x DocBlock
%x DocCopyBlock
+ /** C++20 concepts */
+
+%x RequiresClause
+%x RequiresExpression
+%x ConceptName
+
%%
<NextSemi>"{" {
@@ -671,7 +696,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
<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>";" {
@@ -857,14 +882,14 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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())
{
@@ -1125,7 +1150,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
*/
<FindMembers>{B}*"typename"{BN}+ { lineCount(yyscanner); }
-<FindMembers>{B}*"namespace"{BN}*/[^a-z_A-Z0-9] {
+<FindMembers>{B}*"namespace"{BNopt}/[^a-z_A-Z0-9] {
yyextra->isTypedef=FALSE;
yyextra->current->section = Entry::NAMESPACE_SEC;
yyextra->current->type = "namespace" ;
@@ -1599,12 +1624,25 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
if (yytext[yyleng-1]=='{') unput('{');
BEGIN( CompoundName ) ;
}
-<Operator>"("{BN}*")"({BN}*"<"[^>]*">"){BN}*/"(" { // A::operator()<int>(int arg)
+<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 += "()";
BEGIN( FindMembers );
}
-<Operator>"("{BN}*")"{BN}*/"(" {
+<Operator>"("{BN}*")"{BNopt}/"(" {
lineCount(yyscanner);
yyextra->current->name += yytext ;
yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
@@ -1645,10 +1683,10 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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 );
@@ -1661,7 +1699,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<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;
@@ -1678,12 +1716,12 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<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);
}
@@ -1718,7 +1756,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
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;
@@ -1771,14 +1809,14 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
yyextra->previous->spec |= Entry::Alias;
BEGIN(FindMembers);
}
-<UsingAlias>";"{BN}*("/**"|"//!"|"/*!"|"///")"<" {
+<UsingAlias>";"{BN}*{DCOMM}"<" {
yyextra->docBlockContext = UsingAliasEnd;
yyextra->docBlockInBody = FALSE;
yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
( 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 = ';';
@@ -1824,7 +1862,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
addType(yyscanner);
yyextra->current->name=n.left(n.length()-2);
}
-<FindMembers>{SCOPENAME}{BN}*/"<" { // Note: this could be a return type!
+<FindMembers>{SCOPENAME}{BNopt}/"<" { // Note: this could be a return type!
yyextra->roundCount=0;
yyextra->sharpCount=0;
lineCount(yyscanner);
@@ -1838,7 +1876,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
else
BEGIN( EndTemplate );
}
-<FindMemberName>{SCOPENAME}{BN}*/"<" {
+<FindMemberName>{SCOPENAME}{BNopt}/"<" {
yyextra->sharpCount=0;
yyextra->roundCount=0;
lineCount(yyscanner);
@@ -1891,7 +1929,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
// *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);
}
}
@@ -1899,19 +1937,25 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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>">"{BN}*/"("({BN}*{ID}{BN}*"::")*({BN}*"*"{BN}*)+ { // function pointer returning a template instance
+<EndTemplate>">"{BNopt}/"("({BN}*{ID}{BN}*"::")*({BN}*"*"{BN}*)+ { // function pointer returning a template instance
lineCount(yyscanner);
yyextra->current->name+='>';
if (yyextra->roundCount==0)
@@ -1919,7 +1963,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
BEGIN(FindMembers);
}
}
-<EndTemplate>">"{BN}*/"::" {
+<EndTemplate>">"{BNopt}/"::" {
lineCount(yyscanner);
yyextra->current->name+='>';
// *yyextra->currentTemplateSpec+='>';
@@ -1950,12 +1994,12 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
<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
@@ -1974,7 +2018,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
<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);
@@ -1982,13 +2026,13 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
<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
}
@@ -2046,10 +2090,81 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
<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);
@@ -2306,7 +2421,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
YY_START==ReadNSBody ||
YY_START==ReadBodyIntf)
{
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
BEGIN( PreLineCtrl );
}
@@ -2316,7 +2431,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
yyextra->lastPreLineCtrlContext==ReadNSBody ||
yyextra->lastPreLineCtrlContext==ReadBodyIntf)
{
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
}
<PreLineCtrl>. {
@@ -2324,7 +2439,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
yyextra->lastPreLineCtrlContext==ReadNSBody ||
yyextra->lastPreLineCtrlContext==ReadBodyIntf)
{
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
}
<PreLineCtrl>\n {
@@ -2332,7 +2447,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
yyextra->lastPreLineCtrlContext==ReadNSBody ||
yyextra->lastPreLineCtrlContext==ReadBodyIntf)
{
- yyextra->current->program+=yytext;
+ yyextra->current->program << yytext;
}
lineCount(yyscanner);
BEGIN( yyextra->lastPreLineCtrlContext );
@@ -2349,7 +2464,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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 ) ;
}
@@ -2375,7 +2490,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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;
@@ -2395,10 +2510,10 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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);
@@ -2449,7 +2564,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
yyextra->current->name += yytext ;
addType(yyscanner);
}
-<FindMembers,MemberSpec,Function,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs,DefinePHPEnd>";"{BN}*("/**"|"//!"|"/*!"|"///")"<" {
+<FindMembers,MemberSpec,Function,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs,DefinePHPEnd>";"{BN}*{DCOMM}"<" {
if (yyextra->current->bodyLine==-1)
{
yyextra->current->bodyLine=yyextra->yyLineNr;
@@ -2462,7 +2577,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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);
@@ -2484,7 +2599,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
BEGIN( DocBlock );
}
}
-<MemberSpec,FindFields,FindMembers,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>","{BN}*("/**"|"//!"|"/*!"|"///")"<" {
+<MemberSpec,FindFields,FindMembers,NextSemi,EnumBaseType,BitFields,ReadInitializer,ReadInitializerPtr,OldStyleArgs>","{BN}*{DCOMM}"<" {
yyextra->docBlockContext = YY_START;
yyextra->docBlockInBody = FALSE;
yyextra->docBlockAutoBrief = ( yytext[yyleng-2]=='*' && Config_getBool(JAVADOC_AUTOBRIEF) ) ||
@@ -2492,7 +2607,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
QCString indent;
indent.fill(' ',computeIndent(yytext,yyextra->column));
- yyextra->docBlock=indent;
+ yyextra->docBlock.str(indent.str());
lineCount(yyscanner);
yyextra->docBlockTerm = ',';
@@ -2513,7 +2628,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
BEGIN( DocBlock );
}
}
-<DefineEnd,FindFields,FindFieldArg,ReadInitializer,ReadInitializerPtr,OldStyleArgs>{BN}*("/**"|"//!"|"/*!"|"///")"<" {
+<DefineEnd,FindFields,FindFieldArg,ReadInitializer,ReadInitializerPtr,OldStyleArgs>{BN}*{DCOMM}"<" {
if (yyextra->current->bodyLine==-1)
{
yyextra->current->bodyLine=yyextra->yyLineNr;
@@ -2525,7 +2640,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
( 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;
@@ -2541,7 +2656,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
}
-<FindMembers,FindFields>("//"([!/]){B}*{CMD}"{")|("/*"([!*]){B}*{CMD}"{") {
+<FindMembers,FindFields>({CPPC}([!/]){B}*{CMD}"{")|({CCS}([!*]){B}*{CMD}"{") {
//handleGroupStartCommand(yyextra->current->name);
if (yyextra->previous && yyextra->previous->section==Entry::GROUPDOC_SEC)
{
@@ -2562,7 +2677,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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);
@@ -2579,7 +2694,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
{
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;
@@ -2593,7 +2708,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
}
}
-<FindMembers,FindFields,ReadInitializer,ReadInitializerPtr>"//"([!/]){B}*{CMD}"}".*|"/*"([!*]){B}*{CMD}"}"[^*]*"*/" {
+<FindMembers,FindFields,ReadInitializer,ReadInitializerPtr>{CPPC}([!/]){B}*{CMD}"}".*|{CCS}([!*]){B}*{CMD}"}"[^*]*{CCE} {
bool insideEnum = YY_START==FindFields || ((YY_START==ReadInitializer || YY_START==ReadInitializerPtr) && yyextra->lastInitializerContext==FindFields); // see bug746226
yyextra->commentScanner.close(yyextra->current.get(),yyextra->yyFileName,yyextra->yyLineNr,insideEnum);
lineCount(yyscanner);
@@ -2602,7 +2717,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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;
@@ -2612,7 +2727,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<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);
@@ -2631,7 +2746,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
yyextra->lastRoundContext=YY_START;
yyextra->pCopyRoundGString=&yyextra->current->initializer;
yyextra->roundCount=0;
- yyextra->current->initializer+=*yytext;
+ yyextra->current->initializer << *yytext;
BEGIN(GCopyRound);
}
<ReadInitializer,ReadInitializerPtr>"[" {
@@ -2639,18 +2754,18 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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;
@@ -2666,18 +2781,18 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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
@@ -2688,18 +2803,18 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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)
@@ -2708,13 +2823,13 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
}
<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} {
@@ -2728,15 +2843,15 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
}
<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);
}
@@ -2748,39 +2863,39 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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} {
@@ -2790,16 +2905,16 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
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;
@@ -2813,30 +2928,30 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
}
<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 */
@@ -2851,7 +2966,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
*yyextra->pCopyQuotedString+=*yytext;
BEGIN( yyextra->lastStringContext );
}
-<CopyString,CopyPHPString>"/*"|"*/"|"//" {
+<CopyString,CopyPHPString>{CCS}|{CCE}|{CPPC} {
*yyextra->pCopyQuotedString+=yytext;
}
<CopyString,CopyPHPString>\n {
@@ -2864,62 +2979,62 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
/* 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>"/*"|"*/"|"//" {
- *yyextra->pCopyQuotedGString+=yytext;
+<CopyGString,CopyPHPGString>{CCS}|{CCE}|{CPPC} {
+ *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} {
@@ -2939,37 +3054,90 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
*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} {
@@ -2979,47 +3147,47 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
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} {
@@ -3029,25 +3197,25 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
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;
@@ -3056,11 +3224,11 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
}
<CopyCurly>"{" {
- *yyextra->pCopyCurlyString+=*yytext;
+ *yyextra->pCopyCurlyString += *yytext;
yyextra->curlyCount++;
}
<CopyCurly>"}" {
- *yyextra->pCopyCurlyString+=*yytext;
+ *yyextra->pCopyCurlyString += *yytext;
if (--yyextra->curlyCount<0)
BEGIN(yyextra->lastCurlyContext);
}
@@ -3070,19 +3238,19 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
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 */
@@ -3100,13 +3268,13 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
}
<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;
@@ -3115,11 +3283,11 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
}
<GCopyCurly>"{" {
- *yyextra->pCopyCurlyGString+=*yytext;
+ *yyextra->pCopyCurlyGString << *yytext;
yyextra->curlyCount++;
}
<GCopyCurly>"}" {
- *yyextra->pCopyCurlyGString+=*yytext;
+ *yyextra->pCopyCurlyGString << *yytext;
if (--yyextra->curlyCount<0)
BEGIN(yyextra->lastCurlyContext);
}
@@ -3129,22 +3297,22 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
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;
}
/* ---------------------- */
@@ -3196,7 +3364,12 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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);
@@ -3219,7 +3392,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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--;
@@ -3399,20 +3572,20 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
BEGIN( IDLProp );
}
<IDLPropName>{BN}*"("{BN}*{ID}{BN}*")"{BN}* {
- if (yyextra->odlProp)
- {
- yyextra->idlProp += yytext;
- }
+ if (yyextra->odlProp)
+ {
+ yyextra->idlProp += yytext;
+ }
}
-<IDLPropName>{ID}{BN}*/";" {
- if (yyextra->odlProp)
- {
- yyextra->current->name = yytext;
- yyextra->idlProp = yyextra->idlProp.stripWhiteSpace();
- yyextra->odlProp = false;
+<IDLPropName>{ID}{BNopt}/";" {
+ if (yyextra->odlProp)
+ {
+ yyextra->current->name = yytext;
+ yyextra->idlProp = yyextra->idlProp.stripWhiteSpace();
+ yyextra->odlProp = false;
- BEGIN( IDLProp );
- }
+ BEGIN( IDLProp );
+ }
}
<IDLProp>{BN}*"["[^\]]*"]"{BN}* { // attribute of a parameter
yyextra->idlAttr = yytext;
@@ -3422,7 +3595,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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 += ", ";
@@ -3443,7 +3616,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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;
@@ -3506,13 +3679,13 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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>";" {
@@ -3547,8 +3720,8 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<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;
@@ -3569,7 +3742,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
{
// 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);
@@ -3589,21 +3762,21 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
/*
<FindFieldArg>"," { unput(*yytext); BEGIN(FindFields); }
*/
-<ReadBody,ReadNSBody,ReadBodyIntf>[^\r\n\#{}"@'/<]* { yyextra->current->program += yytext ; }
-<ReadBody,ReadNSBody,ReadBodyIntf>"//".* { 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 );
@@ -3613,16 +3786,16 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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>"/*"{B}* { yyextra->current->program += yytext ;
+<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{B}* { yyextra->current->program << yytext ;
yyextra->lastContext = YY_START ;
BEGIN( Comment ) ;
}
-<ReadBody,ReadNSBody,ReadBodyIntf>"/*"{BL} { yyextra->current->program += yytext ;
+<ReadBody,ReadNSBody,ReadBodyIntf>{CCS}{BL} { yyextra->current->program << yytext ;
++yyextra->yyLineNr ;
yyextra->lastContext = YY_START ;
BEGIN( Comment ) ;
@@ -3630,11 +3803,11 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<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);
@@ -3648,20 +3821,20 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
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
@@ -3688,7 +3861,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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+"::");
@@ -3706,8 +3879,8 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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);
@@ -3721,14 +3894,14 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
{
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
@@ -3754,9 +3927,9 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
else
{
- static QRegExp re("@[0-9]+$");
+ static const reg::Ex re(R"(@\d+$)");
if (!yyextra->isTypedef && yyextra->memspecEntry &&
- yyextra->memspecEntry->name.find(re)==-1) // not typedef or anonymous type (see bug691071)
+ !reg::search(yyextra->memspecEntry->name.str(),re)) // not typedef or anonymous type (see bug691071)
{
// enabled the next two lines for bug 623424
yyextra->current->doc.resize(0);
@@ -3772,7 +3945,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
lineCount(yyscanner);
if ( yyextra->curlyCount>0 )
{
- yyextra->current->program += yytext ;
+ yyextra->current->program << yytext ;
--yyextra->curlyCount ;
}
else
@@ -3780,7 +3953,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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);
@@ -3795,13 +3968,13 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<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;
@@ -3815,7 +3988,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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();
@@ -3880,13 +4053,13 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
// 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;
}
@@ -3895,7 +4068,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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
{
@@ -3926,7 +4099,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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 &&
@@ -3943,16 +4116,16 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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);
}
}
@@ -3989,7 +4162,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<MemberSpec>"=" {
yyextra->lastInitializerContext=YY_START;
yyextra->initBracketCount=0;
- yyextra->current->initializer = yytext;
+ yyextra->current->initializer.str(yytext);
BEGIN(ReadInitializer);
/* BEGIN(MemberSpecSkip); */
}
@@ -4003,7 +4176,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
*/
<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
@@ -4013,7 +4186,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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 */
@@ -4054,7 +4227,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<FuncPtr>. {
//printf("error: FuncPtr '%c' unexpected at line %d of %s\n",*yytext,yyextra->yyLineNr,yyextra->yyFileName);
}
-<FuncPtrOperator>"("{BN}*")"{BN}*/"(" {
+<FuncPtrOperator>"("{BN}*")"{BNopt}/"(" {
yyextra->current->name += yytext;
yyextra->current->name = yyextra->current->name.simplifyWhiteSpace();
lineCount(yyscanner);
@@ -4070,19 +4243,19 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<FuncPtrOperator>. {
yyextra->current->name += *yytext;
}
-<EndFuncPtr>")"{BN}*/";" { // a variable with extra braces
+<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>")"{BN}*/"(" { // a function pointer
+<EndFuncPtr>")"{BNopt}/"(" { // a function pointer
lineCount(yyscanner);
yyextra->current->type+=yyextra->funcPtrType+")";
BEGIN(FindMembers);
}
-<EndFuncPtr>")"{BN}*/"[" { // an array of variables
+<EndFuncPtr>")"{BNopt}/"[" { // an array of variables
lineCount(yyscanner);
- yyextra->current->type+=yyextra->funcPtrType.data();
+ yyextra->current->type+=yyextra->funcPtrType;
yyextra->current->args += ")";
BEGIN(FindMembers);
}
@@ -4094,7 +4267,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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 ) ;
}
@@ -4122,12 +4295,12 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
yyextra->current->type+=yyextra->funcPtrType+")(";
BEGIN(FuncFuncType);
}
-<FuncFuncEnd>")"{BN}*/[;{] {
+<FuncFuncEnd>")"{BNopt}/[;{] {
lineCount(yyscanner);
- yyextra->current->type+=yyextra->funcPtrType.data()+1;
+ yyextra->current->type+=yyextra->funcPtrType.mid(1);
BEGIN(Function);
}
-<FuncFuncEnd>")"{BN}*/"[" { // function returning a pointer to an array
+<FuncFuncEnd>")"{BNopt}/"[" { // function returning a pointer to an array
lineCount(yyscanner);
yyextra->current->type+=yyextra->funcPtrType;
yyextra->current->args+=")";
@@ -4166,7 +4339,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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");
@@ -4187,7 +4360,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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());
@@ -4261,7 +4434,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
BEGIN( yyextra->currentArgumentContext );
}
/* a special comment */
-<ReadFuncArgType,ReadTempArgs>("/*"[*!]|"//"[/!])("<"?) {
+<ReadFuncArgType,ReadTempArgs>({CCS}[*!]|{CPPC}[/!])("<"?) {
if (yyextra->currentArgumentContext==DefineEnd)
{
// for defines we interpret a comment
@@ -4288,12 +4461,12 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
}
/* a non-special comment */
-<ReadFuncArgType,ReadTempArgs>"/**/" { /* empty comment */ }
-<ReadFuncArgType,ReadTempArgs>"/*" {
+<ReadFuncArgType,ReadTempArgs>{CCS}{CCE} { /* empty comment */ }
+<ReadFuncArgType,ReadTempArgs>{CCS} {
yyextra->lastCContext = YY_START;
BEGIN( SkipComment );
}
-<ReadFuncArgType,ReadTempArgs>"//" {
+<ReadFuncArgType,ReadTempArgs>{CPPC} {
yyextra->lastCContext = YY_START;
BEGIN( SkipCxxComment );
}
@@ -4311,7 +4484,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
*/
/* ')' followed by a special comment */
-<ReadFuncArgType>")"{BN}*("/*"[*!]|"//"[/!])"<" {
+<ReadFuncArgType>")"{BN}*({CCS}[*!]|{CPPC}[/!])"<" {
lineCount(yyscanner);
if (yyextra->currentArgumentContext==DefineEnd)
{
@@ -4344,7 +4517,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
<CopyArgComment>^{B}*"*"+/{BN}+
<CopyArgComment>[^\n\\\@\*]+ { yyextra->fullArgString+=yytext; }
-<CopyArgComment>"*/" { yyextra->fullArgString+=yytext;
+<CopyArgComment>{CCE} { yyextra->fullArgString+=yytext;
if (yyextra->lastCopyArgChar!=0)
unput(yyextra->lastCopyArgChar);
BEGIN( yyextra->lastCommentInArgContext );
@@ -4403,7 +4576,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<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 );
}
@@ -4618,6 +4791,11 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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);
@@ -4632,7 +4810,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
{
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;
@@ -4671,7 +4849,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
// typically an initialized function pointer
yyextra->lastInitializerContext=YY_START;
yyextra->initBracketCount=0;
- yyextra->current->initializer = yytext;
+ yyextra->current->initializer.str(yytext);
BEGIN(ReadInitializer);
}
}
@@ -4725,8 +4903,15 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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();
@@ -4734,7 +4919,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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);
@@ -4752,12 +4937,12 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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,
@@ -4846,10 +5031,16 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
yyextra->current->fileName = yyextra->yyFileName;
yyextra->current->startLine = yyextra->yyBegLineNr;
yyextra->current->startColumn = yyextra->yyBegColNr;
- static QRegExp re("([^)]*[*&][^)]*)"); // (...*...)
+ static const reg::Ex re(R"(\([^)]*[*&][^)]*\))");
+ reg::Match match;
+ std::string type = yyextra->current->type.str();
+ int ti=-1;
+ if (reg::search(type,match,re))
+ {
+ ti = (int)match.position();
+ }
int ts=yyextra->current->type.find('<');
int te=yyextra->current->type.findRev('>');
- int ti=yyextra->current->type.find(re,0);
// bug677315: A<int(void *, char *)> get(); is not a function pointer
bool isFunction = ti==-1 || // not a (...*...) pattern
@@ -4858,7 +5049,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
(!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) )
{
@@ -4867,7 +5058,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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 ");
@@ -4876,14 +5067,14 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
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 ")
@@ -4900,7 +5091,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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"))
@@ -4997,7 +5188,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
//addToBody(yytext);
++yyextra->curlyCount ;
}
-<SkipCurly>"}"/{BN}*("/*!"|"/**"|"//!"|"///")"<!--" | /* see bug710917 */
+<SkipCurly>"}"/{BN}*{DCOMM}"<!--" | /* see bug710917 */)
<SkipCurly>"}" {
//addToBody(yytext);
if( yyextra->curlyCount )
@@ -5015,7 +5206,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
BEGIN( yyextra->lastCurlyContext ) ;
}
}
-<SkipCurly>"}"{BN}*("/*!"|"/**"|"//!"|"///")"<" {
+<SkipCurly>"}"{BN}*{DCOMM}"<" {
lineCount(yyscanner);
if ( yyextra->curlyCount )
{
@@ -5032,7 +5223,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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]=='/')
{
@@ -5046,12 +5237,12 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
}
}
-<SkipCurlyEndDoc>"}"{BN}*("/*!"|"/**"|"//!"|"///")"<" { // desc is followed by another one
+<SkipCurlyEndDoc>"}"{BN}*{DCOMM}"<" { // desc is followed by another one
yyextra->docBlockContext = SkipCurlyEndDoc;
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]=='/')
{
@@ -5101,12 +5292,12 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
<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#"'@\\/{}<]+ {
@@ -5123,12 +5314,12 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
//addToBody(yytext);
lineCount(yyscanner);
}
-<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>"/*" {
+<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>{CCS} {
//addToBody(yytext);
yyextra->lastCContext = YY_START;
BEGIN(SkipComment);
}
-<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>"//" {
+<SkipInits,SkipC11Inits,SkipCurly,SkipCurlyCpp,SkipC11Attribute>{CPPC} {
//addToBody(yytext);
yyextra->lastCContext = YY_START;
BEGIN(SkipCxxComment);
@@ -5181,7 +5372,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<SkipPHPString>\' {
BEGIN( yyextra->lastStringContext );
}
-<SkipString,SkipPHPString>"/*"|"*/"|"//" { }
+<SkipString,SkipPHPString>{CCS}|{CCE}|{CPPC} { }
<SkipString,SkipPHPString>\n {
lineCount(yyscanner);
}
@@ -5302,9 +5493,9 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
// 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);
@@ -5378,6 +5569,17 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
<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();
@@ -5406,7 +5608,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
lineCount(yyscanner);
BEGIN( ClassVar );
}
-<ClassVar>{SCOPENAME}{BN}*/"(" {
+<ClassVar>{SCOPENAME}{BNopt}/"(" {
if (yyextra->insideIDL && qstrncmp(yytext,"switch",6)==0 && !isId(yytext[6]))
{
// Corba IDL style union
@@ -5520,8 +5722,8 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
BEGIN( FindMembers );
}
}
-<CSConstraintType,CSConstraintName>"/**/" { /* empty comment */ }
-<CSConstraintType,CSConstraintName>("/*"[*!]|"//"[/!])("<"?) { // special comment
+<CSConstraintType,CSConstraintName>{CCS}{CCE} { /* empty comment */ }
+<CSConstraintType,CSConstraintName>({CCS}[*!]|{CPPC}[/!])("<"?) { // special comment
yyextra->fullArgString.resize(0);
yyextra->lastCopyArgChar='#'; // end marker
yyextra->lastCommentInArgContext=YY_START;
@@ -5642,7 +5844,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
BEGIN( FindMembers );
}
-<Bases,ClassVar>"///"/[^/] {
+<Bases,ClassVar>{CPPC}"/"/[^/] {
if (!yyextra->insideObjC)
{
REJECT;
@@ -5650,7 +5852,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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;
@@ -5658,9 +5860,9 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
BEGIN( ReadBodyIntf );
}
}
-<Bases,ClassVar>("//"{B}*)?"/**"/[^/*] |
-<Bases,ClassVar>("//"{B}*)?"/*!" |
-<Bases,ClassVar>"//!" |
+<Bases,ClassVar>({CPPC}{B}*)?{CCS}"*"/{NCOMM} |
+<Bases,ClassVar>({CPPC}{B}*)?{CCS}"!" |
+<Bases,ClassVar>{CPPC}"!" |
<Bases,ClassVar>[\-+]{BN}* {
if (!yyextra->insideObjC)
{
@@ -5669,7 +5871,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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 +5880,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
}
<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;
@@ -5931,7 +6133,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
}
<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;
@@ -5961,26 +6163,26 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
<SkipUnionSwitch>\n { lineCount(yyscanner); }
<SkipUnionSwitch>.
-<Comment>{BN}+ { yyextra->current->program += yytext ;
+<Comment>{BN}+ { yyextra->current->program << yytext ;
lineCount(yyscanner) ;
}
-<Comment>"/*" { yyextra->current->program += yytext ; }
-<Comment>"//" { 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>"*/" { 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>("//"{B}*)?"/*!" {
+<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,SkipC11Inits,SkipC11Attribute,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"!" {
//printf("Start doc block at %d\n",yyextra->yyLineNr);
if (!yyextra->current->doc.isEmpty())
{
@@ -6003,7 +6205,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
QCString indent;
indent.fill(' ',computeIndent(yytext,yyextra->column));
- yyextra->docBlock=indent;
+ yyextra->docBlock.str(indent.str());
if (yyextra->docBlockAutoBrief)
{
@@ -6013,7 +6215,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
startCommentBlock(yyscanner,FALSE);
BEGIN( DocBlock );
}
-<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>"/**"[*]+{BL} {
+<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>{CCS}"*"[*]+{BL} {
bool javadocBanner = Config_getBool(JAVADOC_BANNER);
lineCount(yyscanner);
@@ -6035,7 +6237,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
QCString indent;
indent.fill(' ',computeIndent(yytext,yyextra->column));
- yyextra->docBlock=indent;
+ yyextra->docBlock.str(indent.str());
if (yyextra->docBlockAutoBrief)
{
@@ -6047,12 +6249,12 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
else
{
- yyextra->current->program += yytext ;
+ yyextra->current->program << yytext ;
yyextra->lastContext = YY_START ;
BEGIN( Comment ) ;
}
}
-<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>("//"{B}*)?"/**"/[^/*] {
+<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>({CPPC}{B}*)?{CCS}"*"/{NCOMM} {
yyextra->lastDocContext = YY_START;
//printf("Found comment block at %s:%d\n",yyextra->yyFileName,yyextra->yyLineNr);
@@ -6069,7 +6271,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
QCString indent;
indent.fill(' ',computeIndent(yytext,yyextra->column));
- yyextra->docBlock=indent;
+ yyextra->docBlock.str(indent.str());
if (yyextra->docBlockAutoBrief)
{
@@ -6079,7 +6281,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
startCommentBlock(yyscanner,FALSE);
BEGIN( DocBlock );
}
-<FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>"//!" {
+<FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"!" {
yyextra->lastDocContext = YY_START;
if (yyextra->current_root->section & Entry::SCOPE_MASK)
{
@@ -6091,12 +6293,12 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
QCString indent;
indent.fill(' ',computeIndent(yytext,yyextra->column));
- yyextra->docBlock=indent;
+ yyextra->docBlock.str(indent.str());
startCommentBlock(yyscanner,yyextra->current->brief.isEmpty());
BEGIN( DocLine );
}
-<FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>"///"/[^/] {
+<FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>{CPPC}"/"/[^/] {
yyextra->lastDocContext = YY_START;
if (yyextra->current_root->section & Entry::SCOPE_MASK)
{
@@ -6107,7 +6309,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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 );
}
@@ -6178,7 +6380,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
// 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);
@@ -6189,7 +6391,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<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);
@@ -6222,8 +6424,8 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<CSAccessorDecl>"." {}
<CSAccessorDecl>\n { lineCount(yyscanner); }
<CSString>"\"" { BEGIN(CSAccessorDecl);}
-<CSString>"//" {} // Otherwise the rule <*>"//" will kick in
-<CSString>"/*" {} // Otherwise the rule <*>"/*" will kick in
+<CSString>{CPPC} {} // Otherwise the rule <*>"//" will kick in
+<CSString>{CCS} {} // Otherwise the rule <*>"/*" will kick in
<CSString>\n { lineCount(yyscanner); }
<CSString>"." {}
@@ -6292,58 +6494,57 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
/**********************************************************************************/
/* ---- Single line comments ------ */
-<DocLine>[^\n]*"\n"[ \t]*"//"[/!][<]? { // continuation of multiline C++-style comment
- yyextra->docBlock+=yytext;
+<DocLine>[^\n]*"\n"[ \t]*{CPPC}[/!][<]? { // continuation of multiline C++-style comment
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}*"///"[/]+{B}*/"\n" { // ignore marker line (see bug700345)
- handleCommentBlock(yyscanner,yyextra->docBlock.data(),yyextra->current->brief.isEmpty());
+<DocLine>{B}*{CPPC}"/"[/]+{Bopt}/"\n" { // ignore marker line (see bug700345)
+ handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
BEGIN( yyextra->docBlockContext );
}
-<DocLine>[^\n]*/"\n"{B}*"//"[!/]{B}*{CMD}"}" { // next line is an end group marker, see bug 752712
- yyextra->docBlock+=yytext;
- handleCommentBlock(yyscanner,yyextra->docBlock.data(),yyextra->current->brief.isEmpty());
+<DocLine>{NONLopt}/"\n"{B}*{CPPC}[!/]{B}*{CMD}"}" { // next line is an end group marker, see bug 752712
+ yyextra->docBlock << yytext;
+ handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
BEGIN( yyextra->docBlockContext );
}
-<DocLine>[^\n]*/"\n" { // whole line
- yyextra->docBlock+=yytext;
- handleCommentBlock(yyscanner,yyextra->docBlock.data(),yyextra->current->brief.isEmpty());
+<DocLine>{NONLopt}/"\n" { // whole line
+ yyextra->docBlock << yytext;
+ handleCommentBlock(yyscanner,yyextra->docBlock.str(),yyextra->current->brief.isEmpty());
BEGIN( yyextra->docBlockContext );
}
/* ---- Comments blocks ------ */
-<DocBlock>"*"*"*/" { // end of comment block
- handleCommentBlock(yyscanner,yyextra->docBlock.data(),FALSE);
+<DocBlock>"*"*{CCE} { // end of comment block
+ 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}*("//")?{B}*"*"+/[^//a-z_A-Z0-9*] { // start of a comment line
+<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}*("//"){B}* { // strip embedded C++ comments if at the start of a line
+<DocBlock>^{B}*({CPPC}){B}* { // strip embedded C++ comments if at the start of a line
}
-<DocBlock>"//" { // slashes in the middle of a comment block
- yyextra->docBlock+=yytext;
+<DocBlock>{CPPC} { // slashes in the middle of a comment block
+ yyextra->docBlock << yytext;
}
-<DocBlock>"/*" { // start of a new comment in the
+<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)=='{')
{
@@ -6354,14 +6555,14 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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;
@@ -6370,7 +6571,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<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;
@@ -6378,7 +6579,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
<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 +6588,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<DocBlock>{B}*"<code>" {
if (yyextra->insideCS)
{
- yyextra->docBlock+=yytext;
+ yyextra->docBlock << yytext;
yyextra->docBlockName="<code>";
yyextra->nestedComment=FALSE;
BEGIN(DocCopyBlock);
@@ -6398,38 +6599,38 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
}
<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);
@@ -6448,7 +6649,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
{
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
@@ -6456,7 +6657,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
{
QCString indent;
indent.fill(' ',computeIndent(yytext,0));
- yyextra->docBlock+=indent;
+ yyextra->docBlock << indent;
}
else
{
@@ -6468,7 +6669,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
{
QCString indent;
indent.fill(' ',computeIndent(yytext,-1));
- yyextra->docBlock+=indent+"*";
+ yyextra->docBlock << indent+"*";
}
else
{
@@ -6482,12 +6683,12 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
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
@@ -6497,7 +6698,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
<DocCopyBlock>^({B}*"*"+)?{B}{0,3}"~~~"[~]* {
QCString pat = substitute(yytext,"*"," ");
- yyextra->docBlock+=pat;
+ yyextra->docBlock << pat;
if (yyextra->fencedSize==pat.stripWhiteSpace().length())
{
BEGIN(DocBlock);
@@ -6505,16 +6706,16 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
<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;
+<DocCopyBlock>[^\<@/\*\]~\$\\\n]+ { // any character that is not special
+ yyextra->docBlock << yytext;
}
-<DocCopyBlock>"/*"|"*/"|"//" {
+<DocCopyBlock>{CCS}|{CCE}|{CPPC} {
if (yytext[1]=='*')
{
yyextra->nestedComment=TRUE;
@@ -6523,20 +6724,20 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
{
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();
}
@@ -6549,7 +6750,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<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 ) ;
}
@@ -6571,7 +6772,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
<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 ) ;
}
@@ -6631,7 +6832,7 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
lineCount(yyscanner);
}
}
-<SkipCxxComment>.*/\n {
+<SkipCxxComment>{ANYopt}/\n {
BEGIN( yyextra->lastCContext ) ;
}
<SkipComment>[^\*\n]+
@@ -6689,12 +6890,12 @@ OPERATOR "operator"{B}*({ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP})
}
}
<*>.
-<SkipComment>"//"|"/*"
-<*>"/*" { yyextra->lastCContext = YY_START ;
+<SkipComment>{CPPC}|{CCS}
+<*>{CCS} { yyextra->lastCContext = YY_START ;
BEGIN( SkipComment ) ;
}
-<SkipComment>{B}*"*/" { BEGIN( yyextra->lastCContext ) ; }
-<*>"//" {
+<SkipComment>{B}*{CCE} { BEGIN( yyextra->lastCContext ) ; }
+<*>{CPPC} {
yyextra->lastCContext = YY_START ;
BEGIN( SkipCxxComment ) ;
}
@@ -6855,10 +7056,11 @@ static void setContext(yyscan_t yyscanner)
yyextra->insideObjC = yyextra->language==SrcLangExt_ObjC;
yyextra->insideJS = yyextra->language==SrcLangExt_JS;
yyextra->insideSlice = yyextra->language==SrcLangExt_Slice;
- yyextra->insideCpp = yyextra->language==SrcLangExt_Cpp;
+ yyextra->insideCpp = (yyextra->language==SrcLangExt_Cpp ||
+ 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
// );
}
@@ -6869,7 +7071,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)
@@ -6904,13 +7106,24 @@ static void splitKnRArg(yyscan_t yyscanner,QCString &oldStyleArgPtr,QCString &ol
int si = yyextra->current->args.length();
if (yyextra->oldStyleArgType.isEmpty()) // new argument
{
- static QRegExp re("([^)]*)");
- int bi1 = yyextra->current->args.findRev(re);
- int bi2 = bi1!=-1 ? yyextra->current->args.findRev(re,bi1-1) : -1;
+ std::string args = yyextra->current->args.str();
+ static const reg::Ex re(R"(\([^)]*\).*)"); // find first (...)
+ int bi1=-1;
+ int bi2=-1;
+ reg::Match match;
+ if (reg::search(args,match,re))
+ {
+ bi1=(int)match.position();
+ size_t secondMatchStart = match.position()+match.length(); // search again after first match
+ if (reg::search(args,match,re,secondMatchStart))
+ {
+ bi2=(int)match.position();
+ }
+ }
char c;
if (bi1!=-1 && bi2!=-1) // found something like "int (*func)(int arg)"
{
- int s=bi2+1;
+ int s=bi2+1; // keep opening (
yyextra->oldStyleArgType = yyextra->current->args.left(s);
int i=s;
while (i<si && ((c=yyextra->current->args.at(i))=='*' || isspace((uchar)c))) i++;
@@ -6922,7 +7135,7 @@ static void splitKnRArg(yyscan_t yyscanner,QCString &oldStyleArgPtr,QCString &ol
}
else if (bi1!=-1) // redundant braces like in "int (*var)"
{
- int s=bi1;
+ int s=bi1; // strip opening (
yyextra->oldStyleArgType = yyextra->current->args.left(s);
s++;
int i=s+1;
@@ -6949,7 +7162,7 @@ static void splitKnRArg(yyscan_t yyscanner,QCString &oldStyleArgPtr,QCString &ol
}
else
{
- oldStyleArgName=yyextra->current->args.copy().stripWhiteSpace();
+ oldStyleArgName=yyextra->current->args.stripWhiteSpace();
}
}
}
@@ -6965,7 +7178,7 @@ static void splitKnRArg(yyscan_t yyscanner,QCString &oldStyleArgPtr,QCString &ol
}
else
{
- oldStyleArgName=yyextra->current->args.copy().stripWhiteSpace();
+ oldStyleArgName=yyextra->current->args.stripWhiteSpace();
}
}
}
@@ -7064,7 +7277,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
@@ -7096,7 +7309,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;
@@ -7123,10 +7336,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;
@@ -7139,7 +7352,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(),
@@ -7156,7 +7369,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)
@@ -7180,18 +7393,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 ) ;
@@ -7210,7 +7424,7 @@ static void parseCompounds(yyscan_t yyscanner,const std::shared_ptr<Entry> &rt)
// deep copy group list from parent (see bug 727732)
bool autoGroupNested = Config_getBool(GROUP_NESTED_COMPOUNDS);
- if (autoGroupNested && ce->section!=Entry::ENUM_SEC && !(ce->spec&Entry::Enum))
+ if (autoGroupNested && !rt->groups.empty() && ce->section!=Entry::ENUM_SEC && !(ce->spec&Entry::Enum))
{
ce->groups = rt->groups;
}
@@ -7261,7 +7475,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);
@@ -7275,7 +7489,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)
@@ -7290,7 +7505,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)
@@ -7316,7 +7531,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);
@@ -7352,7 +7567,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);
@@ -7361,7 +7577,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();
@@ -7373,7 +7589,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!");
@@ -7395,7 +7611,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);
@@ -7451,19 +7667,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));
}
@@ -7471,13 +7687,13 @@ bool COutlineParser::needsPreprocessing(const QCString &extension) const
{
QCString fe=extension.lower();
SrcLangExt lang = getLanguageFromFileName(extension);
- return (SrcLangExt_Cpp == lang) ||
+ return (SrcLangExt_Cpp == lang) || (SrcLangExt_Lex == lang) ||
!( fe==".java" || fe==".as" || fe==".d" || fe==".php" ||
fe==".php4" || fe==".inc" || fe==".phtml"|| fe==".php5"
);
}
-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 89f1681..cf09e67 100644
--- a/src/searchindex.cpp
+++ b/src/searchindex.cpp
@@ -16,9 +16,7 @@
#include <ctype.h>
#include <assert.h>
-
-#include <qfile.h>
-#include <qregexp.h>
+#include <sstream>
#include "searchindex.h"
#include "config.h"
@@ -37,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
@@ -82,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);
@@ -90,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)
@@ -148,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();
}
@@ -176,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;
@@ -191,19 +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)
{
- static QRegExp nextPart("[_a-z:][A-Z]");
- 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());
@@ -221,40 +218,47 @@ 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;
}
}
if (!found) // no prefix stripped
{
- if ((i=nextPart.match(word))>=1)
+ i=0;
+ while (word[i]!=0 &&
+ !((word[i]=='_' || word[i]==':' || (word[i]>='a' && word[i]<='z')) && // [_a-z:]
+ (word[i+1]>='A' && word[i+1]<='Z'))) // [A-Z]
+ {
+ i++;
+ }
+ 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
@@ -327,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++)
{
@@ -349,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++)
{
@@ -447,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:
@@ -462,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());
@@ -483,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));
}
}
@@ -547,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
+ if (isIdJS(s[i]))
{
- result+=(char)c;
+ t << s[i];
}
- else if (isalnum(c)) // simply alpha numerical character
+ else // escape non-identifier characters
{
- result+=(char)tolower(c);
- }
- else // other 'unprintable' 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());
}
@@ -593,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 =
{ {
@@ -622,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)
@@ -640,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" ||
@@ -702,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())
@@ -752,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());
@@ -786,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());
@@ -795,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());
@@ -841,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());
}
@@ -857,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());
}
@@ -869,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());
}
@@ -913,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
@@ -975,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;
@@ -992,7 +995,7 @@ void writeJavaScriptSearchIndex()
if (!firstEntry)
{
ti << "]]]";
- ti << "," << endl;
+ ti << ",\n";
}
firstEntry=FALSE;
@@ -1119,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");
@@ -1216,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/sortdict.h b/src/sortdict.h
deleted file mode 100644
index 907cb78..0000000
--- a/src/sortdict.h
+++ /dev/null
@@ -1,420 +0,0 @@
-/******************************************************************************
- *
- *
- *
- *
- * 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.
- *
- */
-
-#ifndef _SORTDICT_H
-#define _SORTDICT_H
-
-#include <qlist.h>
-#include <qdict.h>
-#include <qintdict.h>
-
-#define AUTORESIZE 1
-
-#if AUTORESIZE
-const uint SDict_primes[] =
-{
- 17,
- 29,
- 47,
- 71,
- 113,
- 179,
- 293,
- 457,
- 733,
- 1171,
- 1871,
- 2999,
- 4787,
- 7669,
- 12251,
- 19603,
- 31379,
- 50177,
- 80287,
- 128449,
- 205519,
- 328829,
- 526139,
- 841801,
- 1346881,
- 2155007,
- 3448033,
- 5516827,
- 8826919,
- 14123059,
- 23538433,
- 39230771,
- 65384537,
- 108974231,
- 181623707,
- 302706181,
- 504510283,
- 840850487,
- 0xffffffff
-};
-#endif
-
-template<class T> class SDict;
-
-/** internal wrapper class that redirects compareValues() to the
- * dictionary
- */
-template<class T>
-class SList : public QList<T>
-{
- public:
- SList(SDict<T> *owner) : m_owner(owner) {}
- virtual ~SList() {}
- int compareValues(const T *item1,const T *item2) const
- {
- return m_owner->compareValues(item1,item2);
- }
- private:
- SDict<T> *m_owner;
-};
-
-/** Ordered dictionary of elements of type T.
- * Internally uses a QList<T> and a QDict<T>.
- */
-template<class T>
-class SDict
-{
- private:
- SList<T> *m_list;
- QDict<T> *m_dict;
- uint m_sizeIndex;
-
- public:
- /*! Create an ordered dictionary.
- * \param size The size of the dictionary. Should be a prime number for
- * best distribution of elements.
- * \param caseSensitive indicated whether the keys should be sorted
- * in a case sensitive way.
- */
- SDict(uint size=17,bool caseSensitive=TRUE) : m_sizeIndex(0)
- {
- m_list = new SList<T>(this);
-#if AUTORESIZE
- while ((uint)size>SDict_primes[m_sizeIndex]) m_sizeIndex++;
- m_dict = new QDict<T>(SDict_primes[m_sizeIndex],caseSensitive);
-#else
- m_dict = new QDict<T>(size,caseSensitive);
-#endif
- }
-
- /*! Destroys the dictionary */
- virtual ~SDict()
- {
- delete m_list;
- delete m_dict;
- }
-
- /*! Appends an element to the dictionary. The element is owned by the
- * dictionary.
- * \param key The unique key to use to quickly find the item later on.
- * \param d The compound to add.
- * \sa find()
- */
- void append(const char *key,const T *d)
- {
- m_list->append(d);
- m_dict->insert(key,d);
-#if AUTORESIZE
- if (m_dict->size()>SDict_primes[m_sizeIndex])
- {
- m_dict->resize(SDict_primes[++m_sizeIndex]);
- }
-#endif
- }
-
- /*! Prepends an element to the dictionary. The element is owned by the
- * dictionary.
- * \param key The unique key to use to quickly find the item later on.
- * \param d The compound to add.
- * \sa find()
- */
- void prepend(const char *key,const T *d)
- {
- m_list->prepend(d);
- m_dict->insert(key,d);
-#if AUTORESIZE
- if (m_dict->size()>SDict_primes[m_sizeIndex])
- {
- m_dict->resize(SDict_primes[++m_sizeIndex]);
- }
-#endif
- }
-
- /*! Remove an item from the dictionary */
- bool remove(const char *key)
- {
- T *item = m_dict->take(key);
- return item ? m_list->remove(item) : FALSE;
- }
-
- /*! Take an item out of the dictionary without deleting it */
- T *take(const char *key)
- {
- T *item = m_dict->take(key);
- if (item)
- {
- int i = m_list->find(item);
- m_list->take(i);
- }
- return item;
- }
-
- /*! Sorts the members of the dictionary. First appending a number
- * of members and then sorting them is faster (O(NlogN) than using
- * inSort() for each member (O(N^2)).
- */
- void sort()
- {
- m_list->sort();
- }
- /*! Inserts a compound into the dictionary in a sorted way.
- * \param key The unique key to use to quickly find the item later on.
- * \param d The compound to add.
- * \sa find()
- */
- void inSort(const char *key,const T *d)
- {
- m_list->inSort(d);
- m_dict->insert(key,d);
-#if AUTORESIZE
- if (m_dict->size()>SDict_primes[m_sizeIndex])
- {
- m_dict->resize(SDict_primes[++m_sizeIndex]);
- }
-#endif
- }
-
- void insertAt(int i,const char *key,const T *d)
- {
- m_list->insert(i,d);
- m_dict->insert(key,d);
-#if AUTORESIZE
- if (m_dict->size()>SDict_primes[m_sizeIndex])
- {
- m_dict->resize(SDict_primes[++m_sizeIndex]);
- }
-#endif
- }
-
- /*! Indicates whether or not the dictionary owns its elements */
- void setAutoDelete(bool val)
- {
- m_list->setAutoDelete(val);
- }
-
- /*! Looks up a compound given its key.
- * \param key The key to identify this element.
- * \return The requested compound or zero if it cannot be found.
- * \sa append()
- */
- T *find(const char *key)
- {
- return m_dict->find(key);
- }
- T *find(const QCString &key)
- {
- return m_dict->find(key);
- }
- int findAt(const QCString &key)
- {
- T *item = find(key);
- if (item==0) return -1;
- return m_list->find(item);
- }
-
- /*! Equivalent to find(). */
- T *operator[](const char *key) const
- {
- return m_dict->find(key);
- }
-
- /*! Returns the item at position \a i in the sorted dictionary */
- T *at(uint i)
- {
- return m_list->at(i);
- }
-
- /*! Function that is used to compare two items when sorting.
- * Overload this to properly sort items.
- * \sa inSort()
- */
- virtual int compareValues(const T *item1,const T *item2) const
- {
- return item1!=item2;
- }
-
- /*! Clears the dictionary. Will delete items if setAutoDelete() was
- * set to \c TRUE.
- * \sa setAutoDelete
- */
- void clear()
- {
- m_list->clear();
- m_dict->clear();
- }
-
- /*! Returns the number of items stored in the dictionary
- */
- uint count() const
- {
- return m_list->count();
- }
-
- class Iterator; // first forward declare
- friend class Iterator; // then make it a friend
- /*! Simple iterator for SDict. It iterates in the order in which the
- * elements are stored.
- */
- class Iterator
- {
- public:
- /*! Create an iterator given the dictionary. */
- Iterator(const SDict<T> &dict)
- {
- m_li = new QListIterator<T>(*dict.m_list);
- }
-
- /*! Destroys the dictionary */
- virtual ~Iterator()
- {
- delete m_li;
- }
-
- /*! Set the iterator to the first element in the list.
- * \return The first compound, or zero if the list was empty.
- */
- T *toFirst() const
- {
- return m_li->toFirst();
- }
-
- /*! Set the iterator to the last element in the list.
- * \return The first compound, or zero if the list was empty.
- */
- T *toLast() const
- {
- return m_li->toLast();
- }
-
- /*! Returns the current compound */
- T *current() const
- {
- return m_li->current();
- }
-
- /*! Moves the iterator to the next element.
- * \return the new "current" element, or zero if the iterator was
- * already pointing at the last element.
- */
- T *operator++()
- {
- return m_li->operator++();
- }
-
- /*! Moves the iterator to the previous element.
- * \return the new "current" element, or zero if the iterator was
- * already pointing at the first element.
- */
- T *operator--()
- {
- return m_li->operator--();
- }
-
- private:
- QListIterator<T> *m_li;
- };
-
- class IteratorDict; // first forward declare
- friend class IteratorDict; // then make it a friend
- /*! Simple iterator for SDict. It iterates over the dictionary elements
- * in an unsorted way, but does provide information about the element's key.
- */
- class IteratorDict
- {
- public:
- /*! Create an iterator given the dictionary. */
- IteratorDict(const SDict<T> &dict)
- {
- m_di = new QDictIterator<T>(*dict.m_dict);
- }
-
- /*! Destroys the dictionary */
- virtual ~IteratorDict()
- {
- delete m_di;
- }
-
- /*! Set the iterator to the first element in the list.
- * \return The first compound, or zero if the list was empty.
- */
- T *toFirst() const
- {
- return m_di->toFirst();
- }
-
- /*! Set the iterator to the last element in the list.
- * \return The first compound, or zero if the list was empty.
- */
- T *toLast() const
- {
- return m_di->toLast();
- }
-
- /*! Returns the current compound */
- T *current() const
- {
- return m_di->current();
- }
-
- /*! Returns the current key */
- QCString currentKey() const
- {
- return m_di->currentKey();
- }
-
- /*! Moves the iterator to the next element.
- * \return the new "current" element, or zero if the iterator was
- * already pointing at the last element.
- */
- T *operator++()
- {
- return m_di->operator++();
- }
-
- /*! Moves the iterator to the previous element.
- * \return the new "current" element, or zero if the iterator was
- * already pointing at the first element.
- */
- T *operator--()
- {
- return m_di->operator--();
- }
-
- private:
- QDictIterator<T> *m_di;
- };
-};
-
-
-#endif
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 c5af17f..ffa8eaa 100644
--- a/src/sqlcode.l
+++ b/src/sqlcode.l
@@ -119,7 +119,7 @@ variable @{idchar}+
simplecomment --.*
commentopen "/\*"
-commentclose "\*/"
+commentclose "\*\/"
%x COMMENT
@@ -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 f0d2a12..6943fb9 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>
@@ -823,45 +825,43 @@ SqlStmt memberdef_param_insert={
,NULL
};
-
class TextGeneratorSqlite3Impl : public TextGeneratorIntf
{
public:
- TextGeneratorSqlite3Impl(StringList &l) : l(l) {
- l.setAutoDelete(TRUE);
- }
- void writeString(const char * /*s*/,bool /*keepSpaces*/) const
+ TextGeneratorSqlite3Impl(StringVector &l) : m_list(l) { }
+ 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
{
- QCString *rs=new QCString(file);
- if (anchor)
+ std::string rs = file.str();
+ if (!anchor.isEmpty())
{
- rs->append("_1").append(anchor);
+ rs+="_1";
+ rs+=anchor.str();
}
- l.append(rs);
+ m_list.push_back(rs);
}
private:
- StringList &l;
+ StringVector &m_list;
// the list is filled by linkifyText and consumed by the caller
};
-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;
@@ -936,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);
@@ -1019,10 +1019,6 @@ static void insertMemberFunctionParams(int memberdef_id, const MemberDef *md, co
const ArgumentList &defAl = md->argumentList();
if (declAl.size()>0)
{
-// ArgumentListIterator declAli(*declAl);
-// ArgumentListIterator defAli(*defAl);
-// const Argument *a;
-// for (declAli.toFirst();(a=declAli.current());++declAli)
auto defIt = defAl.begin();
for (const Argument &a : declAl)
{
@@ -1041,18 +1037,15 @@ static void insertMemberFunctionParams(int memberdef_id, const MemberDef *md, co
}
if (!a.type.isEmpty())
{
- StringList l;
- linkifyText(TextGeneratorSqlite3Impl(l),def,md->getBodyDef(),md,a.type);
+ StringVector list;
+ linkifyText(TextGeneratorSqlite3Impl(list),def,md->getBodyDef(),md,a.type);
- StringListIterator li(l);
- QCString *s;
- while ((s=li.current()))
+ for (const auto &s : list)
{
QCString qsrc_refid = md->getOutputFileBase() + "_1" + md->anchor();
struct Refid src_refid = insertRefid(qsrc_refid);
- struct Refid dst_refid = insertRefid(s->data());
+ struct Refid dst_refid = insertRefid(s.c_str());
insertMemberReference(src_refid,dst_refid, "argument");
- ++li;
}
bindTextParameter(param_select,":type",a.type);
bindTextParameter(param_insert,":type",a.type);
@@ -1074,8 +1067,8 @@ static void insertMemberFunctionParams(int memberdef_id, const MemberDef *md, co
}
if (!a.defval.isEmpty())
{
- StringList l;
- linkifyText(TextGeneratorSqlite3Impl(l),def,md->getBodyDef(),md,a.defval);
+ StringVector list;
+ linkifyText(TextGeneratorSqlite3Impl(list),def,md->getBodyDef(),md,a.defval);
bindTextParameter(param_select,":defval",a.defval);
bindTextParameter(param_insert,":defval",a.defval);
}
@@ -1304,20 +1297,15 @@ static void writeInnerGroups(const GroupList &gl, struct Refid outer_refid)
}
}
-static void writeInnerFiles(const FileList *fl, struct Refid outer_refid)
+static void writeInnerFiles(const FileList &fl, struct Refid outer_refid)
{
- if (fl)
+ for (const auto &fd: fl)
{
- QListIterator<FileDef> fli(*fl);
- const FileDef *fd;
- for (fli.toFirst();(fd=fli.current());++fli)
- {
- struct Refid inner_refid = insertRefid(fd->getOutputFileBase());
+ struct Refid inner_refid = insertRefid(fd->getOutputFileBase());
- bindIntParameter(contains_insert,":inner_rowid", inner_refid.rowid);
- bindIntParameter(contains_insert,":outer_rowid", outer_refid.rowid);
- step(contains_insert);
- }
+ bindIntParameter(contains_insert,":inner_rowid", inner_refid.rowid);
+ bindIntParameter(contains_insert,":outer_rowid", outer_refid.rowid);
+ step(contains_insert);
}
}
@@ -1383,9 +1371,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,
@@ -1394,9 +1388,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,
@@ -1412,15 +1406,15 @@ QCString getSQLDocBlock(const Definition *scope,
);
XMLCodeGenerator codeGen(t);
// create a parse tree visitor for XML
- XmlDocVisitor *visitor = new XmlDocVisitor(t,codeGen);
+ 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,
@@ -1663,7 +1657,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);
@@ -1726,19 +1720,19 @@ static void generateSqlite3ForMember(const MemberDef *md, struct Refid scope_ref
}
QCString typeStr = md->typeString();
stripQualifiers(typeStr);
- StringList l;
- linkifyText(TextGeneratorSqlite3Impl(l), def, md->getBodyDef(),md,typeStr);
- if (typeStr)
+ StringVector list;
+ linkifyText(TextGeneratorSqlite3Impl(list), def, md->getBodyDef(),md,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());
}
@@ -1751,29 +1745,26 @@ static void generateSqlite3ForMember(const MemberDef *md, struct Refid scope_ref
{
bindTextParameter(memberdef_insert,":initializer",md->initializer());
- StringList l;
- linkifyText(TextGeneratorSqlite3Impl(l),def,md->getBodyDef(),md,md->initializer());
- StringListIterator li(l);
- QCString *s;
- while ((s=li.current()))
+ StringVector list;
+ linkifyText(TextGeneratorSqlite3Impl(list),def,md->getBodyDef(),md,md->initializer());
+ for (const auto &s : list)
{
if (md->getBodyDef())
{
DBG_CTX(("initializer:%s %s %s %d\n",
- md->anchor().data(),
- s->data(),
- md->getBodyDef()->getDefFileName().data(),
+ qPrint(md->anchor()),
+ s.c_str(),
+ qPrint(md->getBodyDef()->getDefFileName()),
md->getStartBodyLine()));
QCString qsrc_refid = md->getOutputFileBase() + "_1" + md->anchor();
struct Refid src_refid = insertRefid(qsrc_refid);
- struct Refid dst_refid = insertRefid(s->data());
+ struct Refid dst_refid = insertRefid(s.c_str());
insertMemberReference(src_refid,dst_refid, "initializer");
}
- ++li;
}
}
- if ( md->getScopeString() )
+ if ( !md->getScopeString().isEmpty() )
{
bindTextParameter(memberdef_insert,":scope",md->getScopeString());
}
@@ -1818,7 +1809,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);
}
@@ -1826,14 +1817,12 @@ static void generateSqlite3ForMember(const MemberDef *md, struct Refid scope_ref
// + source references
// The cross-references in initializers only work when both the src and dst
// are defined.
- auto refList = md->getReferencesMembers();
- for (const auto &refmd : refList)
+ for (const auto &refmd : md->getReferencesMembers())
{
insertMemberReference(md,refmd, "inline");
}
// + source referenced by
- auto refByList = md->getReferencedByMembers();
- for (const auto &refmd : refByList)
+ for (const auto &refmd : md->getReferencedByMembers())
{
insertMemberReference(refmd,md, "inline");
}
@@ -1843,14 +1832,11 @@ 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;
- MemberListIterator mli(*ml);
- const MemberDef *md;
-
- for (mli.toFirst();(md=mli.current());++mli)
+ for (const auto &md : *ml)
{
// TODO: necessary? just tracking what xmlgen does; xmlgen says:
// namespace members are also inserted in the file scope, but
@@ -1868,7 +1854,7 @@ static void associateAllClassMembers(const ClassDef *cd, struct Refid scope_refi
{
for (auto &mi : *mni)
{
- MemberDef *md = mi->memberDef();
+ const MemberDef *md = mi->memberDef();
QCString qrefid = md->getOutputFileBase() + "_1" + md->anchor();
associateMember(md, insertRefid(qrefid), scope_refid);
}
@@ -1942,7 +1928,7 @@ static void generateSqlite3ForClass(const ClassDef *cd)
other values if there's a solid heuristic for *when a class will
have a header file*.
*/
- IncludeInfo *ii=cd->includeInfo();
+ const IncludeInfo *ii=cd->includeInfo();
if (ii)
{
QCString nm = ii->includeName;
@@ -1954,10 +1940,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));
@@ -2006,7 +1992,7 @@ static void generateSqlite3ForClass(const ClassDef *cd)
// + member groups
for (const auto &mg : cd->getMemberGroups())
{
- generateSqlite3Section(cd,mg->members(),refid,"user-defined",mg->header(),
+ generateSqlite3Section(cd,&mg->members(),refid,"user-defined",mg->header(),
mg->documentation());
}
@@ -2023,6 +2009,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)
{
@@ -2063,7 +2073,7 @@ static void generateSqlite3ForNamespace(const NamespaceDef *nd)
// + member groups
for (const auto &mg : nd->getMemberGroups())
{
- generateSqlite3Section(nd,mg->members(),refid,"user-defined",mg->header(),
+ generateSqlite3Section(nd,&mg->members(),refid,"user-defined",mg->header(),
mg->documentation());
}
@@ -2115,97 +2125,88 @@ static void generateSqlite3ForFile(const FileDef *fd)
step(compounddef_insert);
// + includes files
- IncludeInfo *ii;
- if (fd->includeFileList())
+ for (const auto &ii : fd->includeFileList())
{
- QListIterator<IncludeInfo> ili(*fd->includeFileList());
- for (ili.toFirst();(ii=ili.current());++ili)
- {
- int src_id=insertPath(fd->absFilePath(),!fd->isReference());
- int dst_id;
- QCString dst_path;
+ int src_id=insertPath(fd->absFilePath(),!fd->isReference());
+ int dst_id;
+ QCString dst_path;
- if(ii->fileDef) // found file
+ if(ii.fileDef) // found file
+ {
+ if(ii.fileDef->isReference())
{
- if(ii->fileDef->isReference())
- {
- // strip tagfile from path
- QCString tagfile = ii->fileDef->getReference();
- dst_path = ii->fileDef->absFilePath().copy();
- dst_path.stripPrefix(tagfile+":");
- }
- else
- {
- dst_path = ii->fileDef->absFilePath();
- }
- dst_id = insertPath(dst_path,ii->local);
+ // strip tagfile from path
+ QCString tagfile = ii.fileDef->getReference();
+ dst_path = ii.fileDef->absFilePath();
+ dst_path.stripPrefix(tagfile+":");
}
- else // can't find file
+ else
{
- dst_id = insertPath(ii->includeName,ii->local,FALSE);
+ dst_path = ii.fileDef->absFilePath();
}
+ dst_id = insertPath(dst_path,ii.local);
+ }
+ else // can't find file
+ {
+ dst_id = insertPath(ii.includeName,ii.local,FALSE);
+ }
- DBG_CTX(("-----> FileDef includeInfo for %s\n", ii->includeName.data()));
- 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((" src_id : %d\n", src_id));
- DBG_CTX((" dst_id: %d\n", dst_id));
-
- bindIntParameter(incl_select,":local",ii->local);
- bindIntParameter(incl_select,":src_id",src_id);
- bindIntParameter(incl_select,":dst_id",dst_id);
- if (step(incl_select,TRUE,TRUE)==0) {
- bindIntParameter(incl_insert,":local",ii->local);
- bindIntParameter(incl_insert,":src_id",src_id);
- bindIntParameter(incl_insert,":dst_id",dst_id);
- step(incl_insert);
- }
+ 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", qPrint(ii.fileDef->absFilePath())));
+ }
+ DBG_CTX((" src_id : %d\n", src_id));
+ DBG_CTX((" dst_id: %d\n", dst_id));
+
+ bindIntParameter(incl_select,":local",ii.local);
+ bindIntParameter(incl_select,":src_id",src_id);
+ bindIntParameter(incl_select,":dst_id",dst_id);
+ if (step(incl_select,TRUE,TRUE)==0) {
+ bindIntParameter(incl_insert,":local",ii.local);
+ bindIntParameter(incl_insert,":src_id",src_id);
+ bindIntParameter(incl_insert,":dst_id",dst_id);
+ step(incl_insert);
}
}
// + includedby files
- if (fd->includedByFileList())
+ for (const auto &ii : fd->includedByFileList())
{
- QListIterator<IncludeInfo> ili(*fd->includedByFileList());
- for (ili.toFirst();(ii=ili.current());++ili)
- {
- int dst_id=insertPath(fd->absFilePath(),!fd->isReference());
- int src_id;
- QCString src_path;
+ int dst_id=insertPath(fd->absFilePath(),!fd->isReference());
+ int src_id;
+ QCString src_path;
- if(ii->fileDef) // found file
+ if(ii.fileDef) // found file
+ {
+ if(ii.fileDef->isReference())
{
- if(ii->fileDef->isReference())
- {
- // strip tagfile from path
- QCString tagfile = ii->fileDef->getReference();
- src_path = ii->fileDef->absFilePath().copy();
- src_path.stripPrefix(tagfile+":");
- }
- else
- {
- src_path = ii->fileDef->absFilePath();
- }
- src_id = insertPath(src_path,ii->local);
+ // strip tagfile from path
+ QCString tagfile = ii.fileDef->getReference();
+ src_path = ii.fileDef->absFilePath();
+ src_path.stripPrefix(tagfile+":");
}
- else // can't find file
+ else
{
- src_id = insertPath(ii->includeName,ii->local,FALSE);
+ src_path = ii.fileDef->absFilePath();
}
+ src_id = insertPath(src_path,ii.local);
+ }
+ else // can't find file
+ {
+ src_id = insertPath(ii.includeName,ii.local,FALSE);
+ }
- bindIntParameter(incl_select,":local",ii->local);
- bindIntParameter(incl_select,":src_id",src_id);
- bindIntParameter(incl_select,":dst_id",dst_id);
- if (step(incl_select,TRUE,TRUE)==0) {
- bindIntParameter(incl_insert,":local",ii->local);
- bindIntParameter(incl_insert,":src_id",src_id);
- bindIntParameter(incl_insert,":dst_id",dst_id);
- step(incl_insert);
- }
+ bindIntParameter(incl_select,":local",ii.local);
+ bindIntParameter(incl_select,":src_id",src_id);
+ bindIntParameter(incl_select,":dst_id",dst_id);
+ if (step(incl_select,TRUE,TRUE)==0) {
+ bindIntParameter(incl_insert,":local",ii.local);
+ bindIntParameter(incl_insert,":src_id",src_id);
+ bindIntParameter(incl_insert,":dst_id",dst_id);
+ step(incl_insert);
}
}
@@ -2218,7 +2219,7 @@ static void generateSqlite3ForFile(const FileDef *fd)
// + member groups
for (const auto &mg : fd->getMemberGroups())
{
- generateSqlite3Section(fd,mg->members(),refid,"user-defined",mg->header(),
+ generateSqlite3Section(fd,&mg->members(),refid,"user-defined",mg->header(),
mg->documentation());
}
@@ -2285,7 +2286,7 @@ static void generateSqlite3ForGroup(const GroupDef *gd)
// + member groups
for (const auto &mg : gd->getMemberGroups())
{
- generateSqlite3Section(gd,mg->members(),refid,"user-defined",mg->header(),
+ generateSqlite3Section(gd,&mg->members(),refid,"user-defined",mg->header(),
mg->documentation());
}
@@ -2392,8 +2393,10 @@ static void generateSqlite3ForPage(const PageDef *pd,bool isExample)
{
title = si->title();
}
-
- if(!title){title = pd->title();}
+ if (title.isEmpty())
+ {
+ title = pd->title();
+ }
}
// + title
@@ -2422,7 +2425,6 @@ static sqlite3* openDbConnection()
{
QCString outputDirectory = Config_getString(SQLITE3_OUTPUT);
- QDir sqlite3Dir(outputDirectory);
sqlite3 *db;
int rc;
@@ -2433,14 +2435,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
{
@@ -2450,7 +2452,7 @@ static sqlite3* openDbConnection()
}
rc = sqlite3_open_v2(
- fi.absFilePath().utf8(),
+ fi.absFilePath().c_str(),
&db,
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE,
0
@@ -2503,14 +2505,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());
}
@@ -2519,7 +2528,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());
}
}
@@ -2527,28 +2536,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 80ec700..17843a1 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();
@@ -553,7 +553,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
@@ -606,7 +606,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)
@@ -643,19 +643,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
{
@@ -677,7 +677,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
{
@@ -688,11 +688,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;
@@ -702,7 +702,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)
{
@@ -723,7 +723,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);
@@ -768,28 +768,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");
@@ -814,7 +814,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
}
@@ -837,7 +837,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)
@@ -873,7 +873,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");
@@ -886,7 +886,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))
{
@@ -943,7 +943,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");
@@ -1010,8 +1010,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;
}
@@ -1029,7 +1029,7 @@ SymbolResolver::~SymbolResolver()
const ClassDef *SymbolResolver::resolveClass(const Definition *scope,
- const char *name,
+ const QCString &name,
bool mayBeUnlinkable,
bool mayBeHidden)
{
@@ -1045,7 +1045,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
// );
@@ -1068,12 +1068,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 d5f8d5f..6dca1cd 100644
--- a/src/tagreader.cpp
+++ b/src/tagreader.cpp
@@ -38,37 +38,38 @@
#include "filename.h"
#include "section.h"
#include "containers.h"
+#include "debug.h"
/** Information about an linkable anchor */
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;
};
@@ -77,32 +78,34 @@ 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;
bool isStatic = false;
std::vector<TagEnumValueInfo> enumValues;
+ int lineNr;
};
/** Base class for all compound types */
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;
+ int lineNr;
private:
CompoundType m_type;
};
@@ -113,8 +116,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;
@@ -130,13 +133,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)
{
@@ -169,8 +189,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)
@@ -188,9 +209,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;
@@ -210,7 +232,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());
@@ -226,7 +248,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)
@@ -260,12 +282,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();
@@ -278,6 +300,7 @@ class TagFileParser
switch (m_state)
{
case InClass:
+ case InConcept:
case InFile:
case InNamespace:
case InGroup:
@@ -295,10 +318,11 @@ class TagFileParser
void startMember( const XMLHandlers::Attributes& attrib)
{
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");
+ m_curMember.kind = XMLHandlers::value(attrib,"kind");
+ QCString protStr = XMLHandlers::value(attrib,"protection");
+ QCString virtStr = XMLHandlers::value(attrib,"virtualness");
+ QCString staticStr = XMLHandlers::value(attrib,"static");
+ m_curMember.lineNr = m_locator->lineNr();
if (protStr=="protected")
{
m_curMember.prot = Protected;
@@ -362,7 +386,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)
@@ -378,6 +402,7 @@ class TagFileParser
switch(m_state)
{
case InClass:
+ case InConcept:
case InFile:
case InNamespace:
case InGroup:
@@ -385,7 +410,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");
@@ -394,6 +419,7 @@ class TagFileParser
switch(m_state)
{
case InClass:
+ case InConcept:
case InFile:
case InNamespace:
case InGroup:
@@ -414,19 +440,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");
@@ -434,18 +460,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");
@@ -458,10 +503,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");
@@ -474,7 +519,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");
@@ -487,7 +532,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");
@@ -524,6 +569,7 @@ class TagFileParser
switch (m_state)
{
case InClass:
+ case InConcept:
case InFile:
case InNamespace:
case InGroup:
@@ -546,8 +592,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")
@@ -562,7 +608,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
{
@@ -609,7 +655,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
{
@@ -622,6 +668,7 @@ class TagFileParser
switch (m_state)
{
case InClass:
+ case InConcept:
case InNamespace:
case InFile:
case InGroup:
@@ -734,7 +781,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
{
@@ -756,6 +803,7 @@ class TagFileParser
enum State { Invalid,
InClass,
+ InConcept,
InFile,
InNamespace,
InGroup,
@@ -770,14 +818,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);
}
@@ -790,10 +838,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;
@@ -838,6 +886,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 ) } },
@@ -873,6 +922,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>(); } } },
@@ -881,31 +931,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));
}
}
@@ -920,6 +970,7 @@ void TagFileParser::startCompound( const XMLHandlers::Attributes& attrib )
{
m_curCompound = it->second.make_instance();
m_state = it->second.state;
+ m_curCompound->lineNr = m_locator->lineNr();
}
else
{
@@ -944,23 +995,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)
{
@@ -968,8 +1030,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() );
@@ -978,10 +1040,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));
}
}
}
@@ -993,8 +1055,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() );
@@ -1007,15 +1069,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));
}
}
}
@@ -1026,8 +1088,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)
{
@@ -1053,10 +1115,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));
}
}
}
@@ -1067,9 +1129,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));
}
}
@@ -1080,8 +1142,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() );
@@ -1099,18 +1161,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));
}
}
}
@@ -1149,6 +1211,7 @@ void TagFileParser::buildMemberList(const std::shared_ptr<Entry> &ce,const std::
me->stat = tmi.isStatic;
me->fileName = ce->fileName;
me->id = tmi.clangId;
+ me->startLine = tmi.lineNr;
if (ce->section == Entry::GROUPDOC_SEC)
{
me->groups.push_back(Grouping(ce->name,Grouping::GROUPING_INGROUP));
@@ -1229,19 +1292,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.
@@ -1281,9 +1331,10 @@ void TagFileParser::buildLists(const std::shared_ptr<Entry> &root)
ce->tagInfoData.tagName = m_tagName;
ce->tagInfoData.anchor = tci->anchor;
ce->tagInfoData.fileName = tci->filename;
- ce->hasTagInfo = TRUE;
- ce->id = tci->clangId;
- ce->lang = tci->isObjC ? SrcLangExt_ObjC : SrcLangExt_Unknown;
+ ce->startLine = tci->lineNr;
+ ce->hasTagInfo = TRUE;
+ ce->id = tci->clangId;
+ ce->lang = tci->isObjC ? SrcLangExt_ObjC : SrcLangExt_Unknown;
// transfer base class list
ce->extends = tci->bases;
if (!tci->templateArguments.empty())
@@ -1312,28 +1363,29 @@ 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();
- 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()) };
+ QCString fullName = m_tagName+":"+tfi->path+stripPath(tfi->name);
+ fe->fileName = fullName;
+ fe->startLine = tfi->lineNr;
+ //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);
@@ -1341,6 +1393,27 @@ 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->startLine = tci->lineNr;
+ ce->hasTagInfo = TRUE;
+ ce->id = tci->clangId;
+
+ root->moveToSubEntryAndKeep(ce);
+ }
+ }
+
// build namespace list
for (const auto &comp : m_tagFileCompounds)
{
@@ -1354,6 +1427,7 @@ void TagFileParser::buildLists(const std::shared_ptr<Entry> &root)
addDocAnchors(ne,tni->docAnchors);
ne->tagInfoData.tagName = m_tagName;
ne->tagInfoData.fileName = tni->filename;
+ ne->startLine = tni->lineNr;
ne->hasTagInfo = TRUE;
ne->id = tni->clangId;
@@ -1375,6 +1449,7 @@ void TagFileParser::buildLists(const std::shared_ptr<Entry> &root)
addDocAnchors(pe,tpgi->docAnchors);
pe->tagInfoData.tagName = m_tagName;
pe->tagInfoData.fileName = tpgi->filename;
+ pe->startLine = tpgi->lineNr;
pe->hasTagInfo = TRUE;
buildMemberList(pe,tpgi->members);
@@ -1396,6 +1471,7 @@ void TagFileParser::buildLists(const std::shared_ptr<Entry> &root)
addDocAnchors(ge,tgi->docAnchors);
ge->tagInfoData.tagName = m_tagName;
ge->tagInfoData.fileName = tgi->filename;
+ ge->startLine = tgi->lineNr;
ge->hasTagInfo = TRUE;
buildMemberList(ge,tgi->members);
@@ -1417,7 +1493,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));
}
}
}
@@ -1431,13 +1507,14 @@ 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;
addDocAnchors(pe,tpi->docAnchors);
pe->tagInfoData.tagName = m_tagName;
pe->tagInfoData.fileName = tpi->filename;
+ pe->startLine = tpi->lineNr;
pe->hasTagInfo = TRUE;
root->moveToSubEntryAndKeep(pe);
}
@@ -1451,30 +1528,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);
}
}
}
@@ -1493,13 +1570,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);
+ 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 d5e8275..82b35f7 100644..100755
--- a/src/template.cpp
+++ b/src/template.cpp
@@ -15,26 +15,22 @@
#include "template.h"
-#include <stdio.h>
-#include <stdarg.h>
-
-#include <qlist.h>
-#include <qarray.h>
-#include <qdict.h>
-#include <qstrlist.h>
-#include <qvaluelist.h>
-#include <qstack.h>
-#include <qfile.h>
-#include <qregexp.h>
-#include <qcstring.h>
-#include <qdir.h>
-
-#include "sortdict.h"
-#include "ftextstream.h"
+#include <vector>
+#include <algorithm>
+#include <unordered_map>
+#include <deque>
+#include <cstdio>
+#include <fstream>
+#include <sstream>
+
#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
@@ -102,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++))
@@ -123,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++)
@@ -242,9 +239,8 @@ int TemplateVariant::toInt() const
class TemplateStruct::Private
{
public:
- Private() : fields(17), refCount(0)
- { fields.setAutoDelete(TRUE); }
- QDict<TemplateVariant> fields;
+ Private() : refCount(0) {}
+ std::unordered_map<std::string,TemplateVariant> fields;
int refCount = 0;
};
@@ -273,23 +269,23 @@ int TemplateStruct::release()
return count;
}
-void TemplateStruct::set(const char *name,const TemplateVariant &v)
+void TemplateStruct::set(const QCString &name,const TemplateVariant &v)
{
- TemplateVariant *pv = p->fields.find(name);
- if (pv) // change existing field
+ auto it = p->fields.find(name.str());
+ if (it!=p->fields.end()) // change existing field
{
- *pv = v;
+ it->second = v;
}
else // insert new field
{
- p->fields.insert(name,new TemplateVariant(v));
+ p->fields.insert(std::make_pair(name.str(),v));
}
}
-TemplateVariant TemplateStruct::get(const char *name) const
+TemplateVariant TemplateStruct::get(const QCString &name) const
{
- TemplateVariant *v = p->fields.find(name);
- return v ? *v : TemplateVariant();
+ auto it = p->fields.find(name.str());
+ return it!=p->fields.end() ? it->second : TemplateVariant();
}
TemplateStruct *TemplateStruct::alloc()
@@ -487,13 +483,14 @@ class TemplateBlockContext
public:
TemplateBlockContext();
TemplateNodeBlock *get(const QCString &name) const;
- TemplateNodeBlock *pop(const QCString &name) const;
+ TemplateNodeBlock *pop(const QCString &name);
void add(TemplateNodeBlock *block);
void add(TemplateBlockContext *ctx);
void push(TemplateNodeBlock *block);
void clear();
+ using NodeBlockList = std::deque<TemplateNodeBlock*>;
private:
- QDict< QList<TemplateNodeBlock> > m_blocks;
+ std::map< std::string, NodeBlockList > m_blocks;
};
/** @brief A container to store a key-value pair */
@@ -516,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)
@@ -524,11 +521,12 @@ class TemplateContextImpl : public TemplateContext
void setEscapeIntf(const QCString &ext,TemplateEscapeIntf *intf)
{
int i=(!ext.isEmpty() && ext.at(0)=='.') ? 1 : 0;
- m_escapeIntfDict.insert(ext.mid(i),new TemplateEscapeIntf*(intf));
+ m_escapeIntfMap.insert(std::make_pair(ext.mid(i).str(),intf));
}
void selectEscapeIntf(const QCString &ext)
- { TemplateEscapeIntf **ppIntf = m_escapeIntfDict.find(ext);
- m_activeEscapeIntf = ppIntf ? *ppIntf : 0;
+ {
+ auto it = m_escapeIntfMap.find(ext.str());
+ m_activeEscapeIntf = it!=m_escapeIntfMap.end() ? it->second : 0;
}
void setActiveEscapeIntf(TemplateEscapeIntf *intf) { m_activeEscapeIntf = intf; }
void setSpacelessIntf(TemplateSpacelessIntf *intf) { m_spacelessIntf = intf; }
@@ -555,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);
@@ -567,15 +565,15 @@ class TemplateContextImpl : public TemplateContext
QCString m_templateName;
int m_line = 0;
QCString m_outputDir;
- QList< QDict<TemplateVariant> > m_contextStack;
+ std::deque< std::map<std::string,TemplateVariant> > m_contextStack;
TemplateBlockContext m_blockContext;
- QDict<TemplateEscapeIntf*> m_escapeIntfDict;
+ std::unordered_map<std::string, TemplateEscapeIntf*> m_escapeIntfMap;
TemplateEscapeIntf *m_activeEscapeIntf = 0;
TemplateSpacelessIntf *m_spacelessIntf = 0;
bool m_spacelessEnabled = false;
bool m_tabbingEnabled = false;
TemplateAutoRef<TemplateStruct> m_indices;
- QDict< QStack<TemplateVariant> > m_indexStacks;
+ std::unordered_map< std::string, std::stack<TemplateVariant> > m_indexStacks;
QCString m_encoding;
void *m_fromUtf8 = 0;
};
@@ -631,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;
}
}
@@ -872,50 +870,42 @@ class FilterListSort
QCString key;
TemplateVariant value;
};
- class SortList : public QList<ListElem>
- {
- public:
- SortList() { setAutoDelete(TRUE); }
- private:
- int compareValues(const ListElem *item1,const ListElem *item2) const
- {
- return qstrcmp(item1->key,item2->key);
- }
- };
public:
static TemplateVariant apply(const TemplateVariant &v,const TemplateVariant &args)
{
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;
TemplateList *result = TemplateList::alloc();
// create list of items based on v using the data in args as a sort key
+ using SortList = std::vector<ListElem>;
SortList sortList;
+ sortList.reserve(v.toList()->count());
for (it->toFirst();(it->current(item));it->toNext())
{
TemplateStructIntf *s = item.toStruct();
if (s)
{
QCString sortKey = determineSortKey(s,args.toString());
- sortList.append(new ListElem(sortKey,item));
- //printf("sortKey=%s\n",sortKey.data());
+ sortList.emplace_back(sortKey,item);
+ //printf("sortKey=%s\n",qPrint(sortKey));
}
}
delete it;
// sort the list
- sortList.sort();
+ std::sort(sortList.begin(),
+ sortList.end(),
+ [](const auto &lhs,const auto &rhs) { return lhs.key < rhs.key; });
// add sorted items to the result list
- QListIterator<ListElem> sit(sortList);
- ListElem *elem;
- for (sit.toFirst();(elem=sit.current());++sit)
+ for (const auto &elem : sortList)
{
- result->append(elem->value);
+ result->append(elem.value);
}
return result;
}
@@ -935,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;
}
@@ -960,58 +950,50 @@ class FilterGroupBy
QCString key;
TemplateVariant value;
};
- class SortList : public QList<ListElem>
- {
- public:
- SortList() { setAutoDelete(TRUE); }
- private:
- int compareValues(const ListElem *item1,const ListElem *item2) const
- {
- return qstrcmp(item1->key,item2->key);
- }
- };
public:
static TemplateVariant apply(const TemplateVariant &v,const TemplateVariant &args)
{
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;
TemplateList *result = TemplateList::alloc();
// create list of items based on v using the data in args as a sort key
+ using SortList = std::vector<ListElem>;
SortList sortList;
+ sortList.reserve(v.toList()->count());
for (it->toFirst();(it->current(item));it->toNext())
{
TemplateStructIntf *s = item.toStruct();
if (s)
{
QCString sortKey = determineSortKey(s,args.toString());
- sortList.append(new ListElem(sortKey,item));
- //printf("sortKey=%s\n",sortKey.data());
+ sortList.emplace_back(sortKey,item);
+ //printf("sortKey=%s\n",qPrint(sortKey));
}
}
delete it;
// sort the list
- sortList.sort();
+ std::sort(sortList.begin(),
+ sortList.end(),
+ [](const auto &lhs,const auto &rhs) { return lhs.key < rhs.key; });
// add sorted items to the result list
- QListIterator<ListElem> sit(sortList);
- ListElem *elem;
TemplateList *groupList=0;
QCString prevKey;
- for (sit.toFirst();(elem=sit.current());++sit)
+ for (const auto &elem : sortList)
{
- if (groupList==0 || elem->key!=prevKey)
+ if (groupList==0 || elem.key!=prevKey)
{
groupList = TemplateList::alloc();
result->append(groupList);
- prevKey = elem->key;
+ prevKey = elem.key;
}
- groupList->append(elem->value);
+ groupList->append(elem.value);
}
return result;
}
@@ -1097,67 +1079,39 @@ class FilterAlphaIndex
struct ListElem
{
ListElem(uint k,const TemplateVariant &v) : key(k), value(v) {}
- uint key;
+ QCString key;
TemplateVariant value;
};
- class SortList : public QList<ListElem>
- {
- public:
- SortList() { setAutoDelete(TRUE); }
- private:
- int compareValues(const ListElem *item1,const ListElem *item2) const
- {
- return item1->key-item2->key;
- }
- };
- static QCString keyToLetter(uint startLetter)
+ static QCString keyToLabel(const QCString &startLetter)
{
- return QString(QChar(startLetter)).utf8();
- }
- static QCString keyToLabel(uint startLetter)
- {
- char s[11]; // 0x12345678 + '\0'
- if ((startLetter>='0' && startLetter<='9') ||
- (startLetter>='a' && startLetter<='z') ||
- (startLetter>='A' && startLetter<='Z'))
+ if (startLetter.isEmpty()) return startLetter;
+ const char *p = startLetter.data();
+ char c = *p;
+ QCString result;
+ if (c<127 && c>31) // printable ASCII character
{
- int i=0;
- if (startLetter>='0' && startLetter<='9') s[i++] = 'x';
- s[i++]=(char)tolower((char)startLetter);
- s[i++]=0;
+ result+=c;
}
else
{
+ result="0x";
const char hex[]="0123456789abcdef";
- int i=0;
- s[i++]='x';
- if (startLetter>(1<<24)) // 4 byte character
- {
- s[i++]=hex[(startLetter>>28)&0xf];
- s[i++]=hex[(startLetter>>24)&0xf];
- }
- if (startLetter>(1<<16)) // 3 byte character
- {
- s[i++]=hex[(startLetter>>20)&0xf];
- s[i++]=hex[(startLetter>>16)&0xf];
- }
- if (startLetter>(1<<8)) // 2 byte character
+ while ((c=*p++))
{
- s[i++]=hex[(startLetter>>12)&0xf];
- s[i++]=hex[(startLetter>>8)&0xf];
+ result+=hex[((unsigned char)c)>>4];
+ result+=hex[((unsigned char)c)&0xf];
}
- // one byte character
- s[i++]=hex[(startLetter>>4)&0xf];
- s[i++]=hex[(startLetter>>0)&0xf];
- s[i++]=0;
}
- return s;
+ return result;
}
static uint determineSortKey(TemplateStructIntf *s,const QCString &attribName)
{
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:
@@ -1165,49 +1119,51 @@ 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;
TemplateList *result = TemplateList::alloc();
// create list of items based on v using the data in args as a sort key
+ using SortList = std::vector<ListElem>;
SortList sortList;
+ sortList.reserve(v.toList()->count());
for (it->toFirst();(it->current(item));it->toNext())
{
TemplateStructIntf *s = item.toStruct();
if (s)
{
uint sortKey = determineSortKey(s,args.toString());
- sortList.append(new ListElem(sortKey,item));
- //printf("sortKey=%s\n",sortKey.data());
+ sortList.emplace_back(sortKey,item);
+ //printf("sortKey=%s\n",qPrint(sortKey));
}
}
delete it;
// sort the list
- sortList.sort();
+ std::sort(sortList.begin(),
+ sortList.end(),
+ [](const auto &lhs,const auto &rhs) { return lhs.key < rhs.key; });
// create an index from the sorted list
- uint letter=0;
- QListIterator<ListElem> sit(sortList);
- ListElem *elem;
+ QCString letter;
TemplateStruct *indexNode = 0;
TemplateList *indexList = 0;
- for (sit.toFirst();(elem=sit.current());++sit)
+ for (const auto &elem : sortList)
{
- if (letter!=elem->key || indexNode==0)
+ if (letter!=elem.key || indexNode==0)
{
// create new indexNode
indexNode = TemplateStruct::alloc();
indexList = TemplateList::alloc();
- indexNode->set("letter", keyToLetter(elem->key));
- indexNode->set("label", keyToLabel(elem->key));
+ indexNode->set("letter", elem.key);
+ indexNode->set("label", keyToLabel(elem.key));
indexNode->set("items",indexList);
result->append(indexNode);
- letter=elem->key;
+ letter=elem.key;
}
- indexList->append(elem->value);
+ indexList->append(elem.value);
}
return result;
}
@@ -1366,11 +1322,11 @@ class TemplateFilterFactory
TemplateVariant apply(const QCString &name,const TemplateVariant &v,const TemplateVariant &arg, bool &ok)
{
- FilterFunction *func = (FilterFunction*)m_registry.find(name);
- if (func)
+ auto it = m_registry.find(name.str());
+ if (it!=m_registry.end())
{
ok=TRUE;
- return (*func)(v,arg);
+ return it->second(v,arg);
}
else
{
@@ -1381,7 +1337,7 @@ class TemplateFilterFactory
void registerFilter(const QCString &name,FilterFunction *func)
{
- m_registry.insert(name,(void*)func);
+ m_registry.insert(std::make_pair(name.str(),func));
}
/** @brief Helper class for registering a filter function */
@@ -1395,7 +1351,7 @@ class TemplateFilterFactory
};
private:
- QDict<void> m_registry;
+ std::unordered_map<std::string,FilterFunction*> m_registry;
};
// register a handlers for each filter we support
@@ -1434,6 +1390,8 @@ class ExprAst
virtual TemplateVariant resolve(TemplateContext *) { return TemplateVariant(); }
};
+using ExprAstList = std::vector< std::unique_ptr<ExprAst> >;
+
/** @brief Class representing a number in the AST */
class ExprAstNumber : public ExprAst
{
@@ -1450,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)
@@ -1459,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;
}
@@ -1470,10 +1428,9 @@ class ExprAstVariable : public ExprAst
class ExprAstFunctionVariable : public ExprAst
{
public:
- ExprAstFunctionVariable(ExprAst *var,const QList<ExprAst> &args)
- : m_var(var), m_args(args)
+ ExprAstFunctionVariable(ExprAst *var, ExprAstList &&args)
+ : m_var(var), m_args(std::move(args))
{ TRACE(("ExprAstFunctionVariable()\n"));
- m_args.setAutoDelete(TRUE);
}
~ExprAstFunctionVariable()
{
@@ -1482,9 +1439,9 @@ class ExprAstFunctionVariable : public ExprAst
virtual TemplateVariant resolve(TemplateContext *c)
{
std::vector<TemplateVariant> args;
- for (uint i=0;i<m_args.count();i++)
+ for (const auto &exprArg : m_args)
{
- TemplateVariant v = m_args.at(i)->resolve(c);
+ TemplateVariant v = exprArg->resolve(c);
args.push_back(v);
}
TemplateVariant v = m_var->resolve(c);
@@ -1496,14 +1453,14 @@ class ExprAstFunctionVariable : public ExprAst
}
private:
ExprAst *m_var = 0;
- QList<ExprAst> m_args;
+ ExprAstList m_args;
};
/** @brief Class representing a filter in the AST */
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; }
@@ -1511,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;
}
@@ -1548,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); }
@@ -1708,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; }
@@ -1718,25 +1675,59 @@ class TemplateNode
//----------------------------------------------------------
+/** @brief Class representing a lexical token in a template */
+class TemplateToken
+{
+ public:
+ enum Type { Text, Variable, Block };
+ TemplateToken(Type t,const QCString &d,int l) : type(t), data(d), line(l) {}
+ Type type = Text;
+ QCString data;
+ int line = 0;
+};
+
+using TemplateTokenPtr = std::unique_ptr<TemplateToken>;
+using TemplateTokenStream = std::deque< TemplateTokenPtr >;
+
+//----------------------------------------------------------
+
+/** @brief Class representing a list of AST nodes in a template */
+class TemplateNodeList : public std::vector< std::unique_ptr<TemplateNode> >
+{
+ public:
+ void render(TextStream &ts,TemplateContext *c)
+ {
+ TRACE(("{TemplateNodeList::render\n"));
+ for (const auto &tn : *this)
+ {
+ tn->render(ts,c);
+ }
+ TRACE(("}TemplateNodeList::render\n"));
+ }
+};
+
+//----------------------------------------------------------
+
/** @brief Parser for templates */
class TemplateParser
{
public:
TemplateParser(const TemplateEngine *engine,
- const QCString &templateName,QList<TemplateToken> &tokens);
- void parse(TemplateNode *parent,int line,const QStrList &stopAt,
- QList<TemplateNode> &nodes);
+ const QCString &templateName,
+ TemplateTokenStream &tokens);
+ void parse(TemplateNode *parent,int line,const StringVector &stopAt,
+ TemplateNodeList &nodes);
bool hasNextToken() const;
- TemplateToken *takeNextToken();
+ TemplateTokenPtr takeNextToken();
void removeNextToken();
- void prependToken(const TemplateToken *token);
+ 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;
- QList<TemplateToken> &m_tokens;
+ TemplateTokenStream &m_tokens;
};
//--------------------------------------------------------------------
@@ -1754,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();
}
@@ -1998,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"));
@@ -2007,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"));
@@ -2016,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)
{
@@ -2024,17 +2015,15 @@ class ExpressionParser
m_curToken.op==Operator::Colon)
{
getNextToken();
- ExprAst *argExpr = parsePrimaryExpression();
- QList<ExprAst> args;
- args.append(argExpr);
+ ExprAstList args;
+ args.push_back(std::unique_ptr<ExprAst>(parsePrimaryExpression()));
while (m_curToken.type==ExprToken::Operator &&
m_curToken.op==Operator::Comma)
{
getNextToken();
- argExpr = parsePrimaryExpression();
- args.append(argExpr);
+ args.push_back(std::unique_ptr<ExprAst>(parsePrimaryExpression()));
}
- expr = new ExprAstFunctionVariable(expr,args);
+ expr = new ExprAstFunctionVariable(expr,std::move(args));
}
}
TRACE(("}parseIdentifierOptionalArgs()\n"));
@@ -2062,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;
@@ -2273,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;
@@ -2287,42 +2276,6 @@ class ExpressionParser
//----------------------------------------------------------
-/** @brief Class representing a lexical token in a template */
-class TemplateToken
-{
- public:
- enum Type { Text, Variable, Block };
- TemplateToken(Type t,const char *d,int l) : type(t), data(d), line(l) {}
- Type type = Text;
- QCString data;
- int line = 0;
-};
-
-//----------------------------------------------------------
-
-/** @brief Class representing a list of AST nodes in a template */
-class TemplateNodeList : public QList<TemplateNode>
-{
- public:
- TemplateNodeList()
- {
- setAutoDelete(TRUE);
- }
- void render(FTextStream &ts,TemplateContext *c)
- {
- TRACE(("{TemplateNodeList::render\n"));
- QListIterator<TemplateNode> it(*this);
- TemplateNode *tn=0;
- for (it.toFirst();(tn=it.current());++it)
- {
- tn->render(ts,c);
- }
- TRACE(("}TemplateNodeList::render\n"));
- }
-};
-
-//----------------------------------------------------------
-
/** @brief Internal class representing the implementation of a template */
class TemplateImpl : public TemplateNode, public Template
{
@@ -2330,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; }
@@ -2351,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:
@@ -2365,9 +2318,6 @@ TemplateContextImpl::TemplateContextImpl(const TemplateEngine *e)
: m_engine(e), m_templateName("<unknown>"), m_line(1), m_activeEscapeIntf(0),
m_spacelessIntf(0), m_spacelessEnabled(FALSE), m_tabbingEnabled(FALSE), m_indices(TemplateStruct::alloc())
{
- m_indexStacks.setAutoDelete(TRUE);
- m_contextStack.setAutoDelete(TRUE);
- m_escapeIntfDict.setAutoDelete(TRUE);
m_fromUtf8 = (void*)(-1);
push();
set("index",m_indices.get());
@@ -2389,24 +2339,24 @@ 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);
size_t iLeft = iSize;
size_t oLeft = oSize;
- char *iPtr = s.rawData();
+ const char *iPtr = s.data();
char *oPtr = output.rawData();
if (!portable_iconv(m_fromUtf8,&iPtr,&iLeft,&oPtr,&oLeft))
{
@@ -2421,14 +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)
{
- TemplateVariant *pv = m_contextStack.getFirst()->find(name);
- if (pv)
+ auto &ctx = m_contextStack.front();
+ auto it = ctx.find(name.str());
+ if (it!=ctx.end())
{
- m_contextStack.getFirst()->remove(name);
+ ctx.erase(it);
}
- m_contextStack.getFirst()->insert(name,new TemplateVariant(v));
+ ctx.insert(std::make_pair(name.str(),v));
}
TemplateVariant TemplateContextImpl::get(const QCString &name) const
@@ -2445,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(".");
@@ -2453,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)
{
@@ -2477,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)
@@ -2491,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();
}
}
@@ -2501,12 +2452,13 @@ TemplateVariant TemplateContextImpl::get(const QCString &name) const
const TemplateVariant *TemplateContextImpl::getRef(const QCString &name) const
{
- QListIterator< QDict<TemplateVariant> > it(m_contextStack);
- QDict<TemplateVariant> *dict;
- for (it.toFirst();(dict=it.current());++it)
+ for (const auto &ctx : m_contextStack)
{
- TemplateVariant *v = dict->find(name);
- if (v) return v;
+ auto it = ctx.find(name.str());
+ if (it!=ctx.end())
+ {
+ return &it->second;
+ }
}
return 0; // not found
}
@@ -2519,17 +2471,19 @@ TemplateVariant TemplateContextImpl::getPrimary(const QCString &name) const
void TemplateContextImpl::push()
{
- QDict<TemplateVariant> *dict = new QDict<TemplateVariant>;
- dict->setAutoDelete(TRUE);
- m_contextStack.prepend(dict);
+ m_contextStack.push_front(std::map<std::string,TemplateVariant>());
}
void TemplateContextImpl::pop()
{
- if (!m_contextStack.removeFirst())
+ if (m_contextStack.empty())
{
warn(m_templateName,m_line,"pop() called on empty context stack!\n");
}
+ else
+ {
+ m_contextStack.pop_front();
+ }
}
TemplateBlockContext *TemplateContextImpl::blockContext()
@@ -2537,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);
@@ -2548,20 +2502,21 @@ void TemplateContextImpl::warn(const char *fileName,int line,const char *fmt,...
void TemplateContextImpl::openSubIndex(const QCString &indexName)
{
- //printf("TemplateContextImpl::openSubIndex(%s)\n",indexName.data());
- QStack<TemplateVariant> *stack = m_indexStacks.find(indexName);
- if (!stack || stack->isEmpty() || stack->top()->type()==TemplateVariant::List) // error: no stack yet or no entry
+ //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
- TemplateStruct *entry = dynamic_cast<TemplateStruct*>(stack->top()->toStruct());
+ auto &stack = kv->second;
+ TemplateStruct *entry = dynamic_cast<TemplateStruct*>(stack.top().toStruct());
if (entry)
{
// add new list to the stack
TemplateList *list = TemplateList::alloc();
- stack->push(new TemplateVariant(list));
+ stack.emplace(list);
entry->set("children",list);
entry->set("is_leaf_node",false);
}
@@ -2569,30 +2524,31 @@ void TemplateContextImpl::openSubIndex(const QCString &indexName)
void TemplateContextImpl::closeSubIndex(const QCString &indexName)
{
- //printf("TemplateContextImpl::closeSubIndex(%s)\n",indexName.data());
- QStack<TemplateVariant> *stack = m_indexStacks.find(indexName);
- if (!stack || stack->count()<3)
+ //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 // stack->count()>=2
+ else
{
- if (stack->top()->type()==TemplateVariant::Struct)
+ auto &stack = kv->second; // stack.size()>2
+ if (stack.top().type()==TemplateVariant::Struct)
{
- delete stack->pop(); // pop struct
- delete stack->pop(); // pop list
+ stack.pop(); // pop struct
+ stack.pop(); // pop list
}
else // empty list! correct "is_left_node" attribute of the parent entry
{
- delete stack->pop(); // pop list
- TemplateStruct *entry = dynamic_cast<TemplateStruct*>(stack->top()->toStruct());
+ stack.pop(); // pop list
+ TemplateStruct *entry = dynamic_cast<TemplateStruct*>(stack.top().toStruct());
if (entry)
{
entry->set("is_leaf_node",true);
}
}
}
- //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)
@@ -2616,49 +2572,49 @@ 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());
// ++it;
//}
TemplateVariant parent(FALSE);
- QStack<TemplateVariant> *stack = m_indexStacks.find(indexName);
- if (!stack) // no stack yet, create it!
+ auto kv = m_indexStacks.find(indexName.str());
+ if (kv==m_indexStacks.end()) // no stack yet, create it!
{
- stack = new QStack<TemplateVariant>;
- stack->setAutoDelete(TRUE);
- m_indexStacks.insert(indexName,stack);
+ kv = m_indexStacks.insert(std::make_pair(indexName.str(),std::stack<TemplateVariant>())).first;
}
TemplateList *list = 0;
- if (stack->isEmpty()) // first item, create empty list and add it to the index
+ auto &stack = kv->second;
+ if (stack.empty()) // first item, create empty list and add it to the index
{
list = TemplateList::alloc();
- stack->push(new TemplateVariant(list));
+ stack.emplace(list);
m_indices->set(indexName,list); // make list available under index
}
else // stack not empty
{
- if (stack->top()->type()==TemplateVariant::Struct) // already an entry in the list
+ if (stack.top().type()==TemplateVariant::Struct) // already an entry in the list
{
// remove current entry from the stack
- delete stack->pop();
+ stack.pop();
}
else // first entry after opensubindex
{
- ASSERT(stack->top()->type()==TemplateVariant::List);
+ ASSERT(stack.top().type()==TemplateVariant::List);
}
- if (stack->count()>1)
+ if (stack.size()>1)
{
- TemplateVariant *tmp = stack->pop();
+ TemplateVariant tmp = stack.top();
+ stack.pop();
// To prevent a cyclic dependency between parent and child which causes a memory
// leak, we wrap the parent into a weak reference version.
- parent = new TemplateStructWeakRef(stack->top()->toStruct());
- stack->push(tmp);
+ parent = new TemplateStructWeakRef(stack.top().toStruct());
+ stack.push(tmp);
ASSERT(parent.type()==TemplateVariant::Struct);
}
// get list to add new item
- list = dynamic_cast<TemplateList*>(stack->top()->toList());
+ list = dynamic_cast<TemplateList*>(stack.top().toList());
}
TemplateStruct *entry = TemplateStruct::alloc();
// add user specified fields to the entry
@@ -2680,7 +2636,7 @@ void TemplateContextImpl::addIndexEntry(const QCString &indexName,const std::vec
entry->set("parent",parent);
entry->set("path",TemplateVariant::Delegate::fromFunction(entry,getPathFunc));
entry->set("last",true);
- stack->push(new TemplateVariant(entry));
+ stack.emplace(entry);
list->append(entry);
}
@@ -2696,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())
@@ -2737,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()
@@ -2750,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
@@ -2791,7 +2747,6 @@ class TemplateNodeVariable : public TemplateNode
QCString m_templateName;
int m_line = 0;
ExprAst *m_var = 0;
- QList<ExprAst> m_args;
};
//----------------------------------------------------------
@@ -2821,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);
@@ -2869,67 +2823,59 @@ class TemplateNodeIf : public TemplateNodeCreator<TemplateNodeIf>
TemplateNodeIf(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data) :
TemplateNodeCreator<TemplateNodeIf>(parser,parent,line)
{
- m_ifGuardedNodes.setAutoDelete(TRUE);
- 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");
}
- QStrList stopAt;
- stopAt.append("endif");
- stopAt.append("elif");
- stopAt.append("else");
+ StringVector stopAt = { "endif", "elif", "else" };
// if 'nodes'
{
- GuardedNodes *guardedNodes = new GuardedNodes;
+ m_ifGuardedNodes.push_back(std::make_unique<GuardedNodes>());
+ auto &guardedNodes = m_ifGuardedNodes.back();
ExpressionParser ex(parser,line);
guardedNodes->line = line;
guardedNodes->guardAst = ex.parse(data);
parser->parse(this,line,stopAt,guardedNodes->trueNodes);
- m_ifGuardedNodes.append(guardedNodes);
}
- TemplateToken *tok = parser->takeNextToken();
+ auto tok = parser->takeNextToken();
// elif 'nodes'
while (tok && tok->data.left(5)=="elif ")
{
+ m_ifGuardedNodes.push_back(std::make_unique<GuardedNodes>());
+ auto &guardedNodes = m_ifGuardedNodes.back();
ExpressionParser ex(parser,line);
- GuardedNodes *guardedNodes = new GuardedNodes;
guardedNodes->line = tok->line;
guardedNodes->guardAst = ex.parse(tok->data.mid(5));
parser->parse(this,tok->line,stopAt,guardedNodes->trueNodes);
- m_ifGuardedNodes.append(guardedNodes);
// proceed to the next token
- delete tok;
tok = parser->takeNextToken();
}
// else 'nodes'
if (tok && tok->data=="else")
{
- stopAt.removeLast(); // remove "else"
- stopAt.removeLast(); // remove "elif"
+ stopAt.pop_back(); // remove "else"
+ stopAt.pop_back(); // remove "elif"
parser->parse(this,line,stopAt,m_falseNodes);
parser->removeNextToken(); // skip over endif
}
- delete tok;
- 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
ci->setLocation(m_templateName,m_line);
//printf("TemplateNodeIf::render #trueNodes=%d #falseNodes=%d\n",m_trueNodes.count(),m_falseNodes.count());
bool processed=FALSE;
- QListIterator<GuardedNodes> li(m_ifGuardedNodes);
- GuardedNodes *nodes;
- for (li.toFirst();(nodes=li.current()) && !processed;++li)
+ for (auto &nodes : m_ifGuardedNodes)
{
if (nodes->guardAst)
{
@@ -2938,6 +2884,7 @@ class TemplateNodeIf : public TemplateNodeCreator<TemplateNodeIf>
{
nodes->trueNodes.render(ts,c);
processed=TRUE;
+ break;
}
}
else
@@ -2960,7 +2907,7 @@ class TemplateNodeIf : public TemplateNodeCreator<TemplateNodeIf>
ExprAst *guardAst = 0;
TemplateNodeList trueNodes;
};
- QList<GuardedNodes> m_ifGuardedNodes;
+ std::vector< std::unique_ptr<GuardedNodes> > m_ifGuardedNodes;
TemplateNodeList m_falseNodes;
};
@@ -2972,20 +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);
- QStrList stopAt;
- stopAt.append("endrepeat");
+ 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
@@ -3027,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 ");
@@ -3085,11 +3031,10 @@ class TemplateNodeRange : public TemplateNodeCreator<TemplateNodeRange>
m_startExpr = expParser.parse(start);
m_endExpr = expParser.parse(end);
- QStrList stopAt;
- stopAt.append("endrange");
+ 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()
@@ -3098,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
@@ -3197,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)
@@ -3239,19 +3184,16 @@ class TemplateNodeFor : public TemplateNodeCreator<TemplateNodeFor>
ExpressionParser expParser(parser,line);
m_expr = expParser.parse(exprStr);
- QStrList stopAt;
- stopAt.append("endfor");
- stopAt.append("empty");
+ StringVector stopAt = { "endfor", "empty" };
parser->parse(this,line,stopAt,m_loopNodes);
- TemplateToken *tok = parser->takeNextToken();
+ auto tok = parser->takeNextToken();
if (tok && tok->data=="empty")
{
- stopAt.removeLast();
+ stopAt.pop_back();
parser->parse(this,line,stopAt,m_emptyNodes);
parser->removeNextToken(); // skip over endfor
}
- delete tok;
- TRACE(("}TemplateNodeFor(%s)\n",data.data()));
+ TRACE(("}TemplateNodeFor(%s)\n",qPrint(data)));
}
~TemplateNodeFor()
@@ -3259,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
@@ -3333,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()));
}
}
}
@@ -3356,13 +3298,12 @@ class TemplateNodeMsg : public TemplateNodeCreator<TemplateNodeMsg>
: TemplateNodeCreator<TemplateNodeMsg>(parser,parent,line)
{
TRACE(("{TemplateNodeMsg()\n"));
- QStrList stopAt;
- stopAt.append("endmsg");
+ StringVector stopAt = { "endmsg" };
parser->parse(this,line,stopAt,m_nodes);
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
@@ -3371,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);
}
@@ -3391,20 +3333,19 @@ 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())
{
parser->warn(parser->templateName(),line,"block tag without name");
}
- QStrList stopAt;
- stopAt.append("endblock");
+ 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
@@ -3417,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
@@ -3429,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));
@@ -3469,23 +3410,23 @@ 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())
{
parser->warn(m_templateName,line,"extend tag is missing template file argument");
}
m_extendExpr = ep.parse(data);
- QStrList stopAt;
+ 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
@@ -3510,16 +3451,14 @@ class TemplateNodeExtend : public TemplateNodeCreator<TemplateNodeExtend>
TemplateBlockContext *bc = ci->blockContext();
// add overruling blocks to the context
- QListIterator<TemplateNode> li(m_nodes);
- TemplateNode *n;
- for (li.toFirst();(n=li.current());++li)
+ for (const auto &n : m_nodes)
{
- TemplateNodeBlock *nb = dynamic_cast<TemplateNodeBlock*>(n);
+ TemplateNodeBlock *nb = dynamic_cast<TemplateNodeBlock*>(n.get());
if (nb)
{
bc->add(nb);
}
- TemplateNodeMsg *msg = dynamic_cast<TemplateNodeMsg*>(n);
+ TemplateNodeMsg *msg = dynamic_cast<TemplateNodeMsg*>(n.get());
if (msg)
{
msg->render(ts,c);
@@ -3535,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));
}
}
}
@@ -3552,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())
{
@@ -3564,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
@@ -3590,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));
}
}
}
@@ -3603,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++))
@@ -3618,6 +3557,7 @@ static void stripLeadingWhiteSpace(QGString &s)
else { *dst++=c; skipSpaces=FALSE; }
}
*dst='\0';
+ s.resize( (int)(dst - src) + 1 );
}
}
@@ -3628,7 +3568,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");
@@ -3661,7 +3601,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
@@ -3694,21 +3634,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);
@@ -3716,12 +3656,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("");
}
@@ -3751,18 +3691,17 @@ 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())
{
parser->warn(m_templateName,line,"recursetree tag is missing data argument");
}
m_treeExpr = ep.parse(data);
- QStrList stopAt;
- stopAt.append("endrecursetree");
+ 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()
{
@@ -3780,8 +3719,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();
@@ -3807,7 +3745,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
@@ -3823,9 +3761,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);
@@ -3856,17 +3794,15 @@ class TemplateNodeIndexEntry : public TemplateNodeCreator<TemplateNodeIndexEntry
{
struct Mapping
{
- Mapping(const QCString &n,ExprAst *e) : name(n), value(e) {}
- ~Mapping() { delete value; }
+ Mapping(const QCString &n,std::unique_ptr<ExprAst> &&e) : name(n), value(std::move(e)) {}
QCString name;
- ExprAst *value = 0;
+ std::unique_ptr<ExprAst> value = 0;
};
public:
TemplateNodeIndexEntry(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeIndexEntry>(parser,parent,line)
{
- TRACE(("{TemplateNodeIndexEntry(%s)\n",data.data()));
- m_args.setAutoDelete(TRUE);
+ TRACE(("{TemplateNodeIndexEntry(%s)\n",qPrint(data)));
ExpressionParser expParser(parser,line);
std::vector<QCString> args = split(data," ");
auto it = args.begin();
@@ -3887,38 +3823,36 @@ class TemplateNodeIndexEntry : public TemplateNodeCreator<TemplateNodeIndexEntry
ExprAst *expr = expParser.parse(arg.mid(j+1));
if (expr)
{
- m_args.append(new Mapping(arg.left(j),expr));
+ m_args.emplace_back(arg.left(j),std::unique_ptr<ExprAst>(expr));
}
}
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
if (!m_name.isEmpty())
{
ci->setLocation(m_templateName,m_line);
- QListIterator<Mapping> it(m_args);
- Mapping *mapping;
std::vector<TemplateKeyValue> list;
- for (it.toFirst();(mapping=it.current());++it)
+ for (const auto &mapping : m_args)
{
- list.push_back(TemplateKeyValue(mapping->name,mapping->value->resolve(c)));
+ list.emplace_back(mapping.name,mapping.value->resolve(c));
}
ci->addIndexEntry(m_name,list);
}
}
private:
QCString m_name;
- QList<Mapping> m_args;
+ std::vector<Mapping> m_args;
};
//----------------------------------------------------------
@@ -3930,7 +3864,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())
{
@@ -3938,12 +3872,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
@@ -3966,7 +3900,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())
{
@@ -3974,12 +3908,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
@@ -4001,17 +3935,15 @@ class TemplateNodeWith : public TemplateNodeCreator<TemplateNodeWith>
{
struct Mapping
{
- Mapping(const QCString &n,ExprAst *e) : name(n), value(e) {}
- ~Mapping() { delete value; }
+ Mapping(const QCString &n,std::unique_ptr<ExprAst> &&e) : name(n), value(std::move(e)) {}
QCString name;
- ExprAst *value;
+ std::unique_ptr<ExprAst> value;
};
public:
TemplateNodeWith(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
: TemplateNodeCreator<TemplateNodeWith>(parser,parent,line)
{
- TRACE(("{TemplateNodeWith(%s)\n",data.data()));
- m_args.setAutoDelete(TRUE);
+ TRACE(("{TemplateNodeWith(%s)\n",qPrint(data)));
ExpressionParser expParser(parser,line);
QCString filteredData = removeSpacesAroundEquals(data);
std::vector<QCString> args = split(filteredData," ");
@@ -4025,43 +3957,40 @@ class TemplateNodeWith : public TemplateNodeCreator<TemplateNodeWith>
ExprAst *expr = expParser.parse(arg.mid(j+1));
if (expr)
{
- m_args.append(new Mapping(arg.left(j),expr));
+ m_args.emplace_back(arg.left(j),std::unique_ptr<ExprAst>(expr));
}
}
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;
}
- QStrList stopAt;
- stopAt.append("endwith");
+ 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
ci->setLocation(m_templateName,m_line);
c->push();
- QListIterator<Mapping> it(m_args);
- Mapping *mapping;
- for (it.toFirst();(mapping=it.current());++it)
+ for (const auto &mapping : m_args)
{
- TemplateVariant value = mapping->value->resolve(c);
- ci->set(mapping->name,value);
+ TemplateVariant value = mapping.value->resolve(c);
+ ci->set(mapping.name,value);
}
m_nodes.render(ts,c);
c->pop();
}
private:
TemplateNodeList m_nodes;
- QList<Mapping> m_args;
+ std::vector<Mapping> m_args;
};
//----------------------------------------------------------
@@ -4073,8 +4002,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()));
- m_args.setAutoDelete(TRUE);
+ TRACE(("{TemplateNodeCycle(%s)\n",qPrint(data)));
m_index=0;
ExpressionParser expParser(parser,line);
std::vector<QCString> args = split(data," ");
@@ -4084,23 +4012,24 @@ class TemplateNodeCycle : public TemplateNodeCreator<TemplateNodeCycle>
ExprAst *expr = expParser.parse(*it);
if (expr)
{
- m_args.append(expr);
+ m_args.push_back(std::unique_ptr<ExprAst>(expr));
}
++it;
}
- if (m_args.count()<2)
+ if (m_args.size()<2)
{
- parser->warn(parser->templateName(),line,"expected at least two arguments for cycle command, got %d",m_args.count());
+ 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.count())
+ if (m_index<m_args.size())
{
- TemplateVariant v = m_args.at(m_index)->resolve(c);
+ TemplateVariant v = m_args[m_index]->resolve(c);
if (v.type()==TemplateVariant::Function)
{
v = v.call(std::vector<TemplateVariant>());
@@ -4128,14 +4057,14 @@ class TemplateNodeCycle : public TemplateNodeCreator<TemplateNodeCycle>
}
}
}
- if (++m_index==m_args.count()) // wrap around
+ if (++m_index==m_args.size()) // wrap around
{
m_index=0;
}
}
private:
- uint m_index = 0;
- QList<ExprAst> m_args;
+ size_t m_index = 0;
+ ExprAstList m_args;
};
//----------------------------------------------------------
@@ -4146,30 +4075,29 @@ class TemplateNodeSet : public TemplateNodeCreator<TemplateNodeSet>
struct Mapping
{
Mapping(const QCString &n,ExprAst *e) : name(n), value(e) {}
- ~Mapping() { delete value; }
+ ~Mapping() { }
QCString name;
ExprAst *value = 0;
};
public:
TemplateNodeSet(TemplateParser *parser,TemplateNode *parent,int line,const QCString &data)
- : TemplateNodeCreator<TemplateNodeSet>(parser,parent,line), m_mapping(0)
+ : 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('=');
ExprAst *expr = 0;
if (j>0 && (expr = expParser.parse(data.mid(j+1))))
{
- m_mapping = new Mapping(data.left(j),expr);
+ m_mapping = std::make_unique<Mapping>(data.left(j),expr);
}
- TRACE(("}TemplateNodeSet(%s)\n",data.data()));
+ TRACE(("}TemplateNodeSet(%s)\n",qPrint(data)));
}
~TemplateNodeSet()
{
- delete m_mapping;
}
- void render(FTextStream &, TemplateContext *c)
+ void render(TextStream &, TemplateContext *c)
{
TemplateContextImpl *ci = dynamic_cast<TemplateContextImpl*>(c);
if (ci==0) return; // should not happen
@@ -4181,7 +4109,7 @@ class TemplateNodeSet : public TemplateNodeCreator<TemplateNodeSet>
}
}
private:
- Mapping *m_mapping = 0;
+ std::unique_ptr<Mapping> m_mapping;
};
//----------------------------------------------------------
@@ -4194,13 +4122,12 @@ class TemplateNodeSpaceless : public TemplateNodeCreator<TemplateNodeSpaceless>
: TemplateNodeCreator<TemplateNodeSpaceless>(parser,parent,line)
{
TRACE(("{TemplateNodeSpaceless()\n"));
- QStrList stopAt;
- stopAt.append("endspaceless");
+ StringVector stopAt = { "endspaceless" };
parser->parse(this,line,stopAt,m_nodes);
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
@@ -4223,7 +4150,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)
@@ -4237,18 +4164,17 @@ class TemplateNodeMarkers : public TemplateNodeCreator<TemplateNodeMarkers>
m_listExpr = expParser.parse(data.mid(i+4,w-i-4));
m_patternExpr = expParser.parse(data.right(data.length()-w-6));
}
- QStrList stopAt;
- stopAt.append("endmarkers");
+ 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
@@ -4264,26 +4190,32 @@ class TemplateNodeMarkers : public TemplateNodeCreator<TemplateNodeMarkers>
{
TemplateListIntf::ConstIterator *it = list->createIterator();
c->push();
- QCString str = patternStr.toString();
- QRegExp marker("@[0-9]+"); // pattern for a marker, i.e. @0, @1 ... @12, etc
- int index=0,newIndex,matchLen;
- while ((newIndex=marker.match(str,index,&matchLen))!=-1)
+ std::string str = patternStr.toString().str();
+
+ static const reg::Ex marker(R"(@\d+)");
+ reg::Iterator re_it(str,marker);
+ reg::Iterator end;
+ size_t index=0;
+ for ( ; re_it!=end ; ++re_it)
{
+ const auto &match = *re_it;
+ size_t newIndex = match.position();
+ size_t matchLen = match.length();
+ std::string part = str.substr(index,newIndex-index);
if (ci->needsRecoding())
{
- ts << ci->recode(str.mid(index,newIndex-index)); // write text before marker
+ ts << ci->recode(QCString(part)); // write text before marker
}
else
{
- ts << str.mid(index,newIndex-index); // write text before marker
+ ts << part; // write text before marker
}
- bool ok;
- uint entryIndex = str.mid(newIndex+1,matchLen-1).toUInt(&ok); // get marker id
+ unsigned long entryIndex = std::stoul(match.str().substr(1));
TemplateVariant var;
- uint i=0;
+ size_t i=0;
// search for list element at position id
for (it->toFirst(); (it->current(var)) && i<entryIndex; it->toNext(),i++) {}
- if (ok && i==entryIndex) // found element
+ if (i==entryIndex) // found element
{
TemplateAutoRef<TemplateStruct> s(TemplateStruct::alloc());
s->set("id",(int)i);
@@ -4294,10 +4226,6 @@ class TemplateNodeMarkers : public TemplateNodeCreator<TemplateNodeMarkers>
m_nodes.render(ts,c);
ci->enableSpaceless(wasSpaceless);
}
- else if (!ok)
- {
- ci->warn(m_templateName,m_line,"markers pattern string has invalid markers '%s'",str.data());
- }
else if (i<entryIndex)
{
ci->warn(m_templateName,m_line,"markers list does not an element for marker position %d",i);
@@ -4306,11 +4234,11 @@ class TemplateNodeMarkers : public TemplateNodeCreator<TemplateNodeMarkers>
}
if (ci->needsRecoding())
{
- ts << ci->recode(str.right(str.length()-index)); // write text after last marker
+ ts << ci->recode(str.substr(index)); // write text after last marker
}
else
{
- ts << str.right(str.length()-index); // write text after last marker
+ ts << str.substr(index); // write text after last marker
}
c->pop();
delete it;
@@ -4343,13 +4271,12 @@ class TemplateNodeTabbing : public TemplateNodeCreator<TemplateNodeTabbing>
: TemplateNodeCreator<TemplateNodeTabbing>(parser,parent,line)
{
TRACE(("{TemplateNodeTabbing()\n"));
- QStrList stopAt;
- stopAt.append("endtabbing");
+ StringVector stopAt = { "endtabbing" };
parser->parse(this,line,stopAt,m_nodes);
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
@@ -4372,7 +4299,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())
@@ -4391,14 +4318,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
@@ -4416,7 +4343,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");
}
@@ -4446,7 +4373,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())
{
@@ -4457,17 +4384,16 @@ class TemplateNodeEncoding : public TemplateNodeCreator<TemplateNodeEncoding>
{
m_encExpr = ep.parse(data);
}
- QStrList stopAt;
- stopAt.append("endencoding");
+ 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
@@ -4514,13 +4440,14 @@ class TemplateNodeFactory
int line,
const QCString &data)
{
- if (m_registry.find(name)==0) return 0;
- return ((CreateFunc)m_registry[name])(parser,parent,line,data);
+ auto it = m_registry.find(name.str());
+ if (it==m_registry.end()) return 0;
+ return it->second(parser,parent,line,data);
}
void registerTemplateNode(const QCString &name,CreateFunc func)
{
- m_registry.insert(name,(void*)func);
+ m_registry.insert(std::make_pair(name.str(),func));
}
/** @brief Helper class for registering a template AST node */
@@ -4534,7 +4461,7 @@ class TemplateNodeFactory
};
private:
- QDict<void> m_registry;
+ std::unordered_map<std::string,CreateFunc> m_registry;
};
// register a handler for each start tag we support
@@ -4562,57 +4489,53 @@ static TemplateNodeFactory::AutoRegister<TemplateNodeCloseSubIndex> autoRefClose
//----------------------------------------------------------
-TemplateBlockContext::TemplateBlockContext() : m_blocks(257)
+TemplateBlockContext::TemplateBlockContext()
{
- m_blocks.setAutoDelete(TRUE);
}
TemplateNodeBlock *TemplateBlockContext::get(const QCString &name) const
{
- QList<TemplateNodeBlock> *list = m_blocks.find(name);
- if (list==0 || list->count()==0)
+ auto it = m_blocks.find(name.str());
+ if (it==m_blocks.end() || it->second.empty())
{
return 0;
}
else
{
- return list->getLast();
+ return it->second.back();
}
}
-TemplateNodeBlock *TemplateBlockContext::pop(const QCString &name) const
+TemplateNodeBlock *TemplateBlockContext::pop(const QCString &name)
{
- QList<TemplateNodeBlock> *list = m_blocks.find(name);
- if (list==0 || list->count()==0)
+ auto it = m_blocks.find(name.str());
+ if (it==m_blocks.end() || it->second.empty())
{
return 0;
}
else
{
- return list->take(list->count()-1);
+ TemplateNodeBlock *bld = it->second.back();
+ it->second.pop_back();
+ return bld;
}
}
void TemplateBlockContext::add(TemplateNodeBlock *block)
{
- QList<TemplateNodeBlock> *list = m_blocks.find(block->name());
- if (list==0)
+ auto it = m_blocks.find(block->name().str());
+ if (it==m_blocks.end())
{
- list = new QList<TemplateNodeBlock>;
- m_blocks.insert(block->name(),list);
+ it = m_blocks.insert(std::make_pair(block->name().str(),NodeBlockList())).first;
}
- list->prepend(block);
+ it->second.push_front(block);
}
void TemplateBlockContext::add(TemplateBlockContext *ctx)
{
- QDictIterator< QList<TemplateNodeBlock> > di(ctx->m_blocks);
- QList<TemplateNodeBlock> *list;
- for (di.toFirst();(list=di.current());++di)
+ for (auto &kv : ctx->m_blocks)
{
- QListIterator<TemplateNodeBlock> li(*list);
- TemplateNodeBlock *nb;
- for (li.toFirst();(nb=li.current());++li)
+ for (auto &nb : kv.second)
{
add(nb);
}
@@ -4626,13 +4549,12 @@ void TemplateBlockContext::clear()
void TemplateBlockContext::push(TemplateNodeBlock *block)
{
- QList<TemplateNodeBlock> *list = m_blocks.find(block->name());
- if (list==0)
+ auto it = m_blocks.find(block->name().str());
+ if (it==m_blocks.end())
{
- list = new QList<TemplateNodeBlock>;
- m_blocks.insert(block->name(),list);
+ it = m_blocks.insert(std::make_pair(block->name().str(),NodeBlockList())).first;
}
- list->append(block);
+ it->second.push_back(block);
}
@@ -4643,12 +4565,12 @@ class TemplateLexer
{
public:
TemplateLexer(const TemplateEngine *engine,const QCString &fileName,const QCString &data);
- void tokenize(QList<TemplateToken> &tokens);
+ void tokenize(TemplateTokenStream &tokens);
void setOpenCloseCharacters(char openChar,char closeChar)
{ m_openChar=openChar; m_closeChar=closeChar; }
private:
- void addToken(QList<TemplateToken> &tokens,
- const char *data,int line,int startPos,int endPos,
+ void addToken(TemplateTokenStream &tokens,
+ const QCString &data,int line,int startPos,int endPos,
TemplateToken::Type type);
void reset();
const TemplateEngine *m_engine = 0;
@@ -4665,7 +4587,7 @@ TemplateLexer::TemplateLexer(const TemplateEngine *engine,const QCString &fileNa
m_closeChar='}';
}
-void TemplateLexer::tokenize(QList<TemplateToken> &tokens)
+void TemplateLexer::tokenize(TemplateTokenStream &tokens)
{
enum LexerStates
{
@@ -4680,8 +4602,8 @@ void TemplateLexer::tokenize(QList<TemplateToken> &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;
@@ -4748,10 +4670,10 @@ void TemplateLexer::tokenize(QList<TemplateToken> &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;
}
@@ -4781,7 +4703,7 @@ void TemplateLexer::tokenize(QList<TemplateToken> &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;
@@ -4829,10 +4751,10 @@ void TemplateLexer::tokenize(QList<TemplateToken> &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;
}
@@ -4862,24 +4784,23 @@ void TemplateLexer::tokenize(QList<TemplateToken> &tokens)
}
if (lastTokenPos<pos)
{
- addToken(tokens,m_data.data(),line,
+ addToken(tokens,m_data,line,
lastTokenPos,pos,
TemplateToken::Text);
}
}
-void TemplateLexer::addToken(QList<TemplateToken> &tokens,
- const char *data,int line,
+void TemplateLexer::addToken(TemplateTokenStream &tokens,
+ 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.append(new TemplateToken(type,text,line));
+ tokens.push_back(std::make_unique<TemplateToken>(type,text,line));
}
}
@@ -4887,29 +4808,29 @@ void TemplateLexer::addToken(QList<TemplateToken> &tokens,
TemplateParser::TemplateParser(const TemplateEngine *engine,
const QCString &templateName,
- QList<TemplateToken> &tokens) :
+ TemplateTokenStream &tokens) :
m_engine(engine), m_templateName(templateName), m_tokens(tokens)
{
}
void TemplateParser::parse(
- TemplateNode *parent,int line,const QStrList &stopAt,
- QList<TemplateNode> &nodes)
+ TemplateNode *parent,int line,const StringVector &stopAt,
+ TemplateNodeList &nodes)
{
TRACE(("{TemplateParser::parse\n"));
// process the tokens. Build node list
while (hasNextToken())
{
- TemplateToken *tok = takeNextToken();
+ 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:
- nodes.append(new TemplateNodeText(this,parent,tok->line,tok->data));
+ nodes.push_back(std::make_unique<TemplateNodeText>(this,parent,tok->line,tok->data));
break;
case TemplateToken::Variable: // {{ var }}
- nodes.append(new TemplateNodeVariable(this,parent,tok->line,tok->data));
+ nodes.push_back(std::make_unique<TemplateNodeVariable>(this,parent,tok->line,tok->data));
break;
case TemplateToken::Block: // {% tag %}
{
@@ -4919,22 +4840,23 @@ void TemplateParser::parse(
{
command=command.left(sep);
}
- if (stopAt.contains(command))
+ TemplateToken *tok_ptr = tok.get();
+ if (std::find(stopAt.begin(),stopAt.end(),command.str())!=stopAt.end())
{
- prependToken(tok);
+ prependToken(std::move(tok));
TRACE(("}TemplateParser::parse: stop\n"));
return;
}
QCString arg;
if (sep!=-1)
{
- arg = tok->data.mid(sep+1);
+ arg = tok_ptr->data.mid(sep+1);
}
- TemplateNode *node = TemplateNodeFactory::instance()->
- create(command,this,parent,tok->line,arg);
+ std::unique_ptr<TemplateNode> node { TemplateNodeFactory::instance()->
+ create(command,this,parent,tok_ptr->line,arg) };
if (node)
{
- nodes.append(node);
+ nodes.push_back(std::move(node));
}
else if (command=="empty" || command=="else" ||
command=="endif" || command=="endfor" ||
@@ -4945,59 +4867,59 @@ void TemplateParser::parse(
command=="endrange" || command=="endtabbing" ||
command=="endencoding")
{
- warn(m_templateName,tok->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->line,"Unknown tag '%s'",command.data());
+ warn(m_templateName,tok_ptr->line,"Unknown tag '%s'",qPrint(command));
}
}
break;
}
- delete tok;
}
- if (!stopAt.isEmpty())
+ if (!stopAt.empty())
{
- QStrListIterator it(stopAt);
- const char *s;
QCString options;
- for (it.toFirst();(s=it.current());++it)
+ for (const auto &s : stopAt)
{
if (!options.isEmpty()) options+=", ";
- options+=s;
+ 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"));
}
bool TemplateParser::hasNextToken() const
{
- return !m_tokens.isEmpty();
+ return !m_tokens.empty();
}
-TemplateToken *TemplateParser::takeNextToken()
+TemplateTokenPtr TemplateParser::takeNextToken()
{
- return m_tokens.take(0);
+ if (m_tokens.empty()) return TemplateTokenPtr();
+ auto tok = std::move(m_tokens.front());
+ m_tokens.pop_front();
+ return tok;
}
const TemplateToken *TemplateParser::currentToken() const
{
- return m_tokens.getFirst();
+ return m_tokens.front().get();
}
void TemplateParser::removeNextToken()
{
- m_tokens.removeFirst();
+ m_tokens.pop_front();
}
-void TemplateParser::prependToken(const TemplateToken *token)
+void TemplateParser::prependToken(TemplateTokenPtr &&token)
{
- m_tokens.prepend(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);
@@ -5022,33 +4944,30 @@ TemplateImpl::TemplateImpl(TemplateEngine *engine,const QCString &name,const QCS
{
lexer.setOpenCloseCharacters('<','>');
}
- QList<TemplateToken> tokens;
- tokens.setAutoDelete(TRUE);
+ TemplateTokenStream tokens;
lexer.tokenize(tokens);
TemplateParser parser(engine,name,tokens);
- parser.parse(this,1,QStrList(),m_nodes);
+ parser.parse(this,1,StringVector(),m_nodes);
}
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
- if (!m_nodes.isEmpty())
+ if (!m_nodes.empty())
{
- TemplateNodeExtend *ne = dynamic_cast<TemplateNodeExtend*>(m_nodes.getFirst());
+ TemplateNodeExtend *ne = dynamic_cast<TemplateNodeExtend*>(m_nodes.front().get());
if (ne==0) // normal template, add blocks to block context
{
TemplateBlockContext *bc = ci->blockContext();
- QListIterator<TemplateNode> li(m_nodes);
- TemplateNode *n;
- for (li.toFirst();(n=li.current());++li)
+ for (const auto &n : m_nodes)
{
- TemplateNodeBlock *nb = dynamic_cast<TemplateNodeBlock*>(n);
+ TemplateNodeBlock *nb = dynamic_cast<TemplateNodeBlock*>(n.get());
if (nb)
{
bc->add(nb);
@@ -5082,63 +5001,66 @@ class TemplateEngine::Private
int m_line = 0;
};
public:
- Private(TemplateEngine *engine) : m_templateCache(17) /*, m_indent(0)*/, m_engine(engine)
+ Private(TemplateEngine *engine) : m_engine(engine)
{
- m_templateCache.setAutoDelete(TRUE);
- m_includeStack.setAutoDelete(TRUE);
}
Template *loadByName(const QCString &fileName,int line)
{
//for (int i=0;i<m_indent;i++) printf(" ");
//m_indent++;
- //printf("loadByName(%s,%d) {\n",fileName.data(),line);
- m_includeStack.append(new IncludeEntry(IncludeEntry::Template,fileName,QCString(),line));
- Template *templ = m_templateCache.find(fileName);
- if (templ==0) // first time template is referenced
+ //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))
- {
- QFileInfo fi(filePath);
- int size=fi.size();
- QCString data(size+1);
- if (f.readBlock(data.rawData(),size)==size)
- {
- templ = new TemplateImpl(m_engine,filePath,data,m_extension);
- m_templateCache.insert(fileName,templ);
- return templ;
- }
- }
- // fallback to default built-in template
- const QCString data = ResourceMgr::instance().getAsString(fileName);
- if (!data.isEmpty())
- {
- templ = new TemplateImpl(m_engine,fileName,data,m_extension);
- m_templateCache.insert(fileName,templ);
+ std::ifstream f(filePath.str(),std::ifstream::in | std::ifstream::binary);
+ if (f.is_open()) // read template from disk
+ {
+ FileInfo fi(filePath.str());
+ int size=(int)fi.size();
+ QCString data(size+1);
+ f.read(data.rawData(),size);
+ if (!f.fail())
+ {
+ kv = m_templateCache.insert(
+ std::make_pair(fileName.str(),
+ std::make_unique<TemplateImpl>(m_engine,filePath,data,m_extension))).first;
+ }
}
- else
+ else // fallback to default built-in template
{
- err("Could not open template file %s\n",fileName.data());
+ const QCString data = ResourceMgr::instance().getAsString(fileName);
+ if (!data.isEmpty())
+ {
+ kv = m_templateCache.insert(
+ std::make_pair(fileName.str(),
+ std::make_unique<TemplateImpl>(m_engine,fileName,data,m_extension))).first;
+ }
+ else
+ {
+ err("Could not open template file %s\n",qPrint(fileName));
+ }
}
}
- return templ;
+ return kv!=m_templateCache.end() ? kv->second.get() : 0;
}
+
void unload(Template * /*t*/)
{
//(void)t;
//m_indent--;
//for (int i=0;i<m_indent;i++) printf(" ");
//printf("}\n");
- m_includeStack.removeLast();
+ m_includeStack.pop_back();
}
void enterBlock(const QCString &fileName,const QCString &blockName,int line)
{
//for (int i=0;i<m_indent;i++) printf(" ");
//m_indent++;
- //printf("enterBlock(%s,%s,%d) {\n",fileName.data(),blockName.data(),line);
- m_includeStack.append(new IncludeEntry(IncludeEntry::Block,fileName,blockName,line));
+ //printf("enterBlock(%s,%s,%d) {\n",qPrint(fileName),qPrint(blockName),line);
+ m_includeStack.emplace_back(IncludeEntry::Block,fileName,blockName,line);
}
void leaveBlock()
@@ -5146,34 +5068,33 @@ class TemplateEngine::Private
//m_indent--;
//for (int i=0;i<m_indent;i++) printf(" ");
//printf("}\n");
- m_includeStack.removeLast();
+ m_includeStack.pop_back();
}
- void printIncludeContext(const char *fileName,int line) const
+ void printIncludeContext(const QCString &fileName,int line) const
{
- QListIterator<IncludeEntry> li(m_includeStack);
- li.toLast();
- IncludeEntry *ie=li.current();
- while ((ie=li.current()))
+ auto it = m_includeStack.rbegin();
+ while (it!=m_includeStack.rend())
{
- --li;
- IncludeEntry *next=li.current();
- if (ie->type()==IncludeEntry::Template)
+ const IncludeEntry &ie = *it;
+ ++it;
+ const IncludeEntry *next = it!=m_includeStack.rend() ? &(*it) : 0;
+ if (ie.type()==IncludeEntry::Template)
{
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
+ 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;
}
@@ -5183,16 +5104,16 @@ class TemplateEngine::Private
return m_extension;
}
- void setTemplateDir(const char *dirName)
+ void setTemplateDir(const QCString &dirName)
{
m_templateDirName = dirName;
}
private:
- QDict<Template> m_templateCache;
+ std::unordered_map< std::string, std::unique_ptr<Template> > m_templateCache;
//mutable int m_indent;
TemplateEngine *m_engine = 0;
- QList<IncludeEntry> m_includeStack;
+ std::vector<IncludeEntry> m_includeStack;
QCString m_extension;
QCString m_templateDirName;
};
@@ -5237,12 +5158,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);
}
@@ -5252,7 +5173,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 c4ba3d7..7439b6b 100644
--- a/src/textdocvisitor.h
+++ b/src/textdocvisitor.h
@@ -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.
*
@@ -19,23 +19,21 @@
#ifndef _TEXTDOCVISITOR_H
#define _TEXTDOCVISITOR_H
+#include "qcstring.h"
#include "docvisitor.h"
#include "docparser.h"
-#include <qstack.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
//--------------------------------------
-
+
void visit(DocWord *w) { filter(w->word()); }
void visit(DocLinkedWord *w) { filter(w->word()); }
void visit(DocWhiteSpace *) { m_t << " "; }
@@ -57,7 +55,7 @@ class TextDocVisitor : public DocVisitor
//--------------------------------------
// visitor functions for compound nodes
//--------------------------------------
-
+
void visitPre(DocAutoList *) {}
void visitPost(DocAutoList *) {}
void visitPre(DocAutoListItem *) {}
@@ -136,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..a9c4a31
--- /dev/null
+++ b/src/textstream.h
@@ -0,0 +1,251 @@
+/******************************************************************************
+ *
+ * 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;
+ }
+
+ void setFile(FILE *f)
+ {
+ flush();
+ m_f = f;
+ }
+
+ /** Returns the attached std::ostream object.
+ * @see setStream()
+ */
+ std::ostream *stream() const
+ {
+ return m_s;
+ }
+
+ FILE *file() const
+ {
+ return m_f;
+ }
+
+ /** 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());
+ }
+ else if (m_f)
+ {
+ fwrite(m_buffer.c_str(),1,m_buffer.length(),m_f);
+ }
+ 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;
+ FILE *m_f = 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 d34444c..a3b7de1 100644
--- a/src/types.h
+++ b/src/types.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.
*
@@ -16,11 +16,10 @@
#ifndef TYPES_H
#define TYPES_H
-#include <string.h>
-#include <qcstring.h>
+#include "qcstring.h"
/** @file
- * @brief This file contains a number of basic enums and types.
+ * @brief This file contains a number of basic enums and types.
*/
/** Protection level of members */
@@ -57,18 +56,19 @@ enum SrcLangExt
//SrcLangExt_Tcl = 0x08000, // no longer supported
SrcLangExt_Markdown = 0x10000,
SrcLangExt_SQL = 0x20000,
- SrcLangExt_Slice = 0x40000
+ SrcLangExt_Slice = 0x40000,
+ SrcLangExt_Lex = 0x80000
};
/** Grouping info */
-struct Grouping
+struct Grouping
{
/** Grouping priority */
- enum GroupPri_t
+ enum GroupPri_t
{
GROUPING_LOWEST,
- GROUPING_AUTO_WEAK = GROUPING_LOWEST, //!< membership in group was defined via \@weakgroup
- GROUPING_AUTO_ADD, //!< membership in group was defined via \@add[to]group
+ GROUPING_AUTO_WEAK = GROUPING_LOWEST, //!< membership in group was defined via \@weakgroup
+ GROUPING_AUTO_ADD, //!< membership in group was defined via \@add[to]group
GROUPING_AUTO_DEF, //!< membership in group was defined via \@defgroup
GROUPING_AUTO_HIGHEST = GROUPING_AUTO_DEF,
GROUPING_INGROUP, //!< membership in group was defined by \@ingroup
@@ -87,11 +87,11 @@ struct Grouping
return "@defgroup";
case GROUPING_INGROUP:
return "@ingroup";
- }
+ }
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
@@ -147,7 +147,7 @@ enum MemberListType
MemberListType_allMembersList = 38,
MemberListType_decDefineMembers = 39 + MemberListType_declarationLists,
- MemberListType_decProtoMembers = 40 + MemberListType_declarationLists,
+ MemberListType_decProtoMembers = 40 + MemberListType_declarationLists,
MemberListType_decTypedefMembers = 41 + MemberListType_declarationLists,
MemberListType_decEnumMembers = 42 + MemberListType_declarationLists,
MemberListType_decFuncMembers = 43 + MemberListType_declarationLists,
diff --git a/src/utf8.cpp b/src/utf8.cpp
new file mode 100644
index 0000000..e7108f4
--- /dev/null
+++ b/src/utf8.cpp
@@ -0,0 +1,233 @@
+/******************************************************************************
+ *
+ * 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);
+ if (uc<128) // ASCII case
+ {
+ len=1;
+ return uc;
+ }
+ 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 char asciiToLower(uint32_t code)
+{
+ return code>='A' && code<='Z' ? (char)(code+'a'-'A') : (char)code;
+}
+
+static inline char asciiToUpper(uint32_t code)
+{
+ return code>='a' && code<='z' ? (char)(code+'A'-'a') : (char)code;
+}
+
+static inline std::string caseConvert(const std::string &input,
+ char (*asciiConversionFunc)(uint32_t code),
+ const char *(*conversionFunc)(uint32_t code))
+{
+ uint32_t code;
+ std::string result;
+ result.reserve(input.length()); // assume all ASCII characters
+ int len;
+ size_t bytesLeft = input.length();
+ const char *p = input.c_str();
+ while ((code=convertUTF8CharToUnicode(p,bytesLeft,len)))
+ {
+ if (code<128) // ASCII case
+ {
+ char c = asciiConversionFunc(code);
+ result+=c;
+ }
+ else // generic case
+ {
+ const char *conv = conversionFunc(code);
+ if (conv==nullptr) // no difference between lower and upper case
+ {
+ result.append(p,len);
+ }
+ else // replace the input character with the conversion result
+ {
+ result.append(conv);
+ }
+ }
+ p+=len;
+ bytesLeft-=len;
+ }
+ return result;
+}
+
+std::string convertUTF8ToLower(const std::string &input)
+{
+ return caseConvert(input,asciiToLower,convertUnicodeToLower);
+}
+
+std::string convertUTF8ToUpper(const std::string &input)
+{
+ return caseConvert(input,asciiToUpper,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 7bc9565..74df050 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -15,23 +15,24 @@
*/
#include <stdlib.h>
-#include <ctype.h>
#include <errno.h>
#include <math.h>
#include <limits.h>
-#include <cinttypes>
#include <string.h>
+#include <assert.h>
#include <mutex>
#include <unordered_set>
+#include <codecvt>
+#include <algorithm>
+#include <ctime>
+#include <cctype>
+#include <cinttypes>
+#include <sstream>
#include "md5.h"
-#include <qregexp.h>
-#include <qfileinfo.h>
-#include <qdir.h>
-#include <qdatetime.h>
-
+#include "regex.h"
#include "util.h"
#include "message.h"
#include "classdef.h"
@@ -68,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
@@ -95,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];
@@ -130,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);
@@ -158,55 +163,70 @@ const int maxInheritanceDepth = 100000;
"bla @1" => "bla"
\endverbatim
*/
-QCString removeAnonymousScopes(const QCString &s)
+QCString removeAnonymousScopes(const QCString &str)
{
- QCString result;
- if (s.isEmpty()) return result;
- static QRegExp re("[ :]*@[0-9]+[: ]*");
- int i,l,sl=s.length();
- int p=0;
- while ((i=re.match(s,p,&l))!=-1)
+ std::string result;
+ if (str.isEmpty()) return result;
+
+ // helper to check if the found delimiter starts with a colon
+ auto startsWithColon = [](const std::string &del)
{
- result+=s.mid(p,i-p);
- int c=i;
- bool b1=FALSE,b2=FALSE;
- while (c<i+l && s.at(c)!='@') if (s.at(c++)==':') b1=TRUE;
- c=i+l-1;
- while (c>=i && s.at(c)!='@') if (s.at(c--)==':') b2=TRUE;
- if (b1 && b2)
+ for (size_t i=0;i<del.size();i++)
{
- result+="::";
+ if (del[i]=='@') return false;
+ else if (del[i]==':') return true;
}
- p=i+l;
- }
- result+=s.right(sl-p);
- //printf("removeAnonymousScopes('%s')='%s'\n",s.data(),result.data());
- return result;
-}
+ return false;
+ };
-// replace anonymous scopes with __anonymous__ or replacement if provided
-QCString replaceAnonymousScopes(const QCString &s,const char *replacement)
-{
- QCString result;
- if (s.isEmpty()) return result;
- static QRegExp re("@[0-9]+");
- int i,l,sl=s.length();
- int p=0;
- while ((i=re.match(s,p,&l))!=-1)
+ // helper to check if the found delimiter ends with a colon
+ auto endsWithColon = [](const std::string &del)
{
- result+=s.mid(p,i-p);
- if (replacement)
+ for (int i=(int)del.size()-1;i>=0;i--)
{
- result+=replacement;
+ if (del[i]=='@') return false;
+ else if (del[i]==':') return true;
}
- else
+ return false;
+ };
+
+ static const reg::Ex re(R"([\s:]*@\d+[\s:]*)");
+ std::string s = str.str();
+ reg::Iterator iter(s,re);
+ reg::Iterator end;
+ size_t p=0;
+ size_t sl=s.length();
+ bool needsSeparator=false;
+ for ( ; iter!=end ; ++iter)
+ {
+ const auto &match = *iter;
+ size_t i = match.position();
+ if (i>p) // add non-matching prefix
{
- result+="__anonymous__";
+ if (needsSeparator) result+="::";
+ needsSeparator=false;
+ result+=s.substr(p,i-p);
}
- p=i+l;
+ std::string delim = match.str();
+ needsSeparator = needsSeparator || (startsWithColon(delim) && endsWithColon(delim));
+ p = match.position()+match.length();
+ }
+ if (p<sl) // add trailing remainder
+ {
+ if (needsSeparator) result+="::";
+ result+=s.substr(p);
}
- result+=s.right(sl-p);
- //printf("replaceAnonymousScopes('%s')='%s'\n",s.data(),result.data());
+ return result;
+}
+
+// replace anonymous scopes with __anonymous__ or replacement if provided
+QCString replaceAnonymousScopes(const QCString &s,const QCString &replacement)
+{
+ if (s.isEmpty()) return s;
+ static const reg::Ex marker(R"(@\d+)");
+ std::string result = reg::replace(s.str(),marker,
+ replacement.isEmpty() ? replacement.data() : "__anonymous__");
+ //printf("replaceAnonymousScopes('%s')='%s'\n",qPrint(s),qPrint(result));
return result;
}
@@ -219,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)!='@')
@@ -237,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();
@@ -308,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" ||
@@ -325,6 +345,7 @@ int guessSection(const char *name)
n.right(4)==".i++" ||
n.right(4)==".inl" ||
n.right(4)==".xml" ||
+ n.right(4)==".lex" ||
n.right(4)==".sql"
) return Entry::SOURCE_SEC;
if (n.right(2)==".h" || // header
@@ -344,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())
{
@@ -377,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;
@@ -388,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)
{
@@ -417,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;
@@ -439,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();
@@ -456,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;
@@ -466,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)
{
- if (name==0 || name[0]=='\0') return 0;
- auto it = Doxygen::namespaceAliasMap.find(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.isEmpty()) return 0;
+ auto it = Doxygen::namespaceAliasMap.find(name.str());
if (it!=Doxygen::namespaceAliasMap.end())
{
int count=0; // recursion detection guard
@@ -488,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
{
@@ -575,7 +616,7 @@ QCString removeRedundantWhiteSpace(const QCString &s)
}
if (growBuf==0) return s; // should not happen, only we run out of memory
- char *src=s.rawData();
+ const char *src=s.data();
char *dst=growBuf;
uint i=0;
@@ -815,7 +856,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;
}
@@ -893,40 +934,43 @@ 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.isEmpty()) return;
//printf("linkify='%s'\n",text);
- static QRegExp regExp("[a-z_A-Z\\x80-\\xFF][~!a-z_A-Z0-9$\\\\.:\\x80-\\xFF]*");
- static QRegExp regExpSplit("(?!:),");
- if (text==0) return;
- QCString txtStr=text;
- int strLen = txtStr.length();
+ std::string txtStr=text.str();
+ size_t strLen = txtStr.length();
if (strLen==0) return;
+
+ static const reg::Ex regExp(R"(\a[\w~!\\.:$]*)");
+ reg::Iterator it(txtStr,regExp);
+ 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);
- int matchLen;
- int index=0;
- int newIndex;
- int skipIndex=0;
- int floatingIndex=0;
- // read a word from the text string
- while ((newIndex=regExp.match(txtStr,index,&matchLen))!=-1)
- {
+ // 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;
+ for (; it!=end ; ++it) // for each word from the text string
+ {
+ const auto &match = *it;
+ size_t newIndex = match.position();
+ size_t matchLen = match.length();
floatingIndex+=newIndex-skipIndex+matchLen;
if (newIndex>0 && txtStr.at(newIndex-1)=='0') // ignore hex numbers (match x00 in 0x00)
{
- out.writeString(txtStr.mid(skipIndex,newIndex+matchLen-skipIndex),keepSpaces);
+ std::string part = txtStr.substr(skipIndex,newIndex+matchLen-skipIndex);
+ out.writeString(part.c_str(),keepSpaces);
skipIndex=index=newIndex+matchLen;
continue;
}
// add non-word part to the result
bool insideString=FALSE;
- int i;
- for (i=index;i<newIndex;i++)
+ for (size_t i=index;i<newIndex;i++)
{
if (txtStr.at(i)=='"') insideString=!insideString;
}
@@ -934,36 +978,39 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
//printf("floatingIndex=%d strlen=%d autoBreak=%d\n",floatingIndex,strLen,autoBreak);
if (strLen>35 && floatingIndex>30 && autoBreak) // try to insert a split point
{
- QCString splitText = txtStr.mid(skipIndex,newIndex-skipIndex);
- int splitLength = splitText.length();
- int offset=1;
- i=splitText.find(regExpSplit,0);
- if (i==-1) { i=splitText.find('<'); if (i!=-1) offset=0; }
- if (i==-1) i=splitText.find('>');
- if (i==-1) i=splitText.find(' ');
- //printf("splitText=[%s] len=%d i=%d offset=%d\n",splitText.data(),splitLength,i,offset);
- if (i!=-1) // add a link-break at i in case of Html output
- {
- out.writeString(splitText.left(i+offset),keepSpaces);
+ std::string splitText = txtStr.substr(skipIndex,newIndex-skipIndex);
+ size_t splitLength = splitText.length();
+ size_t offset=1;
+ size_t i = splitText.find(',');
+ 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",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);
+ out.writeString(part1.c_str(),keepSpaces);
out.writeBreak(indentLevel==0 ? 0 : indentLevel+1);
- out.writeString(splitText.right(splitLength-i-offset),keepSpaces);
+ std::string part2 = splitText.substr(i+offset);
+ out.writeString(part2.c_str(),keepSpaces);
floatingIndex=splitLength-i-offset+matchLen;
}
else
{
- out.writeString(splitText,keepSpaces);
+ out.writeString(splitText.c_str(),keepSpaces);
}
}
else
{
//ol.docify(txtStr.mid(skipIndex,newIndex-skipIndex));
- out.writeString(txtStr.mid(skipIndex,newIndex-skipIndex),keepSpaces);
+ std::string part = txtStr.substr(skipIndex,newIndex-skipIndex);
+ out.writeString(part.c_str(),keepSpaces);
}
// get word from string
- QCString word=txtStr.mid(newIndex,matchLen);
- QCString matchWord = substitute(substitute(word,"\\","::"),".","::");
+ std::string word=txtStr.substr(newIndex,matchLen);
+ 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 +1019,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)
@@ -987,20 +1035,20 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
out.writeLink(typeDef->getReference(),
typeDef->getOutputFileBase(),
typeDef->anchor(),
- word);
+ word.c_str());
found=TRUE;
}
}
}
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())
{
if (cd!=self)
{
- out.writeLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),word);
+ out.writeLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),word.c_str());
found=TRUE;
}
}
@@ -1012,23 +1060,23 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
{
if (cd!=self)
{
- out.writeLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),word);
+ out.writeLink(cd->getReference(),cd->getOutputFileBase(),cd->anchor(),word.c_str());
+ 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 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
{
//printf(" -> nothing\n");
@@ -1050,17 +1098,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()))
@@ -1072,8 +1120,8 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
if (!(scope && (scope->getLanguage() == SrcLangExt_Fortran) && md->isVariable() && (md->getLanguage() != SrcLangExt_Fortran)))
{
out.writeLink(md->getReference(),md->getOutputFileBase(),
- md->anchor(),word);
- //printf("found symbol %s\n",matchWord.data());
+ md->anchor(),word.c_str());
+ //printf("found symbol %s\n",qPrint(matchWord));
found=TRUE;
}
}
@@ -1082,7 +1130,7 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
if (!found) // add word to the result
{
- out.writeString(word,keepSpaces);
+ out.writeString(word.c_str(),keepSpaces);
}
// set next start point in the string
//printf("index=%d/%d\n",index,txtStr.length());
@@ -1090,52 +1138,59 @@ void linkifyText(const TextGeneratorIntf &out, const Definition *scope,
}
// add last part of the string to the result.
//ol.docify(txtStr.right(txtStr.length()-skipIndex));
- out.writeString(txtStr.right(txtStr.length()-skipIndex),keepSpaces);
+ std::string lastPart = txtStr.substr(skipIndex);
+ out.writeString(lastPart.c_str(),keepSpaces);
}
-
-void writeExamples(OutputList &ol,const ExampleList &list)
+void writeMarkerList(OutputList &ol,const std::string &markerText,size_t numMarkers,
+ std::function<void(size_t)> replaceFunc)
{
- QCString exampleLine=theTranslator->trWriteList((int)list.size());
-
- //bool latexEnabled = ol.isEnabled(OutputGenerator::Latex);
- //bool manEnabled = ol.isEnabled(OutputGenerator::Man);
- //bool htmlEnabled = ol.isEnabled(OutputGenerator::Html);
- QRegExp marker("@[0-9]+");
- int index=0,newIndex,matchLen;
+ static const reg::Ex marker(R"(@(\d+))");
+ reg::Iterator it(markerText,marker);
+ reg::Iterator end;
+ size_t index=0;
// now replace all markers in inheritLine with links to the classes
- while ((newIndex=marker.match(exampleLine,index,&matchLen))!=-1)
+ for ( ; it!=end ; ++it)
{
- bool ok;
- ol.parseText(exampleLine.mid(index,newIndex-index));
- uint entryIndex = exampleLine.mid(newIndex+1,matchLen-1).toUInt(&ok);
- if (ok && entryIndex<list.size())
+ const auto &match = *it;
+ size_t newIndex = match.position();
+ size_t matchLen = match.length();
+ ol.parseText(markerText.substr(index,newIndex-index));
+ unsigned long entryIndex = std::stoul(match[1].str());
+ if (entryIndex<(unsigned long)numMarkers)
{
- const auto &e = list[entryIndex];
- ol.pushGeneratorState();
- //if (latexEnabled) ol.disable(OutputGenerator::Latex);
- ol.disable(OutputGenerator::Latex);
- 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);
- ol.popGeneratorState();
-
- ol.pushGeneratorState();
- //if (latexEnabled) ol.enable(OutputGenerator::Latex);
- ol.disable(OutputGenerator::Man);
- 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);
- //if (manEnabled) ol.enable(OutputGenerator::Man);
- //if (htmlEnabled) ol.enable(OutputGenerator::Html);
- ol.popGeneratorState();
+ replaceFunc(entryIndex);
}
index=newIndex+matchLen;
}
- ol.parseText(exampleLine.right(exampleLine.length()-index));
+ ol.parseText(markerText.substr(index));
+}
+
+void writeExamples(OutputList &ol,const ExampleList &list)
+{
+ auto replaceFunc = [&list,&ol](size_t entryIndex)
+ {
+ const auto &e = list[entryIndex];
+ ol.pushGeneratorState();
+ ol.disable(OutputGenerator::Latex);
+ ol.disable(OutputGenerator::RTF);
+ ol.disable(OutputGenerator::Docbook);
+ // link for Html / man
+ //printf("writeObjectLink(file=%s)\n",qPrint(e->file));
+ ol.writeObjectLink(QCString(),e.file,e.anchor,e.name);
+ ol.popGeneratorState();
+
+ ol.pushGeneratorState();
+ ol.disable(OutputGenerator::Man);
+ ol.disable(OutputGenerator::Html);
+ // link for Latex / pdf with anchor because the sources
+ // are not hyperlinked (not possible with a verbatim environment).
+ ol.writeObjectLink(QCString(),e.file,QCString(),e.name);
+ ol.popGeneratorState();
+ };
+
+ writeMarkerList(ol, theTranslator->trWriteList((int)list.size()).str(), list.size(), replaceFunc);
+
ol.writeString(".");
}
@@ -1273,7 +1328,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
@@ -1284,8 +1339,14 @@ static QCString getFilterFromList(const char *name,const StringVector &filterLis
if (i_equals!=-1)
{
QCString filterPattern = fs.left(i_equals);
- QRegExp fpat(filterPattern,Portable::fileSystemIsCaseSensitive(),TRUE);
- if (fpat.match(name)!=-1)
+ QCString input = name;
+ if (!Portable::fileSystemIsCaseSensitive())
+ {
+ filterPattern = filterPattern.lower();
+ input = input.lower();
+ }
+ reg::Ex re(filterPattern.str(),reg::Ex::Mode::Wildcard);
+ if (re.isValid() && reg::match(input.str(),re))
{
// found a match!
QCString filterName = fs.mid(i_equals+1);
@@ -1308,10 +1369,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);
@@ -1352,30 +1413,30 @@ QCString transcodeCharacterStringToUTF8(const QCString &input)
int inputSize=input.length();
int outputSize=inputSize*4+1;
QCString output(outputSize);
- void *cd = portable_iconv_open(outputEncoding,inputEncoding);
+ void *cd = portable_iconv_open(outputEncoding,inputEncoding.data());
if (cd==(void *)(-1))
{
err("unsupported character conversion: '%s'->'%s'\n",
- inputEncoding.data(),outputEncoding);
+ qPrint(inputEncoding),outputEncoding);
error=TRUE;
}
if (!error)
{
size_t iLeft=inputSize;
size_t oLeft=outputSize;
- char *inputPtr = input.rawData();
+ const char *inputPtr = input.data();
char *outputPtr = output.rawData();
if (!portable_iconv(cd, &inputPtr, &iLeft, &outputPtr, &oLeft))
{
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;
}
}
@@ -1387,42 +1448,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)
{
@@ -1437,16 +1486,15 @@ 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 "";
}
-static QDateTime getCurrentDateTime()
+static std::tm getCurrentDateTime()
{
- QDateTime current = QDateTime::currentDateTime();
QCString sourceDateEpoch = Portable::getenv("SOURCE_DATE_EPOCH");
- if (!sourceDateEpoch.isEmpty())
+ if (!sourceDateEpoch.isEmpty()) // see https://reproducible-builds.org/specs/source-date-epoch/
{
bool ok;
uint64 epoch = sourceDateEpoch.toUInt64(&ok);
@@ -1456,46 +1504,43 @@ static QDateTime 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;
}
}
- else if (epoch>UINT_MAX)
+ else // use given epoch value as current 'built' time
{
- static bool warnedOnce=FALSE;
- if (!warnedOnce)
- {
- warn_uncond("Environment variable SOURCE_DATE_EPOCH must have a value smaller than or equal to %d; actual value %" PRIu64 "\n",UINT_MAX, (uint64_t)epoch);
- warnedOnce=TRUE;
- }
- }
- else // all ok, replace current time with epoch value
- {
- current.setTimeUtc_t((ulong)epoch); // TODO: add support for 64bit epoch value
+ auto epoch_start = std::chrono::time_point<std::chrono::system_clock>{};
+ auto epoch_seconds = std::chrono::seconds(epoch);
+ auto build_time = epoch_start + epoch_seconds;
+ std::time_t time = std::chrono::system_clock::to_time_t(build_time);
+ return *gmtime(&time);
}
}
- return current;
+
+ // return current local time
+ auto now = std::chrono::system_clock::now();
+ std::time_t time = std::chrono::system_clock::to_time_t(now);
+ return *localtime(&time);
}
QCString dateToString(bool includeTime)
{
- const QDateTime current = getCurrentDateTime();
- return theTranslator->trDateTime(current.date().year(),
- current.date().month(),
- current.date().day(),
- current.date().dayOfWeek(),
- current.time().hour(),
- current.time().minute(),
- current.time().second(),
+ auto current = getCurrentDateTime();
+ return theTranslator->trDateTime(current.tm_year + 1900,
+ current.tm_mon + 1,
+ current.tm_mday,
+ (current.tm_wday+6)%7+1, // map: Sun=0..Sat=6 to Mon=1..Sun=7
+ current.tm_hour,
+ current.tm_min,
+ current.tm_sec,
includeTime);
}
QCString yearToString()
{
- const QDateTime current = getCurrentDateTime();
- QCString result;
- result.sprintf("%d", current.date().year());
- return result;
+ auto current = getCurrentDateTime();
+ return QCString().setNum(current.tm_year+1900);
}
//----------------------------------------------------------------------
@@ -1513,7 +1558,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;
@@ -1540,7 +1585,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)
{
@@ -1552,17 +1597,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)
{
@@ -1570,7 +1615,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);
@@ -1578,83 +1623,6 @@ void trimBaseClassScope(const BaseClassList &bcl,QCString &s,int level=0)
}
}
-#if 0
-/*! if either t1 or t2 contains a namespace scope, then remove that
- * scope. If neither or both have a namespace scope, t1 and t2 remain
- * unchanged.
- */
-static void trimNamespaceScope(QCString &t1,QCString &t2,const QCString &nsName)
-{
- int p1=t1.length();
- int p2=t2.length();
- for (;;)
- {
- int i1=p1==0 ? -1 : t1.findRev("::",p1);
- int i2=p2==0 ? -1 : t2.findRev("::",p2);
- if (i1==-1 && i2==-1)
- {
- return;
- }
- if (i1!=-1 && i2==-1) // only t1 has a scope
- {
- QCString scope=t1.left(i1);
- replaceNamespaceAliases(scope,i1);
-
- int so=nsName.length();
- do
- {
- QCString fullScope=nsName.left(so);
- if (!fullScope.isEmpty() && !scope.isEmpty()) fullScope+="::";
- fullScope+=scope;
- if (!fullScope.isEmpty() && Doxygen::namespaceSDict[fullScope]!=0) // scope is a namespace
- {
- t1 = t1.right(t1.length()-i1-2);
- return;
- }
- if (so==0)
- {
- so=-1;
- }
- else if ((so=nsName.findRev("::",so-1))==-1)
- {
- so=0;
- }
- }
- while (so>=0);
- }
- else if (i1==-1 && i2!=-1) // only t2 has a scope
- {
- QCString scope=t2.left(i2);
- replaceNamespaceAliases(scope,i2);
-
- int so=nsName.length();
- do
- {
- QCString fullScope=nsName.left(so);
- if (!fullScope.isEmpty() && !scope.isEmpty()) fullScope+="::";
- fullScope+=scope;
- if (!fullScope.isEmpty() && Doxygen::namespaceSDict[fullScope]!=0) // scope is a namespace
- {
- t2 = t2.right(t2.length()-i2-2);
- return;
- }
- if (so==0)
- {
- so=-1;
- }
- else if ((so=nsName.findRev("::",so-1))==-1)
- {
- so=0;
- }
- }
- while (so>=0);
- }
- p1 = QMAX(i1-2,0);
- p2 = QMAX(i2-2,0);
- }
-}
-#endif
-
static void stripIrrelevantString(QCString &target,const QCString &str)
{
if (target==str) { target.resize(0); return; }
@@ -1708,11 +1676,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));
}
@@ -1753,7 +1721,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;
}
@@ -1777,9 +1745,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);
@@ -1801,23 +1769,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
{
@@ -1872,7 +1840,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();
@@ -1891,7 +1859,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;
@@ -1901,7 +1869,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;
}
@@ -1920,10 +1888,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>");
-
- //static QRegExp id("[a-z_A-Z\\x80-\\xFF][:a-z_A-Z0-9\\x80-\\xFF]*");
+ //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;
@@ -1948,28 +1914,36 @@ 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.
{
- static QRegExp re("[a-z_A-Z\\x80-\\xFF][a-z_A-Z0-9\\x80-\\xFF]*");
- int tp=0,tl,ti;
+ std::string ts = templSpec.str();
+ static const reg::Ex re(R"(\a\w*)");
+ reg::Iterator it(ts,re);
+ reg::Iterator end;
+
+ size_t tp=0;
// for each identifier template specifier
- //printf("adding resolved %s to %s\n",templSpec.data(),canType.data());
- while ((ti=re.match(templSpec,tp,&tl))!=-1)
- {
- canType += templSpec.mid(tp,ti-tp);
- canType += getCanonicalTypeForIdentifier(d,fs,templSpec.mid(ti,tl),0);
+ //printf("adding resolved %s to %s\n",qPrint(templSpec),qPrint(canType));
+ for (; it!=end ; ++it)
+ {
+ const auto &match = *it;
+ size_t ti = match.position();
+ size_t tl = match.length();
+ std::string matchStr = match.str();
+ canType += ts.substr(tp,ti-tp);
+ canType += getCanonicalTypeForIdentifier(d,fs,matchStr.c_str(),0);
tp=ti+tl;
}
- canType+=templSpec.right(templSpec.length()-tp);
+ canType+=ts.substr(tp);
}
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);
}
@@ -1978,7 +1952,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+=" ";
@@ -2003,10 +1977,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
//{
@@ -2019,8 +1993,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;
@@ -2034,12 +2008,10 @@ static bool matchArgument2(
dstA.canType=""; // invalidate cached type value
}
- if (srcA.canType.isEmpty())
+ if (srcA.canType.isEmpty() || dstA.canType.isEmpty())
{
+ // need to re-evaluate both see issue #8370
srcA.canType = extractCanonicalArgType(srcScope,srcFileScope,srcA);
- }
- if (dstA.canType.isEmpty())
- {
dstA.canType = extractCanonicalArgType(dstScope,dstFileScope,dstA);
}
@@ -2051,7 +2023,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;
}
@@ -2151,7 +2123,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())
{
@@ -2167,12 +2139,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;
}
@@ -2191,24 +2163,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;
@@ -2228,7 +2200,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"
@@ -2256,15 +2228,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;
}
@@ -2277,19 +2249,19 @@ 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,
- QList<MemberDef> &members)
+ std::vector<const MemberDef *> &members)
{
//printf(" Function with global scope name '%s' args='%s'\n",
// mn->memberName(),args);
@@ -2299,7 +2271,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() &&
@@ -2308,7 +2280,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);
@@ -2320,7 +2292,7 @@ static void findMembersWithSpecificName(const MemberName *mn,
if (match)
{
//printf("Found match!\n");
- members.append(md);
+ members.push_back(md);
}
}
}
@@ -2350,7 +2322,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,
@@ -2369,7 +2341,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
@@ -2382,7 +2354,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;
@@ -2399,15 +2371,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
{
@@ -2431,7 +2403,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()
@@ -2440,7 +2412,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);
}
@@ -2450,7 +2422,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);
@@ -2471,7 +2443,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");
@@ -2481,7 +2453,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);
@@ -2516,27 +2488,21 @@ bool getDefs(const QCString &scName,
if (tmd && tmd->isEnumerate() && tmd->isStrong()) // scoped enum
{
//printf("Found scoped enum!\n");
- const MemberList *tml = tmd->enumFieldList();
- if (tml)
+ for (const auto &emd : tmd->enumFieldList())
{
- MemberListIterator tmi(*tml);
- MemberDef *emd;
- for (;(emd=tmi.current());++tmi)
+ if (emd->localName()==mName)
{
- if (emd->localName()==mName)
+ if (emd->isLinkable())
{
- if (emd->isLinkable())
- {
- cd=tmd->getClassDef();
- md=emd;
- return TRUE;
- }
- else
- {
- cd=0;
- md=0;
- return FALSE;
- }
+ cd=tmd->getClassDef();
+ md=emd;
+ return TRUE;
+ }
+ else
+ {
+ cd=0;
+ md=0;
+ return FALSE;
}
}
}
@@ -2558,9 +2524,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);
}
@@ -2574,7 +2540,7 @@ bool getDefs(const QCString &scName,
continue;
}
- if (!args)
+ if (args.isEmpty())
{
fuzzy_mmd = mmd;
break;
@@ -2608,7 +2574,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");
@@ -2623,16 +2589,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)
{
@@ -2642,7 +2608,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()))
{
@@ -2662,7 +2628,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);
@@ -2680,7 +2646,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
{
@@ -2719,9 +2685,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);
@@ -2735,7 +2701,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;
}
}
@@ -2752,16 +2718,16 @@ bool getDefs(const QCString &scName,
//else // no scope => global function
{
- QList<MemberDef> members;
+ std::vector<const MemberDef *> members;
// search for matches with strict static checking
findMembersWithSpecificName(mn,args,TRUE,currentFile,checkCV,members);
- if (members.count()==0) // nothing found
+ if (members.empty()) // nothing found
{
// search again without strict static checking
findMembersWithSpecificName(mn,args,FALSE,currentFile,checkCV,members);
}
//printf("found %d members\n",members.count());
- if (members.count()!=1 && args && !qstrcmp(args,"()"))
+ if (members.size()!=1 && args=="()")
{
// no exact match found, but if args="()" an arbitrary
// member will do
@@ -2771,8 +2737,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();
@@ -2781,32 +2747,32 @@ bool getDefs(const QCString &scName,
(tmd && tmd->isStrong())
)
{
- members.append(mmd);
+ members.push_back(mmd);
}
}
}
//printf("found %d candidate members\n",members.count());
- if (members.count()>0) // at least one match
+ if (!members.empty()) // at least one match
{
if (currentFile)
{
- //printf("multiple results; pick one from file:%s\n", currentFile->name().data());
- QListIterator<MemberDef> mit(members);
- for (mit.toFirst();(md=mit.current());++mit)
+ //printf("multiple results; pick one from file:%s\n",qPrint( currentFile->name()));
+ for (const auto &rmd : members)
{
- if (md->getFileDef() && md->getFileDef()->name() == currentFile->name())
+ if (rmd->getFileDef() && rmd->getFileDef()->name() == currentFile->name())
{
+ md = rmd;
break; // found match in the current file
}
}
if (!md) // member not in the current file
{
- md=members.getLast();
+ md=members.back();
}
}
else
{
- md=members.getLast();
+ md=members.back();
}
}
if (md && (md->getEnumScope()==0 || !md->getEnumScope()->isStrong()))
@@ -2839,7 +2805,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;
@@ -2864,7 +2830,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
@@ -2893,18 +2859,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,
@@ -2913,7 +2879,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,"#","::");
@@ -2951,7 +2917,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))
@@ -2972,7 +2938,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...
@@ -3013,10 +2979,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
@@ -3026,7 +2993,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))
@@ -3047,7 +3014,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)))
@@ -3055,6 +3022,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;
@@ -3083,7 +3055,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;
@@ -3177,8 +3149,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
@@ -3188,12 +3160,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;
@@ -3256,18 +3229,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;
@@ -3290,19 +3263,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 */
)
{
@@ -3332,51 +3305,23 @@ 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);
}
//----------------------------------------------------------------------
-#if 0
-QCString substituteClassNames(const QCString &s)
-{
- int i=0,l,p;
- QCString result;
- if (s.isEmpty()) return result;
- QRegExp r("[a-z_A-Z][a-z_A-Z0-9]*");
- while ((p=r.match(s,i,&l))!=-1)
- {
- QCString *subst;
- if (p>i) result+=s.mid(i,p-i);
- if ((subst=substituteDict[s.mid(p,l)]))
- {
- result+=*subst;
- }
- else
- {
- result+=s.mid(p,l);
- }
- i=p+l;
- }
- result+=s.mid(i,s.length()-i);
- return result;
-}
-#endif
-
-//----------------------------------------------------------------------
-
/** Cache element for the file name to FileDef mapping cache. */
struct FindFileCacheElem
{
@@ -3389,12 +3334,12 @@ 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::unique_lock<std::mutex> lock(g_findFileDefMutex);
+ std::lock_guard<std::mutex> lock(g_findFileDefMutex);
const int maxAddrSize = 20;
char addr[maxAddrSize];
@@ -3403,7 +3348,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;
@@ -3415,22 +3360,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();
@@ -3476,12 +3420,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);
@@ -3503,11 +3447,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());
@@ -3585,6 +3529,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.
@@ -3644,17 +3589,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)
@@ -3690,20 +3635,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';
@@ -3729,11 +3674,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;
@@ -3800,32 +3746,33 @@ QCString unescapeCharsInString(const char *s)
return result;
}
+static std::unordered_map<std::string,int> g_usedNames;
+static std::mutex g_usedNamesMutex;
+static int g_usedNamesCount=1;
+
/*! This function determines the file name on disk of an item
* 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
{
- static QDict<int> usedNames(10007);
- usedNames.setAutoDelete(TRUE);
- static int count=1;
-
- int *value=usedNames.find(name);
- int num;
- if (value==0)
+ std::lock_guard<std::mutex> lock(g_usedNamesMutex);
+ auto kv = g_usedNames.find(name.str());
+ uint num=0;
+ if (kv!=g_usedNames.end())
{
- usedNames.insert(name,new int(count));
- num = count++;
+ num = kv->second;
}
else
{
- num = *value;
+ num = g_usedNamesCount;
+ g_usedNames.insert(std::make_pair(name.str(),g_usedNamesCount++));
}
result.sprintf("a%05d",num);
}
@@ -3837,9 +3784,9 @@ QCString convertNameToFile(const char *name,bool allowDots,bool allowUnderscore)
{
// third algorithm based on MD5 hash
uchar md5_sig[16];
- QCString sigStr(33);
+ char sigStr[33];
MD5Buffer((const unsigned char *)result.data(),resultLen,md5_sig);
- MD5SigToString(md5_sig,sigStr.rawData(),33);
+ MD5SigToString(md5_sig,sigStr);
result=result.left(128-32)+sigStr;
}
}
@@ -3855,23 +3802,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;
@@ -3881,7 +3827,7 @@ QCString relativePathToRoot(const char *name)
return result;
}
-void createSubDirs(QDir &d)
+void createSubDirs(const Dir &d)
{
if (Config_getBool(CREATE_SUBDIRS))
{
@@ -3891,17 +3837,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));
}
}
}
@@ -3920,7 +3866,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;
}
@@ -3928,11 +3874,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;
}
@@ -3941,18 +3887,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);
@@ -3962,7 +3908,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;
@@ -3972,7 +3918,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
@@ -3985,7 +3931,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;
}
@@ -3993,7 +3939,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();
@@ -4013,7 +3959,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);
@@ -4086,11 +4032,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++))
@@ -4119,18 +4065,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++))
{
@@ -4177,13 +4123,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++))
{
@@ -4241,12 +4187,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;
- growBuf.addStr(getHtmlDirEmbeddingChar(getTextDirByConfig(s)));
- const char *p=s;
+ const char *p=s.data();
char c;
while ((c=*p++))
{
@@ -4302,13 +4247,11 @@ QCString convertToHtml(const char *s,bool keepEntities)
return growBuf.get();
}
-QCString convertToJSString(const char *s, bool applyTextDir)
+QCString convertToJSString(const QCString &s)
{
- if (s==0) return "";
+ if (s.isEmpty()) return s;
GrowBuf growBuf;
- if (applyTextDir)
- growBuf.addStr(getJsDirEmbeddingChar(getTextDirByConfig(s)));
- const char *p=s;
+ const char *p=s.data();
char c;
while ((c=*p++))
{
@@ -4323,11 +4266,11 @@ QCString convertToJSString(const char *s, bool applyTextDir)
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++))
{
@@ -4344,29 +4287,34 @@ 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 QCString &s)
+QCString convertCharEntitiesToUTF8(const QCString &str)
{
- QCString result;
- static QRegExp entityPat("&[a-zA-Z]+[0-9]*;");
+ if (str.isEmpty()) return QCString();
+
+ std::string s = str.data();
+ static const reg::Ex re(R"(&\a\w*;)");
+ reg::Iterator it(s,re);
+ reg::Iterator end;
- if (s.length()==0) return result;
GrowBuf growBuf;
- int p,i=0,l;
- while ((p=entityPat.match(s,i,&l))!=-1)
+ size_t p,i=0,l;
+ for (; it!=end ; ++it)
{
+ const auto &match = *it;
+ p = match.position();
+ l = match.length();
if (p>i)
{
- growBuf.addStr(s.mid(i,p-i));
+ growBuf.addStr(s.substr(i,p-i));
}
- QCString entity = s.mid(p,l);
+ 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)))
@@ -4375,13 +4323,13 @@ QCString convertCharEntitiesToUTF8(const QCString &s)
}
else
{
- growBuf.addStr(s.mid(p,l));
+ growBuf.addStr(entity);
}
i=p+l;
}
- growBuf.addStr(s.mid(i,s.length()-i));
+ 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();
}
@@ -4401,53 +4349,59 @@ 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;
- MemberListIterator mli(*ml);
- MemberDef *md;
- uint index;
- for (index=0;(md=mli.current());)
+
+ struct MoveMemberInfo
+ {
+ MoveMemberInfo(const MemberDef *md,MemberGroup *mg,const RefItemVector &rv)
+ : memberDef(md), memberGroup(mg), sli(rv) {}
+ const MemberDef *memberDef;
+ MemberGroup *memberGroup;
+ RefItemVector sli;
+ };
+ std::vector<MoveMemberInfo> movedMembers;
+
+ for (const auto &md : *ml)
{
if (md->isEnumerate()) // insert enum value of this enum into groups
{
- const MemberList *fmdl=md->enumFieldList();
- if (fmdl!=0)
+ for (const auto &fmd : md->enumFieldList())
{
- MemberListIterator fmli(*fmdl);
- MemberDef *fmd;
- for (fmli.toFirst();(fmd=fmli.current());++fmli)
+ int groupId=fmd->getMemberGroupId();
+ if (groupId!=-1)
{
- int groupId=fmd->getMemberGroupId();
- if (groupId!=-1)
+ auto it = Doxygen::memberGroupInfoMap.find(groupId);
+ if (it!=Doxygen::memberGroupInfoMap.end())
{
- auto it = Doxygen::memberGroupInfoMap.find(groupId);
- if (it!=Doxygen::memberGroupInfoMap.end())
+ auto &info = it->second;
+ auto mg_it = std::find_if(pMemberGroups->begin(),
+ pMemberGroups->end(),
+ [&groupId](const auto &g)
+ { return g->groupId()==groupId; }
+ );
+ MemberGroup *mg_ptr = 0;
+ if (mg_it==pMemberGroups->end())
{
- auto &info = it->second;
- auto mg_it = std::find_if(pMemberGroups->begin(),
- pMemberGroups->end(),
- [&groupId](const auto &g)
- { return g->groupId()==groupId; }
- );
- MemberGroup *mg_ptr = 0;
- if (mg_it==pMemberGroups->end())
- {
- auto mg = std::make_unique<MemberGroup>(
- context,
- groupId,
- info->header,
- info->doc,
- info->docFile,
- info->docLine);
- mg_ptr = mg.get();
- pMemberGroups->push_back(std::move(mg));
- }
- else
- {
- mg_ptr = (*mg_it).get();
- }
- mg_ptr->insertMember(fmd); // insert in member group
- fmd->setMemberGroup(mg_ptr);
+ auto mg = std::make_unique<MemberGroup>(
+ context,
+ groupId,
+ info->header,
+ info->doc,
+ info->docFile,
+ info->docLine);
+ mg_ptr = mg.get();
+ pMemberGroups->push_back(std::move(mg));
+ }
+ else
+ {
+ mg_ptr = (*mg_it).get();
+ }
+ mg_ptr->insertMember(fmd); // insert in member group
+ MemberDefMutable *fmdm = toMemberDefMutable(fmd);
+ if (fmdm)
+ {
+ fmdm->setMemberGroup(mg_ptr);
}
}
}
@@ -4482,14 +4436,22 @@ void addMembersToMemberGroup(MemberList *ml,
{
mg_ptr = (*mg_it).get();
}
- md = ml->take(index); // remove from member list
- mg_ptr->insertMember(md->resolveAlias()); // insert in member group
- mg_ptr->setRefItems(info->m_sli);
- md->setMemberGroup(mg_ptr);
- continue;
+ movedMembers.push_back(MoveMemberInfo(md,mg_ptr,info->m_sli));
}
}
- ++mli;++index;
+ }
+
+ // move the members to their group
+ for (const auto &mmi : movedMembers)
+ {
+ ml->remove(mmi.memberDef); // remove from member list
+ mmi.memberGroup->insertMember(mmi.memberDef->resolveAlias()); // insert in member group
+ mmi.memberGroup->setRefItems(mmi.sli);
+ MemberDefMutable *rmdm = toMemberDefMutable(mmi.memberDef);
+ if (rmdm)
+ {
+ rmdm->setMemberGroup(mmi.memberGroup);
+ }
}
}
@@ -4500,75 +4462,75 @@ void addMembersToMemberGroup(MemberList *ml,
*/
int extractClassNameFromType(const QCString &type,int &pos,QCString &name,QCString &templSpec,SrcLangExt lang)
{
- static const QRegExp re_norm("[a-z_A-Z\\x80-\\xFF][a-z_A-Z0-9:\\x80-\\xFF]*");
- static const QRegExp re_ftn("[a-z_A-Z\\x80-\\xFF][()=_a-z_A-Z0-9:\\x80-\\xFF]*");
- QRegExp re;
+ static reg::Ex re_norm(R"(\a[\w:]*)");
+ static reg::Ex re_fortran(R"(\a[\w:()=]*)");
+ static const reg::Ex *re = &re_norm;
name.resize(0);
templSpec.resize(0);
- int i,l;
- int typeLen=type.length();
+ if (type.isEmpty()) return -1;
+ int typeLen=(int)type.length();
if (typeLen>0)
{
if (lang == SrcLangExt_Fortran)
{
- if (type.at(pos)==',') return -1;
- if (type.left(4).lower()=="type")
+ if (type[pos]==',') return -1;
+ if (QCString(type).left(4).lower()!="type")
{
- re = re_norm;
- }
- else
- {
- re = re_ftn;
+ re = &re_fortran;
}
}
- else
- {
- re = re_norm;
- }
+ std::string s = type.str();
+ reg::Iterator it(s,*re,(int)pos);
+ reg::Iterator end;
- if ((i=re.match(type,pos,&l))!=-1) // for each class name in the type
+ if (it!=end)
{
- int ts=i+l;
- int te=ts;
- int tl=0;
- while (type.at(ts)==' ' && ts<typeLen) ts++,tl++; // skip any whitespace
- if (type.at(ts)=='<') // assume template instance
+ const auto &match = *it;
+ int i = (int)match.position();
+ int l = (int)match.length();
+ int ts = i+l;
+ int te = ts;
+ int tl = 0;
+
+ while (ts<typeLen && type[ts]==' ') ts++,tl++; // skip any whitespace
+ if (ts<typeLen && type[ts]=='<') // assume template instance
{
// locate end of template
te=ts+1;
int brCount=1;
while (te<typeLen && brCount!=0)
{
- if (type.at(te)=='<')
+ if (type[te]=='<')
{
- if (te<typeLen-1 && type.at(te+1)=='<') te++; else brCount++;
+ if (te<typeLen-1 && type[te+1]=='<') te++; else brCount++;
}
- if (type.at(te)=='>')
+ if (type[te]=='>')
{
- if (te<typeLen-1 && type.at(te+1)=='>') te++; else brCount--;
+ if (te<typeLen-1 && type[te+1]=='>') te++; else brCount--;
}
te++;
}
}
- name = type.mid(i,l);
+ name = match.str();
if (te>ts)
{
- templSpec = type.mid(ts,te-ts),tl+=te-ts;
+ templSpec = QCString(type).mid(ts,te-ts);
+ tl+=te-ts;
pos=i+l+tl;
}
else // no template part
{
pos=i+l;
}
- //printf("extractClassNameFromType([in] type=%s,[out] pos=%d,[out] name=%s,[out] templ=%s)=TRUE\n",
- // type.data(),pos,name.data(),templSpec.data());
+ //printf("extractClassNameFromType([in] type=%s,[out] pos=%d,[out] name=%s,[out] templ=%s)=TRUE i=%d\n",
+ // 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.data(),pos,name.data(),templSpec.data());
+ // type,pos,qPrint(name),qPrint(templSpec));
return -1;
}
@@ -4583,13 +4545,19 @@ QCString normalizeNonTemplateArgumentsInString(
p++;
QCString result = name.left(p);
- static QRegExp re("[a-z:_A-Z\\x80-\\xFF][a-z:_A-Z0-9\\x80-\\xFF]*");
- int l,i;
+ std::string s = result.mid(p).str();
+ static const reg::Ex re(R"([\a:][\w:]*)");
+ reg::Iterator it(s,re);
+ reg::Iterator end;
+ size_t pi=0;
// for each identifier in the template part (e.g. B<T> -> T)
- while ((i=re.match(name,p,&l))!=-1)
+ for (; it!=end ; ++it)
{
- result += name.mid(p,i-p);
- QCString n = name.mid(i,l);
+ const auto &match = *it;
+ size_t i = match.position();
+ size_t l = match.length();
+ result += s.substr(pi,i-pi);
+ QCString n(match.str());
bool found=FALSE;
for (const Argument &formArg : formalArgs)
{
@@ -4617,10 +4585,10 @@ QCString normalizeNonTemplateArgumentsInString(
{
result+=n;
}
- p=i+l;
+ pi=i+l;
}
- result+=name.right(name.length()-p);
- //printf("normalizeNonTemplateArgumentInString(%s)=%s\n",name.data(),result.data());
+ result+=s.substr(pi);
+ //printf("normalizeNonTemplateArgumentInString(%s)=%s\n",qPrint(name),qPrint(result));
return removeRedundantWhiteSpace(result);
}
@@ -4632,21 +4600,28 @@ QCString normalizeNonTemplateArgumentsInString(
* prevent recursive substitution.
*/
QCString substituteTemplateArgumentsInString(
- const QCString &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;
+ // qPrint(name),qPrint(argListToString(formalArgs)),qPrint(argListToString(actualArgs)));
+ if (formalArgs.empty()) return nm;
QCString result;
- static QRegExp re("[a-z_A-Z\\x80-\\xFF][a-z_A-Z0-9:\\x80-\\xFF]*");
- int p=0,l,i;
- // for each identifier in the base class name (e.g. B<T> -> B and T)
- while ((i=re.match(name,p,&l))!=-1)
+
+ 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;
+
+ for (; it!=end ; ++it)
{
- result += name.mid(p,i-p);
- QCString n = name.mid(i,l);
+ const auto &match = *it;
+ size_t i = match.position();
+ size_t l = match.length();
+ if (i>p) result += name.substr(p,i-p);
+ QCString n(match.str());
ArgumentList::iterator actIt;
if (actualArgs)
{
@@ -4680,9 +4655,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
{
@@ -4711,7 +4686,7 @@ 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,formalArgs,actualArgs)+" ";
@@ -4721,7 +4696,7 @@ 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,formalArgs,actualArgs)+" ";
@@ -4738,9 +4713,9 @@ QCString substituteTemplateArgumentsInString(
}
p=i+l;
}
- result+=name.right(name.length()-p);
+ result+=name.substr(p);
//printf(" Inheritance relation %s -> %s\n",
- // name.data(),result.data());
+ // qPrint(name),qPrint(result));
return result.stripWhiteSpace();
}
@@ -4763,7 +4738,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;
@@ -4786,22 +4761,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;
}
@@ -4836,7 +4811,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;
@@ -4890,15 +4865,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,
@@ -4916,11 +4891,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);
}
@@ -4932,7 +4907,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)));
@@ -4974,11 +4949,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
@@ -4986,10 +4961,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));
}
}
}
@@ -4999,11 +4974,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)
{
@@ -5035,7 +5010,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)
{
@@ -5052,12 +5027,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;
@@ -5204,13 +5179,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++))
@@ -5245,16 +5219,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++))
@@ -5280,7 +5253,7 @@ QCString latexEscapeIndexChars(const char *s)
p++;
}
tmp[i]=0;
- filterLatexString(t,tmp.data(),
+ filterLatexString(t,tmp,
true, // insideTabbing
false, // insidePre
false, // insideItem
@@ -5290,15 +5263,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++))
{
@@ -5315,15 +5287,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++))
{
@@ -5345,32 +5316,28 @@ 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)
{
- static QCString g_nextTag( "AAAAAAAAAA" );
- static QDict<QCString> g_tagDict( 5003 );
-
- g_tagDict.setAutoDelete(TRUE);
+ std::lock_guard<std::mutex> lock(g_rtfFormatMutex);
// To overcome the 40-character tag limitation, we
// substitute a short arbitrary string for the name
// supplied, and keep track of the correspondence
// between names and strings.
- QCString key( name );
- QCString* tag = g_tagDict.find( key );
- if ( !tag )
+ QCString tag = g_nextTag;
+ auto result = g_tagMap.insert( std::make_pair(name.str(), g_nextTag.str()) );
+
+ if (result.second) // new item was added
{
- // This particular name has not yet been added
- // to the list. Add it, associating it with the
- // next tag value, and increment the next tag.
- tag = new QCString( g_nextTag.copy() ); // Make sure to use a deep copy!
- g_tagDict.insert( key, tag );
+ // increment the next tag.
- // This is the increment part
char* nxtTag = g_nextTag.rawData() + g_nextTag.length() - 1;
for ( unsigned int i = 0; i < g_nextTag.length(); ++i, --nxtTag )
{
@@ -5386,8 +5353,8 @@ QCString rtfFormatBmkStr(const char *name)
}
}
- //printf("Name = %s RTF_tag = %s\n",name,(*tag).data());
- return *tag;
+ //printf("Name = %s RTF_tag = %s\n",name,qPrint(*tag)));
+ return tag;
}
bool checkExtension(const char *fName, const char *ext)
@@ -5395,28 +5362,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);
}
@@ -5428,10 +5394,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());
}
}
@@ -5439,7 +5405,7 @@ void replaceNamespaceAliases(QCString &scope,int i)
}
}
-QCString stripPath(const char *s)
+QCString stripPath(const QCString &s)
{
QCString result=s;
int i=result.findRev('/');
@@ -5456,36 +5422,55 @@ QCString stripPath(const char *s)
}
/** returns \c TRUE iff string \a s contains word \a w */
-bool containsWord(const QCString &s,const QCString &word)
+bool containsWord(const QCString &str,const char *word)
{
- static QRegExp wordExp("[a-z_A-Z\\x80-\\xFF]+");
- int p=0,i,l;
- while ((i=wordExp.match(s,p,&l))!=-1)
+ if (str.isEmpty() || word==0) return false;
+ static const reg::Ex re(R"(\a+)");
+ std::string s = str.str();
+ for (reg::Iterator it(s,re) ; it!=reg::Iterator() ; ++it)
{
- if (s.mid(i,l)==word) return TRUE;
- p=i+l;
+ if (it->str()==word) return true;
}
- return FALSE;
+ return false;
}
-bool findAndRemoveWord(QCString &s,const QCString &word)
-{
- static QRegExp wordExp("[a-z_A-Z\\x80-\\xFF]+");
- int p=0,i,l;
- while ((i=wordExp.match(s,p,&l))!=-1)
- {
- if (s.mid(i,l)==word)
+/** removes occurrences of whole \a word from \a sentence,
+ * while keeps internal spaces and reducing multiple sequences of spaces.
+ * Example: sentence=` cat+ catfish cat cat concat cat`, word=`cat` returns: `+ catfish concat`
+ */
+bool findAndRemoveWord(QCString &sentence,const char *word)
+{
+ static reg::Ex re(R"(\s*(\<\a+\>)\s*)");
+ std::string s = sentence.str();
+ reg::Iterator it(s,re);
+ reg::Iterator end;
+ std::string result;
+ bool found=false;
+ size_t p=0;
+ for ( ; it!=end ; ++it)
+ {
+ const auto match = *it;
+ std::string part = match[1].str();
+ if (part!=word)
+ {
+ size_t i = match.position();
+ size_t l = match.length();
+ result+=s.substr(p,i-p);
+ result+=match.str();
+ p=i+l;
+ }
+ else
{
- if (i>0 && isspace((uchar)s.at(i-1)))
- i--,l++;
- else if (i+l<(int)s.length() && isspace((uchar)s.at(i+l)))
- l++;
- s = s.left(i)+s.mid(i+l); // remove word + spacing
- return TRUE;
+ found=true;
+ size_t i = match[1].position();
+ size_t l = match[1].length();
+ result+=s.substr(p,i-p);
+ p=i+l;
}
- p=i+l;
}
- return FALSE;
+ result+=s.substr(p);
+ sentence = QCString(result).simplifyWhiteSpace();
+ return found;
}
/** Special version of QCString::stripWhiteSpace() that only strips
@@ -5498,8 +5483,8 @@ bool findAndRemoveWord(QCString &s,const QCString &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();
@@ -5530,33 +5515,14 @@ 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);
}
-#if 0
-void stringToSearchIndex(const QCString &docBaseUrl,const QCString &title,
- const QCString &str,bool priority,const QCString &anchor)
-{
- static bool searchEngine = Config_getBool(SEARCHENGINE);
- if (searchEngine)
- {
- Doxygen::searchIndex->setCurrentDoc(title,docBaseUrl,anchor);
- static QRegExp wordPattern("[a-z_A-Z\\x80-\\xFF][a-z_A-Z0-9\\x80-\\xFF]*");
- int i,p=0,l;
- while ((i=wordPattern.match(str,p,&l))!=-1)
- {
- Doxygen::searchIndex->addWord(str.mid(i,l),priority);
- p=i+l;
- }
- }
-}
-#endif
-
//--------------------------------------------------------------------------
-static QDict<int> g_extLookup;
+static std::unordered_map<std::string,int> g_extLookup;
static struct Lang2ExtMap
{
@@ -5585,6 +5551,7 @@ g_lang2extMap[] =
{ "xml", "xml", SrcLangExt_XML },
{ "sql", "sql", SrcLangExt_SQL },
{ "md", "md", SrcLangExt_Markdown },
+ { "lex", "lex", SrcLangExt_Lex },
{ 0, 0, (SrcLangExt)0 }
};
@@ -5604,21 +5571,22 @@ bool updateLanguageMapping(const QCString &extension,const QCString &language)
QCString extName = extension.lower();
if (extName.isEmpty()) return FALSE;
if (extName.at(0)!='.') extName.prepend(".");
- if (g_extLookup.find(extension)!=0) // language was already register for this ext
+ auto it = g_extLookup.find(extName.str());
+ if (it!=g_extLookup.end())
{
- g_extLookup.remove(extension);
+ g_extLookup.erase(it); // language was already register for this ext
}
- //printf("registering extension %s\n",extName.data());
- g_extLookup.insert(extName,new int(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;
}
@@ -5626,7 +5594,6 @@ bool updateLanguageMapping(const QCString &extension,const QCString &language)
void initDefaultExtensionMapping()
{
// NOTE: when adding an extension, also add the extension in config.xml
- g_extLookup.setAutoDelete(TRUE);
// extension parser id
updateLanguageMapping(".dox", "c");
updateLanguageMapping(".txt", "c"); // see bug 760836
@@ -5682,6 +5649,9 @@ void initDefaultExtensionMapping()
updateLanguageMapping(".md", "md");
updateLanguageMapping(".markdown", "md");
updateLanguageMapping(".ice", "slice");
+ updateLanguageMapping(".l", "lex");
+ updateLanguageMapping(".doxygen_lex_c", "c"); // this is a placeholder so we can map initializations
+ // in the lex scanning to cpp
}
void addCodeOnlyMappings()
@@ -5692,18 +5662,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(".");
- int *pVal=g_extLookup.find(extName.data());
- if (pVal) // listed extension
- {
- //printf("getLanguageFromFileName(%s)=%x\n",fi.extension().data(),*pVal);
- return (SrcLangExt)*pVal;
- }
- //printf("getLanguageFromFileName(%s) not found!\n",fileName.data());
+ auto it = g_extLookup.find(extName.str());
+ if (it!=g_extLookup.end()) // listed extension
+ {
+ //printf("getLanguageFromFileName(%s)=%x\n",qPrint(fi.extension()),*pVal);
+ return (SrcLangExt)it->second;
+ }
+ //printf("getLanguageFromFileName(%s) not found!\n",qPrint(fileName));
return SrcLangExt_Cpp; // not listed => assume C-ish language.
}
@@ -5718,7 +5688,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 &&
@@ -5746,7 +5716,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;
@@ -5762,7 +5732,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);
}
}
}
@@ -5770,7 +5740,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);
@@ -5780,78 +5750,45 @@ bool checkIfTypedef(const Definition *scope,const FileDef *fileScope,const char
return FALSE;
}
-const char *writeUtf8Char(FTextStream &t,const char *s)
+static int nextUTF8CharPosition(const QCString &utf8Str,uint len,uint startPos)
{
- 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)
-{
- int bytes=1;
if (startPos>=len) return len;
uchar c = (uchar)utf8Str[startPos];
- if (c>=0x80) // multibyte utf-8 character
+ int bytes=getUTF8CharNumBytes(c);
+ if (c=='&') // skip over character entities
{
- 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=1;
+ int (*matcher)(int) = 0;
+ c = (uchar)utf8Str[startPos+bytes];
+ if (c=='#') // numerical entity?
{
- bytes+=3; // 1111.xxxx: >=4 byte character
- }
- if (((uchar)c&0xFC)==0xF8)
- {
- bytes+=4; // 1111.1xxx: >=5 byte character
+ bytes++;
+ c = (uchar)utf8Str[startPos+bytes];
+ if (c=='x') // hexadecimal entity?
+ {
+ bytes++;
+ matcher = std::isxdigit;
+ }
+ else // decimal entity
+ {
+ matcher = std::isdigit;
+ }
}
- if (((uchar)c&0xFE)==0xFC)
+ else if (std::isalnum(c)) // named entity?
{
- bytes+=5; // 1111.1xxx: 6 byte character
+ bytes++;
+ matcher = std::isalnum;
}
- }
- else if (c=='&') // skip over character entities
- {
- static QRegExp re1("&#[0-9]+;"); // numerical entity
- static QRegExp re2("&[A-Z_a-z]+;"); // named entity
- int l1,l2;
- int i1 = re1.match(utf8Str,startPos,&l1);
- int i2 = re2.match(utf8Str,startPos,&l2);
- if (i1!=-1)
+ if (matcher)
{
- bytes=l1;
+ while ((c = (uchar)utf8Str[startPos+bytes])!=0 && matcher(c))
+ {
+ bytes++;
+ }
}
- else if (i2!=-1)
+ if (c!=';')
{
- bytes=l2;
+ bytes=1; // not a valid entity, reset bytes counter
}
}
return startPos+bytes;
@@ -5860,28 +5797,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();
- 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)==',' ||
@@ -5901,7 +5838,7 @@ QCString parseCommentAsText(const Definition *scope,const MemberDef *md,
//--------------------------------------------------------------------------------------
static QCString expandAliasRec(StringUnorderedSet &aliasesProcessed,
- const QCString s,bool allowRecursion=FALSE);
+ const QCString &s,bool allowRecursion=FALSE);
struct Marker
{
@@ -5946,7 +5883,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;
@@ -5984,7 +5921,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
@@ -6010,17 +5947,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),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,"\\{","{");
@@ -6032,39 +5969,43 @@ 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 QCString s,bool allowRecursion)
+static QCString expandAliasRec(StringUnorderedSet &aliasesProcessed,const QCString &s,bool allowRecursion)
{
QCString result;
- static QRegExp cmdPat("[\\\\@][a-z_A-Z][a-z_A-Z0-9]*");
- QCString value=s;
- int i,p=0,l;
- while ((i=cmdPat.match(value,p,&l))!=-1)
+ static const reg::Ex re(R"([\\@](\a\w*))");
+ std::string str = s.str();
+ reg::Match match;
+ size_t p = 0;
+ while (search(str,match,re,p))
{
- result+=value.mid(p,i-p);
- QCString args = extractAliasArgs(value,i+l);
+ size_t i = match.position();
+ size_t l = match.length();
+ if (i>p) result+=s.mid(p,i-p);
+
+ QCString args = extractAliasArgs(s,i+l);
bool hasArgs = !args.isEmpty(); // found directly after command
int argsLen = args.length();
- QCString cmd = value.mid(i+1,l-1);
+ QCString cmd = match[1].str();
QCString cmdNoArgs = cmd;
int numArgs=0;
if (hasArgs)
@@ -6072,12 +6013,12 @@ static QCString expandAliasRec(StringUnorderedSet &aliasesProcessed,const QCStri
numArgs = countAliasArguments(args);
cmd += QCString().sprintf("{%d}",numArgs); // alias name + {n}
}
- QCString *aliasText=Doxygen::aliasDict.find(cmd);
- if (numArgs>1 && aliasText==0)
+ auto it = Doxygen::aliasMap.find(cmd.str());
+ if (numArgs>1 && it==Doxygen::aliasMap.end())
{ // in case there is no command with numArgs parameters, but there is a command with 1 parameter,
// we also accept all text as the argument of that command (so you don't have to escape commas)
- aliasText=Doxygen::aliasDict.find(cmdNoArgs+"{1}");
- if (aliasText)
+ it = Doxygen::aliasMap.find((cmdNoArgs+"{1}").str());
+ if (it!=Doxygen::aliasMap.end())
{
cmd = cmdNoArgs+"{1}";
args = escapeCommas(args); // escape , so that everything is seen as one argument
@@ -6086,11 +6027,11 @@ static QCString expandAliasRec(StringUnorderedSet &aliasesProcessed,const QCStri
//printf("Found command s='%s' cmd='%s' numArgs=%d args='%s' aliasText=%s\n",
// s.data(),cmd.data(),numArgs,args.data(),aliasText?aliasText->data():"<none>");
if ((allowRecursion || aliasesProcessed.find(cmd.str())==aliasesProcessed.end()) &&
- aliasText) // expand the alias
+ it!=Doxygen::aliasMap.end()) // expand the alias
{
//printf("is an alias!\n");
if (!allowRecursion) aliasesProcessed.insert(cmd.str());
- QCString val = *aliasText;
+ QCString val(it->second);
if (hasArgs)
{
val = replaceAliasArguments(aliasesProcessed,val,args);
@@ -6105,18 +6046,18 @@ static QCString expandAliasRec(StringUnorderedSet &aliasesProcessed,const QCStri
else // command is not an alias
{
//printf("not an alias!\n");
- result+=value.mid(i,l);
+ result+=match.str();
p=i+l;
}
}
- result+=value.right(value.length()-p);
+ result+=s.right(s.length()-p);
//printf("expandAliases '%s'->'%s'\n",s.data(),result.data());
return result;
}
-int countAliasArguments(const QCString argList)
+int countAliasArguments(const QCString &argList)
{
int count=1;
int l = argList.length();
@@ -6157,7 +6098,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);
}
}
@@ -6165,27 +6106,27 @@ 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);
- //printf("Expanding result: '%s'->'%s'\n",aliasCmd.data(),result.data());
+ //printf("Expanding result: '%s'->'%s'\n",qPrint(aliasCmd),qPrint(result));
return result;
}
-QCString expandAlias(const QCString &aliasName,const QCString &aliasValue)
+std::string expandAlias(const std::string &aliasName,const std::string &aliasValue)
{
QCString result;
StringUnorderedSet aliasesProcessed;
// avoid expanding this command recursively
- aliasesProcessed.insert(aliasName.str());
+ aliasesProcessed.insert(aliasName);
// expand embedded commands
- //printf("Expanding: '%s'->'%s'\n",aliasName.data(),aliasValue.data());
- result = expandAliasRec(aliasesProcessed,aliasValue);
- //printf("Expanding result: '%s'->'%s'\n",aliasName.data(),result.data());
- return result;
+ //printf("Expanding: '%s'->'%s'\n",qPrint(aliasName),qPrint(aliasValue));
+ result = expandAliasRec(aliasesProcessed,aliasValue.c_str());
+ //printf("Expanding result: '%s'->'%s'\n",qPrint(aliasName),qPrint(result));
+ return result.str();
}
void writeTypeConstraints(OutputList &ol,const Definition *d,const ArgumentList &al)
@@ -6202,7 +6143,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();
@@ -6237,23 +6178,23 @@ 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);
+ void *cd = portable_iconv_open(outputEncoding.data(),inputEncoding.data());
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);
size_t iLeft=size;
size_t oLeft=tmpBufSize;
- char *srcPtr = srcBuf.data();
+ const char *srcPtr = srcBuf.data();
char *dstPtr = tmpBuf.data();
uint newSize=0;
if (!portable_iconv(cd, &srcPtr, &iLeft, &dstPtr, &oLeft))
@@ -6261,42 +6202,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;
}
}
@@ -6307,7 +6247,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;
@@ -6359,11 +6299,11 @@ 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;
@@ -6372,16 +6312,22 @@ bool readInputFile(const char *fileName,BufStr &inBuf,bool filter,bool isSourceC
// Replace %word by word in title
QCString filterTitle(const QCString &title)
{
- QCString tf;
- static QRegExp re("%[A-Z_a-z]");
- int p=0,i,l;
- while ((i=re.match(title,p,&l))!=-1)
- {
- tf+=title.mid(p,i-p);
- tf+=title.mid(i+1,l-1); // skip %
+ std::string tf;
+ std::string t = title.str();
+ static const reg::Ex re(R"(%[a-z_A-Z]+)");
+ reg::Iterator it(t,re);
+ reg::Iterator end;
+ size_t p = 0;
+ for (; it!=end ; ++it)
+ {
+ const auto &match = *it;
+ size_t i = match.position();
+ size_t l = match.length();
+ if (i>p) tf+=t.substr(p,i-p);
+ tf+=match.str().substr(1); // skip %
p=i+l;
}
- tf+=title.right(title.length()-p);
+ tf+=t.substr(p);
return tf;
}
@@ -6389,7 +6335,7 @@ QCString filterTitle(const QCString &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;
@@ -6402,62 +6348,37 @@ bool patternMatch(const QFileInfo &fi,const StringVector &patList)
if (!patList.empty())
{
- QCString fn = fi.fileName().data();
- QCString fp = fi.filePath().data();
- QCString afp= fi.absFilePath().data();
+ std::string fn = fi.fileName();
+ std::string fp = fi.filePath();
+ std::string afp= fi.absFilePath();
- for (const auto &pat: patList)
+ for (auto pattern: patList)
{
- QCString pattern = pat.c_str();
- if (!pattern.isEmpty())
+ if (!pattern.empty())
{
- int i=pattern.find('=');
- if (i!=-1) pattern=pattern.left(i); // strip of the extension specific filter name
-
- QRegExp re(pattern,caseSenseNames,TRUE);
+ size_t i=pattern.find('=');
+ if (i!=std::string::npos) pattern=pattern.substr(0,i); // strip of the extension specific filter name
- found = re.match(fn)!=-1 ||
- re.match(fp)!=-1 ||
- re.match(afp)!=-1;
+ if (!caseSenseNames)
+ {
+ pattern = QCString(pattern).lower().str();
+ fn = 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) ||
+ (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);
}
}
}
return found;
}
-#if 0 // move to HtmlGenerator::writeSummaryLink
-void writeSummaryLink(OutputList &ol,const char *label,const char *title,
- bool &first,const char *file)
-{
- if (first)
- {
- ol.writeString(" <div class=\"summary\">\n");
- first=FALSE;
- }
- else
- {
- ol.writeString(" &#124;\n");
- }
- if (file)
- {
- ol.writeString("<a href=\"");
- ol.writeString(file);
- ol.writeString(Doxygen::htmlFileExtension);
- }
- else
- {
- ol.writeString("<a href=\"#");
- ol.writeString(label);
- }
- ol.writeString("\">");
- ol.writeString(title);
- ol.writeString("</a>");
-}
-#endif
-
QCString externalLinkTarget(const bool parent)
{
static bool extLinksInWindow = Config_getBool(EXT_LINKS_IN_WINDOW);
@@ -6474,10 +6395,10 @@ QCString externalRef(const QCString &relPath,const QCString &ref,bool href)
QCString result;
if (!ref.isEmpty())
{
- QCString *dest = Doxygen::tagDestinationDict[ref];
- if (dest)
+ auto it = Doxygen::tagDestinationMap.find(ref.str());
+ if (it!=Doxygen::tagDestinationMap.end())
{
- result = *dest;
+ result = it->second;
int l = result.length();
if (!relPath.isEmpty() && l>0 && result.at(0)=='.')
{ // relative path -> prepend relPath.
@@ -6498,23 +6419,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);
}
@@ -6528,20 +6443,26 @@ 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 result;
- QCString s=str;
- if (s.isEmpty()) return result;
- static QRegExp re("##[0-9A-Fa-f][0-9A-Fa-f]");
+QCString replaceColorMarkers(const QCString &str)
+{
+ if (str.isEmpty()) return QCString();
+ std::string result;
+ 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;
static int hue = Config_getInt(HTML_COLORSTYLE_HUE);
static int sat = Config_getInt(HTML_COLORSTYLE_SAT);
static int gamma = Config_getInt(HTML_COLORSTYLE_GAMMA);
- int i,l,sl=s.length(),p=0;
- while ((i=re.match(s,p,&l))!=-1)
- {
- result+=s.mid(p,i-p);
- QCString lumStr = s.mid(i+2,l-2);
+ size_t sl=s.length();
+ size_t p=0;
+ for (; it!=end ; ++it)
+ {
+ const auto &match = *it;
+ size_t i = match.position();
+ size_t l = match.length();
+ if (i>p) result+=s.substr(p,i-p);
+ std::string lumStr = match.str().substr(2);
#define HEXTONUM(x) (((x)>='0' && (x)<='9') ? ((x)-'0') : \
((x)>='a' && (x)<='f') ? ((x)-'a'+10) : \
((x)>='A' && (x)<='F') ? ((x)-'A'+10) : 0)
@@ -6563,11 +6484,11 @@ 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;
}
- result+=s.right(sl-p);
+ if (p<sl) result+=s.substr(p);
return result;
}
@@ -6576,38 +6497,19 @@ QCString replaceColorMarkers(const char *str)
*/
bool copyFile(const QCString &src,const QCString &dest)
{
- QFile sf(src);
- if (sf.open(IO_ReadOnly))
- {
- 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
+ if (!Dir().copy(src.str(),dest.str()))
{
- 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;
@@ -6645,14 +6547,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;
@@ -6693,6 +6595,7 @@ QCString langToString(SrcLangExt lang)
case SrcLangExt_SQL: return "SQL";
case SrcLangExt_Markdown: return "Markdown";
case SrcLangExt_Slice: return "Slice";
+ case SrcLangExt_Lex: return "Lex";
}
return "Unknown";
}
@@ -6754,7 +6657,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;
@@ -6778,7 +6681,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++))
@@ -6786,7 +6689,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
{
@@ -6796,7 +6699,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;
@@ -6808,12 +6711,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)
@@ -6862,7 +6764,7 @@ void stripIndentation(QCString &doc,const int indentationLevel)
break;
}
}
- doc.resize(dst-doc.data()+1);
+ doc.resize(static_cast<uint>(dst-doc.data())+1);
}
@@ -6880,6 +6782,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
@@ -6944,6 +6847,9 @@ uint getUtf8CodeToUpper( const QCString& s, int idx )
const uint v = getUtf8Code( s, idx );
return v < 0x7f ? toupper( v ) : v;
}
+#endif
+
+
//--------------------------------------------------------------------------------------
//
@@ -6959,14 +6865,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;
}
}
@@ -6992,7 +6918,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;
}
}
@@ -7009,27 +6935,43 @@ bool classVisibleInIndex(const ClassDef *cd)
//----------------------------------------------------------------------------
+/** Strip the direction part from docs and return it as a string in canonical form
+ * The input \a docs string can start with e.g. "[in]", "[in, out]", "[inout]", "[out,in]"...
+ * @returns either "[in,out]", "[in]", or "[out]" or the empty string.
+ */
QCString extractDirection(QCString &docs)
{
- QRegExp re("\\[[ inout,]+\\]"); // [...]
- int l=0;
- if (re.match(docs,0,&l)==0 && l>2)
+ std::string s = docs.str();
+ static const reg::Ex re(R"(\[([ inout,]+)\])");
+ reg::Iterator it(s,re);
+ reg::Iterator end;
+ if (it!=end)
{
- // make dir the part inside [...] without separators
- QCString dir=substitute(substitute(docs.mid(1,l-2)," ",""),",","");
- int inIndex, outIndex;
- unsigned char ioMask=0;
- if (( inIndex=dir.find( "in"))!=-1) dir.remove (inIndex,2),ioMask|=(1<<0);
- if ((outIndex=dir.find("out"))!=-1) dir.remove(outIndex,3),ioMask|=(1<<1);
- if (dir.isEmpty() && ioMask!=0) // only in and/or out attributes found
+ const auto &match = *it;
+ size_t p = match.position();
+ size_t l = match.length();
+ if (p==0 && l>2)
{
- docs = docs.mid(l); // strip attributes
- if (ioMask==((1<<0)|(1<<1))) return "[in,out]";
- else if (ioMask==(1<<0)) return "[in]";
- else if (ioMask==(1<<1)) return "[out]";
+ // make dir the part inside [...] without separators
+ std::string dir = match[1].str();
+ // strip , and ' ' from dir
+ dir.erase(std::remove_if(dir.begin(),dir.end(),
+ [](const char c) { return c==' ' || c==','; }
+ ),dir.end());
+ size_t inIndex, outIndex;
+ unsigned char ioMask=0;
+ if (( inIndex=dir.find( "in"))!=std::string::npos) dir.erase( inIndex,2),ioMask|=(1<<0);
+ if ((outIndex=dir.find("out"))!=std::string::npos) dir.erase(outIndex,3),ioMask|=(1<<1);
+ if (dir.empty() && ioMask!=0) // only in and/or out attributes found
+ {
+ docs = s.substr(l); // strip attributes
+ if (ioMask==((1<<0)|(1<<1))) return "[in,out]";
+ else if (ioMask==(1<<0)) return "[in]";
+ else if (ioMask==(1<<1)) return "[out]";
+ }
}
}
- return QCString();
+ return "";
}
//-----------------------------------------------------------
@@ -7235,32 +7177,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);
@@ -7278,7 +7222,7 @@ void writeExtraLatexPackages(FTextStream &t)
}
}
-void writeLatexSpecialFormulaChars(FTextStream &t)
+void writeLatexSpecialFormulaChars(TextStream &t)
{
unsigned char minus[4]; // Superscript minus
char *pminus = (char *)minus;
@@ -7306,7 +7250,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;
@@ -7314,10 +7258,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;
@@ -7351,7 +7297,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;
@@ -7361,18 +7307,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;
@@ -7383,15 +7329,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;
}
@@ -7469,6 +7415,110 @@ 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();
}
+
+/// split input string \a s by string delimiter \a delimiter.
+/// returns a vector of non-empty strings that are between the delimiters
+StringVector split(const std::string &s,const std::string &delimiter)
+{
+ StringVector result;
+ size_t prev = 0, pos = 0, len = s.length();
+ do
+ {
+ pos = s.find(delimiter, prev);
+ if (pos == std::string::npos) pos = len;
+ if (pos>prev) result.push_back(s.substr(prev,pos-prev));
+ prev = pos + delimiter.length();
+ }
+ while (pos<len && prev<len);
+ return result;
+}
+
+/// split input string \a s by regular expression delimiter \a delimiter.
+/// returns a vector of non-empty strings that are between the delimiters
+StringVector split(const std::string &s,const reg::Ex &delimiter)
+{
+ StringVector result;
+ reg::Iterator iter(s, delimiter);
+ reg::Iterator end;
+ size_t p=0;
+ for ( ; iter != end; ++iter)
+ {
+ const auto &match = *iter;
+ size_t i=match.position();
+ size_t l=match.length();
+ if (i>p) result.push_back(s.substr(p,i-p));
+ p=i+l;
+ }
+ if (p<s.length()) result.push_back(s.substr(p));
+ return result;
+}
+
+/// find the index of a string in a vector of strings, returns -1 if the string could not be found
+int findIndex(const StringVector &sv,const std::string &s)
+{
+ auto it = std::find(sv.begin(),sv.end(),s);
+ return it!=sv.end() ? (int)(it-sv.begin()) : -1;
+}
+
+/// find the index of the first occurrence of pattern \a re in a string \a s
+/// returns -1 if the pattern could not be found
+int findIndex(const std::string &s,const reg::Ex &re)
+{
+ reg::Match match;
+ 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;
+}
+
+QCString integerToAlpha(int n, bool upper)
+{
+ QCString result;
+ int residual = n;
+
+ char modVal[2];
+ modVal[1] = 0;
+ while (residual > 0)
+ {
+ modVal[0] = (upper ? 'A': 'a') + (residual-1)%26;
+ result = modVal + result;
+ residual = (residual-1) / 26;
+ }
+ return result;
+}
+
+QCString integerToRoman(int n, bool upper)
+{
+ static const char *str_romans_upper[] = { "M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I" };
+ static const char *str_romans_lower[] = { "m", "cm", "d", "cd", "c", "xc", "l", "xl", "x", "ix", "v", "iv", "i" };
+ static const int values[] = { 1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1 };
+ static const char **str_romans = upper ? str_romans_upper : str_romans_lower;
+
+ QCString result;
+ int residual = n;
+
+ for (int i = 0; i < 13; ++i)
+ {
+ while (residual - values[i] >= 0)
+ {
+ result += str_romans[i];
+ residual -= values[i];
+ }
+ }
+
+ return result;
+}
diff --git a/src/util.h b/src/util.h
index 6d50d88..3034c23 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
@@ -25,17 +23,20 @@
#include <memory>
#include <unordered_map>
#include <algorithm>
+#include <functional>
+#include <fstream>
-#include <qlist.h>
#include <ctype.h>
#include "types.h"
-#include "sortdict.h"
#include "docparser.h"
#include "classdef.h"
#include "arguments.h"
#include "containers.h"
#include "namespacedef.h"
#include "outputgen.h"
+#include "regex.h"
+#include "dir.h"
+#include "conceptdef.h"
//--------------------------------------------------------------------
@@ -48,19 +49,13 @@ class ArgumentList;
class OutputList;
class OutputDocInterface;
class MemberDef;
-class ExampleSDict;
class GroupDef;
-class NamespaceSDict;
struct TagInfo;
class PageDef;
class SectionInfo;
-class QDir;
class Definition;
class BufStr;
-class QFileInfo;
-class QStrList;
-class FTextStream;
-class QFile;
+class FileInfo;
//--------------------------------------------------------------------
@@ -69,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;
};
@@ -82,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;
@@ -102,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,
@@ -126,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,
@@ -138,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
@@ -148,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);
@@ -172,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);
@@ -218,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 QCString &s);
-QCString replaceAnonymousScopes(const QCString &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,
@@ -244,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, bool applyTextDir = true);
+QCString convertToJSString(const QCString &s);
-QCString convertToPSString(const char *s);
+QCString convertToPSString(const QCString &s);
QCString getOverloadDocs();
@@ -294,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(),
@@ -314,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);
@@ -349,15 +353,15 @@ 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 QCString &s,const QCString &word);
+bool containsWord(const QCString &s,const char *word);
-bool findAndRemoveWord(QCString &s,const QCString &word);
+bool findAndRemoveWord(QCString &s,const char *word);
QCString stripLeadingAndTrailingEmptyLines(const QCString &s,int &docLine);
@@ -367,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);
@@ -377,10 +381,10 @@ 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 expandAlias(const QCString &aliasName,const QCString &aliasValue);
+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);
@@ -388,17 +392,18 @@ 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 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);
/** Data associated with a HSV colored image. */
struct ColoredImgDataItem
@@ -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,11 +447,20 @@ 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);
+QCString integerToAlpha(int n, bool upper=true);
+QCString integerToRoman(int n, bool upper=true);
+
#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 0f52356..8908976 100644
--- a/src/vhdlcode.l
+++ b/src/vhdlcode.l
@@ -37,9 +37,6 @@
#include <stdio.h>
#include <assert.h>
#include <ctype.h>
-#include <qregexp.h>
-#include <qdir.h>
-#include <qcstringlist.h>
#include "vhdlcode.h"
#include "entry.h"
@@ -55,6 +52,7 @@
#include "classdef.h"
#include "filedef.h"
#include "tooltip.h"
+#include "regex.h"
#define YY_NO_INPUT 1
#define YY_NO_UNISTD_H 1
@@ -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,
- Definition *d,
- const char *text);
-static void generateFuncLink(yyscan_t yyscanner,CodeOutputInterface &ol,MemberDef* mdef);
+ const Definition *d,
+ 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);
@@ -226,12 +224,11 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
<Map>[^()\n,--]* { /* write and link a port map lines */
QCString tt(yytext);
VhdlDocGen::deleteAllChars(tt,',');
- QRegExp r("=>");
- QCStringList ql=QCStringList::split(r,tt);
- if (ql.count()>=2)
+ auto ql = split(tt.str(),"=>");
+ 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')
{
@@ -262,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')
@@ -290,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);
}
@@ -325,7 +322,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
QCString qcs(yytext);
VhdlDocGen::deleteAllChars(qcs,'"');
VhdlDocGen::deleteAllChars(qcs,' ');
- if (VhdlDocGen::isNumber(qcs))
+ if (VhdlDocGen::isNumber(qcs.str()))
{
writeFont(yyscanner,"vhdllogic",yytext);
}
@@ -355,17 +352,17 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
}
<ParseType>{ENDEFUNC} {
- QRegExp regg("[\\s]");
QCString tt(yytext);
- codifyLines(yyscanner,yytext,yyextra->currClass.data());
+ codifyLines(yyscanner,yytext,yyextra->currClass);
tt=tt.lower();
VhdlDocGen::deleteAllChars(tt,';');
tt.stripWhiteSpace();
- QCStringList ql=QCStringList::split(regg,tt);
- int index=ql.findIndex(QCString("if"))+1;
- index+=ql.findIndex(QCString("case"))+1;
- index+=ql.findIndex(QCString("loop"))+1;
- index+=ql.findIndex(QCString("generate"))+1;
+ static const reg::Ex regg(R"(\s+)"); // any number of whitespace
+ auto ql = split(tt.str(),regg);
+ int index=findIndex(ql,"if")+1;
+ index+=findIndex(ql,"case")+1;
+ index+=findIndex(ql,"loop")+1;
+ index+=findIndex(ql,"generate")+1;
if (index==0)
{
BEGIN(Bases);
@@ -377,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;
}
@@ -390,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);
}
}
@@ -412,10 +409,10 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
yyextra->vhdlKeyDict.find(yyextra->prevString.str())==yyextra->vhdlKeyDict.end())
{
val=val.stripWhiteSpace();
- if (VhdlDocGen::isNumber(val))
+ if (VhdlDocGen::isNumber(val.str()))
{
startFontClass(yyscanner,"vhdllogic");
- codifyLines(yyscanner,yytext,yyextra->currClass.data());
+ codifyLines(yyscanner,yytext,yyextra->currClass);
endFontClass(yyscanner);
}
else
@@ -425,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);
}
}
}
@@ -575,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
{
@@ -610,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);
}
}
}
@@ -638,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;
@@ -655,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);
@@ -671,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;
}
@@ -679,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;
@@ -747,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
@@ -776,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>";" {
@@ -814,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);
}
@@ -847,7 +843,7 @@ XILINX "INST"|"NET"|"PIN"|"BLKNM"|"BUFG"|"COLLAPSE"|"CPLD"|"COMPGRP"|"CONFI
VhdlDocGen::deleteAllChars(qcs,'"');
VhdlDocGen::deleteAllChars(qcs,' ');
- if (VhdlDocGen::isNumber(qcs))
+ if (VhdlDocGen::isNumber(qcs.str()))
{
writeFont(yyscanner,"vhdllogic",yytext);
}
@@ -863,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]* {
@@ -955,41 +951,41 @@ static bool checkVhdlString(yyscan_t yyscanner,QCString &name)
{
struct yyguts_t *yyg = (struct yyguts_t*)yyscanner;
if (name.isEmpty()) return false;
- static QRegExp regg("[\\s\"]");
int len=name.length();
if (name.at(0)=='"' && name.at(len-1)=='"' && len > 2)
{
- QCStringList qrl=QCStringList::split(regg,name);
+ std::string inside = name.str().substr(1,len-2);
+ static const reg::Ex regg(R"(\s+)"); // any number of whitespace
+ auto qrl=split(inside,regg);
if (VhdlDocGen::isNumber(qrl[0]))
{
yyextra->code->codify("\"");
startFontClass(yyscanner,"vhdllogic");
- QCString mid=name.mid(1,len-2); //" 1223 "
- yyextra->code->codify(mid.data());
+ yyextra->code->codify(inside.c_str());
endFontClass(yyscanner);
yyextra->code->codify("\"");
}
else
{
startFontClass(yyscanner,"keyword");
- yyextra->code->codify(name.data());
+ yyextra->code->codify(name);
endFontClass(yyscanner);
}
return true;
}
- if (VhdlDocGen::isNumber(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)
@@ -1015,16 +1011,16 @@ 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();
- MemberDef* mdeff=VhdlDocGen::findMember(yyextra->tempComp,nn);
+ const MemberDef* mdeff=VhdlDocGen::findMember(yyextra->tempComp,nn);
if (mdeff)
{
yyextra->currentMemberDef=mdeff;
@@ -1044,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);
@@ -1088,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;
@@ -1106,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)
@@ -1123,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);
}
}
}
@@ -1160,14 +1156,17 @@ static void writeWord(yyscan_t yyscanner,const char *word,const char* curr_class
}
else
{
- QCString qc(temp.data());
- if (VhdlDocGen::isNumber(qc)){
- startFontClass(yyscanner,"vhdllogic");
- yyextra->code->codify(temp.data());
- endFontClass(yyscanner);
- }
+ QCString qc(temp);
+ if (VhdlDocGen::isNumber(qc.str()))
+ {
+ startFontClass(yyscanner,"vhdllogic");
+ yyextra->code->codify(temp);
+ endFontClass(yyscanner);
+ }
else
- yyextra->code->codify(temp.data());
+ {
+ yyextra->code->codify(temp);
+ }
}
}
}
@@ -1177,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)
@@ -1196,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
{
@@ -1224,10 +1223,11 @@ static void codifyLines(yyscan_t yyscanner,const char *text,const char *cl,bool
* 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)
+ const Definition *d,
+ 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();
@@ -1239,18 +1239,17 @@ static void writeMultiLineCodeLink(yyscan_t yyscanner,CodeOutputInterface &ol,
tooltip = d->briefDescriptionAsTooltip();
}
bool done=false;
- char *p=(char *)text;
+ const char *p=text.data();
while (!done)
{
- char *sp=p;
+ const char *sp=p;
char c;
while ((c=*p++) && c!='\n') {}
if (c=='\n')
{
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,p-sp-1),tooltip);
nextCodeLine(yyscanner);
}
else
@@ -1263,9 +1262,9 @@ static void writeMultiLineCodeLink(yyscan_t yyscanner,CodeOutputInterface &ol,
/*! writes a link to a function or procedure
*/
-static void generateFuncLink(yyscan_t yyscanner,CodeOutputInterface &ol,MemberDef* mdef)
+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
@@ -1274,7 +1273,7 @@ static void generateFuncLink(yyscan_t yyscanner,CodeOutputInterface &ol,MemberDe
addToSearchIndex(yyscanner,memberName);
return;
}
- codifyLines(yyscanner,memberName.data());
+ codifyLines(yyscanner,memberName);
addToSearchIndex(yyscanner,memberName);
} // generateFuncLink
@@ -1284,19 +1283,18 @@ static void generateMemLink(yyscan_t yyscanner,CodeOutputInterface &ol,QCString
if (memberName.isEmpty()) return;
if (clName.isEmpty())
{
- codifyLines(yyscanner,memberName.data());
+ codifyLines(yyscanner,memberName);
return;
}
QCString className=clName;
- MemberDef *md=0;
//MemberDef *comp=0;
//bool isLocal=false;
- md=VhdlDocGen::findMember(className,memberName);
- ClassDef *po=VhdlDocGen::getClass(className.data());
+ const MemberDef *md=VhdlDocGen::findMember(className,memberName);
+ ClassDef *po=VhdlDocGen::getClass(className);
if (md==0 && po && (VhdlDocGen::VhdlClasses)po->protection()==VhdlDocGen::PACKBODYCLASS)
{
@@ -1312,12 +1310,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;
@@ -1327,10 +1326,16 @@ 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())
{
- if (QCString(curr_class).contains(QRegExp("::"+QCString(clName)+"$"))) cd = getClass(curr_class);
+ QCString cls = curr_class;
+ QCString suffix = "::";
+ suffix+=clName;
+ if (cls.right(suffix.length())==suffix)
+ {
+ cd = getClass(curr_class);
+ }
}
while (cd)
@@ -1405,10 +1410,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);
@@ -1425,16 +1430,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)
@@ -1473,7 +1478,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
@@ -1491,30 +1496,30 @@ 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)
{
temp.stripPrefix("_");// _{package body name}
}
- MemberDef *mdef=VhdlDocGen::findFunction(name,temp);
+ const MemberDef *mdef=VhdlDocGen::findFunction(name,temp);
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
@@ -1523,7 +1528,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
@@ -1535,7 +1540,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;
@@ -1569,11 +1574,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,
@@ -1587,7 +1592,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();
@@ -1595,7 +1600,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;
@@ -1660,7 +1665,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 7afc832..f0763db 100644
--- a/src/vhdldocgen.cpp
+++ b/src/vhdldocgen.cpp
@@ -25,13 +25,13 @@
#include <assert.h>
#include <string.h>
#include <map>
-#include <qcstring.h>
-#include <qfileinfo.h>
-#include <qcstringlist.h>
+#include <algorithm>
+
/* --------------------------------------------------------------- */
// local includes
+#include "qcstring.h"
#include "vhdldocgen.h"
#include "message.h"
#include "config.h"
@@ -59,28 +59,28 @@
#include "plantuml.h"
#include "vhdljjparser.h"
#include "VhdlParser.h"
-//#include "vhdlcode.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 QList<MemberDef>* getPorts(ClassDef *cd);
-static void writeVhdlEntityToolTip(FTextStream& t,ClassDef *cd);
-static void endDot(FTextStream &t);
-static void writeTable(QList<MemberDef>* port,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 writeVhdlPortToolTip(FTextStream& t,QList<MemberDef>* port,ClassDef *cd);
+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(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)
@@ -96,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)
{
@@ -135,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();
}
@@ -188,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);
@@ -206,25 +205,18 @@ void VhdlDocGen::writeOverview()
continue;
}
- QList<MemberDef>* port= getPorts(cd.get());
- if (port==0)
- {
- continue;
- }
- if (port->count()==0)
+ std::vector<const MemberDef *> ports = getPorts(cd.get());
+ if (ports.empty())
{
- delete port;
- port=NULL;
continue;
}
startTable(t,cd->name());
writeClassToDot(t,cd.get());
- writeTable(port,t);
+ writeTable(ports,t);
endTable(t);
writeVhdlEntityToolTip(t,cd.get());
- delete port;
for (const auto &bcd : cd->baseClasses())
{
@@ -233,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";
@@ -254,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;
@@ -279,55 +272,23 @@ static void writeVhdlDotLink(FTextStream &t,
static QCString formatBriefNote(const QCString &brief,ClassDef * cd)
{
- QRegExp ep("[\n]");
QCString vForm;
QCString repl("<BR ALIGN=\"LEFT\"/>");
QCString file=cd->getDefFileName();
int k=cd->briefLine();
- QCStringList qsl=QCStringList::split(ep,brief);
- for(uint j=0;j<qsl.count();j++)
+ auto qsl=split(brief.str(),"\n");
+ for(const auto &line : qsl)
{
- QCString qcs=qsl[j];
- vForm+=parseCommentAsText(cd,NULL,qcs,file,k);
+ vForm+=parseCommentAsText(cd,NULL,line.c_str(),file,k);
k++;
- vForm+='\n';
+ vForm+=repl;
}
-
- vForm.replace(ep,repl.data());
return vForm;
}
-#if 0
-static void writeVhdlPortToolTip(FTextStream& t,QList<MemberDef>* port,ClassDef *cd)
-{
-/*
- uint len=port->count();
- MemberDef *md;
-
- for (uint j=0;j<len;j++)
- {
- md=(MemberDef*)port->at(j);
- QCString brief=md->briefDescriptionAsTooltip();
- if (brief.isEmpty()) continue;
-
- QCString node="node";
- node+=VhdlDocGen::getRecordNumber();
- t << node <<"[shape=box margin=0.1, label=<\n";
- t<<"<TABLE BORDER=\"0\" CELLBORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"2\" >\n ";
- t<<"<TR><TD BGCOLOR=\"lightcyan\"> ";
- t<<brief;
- t<<" </TD></TR></TABLE>>];";
- QCString dotn=cd->name()+":";
- dotn+=md->name();
- // writeVhdlDotLink(t,dotn,node,"dotted");
- }
-*/
-}
-#endif
-
-static void writeVhdlEntityToolTip(FTextStream& t,ClassDef *cd)
+static void writeVhdlEntityToolTip(TextStream& t,ClassDef *cd)
{
QCString brief=cd->briefDescription();
@@ -348,11 +309,10 @@ static void writeVhdlEntityToolTip(FTextStream& t,ClassDef *cd)
writeVhdlDotLink(t,dotn,node,"dotted");
}
-static void writeColumn(FTextStream &t,MemberDef *md,bool start)
+static void writeColumn(TextStream &t,const MemberDef *md,bool start)
{
QCString toolTip;
- static QRegExp reg("[%]");
bool bidir=(md!=0 &&( qstricmp(md->typeString(),"inout")==0));
if (md)
@@ -361,10 +321,8 @@ static void writeColumn(FTextStream &t,MemberDef *md,bool start)
if (!toolTip.isEmpty())
{
QCString largs = md->argsString();
- if (!largs.isEmpty())
- largs=largs.replace(reg," ");
toolTip+=" [";
- toolTip+=largs;
+ toolTip+=substitute(largs,"%"," ");
toolTip+="]";
}
}
@@ -384,15 +342,15 @@ static void writeColumn(FTextStream &t,MemberDef *md,bool start)
t<<" TOOLTIP=\"";
if (!toolTip.isEmpty())
{
- codify(t,toolTip.data());
+ codify(t,toolTip);
}
else
{
QCString largs = md->argsString();
if (!largs.isEmpty())
{
- largs=largs.replace(reg," ");
- codify(t,largs.data());
+ largs=substitute(largs,"%"," ");
+ codify(t,largs);
}
}
t << "\" ";
@@ -434,13 +392,13 @@ static void writeColumn(FTextStream &t,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=\"";
@@ -454,59 +412,49 @@ static void writeClassToDot(FTextStream &t,ClassDef* cd)
t << " </TD></TR>\n";
}
-static QList<MemberDef>* getPorts(ClassDef *cd)
+static std::vector<const MemberDef*> getPorts(const ClassDef *cd)
{
- MemberDef* md;
- QList<MemberDef> *portList=new QList<MemberDef>;
- MemberList *ml=cd->getMemberList(MemberListType_variableMembers);
+ MemberList *ml = cd->getMemberList(MemberListType_variableMembers);
+ std::vector<const MemberDef *> portList;
if (ml==0)
{
- delete portList;
- return 0;
+ return portList;
}
- MemberListIterator fmni(*ml);
-
- for (fmni.toFirst();(md=fmni.current());++fmni)
+ for (const auto &md : *ml)
{
if (md->getMemberSpecifiers()==VhdlDocGen::PORT)
{
- portList->append(md);
+ portList.push_back(md);
}
}
-
return portList;
}
-//writeColumn(FTextStream &t,QCString name,bool start)
+//writeColumn(TextStream &t,QCString name,bool start)
-static void writeTable(QList<MemberDef>* port,FTextStream & t)
+static void writeTable(const std::vector<const MemberDef*> &portList,TextStream & t)
{
- MemberDef *md;
- uint len=port->count();
+ std::vector<const MemberDef *> inPorts;
+ std::vector<const MemberDef *> outPorts;
- QList<MemberDef> inPorts;
- QList<MemberDef> outPorts;
-
- uint j;
- for (j=0;j<len;j++)
+ for (const auto &md : portList)
{
- md=(MemberDef*)port->at(j);
QCString qc=md->typeString();
- if(qc=="in")
+ if (qc=="in")
{
- inPorts.append(md);
+ inPorts.push_back(md);
}
else
{
- outPorts.append(md);
+ outPorts.push_back(md);
}
}
- int inp = inPorts.count();
- int outp = outPorts.count();
- int maxLen;
+ size_t inp = inPorts.size();
+ size_t outp = outPorts.size();
+ size_t maxLen;
if (inp>=outp)
{
@@ -517,13 +465,13 @@ static void writeTable(QList<MemberDef>* port,FTextStream & t)
maxLen=outp;
}
- int i;
- for(i=0;i<maxLen;i++)
+ size_t i;
+ for (i=0;i<maxLen;i++)
{
//write inports
if (i<inp)
{
- md=(MemberDef*)inPorts.at(i);
+ auto md = inPorts[i];
writeColumn(t,md,TRUE);
}
else
@@ -533,7 +481,7 @@ static void writeTable(QList<MemberDef>* port,FTextStream & t)
if (i<outp)
{
- md=(MemberDef*)outPorts.at(i);
+ auto md = outPorts[i];
writeColumn(t,md,FALSE);
}
else
@@ -631,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());
}
@@ -642,17 +590,17 @@ ClassDef* VhdlDocGen::getPackageName(const QCString & name)
return getClass(name);
}
-static std::map<std::string,MemberDef*> g_varMap;
+static std::map<std::string,const MemberDef*> g_varMap;
static std::vector<ClassDef*> g_classList;
static std::map<ClassDef*,std::vector<ClassDef*> > g_packages;
-MemberDef* VhdlDocGen::findMember(const QCString& className, const QCString& memName)
+const MemberDef* VhdlDocGen::findMember(const QCString& className, const QCString& memName)
{
ClassDef* cd,*ecd=0;
- MemberDef *mdef=0;
+ 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);
@@ -746,37 +694,30 @@ MemberDef* VhdlDocGen::findMember(const QCString& className, const QCString& mem
* This function returns the entity|package
* in which the key (type) is found
*/
-MemberDef* VhdlDocGen::findMemberDef(ClassDef* cd,const QCString& key,MemberListType type)
+const MemberDef* VhdlDocGen::findMemberDef(ClassDef* cd,const QCString& key,MemberListType type)
{
- MemberDef *md=0;
- MemberList *ml=0;
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())
{
- md=it->second;
- if (md)
- {
- return md;
- }
+ return it->second;
}
if (std::find(g_classList.begin(),g_classList.end(),cd)!=g_classList.end())
{
return 0;
}
- ml=cd->getMemberList(type);
+ const MemberList *ml=cd->getMemberList(type);
g_classList.push_back(cd);
if (!ml)
{
return 0;
}
- MemberListIterator fmni(*ml);
//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 (fmni.toFirst();(md=fmni.current());++fmni)
+ for (const auto &md : *ml)
{
QCString tkey=cd->symbolName()+"@"+md->name();
if (g_varMap.find(tkey.str())==g_varMap.end())
@@ -787,11 +728,7 @@ MemberDef* VhdlDocGen::findMemberDef(ClassDef* cd,const QCString& key,MemberList
it=g_varMap.find(keyType.str());
if (it!=g_varMap.end())
{
- md=it->second;
- if (md)
- {
- return md;
- }
+ return it->second;
}
return 0;
}//findMemberDef
@@ -805,24 +742,22 @@ void VhdlDocGen::findAllPackages( ClassDef *cdef)
if (g_packages.find(cdef)!=g_packages.end()) return;
std::vector<ClassDef*> cList;
MemberList *mem=cdef->getMemberList(MemberListType_variableMembers);
- MemberDef *md;
-
- if (!mem) return;
-
- MemberListIterator fmni(*mem);
- for (fmni.toFirst();(md=fmni.current());++fmni)
+ if (mem)
{
- if (VhdlDocGen::isPackage(md))
+ for (const auto &md : *mem)
{
- ClassDef* cd=VhdlDocGen::getPackageName(md->name());
- if (cd)
+ if (VhdlDocGen::isPackage(md))
{
- cList.push_back(cd);
- VhdlDocGen::findAllPackages(cd);
- g_packages.insert({cdef,cList});
+ ClassDef* cd=VhdlDocGen::getPackageName(md->name());
+ if (cd)
+ {
+ cList.push_back(cd);
+ VhdlDocGen::findAllPackages(cd);
+ g_packages.insert({cdef,cList});
+ }
}
- }
- }//for
+ }//for
+ }
}// findAllPackages
@@ -831,18 +766,15 @@ void VhdlDocGen::findAllPackages( ClassDef *cdef)
* is called in vhdlcode.l
*/
-MemberDef* VhdlDocGen::findFunction(const QCString& funcname, const QCString& package)
+const MemberDef* VhdlDocGen::findFunction(const QCString& funcname, const QCString& package)
{
- MemberDef* mdef=0;
- ClassDef *cdef=getClass(package.data());
+ ClassDef *cdef=getClass(package);
if (cdef==0) return 0;
MemberList *mem=cdef->getMemberList(MemberListType_pubMethods);
-
if (mem)
{
- MemberListIterator fmni(*mem);
- for (fmni.toFirst();(mdef=fmni.current());++fmni)
+ for (const auto &mdef : *mem)
{
QCString mname=mdef->name();
if ((VhdlDocGen::isProcedure(mdef) || VhdlDocGen::isVhdlFunction(mdef)) && (compareString(funcname,mname)==0))
@@ -895,8 +827,7 @@ QCString VhdlDocGen::getClassName(const ClassDef* cd)
void VhdlDocGen::writeInlineClassLink(const ClassDef* cd ,OutputList& ol)
{
- QList<QCString> ql;
- ql.setAutoDelete(TRUE);
+ std::vector<QCString> ql;
QCString nn=cd->className();
int ii=(int)cd->protection()+2;
@@ -920,37 +851,41 @@ 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;
if (ii==VhdlDocGen::ENTITY)
{
VhdlDocGen::findAllArchitectures(ql,cd);
- int j=ql.count();
- for (int i=0;i<j;i++)
- {
- QCString *temp=ql.at(i);
- QCStringList qlist=QCStringList::split("-",*temp);
- QCString s1=qlist[0];
- QCString s2=qlist[1];
- s1.stripPrefix("_");
- if (j==1) s1.resize(0);
- ClassDef*cc = getClass(temp->data());
- if (cc)
+ for (const auto &s : ql)
+ {
+ 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);
+ }
}
}
}
@@ -967,19 +902,18 @@ void VhdlDocGen::writeInlineClassLink(const ClassDef* cd ,OutputList& ol)
/*
* finds all architectures which belongs to an entity
*/
-void VhdlDocGen::findAllArchitectures(QList<QCString>& qll,const ClassDef *cd)
+void VhdlDocGen::findAllArchitectures(std::vector<QCString>& qll,const ClassDef *cd)
{
for (const auto &citer : *Doxygen::classLinkedMap)
{
- QCString jj=citer->className();
- if (cd != citer.get() && jj.contains('-')!=-1)
+ QCString className=citer->className();
+ int pos;
+ if (cd != citer.get() && (pos=className.find('-'))!=-1)
{
- QCStringList ql=QCStringList::split("-",jj);
- QCString temp=ql[1];
- if (qstricmp(cd->className(),temp)==0)
+ QCString postfix=className.mid(pos+1);
+ if (qstricmp(cd->className(),postfix)==0)
{
- QCString *cl=new QCString(jj);
- qll.insert(0,cl);
+ qll.push_back(className);
}
}
}// for
@@ -991,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();
}
@@ -1010,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();
}
@@ -1052,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);
@@ -1079,10 +1013,11 @@ void VhdlDocGen::parseFuncProto(const char* text,QCString& name,QCString& ret,bo
else
{
s1=s1.stripWhiteSpace();
- int i=s1.find("(",0,FALSE);
- int s=s1.find(QRegExp("[ \\t]"));
+ int i=s1.find('(');
+ 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));
@@ -1101,17 +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)
{
- QCStringList ql;
- QCString temp(c);
- QRegExp reg("[\\s:|]");
-
- ql=QCStringList::split(reg,temp);
+ static const reg::Ex reg(R"([\s|])");
+ auto ql=split(c.str(),reg);
- if (ql.count() > (unsigned int)index)
+ if ((size_t)index < ql.size())
{
- return ql[index];
+ return QCString(ql[index]);
}
return "";
@@ -1194,7 +1126,7 @@ QCString VhdlDocGen::getProcessNumber()
void VhdlDocGen::writeFormatString(const QCString& s,OutputList&ol,const MemberDef* mdef)
{
- QRegExp reg("[\\[\\]\\.\\/\\:\\<\\>\\:\\s\\,\\;\\'\\+\\-\\*\\|\\&\\=\\(\\)\"]");
+ static const reg::Ex reg(R"([\[\]./<>:\s,;'+*|&=()\"-])");
QCString qcs = s;
qcs+=QCString(" ");// parsing the last sign
QCString find=qcs;
@@ -1202,9 +1134,7 @@ void VhdlDocGen::writeFormatString(const QCString& s,OutputList&ol,const MemberD
char buf[2];
buf[1]='\0';
- int j;
- int len;
- j = reg.match(temp.data(),0,&len);
+ int j = findIndex(temp.str(),reg);
ol.startBold();
if (j>=0)
@@ -1214,7 +1144,7 @@ void VhdlDocGen::writeFormatString(const QCString& s,OutputList&ol,const MemberD
find=find.left(j);
buf[0]=temp[j];
const char *ss=VhdlDocGen::findKeyWord(find);
- bool k=isNumber(find); // is this a number
+ bool k=isNumber(find.str()); // is this a number
if (k)
{
ol.docify(" ");
@@ -1250,7 +1180,7 @@ void VhdlDocGen::writeFormatString(const QCString& s,OutputList&ol,const MemberD
{
temp=st;
}
- j = reg.match(temp.data(),0,&len);
+ j = findIndex(temp.str(),reg);
}//while
}//if
else
@@ -1263,16 +1193,10 @@ void VhdlDocGen::writeFormatString(const QCString& s,OutputList&ol,const MemberD
/*!
* returns TRUE if this string is a number
*/
-bool VhdlDocGen::isNumber(const QCString& s)
+bool VhdlDocGen::isNumber(const std::string& s)
{
- static QRegExp regg("[0-9][0-9eEfFbBcCdDaA_.#-+?xXzZ]*");
-
- if (s.isEmpty()) return FALSE;
- int j,len;
- j = regg.match(s.data(),0,&len);
- if ((j==0) && (len==(int)s.length())) return TRUE;
- return FALSE;
-
+ static const reg::Ex regg(R"([0-9][0-9eEfFbBcCdDaA_.#+?xXzZ-]*)");
+ return reg::match(s,regg);
}// isNumber
@@ -1332,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);
}
@@ -1444,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;
@@ -1456,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();
@@ -1613,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);
}
@@ -1704,7 +1628,7 @@ bool VhdlDocGen::writeVHDLTypeDocumentation(const MemberDef* mdef, const Definit
QCString nn=mdef->typeString();
nn=nn.stripWhiteSpace();
QCString na=cd->name();
- MemberDef* memdef=VhdlDocGen::findMember(na,nn);
+ const MemberDef* memdef=VhdlDocGen::findMember(na,nn);
if (memdef && memdef->isLinkable())
{
ol.docify(" ");
@@ -1732,7 +1656,7 @@ bool VhdlDocGen::writeVHDLTypeDocumentation(const MemberDef* mdef, const Definit
writeLink(mdef,ol);
ol.docify(" ");
- largs=largs.replace(QRegExp("#")," ");
+ largs=substitute(largs,"#"," ");
VhdlDocGen::formatString(largs,ol,mdef);
return hasParams;
}
@@ -1773,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";
@@ -1798,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 */
@@ -1853,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;
@@ -1864,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);
@@ -1923,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;
@@ -1991,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(),
@@ -2018,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();
@@ -2034,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();
}
@@ -2081,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();
@@ -2104,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();
@@ -2120,20 +2042,18 @@ 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;
bool first=TRUE;
- MemberDef *imd;
- MemberListIterator mli(*mlist);
- for ( ; (imd=mli.current()); ++mli )
+ for (const auto &imd : *mlist)
{
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; }
@@ -2156,9 +2076,7 @@ void VhdlDocGen::writePlainVHDLDeclarations(
static bool membersHaveSpecificType(const MemberList *ml,uint64 type)
{
if (ml==0) return FALSE;
- MemberDef *mdd=0;
- MemberListIterator mmli(*ml);
- for ( ; (mdd=mmli.current()); ++mmli )
+ for (const auto &mdd : *ml)
{
if (mdd->getMemberSpecifiers()==type) //is type in class
{
@@ -2167,9 +2085,9 @@ static bool membersHaveSpecificType(const MemberList *ml,uint64 type)
}
for (const auto &mg : ml->getMemberGroupList())
{
- if (mg->members())
+ if (!mg->members().empty())
{
- if (membersHaveSpecificType(mg->members(),type)) return TRUE;
+ if (membersHaveSpecificType(&mg->members(),type)) return TRUE;
}
}
return FALSE;
@@ -2177,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);
@@ -2200,9 +2118,9 @@ void VhdlDocGen::writeVHDLDeclarations(const MemberList* ml,OutputList &ol,
for (const auto &mg : ml->getMemberGroupList())
{
- if (membersHaveSpecificType(mg->members(),type))
+ 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)
@@ -2215,12 +2133,12 @@ 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();
//printf("--- mg->writePlainDeclarations ---\n");
- VhdlDocGen::writePlainVHDLDeclarations(mg->members(),ol,cd,nd,fd,gd,type);
+ VhdlDocGen::writePlainVHDLDeclarations(&mg->members(),ol,cd,nd,fd,gd,type);
ol.endMemberGroup(hasHeader);
}
}
@@ -2234,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();
@@ -2252,7 +2170,7 @@ void VhdlDocGen::writeStringLink(const MemberDef *mdef,QCString mem, OutputList&
if (cd)
{
QCString n=cd->name();
- MemberDef* memdef=VhdlDocGen::findMember(n,mem);
+ const MemberDef* memdef=VhdlDocGen::findMember(n,mem);
if (memdef && memdef->isLinkable())
{
ol.startBold();
@@ -2297,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
@@ -2343,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;
@@ -2378,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
{
- QRegExp ee("[\\s=]");
- int in=temp.find(ee);
+ 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);
}
}
}
@@ -2399,23 +2317,22 @@ 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;
- QRegExp reg("[\\s=]");
QCString n;
- // bool bo=(qstricmp(type,qcs.data())==0);
VhdlDocGen::deleteAllChars(qcs,';');
qcs=qcs.stripWhiteSpace();
- int i= qcs.find(reg);
+ static const reg::Ex reg(R"([\s=])");
+ int i = findIndex(qcs.str(),reg);
if (i<0) return;
if (i==0)
{
n=type;
VhdlDocGen::deleteAllChars(n,'#');
- type="";
}
else
{
@@ -2443,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())
{
@@ -2467,7 +2384,7 @@ static void writeUCFLink(const MemberDef* mdef,OutputList &ol)
if (!equ)
{
- ol.writeString(n.data());
+ ol.writeString(n);
ol.docify(" ");
ol.insertMemberAlign();
}
@@ -2487,26 +2404,28 @@ static void writeUCFLink(const MemberDef* mdef,OutputList &ol)
// for cell_inst : [entity] work.proto [ (label|expr) ]
QCString VhdlDocGen::parseForConfig(QCString & entity,QCString & arch)
{
- int index;
QCString label;
if (!entity.contains(":")) return "";
- QRegExp exp("[:()\\s]");
- QCStringList ql=QCStringList::split(exp,entity);
- //int ii=ql.findIndex(ent);
- assert(ql.count()>=2);
+ static const reg::Ex exp(R"([:()\s])");
+ auto ql=split(entity.str(),exp);
+ if (ql.size()<2)
+ {
+ return "";
+ }
label = ql[0];
entity = ql[1];
+ int index;
if ((index=entity.findRev("."))>=0)
{
entity.remove(0,index+1);
}
- if (ql.count()==3)
+ if (ql.size()==3)
{
- arch= ql[2];
- ql=QCStringList::split(exp,arch);
- if (ql.count()>1) // expression
+ arch = ql[2];
+ ql=split(arch.str(),exp);
+ if (ql.size()>1) // expression
{
arch="";
}
@@ -2518,26 +2437,29 @@ QCString VhdlDocGen::parseForConfig(QCString & entity,QCString & arch)
QCString VhdlDocGen::parseForBinding(QCString & entity,QCString & arch)
{
- int index;
- QRegExp exp("[()\\s]");
+ static const reg::Ex exp(R"([()\s])");
- QCString label="";
- QCStringList ql=QCStringList::split(exp,entity);
+ auto ql = split(entity.str(),exp);
- if (ql.contains("open"))
+ if (findIndex(ql,"open")!=-1)
{
return "open";
}
- label=ql[0];
+ if (ql.size()<2)
+ {
+ return "";
+ }
+ std::string label=ql[0];
entity = ql[1];
+ int index;
if ((index=entity.findRev("."))>=0)
{
entity.remove(0,index+1);
}
- if (ql.count()==3)
+ if (ql.size()==3)
{
arch=ql[2];
}
@@ -2547,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();
}
@@ -2595,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));
@@ -2606,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);
}
@@ -2630,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
{
@@ -2644,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);
}
@@ -2652,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;
@@ -2668,23 +2590,15 @@ 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);
- //QCString info="Info: Elaborating entity "+n1;
- //fd=ar->getFileDef();
- //info+=" for hierarchy ";
- //QRegExp epr("[|]");
- //QCString label=cur->type+":"+cur->write+":"+cur->name;
- //label.replace(epr,":");
- //info+=label;
- //fprintf(stderr,"\n[%s:%d:%s]\n",fd->fileName().data(),cur->startLine,info.data());
ar->insertMember(md.get());
MemberName *mn = Doxygen::functionNameLinkedMap->add(uu);
mn->push_back(std::move(md));
@@ -2698,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);
@@ -2717,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);
@@ -2748,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()));
@@ -2760,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;
@@ -2791,15 +2705,15 @@ void VhdlDocGen::addBaseClass(ClassDef* cd,ClassDef *ent)
bcd.usedName.append("(2)");
return;
}
- static QRegExp reg("[0-9]+");
+ static const reg::Ex reg(R"(\d+)");
QCString s=n.left(i);
QCString r=n.right(n.length()-i);
- QCString t=r;
+ std::string t=r.str();
VhdlDocGen::deleteAllChars(r,')');
VhdlDocGen::deleteAllChars(r,'(');
r.setNum(r.toInt()+1);
- t.replace(reg,r.data());
- s.append(t.data());
+ reg::replace(t, reg, r.str());
+ s.append(t.c_str());
bcd.usedName=s;
bcd.templSpecifiers=t;
}
@@ -2808,15 +2722,16 @@ void VhdlDocGen::addBaseClass(ClassDef* cd,ClassDef *ent)
}
-static QList<MemberDef> mdList;
+static std::vector<const MemberDef*> mdList;
-static MemberDef* findMemFlow(const MemberDef* mdef)
+static const MemberDef* findMemFlow(const MemberDef* mdef)
{
- for(uint j=0;j<mdList.count();j++)
+ for (const auto &md : mdList)
{
- MemberDef* md=(MemberDef*)mdList.at(j);
if (md->name()==mdef->name() && md->getStartBodyLine()==mdef->getStartBodyLine())
+ {
return md;
+ }
}
return 0;
}
@@ -2826,8 +2741,8 @@ void VhdlDocGen::createFlowChart(const MemberDef *mdef)
if (mdef==0) return;
QCString codeFragment;
- MemberDef* mm=0;
- if((mm=findMemFlow(mdef))!=0)
+ const MemberDef* mm=0;
+ if ((mm=findMemFlow(mdef))!=0)
{
// don't create the same flowchart twice
VhdlDocGen::setFlowMember(mm);
@@ -2835,15 +2750,15 @@ void VhdlDocGen::createFlowChart(const MemberDef *mdef)
}
else
{
- mdList.append(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") };
@@ -2936,7 +2851,7 @@ bool VhdlDocGen::isMisc(const MemberDef *mdef)
#define EMPTY (EEND | FlowChart::ELSIF_NO)
#define EE (FlowChart::ELSE_NO | FlowChart::ELSIF_NO)
#define EMPTNODE (ENDCL | EEND | FlowChart::ELSIF_NO)
-#define FLOWLEN (flowList.count()-1)
+#define FLOWLEN (flowList.size()-1)
static int ifcounter=0;
static int nodeCounter=0;
@@ -2965,7 +2880,7 @@ static struct
"lightcyan" // textNode
};
-QList<FlowChart> FlowChart::flowList;
+std::vector<FlowChart> flowList;
#ifdef DEBUGFLOW
static std::map<std::string,int> g_keyMap;
@@ -2982,13 +2897,12 @@ void alignText(QCString & q)
q.append(" ...");
- QRegExp reg("[\\s|]");
- QCString str(q.data());
+ QCString str(q);
QCString temp;
while (str.length()>80)
{
- int j=str.findRev(reg,80);
+ int j=std::max(str.findRev(' ',80),str.findRev('|',80));
if (j<=0)
{
temp+=str;
@@ -3008,114 +2922,118 @@ void alignText(QCString & q)
// #endif
}
-void FlowChart::printNode(const FlowChart* flo)
+void FlowChart::printNode(const FlowChart& flo)
{
- if (flo==0) return;
QCString ui="-";
- QCString q,t;
- QRegExp ep("[\t\n\r]");
+ std::string q;
+ std::string t;
ui.fill('-',255);
- if (flo->type & STARTL)
+ if (flo.type & STARTL)
{
- if (flo->stamp>0)
+ if (flo.stamp>0)
{
- q=ui.left(2*flo->stamp);
+ q=ui.left(2*flo.stamp).str();
}
else
{
q=" ";
}
- QCString nn=flo->exp.stripWhiteSpace();
- printf("\nYES: %s%s[%d,%d]",q.data(),nn.data(),flo->stamp,flo->id);
+ QCString nn=flo.exp.stripWhiteSpace();
+ printf("\nYES: %s%s[%d,%d]",qPrint(q),qPrint(nn),flo.stamp,flo.id);
}
else
{
- if (flo->type & COMMENT_NO)
+ if (flo.type & COMMENT_NO)
{
- t=flo->label;
+ t=flo.label.str();
}
else
{
- t=flo->text;
+ t=flo.text.str();
}
- t=t.replace(ep,"");
- if (t.isEmpty())
+ static const reg::Ex ep(R"(\s)");
+ t = reg::replace(t,ep,std::string());
+ if (t.empty())
{
t=" ";
}
- if (flo->stamp>0)
+ if (flo.stamp>0)
{
- q=ui.left(2*flo->stamp);
+ q=ui.left(2*flo.stamp).str();
}
else
{
q=" ";
}
- if (flo->type & EMPTNODE)
+ if (flo.type & EMPTNODE)
{
- printf("\n NO: %s%s[%d,%d]",q.data(),FlowChart::getNodeType(flo->type),flo->stamp,flo->id);
+ printf("\n NO: %s%s[%d,%d]",q.c_str(),FlowChart::getNodeType(flo.type),flo.stamp,flo.id);
}
- else if (flo->type & COMMENT_NO)
+ else if (flo.type & COMMENT_NO)
{
- printf("\n NO: %s%s[%d,%d]",t.data(),FlowChart::getNodeType(flo->type),flo->stamp,flo->id);
+ printf("\n NO: %s%s[%d,%d]",t.c_str(),FlowChart::getNodeType(flo.type),flo.stamp,flo.id);
}
else
{
- printf("\n NO: %s[%d,%d]",t.data(),flo->stamp,flo->id);
+ printf("\n NO: %s[%d,%d]",t.c_str(),flo.stamp,flo.id);
}
}
}
void FlowChart::printFlowTree()
{
- uint size=flowList.count();
- for (uint j=0;j<size;j++)
+ for (const auto &flowChart : flowList)
{
- printNode(flowList.at(j));
+ printNode(flowChart);
}
}
void FlowChart::colTextNodes()
{
- FlowChart *flno = NULL;
+ FlowChart *flno = nullptr;
bool found=FALSE;
- for (uint j=0;j<flowList.count();j++)
+ for (size_t j=0;j<flowList.size();j++)
{
- FlowChart *flo=flowList.at(j);
- if (flo->type&TEXT_NO)
+ FlowChart &flo = flowList[j];
+ if (flo.type&TEXT_NO)
{
if (!found)
{
- flno=flo;
+ flno=&flo;
}
else
{
- flno->text+=flo->text;
- flowList.remove(flo);
+ flno->text+=flo.text;
+ flowList.erase(flowList.begin()+j);
if (j>0) j=j-1;
}
found=TRUE;
}
else
+ {
found=FALSE;
+ }
}
// find if..endif without text
// if..elseif without text
- for (uint j=0;j<flowList.count()-1;j++)
+ if (!flowList.empty())
{
- FlowChart *flo=flowList.at(j);
- int kind=flo->type;
- if ( (kind & IFF) || (flo->type & ELSE_NO))
+ for (size_t j=0;j<flowList.size()-1;j++)
{
- FlowChart *ftemp=flowList.at(j+1);
- if (ftemp->type & EMPTY)
+ const FlowChart &flo = flowList[j];
+ int kind = flo.type;
+ if ( (kind & IFF) || (flo.type & ELSE_NO))
{
- FlowChart *fNew = new FlowChart(TEXT_NO,"empty ",0);
- fNew->stamp=flo->stamp;
- flowList.insert(j+1,fNew);
+ const FlowChart &ftemp = flowList[j+1];
+ if (ftemp.type & EMPTY)
+ {
+ FlowChart fc(TEXT_NO,"empty ",QCString());
+ fc.stamp = flo.stamp;
+ flowList.insert(flowList.begin()+j+1,fc);
+ }
}
}
}
@@ -3133,28 +3051,21 @@ void FlowChart::delFlowList()
{
ifcounter=0;
nodeCounter=0;
- uint size=flowList.count();
-
- for (uint j=0;j <size ;j++)
- {
- FlowChart *fll=flowList.at(j);
- delete fll;
- }
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);
@@ -3163,109 +3074,112 @@ 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)
{
- uint size=flowList.count();
+ size_t size=flowList.size();
bool begin=false;
- for (uint j=0;j < size-1 ;j++)
+ if (size>0)
{
- FlowChart *fll=flowList.at(j);
- if (fll->type & COMMENT_NO)
+ for (uint j=0;j < size-1 ;j++)
{
- FlowChart* to=flowList.at(j+1);
- if (to->type & COMMENT_NO)
+ FlowChart &fll = flowList[j];
+ if (fll.type & COMMENT_NO)
{
- fll->label+="\n";
- QCString temp=fll->label+to->label;
- to->label=temp;
- flowList.remove(j);
- size--;
- if (j>0) j--;
+ FlowChart &to=flowList[j+1];
+ if (to.type & COMMENT_NO)
+ {
+ to.label = fll.label+"\n"+to.label;
+ flowList.erase(flowList.begin()+j);
+ if (size>0) size--;
+ if (j>0) j--;
+ }
}
- }
- }// for
+ }// for
+ }
- for (uint j=0;j <flowList.count() ;j++)
+ for (size_t j=0;j <flowList.size() ;j++)
{
- FlowChart *fll=flowList.at(j);
+ const FlowChart &fll=flowList[j];
- if (fll->type & BEGIN_NO)
+ if (fll.type & BEGIN_NO)
{
begin = true;
continue;
}
- if (fll->type & COMMENT_NO)
+ if (fll.type & COMMENT_NO)
{
- FlowChart* to;
+ const FlowChart *to;
if (!begin)
{
// comment between function/process .. begin is linked to start node
- to=flowList.at(0);
+ to = &flowList[0];
+ }
+ else if (j>0 && flowList[j-1].line==fll.line)
+ {
+ to = &flowList[j-1];
}
else
{
- if (j>0 && flowList.at(j-1)->line==fll->line)
- to=flowList.at(j-1);
- else
- to=flowList.at(j+1);
- }
- t << getNodeName(fll->id);
+ to = &flowList[j+1];
+ }
+ t << getNodeName(fll.id);
t << "[shape=none, label=<\n";
t << "<TABLE BORDER=\"0\" CELLBORDER=\"1\" CELLSPACING=\"0\" CELLPADDING=\"2\" >\n ";
t << "<TR><TD BGCOLOR=\"";
t << flowCol.comment;
t << "\" > ";
- FlowChart::alignCommentNode(t,fll->label);
+ FlowChart::alignCommentNode(t,fll.label);
t << " </TD></TR></TABLE>>];";
- writeEdge(t,fll->id,to->id,2);
+ writeEdge(t,fll.id,to->id,2);
}
}// for
// delete comment nodes;
- size=flowList.count();
- for (uint j=0;j < size;j++)
+ size=flowList.size();
+ for (size_t j=0; j<size; j++)
{
- FlowChart *fll=flowList.at(j);
- if (fll->type & (COMMENT_NO | BEGIN_NO))
+ FlowChart &fll=flowList[j];
+ if (fll.type & (COMMENT_NO | BEGIN_NO))
{
- int diff=FLOWLEN-(j+1);
- flowList.remove(j);
+ size_t diff=FLOWLEN-(j+1);
- if ((fll->type & COMMENT_NO) && diff > 1)
- flowList.at(j+1)->label=fll->label;
+ if ((fll.type & COMMENT_NO) && diff > 1)
+ {
+ flowList[j+1].label = fll.label;
+ }
+
+ flowList.erase(flowList.begin()+j);
- delete fll;
- fll=0;
- size--;
+ if (size>0) size--;
if (j>0) j--;
}
}// 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)
{
@@ -3288,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;
@@ -3315,38 +3229,33 @@ 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)
{
- static QRegExp reg("[;]");
- static QRegExp reg1("[\"]");
-
if (!VhdlDocGen::getFlowMember()) return;
QCString typeString(text);
QCString expression(exp);
- if (text)
+ if (!text.isEmpty())
{
- typeString=typeString.replace(reg,"\n");
+ typeString=substitute(typeString,";","\n");
}
- if (exp)
+ if (!exp.isEmpty())
{
- expression=expression.replace(reg1,"\\\"");
+ expression=substitute(expression,"\"","\\\"");
}
- FlowChart *fl=new FlowChart(type,typeString.data(),expression.data(),label);
-
- fl->line=1; // TODO: use getLine(); of the parser
-
if (type & (START_NO | VARIABLE_NO))
{
- flowList.prepend(fl);
+ flowList.insert(flowList.begin(),FlowChart(type,typeString,expression,label));
+ flowList.front().line=1; // TODO: use getLine(); of the parser
}
else
{
- flowList.append(fl);
+ flowList.emplace_back(type,typeString,expression,label);
+ flowList.back().line=1; // TODO: use getLine(); of the parser
}
}
@@ -3356,12 +3265,12 @@ void FlowChart::moveToPrevLevel()
ifcounter--;
}
-QCString FlowChart::printPlantUmlNode(const FlowChart *flo,bool ca,bool endL)
+QCString FlowChart::printPlantUmlNode(const FlowChart &flo,bool ca,bool endL)
{
QCString t;
- QCString exp=flo->exp.stripWhiteSpace();
- QCString text=flo->text.stripWhiteSpace();
- switch (flo->type)
+ QCString exp=flo.exp.stripWhiteSpace();
+ QCString text=flo.text.stripWhiteSpace();
+ switch (flo.type)
{
case START_NO: t=":"+text+"|"; break;
case IF_NO : t="\nif ("+exp+") then (yes)"; break;
@@ -3388,7 +3297,7 @@ QCString FlowChart::printPlantUmlNode(const FlowChart *flo,bool ca,bool endL)
case LOOP_NO: t="\nwhile (infinite loop)"; break;
case NEXT_NO: break;
case EMPTY_NO: break;
- case COMMENT_NO: t="\n note left \n "+flo->label+"\nend note \n"; break;
+ case COMMENT_NO: t="\n note left \n "+flo.label+"\nend note \n"; break;
case BEGIN_NO: t="\n:begin;"; break;
default: assert(false); break;
}
@@ -3401,19 +3310,18 @@ void FlowChart::printUmlTree()
int whenCounter = 0;
QCString qcs;
- uint size=flowList.count();
- bool endList;
- for (uint j=0;j<size;j++)
+ size_t size=flowList.size();
+ for (size_t j=0;j<size;j++)
{
- endList=j==FLOWLEN;
- FlowChart *flo=flowList.at(j);
- if (flo->type==CASE_NO)
+ bool endList = j==FLOWLEN;
+ const FlowChart &flo = flowList[j];
+ if (flo.type==CASE_NO)
{
caseCounter++;
whenCounter=0;
}
- if (flo->type==END_CASE)
+ if (flo.type==END_CASE)
{
caseCounter--;
}
@@ -3422,7 +3330,7 @@ void FlowChart::printUmlTree()
qcs+=printPlantUmlNode(flo,ca,endList);
- if (flo->type==WHEN_NO)
+ if (flo.type==WHEN_NO)
{
whenCounter++;
}
@@ -3433,29 +3341,13 @@ void FlowChart::printUmlTree()
QCString htmlOutDir = Config_getString(HTML_OUTPUT);
QCString n=convertNameToFileName();
- n=PlantumlManager::instance()->writePlantUMLSource(htmlOutDir,n,qcs,PlantumlManager::PUML_SVG);
- PlantumlManager::instance()->generatePlantUMLOutput(n,htmlOutDir,PlantumlManager::PUML_SVG);
+ n=PlantumlManager::instance().writePlantUMLSource(htmlOutDir,n,qcs,PlantumlManager::PUML_SVG);
+ PlantumlManager::instance().generatePlantUMLOutput(n,htmlOutDir,PlantumlManager::PUML_SVG);
}
QCString FlowChart::convertNameToFileName()
{
- static QRegExp exp ("[^][a-z_A-Z0-9]");
- QCString temp,qcs;
- const MemberDef* md=VhdlDocGen::getFlowMember();
-
- // temp.sprintf("%p",md);
- qcs=md->name();
-
- #if 0
- if (qcs.find(exp,0)>=0)
- {
- qcs.prepend("Z");
- qcs=qcs.replace(exp,"_");
- }
- #endif
-
- //QCString tt= qcs;VhdlDocGen::getRecordNumber();
- return qcs;
+ return VhdlDocGen::getFlowMember()->name();
}
const char* FlowChart::getNodeType(int c)
@@ -3496,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";
@@ -3509,7 +3401,7 @@ void FlowChart::createSVG()
}
}
-void FlowChart::startDot(FTextStream &t)
+void FlowChart::startDot(TextStream &t)
{
t << " digraph G { \n";
t << "rankdir=TB \n";
@@ -3517,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";
}
@@ -3528,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);
@@ -3548,36 +3439,35 @@ void FlowChart::writeFlowChart()
{
printUmlTree();
delFlowList();
+ t.flush();
f.close();
return;
}
startDot(t);
buildCommentNodes(t);
- uint size=flowList.count();
-
- for (uint j=0;j <size ;j++)
+ for (const auto &fll : flowList)
{
- FlowChart *fll=flowList.at(j);
writeShape(t,fll);
}
writeFlowLinks(t);
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;
+ if (fl.type & EEND) return;
QCString var;
- if (fl->type & LOOP)
+ if (fl.type & LOOP)
{
var=" loop";
}
- else if (fl->type & IFF)
+ else if (fl.type & IFF)
{
var=" then";
}
@@ -3586,33 +3476,33 @@ void FlowChart::writeShape(FTextStream &t,const FlowChart* fl)
var="";
}
- t<<getNodeName(fl->id).data();
+ t << getNodeName(fl.id);
#ifdef DEBUGFLOW
- QCString qq(getNodeName(fl->id).data());
- g_keyMap.insert({qq.str(),fl->id});
+ QCString qq(getNodeName(fl.id));
+ g_keyMap.insert({qq.str(),fl.id});
#endif
- bool dec=(fl->type & DECLN);
- bool exit=(fl->type & EXITNEXT);
- if (exit && !fl->exp.isEmpty())
+ bool dec=(fl.type & DECLN);
+ bool exit=(fl.type & EXITNEXT);
+ if (exit && !fl.exp.isEmpty())
{
dec=TRUE;
}
if (dec)
{
- QCString exp=fl->exp;
+ QCString exp=fl.exp;
alignText(exp);
t << " [shape=diamond,style=filled,color=\"";
t << flowCol.decisionNode;
t << "\",label=\" ";
QCString kl;
- if (exit) kl=fl->text+" ";
+ if (exit) kl=fl.text+" ";
- if (fl->label)
+ if (!fl.label.isEmpty())
{
- kl+=fl->label+":"+exp+var;
+ kl+=fl.label+":"+exp+var;
}
else
{
@@ -3622,14 +3512,14 @@ void FlowChart::writeShape(FTextStream &t,const FlowChart* fl)
FlowChart::alignCommentNode(t,kl);
t << "\"]\n";
}
- else if (fl->type & ENDCL)
+ else if (fl.type & ENDCL)
{
- QCString val=fl->text;
+ QCString val=fl.text;
t << " [shape=ellipse ,label=\""+val+"\"]\n";
}
- else if (fl->type & STARTFIN)
+ else if (fl.type & STARTFIN)
{
- QCString val=fl->text;
+ QCString val=fl.text;
t << "[shape=box , style=rounded label=<\n";
t << "<TABLE BORDER=\"0\" CELLBORDER=\"0\" CELLSPACING=\"0\" CELLPADDING=\"0\" >\n ";
t << "<TR><TD BGCOLOR=\"";
@@ -3640,13 +3530,13 @@ void FlowChart::writeShape(FTextStream &t,const FlowChart* fl)
}
else
{
- if (fl->text.isEmpty()) return;
- bool isVar=(fl->type & FlowChart::VARIABLE_NO);
- QCString q=fl->text;
+ if (fl.text.isEmpty()) return;
+ bool isVar=(fl.type & FlowChart::VARIABLE_NO);
+ QCString q=fl.text;
if (exit)
{
- q+=" "+fl->label;
+ q+=" "+fl.label;
}
int z=q.findRev("\n");
@@ -3671,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;
+ 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
@@ -3686,10 +3576,10 @@ void FlowChart::writeEdge(FTextStream &t,const FlowChart* fl_from,const FlowChar
assert(it1!=g_keyMap.end());
#endif
- writeEdge(t,fl_from->id,fl_to->id,i,b,c);
+ 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;
@@ -3710,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";
}
@@ -3744,73 +3634,73 @@ 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;
}
q+=temp;
}
-int FlowChart::findNextLoop(int index,int stamp)
+size_t FlowChart::findNextLoop(size_t index,int stamp)
{
- for (uint j=index+1;j<flowList.count();j++)
+ for (size_t j=index+1; j<flowList.size(); j++)
{
- FlowChart *flo=flowList.at(j);
- if (flo->stamp==stamp)
+ const FlowChart &flo = flowList[j];
+ if (flo.stamp==stamp)
{
continue;
}
- if (flo->type&END_LOOP)
+ if (flo.type&END_LOOP)
{
return j;
}
}
- return flowList.count()-1;
+ return flowList.size()-1;
}
-int FlowChart::findPrevLoop(int index,int stamp,bool endif)
+size_t FlowChart::findPrevLoop(size_t index,int stamp,bool endif)
{
- for (uint j=index;j>0;j--)
+ for (size_t j=index;j>0;j--)
{
- FlowChart *flo=flowList.at(j);
- if (flo->type & LOOP)
+ const FlowChart &flo = flowList[j];
+ if (flo.type & LOOP)
{
- if (flo->stamp==stamp && endif)
+ if (flo.stamp==stamp && endif)
{
return j;
}
else
{
- if (flo->stamp<stamp)
+ if (flo.stamp<stamp)
{
return j;
}
}
}
}
- return flowList.count()-1;
+ return flowList.size()-1;
}
-int FlowChart::findLabel(int index,QCString &label)
+size_t FlowChart::findLabel(size_t index,const QCString &label)
{
- for (uint j=index;j>0;j--)
+ for (size_t j=index;j>0;j--)
{
- FlowChart *flo=flowList.at(j);
- if ((flo->type & LOOP) && !flo->label.isEmpty() && qstricmp(flo->label,label)==0)
+ const FlowChart &flo = flowList[j];
+ if ((flo.type & LOOP) && !flo.label.isEmpty() && qstricmp(flo.label,label)==0)
{
return j;
}
}
- err("could not find label: %s",label.data());
+ err("could not find label: %s",qPrint(label));
return 0;
}
-int FlowChart::findNode(int index,int stamp,int type)
+size_t FlowChart::findNode(size_t index,int stamp,int type)
{
- for (uint j=index+1;j<flowList.count();j++)
+ for (size_t j=index+1; j<flowList.size(); j++)
{
- FlowChart *flo=flowList.at(j);
- if (flo->type==type && flo->stamp==stamp)
+ const FlowChart &flo = flowList[j];
+ if (flo.type==type && flo.stamp==stamp)
{
return j;
}
@@ -3818,13 +3708,13 @@ int FlowChart::findNode(int index,int stamp,int type)
return 0;
}// findNode
-int FlowChart::getNextNode(int index,int stamp)
+size_t FlowChart::getNextNode(size_t index,int stamp)
{
- for (uint j=index+1;j<flowList.count();j++)
+ for (size_t j=index+1; j<flowList.size(); j++)
{
- FlowChart *flo=flowList.at(j);
- int kind=flo->type;
- int s=flo->stamp;
+ const FlowChart &flo = flowList[j];
+ int kind = flo.type;
+ int s = flo.stamp;
if (s>stamp)
{
continue;
@@ -3859,15 +3749,13 @@ int FlowChart::getNextNode(int index,int stamp)
return FLOWLEN;
}
-int FlowChart::getNextIfLink(const FlowChart* fl,uint index)
+size_t FlowChart::getNextIfLink(const FlowChart &fl,size_t index)
{
- int stamp=fl->stamp;
- uint start = index+1;
- int endifNode = findNode(start,stamp,ENDIF_NO);
- int elseifNode = findNode(start,stamp,ELSIF_NO);
- int elseNode = findNode(start,stamp,ELSE_NO);
-
- assert(endifNode>-1);
+ int stamp=fl.stamp;
+ size_t start = index+1;
+ size_t endifNode = findNode(start,stamp,ENDIF_NO);
+ size_t elseifNode = findNode(start,stamp,ELSIF_NO);
+ size_t elseNode = findNode(start,stamp,ELSE_NO);
if (elseifNode>0 && elseifNode<endifNode)
{
@@ -3879,23 +3767,23 @@ int FlowChart::getNextIfLink(const FlowChart* fl,uint index)
return elseNode+1;
}
- stamp=flowList.at(endifNode)->stamp;
+ stamp=flowList[endifNode].stamp;
return getNextNode(endifNode,stamp);
}
-void FlowChart::writeFlowLinks(FTextStream &t)
+void FlowChart::writeFlowLinks(TextStream &t)
{
- uint size=flowList.count();
+ size_t size=flowList.size();
if (size<2) return;
// write start link
- writeEdge(t,flowList.at(0),flowList.at(1),2);
+ writeEdge(t,flowList[0],flowList[1],2);
- for (uint j=0;j<size;j++)
+ for (size_t j=0;j<size;j++)
{
- FlowChart *fll=flowList.at(j);
- int kind=fll->type;
- int stamp=fll->stamp;
+ const FlowChart &fll = flowList[j];
+ int kind = fll.type;
+ int stamp = fll.stamp;
if (kind & EEND)
{
continue;
@@ -3903,98 +3791,98 @@ void FlowChart::writeFlowLinks(FTextStream &t)
if (kind & IFF)
{
- writeEdge(t,fll,flowList.at(j+1),0);
- int z=getNextIfLink(fll,j);
+ writeEdge(t,fll,flowList[j+1],0);
+ size_t z=getNextIfLink(fll,j);
// assert(z>-1);
- writeEdge(t,fll,flowList.at(z),1);
+ writeEdge(t,fll,flowList[z],1);
}
else if (kind & LOOP_NO)
{
- writeEdge(t,fll,flowList.at(j+1),2);
+ writeEdge(t,fll,flowList[j+1],2);
continue;
}
else if (kind & (CASE_NO | FOR_NO | WHILE_NO))
{
if (kind & CASE_NO)
{
- writeEdge(t,fll,flowList.at(j+1),2);
+ writeEdge(t,fll,flowList[j+1],2);
continue;
}
else
{
- writeEdge(t,fll,flowList.at(j+1),0);
+ writeEdge(t,fll,flowList[j+1],0);
}
kind=END_LOOP;
- int z=findNode(j+1,fll->stamp,kind);
- z=getNextNode(z,flowList.at(z)->stamp);
+ size_t z=findNode(j+1,fll.stamp,kind);
+ z=getNextNode(z,flowList[z].stamp);
// assert(z>-1);
- writeEdge(t,fll,flowList.at(z),1);
+ writeEdge(t,fll,flowList[z],1);
continue;
}
else if (kind & (TEXT_NO | VARIABLE_NO))
{
- int z=getNextNode(j,stamp);
- writeEdge(t,fll,flowList.at(z),2);
+ size_t z=getNextNode(j,stamp);
+ writeEdge(t,fll,flowList[z],2);
}
else if (kind & WHEN_NO)
{
// default value
- if (qstricmp(fll->text.simplifyWhiteSpace().data(),"others")==0)
+ if (qstricmp(fll.text.simplifyWhiteSpace(),"others")==0)
{
- writeEdge(t,fll,flowList.at(j+1),2);
+ writeEdge(t,fll,flowList[j+1],2);
continue;
}
- writeEdge(t,fll,flowList.at(j+1),0);
- int u=findNode(j,stamp,WHEN_NO);
- int v=findNode(j,stamp-1,END_CASE);
+ writeEdge(t,fll,flowList[j+1],0);
+ size_t u=findNode(j,stamp,WHEN_NO);
+ size_t v=findNode(j,stamp-1,END_CASE);
if (u>0 && u<v)
{
- writeEdge(t,fll,flowList.at(u),1);
+ writeEdge(t,fll,flowList[u],1);
}
else
{
- writeEdge(t,fll,flowList.at(v),1);
+ writeEdge(t,fll,flowList[v],1);
}
}
else if (kind & END_CASE)
{
- int z=FlowChart::getNextNode(j,fll->stamp);
- writeEdge(t,fll,flowList.at(z),2);
+ size_t z=FlowChart::getNextNode(j,fll.stamp);
+ writeEdge(t,fll,flowList[z],2);
}
else if (kind & END_LOOP)
{
- int z=findPrevLoop(j,fll->stamp,true);
- writeEdge(t,fll,flowList.at(z),2);
+ size_t z=findPrevLoop(j,fll.stamp,true);
+ writeEdge(t,fll,flowList[z],2);
}
else if (kind & RETURN_NO)
{
- writeEdge(t,fll,FlowChart::flowList.at(size-1),2);
+ writeEdge(t,fll,flowList[size-1],2);
}
else if (kind & (EXIT_NO | NEXT_NO))
{
- int z;
+ size_t z;
bool b = kind==NEXT_NO;
- if (fll->exp)
+ if (!fll.exp.isEmpty())
{
- writeEdge(t,fll,flowList.at(j+1),1);
+ writeEdge(t,fll,flowList[j+1],1);
}
- if (!fll->label.isEmpty())
+ if (!fll.label.isEmpty())
{
- z=findLabel(j,fll->label);
+ z=findLabel(j,fll.label);
if (b)
{
- writeEdge(t,fll,flowList.at(z),0);
+ writeEdge(t,fll,flowList[z],0);
}
else
{
- z=findNode(z,flowList.at(z)->stamp,END_LOOP);
- z=getNextNode(z,flowList.at(z)->stamp);
- writeEdge(t,fll,flowList.at(z),0);
+ z=findNode(z,flowList[z].stamp,END_LOOP);
+ z=getNextNode(z,flowList[z].stamp);
+ writeEdge(t,fll,flowList[z],0);
}
continue;
}
@@ -4002,17 +3890,17 @@ void FlowChart::writeFlowLinks(FTextStream &t)
{
if (b)
{
- z=findPrevLoop(j,fll->stamp);
- writeEdge(t,fll,flowList.at(z),0);
+ z=findPrevLoop(j,fll.stamp);
+ writeEdge(t,fll,flowList[z],0);
continue;
}
else
{
- z =findNextLoop(j,fll->stamp-1);
+ z =findNextLoop(j,fll.stamp-1);
}
- z=getNextNode(z,flowList.at(z)->stamp);
+ z=getNextNode(z,flowList[z].stamp);
}
- writeEdge(t,fll,flowList.at(z),0);
+ writeEdge(t,fll,flowList[z],0);
}
} //for
} //writeFlowLinks
diff --git a/src/vhdldocgen.h b/src/vhdldocgen.h
index 22751c5..207e449 100644
--- a/src/vhdldocgen.h
+++ b/src/vhdldocgen.h
@@ -21,8 +21,7 @@
* vhdl documents
*/
-#include <qdict.h>
-#include <qcstring.h>
+#include "qcstring.h"
#include "layout.h"
#include "arguments.h"
#include "entry.h"
@@ -32,19 +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();
@@ -119,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);
@@ -133,19 +130,19 @@ class VhdlDocGen
static const char* findKeyWord(const QCString& word);
static ClassDef* getPackageName(const QCString& name);
- static MemberDef* findMember(const QCString& className,
+ static const MemberDef* findMember(const QCString& className,
const QCString& memName);
static void findAllPackages(ClassDef*);
- static MemberDef* findMemberDef(ClassDef* cd,
+ static const MemberDef* findMemberDef(ClassDef* cd,
const QCString& key,
MemberListType type);
- static ClassDef *getClass(const char *name);
- static MemberDef* findFunction(const QCString& 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);
@@ -197,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,13 +207,12 @@ class VhdlDocGen
static QCString getRecordNumber();
static QCString getClassName(const ClassDef*);
- static bool isNumber(const QCString& s);
+ 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);
@@ -225,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();
@@ -248,7 +244,7 @@ class VhdlDocGen
static void resetCodeVhdlParserState();
private:
- static void findAllArchitectures(QList<QCString>& ql,const ClassDef *cd);
+ static void findAllArchitectures(std::vector<QCString>& ql,const ClassDef *cd);
static bool compareArgList(const ArgumentList &,const ArgumentList &);
static void writeVhdlLink(const ClassDef* cdd ,OutputList& ol,QCString& type,QCString& name,QCString& beh);
static void writeStringLink(const MemberDef *mdef,QCString mem,OutputList& ol);
@@ -292,45 +288,42 @@ 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();
- static int getNextTextLink(const FlowChart* fl,uint index);
- static int getNextIfLink(const FlowChart*,uint);
- static int getNextNode(int,int);
- static int findNode(int index,int stamp,int type);
- static int findNode(int index,int type);
- static int findNextLoop(int j,int stamp);
- static int findPrevLoop(int j,int stamp,bool endif=FALSE);
- static int findLabel(int j,QCString &);
+ static size_t getNextIfLink(const FlowChart&,size_t);
+ static size_t getNextNode(size_t index,int stamp);
+ static size_t findNode(size_t index,int stamp,int type);
+ static size_t findNode(size_t index,int type);
+ static size_t findNextLoop(size_t j,int stamp);
+ static size_t findPrevLoop(size_t j,int stamp,bool endif=FALSE);
+ static size_t findLabel(size_t j,const QCString &);
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();
static void alignFuncProc(QCString & q,const ArgumentList &al,bool isFunc);
static QCString convertNameToFileName();
- static void printNode(const FlowChart* n);
+ 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);
+ static QCString printPlantUmlNode(const FlowChart &flo,bool,bool);
- static QList<FlowChart> flowList;
-
- 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:
@@ -345,4 +338,6 @@ private:
QCString exp;
};
+extern std::vector<FlowChart> flowList;
+
#endif
diff --git a/src/vhdljjparser.cpp b/src/vhdljjparser.cpp
index 4ca4bbe..963f3ec 100644
--- a/src/vhdljjparser.cpp
+++ b/src/vhdljjparser.cpp
@@ -10,9 +10,9 @@
*
*/
-#include <qcstring.h>
-#include <qfileinfo.h>
-#include <qcstringlist.h>
+#include <string>
+
+#include "qcstring.h"
#include "containers.h"
#include "vhdljjparser.h"
#include "vhdldocgen.h"
@@ -32,6 +32,7 @@
#include "markdown.h"
#include "VhdlParserTokenManager.h"
#include "VhdlParserErrorHandler.hpp"
+#include "regex.h"
using namespace vhdl::parser;
@@ -56,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;
@@ -85,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
{
@@ -128,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;
@@ -137,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;
@@ -251,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)
@@ -264,18 +266,39 @@ 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);
}
}
int VHDLOutlineParser::checkInlineCode(QCString &doc)
{
- QRegExp cs("[\\\\@]code");
- QRegExp cend("[\\s ]*[\\\\@]endcode");
- QRegExp cbrief("[\\\\@]brief");
- int index = doc.find(cs);
+ static const reg::Ex csRe(R"([\\@]code)");
+ static const reg::Ex cendRe(R"(\s*[\\@]endcode)");
+ static const reg::Ex cbriefRe(R"([\\@]brief)");
+
+ // helper to simulate behavior of QString.find(const QRegExp &re,int pos)
+ auto findRe = [](const QCString &str,const reg::Ex &re,int pos=0) -> int
+ {
+ if ((int)str.length()<pos) return -1;
+ reg::Match match;
+ const std::string s = str.str();
+ if (reg::search(s,match,re,pos)) // match found
+ {
+ return (int)match.position();
+ }
+ else // not found
+ {
+ return -1;
+ }
+ };
+ auto replaceRe = [](const QCString &str,const reg::Ex &re,const QCString &replacement) -> QCString
+ {
+ return reg::replace(str.str(), re, replacement.str());
+ };
+
+ int index = findRe(doc,csRe);
- if (doc.contains(cend) > 0)
+ if (findRe(doc,cendRe)!=-1)
return 1;
if (index < 0)
@@ -283,9 +306,9 @@ int VHDLOutlineParser::checkInlineCode(QCString &doc)
VhdlParser::SharedState *s = &p->shared;
p->strComment += doc;
- p->code = p->inputString.find(cs, p->code + 1);
+ p->code = findRe(p->inputString,csRe, p->code + 1);
int com = p->inputString.find(p->strComment.data());
- int ref = p->inputString.find(cend, p->code + 1);
+ int ref = findRe(p->inputString,cendRe, p->code + 1);
int len = p->strComment.size();
int ll = com + len;
@@ -295,26 +318,27 @@ 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);
-
- QCString co;
- QCString na;
- for (QCString qcs : ql)
- {
- qcs = qcs.simplifyWhiteSpace();
- if (qcs.contains(cs))
- {
- int i = qcs.find('{');
- int j = qcs.find('}');
- if (i > 0 && j > 0 && j > i)
- {
- na = qcs.mid(i + 1, (j - i - 1));
- }
- continue;
- }
- qcs = qcs.replace(cbrief, "");
- co += qcs;
- co += '\n';
+ StringVector ql = split(p->strComment.str(),"\n");
+
+ QCString co;
+ QCString na;
+ for (const auto &qcs_ : ql)
+ {
+ QCString qcs(qcs_);
+ qcs = qcs.simplifyWhiteSpace();
+ if (findRe(qcs,csRe)!=-1)
+ {
+ int i = qcs.find('{');
+ int j = qcs.find('}');
+ if (i > 0 && j > 0 && j > i)
+ {
+ na = qcs.mid(i + 1, (j - i - 1));
+ }
+ continue;
+ }
+ qcs = replaceRe(qcs,cbriefRe, "");
+ co += qcs;
+ co += '\n';
}
VhdlDocGen::prepareComment(co);
@@ -356,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;
@@ -438,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;
@@ -498,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;
@@ -560,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);
}
}
@@ -594,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;
}
@@ -607,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;
@@ -656,10 +680,6 @@ void VHDLOutlineParser::addProto(const char *s1,const char *s2,const char *s3,
*/
void VHDLOutlineParser::mapLibPackage( Entry* root)
{
- //QList<Entry> epp=libUse;
- //EntryListIterator eli(epp);
- //Entry *rt;
- //for (;(rt=eli.current());++eli)
for (const auto &rt : p->libUse)
{
if (addLibUseClause(rt->name))
@@ -744,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)
{
@@ -761,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;
@@ -829,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 651221c..542f48d 100755
--- a/src/vhdljjparser.h
+++ b/src/vhdljjparser.h
@@ -3,22 +3,19 @@
#include <vector>
#include <memory>
+#include <string>
#include "parserintf.h"
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <ctype.h>
-#include <qarray.h>
-#include <qcstringlist.h>
-#include <qfile.h>
-#include <qdict.h>
-#include <string>
#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);
@@ -32,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
@@ -53,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();
@@ -68,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 29990c9..757ae76 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,16 +28,15 @@
#include "htmlentity.h"
#include "emoji.h"
#include "filedef.h"
+#include "fileinfo.h"
-static void visitCaption(XmlDocVisitor *parent, QList<DocNode> children)
+static void visitCaption(XmlDocVisitor *parent, const DocNodeList &children)
{
- QListIterator<DocNode> cli(children);
- DocNode *n;
- for (cli.toFirst();(n=cli.current());++cli) n->accept(parent);
+ for (const auto &n : children) n->accept(parent);
}
-static void visitPreStart(FTextStream &t, const char *cmd, bool doCaption,
- XmlDocVisitor *parent, QList<DocNode> children,
+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)
{
@@ -85,13 +82,14 @@ 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)
- : DocVisitor(DocVisitor_XML), m_t(t), m_ci(ci), m_insidePre(FALSE), m_hide(FALSE)
+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)
{
}
@@ -333,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,
@@ -424,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()),
@@ -454,14 +452,14 @@ 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)
{
m_t << "<programlisting filename=\"" << op->includeFileName() << "\">";
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide = TRUE;
}
QCString locLangExt = getFileNameExtension(op->includeFileName());
@@ -469,14 +467,14 @@ void XmlDocVisitor::visit(DocIncOperator *op)
SrcLangExt langExt = getLanguageFromFileName(locLangExt);
if (op->type()!=DocIncOperator::Skip)
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide)
{
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(),
@@ -491,17 +489,17 @@ void XmlDocVisitor::visit(DocIncOperator *op)
);
if (fd) delete fd;
}
- pushEnabled();
+ pushHidden(m_hide);
m_hide=TRUE;
}
if (op->isLast())
{
- popEnabled();
+ m_hide = popHidden();
if (!m_hide) m_t << "</programlisting>";
}
else
{
- if (!m_hide) m_t << endl;
+ if (!m_hide) m_t << "\n";
}
}
@@ -592,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 *)
@@ -697,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)
@@ -712,7 +710,14 @@ void XmlDocVisitor::visitPre(DocHtmlList *s)
{
if (m_hide) return;
if (s->type()==DocHtmlList::Ordered)
- m_t << "<orderedlist>\n";
+ {
+ m_t << "<orderedlist";
+ for (const auto &opt : s->attribs())
+ {
+ m_t << " " << opt.name << "=\"" << opt.value << "\"";
+ }
+ m_t << ">\n";
+ }
else
m_t << "<itemizedlist>\n";
}
@@ -777,15 +782,13 @@ void XmlDocVisitor::visitPost(DocHtmlDescData *)
void XmlDocVisitor::visitPre(DocHtmlTable *t)
{
if (m_hide) return;
- m_t << "<table rows=\"" << t->numRows()
- << "\" cols=\"" << t->numColumns() << "\"" ;
- HtmlAttribListIterator li(t->attribs());
- HtmlAttrib* opt;
- for (li.toFirst(); (opt = li.current()); ++li)
+ m_t << "<table rows=\"" << (uint)t->numRows()
+ << "\" cols=\"" << (uint)t->numColumns() << "\"" ;
+ for (const auto &opt : t->attribs())
{
- if (opt->name=="width")
+ if (opt.name=="width")
{
- m_t << " " << opt->name << "=\"" << opt->value << "\"";
+ m_t << " " << opt.name << "=\"" << opt.value << "\"";
}
}
m_t << ">";
@@ -813,49 +816,47 @@ void XmlDocVisitor::visitPre(DocHtmlCell *c)
{
if (m_hide) return;
if (c->isHeading()) m_t << "<entry thead=\"yes\""; else m_t << "<entry thead=\"no\"";
- HtmlAttribListIterator li(c->attribs());
- HtmlAttrib *opt;
- for (li.toFirst();(opt=li.current());++li)
+ for (const auto &opt : c->attribs())
{
- if (opt->name=="colspan" || opt->name=="rowspan")
+ if (opt.name=="colspan" || opt.name=="rowspan")
{
- m_t << " " << opt->name << "=\"" << opt->value.toInt() << "\"";
+ m_t << " " << opt.name << "=\"" << opt.value.toInt() << "\"";
}
- else if (opt->name=="align" &&
- (opt->value=="right" || opt->value=="left" || opt->value=="center"))
+ else if (opt.name=="align" &&
+ (opt.value=="right" || opt.value=="left" || opt.value=="center"))
{
- m_t << " align=\"" << opt->value << "\"";
+ m_t << " align=\"" << opt.value << "\"";
}
- else if (opt->name=="valign" &&
- (opt->value == "bottom" || opt->value == "top" || opt->value == "middle"))
+ else if (opt.name=="valign" &&
+ (opt.value == "bottom" || opt.value == "top" || opt.value == "middle"))
{
- m_t << " valign=\"" << opt->value << "\"";
+ m_t << " valign=\"" << opt.value << "\"";
}
- else if (opt->name=="width")
+ else if (opt.name=="width")
{
- m_t << " width=\"" << opt->value << "\"";
+ m_t << " width=\"" << opt.value << "\"";
}
- else if (opt->name=="class") // handle markdown generated attributes
+ else if (opt.name=="class") // handle markdown generated attributes
{
- if (opt->value.left(13)=="markdownTable") // handle markdown generated attributes
+ if (opt.value.left(13)=="markdownTable") // handle markdown generated attributes
{
- if (opt->value.right(5)=="Right")
+ if (opt.value.right(5)=="Right")
{
m_t << " align='right'";
}
- else if (opt->value.right(4)=="Left")
+ else if (opt.value.right(4)=="Left")
{
m_t << " align='left'";
}
- else if (opt->value.right(6)=="Center")
+ else if (opt.value.right(6)=="Center")
{
m_t << " align='center'";
}
// skip 'markdownTable*' value ending with "None"
}
- else if (!opt->value.isEmpty())
+ else if (!opt.value.isEmpty())
{
- m_t << " class=\"" << convertToXML(opt->value) << "\"";
+ m_t << " class=\"" << convertToXML(opt.value) << "\"";
}
}
}
@@ -889,7 +890,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)
@@ -930,26 +931,20 @@ void XmlDocVisitor::visitPre(DocImage *img)
{
baseName = correctURL(url,img->relPath());
}
- visitPreStart(m_t, "image", FALSE, this, img->children(), baseName, TRUE, img->type(), img->width(), img->height(), img->attribs().find("alt"), img->isInlineImage());
+ HtmlAttribList attribs = img->attribs();
+ auto it = std::find_if(attribs.begin(),attribs.end(),
+ [](const auto &att) { return att.name=="alt"; });
+ QCString altValue = it!=attribs.end() ? it->value : "";
+ visitPreStart(m_t, "image", FALSE, this, img->children(), baseName, TRUE,
+ img->type(), img->width(), img->height(),
+ altValue, img->isInlineImage());
// copy the image to the output dir
FileDef *fd;
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);
}
}
@@ -1033,19 +1028,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)
@@ -1057,7 +1052,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)
@@ -1083,42 +1078,36 @@ 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;
- //QStrListIterator li(pl->parameters());
- //const char *s;
- QListIterator<DocNode> li(pl->parameters());
- DocNode *param;
- for (li.toFirst();(param=li.current());++li)
+ m_t << "<parameteritem>\n";
+ m_t << "<parameternamelist>\n";
+ for (const auto &param : pl->parameters())
{
- if (pl->paramTypes().count()>0)
+ if (!pl->paramTypes().empty())
{
- QListIterator<DocNode> li2(pl->paramTypes());
- DocNode *type;
m_t << "<parametertype>";
- for (li2.toFirst();(type=li2.current());++li2)
+ for (const auto &type : pl->paramTypes())
{
if (type->kind()==DocNode::Kind_Word)
{
- visit((DocWord*)type);
+ visit((DocWord*)type.get());
}
else if (type->kind()==DocNode::Kind_LinkedWord)
{
- visit((DocLinkedWord*)type);
+ visit((DocLinkedWord*)type.get());
}
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)
@@ -1141,23 +1130,23 @@ void XmlDocVisitor::visitPre(DocParamList *pl)
m_t << ">";
if (param->kind()==DocNode::Kind_Word)
{
- visit((DocWord*)param);
+ visit((DocWord*)param.get());
}
else if (param->kind()==DocNode::Kind_LinkedWord)
{
- visit((DocLinkedWord*)param);
+ 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)
@@ -1184,7 +1173,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 *)
@@ -1235,14 +1224,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=\"";
@@ -1257,16 +1246,3 @@ void XmlDocVisitor::endLink()
m_t << "</ref>";
}
-void XmlDocVisitor::pushEnabled()
-{
- m_enabled.push(new bool(m_hide));
-}
-
-void XmlDocVisitor::popEnabled()
-{
- bool *v=m_enabled.pop();
- ASSERT(v!=0);
- m_hide = *v;
- delete v;
-}
-
diff --git a/src/xmldocvisitor.h b/src/xmldocvisitor.h
index 6fa1392..f4b2a71 100644
--- a/src/xmldocvisitor.h
+++ b/src/xmldocvisitor.h
@@ -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.
*
@@ -19,11 +19,12 @@
#ifndef _XMLDOCVISITOR_H
#define _XMLDOCVISITOR_H
+#include <iostream>
+
+#include "qcstring.h"
#include "docvisitor.h"
-#include <qstack.h>
-#include <qcstring.h>
+#include "textstream.h"
-class FTextStream;
class CodeOutputInterface;
class QCString;
@@ -31,12 +32,12 @@ class QCString;
class XmlDocVisitor : public DocVisitor
{
public:
- XmlDocVisitor(FTextStream &t,CodeOutputInterface &ci);
-
+ XmlDocVisitor(TextStream &t,CodeOutputInterface &ci,const QCString &langExt);
+
//--------------------------------------
// visitor functions for leaf nodes
//--------------------------------------
-
+
void visit(DocWord *);
void visit(DocLinkedWord *);
void visit(DocWhiteSpace *);
@@ -58,7 +59,7 @@ class XmlDocVisitor : public DocVisitor
//--------------------------------------
// visitor functions for compound nodes
//--------------------------------------
-
+
void visitPre(DocAutoList *);
void visitPost(DocAutoList *);
void visitPre(DocAutoListItem *);
@@ -142,26 +143,22 @@ class XmlDocVisitor : public DocVisitor
private:
//--------------------------------------
- // helper functions
+ // 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();
- void pushEnabled();
- void popEnabled();
-
//--------------------------------------
// state variables
//--------------------------------------
- FTextStream &m_t;
+ TextStream &m_t;
CodeOutputInterface &m_ci;
bool m_insidePre;
bool m_hide;
- QStack<bool> m_enabled;
QCString m_langExt;
};
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp
index 118a6cd..7de18f9 100644
--- a/src/xmlgen.cpp
+++ b/src/xmlgen.cpp
@@ -15,11 +15,7 @@
#include <stdlib.h>
-#include <qdir.h>
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qintdict.h>
-
+#include "textstream.h"
#include "xmlgen.h"
#include "doxygen.h"
#include "message.h"
@@ -49,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)
@@ -59,64 +57,65 @@
//------------------
-/** Helper class mapping MemberList::ListType to a string representing */
-class XmlSectionMapper : public QIntDict<char>
+static std::map<MemberListType,std::string> g_xmlSectionMap =
{
- public:
- XmlSectionMapper() : QIntDict<char>(47)
- {
- insert(MemberListType_pubTypes,"public-type");
- insert(MemberListType_pubMethods,"public-func");
- insert(MemberListType_pubAttribs,"public-attrib");
- insert(MemberListType_pubSlots,"public-slot");
- insert(MemberListType_signals,"signal");
- insert(MemberListType_dcopMethods,"dcop-func");
- insert(MemberListType_properties,"property");
- insert(MemberListType_events,"event");
- insert(MemberListType_interfaces,"interfaces");
- insert(MemberListType_services,"services");
- insert(MemberListType_pubStaticMethods,"public-static-func");
- insert(MemberListType_pubStaticAttribs,"public-static-attrib");
- insert(MemberListType_proTypes,"protected-type");
- insert(MemberListType_proMethods,"protected-func");
- insert(MemberListType_proAttribs,"protected-attrib");
- insert(MemberListType_proSlots,"protected-slot");
- insert(MemberListType_proStaticMethods,"protected-static-func");
- insert(MemberListType_proStaticAttribs,"protected-static-attrib");
- insert(MemberListType_pacTypes,"package-type");
- insert(MemberListType_pacMethods,"package-func");
- insert(MemberListType_pacAttribs,"package-attrib");
- insert(MemberListType_pacStaticMethods,"package-static-func");
- insert(MemberListType_pacStaticAttribs,"package-static-attrib");
- insert(MemberListType_priTypes,"private-type");
- insert(MemberListType_priMethods,"private-func");
- insert(MemberListType_priAttribs,"private-attrib");
- insert(MemberListType_priSlots,"private-slot");
- insert(MemberListType_priStaticMethods,"private-static-func");
- insert(MemberListType_priStaticAttribs,"private-static-attrib");
- insert(MemberListType_friends,"friend");
- insert(MemberListType_related,"related");
- insert(MemberListType_decDefineMembers,"define");
- insert(MemberListType_decProtoMembers,"prototype");
- insert(MemberListType_decTypedefMembers,"typedef");
- insert(MemberListType_decSequenceMembers,"sequence");
- insert(MemberListType_decDictionaryMembers,"dictionary");
- insert(MemberListType_decEnumMembers,"enum");
- insert(MemberListType_decFuncMembers,"func");
- insert(MemberListType_decVarMembers,"var");
- }
+ { MemberListType_pubTypes,"public-type" },
+ { MemberListType_pubMethods,"public-func" },
+ { MemberListType_pubAttribs,"public-attrib" },
+ { MemberListType_pubSlots,"public-slot" },
+ { MemberListType_signals,"signal" },
+ { MemberListType_dcopMethods,"dcop-func" },
+ { MemberListType_properties,"property" },
+ { MemberListType_events,"event" },
+ { MemberListType_interfaces,"interfaces" },
+ { MemberListType_services,"services" },
+ { MemberListType_pubStaticMethods,"public-static-func" },
+ { MemberListType_pubStaticAttribs,"public-static-attrib" },
+ { MemberListType_proTypes,"protected-type" },
+ { MemberListType_proMethods,"protected-func" },
+ { MemberListType_proAttribs,"protected-attrib" },
+ { MemberListType_proSlots,"protected-slot" },
+ { MemberListType_proStaticMethods,"protected-static-func" },
+ { MemberListType_proStaticAttribs,"protected-static-attrib" },
+ { MemberListType_pacTypes,"package-type" },
+ { MemberListType_pacMethods,"package-func" },
+ { MemberListType_pacAttribs,"package-attrib" },
+ { MemberListType_pacStaticMethods,"package-static-func" },
+ { MemberListType_pacStaticAttribs,"package-static-attrib" },
+ { MemberListType_priTypes,"private-type" },
+ { MemberListType_priMethods,"private-func" },
+ { MemberListType_priAttribs,"private-attrib" },
+ { MemberListType_priSlots,"private-slot" },
+ { MemberListType_priStaticMethods,"private-static-func" },
+ { MemberListType_priStaticAttribs,"private-static-attrib" },
+ { MemberListType_friends,"friend" },
+ { MemberListType_related,"related" },
+ { MemberListType_decDefineMembers,"define" },
+ { MemberListType_decProtoMembers,"prototype" },
+ { MemberListType_decTypedefMembers,"typedef" },
+ { MemberListType_decSequenceMembers,"sequence" },
+ { MemberListType_decDictionaryMembers,"dictionary" },
+ { MemberListType_decEnumMembers,"enum" },
+ { MemberListType_decFuncMembers,"func" },
+ { MemberListType_decVarMembers,"var" },
};
-static XmlSectionMapper g_xmlSectionMapper;
+static const char *xmlSectionMapper(MemberListType ml)
+{
+ auto it = g_xmlSectionMap.find(ml);
+ return it!=g_xmlSectionMap.end() ? it->second.c_str() : "";
+}
-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++))
{
@@ -143,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"
@@ -191,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>";
@@ -210,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)
@@ -239,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)
@@ -250,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"));
@@ -294,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)
@@ -317,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()
@@ -341,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,
@@ -363,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,0,4);
+ writeTemplateArgumentList(t,cd->templateArguments(),cd,cd->getFileDef(),4);
}
-static void writeXMLDocBlock(FTextStream &t,
+static void writeTemplateList(const ConceptDef *cd,TextStream &t)
+{
+ writeTemplateArgumentList(t,cd->getTemplateParameterList(),cd,cd->getFileDef(),4);
+}
+
+static void writeXMLDocBlock(TextStream &t,
const QCString &fileName,
int lineNr,
const Definition *scope,
@@ -417,11 +419,11 @@ 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
- XmlDocVisitor *visitor = new XmlDocVisitor(t,*xmlCodeGen);
+ XmlDocVisitor *visitor = new XmlDocVisitor(t,*xmlCodeGen,scope?scope->getDefFileExtension():QCString(""));
// visit all nodes
root->accept(visitor);
// clean up
@@ -431,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());
@@ -439,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
@@ -456,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();
@@ -475,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";
}
@@ -512,7 +514,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
@@ -560,7 +562,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())
@@ -790,44 +792,44 @@ static void generateXMLForMember(const MemberDef *md,FTextStream &ti,FTextStream
t << "\"";
}
- t << ">" << endl;
+ t << ">\n";
if (md->memberType()!=MemberType_Define &&
md->memberType()!=MemberType_Enumeration
)
{
writeMemberTemplateLists(md,t);
- QCString typeStr = md->typeString(); //replaceAnonymousScopes(md->typeString());
+ QCString typeStr = md->typeString();
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();
@@ -835,27 +837,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";
}
- MemberList *rbml = md->reimplementedBy();
- if (rbml)
+ for (const auto &rbmd : md->reimplementedBy())
{
- MemberListIterator mli(*rbml);
- for (mli.toFirst();(rmd=mli.current());++mli)
- {
- t << " <reimplementedby refid=\""
- << memberOutputFileBase(rmd) << "_1" << rmd->anchor() << "\">"
- << convertToXML(rmd->name()) << "</reimplementedby>" << endl;
- }
+ t << " <reimplementedby refid=\""
+ << memberOutputFileBase(rbmd) << "_1" << rbmd->anchor() << "\">"
+ << 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
{
@@ -873,136 +870,136 @@ 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
{
- const MemberList *enumFields = md->enumFieldList();
- if (enumFields)
+ for (const auto &emd : md->enumFieldList())
{
- MemberListIterator emli(*enumFields);
- const MemberDef *emd;
- for (emli.toFirst();(emd=emli.current());++emli)
- {
- ti << " <member refid=\"" << memberOutputFileBase(md)
- << "_1" << emd->anchor() << "\" kind=\"enumvalue\"><name>"
- << convertToXML(emd->name()) << "</name></member>" << endl;
+ ti << " <member refid=\"" << memberOutputFileBase(md)
+ << "_1" << emd->anchor() << "\" kind=\"enumvalue\"><name>"
+ << convertToXML(emd->name()) << "</name></member>\n";
- t << " <enumvalue id=\"" << memberOutputFileBase(md) << "_1"
- << emd->anchor() << "\" prot=\"";
- switch (emd->protection())
- {
- case Public: t << "public"; break;
- case Protected: t << "protected"; break;
- case Private: t << "private"; break;
- case Package: t << "package"; break;
- }
- t << "\">" << endl;
- t << " <name>";
- writeXMLString(t,emd->name());
- t << "</name>" << endl;
- if (!emd->initializer().isEmpty())
- {
- t << " <initializer>";
- writeXMLString(t,emd->initializer());
- t << "</initializer>" << endl;
- }
- t << " <briefdescription>" << endl;
- writeXMLDocBlock(t,emd->briefFile(),emd->briefLine(),emd->getOuterScope(),emd,emd->briefDescription());
- t << " </briefdescription>" << endl;
- t << " <detaileddescription>" << endl;
- writeXMLDocBlock(t,emd->docFile(),emd->docLine(),emd->getOuterScope(),emd,emd->documentation());
- t << " </detaileddescription>" << endl;
- t << " </enumvalue>" << endl;
+ t << " <enumvalue id=\"" << memberOutputFileBase(md) << "_1"
+ << emd->anchor() << "\" prot=\"";
+ switch (emd->protection())
+ {
+ case Public: t << "public"; break;
+ case Protected: t << "protected"; break;
+ case Private: t << "private"; break;
+ case Package: t << "package"; break;
}
+ t << "\">\n";
+ t << " <name>";
+ writeXMLString(t,emd->name());
+ t << "</name>\n";
+ if (!emd->initializer().isEmpty())
+ {
+ t << " <initializer>";
+ writeXMLString(t,emd->initializer());
+ t << "</initializer>\n";
+ }
+ t << " <briefdescription>\n";
+ writeXMLDocBlock(t,emd->briefFile(),emd->briefLine(),emd->getOuterScope(),emd,emd->briefDescription());
+ t << " </briefdescription>\n";
+ t << " <detaileddescription>\n";
+ writeXMLDocBlock(t,emd->docFile(),emd->docLine(),emd->getOuterScope(),emd,emd->documentation());
+ 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=\""
@@ -1025,7 +1022,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());
@@ -1040,7 +1037,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
@@ -1052,15 +1049,13 @@ 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;
- MemberListIterator mli(*ml);
- const MemberDef *md;
int count=0;
- for (mli.toFirst();(md=mli.current());++mli)
+ for (const auto &md : *ml)
{
if (memberVisible(d,md) && (md->memberType()!=MemberType_EnumValue) &&
!md->isHidden())
@@ -1070,30 +1065,30 @@ 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 (mli.toFirst();(md=mli.current());++mli)
+ for (const auto &md : *ml)
{
if (memberVisible(d,md))
{
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)
@@ -1125,14 +1120,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)
{
@@ -1147,12 +1142,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)
{
@@ -1160,26 +1155,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)
{
- if (fl)
+ for (const auto &fd : fl)
{
- QListIterator<FileDef> fli(*fl);
- FileDef *fd;
- for (fli.toFirst();(fd=fli.current());++fli)
- {
- t << " <innerfile refid=\"" << fd->getOutputFileBase()
- << "\">" << convertToXML(fd->name()) << "</innerfile>" << endl;
- }
+ t << " <innerfile refid=\"" << fd->getOutputFileBase()
+ << "\">" << 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)
{
@@ -1188,33 +1178,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
@@ -1238,22 +1248,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=\""
@@ -1270,10 +1279,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 ";
@@ -1308,7 +1317,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())
{
@@ -1330,33 +1339,17 @@ static void generateXMLForClass(const ClassDef *cd,FTextStream &ti)
case Pure: t << "pure-virtual"; break;
}
t << "\">" << convertToXML(bcd.classDef->displayName())
- << "</derivedcompoundref>" << endl;
+ << "</derivedcompoundref>\n";
}
- 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);
writeTemplateList(cd,t);
for (const auto &mg : cd->getMemberGroups())
{
- generateXMLSection(cd,ti,t,mg->members(),"user-defined",mg->header(),
+ generateXMLSection(cd,ti,t,&mg->members(),"user-defined",mg->header(),
mg->documentation());
}
@@ -1364,29 +1357,36 @@ static void generateXMLForClass(const ClassDef *cd,FTextStream &ti)
{
if ((ml->listType()&MemberListType_detailedLists)==0)
{
- generateXMLSection(cd,ti,t,ml.get(),g_xmlSectionMapper.find(ml->listType()));
+ generateXMLSection(cd,ti,t,ml.get(),xmlSectionMapper(ml->listType()));
}
}
- 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=\""
@@ -1402,15 +1402,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
@@ -1425,35 +1469,34 @@ 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);
for (const auto &mg : nd->getMemberGroups())
{
- generateXMLSection(nd,ti,t,mg->members(),"user-defined",mg->header(),
+ generateXMLSection(nd,ti,t,&mg->members(),"user-defined",mg->header(),
mg->documentation());
}
@@ -1461,27 +1504,27 @@ static void generateXMLForNamespace(const NamespaceDef *nd,FTextStream &ti)
{
if ((ml->listType()&MemberListType_declarationLists)!=0)
{
- generateXMLSection(nd,ti,t,ml.get(),g_xmlSectionMapper.find(ml->listType()));
+ generateXMLSection(nd,ti,t,ml.get(),xmlSectionMapper(ml->listType()));
}
}
- 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
@@ -1501,75 +1544,64 @@ 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";
- IncludeInfo *inc;
-
- if (fd->includeFileList())
+ for (const auto &inc : fd->includeFileList())
{
- QListIterator<IncludeInfo> ili1(*fd->includeFileList());
- for (ili1.toFirst();(inc=ili1.current());++ili1)
+ t << " <includes";
+ if (inc.fileDef && !inc.fileDef->isReference()) // TODO: support external references
{
- t << " <includes";
- if (inc->fileDef && !inc->fileDef->isReference()) // TODO: support external references
- {
- t << " refid=\"" << inc->fileDef->getOutputFileBase() << "\"";
- }
- t << " local=\"" << (inc->local ? "yes" : "no") << "\">";
- t << inc->includeName;
- t << "</includes>" << endl;
+ t << " refid=\"" << inc.fileDef->getOutputFileBase() << "\"";
}
+ t << " local=\"" << (inc.local ? "yes" : "no") << "\">";
+ t << inc.includeName;
+ t << "</includes>\n";
}
- if (fd->includedByFileList())
+ for (const auto &inc : fd->includedByFileList())
{
- QListIterator<IncludeInfo> ili2(*fd->includedByFileList());
- for (ili2.toFirst();(inc=ili2.current());++ili2)
+ t << " <includedby";
+ if (inc.fileDef && !inc.fileDef->isReference()) // TODO: support external references
{
- t << " <includedby";
- if (inc->fileDef && !inc->fileDef->isReference()) // TODO: support external references
- {
- t << " refid=\"" << inc->fileDef->getOutputFileBase() << "\"";
- }
- t << " local=\"" << (inc->local ? "yes" : "no") << "\">";
- t << inc->includeName;
- t << "</includedby>" << endl;
+ t << " refid=\"" << inc.fileDef->getOutputFileBase() << "\"";
}
+ t << " local=\"" << (inc.local ? "yes" : "no") << "\">";
+ t << inc.includeName;
+ 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);
@@ -1577,7 +1609,7 @@ static void generateXMLForFile(FileDef *fd,FTextStream &ti)
for (const auto &mg : fd->getMemberGroups())
{
- generateXMLSection(fd,ti,t,mg->members(),"user-defined",mg->header(),
+ generateXMLSection(fd,ti,t,&mg->members(),"user-defined",mg->header(),
mg->documentation());
}
@@ -1585,28 +1617,28 @@ static void generateXMLForFile(FileDef *fd,FTextStream &ti)
{
if ((ml->listType()&MemberListType_declarationLists)!=0)
{
- generateXMLSection(fd,ti,t,ml.get(),g_xmlSectionMapper.find(ml->listType()));
+ generateXMLSection(fd,ti,t,ml.get(),xmlSectionMapper(ml->listType()));
}
}
- 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
@@ -1623,24 +1655,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);
@@ -1650,7 +1681,7 @@ static void generateXMLForGroup(const GroupDef *gd,FTextStream &ti)
for (const auto &mg : gd->getMemberGroups())
{
- generateXMLSection(gd,ti,t,mg->members(),"user-defined",mg->header(),
+ generateXMLSection(gd,ti,t,&mg->members(),"user-defined",mg->header(),
mg->documentation());
}
@@ -1658,62 +1689,61 @@ static void generateXMLForGroup(const GroupDef *gd,FTextStream &ti)
{
if ((ml->listType()&MemberListType_declarationLists)!=0)
{
- generateXMLSection(gd,ti,t,ml.get(),g_xmlSectionMapper.find(ml->listType()));
+ generateXMLSection(gd,ti,t,ml.get(),xmlSectionMapper(ml->listType()));
}
}
- 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
@@ -1733,53 +1763,52 @@ 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
{
QCString title;
if (mainPageHasTitle())
{
- title = filterTitle(convertCharEntitiesToUTF8(Doxygen::mainPage->title()));
+ title = filterTitle(convertCharEntitiesToUTF8(Doxygen::mainPage->title()).str());
}
else
{
title = Config_getString(PROJECT_NAME);
}
t << " <title>" << convertToXML(convertCharEntitiesToUTF8(title))
- << "</title>" << endl;
+ << "</title>\n";
}
else
{
const SectionInfo *si = SectionManager::instance().find(pd->name());
if (si)
{
- t << " <title>" << convertToXML(convertCharEntitiesToUTF8(filterTitle(si->title())))
- << "</title>" << endl;
+ t << " <title>" << convertToXML(filterTitle(convertCharEntitiesToUTF8(si->title()).str()))
+ << "</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();
@@ -1787,31 +1816,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;
}
@@ -1819,19 +1848,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,
@@ -1842,19 +1871,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
@@ -1862,111 +1892,118 @@ 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)
+ // 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)
{
- FTextStream t(&f);
- HtmlEntityMapper::instance()->writeXMLSchema(t);
- }
- else
- {
- f.writeBlock(startLine,len);
+ QCString s(startLine,len);
+ 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;
diff --git a/templates/general/layout_default.xml b/templates/general/layout_default.xml
index 373bb20..c671020 100644
--- a/templates/general/layout_default.xml
+++ b/templates/general/layout_default.xml
@@ -9,6 +9,8 @@
<tab type="namespacelist" visible="yes" title="" intro=""/>
<tab type="namespacemembers" visible="yes" title="" intro=""/>
</tab>
+ <tab type="concepts" visible="yes" title="">
+ </tab>
<tab type="interfaces" visible="yes" title="">
<tab type="interfacelist" visible="yes" title="" intro=""/>
<tab type="interfaceindex" visible="$ALPHABETICAL_INDEX" title=""/>
@@ -103,6 +105,7 @@
<constantgroups visible="yes" title=""/>
<interfaces visible="yes" title=""/>
<classes visible="yes" title=""/>
+ <concepts visible="yes" title=""/>
<structs visible="yes" title=""/>
<exceptions visible="yes" title=""/>
<typedefs title=""/>
@@ -126,6 +129,15 @@
<authorsection visible="yes"/>
</namespace>
+ <!-- Layout definition for a concept page -->
+ <concept>
+ <briefdescription visible="yes"/>
+ <includes visible="$SHOW_INCLUDE_FILES"/>
+ <definition visible="yes" title=""/>
+ <detaileddescription title=""/>
+ <authorsection visible="yes"/>
+ </concept>
+
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
@@ -139,6 +151,7 @@
<structs visible="yes" title=""/>
<exceptions visible="yes" title=""/>
<namespaces visible="yes" title=""/>
+ <concepts visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
@@ -172,6 +185,7 @@
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
+ <concepts visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
diff --git a/templates/html/doxygen.css b/templates/html/doxygen.css
index 5898d87..29dafbe 100644
--- a/templates/html/doxygen.css
+++ b/templates/html/doxygen.css
@@ -439,6 +439,12 @@ img.footer {
vertical-align: middle;
}
+.compoundTemplParams {
+ color: ##60;
+ font-size: 80%;
+ line-height: 120%;
+}
+
/* @group Code Colorization */
span.keyword {
diff --git a/templates/html/htmllayout.tpl b/templates/html/htmllayout.tpl
index 74d83c6..b79f835 100644
--- a/templates/html/htmllayout.tpl
+++ b/templates/html/htmllayout.tpl
@@ -12,7 +12,7 @@
{% resource 'tab_s.lum' %}
{% resource 'tab_h.lum' %}
{% resource 'bc_s.luma' %}
-{% resource 'doxygen.luma' %}
+{% resource 'doxygen.svg' %}
{% resource 'closed.luma' %}
{% resource 'open.luma' %}
{% resource 'bdwn.luma' %}
diff --git a/templates/latex/doxygen.sty b/templates/latex/doxygen.sty
index 8f59bcc..8d9535a 100644
--- a/templates/latex/doxygen.sty
+++ b/templates/latex/doxygen.sty
@@ -20,6 +20,8 @@
\RequirePackage{adjustbox}
\RequirePackage{amssymb}
\RequirePackage{stackengine}
+\RequirePackage{enumitem}
+\RequirePackage{alphalph}
\RequirePackage[normalem]{ulem} % for strikeout, but don't modify emphasis
%---------- Internal commands used in this style file ----------------
@@ -574,3 +576,13 @@
\H@refstepcounter{figure}%
\@dblarg{\@caption{figure}}}
\makeatother
+
+% Define alpha enumarative names for counters > 26
+\makeatletter
+\def\enumalphalphcnt#1{\expandafter\@enumalphalphcnt\csname c@#1\endcsname}
+\def\@enumalphalphcnt#1{\alphalph{#1}}
+\def\enumAlphAlphcnt#1{\expandafter\@enumAlphAlphcnt\csname c@#1\endcsname}
+\def\@enumAlphAlphcnt#1{\AlphAlph{#1}}
+\makeatother
+\AddEnumerateCounter{\enumalphalphcnt}{\@enumalphalphcnt}{aa}
+\AddEnumerateCounter{\enumAlphAlphcnt}{\@enumAlphAlphcnt}{AA}
diff --git a/templates/latex/tabu_doxygen.sty b/templates/latex/tabu_doxygen.sty
index 60fd7e8..3f17d1d 100755
--- a/templates/latex/tabu_doxygen.sty
+++ b/templates/latex/tabu_doxygen.sty
@@ -1,2557 +1,2557 @@
-%%
-%% This is file `tabu.sty',
-%% generated with the docstrip utility.
-%%
-%% The original source files were:
-%%
-%% tabu.dtx (with options: `package')
-%%
-%% This is a generated file.
-%% Copyright (FC) 2010-2011 - lppl
-%%
-%% tabu : 2011/02/26 v2.8 - tabu : Flexible LaTeX tabulars
-%%
-%% **********************************************************************************************
-%% \begin{tabu} { preamble } => default target: \linewidth or \linegoal
-%% \begin{tabu} to <dimen>{ preamble } => target specified
-%% \begin{tabu} spread <dimen>{ preamble } => target relative to the ``natural width''
-%%
-%% tabu works in text and in math modes.
-%%
-%% X columns: automatic width adjustment + horizontal and vertical alignment
-%% \begin{tabu} { X[4c] X[1c] X[-2ml] }
-%%
-%% Horizontal lines and / or leaders:
-%% \hline\hline => double horizontal line
-%% \firsthline\hline => for nested tabulars
-%% \lasthline\hline => for nested tabulars
-%% \tabucline[line spec]{column-column} => ``funny'' lines (dash/leader)
-%% Automatic lines / leaders :
-%% \everyrow{\hline\hline}
-%%
-%% Vertical lines and / or leaders:
-%% \begin{tabu} { |[3pt red] X[4c] X[1c] X[-2ml] |[3pt blue] }
-%% \begin{tabu} { |[3pt red] X[4c] X[1c] X[-2ml] |[3pt on 2pt off 4pt blue] }
-%%
-%% Fixed vertical spacing adjustment:
-%% \extrarowheight=<dimen> \extrarowdepth=<dimen>
-%% or: \extrarowsep=<dimen> => may be prefixed by \global
-%%
-%% Dynamic vertical spacing adjustment:
-%% \abovetabulinesep=<dimen> \belowtabulinesep=<dimen>
-%% or: \tabulinesep=<dimen> => may be prefixed by \global
-%%
-%% delarray.sty shortcuts: in math and text modes
-%% \begin{tabu} .... \({ preamble }\)
-%%
-%% Algorithms reports:
-%% \tracingtabu=1 \tracingtabu=2
-%%
-%% **********************************************************************************************
-%%
-%% This work may be distributed and/or modified under the
-%% conditions of the LaTeX Project Public License, either
-%% version 1.3 of this license or (at your option) any later
-%% version. The latest version of this license is in
-%% http://www.latex-project.org/lppl.txt
-%%
-%% This work consists of the main source file tabu.dtx
-%% and the derived files
-%% tabu.sty, tabu.pdf, tabu.ins
-%%
-%% tabu : Flexible LaTeX tabulars
-%% lppl copyright 2010-2011 by FC <florent.chervet@free.fr>
-%%
-
-\NeedsTeXFormat{LaTeX2e}[2005/12/01]
-\ProvidesPackage{tabu_doxygen}[2011/02/26 v2.8 - flexible LaTeX tabulars (FC), frozen version for doxygen]
-\RequirePackage{array}[2008/09/09]
-\RequirePackage{varwidth}[2009/03/30]
-\AtEndOfPackage{\tabu@AtEnd \let\tabu@AtEnd \@undefined}
-\let\tabu@AtEnd\@empty
-\def\TMP@EnsureCode#1={%
- \edef\tabu@AtEnd{\tabu@AtEnd
- \catcode#1 \the\catcode#1}%
- \catcode#1=%
-}% \TMP@EnsureCode
-\TMP@EnsureCode 33 = 12 % !
-\TMP@EnsureCode 58 = 12 % : (for siunitx)
-\TMP@EnsureCode124 = 12 % |
-\TMP@EnsureCode 36 = 3 % $ = math shift
-\TMP@EnsureCode 38 = 4 % & = tab alignment character
-\TMP@EnsureCode 32 = 10 % space
-\TMP@EnsureCode 94 = 7 % ^
-\TMP@EnsureCode 95 = 8 % _
-%% Constants --------------------------------------------------------
-\newcount \c@taburow \def\thetaburow {\number\c@taburow}
-\newcount \tabu@nbcols
-\newcount \tabu@cnt
-\newcount \tabu@Xcol
-\let\tabu@start \@tempcnta
-\let\tabu@stop \@tempcntb
-\newcount \tabu@alloc \tabu@alloc=\m@ne
-\newcount \tabu@nested
-\def\tabu@alloc@{\global\advance\tabu@alloc \@ne \tabu@nested\tabu@alloc}
-\newdimen \tabu@target
-\newdimen \tabu@spreadtarget
-\newdimen \tabu@naturalX
-\newdimen \tabucolX
-\let\tabu@DELTA \@tempdimc
-\let\tabu@thick \@tempdima
-\let\tabu@on \@tempdimb
-\let\tabu@off \@tempdimc
-\newdimen \tabu@Xsum
-\newdimen \extrarowdepth
-\newdimen \abovetabulinesep
-\newdimen \belowtabulinesep
-\newdimen \tabustrutrule \tabustrutrule \z@
-\newtoks \tabu@thebody
-\newtoks \tabu@footnotes
-\newsavebox \tabu@box
-\newsavebox \tabu@arstrutbox
-\newsavebox \tabu@hleads
-\newsavebox \tabu@vleads
-\newif \iftabu@colortbl
-\newif \iftabu@siunitx
-\newif \iftabu@measuring
-\newif \iftabu@spread
-\newif \iftabu@negcoef
-\newif \iftabu@everyrow
-\def\tabu@everyrowtrue {\global\let\iftabu@everyrow \iftrue}
-\def\tabu@everyrowfalse{\global\let\iftabu@everyrow \iffalse}
-\newif \iftabu@long
-\newif \iftabuscantokens
-\def\tabu@rescan {\tabu@verbatim \scantokens }
-%% Utilities (for internal usage) -----------------------------------
-\def\tabu@gobblespace #1 {#1}
-\def\tabu@gobbletoken #1#2{#1}
-\def\tabu@gobbleX{\futurelet\@let@token \tabu@gobblex}
-\def\tabu@gobblex{\if ^^J\noexpand\@let@token \expandafter\@gobble
- \else\ifx \@sptoken\@let@token
- \expandafter\tabu@gobblespace\expandafter\tabu@gobbleX
- \fi\fi
-}% \tabu@gobblex
-\def\tabu@X{^^J}
-{\obeyspaces
-\global\let\tabu@spxiii= % saves an active space (for \ifx)
-\gdef\tabu@@spxiii{ }}
-\def\tabu@ifenvir {% only for \multicolumn
- \expandafter\tabu@if@nvir\csname\@currenvir\endcsname
-}% \tabu@ifenvir
-\def\tabu@if@nvir #1{\csname @\ifx\tabu#1first\else
- \ifx\longtabu#1first\else
- second\fi\fi oftwo\endcsname
-}% \tabu@ifenvir
-\def\tabu@modulo #1#2{\numexpr\ifnum\numexpr#1=\z@ 0\else #1-(#1-(#2-1)/2)/(#2)*(#2)\fi}
-{\catcode`\&=3
-\gdef\tabu@strtrim #1{% #1 = control sequence to trim
- \ifodd 1\ifx #1\@empty \else \ifx #1\space \else 0\fi \fi
- \let\tabu@c@l@r \@empty \let#1\@empty
- \else \expandafter \tabu@trimspaces #1&#1\@nnil
- \fi
-}% \tabu@strtrim
-\gdef\tabu@trimspaces #1&#2\@nnil{\let\tabu@c@l@r=#2\tabu@firstspace .#1& &#2}%
-\gdef\tabu@firstspace #1#2#3 &{\tabu@lastspace #2#3&}
-\gdef\tabu@lastspace #1&#2&#3{\def #3{#1}%
- \ifx #3\tabu@c@l@r \def\tabu@c@l@r{\protect\color{#1}}\expandafter\remove@to@nnil \fi
- \tabu@trimspaces #1&#3\@nnil}
-}% \catcode
-\def\tabu@sanitizearg #1#2{{%
- \csname \ifcsname if@safe@actives\endcsname % <babel>
- @safe@activestrue\else
- relax\fi \endcsname
- \edef#2{#1}\tabu@strtrim#2\@onelevel@sanitize#2%
- \expandafter}\expandafter\def\expandafter#2\expandafter{#2}%
-}% \tabu@sanitizearg
-\def\tabu@textbar #1{\begingroup \endlinechar\m@ne \scantokens{\def\:{|}}%
- \expandafter\endgroup \expandafter#1\:% !!! semi simple group !!!
-}% \tabu@textbar
-\def\tabu@everyrow@bgroup{\iftabu@everyrow \begingroup \else \noalign{\ifnum0=`}\fi \fi}
-\def\tabu@everyrow@egroup{%
- \iftabu@everyrow \expandafter \endgroup \the\toks@
- \else \ifnum0=`{\fi}%
- \fi
-}% \tabu@everyrow@egroup
-\def\tabu@arstrut {\global\setbox\@arstrutbox \hbox{\vrule
- height \arraystretch \dimexpr\ht\strutbox+\extrarowheight
- depth \arraystretch \dimexpr\dp\strutbox+\extrarowdepth
- width \z@}%
-}% \tabu@arstrut
-\def\tabu@rearstrut {%
- \@tempdima \arraystretch\dimexpr\ht\strutbox+\extrarowheight \relax
- \@tempdimb \arraystretch\dimexpr\dp\strutbox+\extrarowdepth \relax
- \ifodd 1\ifdim \ht\@arstrutbox=\@tempdima
- \ifdim \dp\@arstrutbox=\@tempdimb 0 \fi\fi
- \tabu@mkarstrut
- \fi
-}% \tabu@rearstrut
-\def\tabu@@DBG #1{\ifdim\tabustrutrule>\z@ \color{#1}\fi}
-\def\tabu@DBG@arstrut {\global\setbox\@arstrutbox
- \hbox to\z@{\hbox to\z@{\hss
- {\tabu@DBG{cyan}\vrule
- height \arraystretch \dimexpr\ht\strutbox+\extrarowheight
- depth \z@
- width \tabustrutrule}\kern-\tabustrutrule
- {\tabu@DBG{pink}\vrule
- height \z@
- depth \arraystretch \dimexpr\dp\strutbox+\extrarowdepth
- width \tabustrutrule}}}%
-}% \tabu@DBG@arstrut
-\def\tabu@save@decl{\toks\count@ \expandafter{\the\toks\expandafter\count@
- \@nextchar}}%
-\def\tabu@savedecl{\ifcat$\d@llarend\else
- \let\save@decl \tabu@save@decl \fi % no inversion of tokens in text mode
-}% \tabu@savedecl
-\def\tabu@finalstrut #1{\unskip\ifhmode\nobreak\fi\vrule height\z@ depth\z@ width\z@}
-\newcommand*\tabuDisableCommands {\g@addto@macro\tabu@trialh@@k }
-\let\tabu@trialh@@k \@empty
-\def\tabu@nowrite #1#{{\afterassignment}\toks@}
-\let\tabu@write\write
-\let\tabu@immediate\immediate
-\def\tabu@WRITE{\begingroup
- \def\immediate\write{\aftergroup\endgroup
- \tabu@immediate\tabu@write}%
-}% \tabu@WRITE
-\expandafter\def\expandafter\tabu@GenericError\expandafter{%
- \expandafter\tabu@WRITE\GenericError}
-\def\tabu@warn{\tabu@WRITE\PackageWarning{tabu}}
-\def\tabu@noxfootnote [#1]{\@gobble}
-\def\tabu@nocolor #1#{\@gobble}
-\newcommand*\tabu@norowcolor[2][]{}
-\def\tabu@maybesiunitx #1{\def\tabu@temp{#1}%
- \futurelet\@let@token \tabu@m@ybesiunitx}
-\def\tabu@m@ybesiunitx #1{\def\tabu@m@ybesiunitx {%
- \ifx #1\@let@token \let\tabu@cellleft \@empty \let\tabu@cellright \@empty \fi
- \tabu@temp}% \tabu@m@ybesiunitx
-}\expandafter\tabu@m@ybesiunitx \csname siunitx_table_collect_begin:Nn\endcsname
-\def\tabu@celllalign@def #1{\def\tabu@celllalign{\tabu@maybesiunitx{#1}}}%
-%% Fixed vertical spacing adjustment: \extrarowsep ------------------
-\newcommand*\extrarowsep{\edef\tabu@C@extra{\the\numexpr\tabu@C@extra+1}%
- \iftabu@everyrow \aftergroup\tabu@Gextra
- \else \aftergroup\tabu@n@Gextra
- \fi
- \@ifnextchar={\tabu@gobbletoken\tabu@extra} \tabu@extra
-}% \extrarowsep
-\def\tabu@extra {\@ifnextchar_%
- {\tabu@gobbletoken{\tabu@setextra\extrarowheight \extrarowdepth}}
- {\ifx ^\@let@token \def\tabu@temp{%
- \tabu@gobbletoken{\tabu@setextra\extrarowdepth \extrarowheight}}%
- \else \let\tabu@temp \@empty
- \afterassignment \tabu@setextrasep \extrarowdepth
- \fi \tabu@temp}%
-}% \tabu@extra
-\def\tabu@setextra #1#2{\def\tabu@temp{\tabu@extr@#1#2}\afterassignment\tabu@temp#2}
-\def\tabu@extr@ #1#2{\@ifnextchar^%
- {\tabu@gobbletoken{\tabu@setextra\extrarowdepth \extrarowheight}}
- {\ifx _\@let@token \def\tabu@temp{%
- \tabu@gobbletoken{\tabu@setextra\extrarowheight \extrarowdepth}}%
- \else \let\tabu@temp \@empty
- \tabu@Gsave \tabu@G@extra \tabu@C@extra \extrarowheight \extrarowdepth
- \fi \tabu@temp}%
-}% \tabu@extr@
-\def\tabu@setextrasep {\extrarowheight=\extrarowdepth
- \tabu@Gsave \tabu@G@extra \tabu@C@extra \extrarowheight \extrarowdepth
-}% \tabu@setextrasep
-\def\tabu@Gextra{\ifx \tabu@G@extra\@empty \else {\tabu@Rextra}\fi}
-\def\tabu@n@Gextra{\ifx \tabu@G@extra\@empty \else \noalign{\tabu@Rextra}\fi}
-\def\tabu@Rextra{\tabu@Grestore \tabu@G@extra \tabu@C@extra}
-\let\tabu@C@extra \z@
-\let\tabu@G@extra \@empty
-%% Dynamic vertical spacing adjustment: \tabulinesep ----------------
-\newcommand*\tabulinesep{\edef\tabu@C@linesep{\the\numexpr\tabu@C@linesep+1}%
- \iftabu@everyrow \aftergroup\tabu@Glinesep
- \else \aftergroup\tabu@n@Glinesep
- \fi
- \@ifnextchar={\tabu@gobbletoken\tabu@linesep} \tabu@linesep
-}% \tabulinesep
-\def\tabu@linesep {\@ifnextchar_%
- {\tabu@gobbletoken{\tabu@setsep\abovetabulinesep \belowtabulinesep}}
- {\ifx ^\@let@token \def\tabu@temp{%
- \tabu@gobbletoken{\tabu@setsep\belowtabulinesep \abovetabulinesep}}%
- \else \let\tabu@temp \@empty
- \afterassignment \tabu@setlinesep \abovetabulinesep
- \fi \tabu@temp}%
-}% \tabu@linesep
-\def\tabu@setsep #1#2{\def\tabu@temp{\tabu@sets@p#1#2}\afterassignment\tabu@temp#2}
-\def\tabu@sets@p #1#2{\@ifnextchar^%
- {\tabu@gobbletoken{\tabu@setsep\belowtabulinesep \abovetabulinesep}}
- {\ifx _\@let@token \def\tabu@temp{%
- \tabu@gobbletoken{\tabu@setsep\abovetabulinesep \belowtabulinesep}}%
- \else \let\tabu@temp \@empty
- \tabu@Gsave \tabu@G@linesep \tabu@C@linesep \abovetabulinesep \belowtabulinesep
- \fi \tabu@temp}%
-}% \tabu@sets@p
-\def\tabu@setlinesep {\belowtabulinesep=\abovetabulinesep
- \tabu@Gsave \tabu@G@linesep \tabu@C@linesep \abovetabulinesep \belowtabulinesep
-}% \tabu@setlinesep
-\def\tabu@Glinesep{\ifx \tabu@G@linesep\@empty \else {\tabu@Rlinesep}\fi}
-\def\tabu@n@Glinesep{\ifx \tabu@G@linesep\@empty \else \noalign{\tabu@Rlinesep}\fi}
-\def\tabu@Rlinesep{\tabu@Grestore \tabu@G@linesep \tabu@C@linesep}
-\let\tabu@C@linesep \z@
-\let\tabu@G@linesep \@empty
-%% \global\extrarowsep and \global\tabulinesep -------------------
-\def\tabu@Gsave #1#2#3#4{\xdef#1{#1%
- \toks#2{\toks\the\currentgrouplevel{\global#3\the#3\global#4\the#4}}}%
-}% \tabu@Gsave
-\def\tabu@Grestore#1#2{%
- \toks#2{}#1\toks\currentgrouplevel\expandafter{\expandafter}\the\toks#2\relax
- \ifcat$\the\toks\currentgrouplevel$\else
- \global\let#1\@empty \global\let#2\z@
- \the\toks\currentgrouplevel
- \fi
-}% \tabu@Grestore
-%% Setting code for every row ---------------------------------------
-\newcommand*\everyrow{\tabu@everyrow@bgroup
- \tabu@start \z@ \tabu@stop \z@ \tabu@evrstartstop
-}% \everyrow
-\def\tabu@evrstartstop {\@ifnextchar^%
- {\afterassignment \tabu@evrstartstop \tabu@stop=}%
- {\ifx ^\@let@token
- \afterassignment\tabu@evrstartstop \tabu@start=%
- \else \afterassignment\tabu@everyr@w \toks@
- \fi}%
-}% \tabu@evrstartstop
-\def\tabu@everyr@w {%
- \xdef\tabu@everyrow{%
- \noexpand\tabu@everyrowfalse
- \let\noalign \relax
- \noexpand\tabu@rowfontreset
- \iftabu@colortbl \noexpand\tabu@rc@ \fi % \taburowcolors
- \let\noexpand\tabu@docline \noexpand\tabu@docline@evr
- \the\toks@
- \noexpand\tabu@evrh@@k
- \noexpand\tabu@rearstrut
- \global\advance\c@taburow \@ne}%
- \iftabu@everyrow \toks@\expandafter
- {\expandafter\def\expandafter\tabu@evr@L\expandafter{\the\toks@}\ignorespaces}%
- \else \xdef\tabu@evr@G{\the\toks@}%
- \fi
- \tabu@everyrow@egroup
-}% \tabu@everyr@w
-\def\tabu@evr {\def\tabu@evrh@@k} % for internal use only
-\tabu@evr{}
-%% line style and leaders -------------------------------------------
-\newcommand*\newtabulinestyle [1]{%
- {\@for \@tempa :=#1\do{\expandafter\tabu@newlinestyle \@tempa==\@nil}}%
-}% \newtabulinestyle
-\def\tabu@newlinestyle #1=#2=#3\@nil{\tabu@getline {#2}%
- \tabu@sanitizearg {#1}\@tempa
- \ifodd 1\ifx \@tempa\@empty \ifdefined\tabu@linestyle@ 0 \fi\fi
- \global\expandafter\let
- \csname tabu@linestyle@\@tempa \endcsname =\tabu@thestyle \fi
-}% \tabu@newlinestyle
-\newcommand*\tabulinestyle [1]{\tabu@everyrow@bgroup \tabu@getline{#1}%
- \iftabu@everyrow
- \toks@\expandafter{\expandafter \def \expandafter
- \tabu@ls@L\expandafter{\tabu@thestyle}\ignorespaces}%
- \gdef\tabu@ls@{\tabu@ls@L}%
- \else
- \global\let\tabu@ls@G \tabu@thestyle
- \gdef\tabu@ls@{\tabu@ls@G}%
- \fi
- \tabu@everyrow@egroup
-}% \tabulinestyle
-\newcommand*\taburulecolor{\tabu@everyrow@bgroup \tabu@textbar \tabu@rulecolor}
-\def\tabu@rulecolor #1{\toks@{}%
- \def\tabu@temp #1##1#1{\tabu@ruledrsc{##1}}\@ifnextchar #1%
- \tabu@temp
- \tabu@rulearc
-}% \tabu@rulecolor
-\def\tabu@ruledrsc #1{\edef\tabu@temp{#1}\tabu@strtrim\tabu@temp
- \ifx \tabu@temp\@empty \def\tabu@temp{\tabu@rule@drsc@ {}{}}%
- \else \edef\tabu@temp{\noexpand\tabu@rule@drsc@ {}{\tabu@temp}}%
- \fi
- \tabu@temp
-}% \tabu@ruledrsc@
-\def\tabu@ruledrsc@ #1#{\tabu@rule@drsc@ {#1}}
-\def\tabu@rule@drsc@ #1#2{%
- \iftabu@everyrow
- \ifx \\#1#2\\\toks@{\let\CT@drsc@ \relax}%
- \else \toks@{\def\CT@drsc@{\color #1{#2}}}%
- \fi
- \else
- \ifx \\#1#2\\\global\let\CT@drsc@ \relax
- \else \gdef\CT@drsc@{\color #1{#2}}%
- \fi
- \fi
- \tabu@rulearc
-}% \tabu@rule@drsc@
-\def\tabu@rulearc #1#{\tabu@rule@arc@ {#1}}
-\def\tabu@rule@arc@ #1#2{%
- \iftabu@everyrow
- \ifx \\#1#2\\\toks@\expandafter{\the\toks@ \def\CT@arc@{}}%
- \else \toks@\expandafter{\the\toks@ \def\CT@arc@{\color #1{#2}}}%
- \fi
- \toks@\expandafter{\the\toks@
- \let\tabu@arc@L \CT@arc@
- \let\tabu@drsc@L \CT@drsc@
- \ignorespaces}%
- \else
- \ifx \\#1#2\\\gdef\CT@arc@{}%
- \else \gdef\CT@arc@{\color #1{#2}}%
- \fi
- \global\let\tabu@arc@G \CT@arc@
- \global\let\tabu@drsc@G \CT@drsc@
- \fi
- \tabu@everyrow@egroup
-}% \tabu@rule@arc@
-\def\taburowcolors {\tabu@everyrow@bgroup \@testopt \tabu@rowcolors 1}
-\def\tabu@rowcolors [#1]#2#{\tabu@rowc@lors{#1}{#2}}
-\def\tabu@rowc@lors #1#2#3{%
- \toks@{}\@defaultunits \count@ =\number0#2\relax \@nnil
- \@defaultunits \tabu@start =\number0#1\relax \@nnil
- \ifnum \count@<\tw@ \count@=\tw@ \fi
- \advance\tabu@start \m@ne
- \ifnum \tabu@start<\z@ \tabu@start \z@ \fi
- \tabu@rowcolorseries #3\in@..\in@ \@nnil
-}% \tabu@rowcolors
-\def\tabu@rowcolorseries #1..#2\in@ #3\@nnil {%
- \ifx \in@#1\relax
- \iftabu@everyrow \toks@{\def\tabu@rc@{}\let\tabu@rc@L \tabu@rc@}%
- \else \gdef\tabu@rc@{}\global\let\tabu@rc@G \tabu@rc@
- \fi
- \else
- \ifx \\#2\\\tabu@rowcolorserieserror \fi
- \tabu@sanitizearg{#1}\tabu@temp
- \tabu@sanitizearg{#2}\@tempa
- \advance\count@ \m@ne
- \iftabu@everyrow
- \def\tabu@rc@ ##1##2##3##4{\def\tabu@rc@{%
- \ifnum ##2=\c@taburow
- \definecolorseries{tabu@rcseries@\the\tabu@nested}{rgb}{last}{##3}{##4}\fi
- \ifnum \c@taburow<##2 \else
- \ifnum \tabu@modulo {\c@taburow-##2}{##1+1}=\z@
- \resetcolorseries[{##1}]{tabu@rcseries@\the\tabu@nested}\fi
- \xglobal\colorlet{tabu@rc@\the\tabu@nested}{tabu@rcseries@\the\tabu@nested!!+}%
- \rowcolor{tabu@rc@\the\tabu@nested}\fi}%
- }\edef\x{\noexpand\tabu@rc@ {\the\count@}
- {\the\tabu@start}
- {\tabu@temp}
- {\@tempa}%
- }\x
- \toks@\expandafter{\expandafter\def\expandafter\tabu@rc@\expandafter{\tabu@rc@}}%
- \toks@\expandafter{\the\toks@ \let\tabu@rc@L \tabu@rc@ \ignorespaces}%
- \else % inside \noalign
- \definecolorseries{tabu@rcseries@\the\tabu@nested}{rgb}{last}{\tabu@temp}{\@tempa}%
- \expandafter\resetcolorseries\expandafter[\the\count@]{tabu@rcseries@\the\tabu@nested}%
- \xglobal\colorlet{tabu@rc@\the\tabu@nested}{tabu@rcseries@\the\tabu@nested!!+}%
- \let\noalign \relax \rowcolor{tabu@rc@\the\tabu@nested}%
- \def\tabu@rc@ ##1##2{\gdef\tabu@rc@{%
- \ifnum \tabu@modulo {\c@taburow-##2}{##1+1}=\@ne
- \resetcolorseries[{##1}]{tabu@rcseries@\the\tabu@nested}\fi
- \xglobal\colorlet{tabu@rc@\the\tabu@nested}{tabu@rcseries@\the\tabu@nested!!+}%
- \rowcolor{tabu@rc@\the\tabu@nested}}%
- }\edef\x{\noexpand\tabu@rc@{\the\count@}{\the\c@taburow}}\x
- \global\let\tabu@rc@G \tabu@rc@
- \fi
- \fi
- \tabu@everyrow@egroup
-}% \tabu@rowcolorseries
-\tabuDisableCommands {\let\tabu@rc@ \@empty }
-\def\tabu@rowcolorserieserror {\PackageError{tabu}
- {Invalid syntax for \string\taburowcolors
- \MessageBreak Please look at the documentation!}\@ehd
-}% \tabu@rowcolorserieserror
-\newcommand*\tabureset {%
- \tabulinesep=\z@ \extrarowsep=\z@ \extratabsurround=\z@
- \tabulinestyle{}\everyrow{}\taburulecolor||{}\taburowcolors{}%
-}% \tabureset
-%% Parsing the line styles ------------------------------------------
-\def\tabu@getline #1{\begingroup
- \csname \ifcsname if@safe@actives\endcsname % <babel>
- @safe@activestrue\else
- relax\fi \endcsname
- \edef\tabu@temp{#1}\tabu@sanitizearg{#1}\@tempa
- \let\tabu@thestyle \relax
- \ifcsname tabu@linestyle@\@tempa \endcsname
- \edef\tabu@thestyle{\endgroup
- \def\tabu@thestyle{\expandafter\noexpand
- \csname tabu@linestyle@\@tempa\endcsname}%
- }\tabu@thestyle
- \else \expandafter\tabu@definestyle \tabu@temp \@nil
- \fi
-}% \tabu@getline
-\def\tabu@definestyle #1#2\@nil {\endlinechar \m@ne \makeatletter
- \tabu@thick \maxdimen \tabu@on \maxdimen \tabu@off \maxdimen
- \let\tabu@c@lon \@undefined \let\tabu@c@loff \@undefined
- \ifodd 1\ifcat .#1\else\ifcat\relax #1\else 0\fi\fi % catcode 12 or non expandable cs
- \def\tabu@temp{\tabu@getparam{thick}}%
- \else \def\tabu@temp{\tabu@getparam{thick}\maxdimen}%
- \fi
- {%
- \let\tabu@ \relax
- \def\:{\obeyspaces \tabu@oXIII \tabu@commaXIII \edef\:}% (space active \: happy ;-))
- \scantokens{\:{\tabu@temp #1#2 \tabu@\tabu@}}%
- \expandafter}\expandafter
- \def\expandafter\:\expandafter{\:}% line spec rewritten now ;-)
- \def\;{\def\:}%
- \scantokens\expandafter{\expandafter\;\expandafter{\:}}% space is now inactive (catcode 10)
- \let\tabu@ \tabu@getcolor \:% all arguments are ready now ;-)
- \ifdefined\tabu@c@lon \else \let\tabu@c@lon\@empty \fi
- \ifx \tabu@c@lon\@empty \def\tabu@c@lon{\CT@arc@}\fi
- \ifdefined\tabu@c@loff \else \let\tabu@c@loff \@empty \fi
- \ifdim \tabu@on=\maxdimen \ifdim \tabu@off<\maxdimen
- \tabu@on \tabulineon \fi\fi
- \ifdim \tabu@off=\maxdimen \ifdim \tabu@on<\maxdimen
- \tabu@off \tabulineoff \fi\fi
- \ifodd 1\ifdim \tabu@off=\maxdimen \ifdim \tabu@on=\maxdimen 0 \fi\fi
- \in@true % <leaders>
- \else \in@false % <rule>
- \fi
- \ifdim\tabu@thick=\maxdimen \def\tabu@thick{\arrayrulewidth}%
- \else \edef\tabu@thick{\the\tabu@thick}%
- \fi
- \edef \tabu@thestyle ##1##2{\endgroup
- \def\tabu@thestyle{%
- \ifin@ \noexpand\tabu@leadersstyle {\tabu@thick}
- {\the\tabu@on}{##1}
- {\the\tabu@off}{##2}%
- \else \noexpand\tabu@rulesstyle
- {##1\vrule width \tabu@thick}%
- {##1\leaders \hrule height \tabu@thick \hfil}%
- \fi}%
- }\expandafter \expandafter
- \expandafter \tabu@thestyle \expandafter
- \expandafter \expandafter
- {\expandafter\tabu@c@lon\expandafter}\expandafter{\tabu@c@loff}%
-}% \tabu@definestyle
-{\catcode`\O=\active \lccode`\O=`\o \catcode`\,=\active
- \lowercase{\gdef\tabu@oXIII {\catcode`\o=\active \let O=\tabu@oxiii}}
- \gdef\tabu@commaXIII {\catcode`\,=\active \let ,=\space}
-}% \catcode
-\def\tabu@oxiii #1{%
- \ifcase \ifx n#1\z@ \else
- \ifx f#1\@ne\else
- \tw@ \fi\fi
- \expandafter\tabu@onxiii
- \or \expandafter\tabu@ofxiii
- \else o%
- \fi#1}%
-\def\tabu@onxiii #1#2{%
- \ifcase \ifx !#2\tw@ \else
- \ifcat.\noexpand#2\z@ \else
- \ifx \tabu@spxiii#2\@ne\else
- \tw@ \fi\fi\fi
- \tabu@getparam{on}#2\expandafter\@gobble
- \or \expandafter\tabu@onxiii % (space is active)
- \else o\expandafter\@firstofone
- \fi{#1#2}}%
-\def\tabu@ofxiii #1#2{%
- \ifx #2f\expandafter\tabu@offxiii
- \else o\expandafter\@firstofone
- \fi{#1#2}}
-\def\tabu@offxiii #1#2{%
- \ifcase \ifx !#2\tw@ \else
- \ifcat.\noexpand#2\z@ \else
- \ifx\tabu@spxiii#2\@ne \else
- \tw@ \fi\fi\fi
- \tabu@getparam{off}#2\expandafter\@gobble
- \or \expandafter\tabu@offxiii % (space is active)
- \else o\expandafter\@firstofone
- \fi{#1#2}}
-\def\tabu@getparam #1{\tabu@ \csname tabu@#1\endcsname=}
-\def\tabu@getcolor #1{% \tabu@ <- \tabu@getcolor after \edef
- \ifx \tabu@#1\else % no more spec
- \let\tabu@theparam=#1\afterassignment \tabu@getc@l@r #1\fi
-}% \tabu@getcolor
-\def\tabu@getc@l@r #1\tabu@ {%
- \def\tabu@temp{#1}\tabu@strtrim \tabu@temp
- \ifx \tabu@temp\@empty
- \else%\ifcsname \string\color@\tabu@temp \endcsname % if the color exists
- \ifx \tabu@theparam \tabu@off \let\tabu@c@loff \tabu@c@l@r
- \else \let\tabu@c@lon \tabu@c@l@r
- \fi
- %\else \tabu@warncolour{\tabu@temp}%
- \fi%\fi
- \tabu@ % next spec
-}% \tabu@getc@l@r
-\def\tabu@warncolour #1{\PackageWarning{tabu}
- {Color #1 is not defined. Default color used}%
-}% \tabu@warncolour
-\def\tabu@leadersstyle #1#2#3#4#5{\def\tabu@leaders{{#1}{#2}{#3}{#4}{#5}}%
- \ifx \tabu@leaders\tabu@leaders@G \else
- \tabu@LEADERS{#1}{#2}{#3}{#4}{#5}\fi
-}% \tabu@leadersstyle
-\def\tabu@rulesstyle #1#2{\let\tabu@leaders \@undefined
- \gdef\tabu@thevrule{#1}\gdef\tabu@thehrule{#2}%
-}% \tabu@rulesstyle
-%% The leaders boxes ------------------------------------------------
-\def\tabu@LEADERS #1#2#3#4#5{%% width, dash, dash color, gap, gap color
- {\let\color \tabu@color % => during trials -> \color = \tabu@nocolor
- {% % but the leaders boxes should have colors !
- \def\@therule{\vrule}\def\@thick{height}\def\@length{width}%
- \def\@box{\hbox}\def\@unbox{\unhbox}\def\@elt{\wd}%
- \def\@skip{\hskip}\def\@ss{\hss}\def\tabu@leads{\tabu@hleads}%
- \tabu@l@@d@rs {#1}{#2}{#3}{#4}{#5}%
- \global\let\tabu@thehleaders \tabu@theleaders
- }%
- {%
- \def\@therule{\hrule}\def\@thick{width}\def\@length{height}%
- \def\@box{\vbox}\def\@unbox{\unvbox}\def\@elt{\ht}%
- \def\@skip{\vskip}\def\@ss{\vss}\def\tabu@leads{\tabu@vleads}%
- \tabu@l@@d@rs {#1}{#2}{#3}{#4}{#5}%
- \global\let\tabu@thevleaders \tabu@theleaders
- }%
- \gdef\tabu@leaders@G{{#1}{#2}{#3}{#4}{#5}}%
- }%
-}% \tabu@LEADERS
-\def\tabu@therule #1#2{\@therule \@thick#1\@length\dimexpr#2/2 \@depth\z@}
-\def\tabu@l@@d@rs #1#2#3#4#5{%% width, dash, dash color, gap, gap color
- \global\setbox \tabu@leads=\@box{%
- {#3\tabu@therule{#1}{#2}}%
- \ifx\\#5\\\@skip#4\else{#5\tabu@therule{#1}{#4*2}}\fi
- {#3\tabu@therule{#1}{#2}}}%
- \global\setbox\tabu@leads=\@box to\@elt\tabu@leads{\@ss
- {#3\tabu@therule{#1}{#2}}\@unbox\tabu@leads}%
- \edef\tabu@theleaders ##1{\def\noexpand\tabu@theleaders {%
- {##1\tabu@therule{#1}{#2}}%
- \xleaders \copy\tabu@leads \@ss
- \tabu@therule{0pt}{-#2}{##1\tabu@therule{#1}{#2}}}%
- }\tabu@theleaders{#3}%
-}% \tabu@l@@d@rs
-%% \tabu \endtabu \tabu* \longtabu \endlongtabu \longtabu* ----------
-\newcommand*\tabu {\tabu@longfalse
- \ifmmode \def\tabu@ {\array}\def\endtabu {\endarray}%
- \else \def\tabu@ {\tabu@tabular}\def\endtabu {\endtabular}\fi
- \expandafter\let\csname tabu*\endcsname \tabu
- \expandafter\def\csname endtabu*\endcsname{\endtabu}%
- \tabu@spreadfalse \tabu@negcoeffalse \tabu@settarget
-}% {tabu}
-\let\tabu@tabular \tabular % <For LyX: some users redefine \tabular...>
-\expandafter\def\csname tabu*\endcsname{\tabuscantokenstrue \tabu}
-\newcommand*\longtabu {\tabu@longtrue
- \ifmmode\PackageError{tabu}{longtabu not allowed in math mode}\fi
- \def\tabu@{\longtable}\def\endlongtabu{\endlongtable}%
- \LTchunksize=\@M
- \expandafter\let\csname tabu*\endcsname \tabu
- \expandafter\def\csname endlongtabu*\endcsname{\endlongtabu}%
- \let\LT@startpbox \tabu@LT@startpbox % \everypar{ array struts }
- \tabu@spreadfalse \tabu@negcoeffalse \tabu@settarget
-}% {longtabu}
-\expandafter\def\csname longtabu*\endcsname{\tabuscantokenstrue \longtabu}
-\def\tabu@nolongtabu{\PackageError{tabu}
- {longtabu requires the longtable package}\@ehd}
-%% Read the target and then : \tabular or \@array ------------------
-\def\tabu@settarget {\futurelet\@let@token \tabu@sett@rget }
-\def\tabu@sett@rget {\tabu@target \z@
- \ifcase \ifx \bgroup\@let@token \z@ \else
- \ifx \@sptoken\@let@token \@ne \else
- \if t\@let@token \tw@ \else
- \if s\@let@token \thr@@\else
- \z@\fi\fi\fi\fi
- \expandafter\tabu@begin
- \or \expandafter\tabu@gobblespace\expandafter\tabu@settarget
- \or \expandafter\tabu@to
- \or \expandafter\tabu@spread
- \fi
-}% \tabu@sett@rget
-\def\tabu@to to{\def\tabu@halignto{to}\tabu@gettarget}
-\def\tabu@spread spread{\tabu@spreadtrue\def\tabu@halignto{spread}\tabu@gettarget}
-\def\tabu@gettarget {\afterassignment\tabu@linegoaltarget \tabu@target }
-\def\tabu@linegoaltarget {\futurelet\tabu@temp \tabu@linegoalt@rget }
-\def\tabu@linegoalt@rget {%
- \ifx \tabu@temp\LNGL@setlinegoal
- \LNGL@setlinegoal \expandafter \@firstoftwo \fi % @gobbles \LNGL@setlinegoal
- \tabu@begin
-}% \tabu@linegoalt@rget
-\def\tabu@begin #1#{%
- \iftabu@measuring \expandafter\tabu@nestedmeasure \fi
- \ifdim \tabu@target=\z@ \let\tabu@halignto \@empty
- \else \edef\tabu@halignto{\tabu@halignto\the\tabu@target}%
- \fi
- \@testopt \tabu@tabu@ \tabu@aligndefault #1\@nil
-}% \tabu@begin
-\long\def\tabu@tabu@ [#1]#2\@nil #3{\tabu@setup
- \def\tabu@align {#1}\def\tabu@savedpream{\NC@find #3}%
- \tabu@ [\tabu@align ]#2{#3\tabu@rewritefirst }%
-}% \tabu@tabu@
-\def\tabu@nestedmeasure {%
- \ifodd 1\iftabu@spread \else \ifdim\tabu@target=\z@ \else 0 \fi\fi\relax
- \tabu@spreadtrue
- \else \begingroup \iffalse{\fi \ifnum0=`}\fi
- \toks@{}\def\tabu@stack{b}%
- \expandafter\tabu@collectbody\expandafter\tabu@quickrule
- \expandafter\endgroup
- \fi
-}% \tabu@nestedmeasure
-\def\tabu@quickrule {\indent\vrule height\z@ depth\z@ width\tabu@target}
-%% \tabu@setup \tabu@init \tabu@indent
-\def\tabu@setup{\tabu@alloc@
- \ifcase \tabu@nested
- \ifmmode \else \iftabu@spread\else \ifdim\tabu@target=\z@
- \let\tabu@afterendpar \par
- \fi\fi\fi
- \def\tabu@aligndefault{c}\tabu@init \tabu@indent
- \else % <nested tabu>
- \def\tabu@aligndefault{t}\let\tabudefaulttarget \linewidth
- \fi
- \let\tabu@thetarget \tabudefaulttarget \let\tabu@restored \@undefined
- \edef\tabu@NC@list{\the\NC@list}\NC@list{\NC@do \tabu@rewritefirst}%
- \everycr{}\let\@startpbox \tabu@startpbox % for nested tabu inside longtabu...
- \let\@endpbox \tabu@endpbox % idem " " " " " "
- \let\@tabarray \tabu@tabarray % idem " " " " " "
- \tabu@setcleanup \tabu@setreset
-}% \tabu@setup
-\def\tabu@init{\tabu@starttimer \tabu@measuringfalse
- \edef\tabu@hfuzz {\the\dimexpr\hfuzz+1sp}\global\tabu@footnotes{}%
- \let\firsthline \tabu@firsthline \let\lasthline \tabu@lasthline
- \let\firstline \tabu@firstline \let\lastline \tabu@lastline
- \let\hline \tabu@hline \let\@xhline \tabu@xhline
- \let\color \tabu@color \let\@arstrutbox \tabu@arstrutbox
- \iftabu@colortbl\else\let\LT@@hline \tabu@LT@@hline \fi
- \tabu@trivlist %<restore \\=\@normalcr inside lists>
- \let\@footnotetext \tabu@footnotetext \let\@xfootnotetext \tabu@xfootnotetext
- \let\@xfootnote \tabu@xfootnote \let\centering \tabu@centering
- \let\raggedright \tabu@raggedright \let\raggedleft \tabu@raggedleft
- \let\tabudecimal \tabu@tabudecimal \let\Centering \tabu@Centering
- \let\RaggedRight \tabu@RaggedRight \let\RaggedLeft \tabu@RaggedLeft
- \let\justifying \tabu@justifying \let\rowfont \tabu@rowfont
- \let\fbox \tabu@fbox \let\color@b@x \tabu@color@b@x
- \let\tabu@@everycr \everycr \let\tabu@@everypar \everypar
- \let\tabu@prepnext@tokORI \prepnext@tok\let\prepnext@tok \tabu@prepnext@tok
- \let\tabu@multicolumnORI\multicolumn \let\multicolumn \tabu@multicolumn
- \let\tabu@startpbox \@startpbox % for nested tabu inside longtabu pfff !!!
- \let\tabu@endpbox \@endpbox % idem " " " " " " "
- \let\tabu@tabarray \@tabarray % idem " " " " " " "
- \tabu@adl@fix \let\endarray \tabu@endarray % <fix> colortbl & arydshln (delarray)
- \iftabu@colortbl\CT@everycr\expandafter{\expandafter\iftabu@everyrow \the\CT@everycr \fi}\fi
-}% \tabu@init
-\def\tabu@indent{% correction for indentation
- \ifdim \parindent>\z@\ifx \linewidth\tabudefaulttarget
- \everypar\expandafter{%
- \the\everypar\everypar\expandafter{\the\everypar}%
- \setbox\z@=\lastbox
- \ifdim\wd\z@>\z@ \edef\tabu@thetarget
- {\the\dimexpr -\wd\z@+\tabudefaulttarget}\fi
- \box\z@}%
- \fi\fi
-}% \tabu@indent
-\def\tabu@setcleanup {% saves last global assignments
- \ifodd 1\ifmmode \else \iftabu@long \else 0\fi\fi\relax
- \def\tabu@aftergroupcleanup{%
- \def\tabu@aftergroupcleanup{\aftergroup\tabu@cleanup}}%
- \else
- \def\tabu@aftergroupcleanup{%
- \aftergroup\aftergroup\aftergroup\tabu@cleanup
- \let\tabu@aftergroupcleanup \relax}%
- \fi
- \let\tabu@arc@Gsave \tabu@arc@G
- \let\tabu@arc@G \tabu@arc@L % <init>
- \let\tabu@drsc@Gsave \tabu@drsc@G
- \let\tabu@drsc@G \tabu@drsc@L % <init>
- \let\tabu@ls@Gsave \tabu@ls@G
- \let\tabu@ls@G \tabu@ls@L % <init>
- \let\tabu@rc@Gsave \tabu@rc@G
- \let\tabu@rc@G \tabu@rc@L % <init>
- \let\tabu@evr@Gsave \tabu@evr@G
- \let\tabu@evr@G \tabu@evr@L % <init>
- \let\tabu@celllalign@save \tabu@celllalign
- \let\tabu@cellralign@save \tabu@cellralign
- \let\tabu@cellleft@save \tabu@cellleft
- \let\tabu@cellright@save \tabu@cellright
- \let\tabu@@celllalign@save \tabu@@celllalign
- \let\tabu@@cellralign@save \tabu@@cellralign
- \let\tabu@@cellleft@save \tabu@@cellleft
- \let\tabu@@cellright@save \tabu@@cellright
- \let\tabu@rowfontreset@save \tabu@rowfontreset
- \let\tabu@@rowfontreset@save\tabu@@rowfontreset
- \let\tabu@rowfontreset \@empty
- \edef\tabu@alloc@save {\the\tabu@alloc}% restore at \tabu@reset
- \edef\c@taburow@save {\the\c@taburow}%
- \edef\tabu@naturalX@save {\the\tabu@naturalX}%
- \let\tabu@naturalXmin@save \tabu@naturalXmin
- \let\tabu@naturalXmax@save \tabu@naturalXmax
- \let\tabu@mkarstrut@save \tabu@mkarstrut
- \edef\tabu@clarstrut{%
- \extrarowheight \the\dimexpr \ht\@arstrutbox-\ht\strutbox \relax
- \extrarowdepth \the\dimexpr \dp\@arstrutbox-\dp\strutbox \relax
- \let\noexpand\@arraystretch \@ne \noexpand\tabu@rearstrut}%
-}% \tabu@setcleanup
-\def\tabu@cleanup {\begingroup
- \globaldefs\@ne \tabu@everyrowtrue
- \let\tabu@arc@G \tabu@arc@Gsave
- \let\CT@arc@ \tabu@arc@G
- \let\tabu@drsc@G \tabu@drsc@Gsave
- \let\CT@drsc@ \tabu@drsc@G
- \let\tabu@ls@G \tabu@ls@Gsave
- \let\tabu@ls@ \tabu@ls@G
- \let\tabu@rc@G \tabu@rc@Gsave
- \let\tabu@rc@ \tabu@rc@G
- \let\CT@do@color \relax
- \let\tabu@evr@G \tabu@evr@Gsave
- \let\tabu@celllalign \tabu@celllalign@save
- \let\tabu@cellralign \tabu@cellralign@save
- \let\tabu@cellleft \tabu@cellleft@save
- \let\tabu@cellright \tabu@cellright@save
- \let\tabu@@celllalign \tabu@@celllalign@save
- \let\tabu@@cellralign \tabu@@cellralign@save
- \let\tabu@@cellleft \tabu@@cellleft@save
- \let\tabu@@cellright \tabu@@cellright@save
- \let\tabu@rowfontreset \tabu@rowfontreset@save
- \let\tabu@@rowfontreset \tabu@@rowfontreset@save
- \tabu@naturalX =\tabu@naturalX@save
- \let\tabu@naturalXmax \tabu@naturalXmax@save
- \let\tabu@naturalXmin \tabu@naturalXmin@save
- \let\tabu@mkarstrut \tabu@mkarstrut@save
- \c@taburow =\c@taburow@save
- \ifcase \tabu@nested \tabu@alloc \m@ne\fi
- \endgroup % <end of \globaldefs>
- \ifcase \tabu@nested
- \the\tabu@footnotes \global\tabu@footnotes{}%
- \tabu@afterendpar \tabu@elapsedtime
- \fi
- \tabu@clarstrut
- \everyrow\expandafter {\tabu@evr@G}%
-}% \tabu@cleanup
-\let\tabu@afterendpar \relax
-\def\tabu@setreset {%
- \edef\tabu@savedparams {% \relax for \tabu@message@save
- \ifmmode \col@sep \the\arraycolsep
- \else \col@sep \the\tabcolsep \fi \relax
- \arrayrulewidth \the\arrayrulewidth \relax
- \doublerulesep \the\doublerulesep \relax
- \extratabsurround \the\extratabsurround \relax
- \extrarowheight \the\extrarowheight \relax
- \extrarowdepth \the\extrarowdepth \relax
- \abovetabulinesep \the\abovetabulinesep \relax
- \belowtabulinesep \the\belowtabulinesep \relax
- \def\noexpand\arraystretch{\arraystretch}%
- \ifdefined\minrowclearance \minrowclearance\the\minrowclearance\relax\fi}%
- \begingroup
- \@temptokena\expandafter{\tabu@savedparams}% => only for \savetabu / \usetabu
- \ifx \tabu@arc@L\relax \else \tabu@setsave \tabu@arc@L \fi
- \ifx \tabu@drsc@L\relax \else \tabu@setsave \tabu@drsc@L \fi
- \tabu@setsave \tabu@ls@L \tabu@setsave \tabu@evr@L
- \expandafter \endgroup \expandafter
- \def\expandafter\tabu@saved@ \expandafter{\the\@temptokena
- \let\tabu@arc@G \tabu@arc@L
- \let\tabu@drsc@G \tabu@drsc@L
- \let\tabu@ls@G \tabu@ls@L
- \let\tabu@rc@G \tabu@rc@L
- \let\tabu@evr@G \tabu@evr@L}%
- \def\tabu@reset{\tabu@savedparams
- \tabu@everyrowtrue \c@taburow \z@
- \let\CT@arc@ \tabu@arc@L
- \let\CT@drsc@ \tabu@drsc@L
- \let\tabu@ls@ \tabu@ls@L
- \let\tabu@rc@ \tabu@rc@L
- \global\tabu@alloc \tabu@alloc@save
- \everyrow\expandafter{\tabu@evr@L}}%
-}% \tabu@reset
-\def\tabu@setsave #1{\expandafter\tabu@sets@ve #1\@nil{#1}}
-\long\def\tabu@sets@ve #1\@nil #2{\@temptokena\expandafter{\the\@temptokena \def#2{#1}}}
-%% The Rewriting Process -------------------------------------------
-\def\tabu@newcolumntype #1{%
- \expandafter\tabu@new@columntype
- \csname NC@find@\string#1\expandafter\endcsname
- \csname NC@rewrite@\string#1\endcsname
- {#1}%
-}% \tabu@newcolumntype
-\def\tabu@new@columntype #1#2#3{%
- \def#1##1#3{\NC@{##1}}%
- \let#2\relax \newcommand*#2%
-}% \tabu@new@columntype
-\def\tabu@privatecolumntype #1{%
- \expandafter\tabu@private@columntype
- \csname NC@find@\string#1\expandafter\endcsname
- \csname NC@rewrite@\string#1\expandafter\endcsname
- \csname tabu@NC@find@\string#1\expandafter\endcsname
- \csname tabu@NC@rewrite@\string#1\endcsname
- {#1}%
-}% \tabu@privatecolumntype
-\def\tabu@private@columntype#1#2#3#4{%
- \g@addto@macro\tabu@privatecolumns{\let#1#3\let#2#4}%
- \tabu@new@columntype#3#4%
-}% \tabu@private@columntype
-\let\tabu@privatecolumns \@empty
-\newcommand*\tabucolumn [1]{\expandafter \def \expandafter
- \tabu@highprioritycolumns\expandafter{\tabu@highprioritycolumns
- \NC@do #1}}%
-\let\tabu@highprioritycolumns \@empty
-%% The | ``column'' : rewriting process --------------------------
-\tabu@privatecolumntype |{\tabu@rewritevline}
-\newcommand*\tabu@rewritevline[1][]{\tabu@vlinearg{#1}%
- \expandafter \NC@find \tabu@rewritten}
-\def\tabu@lines #1{%
- \ifx|#1\else \tabu@privatecolumntype #1{\tabu@rewritevline}\fi
- \NC@list\expandafter{\the\NC@list \NC@do #1}%
-}% \tabu@lines@
-\def\tabu@vlinearg #1{%
- \ifx\\#1\\\def\tabu@thestyle {\tabu@ls@}%
- \else\tabu@getline {#1}%
- \fi
- \def\tabu@rewritten ##1{\def\tabu@rewritten{!{##1\tabu@thevline}}%
- }\expandafter\tabu@rewritten\expandafter{\tabu@thestyle}%
- \expandafter \tabu@keepls \tabu@thestyle \@nil
-}% \tabu@vlinearg
-\def\tabu@keepls #1\@nil{%
- \ifcat $\@cdr #1\@nil $%
- \ifx \relax#1\else
- \ifx \tabu@ls@#1\else
- \let#1\relax
- \xdef\tabu@mkpreambuffer{\tabu@mkpreambuffer
- \tabu@savels\noexpand#1}\fi\fi\fi
-}% \tabu@keepls
-\def\tabu@thevline {\begingroup
- \ifdefined\tabu@leaders
- \setbox\@tempboxa=\vtop to\dimexpr
- \ht\@arstrutbox+\dp\@arstrutbox{{\tabu@thevleaders}}%
- \ht\@tempboxa=\ht\@arstrutbox \dp\@tempboxa=\dp\@arstrutbox
- \box\@tempboxa
- \else
- \tabu@thevrule
- \fi \endgroup
-}% \tabu@thevline
-\def\tabu@savels #1{%
- \expandafter\let\csname\string#1\endcsname #1%
- \expandafter\def\expandafter\tabu@reset\expandafter{\tabu@reset
- \tabu@resetls#1}}%
-\def\tabu@resetls #1{\expandafter\let\expandafter#1\csname\string#1\endcsname}%
-%% \multicolumn inside tabu environment -----------------------------
-\tabu@newcolumntype \tabu@rewritemulticolumn{%
- \aftergroup \tabu@endrewritemulticolumn % after \@mkpream group
- \NC@list{\NC@do *}\tabu@textbar \tabu@lines
- \tabu@savedecl
- \tabu@privatecolumns
- \NC@list\expandafter{\the\expandafter\NC@list \tabu@NC@list}%
- \let\tabu@savels \relax
- \NC@find
-}% \tabu@rewritemulticolumn
-\def\tabu@endrewritemulticolumn{\gdef\tabu@mkpreambuffer{}\endgroup}
-\def\tabu@multicolumn{\tabu@ifenvir \tabu@multic@lumn \tabu@multicolumnORI}
-\long\def\tabu@multic@lumn #1#2#3{\multispan{#1}\begingroup
- \tabu@everyrowtrue
- \NC@list{\NC@do \tabu@rewritemulticolumn}%
- \expandafter\@gobbletwo % gobbles \multispan{#1}
- \tabu@multicolumnORI{#1}{\tabu@rewritemulticolumn #2}%
- {\iftabuscantokens \tabu@rescan \else \expandafter\@firstofone \fi
- {#3}}%
-}% \tabu@multic@lumn
-%% The X column(s): rewriting process -----------------------------
-\tabu@privatecolumntype X[1][]{\begingroup \tabu@siunitx{\endgroup \tabu@rewriteX {#1}}}
-\def\tabu@nosiunitx #1{#1{}{}\expandafter \NC@find \tabu@rewritten }
-\def\tabu@siunitx #1{\@ifnextchar \bgroup
- {\tabu@rewriteX@Ss{#1}}
- {\tabu@nosiunitx{#1}}}
-\def\tabu@rewriteX@Ss #1#2{\@temptokena{}%
- \@defaultunits \let\tabu@temp =#2\relax\@nnil
- \ifodd 1\ifx S\tabu@temp \else \ifx s\tabu@temp \else 0 \fi\fi
- \def\NC@find{\def\NC@find >####1####2<####3\relax{#1 {####1}{####3}%
- }\expandafter\NC@find \the\@temptokena \relax
- }\expandafter\NC@rewrite@S \@gobble #2\relax
- \else \tabu@siunitxerror
- \fi
- \expandafter \NC@find \tabu@rewritten
-}% \tabu@rewriteX@Ss
-\def\tabu@siunitxerror {\PackageError{tabu}{Not a S nor s column !
- \MessageBreak X column can only embed siunitx S or s columns}\@ehd
-}% \tabu@siunitxerror
-\def\tabu@rewriteX #1#2#3{\tabu@Xarg {#1}{#2}{#3}%
- \iftabu@measuring
- \else \tabu@measuringtrue % first X column found in the preamble
- \let\@halignto \relax \let\tabu@halignto \relax
- \iftabu@spread \tabu@spreadtarget \tabu@target \tabu@target \z@
- \else \tabu@spreadtarget \z@ \fi
- \ifdim \tabu@target=\z@
- \setlength\tabu@target \tabu@thetarget
- \tabu@message{\tabu@message@defaulttarget}%
- \else \tabu@message{\tabu@message@target}\fi
- \fi
-}% \tabu@rewriteX
-\def\tabu@rewriteXrestore #1#2#3{\let\@halignto \relax
- \def\tabu@rewritten{l}}
-\def\tabu@Xarg #1#2#3{%
- \advance\tabu@Xcol \@ne \let\tabu@Xlcr \@empty
- \let\tabu@Xdisp \@empty \let\tabu@Xmath \@empty
- \ifx\\#1\\% <shortcut when no option>
- \def\tabu@rewritten{p}\tabucolX \p@ % <default coef = 1>
- \else
- \let\tabu@rewritten \@empty \let\tabu@temp \@empty \tabucolX \z@
- \tabu@Xparse {}#1\relax
- \fi
- \tabu@Xrewritten{#2}{#3}%
-}% \tabu@Xarg
-\def\tabu@Xparse #1{\futurelet\@let@token \tabu@Xtest}
-\expandafter\def\expandafter\tabu@Xparsespace\space{\tabu@Xparse{}}
-\def\tabu@Xtest{%
- \ifcase \ifx \relax\@let@token \z@ \else
- \if ,\@let@token \m@ne\else
- \if p\@let@token 1\else
- \if m\@let@token 2\else
- \if b\@let@token 3\else
- \if l\@let@token 4\else
- \if c\@let@token 5\else
- \if r\@let@token 6\else
- \if j\@let@token 7\else
- \if L\@let@token 8\else
- \if C\@let@token 9\else
- \if R\@let@token 10\else
- \if J\@let@token 11\else
- \ifx \@sptoken\@let@token 12\else
- \if .\@let@token 13\else
- \if -\@let@token 13\else
- \ifcat $\@let@token 14\else
- 15\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\relax
- \or \tabu@Xtype {p}%
- \or \tabu@Xtype {m}%
- \or \tabu@Xtype {b}%
- \or \tabu@Xalign \raggedright\relax
- \or \tabu@Xalign \centering\relax
- \or \tabu@Xalign \raggedleft\relax
- \or \tabu@Xalign \tabu@justify\relax
- \or \tabu@Xalign \RaggedRight\raggedright
- \or \tabu@Xalign \Centering\centering
- \or \tabu@Xalign \RaggedLeft\raggedleft
- \or \tabu@Xalign \justifying\tabu@justify
- \or \expandafter \tabu@Xparsespace
- \or \expandafter \tabu@Xcoef
- \or \expandafter \tabu@Xm@th
- \or \tabu@Xcoef{}%
- \else\expandafter \tabu@Xparse
- \fi
-}% \tabu@Xtest
-\def\tabu@Xalign #1#2{%
- \ifx \tabu@Xlcr\@empty \else \PackageWarning{tabu}
- {Duplicate horizontal alignment specification}\fi
- \ifdefined#1\def\tabu@Xlcr{#1}\let#1\relax
- \else \def\tabu@Xlcr{#2}\let#2\relax\fi
- \expandafter\tabu@Xparse
-}% \tabu@Xalign
-\def\tabu@Xtype #1{%
- \ifx \tabu@rewritten\@empty \else \PackageWarning{tabu}
- {Duplicate vertical alignment specification}\fi
- \def\tabu@rewritten{#1}\expandafter\tabu@Xparse
-}% \tabu@Xtype
-\def\tabu@Xcoef#1{\edef\tabu@temp{\tabu@temp#1}%
- \afterassignment\tabu@Xc@ef \tabu@cnt\number\if-#10\fi
-}% \tabu@Xcoef
-\def\tabu@Xc@ef{\advance\tabucolX \tabu@temp\the\tabu@cnt\p@
- \tabu@Xparse{}%
-}% \tabu@Xc@ef
-\def\tabu@Xm@th #1{\futurelet \@let@token \tabu@Xd@sp}
-\def\tabu@Xd@sp{\let\tabu@Xmath=$%
- \ifx $\@let@token \def\tabu@Xdisp{\displaystyle}%
- \expandafter\tabu@Xparse
- \else \expandafter\tabu@Xparse\expandafter{\expandafter}%
- \fi
-}% \tabu@Xd@sp
-\def\tabu@Xrewritten {%
- \ifx \tabu@rewritten\@empty \def\tabu@rewritten{p}\fi
- \ifdim \tabucolX<\z@ \tabu@negcoeftrue
- \else\ifdim \tabucolX=\z@ \tabucolX \p@
- \fi\fi
- \edef\tabu@temp{{\the\tabu@Xcol}{\tabu@strippt\tabucolX}}%
- \edef\tabu@Xcoefs{\tabu@Xcoefs \tabu@ \tabu@temp}%
- \edef\tabu@rewritten ##1##2{\def\noexpand\tabu@rewritten{%
- >{\tabu@Xlcr \ifx$\tabu@Xmath$\tabu@Xdisp\fi ##1}%
- \tabu@rewritten {\tabu@hsize \tabu@temp}%
- <{##2\ifx$\tabu@Xmath$\fi}}%
- }\tabu@rewritten
-}% \tabu@Xrewritten
-\def\tabu@hsize #1#2{%
- \ifdim #2\p@<\z@
- \ifdim \tabucolX=\maxdimen \tabu@wd{#1}\else
- \ifdim \tabu@wd{#1}<-#2\tabucolX \tabu@wd{#1}\else -#2\tabucolX\fi
- \fi
- \else #2\tabucolX
- \fi
-}% \tabu@hsize
-%% \usetabu and \preamble: rewriting process ---------------------
-\tabu@privatecolumntype \usetabu [1]{%
- \ifx\\#1\\\tabu@saveerr{}\else
- \@ifundefined{tabu@saved@\string#1}
- {\tabu@saveerr{#1}}
- {\let\tabu@rewriteX \tabu@rewriteXrestore
- \csname tabu@saved@\string#1\expandafter\endcsname\expandafter\@ne}%
- \fi
-}% \NC@rewrite@\usetabu
-\tabu@privatecolumntype \preamble [1]{%
- \ifx\\#1\\\tabu@saveerr{}\else
- \@ifundefined{tabu@saved@\string#1}
- {\tabu@saveerr{#1}}
- {\csname tabu@saved@\string#1\expandafter\endcsname\expandafter\z@}%
- \fi
-}% \NC@rewrite@\preamble
-%% Controlling the rewriting process -------------------------------
-\tabu@newcolumntype \tabu@rewritefirst{%
- \iftabu@long \aftergroup \tabu@longpream % <the whole implementation is here !>
- \else \aftergroup \tabu@pream
- \fi
- \let\tabu@ \relax \let\tabu@hsize \relax
- \let\tabu@Xcoefs \@empty \let\tabu@savels \relax
- \tabu@Xcol \z@ \tabu@cnt \tw@
- \gdef\tabu@mkpreambuffer{\tabu@{}}\tabu@measuringfalse
- \global\setbox\@arstrutbox \box\@arstrutbox
- \NC@list{\NC@do *}\tabu@textbar \tabu@lines
- \NC@list\expandafter{\the\NC@list \NC@do X}%
- \iftabu@siunitx % <siunitx S and s columns>
- \NC@list\expandafter{\the\NC@list \NC@do S\NC@do s}\fi
- \NC@list\expandafter{\the\expandafter\NC@list \tabu@highprioritycolumns}%
- \expandafter\def\expandafter\tabu@NC@list\expandafter{%
- \the\expandafter\NC@list \tabu@NC@list}% % * | X S <original>
- \NC@list\expandafter{\expandafter \NC@do \expandafter\usetabu
- \expandafter \NC@do \expandafter\preamble
- \the\NC@list \NC@do \tabu@rewritemiddle
- \NC@do \tabu@rewritelast}%
- \tabu@savedecl
- \tabu@privatecolumns
- \edef\tabu@prev{\the\@temptokena}\NC@find \tabu@rewritemiddle
-}% NC@rewrite@\tabu@rewritefirst
-\tabu@newcolumntype \tabu@rewritemiddle{%
- \edef\tabu@temp{\the\@temptokena}\NC@find \tabu@rewritelast
-}% \NC@rewrite@\tabu@rewritemiddle
-\tabu@newcolumntype \tabu@rewritelast{%
- \ifx \tabu@temp\tabu@prev \advance\tabu@cnt \m@ne
- \NC@list\expandafter{\tabu@NC@list \NC@do \tabu@rewritemiddle
- \NC@do \tabu@rewritelast}%
- \else \let\tabu@prev\tabu@temp
- \fi
- \ifcase \tabu@cnt \expandafter\tabu@endrewrite
- \else \expandafter\NC@find \expandafter\tabu@rewritemiddle
- \fi
-}% \NC@rewrite@\tabu@rewritelast
-%% Choosing the strategy --------------------------------------------
-\def\tabu@endrewrite {%
- \let\tabu@temp \NC@find
- \ifx \@arrayright\relax \let\@arrayright \@empty \fi
- \count@=%
- \ifx \@finalstrut\tabu@finalstrut \z@ % outer in mode 0 print
- \iftabu@measuring
- \xdef\tabu@mkpreambuffer{\tabu@mkpreambuffer
- \tabu@target \csname tabu@\the\tabu@nested.T\endcsname
- \tabucolX \csname tabu@\the\tabu@nested.X\endcsname
- \edef\@halignto {\ifx\@arrayright\@empty to\tabu@target\fi}}%
- \fi
- \else\iftabu@measuring 4 % X columns
- \xdef\tabu@mkpreambuffer{\tabu@{\tabu@mkpreambuffer
- \tabu@target \the\tabu@target
- \tabu@spreadtarget \the\tabu@spreadtarget}%
- \def\noexpand\tabu@Xcoefs{\tabu@Xcoefs}%
- \edef\tabu@halignto{\ifx \@arrayright\@empty to\tabu@target\fi}}%
- \let\tabu@Xcoefs \relax
- \else\ifcase\tabu@nested \thr@@ % outer, no X
- \global\let\tabu@afterendpar \relax
- \else \@ne % inner, no X, outer in mode 1 or 2
- \fi
- \ifdefined\tabu@usetabu
- \else \ifdim\tabu@target=\z@
- \else \let\tabu@temp \tabu@extracolsep
- \fi\fi
- \fi
- \fi
- \xdef\tabu@mkpreambuffer{\count@ \the\count@ \tabu@mkpreambuffer}%
- \tabu@temp
-}% \tabu@endrewrite
-\def\tabu@extracolsep{\@defaultunits \expandafter\let
- \expandafter\tabu@temp \expandafter=\the\@temptokena \relax\@nnil
- \ifx \tabu@temp\@sptoken
- \expandafter\tabu@gobblespace \expandafter\tabu@extracolsep
- \else
- \edef\tabu@temp{\noexpand\NC@find
- \if |\noexpand\tabu@temp @%
- \else\if !\noexpand\tabu@temp @%
- \else !%
- \fi\fi
- {\noexpand\extracolsep\noexpand\@flushglue}}%
- \fi
- \tabu@temp
-}% \tabu@extrac@lsep
-%% Implementing the strategy ----------------------------------------
-\long\def\tabu@pream #1\@preamble {%
- \let\tabu@ \tabu@@ \tabu@mkpreambuffer \tabu@aftergroupcleanup
- \NC@list\expandafter {\tabu@NC@list}% in case of nesting...
- \ifdefined\tabu@usetabu \tabu@usetabu \tabu@target \z@ \fi
- \let\tabu@savedpreamble \@preamble
- \global\let\tabu@elapsedtime \relax
- \tabu@thebody ={#1\tabu@aftergroupcleanup}%
- \tabu@thebody =\expandafter{\the\expandafter\tabu@thebody
- \@preamble}%
- \edef\tabuthepreamble {\the\tabu@thebody}% ( no @ allowed for \scantokens )
- \tabu@select
-}% \tabu@pream
-\long\def\tabu@longpream #1\LT@bchunk #2\LT@bchunk{%
- \let\tabu@ \tabu@@ \tabu@mkpreambuffer \tabu@aftergroupcleanup
- \NC@list\expandafter {\tabu@NC@list}% in case of nesting...
- \let\tabu@savedpreamble \@preamble
- \global\let\tabu@elapsedtime \relax
- \tabu@thebody ={#1\LT@bchunk #2\tabu@aftergroupcleanup \LT@bchunk}%
- \edef\tabuthepreamble {\the\tabu@thebody}% ( no @ allowed for \scantokens )
- \tabu@select
-}% \tabu@longpream
-\def\tabu@select {%
- \ifnum\tabu@nested>\z@ \tabuscantokensfalse \fi
- \ifnum \count@=\@ne \iftabu@measuring \count@=\tw@ \fi\fi
- \ifcase \count@
- \global\let\tabu@elapsedtime \relax
- \tabu@seteverycr
- \expandafter \tabuthepreamble % vertical adjustment (inherited from outer)
- \or % exit in vertical measure + struts per cell because no X and outer in mode 3
- \tabu@evr{\tabu@verticalinit}\tabu@celllalign@def{\tabu@verticalmeasure}%
- \def\tabu@cellralign{\tabu@verticalspacing}%
- \tabu@seteverycr
- \expandafter \tabuthepreamble
- \or % exit without measure because no X and outer in mode 4
- \tabu@evr{}\tabu@celllalign@def{}\let\tabu@cellralign \@empty
- \tabu@seteverycr
- \expandafter \tabuthepreamble
- \else % needs trials
- \tabu@evr{}\tabu@celllalign@def{}\let\tabu@cellralign \@empty
- \tabu@savecounters
- \expandafter \tabu@setstrategy
- \fi
-}% \tabu@select
-\def\tabu@@ {\gdef\tabu@mkpreambuffer}
-%% Protections to set up before trials ------------------------------
-\def\tabu@setstrategy {\begingroup % <trials group>
- \tabu@trialh@@k \tabu@cnt \z@ % number of trials
- \hbadness \@M \let\hbadness \@tempcnta
- \hfuzz \maxdimen \let\hfuzz \@tempdima
- \let\write \tabu@nowrite\let\GenericError \tabu@GenericError
- \let\savetabu \@gobble \let\tabudefaulttarget \linewidth
- \let\@footnotetext \@gobble \let\@xfootnote \tabu@xfootnote
- \let\color \tabu@nocolor\let\rowcolor \tabu@norowcolor
- \let\tabu@aftergroupcleanup \relax % only after the last trial
- \tabu@mkpreambuffer
- \ifnum \count@>\thr@@ \let\@halignto \@empty \tabucolX@init
- \def\tabu@lasttry{\m@ne\p@}\fi
- \begingroup \iffalse{\fi \ifnum0=`}\fi
- \toks@{}\def\tabu@stack{b}\iftabuscantokens \endlinechar=10 \obeyspaces \fi %
- \tabu@collectbody \tabu@strategy %
-}% \tabu@setstrategy
-\def\tabu@savecounters{%
- \def\@elt ##1{\csname c@##1\endcsname\the\csname c@##1\endcsname}%
- \edef\tabu@clckpt {\begingroup \globaldefs=\@ne \cl@@ckpt \endgroup}\let\@elt \relax
-}% \tabu@savecounters
-\def\tabucolX@init {% \tabucolX <= \tabu@target / (sum coefs > 0)
- \dimen@ \z@ \tabu@Xsum \z@ \tabucolX \z@ \let\tabu@ \tabu@Xinit \tabu@Xcoefs
- \ifdim \dimen@>\z@
- \@tempdima \dimexpr \tabu@target *\p@/\dimen@ + \tabu@hfuzz\relax
- \ifdim \tabucolX<\@tempdima \tabucolX \@tempdima \fi
- \fi
-}% \tabucolX@init
-\def\tabu@Xinit #1#2{\tabu@Xcol #1 \advance \tabu@Xsum
- \ifdim #2\p@>\z@ #2\p@ \advance\dimen@ #2\p@
- \else -#2\p@ \tabu@negcoeftrue
- \@tempdima \dimexpr \tabu@target*\p@/\dimexpr-#2\p@\relax \relax
- \ifdim \tabucolX<\@tempdima \tabucolX \@tempdima \fi
- \tabu@wddef{#1}{0pt}%
- \fi
-}% \tabu@Xinit
-%% Collecting the environment body ----------------------------------
-\long\def\tabu@collectbody #1#2\end #3{%
- \edef\tabu@stack{\tabu@pushbegins #2\begin\end\expandafter\@gobble\tabu@stack}%
- \ifx \tabu@stack\@empty
- \toks@\expandafter{\expandafter\tabu@thebody\expandafter{\the\toks@ #2}%
- \def\tabu@end@envir{\end{#3}}%
- \iftabuscantokens
- \iftabu@long \def\tabu@endenvir {\end{#3}\tabu@gobbleX}%
- \else \def\tabu@endenvir {\let\endarray \@empty
- \end{#3}\tabu@gobbleX}%
- \fi
- \else \def\tabu@endenvir {\end{#3}}\fi}%
- \let\tabu@collectbody \tabu@endofcollect
- \else\def\tabu@temp{#3}%
- \ifx \tabu@temp\@empty \toks@\expandafter{\the\toks@ #2\end }%
- \else \ifx\tabu@temp\tabu@@spxiii \toks@\expandafter{\the\toks@ #2\end #3}%
- \else \ifx\tabu@temp\tabu@X \toks@\expandafter{\the\toks@ #2\end #3}%
- \else \toks@\expandafter{\the\toks@ #2\end{#3}}%
- \fi\fi\fi
- \fi
- \tabu@collectbody{#1}%
-}% \tabu@collectbody
-\long\def\tabu@pushbegins#1\begin#2{\ifx\end#2\else b\expandafter\tabu@pushbegins\fi}%
-\def\tabu@endofcollect #1{\ifnum0=`{}\fi
- \expandafter\endgroup \the\toks@ #1%
-}% \tabu@endofcollect
-%% The trials: switching between strategies -------------------------
-\def\tabu@strategy {\relax % stops \count@ assignment !
- \ifcase\count@ % case 0 = print with vertical adjustment (outer is finished)
- \expandafter \tabu@endoftrials
- \or % case 1 = exit in vertical measure (outer in mode 3)
- \expandafter\xdef\csname tabu@\the\tabu@nested.T\endcsname{\the\tabu@target}%
- \expandafter\xdef\csname tabu@\the\tabu@nested.X\endcsname{\the\tabucolX}%
- \expandafter \tabu@endoftrials
- \or % case 2 = exit with a rule replacing the table (outer in mode 4)
- \expandafter \tabu@quickend
- \or % case 3 = outer is in mode 3 because of no X
- \begingroup
- \tabu@evr{\tabu@verticalinit}\tabu@celllalign@def{\tabu@verticalmeasure}%
- \def\tabu@cellralign{\tabu@verticalspacing}%
- \expandafter \tabu@measuring
- \else % case 4 = horizontal measure
- \begingroup
- \global\let\tabu@elapsedtime \tabu@message@etime
- \long\def\multicolumn##1##2##3{\multispan{##1}}%
- \let\tabu@startpboxORI \@startpbox
- \iftabu@spread
- \def\tabu@naturalXmax {\z@}%
- \let\tabu@naturalXmin \tabu@naturalXmax
- \tabu@evr{\global\tabu@naturalX \z@}%
- \let\@startpbox \tabu@startpboxmeasure
- \else\iftabu@negcoef
- \let\@startpbox \tabu@startpboxmeasure
- \else \let\@startpbox \tabu@startpboxquick
- \fi\fi
- \expandafter \tabu@measuring
- \fi
-}% \tabu@strategy
-\def\tabu@measuring{\expandafter \tabu@trial \expandafter
- \count@ \the\count@ \tabu@endtrial
-}% \tabu@measuring
-\def\tabu@trial{\iftabu@long \tabu@longtrial \else \tabu@shorttrial \fi}
-\def\tabu@shorttrial {\setbox\tabu@box \hbox\bgroup \tabu@seteverycr
- \ifx \tabu@savecounters\relax \else
- \let\tabu@savecounters \relax \tabu@clckpt \fi
- $\iftabuscantokens \tabu@rescan \else \expandafter\@secondoftwo \fi
- \expandafter{\expandafter \tabuthepreamble
- \the\tabu@thebody
- \csname tabu@adl@endtrial\endcsname
- \endarray}$\egroup % got \tabu@box
-}% \tabu@shorttrial
-\def\tabu@longtrial {\setbox\tabu@box \hbox\bgroup \tabu@seteverycr
- \ifx \tabu@savecounters\relax \else
- \let\tabu@savecounters \relax \tabu@clckpt \fi
- \iftabuscantokens \tabu@rescan \else \expandafter\@secondoftwo \fi
- \expandafter{\expandafter \tabuthepreamble
- \the\tabu@thebody
- \tabuendlongtrial}\egroup % got \tabu@box
-}% \tabu@longtrial
-\def\tabuendlongtrial{% no @ allowed for \scantokens
- \LT@echunk \global\setbox\@ne \hbox{\unhbox\@ne}\kern\wd\@ne
- \LT@get@widths
-}% \tabuendlongtrial
-\def\tabu@adl@endtrial{% <arydshln in nested trials - problem for global column counters!>
- \crcr \noalign{\global\adl@ncol \tabu@nbcols}}% anything global is crap, junky and fails !
-\def\tabu@seteverycr {\tabu@reset
- \everycr \expandafter{\the\everycr \tabu@everycr}%
- \let\everycr \tabu@noeverycr % <for ialign>
-}% \tabu@seteverycr
-\def\tabu@noeverycr{{\aftergroup\tabu@restoreeverycr \afterassignment}\toks@}
-\def\tabu@restoreeverycr {\let\everycr \tabu@@everycr}
-\def\tabu@everycr {\iftabu@everyrow \noalign{\tabu@everyrow}\fi}
-\def\tabu@endoftrials {%
- \iftabuscantokens \expandafter\@firstoftwo
- \else \expandafter\@secondoftwo
- \fi
- {\expandafter \tabu@closetrialsgroup \expandafter
- \tabu@rescan \expandafter{%
- \expandafter\tabuthepreamble
- \the\expandafter\tabu@thebody
- \iftabu@long \else \endarray \fi}}
- {\expandafter\tabu@closetrialsgroup \expandafter
- \tabuthepreamble
- \the\tabu@thebody}%
- \tabu@endenvir % Finish !
-}% \tabu@endoftrials
-\def\tabu@closetrialsgroup {%
- \toks@\expandafter{\tabu@endenvir}%
- \edef\tabu@bufferX{\endgroup
- \tabucolX \the\tabucolX
- \tabu@target \the\tabu@target
- \tabu@cnt \the\tabu@cnt
- \def\noexpand\tabu@endenvir{\the\toks@}%
- %Quid de \@halignto = \tabu@halignto ??
- }% \tabu@bufferX
- \tabu@bufferX
- \ifcase\tabu@nested % print out (outer in mode 0)
- \global\tabu@cnt \tabu@cnt
- \tabu@evr{\tabu@verticaldynamicadjustment}%
- \tabu@celllalign@def{\everypar{}}\let\tabu@cellralign \@empty
- \let\@finalstrut \tabu@finalstrut
- \else % vertical measure of nested tabu
- \tabu@evr{\tabu@verticalinit}%
- \tabu@celllalign@def{\tabu@verticalmeasure}%
- \def\tabu@cellralign{\tabu@verticalspacing}%
- \fi
- \tabu@clckpt \let\@halignto \tabu@halignto
- \let\@halignto \@empty
- \tabu@seteverycr
- \ifdim \tabustrutrule>\z@ \ifnum\tabu@nested=\z@
- \setbox\@arstrutbox \box\voidb@x % force \@arstrutbox to be rebuilt (visible struts)
- \fi\fi
-}% \tabu@closetrialsgroup
-\def\tabu@quickend {\expandafter \endgroup \expandafter
- \tabu@target \the\tabu@target \tabu@quickrule
- \let\endarray \relax \tabu@endenvir
-}% \tabu@quickend
-\def\tabu@endtrial {\relax % stops \count@ assignment !
- \ifcase \count@ \tabu@err % case 0 = impossible here
- \or \tabu@err % case 1 = impossible here
- \or \tabu@err % case 2 = impossible here
- \or % case 3 = outer goes into mode 0
- \def\tabu@bufferX{\endgroup}\count@ \z@
- \else % case 4 = outer goes into mode 3
- \iftabu@spread \tabu@spreadarith % inner into mode 1 (outer in mode 3)
- \else \tabu@arith % or 2 (outer in mode 4)
- \fi
- \count@=%
- \ifcase\tabu@nested \thr@@ % outer goes into mode 3
- \else\iftabu@measuring \tw@ % outer is in mode 4
- \else \@ne % outer is in mode 3
- \fi\fi
- \edef\tabu@bufferX{\endgroup
- \tabucolX \the\tabucolX
- \tabu@target \the\tabu@target}%
- \fi
- \expandafter \tabu@bufferX \expandafter
- \count@ \the\count@ \tabu@strategy
-}% \tabu@endtrial
-\def\tabu@err{\errmessage{(tabu) Internal impossible error! (\count@=\the\count@)}}
-%% The algorithms: compute the widths / stop or go on ---------------
-\def\tabu@arithnegcoef {%
- \@tempdima \z@ \dimen@ \z@ \let\tabu@ \tabu@arith@negcoef \tabu@Xcoefs
-}% \tabu@arithnegcoef
-\def\tabu@arith@negcoef #1#2{%
- \ifdim #2\p@>\z@ \advance\dimen@ #2\p@ % saturated by definition
- \advance\@tempdima #2\tabucolX
- \else
- \ifdim -#2\tabucolX <\tabu@wd{#1}% c_i X < natural width <= \tabu@target-> saturated
- \advance\dimen@ -#2\p@
- \advance\@tempdima -#2\tabucolX
- \else
- \advance\@tempdima \tabu@wd{#1}% natural width <= c_i X => neutralised
- \ifdim \tabu@wd{#1}<\tabu@target \else % neutralised
- \advance\dimen@ -#2\p@ % saturated (natural width = tabu@target)
- \fi
- \fi
- \fi
-}% \tabu@arith@negcoef
-\def\tabu@givespace #1#2{% here \tabu@DELTA < \z@
- \ifdim \@tempdima=\z@
- \tabu@wddef{#1}{\the\dimexpr -\tabu@DELTA*\p@/\tabu@Xsum}%
- \else
- \tabu@wddef{#1}{\the\dimexpr \tabu@hsize{#1}{#2}
- *(\p@ -\tabu@DELTA*\p@/\@tempdima)/\p@\relax}%
- \fi
-}% \tabu@givespace
-\def\tabu@arith {\advance\tabu@cnt \@ne
- \ifnum \tabu@cnt=\@ne \tabu@message{\tabu@titles}\fi
- \tabu@arithnegcoef
- \@tempdimb \dimexpr \wd\tabu@box -\@tempdima \relax % <incompressible material>
- \tabu@DELTA = \dimexpr \wd\tabu@box - \tabu@target \relax
- \tabu@message{\tabu@message@arith}%
- \ifdim \tabu@DELTA <\tabu@hfuzz
- \ifdim \tabu@DELTA<\z@ % wd (tabu)<\tabu@target ?
- \let\tabu@ \tabu@givespace \tabu@Xcoefs
- \advance\@tempdima \@tempdimb \advance\@tempdima -\tabu@DELTA % for message
- \else % already converged: nothing to do but nearly impossible...
- \fi
- \tabucolX \maxdimen
- \tabu@measuringfalse
- \else % need for narrower X columns
- \tabucolX =\dimexpr (\@tempdima -\tabu@DELTA) *\p@/\tabu@Xsum \relax
- \tabu@measuringtrue
- \@whilesw \iftabu@measuring\fi {%
- \advance\tabu@cnt \@ne
- \tabu@arithnegcoef
- \tabu@DELTA =\dimexpr \@tempdima+\@tempdimb -\tabu@target \relax % always < 0 here
- \tabu@message{\tabu@header
- \tabu@msgalign \tabucolX { }{ }{ }{ }{ }\@@
- \tabu@msgalign \@tempdima+\@tempdimb { }{ }{ }{ }{ }\@@
- \tabu@msgalign \tabu@target { }{ }{ }{ }{ }\@@
- \tabu@msgalign@PT \dimen@ { }{}{}{}{}{}{}\@@
- \ifdim -\tabu@DELTA<\tabu@hfuzz \tabu@spaces target ok\else
- \tabu@msgalign \dimexpr -\tabu@DELTA *\p@/\dimen@ {}{}{}{}{}\@@
- \fi}%
- \ifdim -\tabu@DELTA<\tabu@hfuzz
- \advance\@tempdima \@tempdimb % for message
- \tabu@measuringfalse
- \else
- \advance\tabucolX \dimexpr -\tabu@DELTA *\p@/\dimen@ \relax
- \fi
- }%
- \fi
- \tabu@message{\tabu@message@reached}%
- \edef\tabu@bufferX{\endgroup \tabu@cnt \the\tabu@cnt
- \tabucolX \the\tabucolX
- \tabu@target \the\tabu@target}%
-}% \tabu@arith
-\def\tabu@spreadarith {%
- \dimen@ \z@ \@tempdima \tabu@naturalXmax \let\tabu@ \tabu@spread@arith \tabu@Xcoefs
- \edef\tabu@naturalXmin {\the\dimexpr\tabu@naturalXmin*\dimen@/\p@}%
- \@tempdimc =\dimexpr \wd\tabu@box -\tabu@naturalXmax+\tabu@naturalXmin \relax
- \iftabu@measuring
- \tabu@target =\dimexpr \@tempdimc+\tabu@spreadtarget \relax
- \edef\tabu@bufferX{\endgroup \tabucolX \the\tabucolX \tabu@target\the\tabu@target}%
- \else
- \tabu@message{\tabu@message@spreadarith}%
- \ifdim \dimexpr \@tempdimc+\tabu@spreadtarget >\tabu@target
- \tabu@message{(tabu) spread
- \ifdim \@tempdimc>\tabu@target useless here: default target used%
- \else too large: reduced to fit default target\fi.}%
- \else
- \tabu@target =\dimexpr \@tempdimc+\tabu@spreadtarget \relax
- \tabu@message{(tabu) spread: New target set to \the\tabu@target^^J}%
- \fi
- \begingroup \let\tabu@wddef \@gobbletwo
- \@tempdimb \@tempdima
- \tabucolX@init
- \tabu@arithnegcoef
- \wd\tabu@box =\dimexpr \wd\tabu@box +\@tempdima-\@tempdimb \relax
- \expandafter\endgroup \expandafter\tabucolX \the\tabucolX
- \tabu@arith
- \fi
-}% \tabu@spreadarith
-\def\tabu@spread@arith #1#2{%
- \ifdim #2\p@>\z@ \advance\dimen@ #2\p@
- \else \advance\@tempdima \tabu@wd{#1}\relax
- \fi
-}% \tabu@spread@arith
-%% Reporting in the .log file ---------------------------------------
-\def\tabu@message@defaulttarget{%
- \ifnum\tabu@nested=\z@^^J(tabu) Default target:
- \ifx\tabudefaulttarget\linewidth \string\linewidth
- \ifdim \tabu@thetarget=\linewidth \else
- -\the\dimexpr\linewidth-\tabu@thetarget\fi =
- \else\ifx\tabudefaulttarget\linegoal\string\linegoal=
- \fi\fi
- \else (tabu) Default target (nested): \fi
- \the\tabu@target \on@line
- \ifnum\tabu@nested=\z@ , page \the\c@page\fi}
-\def\tabu@message@target {^^J(tabu) Target specified:
- \the\tabu@target \on@line, page \the\c@page}
-\def\tabu@message@arith {\tabu@header
- \tabu@msgalign \tabucolX { }{ }{ }{ }{ }\@@
- \tabu@msgalign \wd\tabu@box { }{ }{ }{ }{ }\@@
- \tabu@msgalign \tabu@target { }{ }{ }{ }{ }\@@
- \tabu@msgalign@PT \dimen@ { }{}{}{}{}{}{}\@@
- \ifdim \tabu@DELTA<\tabu@hfuzz giving space\else
- \tabu@msgalign \dimexpr (\@tempdima-\tabu@DELTA) *\p@/\tabu@Xsum -\tabucolX {}{}{}{}{}\@@
- \fi
-}% \tabu@message@arith
-\def\tabu@message@spreadarith {\tabu@spreadheader
- \tabu@msgalign \tabu@spreadtarget { }{ }{ }{ }{}\@@
- \tabu@msgalign \wd\tabu@box { }{ }{ }{ }{}\@@
- \tabu@msgalign -\tabu@naturalXmax { }{}{}{}{}\@@
- \tabu@msgalign \tabu@naturalXmin { }{ }{ }{ }{}\@@
- \tabu@msgalign \ifdim \dimexpr\@tempdimc>\tabu@target \tabu@target
- \else \@tempdimc+\tabu@spreadtarget \fi
- {}{}{}{}{}\@@}
-\def\tabu@message@negcoef #1#2{
- \tabu@spaces\tabu@spaces\space * #1. X[\rem@pt#2]:
- \space width = \tabu@wd {#1}
- \expandafter\string\csname tabu@\the\tabu@nested.W\number#1\endcsname
- \ifdim -\tabu@pt#2\tabucolX<\tabu@target
- < \number-\rem@pt#2 X
- = \the\dimexpr -\tabu@pt#2\tabucolX \relax
- \else
- <= \the\tabu@target\space < \number-\rem@pt#2 X\fi}
-\def\tabu@message@reached{\tabu@header
- ******* Reached Target:
- hfuzz = \tabu@hfuzz\on@line\space *******}
-\def\tabu@message@etime{\edef\tabu@stoptime{\the\pdfelapsedtime}%
- \tabu@message{(tabu)\tabu@spaces Time elapsed during measure:
- \the\numexpr(\tabu@stoptime-\tabu@starttime-32767)/65536\relax sec
- \the\numexpr\numexpr(\tabu@stoptime-\tabu@starttime)
- -\numexpr(\tabu@stoptime-\tabu@starttime-32767)/65536\relax*65536\relax
- *1000/65536\relax ms \tabu@spaces(\the\tabu@cnt\space
- cycle\ifnum\tabu@cnt>\@ne s\fi)^^J^^J}}
-\def\tabu@message@verticalsp {%
- \ifdim \@tempdima>\tabu@ht
- \ifdim \@tempdimb>\tabu@dp
- \expandafter\expandafter\expandafter\string\tabu@ht =
- \tabu@msgalign \@tempdima { }{ }{ }{ }{ }\@@
- \expandafter\expandafter\expandafter\string\tabu@dp =
- \tabu@msgalign \@tempdimb { }{ }{ }{ }{ }\@@^^J%
- \else
- \expandafter\expandafter\expandafter\string\tabu@ht =
- \tabu@msgalign \@tempdima { }{ }{ }{ }{ }\@@^^J%
- \fi
- \else\ifdim \@tempdimb>\tabu@dp
- \tabu@spaces\tabu@spaces\tabu@spaces
- \expandafter\expandafter\expandafter\string\tabu@dp =
- \tabu@msgalign \@tempdimb { }{ }{ }{ }{ }\@@^^J\fi
- \fi
-}% \tabu@message@verticalsp
-\edef\tabu@spaces{\@spaces}
-\def\tabu@strippt{\expandafter\tabu@pt\the}
-{\@makeother\P \@makeother\T\lowercase{\gdef\tabu@pt #1PT{#1}}}
-\def\tabu@msgalign{\expandafter\tabu@msg@align\the\dimexpr}
-\def\tabu@msgalign@PT{\expandafter\tabu@msg@align\romannumeral-`\0\tabu@strippt}
-\def\do #1{%
- \def\tabu@msg@align##1.##2##3##4##5##6##7##8##9\@@{%
- \ifnum##1<10 #1 #1\else
- \ifnum##1<100 #1 \else
- \ifnum##1<\@m #1\fi\fi\fi
- ##1.##2##3##4##5##6##7##8#1}%
- \def\tabu@header{(tabu) \ifnum\tabu@cnt<10 #1\fi\the\tabu@cnt) }%
- \def\tabu@titles{\ifnum \tabu@nested=\z@
- (tabu) Try#1 #1 tabu X #1 #1 #1tabu Width #1 #1 Target
- #1 #1 #1 Coefs #1 #1 #1 Update^^J\fi}%
- \def\tabu@spreadheader{%
- (tabu) Try#1 #1 Spread #1 #1 tabu Width #1 #1 #1 Nat. X #1 #1 #1 #1Nat. Min.
- #1 New Target^^J%
- (tabu) sprd}
- \def\tabu@message@save {\begingroup
- \def\x ####1{\tabu@msg@align ####1{ }{ }{ }{ }{}\@@}
- \def\z ####1{\expandafter\x\expandafter{\romannumeral-`\0\tabu@strippt
- \dimexpr####1\p@{ }{ }}}%
- \let\color \relax \def\tabu@rulesstyle ####1####2{\detokenize{####1}}%
- \let\CT@arc@ \relax \let\@preamble \@gobble
- \let\tabu@savedpream \@firstofone
- \let\tabu@savedparams \@firstofone
- \def\tabu@target ####1\relax {(tabu) target #1 #1 #1 #1 #1 = \x{####1}^^J}%
- \def\tabucolX ####1\relax {(tabu) X columns width#1 = \x{####1}^^J}%
- \def\tabu@nbcols ####1\relax {(tabu) Number of columns: \z{####1}^^J}%
- \def\tabu@aligndefault ####1{(tabu) Default alignment: #1 #1 ####1^^J}%
- \def\col@sep ####1\relax {(tabu) column sep #1 #1 #1 = \x{####1}^^J}%
- \def\arrayrulewidth ####1\relax{(tabu) arrayrulewidth #1 = \x{####1}}%
- \def\doublerulesep ####1\relax { doublerulesep = \x{####1}^^J}%
- \def\extratabsurround####1\relax{(tabu) extratabsurround = \x{####1}^^J}%
- \def\extrarowheight ####1\relax{(tabu) extrarowheight #1 = \x{####1}}%
- \def\extrarowdepth ####1\relax {extrarowdepth = \x{####1}^^J}%
- \def\abovetabulinesep####1\relax{(tabu) abovetabulinesep=\x{####1} }%
- \def\belowtabulinesep####1\relax{ belowtabulinesep=\x{####1}^^J}%
- \def\arraystretch ####1{(tabu) arraystretch #1 #1 = \z{####1}^^J}%
- \def\minrowclearance####1\relax{(tabu) minrowclearance #1 = \x{####1}^^J}%
- \def\tabu@arc@L ####1{(tabu) taburulecolor #1 #1 = ####1^^J}%
- \def\tabu@drsc@L ####1{(tabu) tabudoublerulecolor= ####1^^J}%
- \def\tabu@evr@L ####1{(tabu) everyrow #1 #1 #1 #1 = \detokenize{####1}^^J}%
- \def\tabu@ls@L ####1{(tabu) line style = \detokenize{####1}^^J}%
- \def\NC@find ####1\@nil{(tabu) tabu preamble#1 #1 = \detokenize{####1}^^J}%
- \def\tabu@wddef####1####2{(tabu) Natural width ####1 = \x{####2}^^J}%
- \let\edef \@gobbletwo \let\def \@empty \let\let \@gobbletwo
- \tabu@message{%
- (tabu) \string\savetabu{\tabu@temp}: \on@line^^J%
- \tabu@usetabu \@nil^^J}%
- \endgroup}
-}\do{ }
-%% Measuring the natural width (varwidth) - store the results -------
-\def\tabu@startpboxmeasure #1{\bgroup % entering \vtop
- \edef\tabu@temp{\expandafter\@secondoftwo \ifx\tabu@hsize #1\else\relax\fi}%
- \ifodd 1\ifx \tabu@temp\@empty 0 \else % starts with \tabu@hsize ?
- \iftabu@spread \else % if spread -> measure
- \ifdim \tabu@temp\p@>\z@ 0 \fi\fi\fi% if coef>0 -> do not measure
- \let\@startpbox \tabu@startpboxORI % restore immediately (nesting)
- \tabu@measuringtrue % for the quick option...
- \tabu@Xcol =\expandafter\@firstoftwo\ifx\tabu@hsize #1\fi
- \ifdim \tabu@temp\p@>\z@ \ifdim \tabu@temp\tabucolX<\tabu@target
- \tabu@target=\tabu@temp\tabucolX \fi\fi
- \setbox\tabu@box \hbox \bgroup
- \begin{varwidth}\tabu@target
- \let\FV@ListProcessLine \tabu@FV@ListProcessLine % \hbox to natural width...
- \narrowragged \arraybackslash \parfillskip \@flushglue
- \ifdefined\pdfadjustspacing \pdfadjustspacing\z@ \fi
- \bgroup \aftergroup\tabu@endpboxmeasure
- \ifdefined \cellspacetoplimit \tabu@cellspacepatch \fi
- \else \expandafter\@gobble
- \tabu@startpboxquick{#1}% \@gobble \bgroup
- \fi
-}% \tabu@startpboxmeasure
-\def\tabu@cellspacepatch{\def\bcolumn##1\@nil{}\let\ecolumn\@empty
- \bgroup\color@begingroup}
-\def\tabu@endpboxmeasure {%
- \@finalstrut \@arstrutbox
- \end{varwidth}\egroup % <got my \tabu@box>
- \ifdim \tabu@temp\p@ <\z@ % neg coef
- \ifdim \tabu@wd\tabu@Xcol <\wd\tabu@box
- \tabu@wddef\tabu@Xcol {\the\wd\tabu@box}%
- \tabu@debug{\tabu@message@endpboxmeasure}%
- \fi
- \else % spread coef>0
- \global\advance \tabu@naturalX \wd\tabu@box
- \@tempdima =\dimexpr \wd\tabu@box *\p@/\dimexpr \tabu@temp\p@\relax \relax
- \ifdim \tabu@naturalXmax <\tabu@naturalX
- \xdef\tabu@naturalXmax {\the\tabu@naturalX}\fi
- \ifdim \tabu@naturalXmin <\@tempdima
- \xdef\tabu@naturalXmin {\the\@tempdima}\fi
- \fi
- \box\tabu@box \egroup % end of \vtop (measure) restore \tabu@target
-}% \tabu@endpboxmeasure
-\def\tabu@wddef #1{\expandafter\xdef
- \csname tabu@\the\tabu@nested.W\number#1\endcsname}
-\def\tabu@wd #1{\csname tabu@\the\tabu@nested.W\number#1\endcsname}
-\def\tabu@message@endpboxmeasure{\tabu@spaces\tabu@spaces<-> % <-> save natural wd
- \the\tabu@Xcol. X[\tabu@temp]:
- target = \the\tabucolX \space
- \expandafter\expandafter\expandafter\string\tabu@wd\tabu@Xcol
- =\tabu@wd\tabu@Xcol
-}% \tabu@message@endpboxmeasure
-\def\tabu@startpboxquick {\bgroup
- \let\@startpbox \tabu@startpboxORI % restore immediately
- \let\tabu \tabu@quick % \begin is expanded before...
- \expandafter\@gobble \@startpbox % gobbles \bgroup
-}% \tabu@startpboxquick
-\def\tabu@quick {\begingroup \iffalse{\fi \ifnum0=`}\fi
- \toks@{}\def\tabu@stack{b}\tabu@collectbody \tabu@endquick
-}% \tabu@quick
-\def\tabu@endquick {%
- \ifodd 1\ifx\tabu@end@envir\tabu@endtabu \else
- \ifx\tabu@end@envir\tabu@endtabus \else 0\fi\fi\relax
- \endgroup
- \else \let\endtabu \relax
- \tabu@end@envir
- \fi
-}% \tabu@quick
-\def\tabu@endtabu {\end{tabu}}
-\def\tabu@endtabus {\end{tabu*}}
-%% Measuring the heights and depths - store the results -------------
-\def\tabu@verticalmeasure{\everypar{}%
- \ifnum \currentgrouptype>12 % 14=semi-simple, 15=math shift group
- \setbox\tabu@box =\hbox\bgroup
- \let\tabu@verticalspacing \tabu@verticalsp@lcr
- \d@llarbegin % after \hbox ...
- \else
- \edef\tabu@temp{\ifnum\currentgrouptype=5\vtop
- \else\ifnum\currentgrouptype=12\vcenter
- \else\vbox\fi\fi}%
- \setbox\tabu@box \hbox\bgroup$\tabu@temp \bgroup
- \let\tabu@verticalspacing \tabu@verticalsp@pmb
- \fi
-}% \tabu@verticalmeasure
-\def\tabu@verticalsp@lcr{%
- \d@llarend \egroup % <got my \tabu@box>
- \@tempdima \dimexpr \ht\tabu@box+\abovetabulinesep
- \@tempdimb \dimexpr \dp\tabu@box+\belowtabulinesep \relax
- \ifdim\tabustrutrule>\z@ \tabu@debug{\tabu@message@verticalsp}\fi
- \ifdim \tabu@ht<\@tempdima \tabu@htdef{\the\@tempdima}\fi
- \ifdim \tabu@dp<\@tempdimb \tabu@dpdef{\the\@tempdimb}\fi
- \noindent\vrule height\@tempdima depth\@tempdimb
-}% \tabu@verticalsp@lcr
-\def\tabu@verticalsp@pmb{% inserts struts as needed
- \par \expandafter\egroup
- \expandafter$\expandafter
- \egroup \expandafter
- \@tempdimc \the\prevdepth
- \@tempdima \dimexpr \ht\tabu@box+\abovetabulinesep
- \@tempdimb \dimexpr \dp\tabu@box+\belowtabulinesep \relax
- \ifdim\tabustrutrule>\z@ \tabu@debug{\tabu@message@verticalsp}\fi
- \ifdim \tabu@ht<\@tempdima \tabu@htdef{\the\@tempdima}\fi
- \ifdim \tabu@dp<\@tempdimb \tabu@dpdef{\the\@tempdimb}\fi
- \let\@finalstrut \@gobble
- \hrule height\@tempdima depth\@tempdimb width\hsize
-%% \box\tabu@box
-}% \tabu@verticalsp@pmb
-
-\def\tabu@verticalinit{%
- \ifnum \c@taburow=\z@ \tabu@rearstrut \fi % after \tabu@reset !
- \advance\c@taburow \@ne
- \tabu@htdef{\the\ht\@arstrutbox}\tabu@dpdef{\the\dp\@arstrutbox}%
- \advance\c@taburow \m@ne
-}% \tabu@verticalinit
-\def\tabu@htdef {\expandafter\xdef \csname tabu@\the\tabu@nested.H\the\c@taburow\endcsname}
-\def\tabu@ht {\csname tabu@\the\tabu@nested.H\the\c@taburow\endcsname}
-\def\tabu@dpdef {\expandafter\xdef \csname tabu@\the\tabu@nested.D\the\c@taburow\endcsname}
-\def\tabu@dp {\csname tabu@\the\tabu@nested.D\the\c@taburow\endcsname}
-\def\tabu@verticaldynamicadjustment {%
- \advance\c@taburow \@ne
- \extrarowheight \dimexpr\tabu@ht - \ht\strutbox
- \extrarowdepth \dimexpr\tabu@dp - \dp\strutbox
- \let\arraystretch \@empty
- \advance\c@taburow \m@ne
-}% \tabu@verticaldynamicadjustment
-\def\tabuphantomline{\crcr \noalign{%
- {\globaldefs \@ne
- \setbox\@arstrutbox \box\voidb@x
- \let\tabu@@celllalign \tabu@celllalign
- \let\tabu@@cellralign \tabu@cellralign
- \let\tabu@@cellleft \tabu@cellleft
- \let\tabu@@cellright \tabu@cellright
- \let\tabu@@thevline \tabu@thevline
- \let\tabu@celllalign \@empty
- \let\tabu@cellralign \@empty
- \let\tabu@cellright \@empty
- \let\tabu@cellleft \@empty
- \let\tabu@thevline \relax}%
- \edef\tabu@temp{\tabu@multispan \tabu@nbcols{\noindent &}}%
- \toks@\expandafter{\tabu@temp \noindent\tabu@everyrowfalse \cr
- \noalign{\tabu@rearstrut
- {\globaldefs\@ne
- \let\tabu@celllalign \tabu@@celllalign
- \let\tabu@cellralign \tabu@@cellralign
- \let\tabu@cellleft \tabu@@cellleft
- \let\tabu@cellright \tabu@@cellright
- \let\tabu@thevline \tabu@@thevline}}}%
- \expandafter}\the\toks@
-}% \tabuphantomline
-%% \firsthline and \lasthline corrections ---------------------------
-\def\tabu@firstline {\tabu@hlineAZ \tabu@firsthlinecorrection {}}
-\def\tabu@firsthline{\tabu@hlineAZ \tabu@firsthlinecorrection \hline}
-\def\tabu@lastline {\tabu@hlineAZ \tabu@lasthlinecorrection {}}
-\def\tabu@lasthline {\tabu@hlineAZ \tabu@lasthlinecorrection \hline}
-\def\tabu@hline {% replaces \hline if no colortbl (see \AtBeginDocument)
- \noalign{\ifnum0=`}\fi
- {\CT@arc@\hrule height\arrayrulewidth}%
- \futurelet \tabu@temp \tabu@xhline
-}% \tabu@hline
-\def\tabu@xhline{%
- \ifx \tabu@temp \hline
- {\ifx \CT@drsc@\relax \vskip
- \else\ifx \CT@drsc@\@empty \vskip
- \else \CT@drsc@\hrule height
- \fi\fi
- \doublerulesep}%
- \fi
- \ifnum0=`{\fi}%
-}% \tabu@xhline
-\def\tabu@hlineAZ #1#2{\noalign{\ifnum0=`}\fi \dimen@ \z@ \count@ \z@
- \toks@{}\def\tabu@hlinecorrection{#1}\def\tabu@temp{#2}%
- \tabu@hlineAZsurround
-}% \tabu@hlineAZ
-\newcommand*\tabu@hlineAZsurround[1][\extratabsurround]{%
- \extratabsurround #1\let\tabucline \tabucline@scan
- \let\hline \tabu@hlinescan \let\firsthline \hline
- \let\cline \tabu@clinescan \let\lasthline \hline
- \expandafter \futurelet \expandafter \tabu@temp
- \expandafter \tabu@nexthlineAZ \tabu@temp
-}% \tabu@hlineAZsurround
-\def\tabu@hlinescan {\tabu@thick \arrayrulewidth \tabu@xhlineAZ \hline}
-\def\tabu@clinescan #1{\tabu@thick \arrayrulewidth \tabu@xhlineAZ {\cline{#1}}}
-\def\tabucline@scan{\@testopt \tabucline@sc@n {}}
-\def\tabucline@sc@n #1[#2]{\tabu@xhlineAZ {\tabucline[{#1}]{#2}}}
-\def\tabu@nexthlineAZ{%
- \ifx \tabu@temp\hline \else
- \ifx \tabu@temp\cline \else
- \ifx \tabu@temp\tabucline \else
- \tabu@hlinecorrection
- \fi\fi\fi
-}% \tabu@nexthlineAZ
-\def\tabu@xhlineAZ #1{%
- \toks@\expandafter{\the\toks@ #1}%
- \@tempdimc \tabu@thick % The last line width
- \ifcase\count@ \@tempdimb \tabu@thick % The first line width
- \else \advance\dimen@ \dimexpr \tabu@thick+\doublerulesep \relax
- \fi
- \advance\count@ \@ne \futurelet \tabu@temp \tabu@nexthlineAZ
-}% \tabu@xhlineAZ
-\def\tabu@firsthlinecorrection{% \count@ = number of \hline -1
- \@tempdima \dimexpr \ht\@arstrutbox+\dimen@
- \edef\firsthline{% <local in \noalign>
- \omit \hbox to\z@{\hss{\noexpand\tabu@DBG{yellow}\vrule
- height \the\dimexpr\@tempdima+\extratabsurround
- depth \dp\@arstrutbox
- width \tabustrutrule}\hss}\cr
- \noalign{\vskip -\the\dimexpr \@tempdima+\@tempdimb
- +\dp\@arstrutbox \relax}%
- \the\toks@
- }\ifnum0=`{\fi
- \expandafter}\firsthline % we are then !
-}% \tabu@firsthlinecorrection
-\def\tabu@lasthlinecorrection{%
- \@tempdima \dimexpr \dp\@arstrutbox+\dimen@+\@tempdimb+\@tempdimc
- \edef\lasthline{% <local in \noalign>
- \the\toks@
- \noalign{\vskip -\the\dimexpr\dimen@+\@tempdimb+\dp\@arstrutbox}%
- \omit \hbox to\z@{\hss{\noexpand\tabu@DBG{yellow}\vrule
- depth \the\dimexpr \dp\@arstrutbox+\@tempdimb+\dimen@
- +\extratabsurround-\@tempdimc
- height \z@
- width \tabustrutrule}\hss}\cr
- }\ifnum0=`{\fi
- \expandafter}\lasthline % we are then !
-}% \tabu@lasthlinecorrection
-\def\tabu@LT@@hline{%
- \ifx\LT@next\hline
- \global\let\LT@next \@gobble
- \ifx \CT@drsc@\relax
- \gdef\CT@LT@sep{%
- \noalign{\penalty-\@medpenalty\vskip\doublerulesep}}%
- \else
- \gdef\CT@LT@sep{%
- \multispan\LT@cols{%
- \CT@drsc@\leaders\hrule\@height\doublerulesep\hfill}\cr}%
- \fi
- \else
- \global\let\LT@next\empty
- \gdef\CT@LT@sep{%
- \noalign{\penalty-\@lowpenalty\vskip-\arrayrulewidth}}%
- \fi
- \ifnum0=`{\fi}%
- \multispan\LT@cols
- {\CT@arc@\leaders\hrule\@height\arrayrulewidth\hfill}\cr
- \CT@LT@sep
- \multispan\LT@cols
- {\CT@arc@\leaders\hrule\@height\arrayrulewidth\hfill}\cr
- \noalign{\penalty\@M}%
- \LT@next
-}% \tabu@LT@@hline
-%% Horizontal lines : \tabucline ------------------------------------
-\let\tabu@start \@tempcnta
-\let\tabu@stop \@tempcntb
-\newcommand*\tabucline{\noalign{\ifnum0=`}\fi \tabu@cline}
-\newcommand*\tabu@cline[2][]{\tabu@startstop{#2}%
- \ifnum \tabu@stop<\z@ \toks@{}%
- \else \tabu@clinearg{#1}\tabu@thestyle
- \edef\tabucline{\toks@{%
- \ifnum \tabu@start>\z@ \omit
- \tabu@multispan\tabu@start {\span\omit}&\fi
- \omit \tabu@multispan\tabu@stop {\span\omit}%
- \tabu@thehline\cr
- }}\tabucline
- \tabu@tracinglines{(tabu:tabucline) Style: #1^^J\the\toks@^^J^^J}%
- \fi
- \futurelet \tabu@temp \tabu@xcline
-}% \tabu@cline
-\def\tabu@clinearg #1{%
- \ifx\\#1\\\let\tabu@thestyle \tabu@ls@
- \else \@defaultunits \expandafter\let\expandafter\@tempa
- \romannumeral-`\0#1\relax \@nnil
- \ifx \hbox\@tempa \tabu@clinebox{#1}%
- \else\ifx \box\@tempa \tabu@clinebox{#1}%
- \else\ifx \vbox\@tempa \tabu@clinebox{#1}%
- \else\ifx \vtop\@tempa \tabu@clinebox{#1}%
- \else\ifx \copy\@tempa \tabu@clinebox{#1}%
- \else\ifx \leaders\@tempa \tabu@clineleads{#1}%
- \else\ifx \cleaders\@tempa \tabu@clineleads{#1}%
- \else\ifx \xleaders\@tempa \tabu@clineleads{#1}%
- \else\tabu@getline {#1}%
- \fi\fi\fi\fi\fi\fi\fi\fi
- \fi
-}% \tabu@clinearg
-\def\tabu@clinebox #1{\tabu@clineleads{\xleaders#1\hss}}
-\def\tabu@clineleads #1{%
- \let\tabu@thestyle \relax \let\tabu@leaders \@undefined
- \gdef\tabu@thehrule{#1}}
-\def\tabu@thehline{\begingroup
- \ifdefined\tabu@leaders
- \noexpand\tabu@thehleaders
- \else \noexpand\tabu@thehrule
- \fi \endgroup
-}% \tabu@thehline
-\def\tabu@xcline{%
- \ifx \tabu@temp\tabucline
- \toks@\expandafter{\the\toks@ \noalign
- {\ifx\CT@drsc@\relax \vskip
- \else \CT@drsc@\hrule height
- \fi
- \doublerulesep}}%
- \fi
- \tabu@docline
-}% \tabu@xcline
-\def\tabu@docline {\ifnum0=`{\fi \expandafter}\the\toks@}
-\def\tabu@docline@evr {\xdef\tabu@doclineafter{\the\toks@}%
- \ifnum0=`{\fi}\aftergroup\tabu@doclineafter}
-\def\tabu@multispan #1#2{%
- \ifnum\numexpr#1>\@ne #2\expandafter\tabu@multispan
- \else \expandafter\@gobbletwo
- \fi {#1-1}{#2}%
-}% \tabu@multispan
-\def\tabu@startstop #1{\tabu@start@stop #1\relax 1-\tabu@nbcols \@nnil}
-\def\tabu@start@stop #1-#2\@nnil{%
- \@defaultunits \tabu@start\number 0#1\relax \@nnil
- \@defaultunits \tabu@stop \number 0#2\relax \@nnil
- \tabu@stop \ifnum \tabu@start>\tabu@nbcols \m@ne
- \else\ifnum \tabu@stop=\z@ \tabu@nbcols
- \else\ifnum \tabu@stop>\tabu@nbcols \tabu@nbcols
- \else \tabu@stop
- \fi\fi\fi
- \advance\tabu@start \m@ne
- \ifnum \tabu@start>\z@ \advance\tabu@stop -\tabu@start \fi
-}% \tabu@start@stop
-%% Numbers: siunitx S columns (and \tabudecimal) -------------------
-\def\tabu@tabudecimal #1{%
- \def\tabu@decimal{#1}\@temptokena{}%
- \let\tabu@getdecimal@ \tabu@getdecimal@ignorespaces
- \tabu@scandecimal
-}% \tabu@tabudecimal
-\def\tabu@scandecimal{\futurelet \tabu@temp \tabu@getdecimal@}
-\def\tabu@skipdecimal#1{#1\tabu@scandecimal}
-\def\tabu@getdecimal@ignorespaces{%
- \ifcase 0\ifx\tabu@temp\ignorespaces\else
- \ifx\tabu@temp\@sptoken1\else
- 2\fi\fi\relax
- \let\tabu@getdecimal@ \tabu@getdecimal
- \expandafter\tabu@skipdecimal
- \or \expandafter\tabu@gobblespace\expandafter\tabu@scandecimal
- \else \expandafter\tabu@skipdecimal
- \fi
-}% \tabu@getdecimal@ignorespaces
-\def\tabu@get@decimal#1{\@temptokena\expandafter{\the\@temptokena #1}%
- \tabu@scandecimal}
-\def\do#1{%
- \def\tabu@get@decimalspace#1{%
- \@temptokena\expandafter{\the\@temptokena #1}\tabu@scandecimal}%
-}\do{ }
-\let\tabu@@tabudecimal \tabu@tabudecimal
-\def\tabu@getdecimal{%
- \ifcase 0\ifx 0\tabu@temp\else
- \ifx 1\tabu@temp\else
- \ifx 2\tabu@temp\else
- \ifx 3\tabu@temp\else
- \ifx 4\tabu@temp\else
- \ifx 5\tabu@temp\else
- \ifx 6\tabu@temp\else
- \ifx 7\tabu@temp\else
- \ifx 8\tabu@temp\else
- \ifx 9\tabu@temp\else
- \ifx .\tabu@temp\else
- \ifx ,\tabu@temp\else
- \ifx -\tabu@temp\else
- \ifx +\tabu@temp\else
- \ifx e\tabu@temp\else
- \ifx E\tabu@temp\else
- \ifx\tabu@cellleft\tabu@temp1\else
- \ifx\ignorespaces\tabu@temp1\else
- \ifx\@sptoken\tabu@temp2\else
- 3\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\relax
- \expandafter\tabu@get@decimal
- \or \expandafter\tabu@skipdecimal
- \or \expandafter\tabu@get@decimalspace
- \else\expandafter\tabu@printdecimal
- \fi
-}% \tabu@getdecimal
-\def\tabu@printdecimal{%
- \edef\tabu@temp{\the\@temptokena}%
- \ifx\tabu@temp\@empty\else
- \ifx\tabu@temp\space\else
- \expandafter\tabu@decimal\expandafter{\the\@temptokena}%
- \fi\fi
-}% \tabu@printdecimal
-%% Verbatim inside X columns ----------------------------------------
-\def\tabu@verbatim{%
- \let\verb \tabu@verb
- \let\FV@DefineCheckEnd \tabu@FV@DefineCheckEnd
-}% \tabu@verbatim
-\let\tabu@ltx@verb \verb
-\def\tabu@verb{\@ifstar {\tabu@ltx@verb*} \tabu@ltx@verb}
-\def\tabu@fancyvrb {%
- \def\tabu@FV@DefineCheckEnd ##1{%
- \def\tabu@FV@DefineCheckEnd{%
- ##1% <original definition (if fancyvrb is loaded)>
- \let\FV@CheckEnd \tabu@FV@CheckEnd
- \let\FV@@CheckEnd \tabu@FV@@CheckEnd
- \let\FV@@@CheckEnd \tabu@FV@@@CheckEnd
- \edef\FV@EndScanning{%
- \def\noexpand\next{\noexpand\end{\FV@EnvironName}}%
- \global\let\noexpand\FV@EnvironName\relax
- \noexpand\next}%
- \xdef\FV@EnvironName{\detokenize\expandafter{\FV@EnvironName}}}%
- }\expandafter\tabu@FV@DefineCheckEnd\expandafter{\FV@DefineCheckEnd}
-}% \tabu@fancyvrb
-\def\tabu@FV@CheckEnd #1{\expandafter\FV@@CheckEnd \detokenize{#1\end{}}\@nil}
-\edef\tabu@FV@@@CheckEnd {\detokenize{\end{}}}
-\begingroup
-\catcode`\[1 \catcode`\]2
-\@makeother\{ \@makeother\}
- \edef\x[\endgroup
- \def\noexpand\tabu@FV@@CheckEnd ##1\detokenize[\end{]##2\detokenize[}]##3%
- ]\x \@nil{\def\@tempa{#2}\def\@tempb{#3}}
-\def\tabu@FV@ListProcessLine #1{%
- \hbox {%to \hsize{%
- \kern\leftmargin
- \hbox {%to \linewidth{%
- \FV@LeftListNumber
- \FV@LeftListFrame
- \FancyVerbFormatLine{#1}\hss
-%% DG/SR modification begin - Jan. 28, 1998 (for numbers=right add-on)
-%% \FV@RightListFrame}%
- \FV@RightListFrame
- \FV@RightListNumber}%
-%% DG/SR modification end
- \hss}}
-%% \savetabu --------------------------------------------------------
-\newcommand*\savetabu[1]{\noalign{%
- \tabu@sanitizearg{#1}\tabu@temp
- \ifx \tabu@temp\@empty \tabu@savewarn{}{The tabu will not be saved}\else
- \@ifundefined{tabu@saved@\tabu@temp}{}{\tabu@savewarn{#1}{Overwriting}}%
- \ifdefined\tabu@restored \expandafter\let
- \csname tabu@saved@\tabu@temp \endcsname \tabu@restored
- \else {\tabu@save}%
- \fi
- \fi}%
-}% \savetabu
-\def\tabu@save {%
- \toks0\expandafter{\tabu@saved@}%
- \iftabu@negcoef
- \let\tabu@wddef \relax \let\tabu@ \tabu@savewd \edef\tabu@savewd{\tabu@Xcoefs}%
- \toks0\expandafter{\the\toks\expandafter0\tabu@savewd}\fi
- \toks1\expandafter{\tabu@savedpream}%
- \toks2\expandafter{\tabu@savedpreamble}%
- \let\@preamble \relax
- \let\tabu@savedpream \relax \let\tabu@savedparams \relax
- \edef\tabu@preamble{%
- \def\noexpand\tabu@aligndefault{\tabu@align}%
- \def\tabu@savedparams {\noexpand\the\toks0}%
- \def\tabu@savedpream {\noexpand\the\toks1}}%
- \edef\tabu@usetabu{%
- \def\@preamble {\noexpand\the\toks2}%
- \tabu@target \the\tabu@target \relax
- \tabucolX \the\tabucolX \relax
- \tabu@nbcols \the\tabu@nbcols \relax
- \def\noexpand\tabu@aligndefault{\tabu@align}%
- \def\tabu@savedparams {\noexpand\the\toks0}%
- \def\tabu@savedpream {\noexpand\the\toks1}}%
- \let\tabu@aligndefault \relax \let\@sharp \relax
- \edef\@tempa{\noexpand\tabu@s@ved
- {\tabu@usetabu}
- {\tabu@preamble}
- {\the\toks1}}\@tempa
- \tabu@message@save
-}% \tabu@save
-\long\def\tabu@s@ved #1#2#3{%
- \def\tabu@usetabu{#1}% <for \tabu@message@save>
- \expandafter\gdef\csname tabu@saved@\tabu@temp\endcsname ##1{%
- \ifodd ##1% \usetabu
- \tabu@measuringfalse \tabu@spreadfalse % Just in case...
- \gdef\tabu@usetabu {%
- \ifdim \tabu@target>\z@ \tabu@warn@usetabu \fi
- \global\let\tabu@usetabu \@undefined
- \def\@halignto {to\tabu@target}%
- #1%
- \ifx \tabu@align\tabu@aligndefault@text
- \ifnum \tabu@nested=\z@
- \let\tabu@align \tabu@aligndefault \fi\fi}%
- \else % \preamble
- \gdef\tabu@preamble {%
- \global\let\tabu@preamble \@undefined
- #2%
- \ifx \tabu@align\tabu@aligndefault@text
- \ifnum \tabu@nested=\z@
- \let\tabu@align \tabu@aligndefault \fi\fi}%
- \fi
- #3}%
-}% \tabu@s@ved
-\def\tabu@aligndefault@text {\tabu@aligndefault}%
-\def\tabu@warn@usetabu {\PackageWarning{tabu}
- {Specifying a target with \string\usetabu\space is useless
- \MessageBreak The target cannot be changed!}}
-\def\tabu@savewd #1#2{\ifdim #2\p@<\z@ \tabu@wddef{#1}{\tabu@wd{#1}}\fi}
-\def\tabu@savewarn#1#2{\PackageInfo{tabu}
- {User-name `#1' already used for \string\savetabu
- \MessageBreak #2}}%
-\def\tabu@saveerr#1{\PackageError{tabu}
- {User-name `#1' is unknown for \string\usetabu
- \MessageBreak I cannot restore an unknown preamble!}\@ehd}
-%% \rowfont ---------------------------------------------------------
-\newskip \tabu@cellskip
-\def\tabu@rowfont{\ifdim \baselineskip=\z@\noalign\fi
- {\ifnum0=`}\fi \tabu@row@font}
-\newcommand*\tabu@row@font[2][]{%
- \ifnum7=\currentgrouptype
- \global\let\tabu@@cellleft \tabu@cellleft
- \global\let\tabu@@cellright \tabu@cellright
- \global\let\tabu@@celllalign \tabu@celllalign
- \global\let\tabu@@cellralign \tabu@cellralign
- \global\let\tabu@@rowfontreset\tabu@rowfontreset
- \fi
- \global\let\tabu@rowfontreset \tabu@rowfont@reset
- \expandafter\gdef\expandafter\tabu@cellleft\expandafter{\tabu@cellleft #2}%
- \ifcsname tabu@cell@#1\endcsname % row alignment
- \csname tabu@cell@#1\endcsname \fi
- \ifnum0=`{\fi}% end of group / noalign group
-}% \rowfont
-\def\tabu@ifcolorleavevmode #1{\let\color \tabu@leavevmodecolor #1\let\color\tabu@color}%
-\def\tabu@rowfont@reset{%
- \global\let\tabu@rowfontreset \tabu@@rowfontreset
- \global\let\tabu@cellleft \tabu@@cellleft
- \global\let\tabu@cellright \tabu@@cellright
- \global\let\tabu@cellfont \@empty
- \global\let\tabu@celllalign \tabu@@celllalign
- \global\let\tabu@cellralign \tabu@@cellralign
-}% \tabu@@rowfontreset
-\let\tabu@rowfontreset \@empty % overwritten \AtBeginDocument if colortbl
-%% \tabu@prepnext@tok -----------------------------------------------
-\newif \iftabu@cellright
-\def\tabu@prepnext@tok{%
- \ifnum \count@<\z@ % <first initialisation>
- \@tempcnta \@M % <not initialized by array.sty>
- \tabu@nbcols\z@
- \let\tabu@fornoopORI \@fornoop
- \tabu@cellrightfalse
- \else
- \ifcase \numexpr \count@-\@tempcnta \relax % (case 0): prev. token is left
- \advance \tabu@nbcols \@ne
- \iftabu@cellright % before-previous token is right and is finished
- \tabu@cellrightfalse % <only once>
- \tabu@righttok
- \fi
- \tabu@lefttok
- \or % (case 1) previous token is right
- \tabu@cellrighttrue \let\@fornoop \tabu@lastnoop
- \else % special column: do not change the token
- \iftabu@cellright % before-previous token is right
- \tabu@cellrightfalse
- \tabu@righttok
- \fi
- \fi % \ifcase
- \fi
- \tabu@prepnext@tokORI
-}% \tabu@prepnext@tok
-\long\def\tabu@lastnoop#1\@@#2#3{\tabu@lastn@@p #2\@nextchar \in@\in@@}
-\def\tabu@lastn@@p #1\@nextchar #2#3\in@@{%
- \ifx \in@#2\else
- \let\@fornoop \tabu@fornoopORI
- \xdef\tabu@mkpreambuffer{\tabu@nbcols\the\tabu@nbcols \tabu@mkpreambuffer}%
- \toks0\expandafter{\expandafter\tabu@everyrowtrue \the\toks0}%
- \expandafter\prepnext@tok
- \fi
-}% \tabu@lastnoop
-\def\tabu@righttok{%
- \advance \count@ \m@ne
- \toks\count@\expandafter {\the\toks\count@ \tabu@cellright \tabu@cellralign}%
- \advance \count@ \@ne
-}% \tabu@righttok
-\def\tabu@lefttok{\toks\count@\expandafter{\expandafter\tabu@celllalign
- \the\toks\count@ \tabu@cellleft}% after because of $
-}% \tabu@lefttok
-%% Neutralisation of glues ------------------------------------------
-\let\tabu@cellleft \@empty
-\let\tabu@cellright \@empty
-\tabu@celllalign@def{\tabu@cellleft}%
-\let\tabu@cellralign \@empty
-\def\tabu@cell@align #1#2#3{%
- \let\tabu@maybesiunitx \toks@ \tabu@celllalign
- \global \expandafter \tabu@celllalign@def \expandafter {\the\toks@ #1}%
- \toks@\expandafter{\tabu@cellralign #2}%
- \xdef\tabu@cellralign{\the\toks@}%
- \toks@\expandafter{\tabu@cellleft #3}%
- \xdef\tabu@cellleft{\the\toks@}%
-}% \tabu@cell@align
-\def\tabu@cell@l{% force alignment to left
- \tabu@cell@align
- {\tabu@removehfil \raggedright \tabu@cellleft}% left
- {\tabu@flush1\tabu@ignorehfil}% right
- \raggedright
-}% \tabu@cell@l
-\def\tabu@cell@c{% force alignment to center
- \tabu@cell@align
- {\tabu@removehfil \centering \tabu@flush{.5}\tabu@cellleft}
- {\tabu@flush{.5}\tabu@ignorehfil}
- \centering
-}% \tabu@cell@c
-\def\tabu@cell@r{% force alignment to right
- \tabu@cell@align
- {\tabu@removehfil \raggedleft \tabu@flush1\tabu@cellleft}
- \tabu@ignorehfil
- \raggedleft
-}% \tabu@cell@r
-\def\tabu@cell@j{% force justification (for p, m, b columns)
- \tabu@cell@align
- {\tabu@justify\tabu@cellleft}
- {}
- \tabu@justify
-}% \tabu@cell@j
-\def\tabu@justify{%
- \leftskip\z@skip \@rightskip\leftskip \rightskip\@rightskip
- \parfillskip\@flushglue
-}% \tabu@justify
-%% ragged2e settings
-\def\tabu@cell@L{% force alignment to left (ragged2e)
- \tabu@cell@align
- {\tabu@removehfil \RaggedRight \tabu@cellleft}
- {\tabu@flush 1\tabu@ignorehfil}
- \RaggedRight
-}% \tabu@cell@L
-\def\tabu@cell@C{% force alignment to center (ragged2e)
- \tabu@cell@align
- {\tabu@removehfil \Centering \tabu@flush{.5}\tabu@cellleft}
- {\tabu@flush{.5}\tabu@ignorehfil}
- \Centering
-}% \tabu@cell@C
-\def\tabu@cell@R{% force alignment to right (ragged2e)
- \tabu@cell@align
- {\tabu@removehfil \RaggedLeft \tabu@flush 1\tabu@cellleft}
- \tabu@ignorehfil
- \RaggedLeft
-}% \tabu@cell@R
-\def\tabu@cell@J{% force justification (ragged2e)
- \tabu@cell@align
- {\justifying \tabu@cellleft}
- {}
- \justifying
-}% \tabu@cell@J
-\def\tabu@flush#1{%
- \iftabu@colortbl % colortbl uses \hfill rather than \hfil
- \hskip \ifnum13<\currentgrouptype \stretch{#1}%
- \else \ifdim#1pt<\p@ \tabu@cellskip
- \else \stretch{#1}
- \fi\fi \relax
- \else % array.sty
- \ifnum 13<\currentgrouptype
- \hfil \hskip1sp \relax \fi
- \fi
-}% \tabu@flush
-\let\tabu@hfil \hfil
-\let\tabu@hfill \hfill
-\let\tabu@hskip \hskip
-\def\tabu@removehfil{%
- \iftabu@colortbl
- \unkern \tabu@cellskip =\lastskip
- \ifnum\gluestretchorder\tabu@cellskip =\tw@ \hskip-\tabu@cellskip
- \else \tabu@cellskip \z@skip
- \fi
- \else
- \ifdim\lastskip=1sp\unskip\fi
- \ifnum\gluestretchorder\lastskip =\@ne
- \hfilneg % \hfilneg for array.sty but not for colortbl...
- \fi
- \fi
-}% \tabu@removehfil
-\def\tabu@ignorehfil{\aftergroup \tabu@nohfil}
-\def\tabu@nohfil{% \hfil -> do nothing + restore original \hfil
- \def\hfil{\let\hfil \tabu@hfil}% local to (alignment template) group
-}% \tabu@nohfil
-\def\tabu@colortblalignments {% if colortbl
- \def\tabu@nohfil{%
- \def\hfil {\let\hfil \tabu@hfil}% local to (alignment template) group
- \def\hfill {\let\hfill \tabu@hfill}% (colortbl uses \hfill) pfff...
- \def\hskip ####1\relax{\let\hskip \tabu@hskip}}% local
-}% \tabu@colortblalignments
-%% Taking care of footnotes and hyperfootnotes ----------------------
-\long\def\tabu@footnotetext #1{%
- \edef\@tempa{\the\tabu@footnotes
- \noexpand\footnotetext [\the\csname c@\@mpfn\endcsname]}%
- \global\tabu@footnotes\expandafter{\@tempa {#1}}}%
-\long\def\tabu@xfootnotetext [#1]#2{%
- \global\tabu@footnotes\expandafter{\the\tabu@footnotes
- \footnotetext [{#1}]{#2}}}
-\let\tabu@xfootnote \@xfootnote
-\long\def\tabu@Hy@ftntext{\tabu@Hy@ftntxt {\the \c@footnote }}
-\long\def\tabu@Hy@xfootnote [#1]{%
- \begingroup
- \value\@mpfn #1\relax
- \protected@xdef \@thefnmark {\thempfn}%
- \endgroup
- \@footnotemark \tabu@Hy@ftntxt {#1}%
-}% \tabu@Hy@xfootnote
-\long\def\tabu@Hy@ftntxt #1#2{%
- \edef\@tempa{%
- \the\tabu@footnotes
- \begingroup
- \value\@mpfn #1\relax
- \noexpand\protected@xdef\noexpand\@thefnmark {\noexpand\thempfn}%
- \expandafter \noexpand \expandafter
- \tabu@Hy@footnotetext \expandafter{\Hy@footnote@currentHref}%
- }%
- \global\tabu@footnotes\expandafter{\@tempa {#2}%
- \endgroup}%
-}% \tabu@Hy@ftntxt
-\long\def\tabu@Hy@footnotetext #1#2{%
- \H@@footnotetext{%
- \ifHy@nesting
- \hyper@@anchor {#1}{#2}%
- \else
- \Hy@raisedlink{%
- \hyper@@anchor {#1}{\relax}%
- }%
- \def\@currentHref {#1}%
- \let\@currentlabelname \@empty
- #2%
- \fi
- }%
-}% \tabu@Hy@footnotetext
-%% No need for \arraybackslash ! ------------------------------------
-\def\tabu@latextwoe {%
-\def\tabu@temp##1##2##3{{\toks@\expandafter{##2##3}\xdef##1{\the\toks@}}}
-\tabu@temp \tabu@centering \centering \arraybackslash
-\tabu@temp \tabu@raggedleft \raggedleft \arraybackslash
-\tabu@temp \tabu@raggedright \raggedright \arraybackslash
-}% \tabu@latextwoe
-\def\tabu@raggedtwoe {%
-\def\tabu@temp ##1##2##3{{\toks@\expandafter{##2##3}\xdef##1{\the\toks@}}}
-\tabu@temp \tabu@Centering \Centering \arraybackslash
-\tabu@temp \tabu@RaggedLeft \RaggedLeft \arraybackslash
-\tabu@temp \tabu@RaggedRight \RaggedRight \arraybackslash
-\tabu@temp \tabu@justifying \justifying \arraybackslash
-}% \tabu@raggedtwoe
-\def\tabu@normalcrbackslash{\let\\\@normalcr}
-\def\tabu@trivlist{\expandafter\def\expandafter\@trivlist\expandafter{%
- \expandafter\tabu@normalcrbackslash \@trivlist}}
-%% Utilities: \fbox \fcolorbox and \tabudecimal -------------------
-\def\tabu@fbox {\leavevmode\afterassignment\tabu@beginfbox \setbox\@tempboxa\hbox}
-\def\tabu@beginfbox {\bgroup \kern\fboxsep
- \bgroup\aftergroup\tabu@endfbox}
-\def\tabu@endfbox {\kern\fboxsep\egroup\egroup
- \@frameb@x\relax}
-\def\tabu@color@b@x #1#2{\leavevmode \bgroup
- \def\tabu@docolor@b@x{#1{#2\color@block{\wd\z@}{\ht\z@}{\dp\z@}\box\z@}}%
- \afterassignment\tabu@begincolor@b@x \setbox\z@ \hbox
-}% \tabu@color@b@x
-\def\tabu@begincolor@b@x {\kern\fboxsep \bgroup
- \aftergroup\tabu@endcolor@b@x \set@color}
-\def\tabu@endcolor@b@x {\kern\fboxsep \egroup
- \dimen@\ht\z@ \advance\dimen@ \fboxsep \ht\z@ \dimen@
- \dimen@\dp\z@ \advance\dimen@ \fboxsep \dp\z@ \dimen@
- \tabu@docolor@b@x \egroup
-}% \tabu@endcolor@b@x
-%% Corrections (arydshln, delarray, colortbl) -----------------------
-\def\tabu@fix@arrayright {%% \@arrayright is missing from \endarray
- \iftabu@colortbl
- \ifdefined\adl@array % <colortbl + arydshln>
- \def\tabu@endarray{%
- \adl@endarray \egroup \adl@arrayrestore \CT@end \egroup %<original>
- \@arrayright % <FC>
- \gdef\@preamble{}}% <FC>
- \else % <colortbl / no arydshln>
- \def\tabu@endarray{%
- \crcr \egroup \egroup %<original>
- \@arrayright % <FC>
- \gdef\@preamble{}\CT@end}%
- \fi
- \else
- \ifdefined\adl@array % <arydshln / no colortbl>
- \def\tabu@endarray{%
- \adl@endarray \egroup \adl@arrayrestore \egroup %<original>
- \@arrayright % <FC>
- \gdef\@preamble{}}% <FC>
- \else % <no arydshln / no colotbl + \@arrayright missing>
- \PackageWarning{tabu}
- {\string\@arrayright\space is missing from the
- \MessageBreak definition of \string\endarray.
- \MessageBreak Compatibility with delarray.sty is broken.}%
- \fi\fi
-}% \tabu@fix@arrayright
-\def\tabu@adl@xarraydashrule #1#2#3{%
- \ifnum\@lastchclass=\adl@class@start\else
- \ifnum\@lastchclass=\@ne\else
- \ifnum\@lastchclass=5 \else % <FC> @-arg (class 5) and !-arg (class 1)
- \adl@leftrulefalse \fi\fi % must be treated the same
- \fi
- \ifadl@zwvrule\else \ifadl@inactive\else
- \@addtopreamble{\vrule\@width\arrayrulewidth
- \@height\z@ \@depth\z@}\fi \fi
- \ifadl@leftrule
- \@addtopreamble{\adl@vlineL{\CT@arc@}{\adl@dashgapcolor}%
- {\number#1}#3}%
- \else \@addtopreamble{\adl@vlineR{\CT@arc@}{\adl@dashgapcolor}%
- {\number#2}#3}
- \fi
-}% \tabu@adl@xarraydashrule
-\def\tabu@adl@act@endpbox {%
- \unskip \ifhmode \nobreak \fi \@finalstrut \@arstrutbox
- \egroup \egroup
- \adl@colhtdp \box\adl@box \hfil
-}% \tabu@adl@act@endpbox
-\def\tabu@adl@fix {%
- \let\adl@xarraydashrule \tabu@adl@xarraydashrule % <fix> arydshln
- \let\adl@act@endpbox \tabu@adl@act@endpbox % <fix> arydshln
- \let\adl@act@@endpbox \tabu@adl@act@endpbox % <fix> arydshln
- \let\@preamerror \@preamerr % <fix> arydshln
-}% \tabu@adl@fix
-%% Correction for longtable' \@startbox definition ------------------
-%% => \everypar is ``missing'' : TeX should be in vertical mode
-\def\tabu@LT@startpbox #1{%
- \bgroup
- \let\@footnotetext\LT@p@ftntext
- \setlength\hsize{#1}%
- \@arrayparboxrestore
- \everypar{%
- \vrule \@height \ht\@arstrutbox \@width \z@
- \everypar{}}%
-}% \tabu@LT@startpbox
-%% \tracingtabu and the package options ------------------
-\DeclareOption{delarray}{\AtEndOfPackage{\RequirePackage{delarray}}}
-\DeclareOption{linegoal}{%
- \AtEndOfPackage{%
- \RequirePackage{linegoal}[2010/12/07]%
- \let\tabudefaulttarget \linegoal% \linegoal is \linewidth if not pdfTeX
-}}
-\DeclareOption{scantokens}{\tabuscantokenstrue}
-\DeclareOption{debugshow}{\AtEndOfPackage{\tracingtabu=\tw@}}
-\def\tracingtabu {\begingroup\@ifnextchar=%
- {\afterassignment\tabu@tracing\count@}
- {\afterassignment\tabu@tracing\count@1\relax}}
-\def\tabu@tracing{\expandafter\endgroup
- \expandafter\tabu@tr@cing \the\count@ \relax
-}% \tabu@tracing
-\def\tabu@tr@cing #1\relax {%
- \ifnum#1>\thr@@ \let\tabu@tracinglines\message
- \else \let\tabu@tracinglines\@gobble
- \fi
- \ifnum#1>\tw@ \let\tabu@DBG \tabu@@DBG
- \def\tabu@mkarstrut {\tabu@DBG@arstrut}%
- \tabustrutrule 1.5\p@
- \else \let\tabu@DBG \@gobble
- \def\tabu@mkarstrut {\tabu@arstrut}%
- \tabustrutrule \z@
- \fi
- \ifnum#1>\@ne \let\tabu@debug \message
- \else \let\tabu@debug \@gobble
- \fi
- \ifnum#1>\z@
- \let\tabu@message \message
- \let\tabu@tracing@save \tabu@message@save
- \let\tabu@starttimer \tabu@pdftimer
- \else
- \let\tabu@message \@gobble
- \let\tabu@tracing@save \@gobble
- \let\tabu@starttimer \relax
- \fi
-}% \tabu@tr@cing
-%% Setup \AtBeginDocument
-\AtBeginDocument{\tabu@AtBeginDocument}
-\def\tabu@AtBeginDocument{\let\tabu@AtBeginDocument \@undefined
- \ifdefined\arrayrulecolor \tabu@colortbltrue % <colortbl>
- \tabu@colortblalignments % different glues are used
- \else \tabu@colortblfalse \fi
- \ifdefined\CT@arc@ \else \let\CT@arc@ \relax \fi
- \ifdefined\CT@drsc@\else \let\CT@drsc@ \relax \fi
- \let\tabu@arc@L \CT@arc@ \let\tabu@drsc@L \CT@drsc@
- \ifodd 1\ifcsname siunitx_table_collect_begin:Nn\endcsname % <siunitx: ok>
- \expandafter\ifx
- \csname siunitx_table_collect_begin:Nn\endcsname\relax 0\fi\fi\relax
- \tabu@siunitxtrue
- \else \let\tabu@maybesiunitx \@firstofone % <not siunitx: setup>
- \let\tabu@siunitx \tabu@nosiunitx
- \tabu@siunitxfalse
- \fi
- \ifdefined\adl@array % <arydshln>
- \else \let\tabu@adl@fix \relax
- \let\tabu@adl@endtrial \@empty \fi
- \ifdefined\longtable % <longtable>
- \else \let\longtabu \tabu@nolongtabu \fi
- \ifdefined\cellspacetoplimit \tabu@warn@cellspace\fi
- \csname\ifcsname ifHy@hyperfootnotes\endcsname % <hyperfootnotes>
- ifHy@hyperfootnotes\else iffalse\fi\endcsname
- \let\tabu@footnotetext \tabu@Hy@ftntext
- \let\tabu@xfootnote \tabu@Hy@xfootnote \fi
- \ifdefined\FV@DefineCheckEnd% <fancyvrb>
- \tabu@fancyvrb \fi
- \ifdefined\color % <color / xcolor>
- \let\tabu@color \color
- \def\tabu@leavevmodecolor ##1{%
- \def\tabu@leavevmodecolor {\leavevmode ##1}%
- }\expandafter\tabu@leavevmodecolor\expandafter{\color}%
- \else
- \let\tabu@color \tabu@nocolor
- \let\tabu@leavevmodecolor \@firstofone \fi
- \tabu@latextwoe
- \ifdefined\@raggedtwoe@everyselectfont % <ragged2e>
- \tabu@raggedtwoe
- \else
- \let\tabu@cell@L \tabu@cell@l
- \let\tabu@cell@R \tabu@cell@r
- \let\tabu@cell@C \tabu@cell@c
- \let\tabu@cell@J \tabu@cell@j \fi
- \expandafter\in@ \expandafter\@arrayright \expandafter{\endarray}%
- \ifin@ \let\tabu@endarray \endarray
- \else \tabu@fix@arrayright \fi% <fix for colortbl & arydshln (delarray)>
- \everyrow{}%
-}% \tabu@AtBeginDocument
-\def\tabu@warn@cellspace{%
- \PackageWarning{tabu}{%
- Package cellspace has some limitations
- \MessageBreak And redefines some macros of array.sty.
- \MessageBreak Please use \string\tabulinesep\space to control
- \MessageBreak vertical spacing of lines inside tabu environment}%
-}% \tabu@warn@cellspace
-%% tabu Package initialisation
-\tabuscantokensfalse
-\let\tabu@arc@G \relax
-\let\tabu@drsc@G \relax
-\let\tabu@evr@G \@empty
-\let\tabu@rc@G \@empty
-\def\tabu@ls@G {\tabu@linestyle@}%
-\let\tabu@@rowfontreset \@empty % <init>
-\let\tabu@@celllalign \@empty
-\let\tabu@@cellralign \@empty
-\let\tabu@@cellleft \@empty
-\let\tabu@@cellright \@empty
-\def\tabu@naturalXmin {\z@}
-\def\tabu@naturalXmax {\z@}
-\let\tabu@rowfontreset \@empty
-\def\tabulineon {4pt}\let\tabulineoff \tabulineon
-\tabu@everyrowtrue
-\ifdefined\pdfelapsedtime % <pdfTeX>
- \def\tabu@pdftimer {\xdef\tabu@starttime{\the\pdfelapsedtime}}%
-\else \let\tabu@pdftimer \relax \let\tabu@message@etime \relax
-\fi
-\tracingtabu=\z@
-\newtabulinestyle {=\maxdimen}% creates the 'factory' settings \tabu@linestyle@
-\tabulinestyle{}
-\taburowcolors{}
-\let\tabudefaulttarget \linewidth
-\ProcessOptions* % \ProcessOptions* is quicker !
-\endinput
-%%
-%% End of file `tabu.sty'.
+%%
+%% This is file `tabu.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% tabu.dtx (with options: `package')
+%%
+%% This is a generated file.
+%% Copyright (FC) 2010-2011 - lppl
+%%
+%% tabu : 2011/02/26 v2.8 - tabu : Flexible LaTeX tabulars
+%%
+%% **********************************************************************************************
+%% \begin{tabu} { preamble } => default target: \linewidth or \linegoal
+%% \begin{tabu} to <dimen>{ preamble } => target specified
+%% \begin{tabu} spread <dimen>{ preamble } => target relative to the ``natural width''
+%%
+%% tabu works in text and in math modes.
+%%
+%% X columns: automatic width adjustment + horizontal and vertical alignment
+%% \begin{tabu} { X[4c] X[1c] X[-2ml] }
+%%
+%% Horizontal lines and / or leaders:
+%% \hline\hline => double horizontal line
+%% \firsthline\hline => for nested tabulars
+%% \lasthline\hline => for nested tabulars
+%% \tabucline[line spec]{column-column} => ``funny'' lines (dash/leader)
+%% Automatic lines / leaders :
+%% \everyrow{\hline\hline}
+%%
+%% Vertical lines and / or leaders:
+%% \begin{tabu} { |[3pt red] X[4c] X[1c] X[-2ml] |[3pt blue] }
+%% \begin{tabu} { |[3pt red] X[4c] X[1c] X[-2ml] |[3pt on 2pt off 4pt blue] }
+%%
+%% Fixed vertical spacing adjustment:
+%% \extrarowheight=<dimen> \extrarowdepth=<dimen>
+%% or: \extrarowsep=<dimen> => may be prefixed by \global
+%%
+%% Dynamic vertical spacing adjustment:
+%% \abovetabulinesep=<dimen> \belowtabulinesep=<dimen>
+%% or: \tabulinesep=<dimen> => may be prefixed by \global
+%%
+%% delarray.sty shortcuts: in math and text modes
+%% \begin{tabu} .... \({ preamble }\)
+%%
+%% Algorithms reports:
+%% \tracingtabu=1 \tracingtabu=2
+%%
+%% **********************************************************************************************
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either
+%% version 1.3 of this license or (at your option) any later
+%% version. The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%%
+%% This work consists of the main source file tabu.dtx
+%% and the derived files
+%% tabu.sty, tabu.pdf, tabu.ins
+%%
+%% tabu : Flexible LaTeX tabulars
+%% lppl copyright 2010-2011 by FC <florent.chervet@free.fr>
+%%
+
+\NeedsTeXFormat{LaTeX2e}[2005/12/01]
+\ProvidesPackage{tabu_doxygen}[2011/02/26 v2.8 - flexible LaTeX tabulars (FC), frozen version for doxygen]
+\RequirePackage{array}[2008/09/09]
+\RequirePackage{varwidth}[2009/03/30]
+\AtEndOfPackage{\tabu@AtEnd \let\tabu@AtEnd \@undefined}
+\let\tabu@AtEnd\@empty
+\def\TMP@EnsureCode#1={%
+ \edef\tabu@AtEnd{\tabu@AtEnd
+ \catcode#1 \the\catcode#1}%
+ \catcode#1=%
+}% \TMP@EnsureCode
+\TMP@EnsureCode 33 = 12 % !
+\TMP@EnsureCode 58 = 12 % : (for siunitx)
+\TMP@EnsureCode124 = 12 % |
+\TMP@EnsureCode 36 = 3 % $ = math shift
+\TMP@EnsureCode 38 = 4 % & = tab alignment character
+\TMP@EnsureCode 32 = 10 % space
+\TMP@EnsureCode 94 = 7 % ^
+\TMP@EnsureCode 95 = 8 % _
+%% Constants --------------------------------------------------------
+\newcount \c@taburow \def\thetaburow {\number\c@taburow}
+\newcount \tabu@nbcols
+\newcount \tabu@cnt
+\newcount \tabu@Xcol
+\let\tabu@start \@tempcnta
+\let\tabu@stop \@tempcntb
+\newcount \tabu@alloc \tabu@alloc=\m@ne
+\newcount \tabu@nested
+\def\tabu@alloc@{\global\advance\tabu@alloc \@ne \tabu@nested\tabu@alloc}
+\newdimen \tabu@target
+\newdimen \tabu@spreadtarget
+\newdimen \tabu@naturalX
+\newdimen \tabucolX
+\let\tabu@DELTA \@tempdimc
+\let\tabu@thick \@tempdima
+\let\tabu@on \@tempdimb
+\let\tabu@off \@tempdimc
+\newdimen \tabu@Xsum
+\newdimen \extrarowdepth
+\newdimen \abovetabulinesep
+\newdimen \belowtabulinesep
+\newdimen \tabustrutrule \tabustrutrule \z@
+\newtoks \tabu@thebody
+\newtoks \tabu@footnotes
+\newsavebox \tabu@box
+\newsavebox \tabu@arstrutbox
+\newsavebox \tabu@hleads
+\newsavebox \tabu@vleads
+\newif \iftabu@colortbl
+\newif \iftabu@siunitx
+\newif \iftabu@measuring
+\newif \iftabu@spread
+\newif \iftabu@negcoef
+\newif \iftabu@everyrow
+\def\tabu@everyrowtrue {\global\let\iftabu@everyrow \iftrue}
+\def\tabu@everyrowfalse{\global\let\iftabu@everyrow \iffalse}
+\newif \iftabu@long
+\newif \iftabuscantokens
+\def\tabu@rescan {\tabu@verbatim \scantokens }
+%% Utilities (for internal usage) -----------------------------------
+\def\tabu@gobblespace #1 {#1}
+\def\tabu@gobbletoken #1#2{#1}
+\def\tabu@gobbleX{\futurelet\@let@token \tabu@gobblex}
+\def\tabu@gobblex{\if ^^J\noexpand\@let@token \expandafter\@gobble
+ \else\ifx \@sptoken\@let@token
+ \expandafter\tabu@gobblespace\expandafter\tabu@gobbleX
+ \fi\fi
+}% \tabu@gobblex
+\def\tabu@X{^^J}
+{\obeyspaces
+\global\let\tabu@spxiii= % saves an active space (for \ifx)
+\gdef\tabu@@spxiii{ }}
+\def\tabu@ifenvir {% only for \multicolumn
+ \expandafter\tabu@if@nvir\csname\@currenvir\endcsname
+}% \tabu@ifenvir
+\def\tabu@if@nvir #1{\csname @\ifx\tabu#1first\else
+ \ifx\longtabu#1first\else
+ second\fi\fi oftwo\endcsname
+}% \tabu@ifenvir
+\def\tabu@modulo #1#2{\numexpr\ifnum\numexpr#1=\z@ 0\else #1-(#1-(#2-1)/2)/(#2)*(#2)\fi}
+{\catcode`\&=3
+\gdef\tabu@strtrim #1{% #1 = control sequence to trim
+ \ifodd 1\ifx #1\@empty \else \ifx #1\space \else 0\fi \fi
+ \let\tabu@c@l@r \@empty \let#1\@empty
+ \else \expandafter \tabu@trimspaces #1&#1\@nnil
+ \fi
+}% \tabu@strtrim
+\gdef\tabu@trimspaces #1&#2\@nnil{\let\tabu@c@l@r=#2\tabu@firstspace .#1& &#2}%
+\gdef\tabu@firstspace #1#2#3 &{\tabu@lastspace #2#3&}
+\gdef\tabu@lastspace #1&#2&#3{\def #3{#1}%
+ \ifx #3\tabu@c@l@r \def\tabu@c@l@r{\protect\color{#1}}\expandafter\remove@to@nnil \fi
+ \tabu@trimspaces #1&#3\@nnil}
+}% \catcode
+\def\tabu@sanitizearg #1#2{{%
+ \csname \ifcsname if@safe@actives\endcsname % <babel>
+ @safe@activestrue\else
+ relax\fi \endcsname
+ \edef#2{#1}\tabu@strtrim#2\@onelevel@sanitize#2%
+ \expandafter}\expandafter\def\expandafter#2\expandafter{#2}%
+}% \tabu@sanitizearg
+\def\tabu@textbar #1{\begingroup \endlinechar\m@ne \scantokens{\def\:{|}}%
+ \expandafter\endgroup \expandafter#1\:% !!! semi simple group !!!
+}% \tabu@textbar
+\def\tabu@everyrow@bgroup{\iftabu@everyrow \begingroup \else \noalign{\ifnum0=`}\fi \fi}
+\def\tabu@everyrow@egroup{%
+ \iftabu@everyrow \expandafter \endgroup \the\toks@
+ \else \ifnum0=`{\fi}%
+ \fi
+}% \tabu@everyrow@egroup
+\def\tabu@arstrut {\global\setbox\@arstrutbox \hbox{\vrule
+ height \arraystretch \dimexpr\ht\strutbox+\extrarowheight
+ depth \arraystretch \dimexpr\dp\strutbox+\extrarowdepth
+ width \z@}%
+}% \tabu@arstrut
+\def\tabu@rearstrut {%
+ \@tempdima \arraystretch\dimexpr\ht\strutbox+\extrarowheight \relax
+ \@tempdimb \arraystretch\dimexpr\dp\strutbox+\extrarowdepth \relax
+ \ifodd 1\ifdim \ht\@arstrutbox=\@tempdima
+ \ifdim \dp\@arstrutbox=\@tempdimb 0 \fi\fi
+ \tabu@mkarstrut
+ \fi
+}% \tabu@rearstrut
+\def\tabu@@DBG #1{\ifdim\tabustrutrule>\z@ \color{#1}\fi}
+\def\tabu@DBG@arstrut {\global\setbox\@arstrutbox
+ \hbox to\z@{\hbox to\z@{\hss
+ {\tabu@DBG{cyan}\vrule
+ height \arraystretch \dimexpr\ht\strutbox+\extrarowheight
+ depth \z@
+ width \tabustrutrule}\kern-\tabustrutrule
+ {\tabu@DBG{pink}\vrule
+ height \z@
+ depth \arraystretch \dimexpr\dp\strutbox+\extrarowdepth
+ width \tabustrutrule}}}%
+}% \tabu@DBG@arstrut
+\def\tabu@save@decl{\toks\count@ \expandafter{\the\toks\expandafter\count@
+ \@nextchar}}%
+\def\tabu@savedecl{\ifcat$\d@llarend\else
+ \let\save@decl \tabu@save@decl \fi % no inversion of tokens in text mode
+}% \tabu@savedecl
+\def\tabu@finalstrut #1{\unskip\ifhmode\nobreak\fi\vrule height\z@ depth\z@ width\z@}
+\newcommand*\tabuDisableCommands {\g@addto@macro\tabu@trialh@@k }
+\let\tabu@trialh@@k \@empty
+\def\tabu@nowrite #1#{{\afterassignment}\toks@}
+\let\tabu@write\write
+\let\tabu@immediate\immediate
+\def\tabu@WRITE{\begingroup
+ \def\immediate\write{\aftergroup\endgroup
+ \tabu@immediate\tabu@write}%
+}% \tabu@WRITE
+\expandafter\def\expandafter\tabu@GenericError\expandafter{%
+ \expandafter\tabu@WRITE\GenericError}
+\def\tabu@warn{\tabu@WRITE\PackageWarning{tabu}}
+\def\tabu@noxfootnote [#1]{\@gobble}
+\def\tabu@nocolor #1#{\@gobble}
+\newcommand*\tabu@norowcolor[2][]{}
+\def\tabu@maybesiunitx #1{\def\tabu@temp{#1}%
+ \futurelet\@let@token \tabu@m@ybesiunitx}
+\def\tabu@m@ybesiunitx #1{\def\tabu@m@ybesiunitx {%
+ \ifx #1\@let@token \let\tabu@cellleft \@empty \let\tabu@cellright \@empty \fi
+ \tabu@temp}% \tabu@m@ybesiunitx
+}\expandafter\tabu@m@ybesiunitx \csname siunitx_table_collect_begin:Nn\endcsname
+\def\tabu@celllalign@def #1{\def\tabu@celllalign{\tabu@maybesiunitx{#1}}}%
+%% Fixed vertical spacing adjustment: \extrarowsep ------------------
+\newcommand*\extrarowsep{\edef\tabu@C@extra{\the\numexpr\tabu@C@extra+1}%
+ \iftabu@everyrow \aftergroup\tabu@Gextra
+ \else \aftergroup\tabu@n@Gextra
+ \fi
+ \@ifnextchar={\tabu@gobbletoken\tabu@extra} \tabu@extra
+}% \extrarowsep
+\def\tabu@extra {\@ifnextchar_%
+ {\tabu@gobbletoken{\tabu@setextra\extrarowheight \extrarowdepth}}
+ {\ifx ^\@let@token \def\tabu@temp{%
+ \tabu@gobbletoken{\tabu@setextra\extrarowdepth \extrarowheight}}%
+ \else \let\tabu@temp \@empty
+ \afterassignment \tabu@setextrasep \extrarowdepth
+ \fi \tabu@temp}%
+}% \tabu@extra
+\def\tabu@setextra #1#2{\def\tabu@temp{\tabu@extr@#1#2}\afterassignment\tabu@temp#2}
+\def\tabu@extr@ #1#2{\@ifnextchar^%
+ {\tabu@gobbletoken{\tabu@setextra\extrarowdepth \extrarowheight}}
+ {\ifx _\@let@token \def\tabu@temp{%
+ \tabu@gobbletoken{\tabu@setextra\extrarowheight \extrarowdepth}}%
+ \else \let\tabu@temp \@empty
+ \tabu@Gsave \tabu@G@extra \tabu@C@extra \extrarowheight \extrarowdepth
+ \fi \tabu@temp}%
+}% \tabu@extr@
+\def\tabu@setextrasep {\extrarowheight=\extrarowdepth
+ \tabu@Gsave \tabu@G@extra \tabu@C@extra \extrarowheight \extrarowdepth
+}% \tabu@setextrasep
+\def\tabu@Gextra{\ifx \tabu@G@extra\@empty \else {\tabu@Rextra}\fi}
+\def\tabu@n@Gextra{\ifx \tabu@G@extra\@empty \else \noalign{\tabu@Rextra}\fi}
+\def\tabu@Rextra{\tabu@Grestore \tabu@G@extra \tabu@C@extra}
+\let\tabu@C@extra \z@
+\let\tabu@G@extra \@empty
+%% Dynamic vertical spacing adjustment: \tabulinesep ----------------
+\newcommand*\tabulinesep{\edef\tabu@C@linesep{\the\numexpr\tabu@C@linesep+1}%
+ \iftabu@everyrow \aftergroup\tabu@Glinesep
+ \else \aftergroup\tabu@n@Glinesep
+ \fi
+ \@ifnextchar={\tabu@gobbletoken\tabu@linesep} \tabu@linesep
+}% \tabulinesep
+\def\tabu@linesep {\@ifnextchar_%
+ {\tabu@gobbletoken{\tabu@setsep\abovetabulinesep \belowtabulinesep}}
+ {\ifx ^\@let@token \def\tabu@temp{%
+ \tabu@gobbletoken{\tabu@setsep\belowtabulinesep \abovetabulinesep}}%
+ \else \let\tabu@temp \@empty
+ \afterassignment \tabu@setlinesep \abovetabulinesep
+ \fi \tabu@temp}%
+}% \tabu@linesep
+\def\tabu@setsep #1#2{\def\tabu@temp{\tabu@sets@p#1#2}\afterassignment\tabu@temp#2}
+\def\tabu@sets@p #1#2{\@ifnextchar^%
+ {\tabu@gobbletoken{\tabu@setsep\belowtabulinesep \abovetabulinesep}}
+ {\ifx _\@let@token \def\tabu@temp{%
+ \tabu@gobbletoken{\tabu@setsep\abovetabulinesep \belowtabulinesep}}%
+ \else \let\tabu@temp \@empty
+ \tabu@Gsave \tabu@G@linesep \tabu@C@linesep \abovetabulinesep \belowtabulinesep
+ \fi \tabu@temp}%
+}% \tabu@sets@p
+\def\tabu@setlinesep {\belowtabulinesep=\abovetabulinesep
+ \tabu@Gsave \tabu@G@linesep \tabu@C@linesep \abovetabulinesep \belowtabulinesep
+}% \tabu@setlinesep
+\def\tabu@Glinesep{\ifx \tabu@G@linesep\@empty \else {\tabu@Rlinesep}\fi}
+\def\tabu@n@Glinesep{\ifx \tabu@G@linesep\@empty \else \noalign{\tabu@Rlinesep}\fi}
+\def\tabu@Rlinesep{\tabu@Grestore \tabu@G@linesep \tabu@C@linesep}
+\let\tabu@C@linesep \z@
+\let\tabu@G@linesep \@empty
+%% \global\extrarowsep and \global\tabulinesep -------------------
+\def\tabu@Gsave #1#2#3#4{\xdef#1{#1%
+ \toks#2{\toks\the\currentgrouplevel{\global#3\the#3\global#4\the#4}}}%
+}% \tabu@Gsave
+\def\tabu@Grestore#1#2{%
+ \toks#2{}#1\toks\currentgrouplevel\expandafter{\expandafter}\the\toks#2\relax
+ \ifcat$\the\toks\currentgrouplevel$\else
+ \global\let#1\@empty \global\let#2\z@
+ \the\toks\currentgrouplevel
+ \fi
+}% \tabu@Grestore
+%% Setting code for every row ---------------------------------------
+\newcommand*\everyrow{\tabu@everyrow@bgroup
+ \tabu@start \z@ \tabu@stop \z@ \tabu@evrstartstop
+}% \everyrow
+\def\tabu@evrstartstop {\@ifnextchar^%
+ {\afterassignment \tabu@evrstartstop \tabu@stop=}%
+ {\ifx ^\@let@token
+ \afterassignment\tabu@evrstartstop \tabu@start=%
+ \else \afterassignment\tabu@everyr@w \toks@
+ \fi}%
+}% \tabu@evrstartstop
+\def\tabu@everyr@w {%
+ \xdef\tabu@everyrow{%
+ \noexpand\tabu@everyrowfalse
+ \let\noalign \relax
+ \noexpand\tabu@rowfontreset
+ \iftabu@colortbl \noexpand\tabu@rc@ \fi % \taburowcolors
+ \let\noexpand\tabu@docline \noexpand\tabu@docline@evr
+ \the\toks@
+ \noexpand\tabu@evrh@@k
+ \noexpand\tabu@rearstrut
+ \global\advance\c@taburow \@ne}%
+ \iftabu@everyrow \toks@\expandafter
+ {\expandafter\def\expandafter\tabu@evr@L\expandafter{\the\toks@}\ignorespaces}%
+ \else \xdef\tabu@evr@G{\the\toks@}%
+ \fi
+ \tabu@everyrow@egroup
+}% \tabu@everyr@w
+\def\tabu@evr {\def\tabu@evrh@@k} % for internal use only
+\tabu@evr{}
+%% line style and leaders -------------------------------------------
+\newcommand*\newtabulinestyle [1]{%
+ {\@for \@tempa :=#1\do{\expandafter\tabu@newlinestyle \@tempa==\@nil}}%
+}% \newtabulinestyle
+\def\tabu@newlinestyle #1=#2=#3\@nil{\tabu@getline {#2}%
+ \tabu@sanitizearg {#1}\@tempa
+ \ifodd 1\ifx \@tempa\@empty \ifdefined\tabu@linestyle@ 0 \fi\fi
+ \global\expandafter\let
+ \csname tabu@linestyle@\@tempa \endcsname =\tabu@thestyle \fi
+}% \tabu@newlinestyle
+\newcommand*\tabulinestyle [1]{\tabu@everyrow@bgroup \tabu@getline{#1}%
+ \iftabu@everyrow
+ \toks@\expandafter{\expandafter \def \expandafter
+ \tabu@ls@L\expandafter{\tabu@thestyle}\ignorespaces}%
+ \gdef\tabu@ls@{\tabu@ls@L}%
+ \else
+ \global\let\tabu@ls@G \tabu@thestyle
+ \gdef\tabu@ls@{\tabu@ls@G}%
+ \fi
+ \tabu@everyrow@egroup
+}% \tabulinestyle
+\newcommand*\taburulecolor{\tabu@everyrow@bgroup \tabu@textbar \tabu@rulecolor}
+\def\tabu@rulecolor #1{\toks@{}%
+ \def\tabu@temp #1##1#1{\tabu@ruledrsc{##1}}\@ifnextchar #1%
+ \tabu@temp
+ \tabu@rulearc
+}% \tabu@rulecolor
+\def\tabu@ruledrsc #1{\edef\tabu@temp{#1}\tabu@strtrim\tabu@temp
+ \ifx \tabu@temp\@empty \def\tabu@temp{\tabu@rule@drsc@ {}{}}%
+ \else \edef\tabu@temp{\noexpand\tabu@rule@drsc@ {}{\tabu@temp}}%
+ \fi
+ \tabu@temp
+}% \tabu@ruledrsc@
+\def\tabu@ruledrsc@ #1#{\tabu@rule@drsc@ {#1}}
+\def\tabu@rule@drsc@ #1#2{%
+ \iftabu@everyrow
+ \ifx \\#1#2\\\toks@{\let\CT@drsc@ \relax}%
+ \else \toks@{\def\CT@drsc@{\color #1{#2}}}%
+ \fi
+ \else
+ \ifx \\#1#2\\\global\let\CT@drsc@ \relax
+ \else \gdef\CT@drsc@{\color #1{#2}}%
+ \fi
+ \fi
+ \tabu@rulearc
+}% \tabu@rule@drsc@
+\def\tabu@rulearc #1#{\tabu@rule@arc@ {#1}}
+\def\tabu@rule@arc@ #1#2{%
+ \iftabu@everyrow
+ \ifx \\#1#2\\\toks@\expandafter{\the\toks@ \def\CT@arc@{}}%
+ \else \toks@\expandafter{\the\toks@ \def\CT@arc@{\color #1{#2}}}%
+ \fi
+ \toks@\expandafter{\the\toks@
+ \let\tabu@arc@L \CT@arc@
+ \let\tabu@drsc@L \CT@drsc@
+ \ignorespaces}%
+ \else
+ \ifx \\#1#2\\\gdef\CT@arc@{}%
+ \else \gdef\CT@arc@{\color #1{#2}}%
+ \fi
+ \global\let\tabu@arc@G \CT@arc@
+ \global\let\tabu@drsc@G \CT@drsc@
+ \fi
+ \tabu@everyrow@egroup
+}% \tabu@rule@arc@
+\def\taburowcolors {\tabu@everyrow@bgroup \@testopt \tabu@rowcolors 1}
+\def\tabu@rowcolors [#1]#2#{\tabu@rowc@lors{#1}{#2}}
+\def\tabu@rowc@lors #1#2#3{%
+ \toks@{}\@defaultunits \count@ =\number0#2\relax \@nnil
+ \@defaultunits \tabu@start =\number0#1\relax \@nnil
+ \ifnum \count@<\tw@ \count@=\tw@ \fi
+ \advance\tabu@start \m@ne
+ \ifnum \tabu@start<\z@ \tabu@start \z@ \fi
+ \tabu@rowcolorseries #3\in@..\in@ \@nnil
+}% \tabu@rowcolors
+\def\tabu@rowcolorseries #1..#2\in@ #3\@nnil {%
+ \ifx \in@#1\relax
+ \iftabu@everyrow \toks@{\def\tabu@rc@{}\let\tabu@rc@L \tabu@rc@}%
+ \else \gdef\tabu@rc@{}\global\let\tabu@rc@G \tabu@rc@
+ \fi
+ \else
+ \ifx \\#2\\\tabu@rowcolorserieserror \fi
+ \tabu@sanitizearg{#1}\tabu@temp
+ \tabu@sanitizearg{#2}\@tempa
+ \advance\count@ \m@ne
+ \iftabu@everyrow
+ \def\tabu@rc@ ##1##2##3##4{\def\tabu@rc@{%
+ \ifnum ##2=\c@taburow
+ \definecolorseries{tabu@rcseries@\the\tabu@nested}{rgb}{last}{##3}{##4}\fi
+ \ifnum \c@taburow<##2 \else
+ \ifnum \tabu@modulo {\c@taburow-##2}{##1+1}=\z@
+ \resetcolorseries[{##1}]{tabu@rcseries@\the\tabu@nested}\fi
+ \xglobal\colorlet{tabu@rc@\the\tabu@nested}{tabu@rcseries@\the\tabu@nested!!+}%
+ \rowcolor{tabu@rc@\the\tabu@nested}\fi}%
+ }\edef\x{\noexpand\tabu@rc@ {\the\count@}
+ {\the\tabu@start}
+ {\tabu@temp}
+ {\@tempa}%
+ }\x
+ \toks@\expandafter{\expandafter\def\expandafter\tabu@rc@\expandafter{\tabu@rc@}}%
+ \toks@\expandafter{\the\toks@ \let\tabu@rc@L \tabu@rc@ \ignorespaces}%
+ \else % inside \noalign
+ \definecolorseries{tabu@rcseries@\the\tabu@nested}{rgb}{last}{\tabu@temp}{\@tempa}%
+ \expandafter\resetcolorseries\expandafter[\the\count@]{tabu@rcseries@\the\tabu@nested}%
+ \xglobal\colorlet{tabu@rc@\the\tabu@nested}{tabu@rcseries@\the\tabu@nested!!+}%
+ \let\noalign \relax \rowcolor{tabu@rc@\the\tabu@nested}%
+ \def\tabu@rc@ ##1##2{\gdef\tabu@rc@{%
+ \ifnum \tabu@modulo {\c@taburow-##2}{##1+1}=\@ne
+ \resetcolorseries[{##1}]{tabu@rcseries@\the\tabu@nested}\fi
+ \xglobal\colorlet{tabu@rc@\the\tabu@nested}{tabu@rcseries@\the\tabu@nested!!+}%
+ \rowcolor{tabu@rc@\the\tabu@nested}}%
+ }\edef\x{\noexpand\tabu@rc@{\the\count@}{\the\c@taburow}}\x
+ \global\let\tabu@rc@G \tabu@rc@
+ \fi
+ \fi
+ \tabu@everyrow@egroup
+}% \tabu@rowcolorseries
+\tabuDisableCommands {\let\tabu@rc@ \@empty }
+\def\tabu@rowcolorserieserror {\PackageError{tabu}
+ {Invalid syntax for \string\taburowcolors
+ \MessageBreak Please look at the documentation!}\@ehd
+}% \tabu@rowcolorserieserror
+\newcommand*\tabureset {%
+ \tabulinesep=\z@ \extrarowsep=\z@ \extratabsurround=\z@
+ \tabulinestyle{}\everyrow{}\taburulecolor||{}\taburowcolors{}%
+}% \tabureset
+%% Parsing the line styles ------------------------------------------
+\def\tabu@getline #1{\begingroup
+ \csname \ifcsname if@safe@actives\endcsname % <babel>
+ @safe@activestrue\else
+ relax\fi \endcsname
+ \edef\tabu@temp{#1}\tabu@sanitizearg{#1}\@tempa
+ \let\tabu@thestyle \relax
+ \ifcsname tabu@linestyle@\@tempa \endcsname
+ \edef\tabu@thestyle{\endgroup
+ \def\tabu@thestyle{\expandafter\noexpand
+ \csname tabu@linestyle@\@tempa\endcsname}%
+ }\tabu@thestyle
+ \else \expandafter\tabu@definestyle \tabu@temp \@nil
+ \fi
+}% \tabu@getline
+\def\tabu@definestyle #1#2\@nil {\endlinechar \m@ne \makeatletter
+ \tabu@thick \maxdimen \tabu@on \maxdimen \tabu@off \maxdimen
+ \let\tabu@c@lon \@undefined \let\tabu@c@loff \@undefined
+ \ifodd 1\ifcat .#1\else\ifcat\relax #1\else 0\fi\fi % catcode 12 or non expandable cs
+ \def\tabu@temp{\tabu@getparam{thick}}%
+ \else \def\tabu@temp{\tabu@getparam{thick}\maxdimen}%
+ \fi
+ {%
+ \let\tabu@ \relax
+ \def\:{\obeyspaces \tabu@oXIII \tabu@commaXIII \edef\:}% (space active \: happy ;-))
+ \scantokens{\:{\tabu@temp #1#2 \tabu@\tabu@}}%
+ \expandafter}\expandafter
+ \def\expandafter\:\expandafter{\:}% line spec rewritten now ;-)
+ \def\;{\def\:}%
+ \scantokens\expandafter{\expandafter\;\expandafter{\:}}% space is now inactive (catcode 10)
+ \let\tabu@ \tabu@getcolor \:% all arguments are ready now ;-)
+ \ifdefined\tabu@c@lon \else \let\tabu@c@lon\@empty \fi
+ \ifx \tabu@c@lon\@empty \def\tabu@c@lon{\CT@arc@}\fi
+ \ifdefined\tabu@c@loff \else \let\tabu@c@loff \@empty \fi
+ \ifdim \tabu@on=\maxdimen \ifdim \tabu@off<\maxdimen
+ \tabu@on \tabulineon \fi\fi
+ \ifdim \tabu@off=\maxdimen \ifdim \tabu@on<\maxdimen
+ \tabu@off \tabulineoff \fi\fi
+ \ifodd 1\ifdim \tabu@off=\maxdimen \ifdim \tabu@on=\maxdimen 0 \fi\fi
+ \in@true % <leaders>
+ \else \in@false % <rule>
+ \fi
+ \ifdim\tabu@thick=\maxdimen \def\tabu@thick{\arrayrulewidth}%
+ \else \edef\tabu@thick{\the\tabu@thick}%
+ \fi
+ \edef \tabu@thestyle ##1##2{\endgroup
+ \def\tabu@thestyle{%
+ \ifin@ \noexpand\tabu@leadersstyle {\tabu@thick}
+ {\the\tabu@on}{##1}
+ {\the\tabu@off}{##2}%
+ \else \noexpand\tabu@rulesstyle
+ {##1\vrule width \tabu@thick}%
+ {##1\leaders \hrule height \tabu@thick \hfil}%
+ \fi}%
+ }\expandafter \expandafter
+ \expandafter \tabu@thestyle \expandafter
+ \expandafter \expandafter
+ {\expandafter\tabu@c@lon\expandafter}\expandafter{\tabu@c@loff}%
+}% \tabu@definestyle
+{\catcode`\O=\active \lccode`\O=`\o \catcode`\,=\active
+ \lowercase{\gdef\tabu@oXIII {\catcode`\o=\active \let O=\tabu@oxiii}}
+ \gdef\tabu@commaXIII {\catcode`\,=\active \let ,=\space}
+}% \catcode
+\def\tabu@oxiii #1{%
+ \ifcase \ifx n#1\z@ \else
+ \ifx f#1\@ne\else
+ \tw@ \fi\fi
+ \expandafter\tabu@onxiii
+ \or \expandafter\tabu@ofxiii
+ \else o%
+ \fi#1}%
+\def\tabu@onxiii #1#2{%
+ \ifcase \ifx !#2\tw@ \else
+ \ifcat.\noexpand#2\z@ \else
+ \ifx \tabu@spxiii#2\@ne\else
+ \tw@ \fi\fi\fi
+ \tabu@getparam{on}#2\expandafter\@gobble
+ \or \expandafter\tabu@onxiii % (space is active)
+ \else o\expandafter\@firstofone
+ \fi{#1#2}}%
+\def\tabu@ofxiii #1#2{%
+ \ifx #2f\expandafter\tabu@offxiii
+ \else o\expandafter\@firstofone
+ \fi{#1#2}}
+\def\tabu@offxiii #1#2{%
+ \ifcase \ifx !#2\tw@ \else
+ \ifcat.\noexpand#2\z@ \else
+ \ifx\tabu@spxiii#2\@ne \else
+ \tw@ \fi\fi\fi
+ \tabu@getparam{off}#2\expandafter\@gobble
+ \or \expandafter\tabu@offxiii % (space is active)
+ \else o\expandafter\@firstofone
+ \fi{#1#2}}
+\def\tabu@getparam #1{\tabu@ \csname tabu@#1\endcsname=}
+\def\tabu@getcolor #1{% \tabu@ <- \tabu@getcolor after \edef
+ \ifx \tabu@#1\else % no more spec
+ \let\tabu@theparam=#1\afterassignment \tabu@getc@l@r #1\fi
+}% \tabu@getcolor
+\def\tabu@getc@l@r #1\tabu@ {%
+ \def\tabu@temp{#1}\tabu@strtrim \tabu@temp
+ \ifx \tabu@temp\@empty
+ \else%\ifcsname \string\color@\tabu@temp \endcsname % if the color exists
+ \ifx \tabu@theparam \tabu@off \let\tabu@c@loff \tabu@c@l@r
+ \else \let\tabu@c@lon \tabu@c@l@r
+ \fi
+ %\else \tabu@warncolour{\tabu@temp}%
+ \fi%\fi
+ \tabu@ % next spec
+}% \tabu@getc@l@r
+\def\tabu@warncolour #1{\PackageWarning{tabu}
+ {Color #1 is not defined. Default color used}%
+}% \tabu@warncolour
+\def\tabu@leadersstyle #1#2#3#4#5{\def\tabu@leaders{{#1}{#2}{#3}{#4}{#5}}%
+ \ifx \tabu@leaders\tabu@leaders@G \else
+ \tabu@LEADERS{#1}{#2}{#3}{#4}{#5}\fi
+}% \tabu@leadersstyle
+\def\tabu@rulesstyle #1#2{\let\tabu@leaders \@undefined
+ \gdef\tabu@thevrule{#1}\gdef\tabu@thehrule{#2}%
+}% \tabu@rulesstyle
+%% The leaders boxes ------------------------------------------------
+\def\tabu@LEADERS #1#2#3#4#5{%% width, dash, dash color, gap, gap color
+ {\let\color \tabu@color % => during trials -> \color = \tabu@nocolor
+ {% % but the leaders boxes should have colors !
+ \def\@therule{\vrule}\def\@thick{height}\def\@length{width}%
+ \def\@box{\hbox}\def\@unbox{\unhbox}\def\@elt{\wd}%
+ \def\@skip{\hskip}\def\@ss{\hss}\def\tabu@leads{\tabu@hleads}%
+ \tabu@l@@d@rs {#1}{#2}{#3}{#4}{#5}%
+ \global\let\tabu@thehleaders \tabu@theleaders
+ }%
+ {%
+ \def\@therule{\hrule}\def\@thick{width}\def\@length{height}%
+ \def\@box{\vbox}\def\@unbox{\unvbox}\def\@elt{\ht}%
+ \def\@skip{\vskip}\def\@ss{\vss}\def\tabu@leads{\tabu@vleads}%
+ \tabu@l@@d@rs {#1}{#2}{#3}{#4}{#5}%
+ \global\let\tabu@thevleaders \tabu@theleaders
+ }%
+ \gdef\tabu@leaders@G{{#1}{#2}{#3}{#4}{#5}}%
+ }%
+}% \tabu@LEADERS
+\def\tabu@therule #1#2{\@therule \@thick#1\@length\dimexpr#2/2 \@depth\z@}
+\def\tabu@l@@d@rs #1#2#3#4#5{%% width, dash, dash color, gap, gap color
+ \global\setbox \tabu@leads=\@box{%
+ {#3\tabu@therule{#1}{#2}}%
+ \ifx\\#5\\\@skip#4\else{#5\tabu@therule{#1}{#4*2}}\fi
+ {#3\tabu@therule{#1}{#2}}}%
+ \global\setbox\tabu@leads=\@box to\@elt\tabu@leads{\@ss
+ {#3\tabu@therule{#1}{#2}}\@unbox\tabu@leads}%
+ \edef\tabu@theleaders ##1{\def\noexpand\tabu@theleaders {%
+ {##1\tabu@therule{#1}{#2}}%
+ \xleaders \copy\tabu@leads \@ss
+ \tabu@therule{0pt}{-#2}{##1\tabu@therule{#1}{#2}}}%
+ }\tabu@theleaders{#3}%
+}% \tabu@l@@d@rs
+%% \tabu \endtabu \tabu* \longtabu \endlongtabu \longtabu* ----------
+\newcommand*\tabu {\tabu@longfalse
+ \ifmmode \def\tabu@ {\array}\def\endtabu {\endarray}%
+ \else \def\tabu@ {\tabu@tabular}\def\endtabu {\endtabular}\fi
+ \expandafter\let\csname tabu*\endcsname \tabu
+ \expandafter\def\csname endtabu*\endcsname{\endtabu}%
+ \tabu@spreadfalse \tabu@negcoeffalse \tabu@settarget
+}% {tabu}
+\let\tabu@tabular \tabular % <For LyX: some users redefine \tabular...>
+\expandafter\def\csname tabu*\endcsname{\tabuscantokenstrue \tabu}
+\newcommand*\longtabu {\tabu@longtrue
+ \ifmmode\PackageError{tabu}{longtabu not allowed in math mode}\fi
+ \def\tabu@{\longtable}\def\endlongtabu{\endlongtable}%
+ \LTchunksize=\@M
+ \expandafter\let\csname tabu*\endcsname \tabu
+ \expandafter\def\csname endlongtabu*\endcsname{\endlongtabu}%
+ \let\LT@startpbox \tabu@LT@startpbox % \everypar{ array struts }
+ \tabu@spreadfalse \tabu@negcoeffalse \tabu@settarget
+}% {longtabu}
+\expandafter\def\csname longtabu*\endcsname{\tabuscantokenstrue \longtabu}
+\def\tabu@nolongtabu{\PackageError{tabu}
+ {longtabu requires the longtable package}\@ehd}
+%% Read the target and then : \tabular or \@array ------------------
+\def\tabu@settarget {\futurelet\@let@token \tabu@sett@rget }
+\def\tabu@sett@rget {\tabu@target \z@
+ \ifcase \ifx \bgroup\@let@token \z@ \else
+ \ifx \@sptoken\@let@token \@ne \else
+ \if t\@let@token \tw@ \else
+ \if s\@let@token \thr@@\else
+ \z@\fi\fi\fi\fi
+ \expandafter\tabu@begin
+ \or \expandafter\tabu@gobblespace\expandafter\tabu@settarget
+ \or \expandafter\tabu@to
+ \or \expandafter\tabu@spread
+ \fi
+}% \tabu@sett@rget
+\def\tabu@to to{\def\tabu@halignto{to}\tabu@gettarget}
+\def\tabu@spread spread{\tabu@spreadtrue\def\tabu@halignto{spread}\tabu@gettarget}
+\def\tabu@gettarget {\afterassignment\tabu@linegoaltarget \tabu@target }
+\def\tabu@linegoaltarget {\futurelet\tabu@temp \tabu@linegoalt@rget }
+\def\tabu@linegoalt@rget {%
+ \ifx \tabu@temp\LNGL@setlinegoal
+ \LNGL@setlinegoal \expandafter \@firstoftwo \fi % @gobbles \LNGL@setlinegoal
+ \tabu@begin
+}% \tabu@linegoalt@rget
+\def\tabu@begin #1#{%
+ \iftabu@measuring \expandafter\tabu@nestedmeasure \fi
+ \ifdim \tabu@target=\z@ \let\tabu@halignto \@empty
+ \else \edef\tabu@halignto{\tabu@halignto\the\tabu@target}%
+ \fi
+ \@testopt \tabu@tabu@ \tabu@aligndefault #1\@nil
+}% \tabu@begin
+\long\def\tabu@tabu@ [#1]#2\@nil #3{\tabu@setup
+ \def\tabu@align {#1}\def\tabu@savedpream{\NC@find #3}%
+ \tabu@ [\tabu@align ]#2{#3\tabu@rewritefirst }%
+}% \tabu@tabu@
+\def\tabu@nestedmeasure {%
+ \ifodd 1\iftabu@spread \else \ifdim\tabu@target=\z@ \else 0 \fi\fi\relax
+ \tabu@spreadtrue
+ \else \begingroup \iffalse{\fi \ifnum0=`}\fi
+ \toks@{}\def\tabu@stack{b}%
+ \expandafter\tabu@collectbody\expandafter\tabu@quickrule
+ \expandafter\endgroup
+ \fi
+}% \tabu@nestedmeasure
+\def\tabu@quickrule {\indent\vrule height\z@ depth\z@ width\tabu@target}
+%% \tabu@setup \tabu@init \tabu@indent
+\def\tabu@setup{\tabu@alloc@
+ \ifcase \tabu@nested
+ \ifmmode \else \iftabu@spread\else \ifdim\tabu@target=\z@
+ \let\tabu@afterendpar \par
+ \fi\fi\fi
+ \def\tabu@aligndefault{c}\tabu@init \tabu@indent
+ \else % <nested tabu>
+ \def\tabu@aligndefault{t}\let\tabudefaulttarget \linewidth
+ \fi
+ \let\tabu@thetarget \tabudefaulttarget \let\tabu@restored \@undefined
+ \edef\tabu@NC@list{\the\NC@list}\NC@list{\NC@do \tabu@rewritefirst}%
+ \everycr{}\let\@startpbox \tabu@startpbox % for nested tabu inside longtabu...
+ \let\@endpbox \tabu@endpbox % idem " " " " " "
+ \let\@tabarray \tabu@tabarray % idem " " " " " "
+ \tabu@setcleanup \tabu@setreset
+}% \tabu@setup
+\def\tabu@init{\tabu@starttimer \tabu@measuringfalse
+ \edef\tabu@hfuzz {\the\dimexpr\hfuzz+1sp}\global\tabu@footnotes{}%
+ \let\firsthline \tabu@firsthline \let\lasthline \tabu@lasthline
+ \let\firstline \tabu@firstline \let\lastline \tabu@lastline
+ \let\hline \tabu@hline \let\@xhline \tabu@xhline
+ \let\color \tabu@color \let\@arstrutbox \tabu@arstrutbox
+ \iftabu@colortbl\else\let\LT@@hline \tabu@LT@@hline \fi
+ \tabu@trivlist %<restore \\=\@normalcr inside lists>
+ \let\@footnotetext \tabu@footnotetext \let\@xfootnotetext \tabu@xfootnotetext
+ \let\@xfootnote \tabu@xfootnote \let\centering \tabu@centering
+ \let\raggedright \tabu@raggedright \let\raggedleft \tabu@raggedleft
+ \let\tabudecimal \tabu@tabudecimal \let\Centering \tabu@Centering
+ \let\RaggedRight \tabu@RaggedRight \let\RaggedLeft \tabu@RaggedLeft
+ \let\justifying \tabu@justifying \let\rowfont \tabu@rowfont
+ \let\fbox \tabu@fbox \let\color@b@x \tabu@color@b@x
+ \let\tabu@@everycr \everycr \let\tabu@@everypar \everypar
+ \let\tabu@prepnext@tokORI \prepnext@tok\let\prepnext@tok \tabu@prepnext@tok
+ \let\tabu@multicolumnORI\multicolumn \let\multicolumn \tabu@multicolumn
+ \let\tabu@startpbox \@startpbox % for nested tabu inside longtabu pfff !!!
+ \let\tabu@endpbox \@endpbox % idem " " " " " " "
+ \let\tabu@tabarray \@tabarray % idem " " " " " " "
+ \tabu@adl@fix \let\endarray \tabu@endarray % <fix> colortbl & arydshln (delarray)
+ \iftabu@colortbl\CT@everycr\expandafter{\expandafter\iftabu@everyrow \the\CT@everycr \fi}\fi
+}% \tabu@init
+\def\tabu@indent{% correction for indentation
+ \ifdim \parindent>\z@\ifx \linewidth\tabudefaulttarget
+ \everypar\expandafter{%
+ \the\everypar\everypar\expandafter{\the\everypar}%
+ \setbox\z@=\lastbox
+ \ifdim\wd\z@>\z@ \edef\tabu@thetarget
+ {\the\dimexpr -\wd\z@+\tabudefaulttarget}\fi
+ \box\z@}%
+ \fi\fi
+}% \tabu@indent
+\def\tabu@setcleanup {% saves last global assignments
+ \ifodd 1\ifmmode \else \iftabu@long \else 0\fi\fi\relax
+ \def\tabu@aftergroupcleanup{%
+ \def\tabu@aftergroupcleanup{\aftergroup\tabu@cleanup}}%
+ \else
+ \def\tabu@aftergroupcleanup{%
+ \aftergroup\aftergroup\aftergroup\tabu@cleanup
+ \let\tabu@aftergroupcleanup \relax}%
+ \fi
+ \let\tabu@arc@Gsave \tabu@arc@G
+ \let\tabu@arc@G \tabu@arc@L % <init>
+ \let\tabu@drsc@Gsave \tabu@drsc@G
+ \let\tabu@drsc@G \tabu@drsc@L % <init>
+ \let\tabu@ls@Gsave \tabu@ls@G
+ \let\tabu@ls@G \tabu@ls@L % <init>
+ \let\tabu@rc@Gsave \tabu@rc@G
+ \let\tabu@rc@G \tabu@rc@L % <init>
+ \let\tabu@evr@Gsave \tabu@evr@G
+ \let\tabu@evr@G \tabu@evr@L % <init>
+ \let\tabu@celllalign@save \tabu@celllalign
+ \let\tabu@cellralign@save \tabu@cellralign
+ \let\tabu@cellleft@save \tabu@cellleft
+ \let\tabu@cellright@save \tabu@cellright
+ \let\tabu@@celllalign@save \tabu@@celllalign
+ \let\tabu@@cellralign@save \tabu@@cellralign
+ \let\tabu@@cellleft@save \tabu@@cellleft
+ \let\tabu@@cellright@save \tabu@@cellright
+ \let\tabu@rowfontreset@save \tabu@rowfontreset
+ \let\tabu@@rowfontreset@save\tabu@@rowfontreset
+ \let\tabu@rowfontreset \@empty
+ \edef\tabu@alloc@save {\the\tabu@alloc}% restore at \tabu@reset
+ \edef\c@taburow@save {\the\c@taburow}%
+ \edef\tabu@naturalX@save {\the\tabu@naturalX}%
+ \let\tabu@naturalXmin@save \tabu@naturalXmin
+ \let\tabu@naturalXmax@save \tabu@naturalXmax
+ \let\tabu@mkarstrut@save \tabu@mkarstrut
+ \edef\tabu@clarstrut{%
+ \extrarowheight \the\dimexpr \ht\@arstrutbox-\ht\strutbox \relax
+ \extrarowdepth \the\dimexpr \dp\@arstrutbox-\dp\strutbox \relax
+ \let\noexpand\@arraystretch \@ne \noexpand\tabu@rearstrut}%
+}% \tabu@setcleanup
+\def\tabu@cleanup {\begingroup
+ \globaldefs\@ne \tabu@everyrowtrue
+ \let\tabu@arc@G \tabu@arc@Gsave
+ \let\CT@arc@ \tabu@arc@G
+ \let\tabu@drsc@G \tabu@drsc@Gsave
+ \let\CT@drsc@ \tabu@drsc@G
+ \let\tabu@ls@G \tabu@ls@Gsave
+ \let\tabu@ls@ \tabu@ls@G
+ \let\tabu@rc@G \tabu@rc@Gsave
+ \let\tabu@rc@ \tabu@rc@G
+ \let\CT@do@color \relax
+ \let\tabu@evr@G \tabu@evr@Gsave
+ \let\tabu@celllalign \tabu@celllalign@save
+ \let\tabu@cellralign \tabu@cellralign@save
+ \let\tabu@cellleft \tabu@cellleft@save
+ \let\tabu@cellright \tabu@cellright@save
+ \let\tabu@@celllalign \tabu@@celllalign@save
+ \let\tabu@@cellralign \tabu@@cellralign@save
+ \let\tabu@@cellleft \tabu@@cellleft@save
+ \let\tabu@@cellright \tabu@@cellright@save
+ \let\tabu@rowfontreset \tabu@rowfontreset@save
+ \let\tabu@@rowfontreset \tabu@@rowfontreset@save
+ \tabu@naturalX =\tabu@naturalX@save
+ \let\tabu@naturalXmax \tabu@naturalXmax@save
+ \let\tabu@naturalXmin \tabu@naturalXmin@save
+ \let\tabu@mkarstrut \tabu@mkarstrut@save
+ \c@taburow =\c@taburow@save
+ \ifcase \tabu@nested \tabu@alloc \m@ne\fi
+ \endgroup % <end of \globaldefs>
+ \ifcase \tabu@nested
+ \the\tabu@footnotes \global\tabu@footnotes{}%
+ \tabu@afterendpar \tabu@elapsedtime
+ \fi
+ \tabu@clarstrut
+ \everyrow\expandafter {\tabu@evr@G}%
+}% \tabu@cleanup
+\let\tabu@afterendpar \relax
+\def\tabu@setreset {%
+ \edef\tabu@savedparams {% \relax for \tabu@message@save
+ \ifmmode \col@sep \the\arraycolsep
+ \else \col@sep \the\tabcolsep \fi \relax
+ \arrayrulewidth \the\arrayrulewidth \relax
+ \doublerulesep \the\doublerulesep \relax
+ \extratabsurround \the\extratabsurround \relax
+ \extrarowheight \the\extrarowheight \relax
+ \extrarowdepth \the\extrarowdepth \relax
+ \abovetabulinesep \the\abovetabulinesep \relax
+ \belowtabulinesep \the\belowtabulinesep \relax
+ \def\noexpand\arraystretch{\arraystretch}%
+ \ifdefined\minrowclearance \minrowclearance\the\minrowclearance\relax\fi}%
+ \begingroup
+ \@temptokena\expandafter{\tabu@savedparams}% => only for \savetabu / \usetabu
+ \ifx \tabu@arc@L\relax \else \tabu@setsave \tabu@arc@L \fi
+ \ifx \tabu@drsc@L\relax \else \tabu@setsave \tabu@drsc@L \fi
+ \tabu@setsave \tabu@ls@L \tabu@setsave \tabu@evr@L
+ \expandafter \endgroup \expandafter
+ \def\expandafter\tabu@saved@ \expandafter{\the\@temptokena
+ \let\tabu@arc@G \tabu@arc@L
+ \let\tabu@drsc@G \tabu@drsc@L
+ \let\tabu@ls@G \tabu@ls@L
+ \let\tabu@rc@G \tabu@rc@L
+ \let\tabu@evr@G \tabu@evr@L}%
+ \def\tabu@reset{\tabu@savedparams
+ \tabu@everyrowtrue \c@taburow \z@
+ \let\CT@arc@ \tabu@arc@L
+ \let\CT@drsc@ \tabu@drsc@L
+ \let\tabu@ls@ \tabu@ls@L
+ \let\tabu@rc@ \tabu@rc@L
+ \global\tabu@alloc \tabu@alloc@save
+ \everyrow\expandafter{\tabu@evr@L}}%
+}% \tabu@reset
+\def\tabu@setsave #1{\expandafter\tabu@sets@ve #1\@nil{#1}}
+\long\def\tabu@sets@ve #1\@nil #2{\@temptokena\expandafter{\the\@temptokena \def#2{#1}}}
+%% The Rewriting Process -------------------------------------------
+\def\tabu@newcolumntype #1{%
+ \expandafter\tabu@new@columntype
+ \csname NC@find@\string#1\expandafter\endcsname
+ \csname NC@rewrite@\string#1\endcsname
+ {#1}%
+}% \tabu@newcolumntype
+\def\tabu@new@columntype #1#2#3{%
+ \def#1##1#3{\NC@{##1}}%
+ \let#2\relax \newcommand*#2%
+}% \tabu@new@columntype
+\def\tabu@privatecolumntype #1{%
+ \expandafter\tabu@private@columntype
+ \csname NC@find@\string#1\expandafter\endcsname
+ \csname NC@rewrite@\string#1\expandafter\endcsname
+ \csname tabu@NC@find@\string#1\expandafter\endcsname
+ \csname tabu@NC@rewrite@\string#1\endcsname
+ {#1}%
+}% \tabu@privatecolumntype
+\def\tabu@private@columntype#1#2#3#4{%
+ \g@addto@macro\tabu@privatecolumns{\let#1#3\let#2#4}%
+ \tabu@new@columntype#3#4%
+}% \tabu@private@columntype
+\let\tabu@privatecolumns \@empty
+\newcommand*\tabucolumn [1]{\expandafter \def \expandafter
+ \tabu@highprioritycolumns\expandafter{\tabu@highprioritycolumns
+ \NC@do #1}}%
+\let\tabu@highprioritycolumns \@empty
+%% The | ``column'' : rewriting process --------------------------
+\tabu@privatecolumntype |{\tabu@rewritevline}
+\newcommand*\tabu@rewritevline[1][]{\tabu@vlinearg{#1}%
+ \expandafter \NC@find \tabu@rewritten}
+\def\tabu@lines #1{%
+ \ifx|#1\else \tabu@privatecolumntype #1{\tabu@rewritevline}\fi
+ \NC@list\expandafter{\the\NC@list \NC@do #1}%
+}% \tabu@lines@
+\def\tabu@vlinearg #1{%
+ \ifx\\#1\\\def\tabu@thestyle {\tabu@ls@}%
+ \else\tabu@getline {#1}%
+ \fi
+ \def\tabu@rewritten ##1{\def\tabu@rewritten{!{##1\tabu@thevline}}%
+ }\expandafter\tabu@rewritten\expandafter{\tabu@thestyle}%
+ \expandafter \tabu@keepls \tabu@thestyle \@nil
+}% \tabu@vlinearg
+\def\tabu@keepls #1\@nil{%
+ \ifcat $\@cdr #1\@nil $%
+ \ifx \relax#1\else
+ \ifx \tabu@ls@#1\else
+ \let#1\relax
+ \xdef\tabu@mkpreambuffer{\tabu@mkpreambuffer
+ \tabu@savels\noexpand#1}\fi\fi\fi
+}% \tabu@keepls
+\def\tabu@thevline {\begingroup
+ \ifdefined\tabu@leaders
+ \setbox\@tempboxa=\vtop to\dimexpr
+ \ht\@arstrutbox+\dp\@arstrutbox{{\tabu@thevleaders}}%
+ \ht\@tempboxa=\ht\@arstrutbox \dp\@tempboxa=\dp\@arstrutbox
+ \box\@tempboxa
+ \else
+ \tabu@thevrule
+ \fi \endgroup
+}% \tabu@thevline
+\def\tabu@savels #1{%
+ \expandafter\let\csname\string#1\endcsname #1%
+ \expandafter\def\expandafter\tabu@reset\expandafter{\tabu@reset
+ \tabu@resetls#1}}%
+\def\tabu@resetls #1{\expandafter\let\expandafter#1\csname\string#1\endcsname}%
+%% \multicolumn inside tabu environment -----------------------------
+\tabu@newcolumntype \tabu@rewritemulticolumn{%
+ \aftergroup \tabu@endrewritemulticolumn % after \@mkpream group
+ \NC@list{\NC@do *}\tabu@textbar \tabu@lines
+ \tabu@savedecl
+ \tabu@privatecolumns
+ \NC@list\expandafter{\the\expandafter\NC@list \tabu@NC@list}%
+ \let\tabu@savels \relax
+ \NC@find
+}% \tabu@rewritemulticolumn
+\def\tabu@endrewritemulticolumn{\gdef\tabu@mkpreambuffer{}\endgroup}
+\def\tabu@multicolumn{\tabu@ifenvir \tabu@multic@lumn \tabu@multicolumnORI}
+\long\def\tabu@multic@lumn #1#2#3{\multispan{#1}\begingroup
+ \tabu@everyrowtrue
+ \NC@list{\NC@do \tabu@rewritemulticolumn}%
+ \expandafter\@gobbletwo % gobbles \multispan{#1}
+ \tabu@multicolumnORI{#1}{\tabu@rewritemulticolumn #2}%
+ {\iftabuscantokens \tabu@rescan \else \expandafter\@firstofone \fi
+ {#3}}%
+}% \tabu@multic@lumn
+%% The X column(s): rewriting process -----------------------------
+\tabu@privatecolumntype X[1][]{\begingroup \tabu@siunitx{\endgroup \tabu@rewriteX {#1}}}
+\def\tabu@nosiunitx #1{#1{}{}\expandafter \NC@find \tabu@rewritten }
+\def\tabu@siunitx #1{\@ifnextchar \bgroup
+ {\tabu@rewriteX@Ss{#1}}
+ {\tabu@nosiunitx{#1}}}
+\def\tabu@rewriteX@Ss #1#2{\@temptokena{}%
+ \@defaultunits \let\tabu@temp =#2\relax\@nnil
+ \ifodd 1\ifx S\tabu@temp \else \ifx s\tabu@temp \else 0 \fi\fi
+ \def\NC@find{\def\NC@find >####1####2<####3\relax{#1 {####1}{####3}%
+ }\expandafter\NC@find \the\@temptokena \relax
+ }\expandafter\NC@rewrite@S \@gobble #2\relax
+ \else \tabu@siunitxerror
+ \fi
+ \expandafter \NC@find \tabu@rewritten
+}% \tabu@rewriteX@Ss
+\def\tabu@siunitxerror {\PackageError{tabu}{Not a S nor s column !
+ \MessageBreak X column can only embed siunitx S or s columns}\@ehd
+}% \tabu@siunitxerror
+\def\tabu@rewriteX #1#2#3{\tabu@Xarg {#1}{#2}{#3}%
+ \iftabu@measuring
+ \else \tabu@measuringtrue % first X column found in the preamble
+ \let\@halignto \relax \let\tabu@halignto \relax
+ \iftabu@spread \tabu@spreadtarget \tabu@target \tabu@target \z@
+ \else \tabu@spreadtarget \z@ \fi
+ \ifdim \tabu@target=\z@
+ \setlength\tabu@target \tabu@thetarget
+ \tabu@message{\tabu@message@defaulttarget}%
+ \else \tabu@message{\tabu@message@target}\fi
+ \fi
+}% \tabu@rewriteX
+\def\tabu@rewriteXrestore #1#2#3{\let\@halignto \relax
+ \def\tabu@rewritten{l}}
+\def\tabu@Xarg #1#2#3{%
+ \advance\tabu@Xcol \@ne \let\tabu@Xlcr \@empty
+ \let\tabu@Xdisp \@empty \let\tabu@Xmath \@empty
+ \ifx\\#1\\% <shortcut when no option>
+ \def\tabu@rewritten{p}\tabucolX \p@ % <default coef = 1>
+ \else
+ \let\tabu@rewritten \@empty \let\tabu@temp \@empty \tabucolX \z@
+ \tabu@Xparse {}#1\relax
+ \fi
+ \tabu@Xrewritten{#2}{#3}%
+}% \tabu@Xarg
+\def\tabu@Xparse #1{\futurelet\@let@token \tabu@Xtest}
+\expandafter\def\expandafter\tabu@Xparsespace\space{\tabu@Xparse{}}
+\def\tabu@Xtest{%
+ \ifcase \ifx \relax\@let@token \z@ \else
+ \if ,\@let@token \m@ne\else
+ \if p\@let@token 1\else
+ \if m\@let@token 2\else
+ \if b\@let@token 3\else
+ \if l\@let@token 4\else
+ \if c\@let@token 5\else
+ \if r\@let@token 6\else
+ \if j\@let@token 7\else
+ \if L\@let@token 8\else
+ \if C\@let@token 9\else
+ \if R\@let@token 10\else
+ \if J\@let@token 11\else
+ \ifx \@sptoken\@let@token 12\else
+ \if .\@let@token 13\else
+ \if -\@let@token 13\else
+ \ifcat $\@let@token 14\else
+ 15\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\relax
+ \or \tabu@Xtype {p}%
+ \or \tabu@Xtype {m}%
+ \or \tabu@Xtype {b}%
+ \or \tabu@Xalign \raggedright\relax
+ \or \tabu@Xalign \centering\relax
+ \or \tabu@Xalign \raggedleft\relax
+ \or \tabu@Xalign \tabu@justify\relax
+ \or \tabu@Xalign \RaggedRight\raggedright
+ \or \tabu@Xalign \Centering\centering
+ \or \tabu@Xalign \RaggedLeft\raggedleft
+ \or \tabu@Xalign \justifying\tabu@justify
+ \or \expandafter \tabu@Xparsespace
+ \or \expandafter \tabu@Xcoef
+ \or \expandafter \tabu@Xm@th
+ \or \tabu@Xcoef{}%
+ \else\expandafter \tabu@Xparse
+ \fi
+}% \tabu@Xtest
+\def\tabu@Xalign #1#2{%
+ \ifx \tabu@Xlcr\@empty \else \PackageWarning{tabu}
+ {Duplicate horizontal alignment specification}\fi
+ \ifdefined#1\def\tabu@Xlcr{#1}\let#1\relax
+ \else \def\tabu@Xlcr{#2}\let#2\relax\fi
+ \expandafter\tabu@Xparse
+}% \tabu@Xalign
+\def\tabu@Xtype #1{%
+ \ifx \tabu@rewritten\@empty \else \PackageWarning{tabu}
+ {Duplicate vertical alignment specification}\fi
+ \def\tabu@rewritten{#1}\expandafter\tabu@Xparse
+}% \tabu@Xtype
+\def\tabu@Xcoef#1{\edef\tabu@temp{\tabu@temp#1}%
+ \afterassignment\tabu@Xc@ef \tabu@cnt\number\if-#10\fi
+}% \tabu@Xcoef
+\def\tabu@Xc@ef{\advance\tabucolX \tabu@temp\the\tabu@cnt\p@
+ \tabu@Xparse{}%
+}% \tabu@Xc@ef
+\def\tabu@Xm@th #1{\futurelet \@let@token \tabu@Xd@sp}
+\def\tabu@Xd@sp{\let\tabu@Xmath=$%
+ \ifx $\@let@token \def\tabu@Xdisp{\displaystyle}%
+ \expandafter\tabu@Xparse
+ \else \expandafter\tabu@Xparse\expandafter{\expandafter}%
+ \fi
+}% \tabu@Xd@sp
+\def\tabu@Xrewritten {%
+ \ifx \tabu@rewritten\@empty \def\tabu@rewritten{p}\fi
+ \ifdim \tabucolX<\z@ \tabu@negcoeftrue
+ \else\ifdim \tabucolX=\z@ \tabucolX \p@
+ \fi\fi
+ \edef\tabu@temp{{\the\tabu@Xcol}{\tabu@strippt\tabucolX}}%
+ \edef\tabu@Xcoefs{\tabu@Xcoefs \tabu@ \tabu@temp}%
+ \edef\tabu@rewritten ##1##2{\def\noexpand\tabu@rewritten{%
+ >{\tabu@Xlcr \ifx$\tabu@Xmath$\tabu@Xdisp\fi ##1}%
+ \tabu@rewritten {\tabu@hsize \tabu@temp}%
+ <{##2\ifx$\tabu@Xmath$\fi}}%
+ }\tabu@rewritten
+}% \tabu@Xrewritten
+\def\tabu@hsize #1#2{%
+ \ifdim #2\p@<\z@
+ \ifdim \tabucolX=\maxdimen \tabu@wd{#1}\else
+ \ifdim \tabu@wd{#1}<-#2\tabucolX \tabu@wd{#1}\else -#2\tabucolX\fi
+ \fi
+ \else #2\tabucolX
+ \fi
+}% \tabu@hsize
+%% \usetabu and \preamble: rewriting process ---------------------
+\tabu@privatecolumntype \usetabu [1]{%
+ \ifx\\#1\\\tabu@saveerr{}\else
+ \@ifundefined{tabu@saved@\string#1}
+ {\tabu@saveerr{#1}}
+ {\let\tabu@rewriteX \tabu@rewriteXrestore
+ \csname tabu@saved@\string#1\expandafter\endcsname\expandafter\@ne}%
+ \fi
+}% \NC@rewrite@\usetabu
+\tabu@privatecolumntype \preamble [1]{%
+ \ifx\\#1\\\tabu@saveerr{}\else
+ \@ifundefined{tabu@saved@\string#1}
+ {\tabu@saveerr{#1}}
+ {\csname tabu@saved@\string#1\expandafter\endcsname\expandafter\z@}%
+ \fi
+}% \NC@rewrite@\preamble
+%% Controlling the rewriting process -------------------------------
+\tabu@newcolumntype \tabu@rewritefirst{%
+ \iftabu@long \aftergroup \tabu@longpream % <the whole implementation is here !>
+ \else \aftergroup \tabu@pream
+ \fi
+ \let\tabu@ \relax \let\tabu@hsize \relax
+ \let\tabu@Xcoefs \@empty \let\tabu@savels \relax
+ \tabu@Xcol \z@ \tabu@cnt \tw@
+ \gdef\tabu@mkpreambuffer{\tabu@{}}\tabu@measuringfalse
+ \global\setbox\@arstrutbox \box\@arstrutbox
+ \NC@list{\NC@do *}\tabu@textbar \tabu@lines
+ \NC@list\expandafter{\the\NC@list \NC@do X}%
+ \iftabu@siunitx % <siunitx S and s columns>
+ \NC@list\expandafter{\the\NC@list \NC@do S\NC@do s}\fi
+ \NC@list\expandafter{\the\expandafter\NC@list \tabu@highprioritycolumns}%
+ \expandafter\def\expandafter\tabu@NC@list\expandafter{%
+ \the\expandafter\NC@list \tabu@NC@list}% % * | X S <original>
+ \NC@list\expandafter{\expandafter \NC@do \expandafter\usetabu
+ \expandafter \NC@do \expandafter\preamble
+ \the\NC@list \NC@do \tabu@rewritemiddle
+ \NC@do \tabu@rewritelast}%
+ \tabu@savedecl
+ \tabu@privatecolumns
+ \edef\tabu@prev{\the\@temptokena}\NC@find \tabu@rewritemiddle
+}% NC@rewrite@\tabu@rewritefirst
+\tabu@newcolumntype \tabu@rewritemiddle{%
+ \edef\tabu@temp{\the\@temptokena}\NC@find \tabu@rewritelast
+}% \NC@rewrite@\tabu@rewritemiddle
+\tabu@newcolumntype \tabu@rewritelast{%
+ \ifx \tabu@temp\tabu@prev \advance\tabu@cnt \m@ne
+ \NC@list\expandafter{\tabu@NC@list \NC@do \tabu@rewritemiddle
+ \NC@do \tabu@rewritelast}%
+ \else \let\tabu@prev\tabu@temp
+ \fi
+ \ifcase \tabu@cnt \expandafter\tabu@endrewrite
+ \else \expandafter\NC@find \expandafter\tabu@rewritemiddle
+ \fi
+}% \NC@rewrite@\tabu@rewritelast
+%% Choosing the strategy --------------------------------------------
+\def\tabu@endrewrite {%
+ \let\tabu@temp \NC@find
+ \ifx \@arrayright\relax \let\@arrayright \@empty \fi
+ \count@=%
+ \ifx \@finalstrut\tabu@finalstrut \z@ % outer in mode 0 print
+ \iftabu@measuring
+ \xdef\tabu@mkpreambuffer{\tabu@mkpreambuffer
+ \tabu@target \csname tabu@\the\tabu@nested.T\endcsname
+ \tabucolX \csname tabu@\the\tabu@nested.X\endcsname
+ \edef\@halignto {\ifx\@arrayright\@empty to\tabu@target\fi}}%
+ \fi
+ \else\iftabu@measuring 4 % X columns
+ \xdef\tabu@mkpreambuffer{\tabu@{\tabu@mkpreambuffer
+ \tabu@target \the\tabu@target
+ \tabu@spreadtarget \the\tabu@spreadtarget}%
+ \def\noexpand\tabu@Xcoefs{\tabu@Xcoefs}%
+ \edef\tabu@halignto{\ifx \@arrayright\@empty to\tabu@target\fi}}%
+ \let\tabu@Xcoefs \relax
+ \else\ifcase\tabu@nested \thr@@ % outer, no X
+ \global\let\tabu@afterendpar \relax
+ \else \@ne % inner, no X, outer in mode 1 or 2
+ \fi
+ \ifdefined\tabu@usetabu
+ \else \ifdim\tabu@target=\z@
+ \else \let\tabu@temp \tabu@extracolsep
+ \fi\fi
+ \fi
+ \fi
+ \xdef\tabu@mkpreambuffer{\count@ \the\count@ \tabu@mkpreambuffer}%
+ \tabu@temp
+}% \tabu@endrewrite
+\def\tabu@extracolsep{\@defaultunits \expandafter\let
+ \expandafter\tabu@temp \expandafter=\the\@temptokena \relax\@nnil
+ \ifx \tabu@temp\@sptoken
+ \expandafter\tabu@gobblespace \expandafter\tabu@extracolsep
+ \else
+ \edef\tabu@temp{\noexpand\NC@find
+ \if |\noexpand\tabu@temp @%
+ \else\if !\noexpand\tabu@temp @%
+ \else !%
+ \fi\fi
+ {\noexpand\extracolsep\noexpand\@flushglue}}%
+ \fi
+ \tabu@temp
+}% \tabu@extrac@lsep
+%% Implementing the strategy ----------------------------------------
+\long\def\tabu@pream #1\@preamble {%
+ \let\tabu@ \tabu@@ \tabu@mkpreambuffer \tabu@aftergroupcleanup
+ \NC@list\expandafter {\tabu@NC@list}% in case of nesting...
+ \ifdefined\tabu@usetabu \tabu@usetabu \tabu@target \z@ \fi
+ \let\tabu@savedpreamble \@preamble
+ \global\let\tabu@elapsedtime \relax
+ \tabu@thebody ={#1\tabu@aftergroupcleanup}%
+ \tabu@thebody =\expandafter{\the\expandafter\tabu@thebody
+ \@preamble}%
+ \edef\tabuthepreamble {\the\tabu@thebody}% ( no @ allowed for \scantokens )
+ \tabu@select
+}% \tabu@pream
+\long\def\tabu@longpream #1\LT@bchunk #2\LT@bchunk{%
+ \let\tabu@ \tabu@@ \tabu@mkpreambuffer \tabu@aftergroupcleanup
+ \NC@list\expandafter {\tabu@NC@list}% in case of nesting...
+ \let\tabu@savedpreamble \@preamble
+ \global\let\tabu@elapsedtime \relax
+ \tabu@thebody ={#1\LT@bchunk #2\tabu@aftergroupcleanup \LT@bchunk}%
+ \edef\tabuthepreamble {\the\tabu@thebody}% ( no @ allowed for \scantokens )
+ \tabu@select
+}% \tabu@longpream
+\def\tabu@select {%
+ \ifnum\tabu@nested>\z@ \tabuscantokensfalse \fi
+ \ifnum \count@=\@ne \iftabu@measuring \count@=\tw@ \fi\fi
+ \ifcase \count@
+ \global\let\tabu@elapsedtime \relax
+ \tabu@seteverycr
+ \expandafter \tabuthepreamble % vertical adjustment (inherited from outer)
+ \or % exit in vertical measure + struts per cell because no X and outer in mode 3
+ \tabu@evr{\tabu@verticalinit}\tabu@celllalign@def{\tabu@verticalmeasure}%
+ \def\tabu@cellralign{\tabu@verticalspacing}%
+ \tabu@seteverycr
+ \expandafter \tabuthepreamble
+ \or % exit without measure because no X and outer in mode 4
+ \tabu@evr{}\tabu@celllalign@def{}\let\tabu@cellralign \@empty
+ \tabu@seteverycr
+ \expandafter \tabuthepreamble
+ \else % needs trials
+ \tabu@evr{}\tabu@celllalign@def{}\let\tabu@cellralign \@empty
+ \tabu@savecounters
+ \expandafter \tabu@setstrategy
+ \fi
+}% \tabu@select
+\def\tabu@@ {\gdef\tabu@mkpreambuffer}
+%% Protections to set up before trials ------------------------------
+\def\tabu@setstrategy {\begingroup % <trials group>
+ \tabu@trialh@@k \tabu@cnt \z@ % number of trials
+ \hbadness \@M \let\hbadness \@tempcnta
+ \hfuzz \maxdimen \let\hfuzz \@tempdima
+ \let\write \tabu@nowrite\let\GenericError \tabu@GenericError
+ \let\savetabu \@gobble \let\tabudefaulttarget \linewidth
+ \let\@footnotetext \@gobble \let\@xfootnote \tabu@xfootnote
+ \let\color \tabu@nocolor\let\rowcolor \tabu@norowcolor
+ \let\tabu@aftergroupcleanup \relax % only after the last trial
+ \tabu@mkpreambuffer
+ \ifnum \count@>\thr@@ \let\@halignto \@empty \tabucolX@init
+ \def\tabu@lasttry{\m@ne\p@}\fi
+ \begingroup \iffalse{\fi \ifnum0=`}\fi
+ \toks@{}\def\tabu@stack{b}\iftabuscantokens \endlinechar=10 \obeyspaces \fi %
+ \tabu@collectbody \tabu@strategy %
+}% \tabu@setstrategy
+\def\tabu@savecounters{%
+ \def\@elt ##1{\csname c@##1\endcsname\the\csname c@##1\endcsname}%
+ \edef\tabu@clckpt {\begingroup \globaldefs=\@ne \cl@@ckpt \endgroup}\let\@elt \relax
+}% \tabu@savecounters
+\def\tabucolX@init {% \tabucolX <= \tabu@target / (sum coefs > 0)
+ \dimen@ \z@ \tabu@Xsum \z@ \tabucolX \z@ \let\tabu@ \tabu@Xinit \tabu@Xcoefs
+ \ifdim \dimen@>\z@
+ \@tempdima \dimexpr \tabu@target *\p@/\dimen@ + \tabu@hfuzz\relax
+ \ifdim \tabucolX<\@tempdima \tabucolX \@tempdima \fi
+ \fi
+}% \tabucolX@init
+\def\tabu@Xinit #1#2{\tabu@Xcol #1 \advance \tabu@Xsum
+ \ifdim #2\p@>\z@ #2\p@ \advance\dimen@ #2\p@
+ \else -#2\p@ \tabu@negcoeftrue
+ \@tempdima \dimexpr \tabu@target*\p@/\dimexpr-#2\p@\relax \relax
+ \ifdim \tabucolX<\@tempdima \tabucolX \@tempdima \fi
+ \tabu@wddef{#1}{0pt}%
+ \fi
+}% \tabu@Xinit
+%% Collecting the environment body ----------------------------------
+\long\def\tabu@collectbody #1#2\end #3{%
+ \edef\tabu@stack{\tabu@pushbegins #2\begin\end\expandafter\@gobble\tabu@stack}%
+ \ifx \tabu@stack\@empty
+ \toks@\expandafter{\expandafter\tabu@thebody\expandafter{\the\toks@ #2}%
+ \def\tabu@end@envir{\end{#3}}%
+ \iftabuscantokens
+ \iftabu@long \def\tabu@endenvir {\end{#3}\tabu@gobbleX}%
+ \else \def\tabu@endenvir {\let\endarray \@empty
+ \end{#3}\tabu@gobbleX}%
+ \fi
+ \else \def\tabu@endenvir {\end{#3}}\fi}%
+ \let\tabu@collectbody \tabu@endofcollect
+ \else\def\tabu@temp{#3}%
+ \ifx \tabu@temp\@empty \toks@\expandafter{\the\toks@ #2\end }%
+ \else \ifx\tabu@temp\tabu@@spxiii \toks@\expandafter{\the\toks@ #2\end #3}%
+ \else \ifx\tabu@temp\tabu@X \toks@\expandafter{\the\toks@ #2\end #3}%
+ \else \toks@\expandafter{\the\toks@ #2\end{#3}}%
+ \fi\fi\fi
+ \fi
+ \tabu@collectbody{#1}%
+}% \tabu@collectbody
+\long\def\tabu@pushbegins#1\begin#2{\ifx\end#2\else b\expandafter\tabu@pushbegins\fi}%
+\def\tabu@endofcollect #1{\ifnum0=`{}\fi
+ \expandafter\endgroup \the\toks@ #1%
+}% \tabu@endofcollect
+%% The trials: switching between strategies -------------------------
+\def\tabu@strategy {\relax % stops \count@ assignment !
+ \ifcase\count@ % case 0 = print with vertical adjustment (outer is finished)
+ \expandafter \tabu@endoftrials
+ \or % case 1 = exit in vertical measure (outer in mode 3)
+ \expandafter\xdef\csname tabu@\the\tabu@nested.T\endcsname{\the\tabu@target}%
+ \expandafter\xdef\csname tabu@\the\tabu@nested.X\endcsname{\the\tabucolX}%
+ \expandafter \tabu@endoftrials
+ \or % case 2 = exit with a rule replacing the table (outer in mode 4)
+ \expandafter \tabu@quickend
+ \or % case 3 = outer is in mode 3 because of no X
+ \begingroup
+ \tabu@evr{\tabu@verticalinit}\tabu@celllalign@def{\tabu@verticalmeasure}%
+ \def\tabu@cellralign{\tabu@verticalspacing}%
+ \expandafter \tabu@measuring
+ \else % case 4 = horizontal measure
+ \begingroup
+ \global\let\tabu@elapsedtime \tabu@message@etime
+ \long\def\multicolumn##1##2##3{\multispan{##1}}%
+ \let\tabu@startpboxORI \@startpbox
+ \iftabu@spread
+ \def\tabu@naturalXmax {\z@}%
+ \let\tabu@naturalXmin \tabu@naturalXmax
+ \tabu@evr{\global\tabu@naturalX \z@}%
+ \let\@startpbox \tabu@startpboxmeasure
+ \else\iftabu@negcoef
+ \let\@startpbox \tabu@startpboxmeasure
+ \else \let\@startpbox \tabu@startpboxquick
+ \fi\fi
+ \expandafter \tabu@measuring
+ \fi
+}% \tabu@strategy
+\def\tabu@measuring{\expandafter \tabu@trial \expandafter
+ \count@ \the\count@ \tabu@endtrial
+}% \tabu@measuring
+\def\tabu@trial{\iftabu@long \tabu@longtrial \else \tabu@shorttrial \fi}
+\def\tabu@shorttrial {\setbox\tabu@box \hbox\bgroup \tabu@seteverycr
+ \ifx \tabu@savecounters\relax \else
+ \let\tabu@savecounters \relax \tabu@clckpt \fi
+ $\iftabuscantokens \tabu@rescan \else \expandafter\@secondoftwo \fi
+ \expandafter{\expandafter \tabuthepreamble
+ \the\tabu@thebody
+ \csname tabu@adl@endtrial\endcsname
+ \endarray}$\egroup % got \tabu@box
+}% \tabu@shorttrial
+\def\tabu@longtrial {\setbox\tabu@box \hbox\bgroup \tabu@seteverycr
+ \ifx \tabu@savecounters\relax \else
+ \let\tabu@savecounters \relax \tabu@clckpt \fi
+ \iftabuscantokens \tabu@rescan \else \expandafter\@secondoftwo \fi
+ \expandafter{\expandafter \tabuthepreamble
+ \the\tabu@thebody
+ \tabuendlongtrial}\egroup % got \tabu@box
+}% \tabu@longtrial
+\def\tabuendlongtrial{% no @ allowed for \scantokens
+ \LT@echunk \global\setbox\@ne \hbox{\unhbox\@ne}\kern\wd\@ne
+ \LT@get@widths
+}% \tabuendlongtrial
+\def\tabu@adl@endtrial{% <arydshln in nested trials - problem for global column counters!>
+ \crcr \noalign{\global\adl@ncol \tabu@nbcols}}% anything global is crap, junky and fails !
+\def\tabu@seteverycr {\tabu@reset
+ \everycr \expandafter{\the\everycr \tabu@everycr}%
+ \let\everycr \tabu@noeverycr % <for ialign>
+}% \tabu@seteverycr
+\def\tabu@noeverycr{{\aftergroup\tabu@restoreeverycr \afterassignment}\toks@}
+\def\tabu@restoreeverycr {\let\everycr \tabu@@everycr}
+\def\tabu@everycr {\iftabu@everyrow \noalign{\tabu@everyrow}\fi}
+\def\tabu@endoftrials {%
+ \iftabuscantokens \expandafter\@firstoftwo
+ \else \expandafter\@secondoftwo
+ \fi
+ {\expandafter \tabu@closetrialsgroup \expandafter
+ \tabu@rescan \expandafter{%
+ \expandafter\tabuthepreamble
+ \the\expandafter\tabu@thebody
+ \iftabu@long \else \endarray \fi}}
+ {\expandafter\tabu@closetrialsgroup \expandafter
+ \tabuthepreamble
+ \the\tabu@thebody}%
+ \tabu@endenvir % Finish !
+}% \tabu@endoftrials
+\def\tabu@closetrialsgroup {%
+ \toks@\expandafter{\tabu@endenvir}%
+ \edef\tabu@bufferX{\endgroup
+ \tabucolX \the\tabucolX
+ \tabu@target \the\tabu@target
+ \tabu@cnt \the\tabu@cnt
+ \def\noexpand\tabu@endenvir{\the\toks@}%
+ %Quid de \@halignto = \tabu@halignto ??
+ }% \tabu@bufferX
+ \tabu@bufferX
+ \ifcase\tabu@nested % print out (outer in mode 0)
+ \global\tabu@cnt \tabu@cnt
+ \tabu@evr{\tabu@verticaldynamicadjustment}%
+ \tabu@celllalign@def{\everypar{}}\let\tabu@cellralign \@empty
+ \let\@finalstrut \tabu@finalstrut
+ \else % vertical measure of nested tabu
+ \tabu@evr{\tabu@verticalinit}%
+ \tabu@celllalign@def{\tabu@verticalmeasure}%
+ \def\tabu@cellralign{\tabu@verticalspacing}%
+ \fi
+ \tabu@clckpt \let\@halignto \tabu@halignto
+ \let\@halignto \@empty
+ \tabu@seteverycr
+ \ifdim \tabustrutrule>\z@ \ifnum\tabu@nested=\z@
+ \setbox\@arstrutbox \box\voidb@x % force \@arstrutbox to be rebuilt (visible struts)
+ \fi\fi
+}% \tabu@closetrialsgroup
+\def\tabu@quickend {\expandafter \endgroup \expandafter
+ \tabu@target \the\tabu@target \tabu@quickrule
+ \let\endarray \relax \tabu@endenvir
+}% \tabu@quickend
+\def\tabu@endtrial {\relax % stops \count@ assignment !
+ \ifcase \count@ \tabu@err % case 0 = impossible here
+ \or \tabu@err % case 1 = impossible here
+ \or \tabu@err % case 2 = impossible here
+ \or % case 3 = outer goes into mode 0
+ \def\tabu@bufferX{\endgroup}\count@ \z@
+ \else % case 4 = outer goes into mode 3
+ \iftabu@spread \tabu@spreadarith % inner into mode 1 (outer in mode 3)
+ \else \tabu@arith % or 2 (outer in mode 4)
+ \fi
+ \count@=%
+ \ifcase\tabu@nested \thr@@ % outer goes into mode 3
+ \else\iftabu@measuring \tw@ % outer is in mode 4
+ \else \@ne % outer is in mode 3
+ \fi\fi
+ \edef\tabu@bufferX{\endgroup
+ \tabucolX \the\tabucolX
+ \tabu@target \the\tabu@target}%
+ \fi
+ \expandafter \tabu@bufferX \expandafter
+ \count@ \the\count@ \tabu@strategy
+}% \tabu@endtrial
+\def\tabu@err{\errmessage{(tabu) Internal impossible error! (\count@=\the\count@)}}
+%% The algorithms: compute the widths / stop or go on ---------------
+\def\tabu@arithnegcoef {%
+ \@tempdima \z@ \dimen@ \z@ \let\tabu@ \tabu@arith@negcoef \tabu@Xcoefs
+}% \tabu@arithnegcoef
+\def\tabu@arith@negcoef #1#2{%
+ \ifdim #2\p@>\z@ \advance\dimen@ #2\p@ % saturated by definition
+ \advance\@tempdima #2\tabucolX
+ \else
+ \ifdim -#2\tabucolX <\tabu@wd{#1}% c_i X < natural width <= \tabu@target-> saturated
+ \advance\dimen@ -#2\p@
+ \advance\@tempdima -#2\tabucolX
+ \else
+ \advance\@tempdima \tabu@wd{#1}% natural width <= c_i X => neutralised
+ \ifdim \tabu@wd{#1}<\tabu@target \else % neutralised
+ \advance\dimen@ -#2\p@ % saturated (natural width = tabu@target)
+ \fi
+ \fi
+ \fi
+}% \tabu@arith@negcoef
+\def\tabu@givespace #1#2{% here \tabu@DELTA < \z@
+ \ifdim \@tempdima=\z@
+ \tabu@wddef{#1}{\the\dimexpr -\tabu@DELTA*\p@/\tabu@Xsum}%
+ \else
+ \tabu@wddef{#1}{\the\dimexpr \tabu@hsize{#1}{#2}
+ *(\p@ -\tabu@DELTA*\p@/\@tempdima)/\p@\relax}%
+ \fi
+}% \tabu@givespace
+\def\tabu@arith {\advance\tabu@cnt \@ne
+ \ifnum \tabu@cnt=\@ne \tabu@message{\tabu@titles}\fi
+ \tabu@arithnegcoef
+ \@tempdimb \dimexpr \wd\tabu@box -\@tempdima \relax % <incompressible material>
+ \tabu@DELTA = \dimexpr \wd\tabu@box - \tabu@target \relax
+ \tabu@message{\tabu@message@arith}%
+ \ifdim \tabu@DELTA <\tabu@hfuzz
+ \ifdim \tabu@DELTA<\z@ % wd (tabu)<\tabu@target ?
+ \let\tabu@ \tabu@givespace \tabu@Xcoefs
+ \advance\@tempdima \@tempdimb \advance\@tempdima -\tabu@DELTA % for message
+ \else % already converged: nothing to do but nearly impossible...
+ \fi
+ \tabucolX \maxdimen
+ \tabu@measuringfalse
+ \else % need for narrower X columns
+ \tabucolX =\dimexpr (\@tempdima -\tabu@DELTA) *\p@/\tabu@Xsum \relax
+ \tabu@measuringtrue
+ \@whilesw \iftabu@measuring\fi {%
+ \advance\tabu@cnt \@ne
+ \tabu@arithnegcoef
+ \tabu@DELTA =\dimexpr \@tempdima+\@tempdimb -\tabu@target \relax % always < 0 here
+ \tabu@message{\tabu@header
+ \tabu@msgalign \tabucolX { }{ }{ }{ }{ }\@@
+ \tabu@msgalign \@tempdima+\@tempdimb { }{ }{ }{ }{ }\@@
+ \tabu@msgalign \tabu@target { }{ }{ }{ }{ }\@@
+ \tabu@msgalign@PT \dimen@ { }{}{}{}{}{}{}\@@
+ \ifdim -\tabu@DELTA<\tabu@hfuzz \tabu@spaces target ok\else
+ \tabu@msgalign \dimexpr -\tabu@DELTA *\p@/\dimen@ {}{}{}{}{}\@@
+ \fi}%
+ \ifdim -\tabu@DELTA<\tabu@hfuzz
+ \advance\@tempdima \@tempdimb % for message
+ \tabu@measuringfalse
+ \else
+ \advance\tabucolX \dimexpr -\tabu@DELTA *\p@/\dimen@ \relax
+ \fi
+ }%
+ \fi
+ \tabu@message{\tabu@message@reached}%
+ \edef\tabu@bufferX{\endgroup \tabu@cnt \the\tabu@cnt
+ \tabucolX \the\tabucolX
+ \tabu@target \the\tabu@target}%
+}% \tabu@arith
+\def\tabu@spreadarith {%
+ \dimen@ \z@ \@tempdima \tabu@naturalXmax \let\tabu@ \tabu@spread@arith \tabu@Xcoefs
+ \edef\tabu@naturalXmin {\the\dimexpr\tabu@naturalXmin*\dimen@/\p@}%
+ \@tempdimc =\dimexpr \wd\tabu@box -\tabu@naturalXmax+\tabu@naturalXmin \relax
+ \iftabu@measuring
+ \tabu@target =\dimexpr \@tempdimc+\tabu@spreadtarget \relax
+ \edef\tabu@bufferX{\endgroup \tabucolX \the\tabucolX \tabu@target\the\tabu@target}%
+ \else
+ \tabu@message{\tabu@message@spreadarith}%
+ \ifdim \dimexpr \@tempdimc+\tabu@spreadtarget >\tabu@target
+ \tabu@message{(tabu) spread
+ \ifdim \@tempdimc>\tabu@target useless here: default target used%
+ \else too large: reduced to fit default target\fi.}%
+ \else
+ \tabu@target =\dimexpr \@tempdimc+\tabu@spreadtarget \relax
+ \tabu@message{(tabu) spread: New target set to \the\tabu@target^^J}%
+ \fi
+ \begingroup \let\tabu@wddef \@gobbletwo
+ \@tempdimb \@tempdima
+ \tabucolX@init
+ \tabu@arithnegcoef
+ \wd\tabu@box =\dimexpr \wd\tabu@box +\@tempdima-\@tempdimb \relax
+ \expandafter\endgroup \expandafter\tabucolX \the\tabucolX
+ \tabu@arith
+ \fi
+}% \tabu@spreadarith
+\def\tabu@spread@arith #1#2{%
+ \ifdim #2\p@>\z@ \advance\dimen@ #2\p@
+ \else \advance\@tempdima \tabu@wd{#1}\relax
+ \fi
+}% \tabu@spread@arith
+%% Reporting in the .log file ---------------------------------------
+\def\tabu@message@defaulttarget{%
+ \ifnum\tabu@nested=\z@^^J(tabu) Default target:
+ \ifx\tabudefaulttarget\linewidth \string\linewidth
+ \ifdim \tabu@thetarget=\linewidth \else
+ -\the\dimexpr\linewidth-\tabu@thetarget\fi =
+ \else\ifx\tabudefaulttarget\linegoal\string\linegoal=
+ \fi\fi
+ \else (tabu) Default target (nested): \fi
+ \the\tabu@target \on@line
+ \ifnum\tabu@nested=\z@ , page \the\c@page\fi}
+\def\tabu@message@target {^^J(tabu) Target specified:
+ \the\tabu@target \on@line, page \the\c@page}
+\def\tabu@message@arith {\tabu@header
+ \tabu@msgalign \tabucolX { }{ }{ }{ }{ }\@@
+ \tabu@msgalign \wd\tabu@box { }{ }{ }{ }{ }\@@
+ \tabu@msgalign \tabu@target { }{ }{ }{ }{ }\@@
+ \tabu@msgalign@PT \dimen@ { }{}{}{}{}{}{}\@@
+ \ifdim \tabu@DELTA<\tabu@hfuzz giving space\else
+ \tabu@msgalign \dimexpr (\@tempdima-\tabu@DELTA) *\p@/\tabu@Xsum -\tabucolX {}{}{}{}{}\@@
+ \fi
+}% \tabu@message@arith
+\def\tabu@message@spreadarith {\tabu@spreadheader
+ \tabu@msgalign \tabu@spreadtarget { }{ }{ }{ }{}\@@
+ \tabu@msgalign \wd\tabu@box { }{ }{ }{ }{}\@@
+ \tabu@msgalign -\tabu@naturalXmax { }{}{}{}{}\@@
+ \tabu@msgalign \tabu@naturalXmin { }{ }{ }{ }{}\@@
+ \tabu@msgalign \ifdim \dimexpr\@tempdimc>\tabu@target \tabu@target
+ \else \@tempdimc+\tabu@spreadtarget \fi
+ {}{}{}{}{}\@@}
+\def\tabu@message@negcoef #1#2{
+ \tabu@spaces\tabu@spaces\space * #1. X[\rem@pt#2]:
+ \space width = \tabu@wd {#1}
+ \expandafter\string\csname tabu@\the\tabu@nested.W\number#1\endcsname
+ \ifdim -\tabu@pt#2\tabucolX<\tabu@target
+ < \number-\rem@pt#2 X
+ = \the\dimexpr -\tabu@pt#2\tabucolX \relax
+ \else
+ <= \the\tabu@target\space < \number-\rem@pt#2 X\fi}
+\def\tabu@message@reached{\tabu@header
+ ******* Reached Target:
+ hfuzz = \tabu@hfuzz\on@line\space *******}
+\def\tabu@message@etime{\edef\tabu@stoptime{\the\pdfelapsedtime}%
+ \tabu@message{(tabu)\tabu@spaces Time elapsed during measure:
+ \the\numexpr(\tabu@stoptime-\tabu@starttime-32767)/65536\relax sec
+ \the\numexpr\numexpr(\tabu@stoptime-\tabu@starttime)
+ -\numexpr(\tabu@stoptime-\tabu@starttime-32767)/65536\relax*65536\relax
+ *1000/65536\relax ms \tabu@spaces(\the\tabu@cnt\space
+ cycle\ifnum\tabu@cnt>\@ne s\fi)^^J^^J}}
+\def\tabu@message@verticalsp {%
+ \ifdim \@tempdima>\tabu@ht
+ \ifdim \@tempdimb>\tabu@dp
+ \expandafter\expandafter\expandafter\string\tabu@ht =
+ \tabu@msgalign \@tempdima { }{ }{ }{ }{ }\@@
+ \expandafter\expandafter\expandafter\string\tabu@dp =
+ \tabu@msgalign \@tempdimb { }{ }{ }{ }{ }\@@^^J%
+ \else
+ \expandafter\expandafter\expandafter\string\tabu@ht =
+ \tabu@msgalign \@tempdima { }{ }{ }{ }{ }\@@^^J%
+ \fi
+ \else\ifdim \@tempdimb>\tabu@dp
+ \tabu@spaces\tabu@spaces\tabu@spaces
+ \expandafter\expandafter\expandafter\string\tabu@dp =
+ \tabu@msgalign \@tempdimb { }{ }{ }{ }{ }\@@^^J\fi
+ \fi
+}% \tabu@message@verticalsp
+\edef\tabu@spaces{\@spaces}
+\def\tabu@strippt{\expandafter\tabu@pt\the}
+{\@makeother\P \@makeother\T\lowercase{\gdef\tabu@pt #1PT{#1}}}
+\def\tabu@msgalign{\expandafter\tabu@msg@align\the\dimexpr}
+\def\tabu@msgalign@PT{\expandafter\tabu@msg@align\romannumeral-`\0\tabu@strippt}
+\def\do #1{%
+ \def\tabu@msg@align##1.##2##3##4##5##6##7##8##9\@@{%
+ \ifnum##1<10 #1 #1\else
+ \ifnum##1<100 #1 \else
+ \ifnum##1<\@m #1\fi\fi\fi
+ ##1.##2##3##4##5##6##7##8#1}%
+ \def\tabu@header{(tabu) \ifnum\tabu@cnt<10 #1\fi\the\tabu@cnt) }%
+ \def\tabu@titles{\ifnum \tabu@nested=\z@
+ (tabu) Try#1 #1 tabu X #1 #1 #1tabu Width #1 #1 Target
+ #1 #1 #1 Coefs #1 #1 #1 Update^^J\fi}%
+ \def\tabu@spreadheader{%
+ (tabu) Try#1 #1 Spread #1 #1 tabu Width #1 #1 #1 Nat. X #1 #1 #1 #1Nat. Min.
+ #1 New Target^^J%
+ (tabu) sprd}
+ \def\tabu@message@save {\begingroup
+ \def\x ####1{\tabu@msg@align ####1{ }{ }{ }{ }{}\@@}
+ \def\z ####1{\expandafter\x\expandafter{\romannumeral-`\0\tabu@strippt
+ \dimexpr####1\p@{ }{ }}}%
+ \let\color \relax \def\tabu@rulesstyle ####1####2{\detokenize{####1}}%
+ \let\CT@arc@ \relax \let\@preamble \@gobble
+ \let\tabu@savedpream \@firstofone
+ \let\tabu@savedparams \@firstofone
+ \def\tabu@target ####1\relax {(tabu) target #1 #1 #1 #1 #1 = \x{####1}^^J}%
+ \def\tabucolX ####1\relax {(tabu) X columns width#1 = \x{####1}^^J}%
+ \def\tabu@nbcols ####1\relax {(tabu) Number of columns: \z{####1}^^J}%
+ \def\tabu@aligndefault ####1{(tabu) Default alignment: #1 #1 ####1^^J}%
+ \def\col@sep ####1\relax {(tabu) column sep #1 #1 #1 = \x{####1}^^J}%
+ \def\arrayrulewidth ####1\relax{(tabu) arrayrulewidth #1 = \x{####1}}%
+ \def\doublerulesep ####1\relax { doublerulesep = \x{####1}^^J}%
+ \def\extratabsurround####1\relax{(tabu) extratabsurround = \x{####1}^^J}%
+ \def\extrarowheight ####1\relax{(tabu) extrarowheight #1 = \x{####1}}%
+ \def\extrarowdepth ####1\relax {extrarowdepth = \x{####1}^^J}%
+ \def\abovetabulinesep####1\relax{(tabu) abovetabulinesep=\x{####1} }%
+ \def\belowtabulinesep####1\relax{ belowtabulinesep=\x{####1}^^J}%
+ \def\arraystretch ####1{(tabu) arraystretch #1 #1 = \z{####1}^^J}%
+ \def\minrowclearance####1\relax{(tabu) minrowclearance #1 = \x{####1}^^J}%
+ \def\tabu@arc@L ####1{(tabu) taburulecolor #1 #1 = ####1^^J}%
+ \def\tabu@drsc@L ####1{(tabu) tabudoublerulecolor= ####1^^J}%
+ \def\tabu@evr@L ####1{(tabu) everyrow #1 #1 #1 #1 = \detokenize{####1}^^J}%
+ \def\tabu@ls@L ####1{(tabu) line style = \detokenize{####1}^^J}%
+ \def\NC@find ####1\@nil{(tabu) tabu preamble#1 #1 = \detokenize{####1}^^J}%
+ \def\tabu@wddef####1####2{(tabu) Natural width ####1 = \x{####2}^^J}%
+ \let\edef \@gobbletwo \let\def \@empty \let\let \@gobbletwo
+ \tabu@message{%
+ (tabu) \string\savetabu{\tabu@temp}: \on@line^^J%
+ \tabu@usetabu \@nil^^J}%
+ \endgroup}
+}\do{ }
+%% Measuring the natural width (varwidth) - store the results -------
+\def\tabu@startpboxmeasure #1{\bgroup % entering \vtop
+ \edef\tabu@temp{\expandafter\@secondoftwo \ifx\tabu@hsize #1\else\relax\fi}%
+ \ifodd 1\ifx \tabu@temp\@empty 0 \else % starts with \tabu@hsize ?
+ \iftabu@spread \else % if spread -> measure
+ \ifdim \tabu@temp\p@>\z@ 0 \fi\fi\fi% if coef>0 -> do not measure
+ \let\@startpbox \tabu@startpboxORI % restore immediately (nesting)
+ \tabu@measuringtrue % for the quick option...
+ \tabu@Xcol =\expandafter\@firstoftwo\ifx\tabu@hsize #1\fi
+ \ifdim \tabu@temp\p@>\z@ \ifdim \tabu@temp\tabucolX<\tabu@target
+ \tabu@target=\tabu@temp\tabucolX \fi\fi
+ \setbox\tabu@box \hbox \bgroup
+ \begin{varwidth}\tabu@target
+ \let\FV@ListProcessLine \tabu@FV@ListProcessLine % \hbox to natural width...
+ \narrowragged \arraybackslash \parfillskip \@flushglue
+ \ifdefined\pdfadjustspacing \pdfadjustspacing\z@ \fi
+ \bgroup \aftergroup\tabu@endpboxmeasure
+ \ifdefined \cellspacetoplimit \tabu@cellspacepatch \fi
+ \else \expandafter\@gobble
+ \tabu@startpboxquick{#1}% \@gobble \bgroup
+ \fi
+}% \tabu@startpboxmeasure
+\def\tabu@cellspacepatch{\def\bcolumn##1\@nil{}\let\ecolumn\@empty
+ \bgroup\color@begingroup}
+\def\tabu@endpboxmeasure {%
+ \@finalstrut \@arstrutbox
+ \end{varwidth}\egroup % <got my \tabu@box>
+ \ifdim \tabu@temp\p@ <\z@ % neg coef
+ \ifdim \tabu@wd\tabu@Xcol <\wd\tabu@box
+ \tabu@wddef\tabu@Xcol {\the\wd\tabu@box}%
+ \tabu@debug{\tabu@message@endpboxmeasure}%
+ \fi
+ \else % spread coef>0
+ \global\advance \tabu@naturalX \wd\tabu@box
+ \@tempdima =\dimexpr \wd\tabu@box *\p@/\dimexpr \tabu@temp\p@\relax \relax
+ \ifdim \tabu@naturalXmax <\tabu@naturalX
+ \xdef\tabu@naturalXmax {\the\tabu@naturalX}\fi
+ \ifdim \tabu@naturalXmin <\@tempdima
+ \xdef\tabu@naturalXmin {\the\@tempdima}\fi
+ \fi
+ \box\tabu@box \egroup % end of \vtop (measure) restore \tabu@target
+}% \tabu@endpboxmeasure
+\def\tabu@wddef #1{\expandafter\xdef
+ \csname tabu@\the\tabu@nested.W\number#1\endcsname}
+\def\tabu@wd #1{\csname tabu@\the\tabu@nested.W\number#1\endcsname}
+\def\tabu@message@endpboxmeasure{\tabu@spaces\tabu@spaces<-> % <-> save natural wd
+ \the\tabu@Xcol. X[\tabu@temp]:
+ target = \the\tabucolX \space
+ \expandafter\expandafter\expandafter\string\tabu@wd\tabu@Xcol
+ =\tabu@wd\tabu@Xcol
+}% \tabu@message@endpboxmeasure
+\def\tabu@startpboxquick {\bgroup
+ \let\@startpbox \tabu@startpboxORI % restore immediately
+ \let\tabu \tabu@quick % \begin is expanded before...
+ \expandafter\@gobble \@startpbox % gobbles \bgroup
+}% \tabu@startpboxquick
+\def\tabu@quick {\begingroup \iffalse{\fi \ifnum0=`}\fi
+ \toks@{}\def\tabu@stack{b}\tabu@collectbody \tabu@endquick
+}% \tabu@quick
+\def\tabu@endquick {%
+ \ifodd 1\ifx\tabu@end@envir\tabu@endtabu \else
+ \ifx\tabu@end@envir\tabu@endtabus \else 0\fi\fi\relax
+ \endgroup
+ \else \let\endtabu \relax
+ \tabu@end@envir
+ \fi
+}% \tabu@quick
+\def\tabu@endtabu {\end{tabu}}
+\def\tabu@endtabus {\end{tabu*}}
+%% Measuring the heights and depths - store the results -------------
+\def\tabu@verticalmeasure{\everypar{}%
+ \ifnum \currentgrouptype>12 % 14=semi-simple, 15=math shift group
+ \setbox\tabu@box =\hbox\bgroup
+ \let\tabu@verticalspacing \tabu@verticalsp@lcr
+ \d@llarbegin % after \hbox ...
+ \else
+ \edef\tabu@temp{\ifnum\currentgrouptype=5\vtop
+ \else\ifnum\currentgrouptype=12\vcenter
+ \else\vbox\fi\fi}%
+ \setbox\tabu@box \hbox\bgroup$\tabu@temp \bgroup
+ \let\tabu@verticalspacing \tabu@verticalsp@pmb
+ \fi
+}% \tabu@verticalmeasure
+\def\tabu@verticalsp@lcr{%
+ \d@llarend \egroup % <got my \tabu@box>
+ \@tempdima \dimexpr \ht\tabu@box+\abovetabulinesep
+ \@tempdimb \dimexpr \dp\tabu@box+\belowtabulinesep \relax
+ \ifdim\tabustrutrule>\z@ \tabu@debug{\tabu@message@verticalsp}\fi
+ \ifdim \tabu@ht<\@tempdima \tabu@htdef{\the\@tempdima}\fi
+ \ifdim \tabu@dp<\@tempdimb \tabu@dpdef{\the\@tempdimb}\fi
+ \noindent\vrule height\@tempdima depth\@tempdimb
+}% \tabu@verticalsp@lcr
+\def\tabu@verticalsp@pmb{% inserts struts as needed
+ \par \expandafter\egroup
+ \expandafter$\expandafter
+ \egroup \expandafter
+ \@tempdimc \the\prevdepth
+ \@tempdima \dimexpr \ht\tabu@box+\abovetabulinesep
+ \@tempdimb \dimexpr \dp\tabu@box+\belowtabulinesep \relax
+ \ifdim\tabustrutrule>\z@ \tabu@debug{\tabu@message@verticalsp}\fi
+ \ifdim \tabu@ht<\@tempdima \tabu@htdef{\the\@tempdima}\fi
+ \ifdim \tabu@dp<\@tempdimb \tabu@dpdef{\the\@tempdimb}\fi
+ \let\@finalstrut \@gobble
+ \hrule height\@tempdima depth\@tempdimb width\hsize
+%% \box\tabu@box
+}% \tabu@verticalsp@pmb
+
+\def\tabu@verticalinit{%
+ \ifnum \c@taburow=\z@ \tabu@rearstrut \fi % after \tabu@reset !
+ \advance\c@taburow \@ne
+ \tabu@htdef{\the\ht\@arstrutbox}\tabu@dpdef{\the\dp\@arstrutbox}%
+ \advance\c@taburow \m@ne
+}% \tabu@verticalinit
+\def\tabu@htdef {\expandafter\xdef \csname tabu@\the\tabu@nested.H\the\c@taburow\endcsname}
+\def\tabu@ht {\csname tabu@\the\tabu@nested.H\the\c@taburow\endcsname}
+\def\tabu@dpdef {\expandafter\xdef \csname tabu@\the\tabu@nested.D\the\c@taburow\endcsname}
+\def\tabu@dp {\csname tabu@\the\tabu@nested.D\the\c@taburow\endcsname}
+\def\tabu@verticaldynamicadjustment {%
+ \advance\c@taburow \@ne
+ \extrarowheight \dimexpr\tabu@ht - \ht\strutbox
+ \extrarowdepth \dimexpr\tabu@dp - \dp\strutbox
+ \let\arraystretch \@empty
+ \advance\c@taburow \m@ne
+}% \tabu@verticaldynamicadjustment
+\def\tabuphantomline{\crcr \noalign{%
+ {\globaldefs \@ne
+ \setbox\@arstrutbox \box\voidb@x
+ \let\tabu@@celllalign \tabu@celllalign
+ \let\tabu@@cellralign \tabu@cellralign
+ \let\tabu@@cellleft \tabu@cellleft
+ \let\tabu@@cellright \tabu@cellright
+ \let\tabu@@thevline \tabu@thevline
+ \let\tabu@celllalign \@empty
+ \let\tabu@cellralign \@empty
+ \let\tabu@cellright \@empty
+ \let\tabu@cellleft \@empty
+ \let\tabu@thevline \relax}%
+ \edef\tabu@temp{\tabu@multispan \tabu@nbcols{\noindent &}}%
+ \toks@\expandafter{\tabu@temp \noindent\tabu@everyrowfalse \cr
+ \noalign{\tabu@rearstrut
+ {\globaldefs\@ne
+ \let\tabu@celllalign \tabu@@celllalign
+ \let\tabu@cellralign \tabu@@cellralign
+ \let\tabu@cellleft \tabu@@cellleft
+ \let\tabu@cellright \tabu@@cellright
+ \let\tabu@thevline \tabu@@thevline}}}%
+ \expandafter}\the\toks@
+}% \tabuphantomline
+%% \firsthline and \lasthline corrections ---------------------------
+\def\tabu@firstline {\tabu@hlineAZ \tabu@firsthlinecorrection {}}
+\def\tabu@firsthline{\tabu@hlineAZ \tabu@firsthlinecorrection \hline}
+\def\tabu@lastline {\tabu@hlineAZ \tabu@lasthlinecorrection {}}
+\def\tabu@lasthline {\tabu@hlineAZ \tabu@lasthlinecorrection \hline}
+\def\tabu@hline {% replaces \hline if no colortbl (see \AtBeginDocument)
+ \noalign{\ifnum0=`}\fi
+ {\CT@arc@\hrule height\arrayrulewidth}%
+ \futurelet \tabu@temp \tabu@xhline
+}% \tabu@hline
+\def\tabu@xhline{%
+ \ifx \tabu@temp \hline
+ {\ifx \CT@drsc@\relax \vskip
+ \else\ifx \CT@drsc@\@empty \vskip
+ \else \CT@drsc@\hrule height
+ \fi\fi
+ \doublerulesep}%
+ \fi
+ \ifnum0=`{\fi}%
+}% \tabu@xhline
+\def\tabu@hlineAZ #1#2{\noalign{\ifnum0=`}\fi \dimen@ \z@ \count@ \z@
+ \toks@{}\def\tabu@hlinecorrection{#1}\def\tabu@temp{#2}%
+ \tabu@hlineAZsurround
+}% \tabu@hlineAZ
+\newcommand*\tabu@hlineAZsurround[1][\extratabsurround]{%
+ \extratabsurround #1\let\tabucline \tabucline@scan
+ \let\hline \tabu@hlinescan \let\firsthline \hline
+ \let\cline \tabu@clinescan \let\lasthline \hline
+ \expandafter \futurelet \expandafter \tabu@temp
+ \expandafter \tabu@nexthlineAZ \tabu@temp
+}% \tabu@hlineAZsurround
+\def\tabu@hlinescan {\tabu@thick \arrayrulewidth \tabu@xhlineAZ \hline}
+\def\tabu@clinescan #1{\tabu@thick \arrayrulewidth \tabu@xhlineAZ {\cline{#1}}}
+\def\tabucline@scan{\@testopt \tabucline@sc@n {}}
+\def\tabucline@sc@n #1[#2]{\tabu@xhlineAZ {\tabucline[{#1}]{#2}}}
+\def\tabu@nexthlineAZ{%
+ \ifx \tabu@temp\hline \else
+ \ifx \tabu@temp\cline \else
+ \ifx \tabu@temp\tabucline \else
+ \tabu@hlinecorrection
+ \fi\fi\fi
+}% \tabu@nexthlineAZ
+\def\tabu@xhlineAZ #1{%
+ \toks@\expandafter{\the\toks@ #1}%
+ \@tempdimc \tabu@thick % The last line width
+ \ifcase\count@ \@tempdimb \tabu@thick % The first line width
+ \else \advance\dimen@ \dimexpr \tabu@thick+\doublerulesep \relax
+ \fi
+ \advance\count@ \@ne \futurelet \tabu@temp \tabu@nexthlineAZ
+}% \tabu@xhlineAZ
+\def\tabu@firsthlinecorrection{% \count@ = number of \hline -1
+ \@tempdima \dimexpr \ht\@arstrutbox+\dimen@
+ \edef\firsthline{% <local in \noalign>
+ \omit \hbox to\z@{\hss{\noexpand\tabu@DBG{yellow}\vrule
+ height \the\dimexpr\@tempdima+\extratabsurround
+ depth \dp\@arstrutbox
+ width \tabustrutrule}\hss}\cr
+ \noalign{\vskip -\the\dimexpr \@tempdima+\@tempdimb
+ +\dp\@arstrutbox \relax}%
+ \the\toks@
+ }\ifnum0=`{\fi
+ \expandafter}\firsthline % we are then !
+}% \tabu@firsthlinecorrection
+\def\tabu@lasthlinecorrection{%
+ \@tempdima \dimexpr \dp\@arstrutbox+\dimen@+\@tempdimb+\@tempdimc
+ \edef\lasthline{% <local in \noalign>
+ \the\toks@
+ \noalign{\vskip -\the\dimexpr\dimen@+\@tempdimb+\dp\@arstrutbox}%
+ \omit \hbox to\z@{\hss{\noexpand\tabu@DBG{yellow}\vrule
+ depth \the\dimexpr \dp\@arstrutbox+\@tempdimb+\dimen@
+ +\extratabsurround-\@tempdimc
+ height \z@
+ width \tabustrutrule}\hss}\cr
+ }\ifnum0=`{\fi
+ \expandafter}\lasthline % we are then !
+}% \tabu@lasthlinecorrection
+\def\tabu@LT@@hline{%
+ \ifx\LT@next\hline
+ \global\let\LT@next \@gobble
+ \ifx \CT@drsc@\relax
+ \gdef\CT@LT@sep{%
+ \noalign{\penalty-\@medpenalty\vskip\doublerulesep}}%
+ \else
+ \gdef\CT@LT@sep{%
+ \multispan\LT@cols{%
+ \CT@drsc@\leaders\hrule\@height\doublerulesep\hfill}\cr}%
+ \fi
+ \else
+ \global\let\LT@next\empty
+ \gdef\CT@LT@sep{%
+ \noalign{\penalty-\@lowpenalty\vskip-\arrayrulewidth}}%
+ \fi
+ \ifnum0=`{\fi}%
+ \multispan\LT@cols
+ {\CT@arc@\leaders\hrule\@height\arrayrulewidth\hfill}\cr
+ \CT@LT@sep
+ \multispan\LT@cols
+ {\CT@arc@\leaders\hrule\@height\arrayrulewidth\hfill}\cr
+ \noalign{\penalty\@M}%
+ \LT@next
+}% \tabu@LT@@hline
+%% Horizontal lines : \tabucline ------------------------------------
+\let\tabu@start \@tempcnta
+\let\tabu@stop \@tempcntb
+\newcommand*\tabucline{\noalign{\ifnum0=`}\fi \tabu@cline}
+\newcommand*\tabu@cline[2][]{\tabu@startstop{#2}%
+ \ifnum \tabu@stop<\z@ \toks@{}%
+ \else \tabu@clinearg{#1}\tabu@thestyle
+ \edef\tabucline{\toks@{%
+ \ifnum \tabu@start>\z@ \omit
+ \tabu@multispan\tabu@start {\span\omit}&\fi
+ \omit \tabu@multispan\tabu@stop {\span\omit}%
+ \tabu@thehline\cr
+ }}\tabucline
+ \tabu@tracinglines{(tabu:tabucline) Style: #1^^J\the\toks@^^J^^J}%
+ \fi
+ \futurelet \tabu@temp \tabu@xcline
+}% \tabu@cline
+\def\tabu@clinearg #1{%
+ \ifx\\#1\\\let\tabu@thestyle \tabu@ls@
+ \else \@defaultunits \expandafter\let\expandafter\@tempa
+ \romannumeral-`\0#1\relax \@nnil
+ \ifx \hbox\@tempa \tabu@clinebox{#1}%
+ \else\ifx \box\@tempa \tabu@clinebox{#1}%
+ \else\ifx \vbox\@tempa \tabu@clinebox{#1}%
+ \else\ifx \vtop\@tempa \tabu@clinebox{#1}%
+ \else\ifx \copy\@tempa \tabu@clinebox{#1}%
+ \else\ifx \leaders\@tempa \tabu@clineleads{#1}%
+ \else\ifx \cleaders\@tempa \tabu@clineleads{#1}%
+ \else\ifx \xleaders\@tempa \tabu@clineleads{#1}%
+ \else\tabu@getline {#1}%
+ \fi\fi\fi\fi\fi\fi\fi\fi
+ \fi
+}% \tabu@clinearg
+\def\tabu@clinebox #1{\tabu@clineleads{\xleaders#1\hss}}
+\def\tabu@clineleads #1{%
+ \let\tabu@thestyle \relax \let\tabu@leaders \@undefined
+ \gdef\tabu@thehrule{#1}}
+\def\tabu@thehline{\begingroup
+ \ifdefined\tabu@leaders
+ \noexpand\tabu@thehleaders
+ \else \noexpand\tabu@thehrule
+ \fi \endgroup
+}% \tabu@thehline
+\def\tabu@xcline{%
+ \ifx \tabu@temp\tabucline
+ \toks@\expandafter{\the\toks@ \noalign
+ {\ifx\CT@drsc@\relax \vskip
+ \else \CT@drsc@\hrule height
+ \fi
+ \doublerulesep}}%
+ \fi
+ \tabu@docline
+}% \tabu@xcline
+\def\tabu@docline {\ifnum0=`{\fi \expandafter}\the\toks@}
+\def\tabu@docline@evr {\xdef\tabu@doclineafter{\the\toks@}%
+ \ifnum0=`{\fi}\aftergroup\tabu@doclineafter}
+\def\tabu@multispan #1#2{%
+ \ifnum\numexpr#1>\@ne #2\expandafter\tabu@multispan
+ \else \expandafter\@gobbletwo
+ \fi {#1-1}{#2}%
+}% \tabu@multispan
+\def\tabu@startstop #1{\tabu@start@stop #1\relax 1-\tabu@nbcols \@nnil}
+\def\tabu@start@stop #1-#2\@nnil{%
+ \@defaultunits \tabu@start\number 0#1\relax \@nnil
+ \@defaultunits \tabu@stop \number 0#2\relax \@nnil
+ \tabu@stop \ifnum \tabu@start>\tabu@nbcols \m@ne
+ \else\ifnum \tabu@stop=\z@ \tabu@nbcols
+ \else\ifnum \tabu@stop>\tabu@nbcols \tabu@nbcols
+ \else \tabu@stop
+ \fi\fi\fi
+ \advance\tabu@start \m@ne
+ \ifnum \tabu@start>\z@ \advance\tabu@stop -\tabu@start \fi
+}% \tabu@start@stop
+%% Numbers: siunitx S columns (and \tabudecimal) -------------------
+\def\tabu@tabudecimal #1{%
+ \def\tabu@decimal{#1}\@temptokena{}%
+ \let\tabu@getdecimal@ \tabu@getdecimal@ignorespaces
+ \tabu@scandecimal
+}% \tabu@tabudecimal
+\def\tabu@scandecimal{\futurelet \tabu@temp \tabu@getdecimal@}
+\def\tabu@skipdecimal#1{#1\tabu@scandecimal}
+\def\tabu@getdecimal@ignorespaces{%
+ \ifcase 0\ifx\tabu@temp\ignorespaces\else
+ \ifx\tabu@temp\@sptoken1\else
+ 2\fi\fi\relax
+ \let\tabu@getdecimal@ \tabu@getdecimal
+ \expandafter\tabu@skipdecimal
+ \or \expandafter\tabu@gobblespace\expandafter\tabu@scandecimal
+ \else \expandafter\tabu@skipdecimal
+ \fi
+}% \tabu@getdecimal@ignorespaces
+\def\tabu@get@decimal#1{\@temptokena\expandafter{\the\@temptokena #1}%
+ \tabu@scandecimal}
+\def\do#1{%
+ \def\tabu@get@decimalspace#1{%
+ \@temptokena\expandafter{\the\@temptokena #1}\tabu@scandecimal}%
+}\do{ }
+\let\tabu@@tabudecimal \tabu@tabudecimal
+\def\tabu@getdecimal{%
+ \ifcase 0\ifx 0\tabu@temp\else
+ \ifx 1\tabu@temp\else
+ \ifx 2\tabu@temp\else
+ \ifx 3\tabu@temp\else
+ \ifx 4\tabu@temp\else
+ \ifx 5\tabu@temp\else
+ \ifx 6\tabu@temp\else
+ \ifx 7\tabu@temp\else
+ \ifx 8\tabu@temp\else
+ \ifx 9\tabu@temp\else
+ \ifx .\tabu@temp\else
+ \ifx ,\tabu@temp\else
+ \ifx -\tabu@temp\else
+ \ifx +\tabu@temp\else
+ \ifx e\tabu@temp\else
+ \ifx E\tabu@temp\else
+ \ifx\tabu@cellleft\tabu@temp1\else
+ \ifx\ignorespaces\tabu@temp1\else
+ \ifx\@sptoken\tabu@temp2\else
+ 3\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\relax
+ \expandafter\tabu@get@decimal
+ \or \expandafter\tabu@skipdecimal
+ \or \expandafter\tabu@get@decimalspace
+ \else\expandafter\tabu@printdecimal
+ \fi
+}% \tabu@getdecimal
+\def\tabu@printdecimal{%
+ \edef\tabu@temp{\the\@temptokena}%
+ \ifx\tabu@temp\@empty\else
+ \ifx\tabu@temp\space\else
+ \expandafter\tabu@decimal\expandafter{\the\@temptokena}%
+ \fi\fi
+}% \tabu@printdecimal
+%% Verbatim inside X columns ----------------------------------------
+\def\tabu@verbatim{%
+ \let\verb \tabu@verb
+ \let\FV@DefineCheckEnd \tabu@FV@DefineCheckEnd
+}% \tabu@verbatim
+\let\tabu@ltx@verb \verb
+\def\tabu@verb{\@ifstar {\tabu@ltx@verb*} \tabu@ltx@verb}
+\def\tabu@fancyvrb {%
+ \def\tabu@FV@DefineCheckEnd ##1{%
+ \def\tabu@FV@DefineCheckEnd{%
+ ##1% <original definition (if fancyvrb is loaded)>
+ \let\FV@CheckEnd \tabu@FV@CheckEnd
+ \let\FV@@CheckEnd \tabu@FV@@CheckEnd
+ \let\FV@@@CheckEnd \tabu@FV@@@CheckEnd
+ \edef\FV@EndScanning{%
+ \def\noexpand\next{\noexpand\end{\FV@EnvironName}}%
+ \global\let\noexpand\FV@EnvironName\relax
+ \noexpand\next}%
+ \xdef\FV@EnvironName{\detokenize\expandafter{\FV@EnvironName}}}%
+ }\expandafter\tabu@FV@DefineCheckEnd\expandafter{\FV@DefineCheckEnd}
+}% \tabu@fancyvrb
+\def\tabu@FV@CheckEnd #1{\expandafter\FV@@CheckEnd \detokenize{#1\end{}}\@nil}
+\edef\tabu@FV@@@CheckEnd {\detokenize{\end{}}}
+\begingroup
+\catcode`\[1 \catcode`\]2
+\@makeother\{ \@makeother\}
+ \edef\x[\endgroup
+ \def\noexpand\tabu@FV@@CheckEnd ##1\detokenize[\end{]##2\detokenize[}]##3%
+ ]\x \@nil{\def\@tempa{#2}\def\@tempb{#3}}
+\def\tabu@FV@ListProcessLine #1{%
+ \hbox {%to \hsize{%
+ \kern\leftmargin
+ \hbox {%to \linewidth{%
+ \FV@LeftListNumber
+ \FV@LeftListFrame
+ \FancyVerbFormatLine{#1}\hss
+%% DG/SR modification begin - Jan. 28, 1998 (for numbers=right add-on)
+%% \FV@RightListFrame}%
+ \FV@RightListFrame
+ \FV@RightListNumber}%
+%% DG/SR modification end
+ \hss}}
+%% \savetabu --------------------------------------------------------
+\newcommand*\savetabu[1]{\noalign{%
+ \tabu@sanitizearg{#1}\tabu@temp
+ \ifx \tabu@temp\@empty \tabu@savewarn{}{The tabu will not be saved}\else
+ \@ifundefined{tabu@saved@\tabu@temp}{}{\tabu@savewarn{#1}{Overwriting}}%
+ \ifdefined\tabu@restored \expandafter\let
+ \csname tabu@saved@\tabu@temp \endcsname \tabu@restored
+ \else {\tabu@save}%
+ \fi
+ \fi}%
+}% \savetabu
+\def\tabu@save {%
+ \toks0\expandafter{\tabu@saved@}%
+ \iftabu@negcoef
+ \let\tabu@wddef \relax \let\tabu@ \tabu@savewd \edef\tabu@savewd{\tabu@Xcoefs}%
+ \toks0\expandafter{\the\toks\expandafter0\tabu@savewd}\fi
+ \toks1\expandafter{\tabu@savedpream}%
+ \toks2\expandafter{\tabu@savedpreamble}%
+ \let\@preamble \relax
+ \let\tabu@savedpream \relax \let\tabu@savedparams \relax
+ \edef\tabu@preamble{%
+ \def\noexpand\tabu@aligndefault{\tabu@align}%
+ \def\tabu@savedparams {\noexpand\the\toks0}%
+ \def\tabu@savedpream {\noexpand\the\toks1}}%
+ \edef\tabu@usetabu{%
+ \def\@preamble {\noexpand\the\toks2}%
+ \tabu@target \the\tabu@target \relax
+ \tabucolX \the\tabucolX \relax
+ \tabu@nbcols \the\tabu@nbcols \relax
+ \def\noexpand\tabu@aligndefault{\tabu@align}%
+ \def\tabu@savedparams {\noexpand\the\toks0}%
+ \def\tabu@savedpream {\noexpand\the\toks1}}%
+ \let\tabu@aligndefault \relax \let\@sharp \relax
+ \edef\@tempa{\noexpand\tabu@s@ved
+ {\tabu@usetabu}
+ {\tabu@preamble}
+ {\the\toks1}}\@tempa
+ \tabu@message@save
+}% \tabu@save
+\long\def\tabu@s@ved #1#2#3{%
+ \def\tabu@usetabu{#1}% <for \tabu@message@save>
+ \expandafter\gdef\csname tabu@saved@\tabu@temp\endcsname ##1{%
+ \ifodd ##1% \usetabu
+ \tabu@measuringfalse \tabu@spreadfalse % Just in case...
+ \gdef\tabu@usetabu {%
+ \ifdim \tabu@target>\z@ \tabu@warn@usetabu \fi
+ \global\let\tabu@usetabu \@undefined
+ \def\@halignto {to\tabu@target}%
+ #1%
+ \ifx \tabu@align\tabu@aligndefault@text
+ \ifnum \tabu@nested=\z@
+ \let\tabu@align \tabu@aligndefault \fi\fi}%
+ \else % \preamble
+ \gdef\tabu@preamble {%
+ \global\let\tabu@preamble \@undefined
+ #2%
+ \ifx \tabu@align\tabu@aligndefault@text
+ \ifnum \tabu@nested=\z@
+ \let\tabu@align \tabu@aligndefault \fi\fi}%
+ \fi
+ #3}%
+}% \tabu@s@ved
+\def\tabu@aligndefault@text {\tabu@aligndefault}%
+\def\tabu@warn@usetabu {\PackageWarning{tabu}
+ {Specifying a target with \string\usetabu\space is useless
+ \MessageBreak The target cannot be changed!}}
+\def\tabu@savewd #1#2{\ifdim #2\p@<\z@ \tabu@wddef{#1}{\tabu@wd{#1}}\fi}
+\def\tabu@savewarn#1#2{\PackageInfo{tabu}
+ {User-name `#1' already used for \string\savetabu
+ \MessageBreak #2}}%
+\def\tabu@saveerr#1{\PackageError{tabu}
+ {User-name `#1' is unknown for \string\usetabu
+ \MessageBreak I cannot restore an unknown preamble!}\@ehd}
+%% \rowfont ---------------------------------------------------------
+\newskip \tabu@cellskip
+\def\tabu@rowfont{\ifdim \baselineskip=\z@\noalign\fi
+ {\ifnum0=`}\fi \tabu@row@font}
+\newcommand*\tabu@row@font[2][]{%
+ \ifnum7=\currentgrouptype
+ \global\let\tabu@@cellleft \tabu@cellleft
+ \global\let\tabu@@cellright \tabu@cellright
+ \global\let\tabu@@celllalign \tabu@celllalign
+ \global\let\tabu@@cellralign \tabu@cellralign
+ \global\let\tabu@@rowfontreset\tabu@rowfontreset
+ \fi
+ \global\let\tabu@rowfontreset \tabu@rowfont@reset
+ \expandafter\gdef\expandafter\tabu@cellleft\expandafter{\tabu@cellleft #2}%
+ \ifcsname tabu@cell@#1\endcsname % row alignment
+ \csname tabu@cell@#1\endcsname \fi
+ \ifnum0=`{\fi}% end of group / noalign group
+}% \rowfont
+\def\tabu@ifcolorleavevmode #1{\let\color \tabu@leavevmodecolor #1\let\color\tabu@color}%
+\def\tabu@rowfont@reset{%
+ \global\let\tabu@rowfontreset \tabu@@rowfontreset
+ \global\let\tabu@cellleft \tabu@@cellleft
+ \global\let\tabu@cellright \tabu@@cellright
+ \global\let\tabu@cellfont \@empty
+ \global\let\tabu@celllalign \tabu@@celllalign
+ \global\let\tabu@cellralign \tabu@@cellralign
+}% \tabu@@rowfontreset
+\let\tabu@rowfontreset \@empty % overwritten \AtBeginDocument if colortbl
+%% \tabu@prepnext@tok -----------------------------------------------
+\newif \iftabu@cellright
+\def\tabu@prepnext@tok{%
+ \ifnum \count@<\z@ % <first initialisation>
+ \@tempcnta \@M % <not initialized by array.sty>
+ \tabu@nbcols\z@
+ \let\tabu@fornoopORI \@fornoop
+ \tabu@cellrightfalse
+ \else
+ \ifcase \numexpr \count@-\@tempcnta \relax % (case 0): prev. token is left
+ \advance \tabu@nbcols \@ne
+ \iftabu@cellright % before-previous token is right and is finished
+ \tabu@cellrightfalse % <only once>
+ \tabu@righttok
+ \fi
+ \tabu@lefttok
+ \or % (case 1) previous token is right
+ \tabu@cellrighttrue \let\@fornoop \tabu@lastnoop
+ \else % special column: do not change the token
+ \iftabu@cellright % before-previous token is right
+ \tabu@cellrightfalse
+ \tabu@righttok
+ \fi
+ \fi % \ifcase
+ \fi
+ \tabu@prepnext@tokORI
+}% \tabu@prepnext@tok
+\long\def\tabu@lastnoop#1\@@#2#3{\tabu@lastn@@p #2\@nextchar \in@\in@@}
+\def\tabu@lastn@@p #1\@nextchar #2#3\in@@{%
+ \ifx \in@#2\else
+ \let\@fornoop \tabu@fornoopORI
+ \xdef\tabu@mkpreambuffer{\tabu@nbcols\the\tabu@nbcols \tabu@mkpreambuffer}%
+ \toks0\expandafter{\expandafter\tabu@everyrowtrue \the\toks0}%
+ \expandafter\prepnext@tok
+ \fi
+}% \tabu@lastnoop
+\def\tabu@righttok{%
+ \advance \count@ \m@ne
+ \toks\count@\expandafter {\the\toks\count@ \tabu@cellright \tabu@cellralign}%
+ \advance \count@ \@ne
+}% \tabu@righttok
+\def\tabu@lefttok{\toks\count@\expandafter{\expandafter\tabu@celllalign
+ \the\toks\count@ \tabu@cellleft}% after because of $
+}% \tabu@lefttok
+%% Neutralisation of glues ------------------------------------------
+\let\tabu@cellleft \@empty
+\let\tabu@cellright \@empty
+\tabu@celllalign@def{\tabu@cellleft}%
+\let\tabu@cellralign \@empty
+\def\tabu@cell@align #1#2#3{%
+ \let\tabu@maybesiunitx \toks@ \tabu@celllalign
+ \global \expandafter \tabu@celllalign@def \expandafter {\the\toks@ #1}%
+ \toks@\expandafter{\tabu@cellralign #2}%
+ \xdef\tabu@cellralign{\the\toks@}%
+ \toks@\expandafter{\tabu@cellleft #3}%
+ \xdef\tabu@cellleft{\the\toks@}%
+}% \tabu@cell@align
+\def\tabu@cell@l{% force alignment to left
+ \tabu@cell@align
+ {\tabu@removehfil \raggedright \tabu@cellleft}% left
+ {\tabu@flush1\tabu@ignorehfil}% right
+ \raggedright
+}% \tabu@cell@l
+\def\tabu@cell@c{% force alignment to center
+ \tabu@cell@align
+ {\tabu@removehfil \centering \tabu@flush{.5}\tabu@cellleft}
+ {\tabu@flush{.5}\tabu@ignorehfil}
+ \centering
+}% \tabu@cell@c
+\def\tabu@cell@r{% force alignment to right
+ \tabu@cell@align
+ {\tabu@removehfil \raggedleft \tabu@flush1\tabu@cellleft}
+ \tabu@ignorehfil
+ \raggedleft
+}% \tabu@cell@r
+\def\tabu@cell@j{% force justification (for p, m, b columns)
+ \tabu@cell@align
+ {\tabu@justify\tabu@cellleft}
+ {}
+ \tabu@justify
+}% \tabu@cell@j
+\def\tabu@justify{%
+ \leftskip\z@skip \@rightskip\leftskip \rightskip\@rightskip
+ \parfillskip\@flushglue
+}% \tabu@justify
+%% ragged2e settings
+\def\tabu@cell@L{% force alignment to left (ragged2e)
+ \tabu@cell@align
+ {\tabu@removehfil \RaggedRight \tabu@cellleft}
+ {\tabu@flush 1\tabu@ignorehfil}
+ \RaggedRight
+}% \tabu@cell@L
+\def\tabu@cell@C{% force alignment to center (ragged2e)
+ \tabu@cell@align
+ {\tabu@removehfil \Centering \tabu@flush{.5}\tabu@cellleft}
+ {\tabu@flush{.5}\tabu@ignorehfil}
+ \Centering
+}% \tabu@cell@C
+\def\tabu@cell@R{% force alignment to right (ragged2e)
+ \tabu@cell@align
+ {\tabu@removehfil \RaggedLeft \tabu@flush 1\tabu@cellleft}
+ \tabu@ignorehfil
+ \RaggedLeft
+}% \tabu@cell@R
+\def\tabu@cell@J{% force justification (ragged2e)
+ \tabu@cell@align
+ {\justifying \tabu@cellleft}
+ {}
+ \justifying
+}% \tabu@cell@J
+\def\tabu@flush#1{%
+ \iftabu@colortbl % colortbl uses \hfill rather than \hfil
+ \hskip \ifnum13<\currentgrouptype \stretch{#1}%
+ \else \ifdim#1pt<\p@ \tabu@cellskip
+ \else \stretch{#1}
+ \fi\fi \relax
+ \else % array.sty
+ \ifnum 13<\currentgrouptype
+ \hfil \hskip1sp \relax \fi
+ \fi
+}% \tabu@flush
+\let\tabu@hfil \hfil
+\let\tabu@hfill \hfill
+\let\tabu@hskip \hskip
+\def\tabu@removehfil{%
+ \iftabu@colortbl
+ \unkern \tabu@cellskip =\lastskip
+ \ifnum\gluestretchorder\tabu@cellskip =\tw@ \hskip-\tabu@cellskip
+ \else \tabu@cellskip \z@skip
+ \fi
+ \else
+ \ifdim\lastskip=1sp\unskip\fi
+ \ifnum\gluestretchorder\lastskip =\@ne
+ \hfilneg % \hfilneg for array.sty but not for colortbl...
+ \fi
+ \fi
+}% \tabu@removehfil
+\def\tabu@ignorehfil{\aftergroup \tabu@nohfil}
+\def\tabu@nohfil{% \hfil -> do nothing + restore original \hfil
+ \def\hfil{\let\hfil \tabu@hfil}% local to (alignment template) group
+}% \tabu@nohfil
+\def\tabu@colortblalignments {% if colortbl
+ \def\tabu@nohfil{%
+ \def\hfil {\let\hfil \tabu@hfil}% local to (alignment template) group
+ \def\hfill {\let\hfill \tabu@hfill}% (colortbl uses \hfill) pfff...
+ \def\hskip ####1\relax{\let\hskip \tabu@hskip}}% local
+}% \tabu@colortblalignments
+%% Taking care of footnotes and hyperfootnotes ----------------------
+\long\def\tabu@footnotetext #1{%
+ \edef\@tempa{\the\tabu@footnotes
+ \noexpand\footnotetext [\the\csname c@\@mpfn\endcsname]}%
+ \global\tabu@footnotes\expandafter{\@tempa {#1}}}%
+\long\def\tabu@xfootnotetext [#1]#2{%
+ \global\tabu@footnotes\expandafter{\the\tabu@footnotes
+ \footnotetext [{#1}]{#2}}}
+\let\tabu@xfootnote \@xfootnote
+\long\def\tabu@Hy@ftntext{\tabu@Hy@ftntxt {\the \c@footnote }}
+\long\def\tabu@Hy@xfootnote [#1]{%
+ \begingroup
+ \value\@mpfn #1\relax
+ \protected@xdef \@thefnmark {\thempfn}%
+ \endgroup
+ \@footnotemark \tabu@Hy@ftntxt {#1}%
+}% \tabu@Hy@xfootnote
+\long\def\tabu@Hy@ftntxt #1#2{%
+ \edef\@tempa{%
+ \the\tabu@footnotes
+ \begingroup
+ \value\@mpfn #1\relax
+ \noexpand\protected@xdef\noexpand\@thefnmark {\noexpand\thempfn}%
+ \expandafter \noexpand \expandafter
+ \tabu@Hy@footnotetext \expandafter{\Hy@footnote@currentHref}%
+ }%
+ \global\tabu@footnotes\expandafter{\@tempa {#2}%
+ \endgroup}%
+}% \tabu@Hy@ftntxt
+\long\def\tabu@Hy@footnotetext #1#2{%
+ \H@@footnotetext{%
+ \ifHy@nesting
+ \hyper@@anchor {#1}{#2}%
+ \else
+ \Hy@raisedlink{%
+ \hyper@@anchor {#1}{\relax}%
+ }%
+ \def\@currentHref {#1}%
+ \let\@currentlabelname \@empty
+ #2%
+ \fi
+ }%
+}% \tabu@Hy@footnotetext
+%% No need for \arraybackslash ! ------------------------------------
+\def\tabu@latextwoe {%
+\def\tabu@temp##1##2##3{{\toks@\expandafter{##2##3}\xdef##1{\the\toks@}}}
+\tabu@temp \tabu@centering \centering \arraybackslash
+\tabu@temp \tabu@raggedleft \raggedleft \arraybackslash
+\tabu@temp \tabu@raggedright \raggedright \arraybackslash
+}% \tabu@latextwoe
+\def\tabu@raggedtwoe {%
+\def\tabu@temp ##1##2##3{{\toks@\expandafter{##2##3}\xdef##1{\the\toks@}}}
+\tabu@temp \tabu@Centering \Centering \arraybackslash
+\tabu@temp \tabu@RaggedLeft \RaggedLeft \arraybackslash
+\tabu@temp \tabu@RaggedRight \RaggedRight \arraybackslash
+\tabu@temp \tabu@justifying \justifying \arraybackslash
+}% \tabu@raggedtwoe
+\def\tabu@normalcrbackslash{\let\\\@normalcr}
+\def\tabu@trivlist{\expandafter\def\expandafter\@trivlist\expandafter{%
+ \expandafter\tabu@normalcrbackslash \@trivlist}}
+%% Utilities: \fbox \fcolorbox and \tabudecimal -------------------
+\def\tabu@fbox {\leavevmode\afterassignment\tabu@beginfbox \setbox\@tempboxa\hbox}
+\def\tabu@beginfbox {\bgroup \kern\fboxsep
+ \bgroup\aftergroup\tabu@endfbox}
+\def\tabu@endfbox {\kern\fboxsep\egroup\egroup
+ \@frameb@x\relax}
+\def\tabu@color@b@x #1#2{\leavevmode \bgroup
+ \def\tabu@docolor@b@x{#1{#2\color@block{\wd\z@}{\ht\z@}{\dp\z@}\box\z@}}%
+ \afterassignment\tabu@begincolor@b@x \setbox\z@ \hbox
+}% \tabu@color@b@x
+\def\tabu@begincolor@b@x {\kern\fboxsep \bgroup
+ \aftergroup\tabu@endcolor@b@x \set@color}
+\def\tabu@endcolor@b@x {\kern\fboxsep \egroup
+ \dimen@\ht\z@ \advance\dimen@ \fboxsep \ht\z@ \dimen@
+ \dimen@\dp\z@ \advance\dimen@ \fboxsep \dp\z@ \dimen@
+ \tabu@docolor@b@x \egroup
+}% \tabu@endcolor@b@x
+%% Corrections (arydshln, delarray, colortbl) -----------------------
+\def\tabu@fix@arrayright {%% \@arrayright is missing from \endarray
+ \iftabu@colortbl
+ \ifdefined\adl@array % <colortbl + arydshln>
+ \def\tabu@endarray{%
+ \adl@endarray \egroup \adl@arrayrestore \CT@end \egroup %<original>
+ \@arrayright % <FC>
+ \gdef\@preamble{}}% <FC>
+ \else % <colortbl / no arydshln>
+ \def\tabu@endarray{%
+ \crcr \egroup \egroup %<original>
+ \@arrayright % <FC>
+ \gdef\@preamble{}\CT@end}%
+ \fi
+ \else
+ \ifdefined\adl@array % <arydshln / no colortbl>
+ \def\tabu@endarray{%
+ \adl@endarray \egroup \adl@arrayrestore \egroup %<original>
+ \@arrayright % <FC>
+ \gdef\@preamble{}}% <FC>
+ \else % <no arydshln / no colotbl + \@arrayright missing>
+ \PackageWarning{tabu}
+ {\string\@arrayright\space is missing from the
+ \MessageBreak definition of \string\endarray.
+ \MessageBreak Compatibility with delarray.sty is broken.}%
+ \fi\fi
+}% \tabu@fix@arrayright
+\def\tabu@adl@xarraydashrule #1#2#3{%
+ \ifnum\@lastchclass=\adl@class@start\else
+ \ifnum\@lastchclass=\@ne\else
+ \ifnum\@lastchclass=5 \else % <FC> @-arg (class 5) and !-arg (class 1)
+ \adl@leftrulefalse \fi\fi % must be treated the same
+ \fi
+ \ifadl@zwvrule\else \ifadl@inactive\else
+ \@addtopreamble{\vrule\@width\arrayrulewidth
+ \@height\z@ \@depth\z@}\fi \fi
+ \ifadl@leftrule
+ \@addtopreamble{\adl@vlineL{\CT@arc@}{\adl@dashgapcolor}%
+ {\number#1}#3}%
+ \else \@addtopreamble{\adl@vlineR{\CT@arc@}{\adl@dashgapcolor}%
+ {\number#2}#3}
+ \fi
+}% \tabu@adl@xarraydashrule
+\def\tabu@adl@act@endpbox {%
+ \unskip \ifhmode \nobreak \fi \@finalstrut \@arstrutbox
+ \egroup \egroup
+ \adl@colhtdp \box\adl@box \hfil
+}% \tabu@adl@act@endpbox
+\def\tabu@adl@fix {%
+ \let\adl@xarraydashrule \tabu@adl@xarraydashrule % <fix> arydshln
+ \let\adl@act@endpbox \tabu@adl@act@endpbox % <fix> arydshln
+ \let\adl@act@@endpbox \tabu@adl@act@endpbox % <fix> arydshln
+ \let\@preamerror \@preamerr % <fix> arydshln
+}% \tabu@adl@fix
+%% Correction for longtable' \@startbox definition ------------------
+%% => \everypar is ``missing'' : TeX should be in vertical mode
+\def\tabu@LT@startpbox #1{%
+ \bgroup
+ \let\@footnotetext\LT@p@ftntext
+ \setlength\hsize{#1}%
+ \@arrayparboxrestore
+ \everypar{%
+ \vrule \@height \ht\@arstrutbox \@width \z@
+ \everypar{}}%
+}% \tabu@LT@startpbox
+%% \tracingtabu and the package options ------------------
+\DeclareOption{delarray}{\AtEndOfPackage{\RequirePackage{delarray}}}
+\DeclareOption{linegoal}{%
+ \AtEndOfPackage{%
+ \RequirePackage{linegoal}[2010/12/07]%
+ \let\tabudefaulttarget \linegoal% \linegoal is \linewidth if not pdfTeX
+}}
+\DeclareOption{scantokens}{\tabuscantokenstrue}
+\DeclareOption{debugshow}{\AtEndOfPackage{\tracingtabu=\tw@}}
+\def\tracingtabu {\begingroup\@ifnextchar=%
+ {\afterassignment\tabu@tracing\count@}
+ {\afterassignment\tabu@tracing\count@1\relax}}
+\def\tabu@tracing{\expandafter\endgroup
+ \expandafter\tabu@tr@cing \the\count@ \relax
+}% \tabu@tracing
+\def\tabu@tr@cing #1\relax {%
+ \ifnum#1>\thr@@ \let\tabu@tracinglines\message
+ \else \let\tabu@tracinglines\@gobble
+ \fi
+ \ifnum#1>\tw@ \let\tabu@DBG \tabu@@DBG
+ \def\tabu@mkarstrut {\tabu@DBG@arstrut}%
+ \tabustrutrule 1.5\p@
+ \else \let\tabu@DBG \@gobble
+ \def\tabu@mkarstrut {\tabu@arstrut}%
+ \tabustrutrule \z@
+ \fi
+ \ifnum#1>\@ne \let\tabu@debug \message
+ \else \let\tabu@debug \@gobble
+ \fi
+ \ifnum#1>\z@
+ \let\tabu@message \message
+ \let\tabu@tracing@save \tabu@message@save
+ \let\tabu@starttimer \tabu@pdftimer
+ \else
+ \let\tabu@message \@gobble
+ \let\tabu@tracing@save \@gobble
+ \let\tabu@starttimer \relax
+ \fi
+}% \tabu@tr@cing
+%% Setup \AtBeginDocument
+\AtBeginDocument{\tabu@AtBeginDocument}
+\def\tabu@AtBeginDocument{\let\tabu@AtBeginDocument \@undefined
+ \ifdefined\arrayrulecolor \tabu@colortbltrue % <colortbl>
+ \tabu@colortblalignments % different glues are used
+ \else \tabu@colortblfalse \fi
+ \ifdefined\CT@arc@ \else \let\CT@arc@ \relax \fi
+ \ifdefined\CT@drsc@\else \let\CT@drsc@ \relax \fi
+ \let\tabu@arc@L \CT@arc@ \let\tabu@drsc@L \CT@drsc@
+ \ifodd 1\ifcsname siunitx_table_collect_begin:Nn\endcsname % <siunitx: ok>
+ \expandafter\ifx
+ \csname siunitx_table_collect_begin:Nn\endcsname\relax 0\fi\fi\relax
+ \tabu@siunitxtrue
+ \else \let\tabu@maybesiunitx \@firstofone % <not siunitx: setup>
+ \let\tabu@siunitx \tabu@nosiunitx
+ \tabu@siunitxfalse
+ \fi
+ \ifdefined\adl@array % <arydshln>
+ \else \let\tabu@adl@fix \relax
+ \let\tabu@adl@endtrial \@empty \fi
+ \ifdefined\longtable % <longtable>
+ \else \let\longtabu \tabu@nolongtabu \fi
+ \ifdefined\cellspacetoplimit \tabu@warn@cellspace\fi
+ \csname\ifcsname ifHy@hyperfootnotes\endcsname % <hyperfootnotes>
+ ifHy@hyperfootnotes\else iffalse\fi\endcsname
+ \let\tabu@footnotetext \tabu@Hy@ftntext
+ \let\tabu@xfootnote \tabu@Hy@xfootnote \fi
+ \ifdefined\FV@DefineCheckEnd% <fancyvrb>
+ \tabu@fancyvrb \fi
+ \ifdefined\color % <color / xcolor>
+ \let\tabu@color \color
+ \def\tabu@leavevmodecolor ##1{%
+ \def\tabu@leavevmodecolor {\leavevmode ##1}%
+ }\expandafter\tabu@leavevmodecolor\expandafter{\color}%
+ \else
+ \let\tabu@color \tabu@nocolor
+ \let\tabu@leavevmodecolor \@firstofone \fi
+ \tabu@latextwoe
+ \ifdefined\@raggedtwoe@everyselectfont % <ragged2e>
+ \tabu@raggedtwoe
+ \else
+ \let\tabu@cell@L \tabu@cell@l
+ \let\tabu@cell@R \tabu@cell@r
+ \let\tabu@cell@C \tabu@cell@c
+ \let\tabu@cell@J \tabu@cell@j \fi
+ \expandafter\in@ \expandafter\@arrayright \expandafter{\endarray}%
+ \ifin@ \let\tabu@endarray \endarray
+ \else \tabu@fix@arrayright \fi% <fix for colortbl & arydshln (delarray)>
+ \everyrow{}%
+}% \tabu@AtBeginDocument
+\def\tabu@warn@cellspace{%
+ \PackageWarning{tabu}{%
+ Package cellspace has some limitations
+ \MessageBreak And redefines some macros of array.sty.
+ \MessageBreak Please use \string\tabulinesep\space to control
+ \MessageBreak vertical spacing of lines inside tabu environment}%
+}% \tabu@warn@cellspace
+%% tabu Package initialisation
+\tabuscantokensfalse
+\let\tabu@arc@G \relax
+\let\tabu@drsc@G \relax
+\let\tabu@evr@G \@empty
+\let\tabu@rc@G \@empty
+\def\tabu@ls@G {\tabu@linestyle@}%
+\let\tabu@@rowfontreset \@empty % <init>
+\let\tabu@@celllalign \@empty
+\let\tabu@@cellralign \@empty
+\let\tabu@@cellleft \@empty
+\let\tabu@@cellright \@empty
+\def\tabu@naturalXmin {\z@}
+\def\tabu@naturalXmax {\z@}
+\let\tabu@rowfontreset \@empty
+\def\tabulineon {4pt}\let\tabulineoff \tabulineon
+\tabu@everyrowtrue
+\ifdefined\pdfelapsedtime % <pdfTeX>
+ \def\tabu@pdftimer {\xdef\tabu@starttime{\the\pdfelapsedtime}}%
+\else \let\tabu@pdftimer \relax \let\tabu@message@etime \relax
+\fi
+\tracingtabu=\z@
+\newtabulinestyle {=\maxdimen}% creates the 'factory' settings \tabu@linestyle@
+\tabulinestyle{}
+\taburowcolors{}
+\let\tabudefaulttarget \linewidth
+\ProcessOptions* % \ProcessOptions* is quicker !
+\endinput
+%%
+%% End of file `tabu.sty'.
diff --git a/templates/xml/compound.xsd b/templates/xml/compound.xsd
index 400bea5..f540c8a 100644
--- a/templates/xml/compound.xsd
+++ b/templates/xml/compound.xsd
@@ -33,6 +33,8 @@
<xsd:element name="templateparamlist" type="templateparamlistType" minOccurs="0" />
<xsd:element name="sectiondef" type="sectiondefType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="tableofcontents" type="tableofcontentsType" minOccurs="0" maxOccurs="1" />
+ <xsd:element name="requiresclause" type="linkedTextType" minOccurs="0" />
+ <xsd:element name="initializer" type="linkedTextType" minOccurs="0" />
<xsd:element name="briefdescription" type="descriptionType" minOccurs="0" />
<xsd:element name="detaileddescription" type="descriptionType" minOccurs="0" />
<xsd:element name="inheritancegraph" type="graphType" minOccurs="0" />
@@ -147,6 +149,7 @@
<xsd:element name="reimplementedby" type="reimplementType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="param" type="paramType" minOccurs="0" maxOccurs="unbounded" />
<xsd:element name="enumvalue" type="enumvalueType" minOccurs="0" maxOccurs="unbounded" />
+ <xsd:element name="requiresclause" type="linkedTextType" minOccurs="0" />
<xsd:element name="initializer" type="linkedTextType" minOccurs="0" />
<xsd:element name="exceptions" type="linkedTextType" minOccurs="0" />
<xsd:element name="briefdescription" type="descriptionType" minOccurs="0" />
@@ -509,6 +512,8 @@
<xsd:sequence>
<xsd:element name="listitem" type="docListItemType" maxOccurs="unbounded" />
</xsd:sequence>
+ <xsd:attribute name="type" type="DoxOlType" />
+ <xsd:attribute name="start" type="xsd:integer" />
</xsd:complexType>
<xsd:complexType name="docListItemType">
@@ -815,6 +820,7 @@
<xsd:enumeration value="page" />
<xsd:enumeration value="example" />
<xsd:enumeration value="dir" />
+ <xsd:enumeration value="concept" />
</xsd:restriction>
</xsd:simpleType>
@@ -963,5 +969,15 @@
</xsd:restriction>
</xsd:simpleType>
+ <xsd:simpleType name="DoxOlType">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="1" />
+ <xsd:enumeration value="a" />
+ <xsd:enumeration value="A" />
+ <xsd:enumeration value="i" />
+ <xsd:enumeration value="I" />
+ </xsd:restriction>
+ </xsd:simpleType>
+
</xsd:schema>
diff --git a/templates/xml/index.xsd b/templates/xml/index.xsd
index edb1d34..cfb7041 100644
--- a/templates/xml/index.xsd
+++ b/templates/xml/index.xsd
@@ -45,6 +45,7 @@
<xsd:enumeration value="example"/>
<xsd:enumeration value="dir"/>
<xsd:enumeration value="type"/>
+ <xsd:enumeration value="concept"/>
</xsd:restriction>
</xsd:simpleType>
diff --git a/testing/011/interface_integer.xml b/testing/011/interface_integer.xml
index 45833d8..786bc2a 100644
--- a/testing/011/interface_integer.xml
+++ b/testing/011/interface_integer.xml
@@ -59,26 +59,26 @@
<para>An interface </para>
</detaileddescription>
<inheritancegraph>
- <node id="2">
- <label>Object</label>
- </node>
<node id="1">
<label>Integer</label>
<link refid="interface_integer"/>
<childnode refid="2" relation="public-inheritance">
</childnode>
</node>
- </inheritancegraph>
- <collaborationgraph>
<node id="2">
<label>Object</label>
</node>
+ </inheritancegraph>
+ <collaborationgraph>
<node id="1">
<label>Integer</label>
<link refid="interface_integer"/>
<childnode refid="2" relation="public-inheritance">
</childnode>
</node>
+ <node id="2">
+ <label>Object</label>
+ </node>
</collaborationgraph>
<location file="011_category.m" line="6" column="12" bodyfile="011_category.m" bodystart="6" bodyend="-1"/>
<listofallmembers>
diff --git a/testing/014/indexpage.xml b/testing/014/indexpage.xml
index 3f9510c..a160b1a 100644
--- a/testing/014/indexpage.xml
+++ b/testing/014/indexpage.xml
@@ -42,7 +42,7 @@
<para>
<programlisting>
<codeline>
- <highlight class="normal">//<sp/>implicit<sp/>code<sp/>language</highlight>
+ <highlight class="comment">//<sp/>implicit<sp/>code<sp/>language</highlight>
</codeline>
</programlisting>
</para>
diff --git a/testing/027/struct_car.xml b/testing/027/struct_car.xml
index 8b203e5..a2d384d 100644
--- a/testing/027/struct_car.xml
+++ b/testing/027/struct_car.xml
@@ -27,30 +27,30 @@
<para><ref refid="struct_car" kindref="compound">Car</ref> class. </para>
</detaileddescription>
<inheritancegraph>
- <node id="2">
- <label>Vehicle</label>
- <link refid="struct_vehicle"/>
- <childnode refid="3" relation="public-inheritance">
- </childnode>
- </node>
- <node id="3">
- <label>Object</label>
- <link refid="struct_object"/>
- </node>
<node id="1">
<label>Car</label>
<link refid="struct_car"/>
<childnode refid="2" relation="public-inheritance">
</childnode>
</node>
- </inheritancegraph>
- <collaborationgraph>
+ <node id="3">
+ <label>Object</label>
+ <link refid="struct_object"/>
+ </node>
<node id="2">
<label>Vehicle</label>
<link refid="struct_vehicle"/>
<childnode refid="3" relation="public-inheritance">
</childnode>
- <childnode refid="3" relation="usage">
+ </node>
+ </inheritancegraph>
+ <collaborationgraph>
+ <node id="1">
+ <label>Car</label>
+ <link refid="struct_car"/>
+ <childnode refid="2" relation="public-inheritance">
+ </childnode>
+ <childnode refid="2" relation="usage">
<edgelabel>base</edgelabel>
</childnode>
</node>
@@ -58,12 +58,12 @@
<label>Object</label>
<link refid="struct_object"/>
</node>
- <node id="1">
- <label>Car</label>
- <link refid="struct_car"/>
- <childnode refid="2" relation="public-inheritance">
+ <node id="2">
+ <label>Vehicle</label>
+ <link refid="struct_vehicle"/>
+ <childnode refid="3" relation="public-inheritance">
</childnode>
- <childnode refid="2" relation="usage">
+ <childnode refid="3" relation="usage">
<edgelabel>base</edgelabel>
</childnode>
</node>
diff --git a/testing/027/struct_object.xml b/testing/027/struct_object.xml
index 7ab7e7a..36866ac 100644
--- a/testing/027/struct_object.xml
+++ b/testing/027/struct_object.xml
@@ -63,6 +63,16 @@
<para>Base object class. </para>
</detaileddescription>
<inheritancegraph>
+ <node id="3">
+ <label>Car</label>
+ <link refid="struct_car"/>
+ <childnode refid="2" relation="public-inheritance">
+ </childnode>
+ </node>
+ <node id="1">
+ <label>Object</label>
+ <link refid="struct_object"/>
+ </node>
<node id="4">
<label>Truck</label>
<link refid="struct_truck"/>
@@ -75,16 +85,6 @@
<childnode refid="1" relation="public-inheritance">
</childnode>
</node>
- <node id="1">
- <label>Object</label>
- <link refid="struct_object"/>
- </node>
- <node id="3">
- <label>Car</label>
- <link refid="struct_car"/>
- <childnode refid="2" relation="public-inheritance">
- </childnode>
- </node>
</inheritancegraph>
<location file="027_extends.c" line="19" column="1" bodyfile="027_extends.c" bodystart="20" bodyend="22"/>
<listofallmembers>
diff --git a/testing/027/struct_truck.xml b/testing/027/struct_truck.xml
index 588f425..2e10c7a 100644
--- a/testing/027/struct_truck.xml
+++ b/testing/027/struct_truck.xml
@@ -27,6 +27,10 @@
<para><ref refid="struct_truck" kindref="compound">Truck</ref> class. </para>
</detaileddescription>
<inheritancegraph>
+ <node id="3">
+ <label>Object</label>
+ <link refid="struct_object"/>
+ </node>
<node id="1">
<label>Truck</label>
<link refid="struct_truck"/>
@@ -39,12 +43,12 @@
<childnode refid="3" relation="public-inheritance">
</childnode>
</node>
+ </inheritancegraph>
+ <collaborationgraph>
<node id="3">
<label>Object</label>
<link refid="struct_object"/>
</node>
- </inheritancegraph>
- <collaborationgraph>
<node id="1">
<label>Truck</label>
<link refid="struct_truck"/>
@@ -63,10 +67,6 @@
<edgelabel>base</edgelabel>
</childnode>
</node>
- <node id="3">
- <label>Object</label>
- <link refid="struct_object"/>
- </node>
</collaborationgraph>
<location file="027_extends.c" line="77" column="1" bodyfile="027_extends.c" bodystart="78" bodyend="80"/>
<listofallmembers>
diff --git a/testing/027/struct_vehicle.xml b/testing/027/struct_vehicle.xml
index 380f3e7..9f9e27b 100644
--- a/testing/027/struct_vehicle.xml
+++ b/testing/027/struct_vehicle.xml
@@ -67,6 +67,16 @@
<para><ref refid="struct_vehicle" kindref="compound">Vehicle</ref> class. </para>
</detaileddescription>
<inheritancegraph>
+ <node id="3">
+ <label>Car</label>
+ <link refid="struct_car"/>
+ <childnode refid="1" relation="public-inheritance">
+ </childnode>
+ </node>
+ <node id="2">
+ <label>Object</label>
+ <link refid="struct_object"/>
+ </node>
<node id="4">
<label>Truck</label>
<link refid="struct_truck"/>
@@ -79,18 +89,12 @@
<childnode refid="2" relation="public-inheritance">
</childnode>
</node>
+ </inheritancegraph>
+ <collaborationgraph>
<node id="2">
<label>Object</label>
<link refid="struct_object"/>
</node>
- <node id="3">
- <label>Car</label>
- <link refid="struct_car"/>
- <childnode refid="1" relation="public-inheritance">
- </childnode>
- </node>
- </inheritancegraph>
- <collaborationgraph>
<node id="1">
<label>Vehicle</label>
<link refid="struct_vehicle"/>
@@ -100,10 +104,6 @@
<edgelabel>base</edgelabel>
</childnode>
</node>
- <node id="2">
- <label>Object</label>
- <link refid="struct_object"/>
- </node>
</collaborationgraph>
<location file="027_extends.c" line="43" column="1" bodyfile="027_extends.c" bodystart="44" bodyend="46"/>
<listofallmembers>
diff --git a/vhdlparser/CMakeLists.txt b/vhdlparser/CMakeLists.txt
index b610f5c..b7f831a 100644
--- a/vhdlparser/CMakeLists.txt
+++ b/vhdlparser/CMakeLists.txt
@@ -32,11 +32,14 @@ endif()
add_custom_command(
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/vhdlparser/vhdl_adj.py ${PROJECT_SOURCE_DIR}/vhdlparser/VhdlParser.cc ${GENERATED_SRC}/VhdlParser_adj.cc
DEPENDS ${PROJECT_SOURCE_DIR}/vhdlparser/VhdlParser.cc ${PROJECT_SOURCE_DIR}/vhdlparser/vhdl_adj.py
- OUTPUT ${GENERATED_SRC}/VhdlParser_adj.cc
+ OUTPUT ${GENERATED_SRC}/VhdlParser_adj.cc
)
set_source_files_properties(${GENERATED_SRC}/VhdlParser_adj.cc PROPERTIES GENERATED 1)
-include_directories(${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/qtools ${PROJECT_SOURCE_DIR}/vhdlparser ${GENERATED_SRC})
+include_directories(
+ ${PROJECT_SOURCE_DIR}/src
+ ${PROJECT_SOURCE_DIR}/vhdlparser
+ ${GENERATED_SRC})
add_library(vhdlparser STATIC
CharStream.cc
ParseException.cc
diff --git a/vhdlparser/VhdlParser.cc b/vhdlparser/VhdlParser.cc
index e039b33..16753ea 100644
--- a/vhdlparser/VhdlParser.cc
+++ b/vhdlparser/VhdlParser.cc
@@ -28,7 +28,7 @@ QCString VhdlParser::abstract_literal() {Token *tok;
tok = jj_consume_token(DECIMAL_LITERAL);
}
if (!hasError) {
-return tok->image.c_str();
+return QCString(tok->image);
}
break;
}
@@ -37,7 +37,7 @@ return tok->image.c_str();
tok = jj_consume_token(INTEGER);
}
if (!hasError) {
-return tok->image.c_str();
+return QCString(tok->image);
}
break;
}
@@ -46,7 +46,7 @@ return tok->image.c_str();
tok = jj_consume_token(BASED_LITERAL);
}
if (!hasError) {
-return tok->image.c_str();
+return QCString(tok->image);
}
break;
}
@@ -66,7 +66,7 @@ QCString VhdlParser::access_type_definition() {Token *tok=0;QCString str,str1;
if (!hasError) {
str1 = subtype_indication();
}
-str=tok->image.c_str(); return str+str1;
+str=tok->image; return str+str1;
assert(false);
}
@@ -78,7 +78,7 @@ QCString VhdlParser::actual_designator() {QCString str;Token *t=0;
t = jj_consume_token(OPEN_T);
}
if (!hasError) {
-return t->image.c_str();
+return QCString(t->image);
}
break;
}
@@ -241,7 +241,7 @@ s+=","+s1;
if (!hasError) {
jj_consume_token(RPAREN_T);
}
-return "("+s+")";
+return QCString("("+s+")");
assert(false);
}
@@ -330,7 +330,7 @@ return s;
tok = jj_consume_token(CHARACTER_LITERAL);
}
if (!hasError) {
-return tok->image.c_str();
+return QCString(tok->image);
}
break;
}
@@ -401,7 +401,7 @@ QCString t=s1+"::"+s;
m_sharedState->genLabels.resize(0);
outlineParser()->pushLabel(m_sharedState->genLabels,s1);
m_sharedState->lastCompound=m_sharedState->current;
- outlineParser()->addVhdlType(t,outlineParser()->getLine(ARCHITECTURE_T),Entry::CLASS_SEC,VhdlDocGen::ARCHITECTURE,0,0,Private);
+ outlineParser()->addVhdlType(t.data(),outlineParser()->getLine(ARCHITECTURE_T),Entry::CLASS_SEC,VhdlDocGen::ARCHITECTURE,0,0,Private);
}
if (!hasError) {
try {
@@ -724,7 +724,7 @@ return s;
tok = jj_consume_token(RANGE_T);
}
if (!hasError) {
-return tok->image.c_str();
+return QCString(tok->image);
}
break;
}
@@ -830,7 +830,7 @@ QCString VhdlParser::base() {Token *tok=0;
if (!hasError) {
tok = jj_consume_token(INTEGER);
}
-return tok->image.c_str();
+return QCString(tok->image);
assert(false);
}
@@ -839,7 +839,7 @@ QCString VhdlParser::base_specifier() {Token *tok=0;
if (!hasError) {
tok = jj_consume_token(BASIC_IDENTIFIER);
}
-return tok->image.c_str();
+return QCString(tok->image);
assert(false);
}
@@ -857,7 +857,7 @@ QCString VhdlParser::based_integer() {Token *tok=0;
if (!hasError) {
tok = jj_consume_token(BASIC_IDENTIFIER);
}
-return tok->image.c_str();
+return QCString(tok->image);
assert(false);
}
@@ -866,7 +866,7 @@ QCString VhdlParser::based_literal() {Token *tok=0;
if (!hasError) {
tok = jj_consume_token(BASED_LITERAL);
}
-return tok->image.c_str();
+return QCString(tok->image);
assert(false);
}
@@ -875,7 +875,7 @@ QCString VhdlParser::basic_identifier() {Token *tok=0;
if (!hasError) {
tok = jj_consume_token(BASIC_IDENTIFIER);
}
-return tok->image.c_str();
+return QCString(tok->image);
assert(false);
}
@@ -930,7 +930,7 @@ QCString VhdlParser::bit_string_literal() {Token *tok=0;
if (!hasError) {
tok = jj_consume_token(BIT_STRING_LITERAL);
}
-return tok->image.c_str();
+return QCString(tok->image);
assert(false);
}
@@ -939,7 +939,7 @@ QCString VhdlParser::bit_value() {Token *tok=0;
if (!hasError) {
tok = jj_consume_token(BASIC_IDENTIFIER);
}
-return tok->image.c_str();
+return QCString(tok->image);
assert(false);
}
@@ -1391,7 +1391,7 @@ void VhdlParser::case_statement() {QCString s;
}
if (!hasError) {
QCString ca="case "+s;
- FlowChart::addFlowChart(FlowChart::CASE_NO,0,ca);
+ FlowChart::addFlowChart(FlowChart::CASE_NO,QCString(),ca);
}
if (!hasError) {
jj_consume_token(IS_T);
@@ -1440,7 +1440,7 @@ QCString ca="case "+s;
jj_consume_token(SEMI_T);
}
FlowChart::moveToPrevLevel();
- FlowChart::addFlowChart(FlowChart::END_CASE,"end case",0);
+ FlowChart::addFlowChart(FlowChart::END_CASE,"end case",QCString());
}
@@ -1455,9 +1455,9 @@ void VhdlParser::case_statement_alternative() {QCString s;
jj_consume_token(ARROW_T);
}
if (!hasError) {
-QCString t="when ";
+QCString t("when ");
t+=s+"=> ";
- FlowChart::addFlowChart(FlowChart::WHEN_NO,s.data(),t);
+ FlowChart::addFlowChart(FlowChart::WHEN_NO,s,t);
}
if (!hasError) {
sequence_of_statement();
@@ -1470,7 +1470,7 @@ QCString VhdlParser::character_literal() {Token *tok=0;
if (!hasError) {
tok = jj_consume_token(CHARACTER_LITERAL);
}
-return tok->image.c_str();
+return QCString(tok->image);
assert(false);
}
@@ -1703,8 +1703,8 @@ void VhdlParser::component_instantiation_statement() {QCString s,s1;
if (!hasError) {
QCString s3;
if (s1.contains("|")) {
- s3=VhdlDocGen::getIndexWord(s1.data(),0);
- s1=VhdlDocGen::getIndexWord(s1.data(),1);
+ s3=VhdlDocGen::getIndexWord(s1,0);
+ s1=VhdlDocGen::getIndexWord(s1,1);
}
outlineParser()->addCompInst(s.lower().data(),s1.lower().data(),s3.data(),outlineParser()->getLine());
@@ -2337,7 +2337,7 @@ QCString VhdlParser::decimal_literal() {Token *tok=0;
if (!hasError) {
tok = jj_consume_token(DECIMAL_LITERAL);
}
-return tok->image.c_str();
+return QCString(tok->image);
assert(false);
}
@@ -2489,7 +2489,7 @@ QCString VhdlParser::direction() {Token *tok=0;
tok = jj_consume_token(TO_T);
}
if (!hasError) {
-return tok->image.c_str();
+return QCString(tok->image);
}
break;
}
@@ -2498,7 +2498,7 @@ return tok->image.c_str();
tok = jj_consume_token(DOWNTO_T);
}
if (!hasError) {
-return tok->image.c_str();
+return QCString(tok->image);
}
break;
}
@@ -2602,16 +2602,20 @@ QCString VhdlParser::element_declaration() {QCString rec_name,s1,s2;
if (!hasError) {
jj_consume_token(SEMI_T);
}
-QCString name;
- QCStringList ql=QCStringList::split(",",rec_name);
- for (uint j=0;j<ql.count();j++)
- {
- name=ql[j]+"~";
- name+=outlineParser()->getNameID().data();;
- outlineParser()->addVhdlType(name.data(),outlineParser()->getLine(),Entry::VARIABLE_SEC,VhdlDocGen::RECORD,0,s1.data(),Public);
- }
- s2=rec_name+":"+s1;
- return s2;
+auto ql = split(rec_name.str(),",");
+ for (const auto &n : ql)
+ {
+ std::string name=n+"~";
+ name+=outlineParser()->getNameID().data();
+ outlineParser()->addVhdlType(
+ name.c_str(),outlineParser()->getLine(),
+ Entry::VARIABLE_SEC,
+ VhdlDocGen::RECORD,0,
+ s1.data(),
+ Public);
+ }
+ s2=rec_name+":"+s1;
+ return s2;
assert(false);
}
@@ -2660,7 +2664,7 @@ return s;
s = name();
}
if (!hasError) {
-return tok->image.c_str()+s;
+return QCString(tok->image)+s;
}
break;
}
@@ -2669,7 +2673,7 @@ return tok->image.c_str()+s;
tok = jj_consume_token(OPEN_T);
}
if (!hasError) {
-return tok->image.c_str();
+return QCString(tok->image);
}
break;
}
@@ -3504,7 +3508,7 @@ QCString VhdlParser::exit_statement() {QCString s,s1,s2;Token *t=0;Token *t1=0;
m_sharedState->lab.resize(0);
if(t) s+=":";
if(t1) s2.prepend(" when ");
- FlowChart::addFlowChart(FlowChart::EXIT_NO,"exit",s2.data(),s1.data());
+ FlowChart::addFlowChart(FlowChart::EXIT_NO,"exit",s2,s1);
return s+s1+s2+";";
assert(false);
@@ -3617,7 +3621,7 @@ QCString VhdlParser::extended_identifier() {Token *t;
if (!hasError) {
t = jj_consume_token(EXTENDED_CHARACTER);
}
-return t->image.c_str();
+return QCString(t->image);
assert(false);
}
@@ -3856,7 +3860,7 @@ return s;
tok = jj_consume_token(INTEGER);
}
if (!hasError) {
-return tok->image.c_str();
+return QCString(tok->image);
}
break;
}
@@ -4254,7 +4258,7 @@ QCString VhdlParser::identifier() {Token *tok=0;
tok = jj_consume_token(EXTENDED_CHARACTER);
}
if (!hasError) {
-return tok->image.c_str();
+return QCString(tok->image);
}
break;
}
@@ -4263,7 +4267,7 @@ return tok->image.c_str();
tok = jj_consume_token(BASIC_IDENTIFIER);
}
if (!hasError) {
-return tok->image.c_str();
+return QCString(tok->image);
}
break;
}
@@ -4337,7 +4341,7 @@ void VhdlParser::if_statement() {QCString s,s1;
}
if (!hasError) {
s.prepend("if ");
- FlowChart::addFlowChart(FlowChart::IF_NO,0,s);
+ FlowChart::addFlowChart(FlowChart::IF_NO,QCString(),s);
}
if (!hasError) {
sequence_of_statement();
@@ -4364,7 +4368,7 @@ s.prepend("if ");
}
if (!hasError) {
s1.prepend("elsif ");
- FlowChart::addFlowChart(FlowChart::ELSIF_NO,0,s1.data());
+ FlowChart::addFlowChart(FlowChart::ELSIF_NO,QCString(),s1);
}
if (!hasError) {
sequence_of_statement();
@@ -4379,7 +4383,7 @@ s1.prepend("elsif ");
jj_consume_token(ELSE_T);
}
if (!hasError) {
-FlowChart::addFlowChart(FlowChart::ELSE_NO,0,0);
+FlowChart::addFlowChart(FlowChart::ELSE_NO,QCString(),QCString());
}
if (!hasError) {
sequence_of_statement();
@@ -4415,7 +4419,7 @@ FlowChart::addFlowChart(FlowChart::ELSE_NO,0,0);
jj_consume_token(SEMI_T);
}
FlowChart::moveToPrevLevel();
- FlowChart::addFlowChart(FlowChart::ENDIF_NO,0,0);
+ FlowChart::addFlowChart(FlowChart::ENDIF_NO,QCString(),QCString());
}
@@ -4434,7 +4438,7 @@ assert(false);
}
-QCString VhdlParser::index_constraint() {QCString s="("; QCString s1,s2;
+QCString VhdlParser::index_constraint() {QCString s("("); QCString s1,s2;
if (!hasError) {
jj_consume_token(LPAREN_T);
}
@@ -4656,7 +4660,7 @@ return s;
tok = jj_consume_token(OTHER_T);
}
if (!hasError) {
-return tok->image.c_str();
+return QCString(tok->image);
}
break;
}
@@ -4665,7 +4669,7 @@ return tok->image.c_str();
tok = jj_consume_token(ALL_T);
}
if (!hasError) {
-return tok->image.c_str();
+return QCString(tok->image);
}
break;
}
@@ -4682,7 +4686,7 @@ QCString VhdlParser::integer() {Token *t;
if (!hasError) {
t = jj_consume_token(INTEGER);
}
-return t->image.c_str();
+return QCString(t->image);
assert(false);
}
@@ -4786,7 +4790,7 @@ QCString VhdlParser::interface_file_declaration() {QCString s,s1;
s1 = subtype_indication();
}
outlineParser()->addVhdlType(s.data(),outlineParser()->getLine(),Entry::VARIABLE_SEC,VhdlDocGen::VFILE,0,s1.data(),Public);
- return " file "+s+":"+s1;
+ return QCString(" file "+s+":"+s1);
assert(false);
}
@@ -4925,7 +4929,7 @@ QCString VhdlParser::interface_variable_declaration() {Token *tok=0;Token *tok1=
}
}
if(tok)
- s5=tok->image.c_str();
+ s5=QCString(tok->image);
if(tok1)
s3=tok1->image.data();
@@ -4966,7 +4970,7 @@ QCString VhdlParser::iteration_scheme() {QCString s;
}
if (!hasError) {
s.prepend("while ");
- FlowChart::addFlowChart(FlowChart::WHILE_NO,0,s.data(),m_sharedState->lab.data());
+ FlowChart::addFlowChart(FlowChart::WHILE_NO,QCString(),s,m_sharedState->lab);
m_sharedState->lab="";
return s;
}
@@ -4981,7 +4985,7 @@ s.prepend("while ");
}
if (!hasError) {
QCString q=m_sharedState->lab+" for "+s;
- FlowChart::addFlowChart(FlowChart::FOR_NO,0,q.data(),m_sharedState->lab.data());
+ FlowChart::addFlowChart(FlowChart::FOR_NO,QCString(),q,m_sharedState->lab);
m_sharedState->lab="";
return q;
}
@@ -5155,7 +5159,7 @@ s+=":";
}
if (!hasError) {
if(s1.isEmpty())
- FlowChart::addFlowChart(FlowChart::LOOP_NO,0,"infinite");
+ FlowChart::addFlowChart(FlowChart::LOOP_NO,QCString(),"infinite");
}
if (!hasError) {
jj_consume_token(LOOP_T);
@@ -5189,7 +5193,7 @@ if(s1.isEmpty())
QCString q = s+" loop "+s2+" end loop" +s3;
QCString endLoop="end loop" + s3;
FlowChart::moveToPrevLevel();
- FlowChart::addFlowChart(FlowChart::END_LOOP,endLoop.data(),0);
+ FlowChart::addFlowChart(FlowChart::END_LOOP,endLoop,QCString());
return q;
assert(false);
}
@@ -5296,7 +5300,7 @@ QCString VhdlParser::multiplying_operation() {Token *tok=0;
tok = jj_consume_token(MULT_T);
}
if (!hasError) {
-return tok->image.c_str();
+return QCString(tok->image);
}
break;
}
@@ -5305,7 +5309,7 @@ return tok->image.c_str();
tok = jj_consume_token(SLASH_T);
}
if (!hasError) {
-return tok->image.c_str();
+return QCString(tok->image);
}
break;
}
@@ -5314,7 +5318,7 @@ return tok->image.c_str();
tok = jj_consume_token(MOD_T);
}
if (!hasError) {
-return tok->image.c_str();
+return QCString(tok->image);
}
break;
}
@@ -5323,7 +5327,7 @@ return tok->image.c_str();
tok = jj_consume_token(REM_T);
}
if (!hasError) {
-return tok->image.c_str();
+return QCString(tok->image);
}
break;
}
@@ -5676,7 +5680,7 @@ QCString VhdlParser::next_statement() {QCString s,s1,s2;Token *t=0;Token *t1=0;
jj_consume_token(SEMI_T);
}
if(t) s+=":";
- FlowChart::addFlowChart(FlowChart::NEXT_NO,"next ",s2.data(),s1.data());
+ FlowChart::addFlowChart(FlowChart::NEXT_NO,"next ",s2,s1);
m_sharedState->lab.resize(0);
if(t1) s2.prepend("when ");
return s+s1+s2+";";
@@ -5819,7 +5823,7 @@ QCString VhdlParser::operator_symbol() {Token *tok=0;
if (!hasError) {
tok = jj_consume_token(STRINGLITERAL);
}
-return tok->image.c_str();
+return QCString(tok->image);
assert(false);
}
@@ -5872,7 +5876,7 @@ void VhdlParser::package_body() {QCString s;
if (!hasError) {
m_sharedState->lastCompound=m_sharedState->current;
s.prepend("_");
- outlineParser()->addVhdlType(s,outlineParser()->getLine(),Entry::CLASS_SEC,VhdlDocGen::PACKAGE_BODY,0,0,Protected);
+ outlineParser()->addVhdlType(s.data(),outlineParser()->getLine(),Entry::CLASS_SEC,VhdlDocGen::PACKAGE_BODY,0,0,Protected);
}
if (!hasError) {
package_body_declarative_part();
@@ -6083,7 +6087,7 @@ m_sharedState->lastCompound=m_sharedState->current;
clone->bodyLine=outlineParser()->getLine(PACKAGE_T);
clone->protection=Package;
m_sharedState->current_root->moveToSubEntryAndKeep(clone);
- outlineParser()->addVhdlType(s,outlineParser()->getLine(PACKAGE_T),Entry::CLASS_SEC,VhdlDocGen::PACKAGE,0,0,Package);
+ outlineParser()->addVhdlType(s.data(),outlineParser()->getLine(PACKAGE_T),Entry::CLASS_SEC,VhdlDocGen::PACKAGE,0,0,Package);
}
if (!hasError) {
package_header();
@@ -6525,7 +6529,7 @@ return s;
allocator();
}
if (!hasError) {
-return "";
+return QCString();
}
} else {
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
@@ -6664,7 +6668,7 @@ QCString VhdlParser::process_declarative_item() {QCString s;
subprogram_declaration();
}
if (!hasError) {
-return "";
+return QCString();
}
break;
}
@@ -6902,8 +6906,8 @@ m_sharedState->currP=VhdlDocGen::PROCESS;
}
if (!hasError) {
if (s2.data())
- FlowChart::addFlowChart(FlowChart::VARIABLE_NO,s2.data(),0);
- FlowChart::addFlowChart(FlowChart::BEGIN_NO,"BEGIN",0);
+ FlowChart::addFlowChart(FlowChart::VARIABLE_NO,s2,QCString());
+ FlowChart::addFlowChart(FlowChart::BEGIN_NO,"BEGIN",QCString());
}
if (!hasError) {
jj_consume_token(BEGIN_T);
@@ -6957,8 +6961,8 @@ if(s.isEmpty())
m_sharedState->current->endBodyLine=outlineParser()->getLine();
m_sharedState->currP=0;
if(tok)
- s1=tok->image.data();
- outlineParser()->createFunction(m_sharedState->currName,VhdlDocGen::PROCESS,s1.data());
+ s1=tok->image;
+ outlineParser()->createFunction(m_sharedState->currName.data(),VhdlDocGen::PROCESS,s1.data());
outlineParser()->createFlow();
m_sharedState->currName="";
outlineParser()->newEntry();
@@ -7282,7 +7286,7 @@ return "?=";
jj_consume_token(QNEQU_T);
}
if (!hasError) {
-return "?/=";
+return "?/=";
}
break;
}
@@ -7674,42 +7678,42 @@ QCString VhdlParser::sequential_statement() {QCString s;
s = signal_assignment_statement();
}
if (!hasError) {
-FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
+FlowChart::addFlowChart(FlowChart::TEXT_NO,s,QCString());return s;
}
} else if (jj_2_85(3)) {
if (!hasError) {
s = assertion_statement();
}
if (!hasError) {
-FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
+FlowChart::addFlowChart(FlowChart::TEXT_NO,s,QCString());return s;
}
} else if (jj_2_86(3)) {
if (!hasError) {
s = report_statement();
}
if (!hasError) {
-FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
+FlowChart::addFlowChart(FlowChart::TEXT_NO,s,QCString());return s;
}
} else if (jj_2_87(3)) {
if (!hasError) {
s = wait_statement();
}
if (!hasError) {
-FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
+FlowChart::addFlowChart(FlowChart::TEXT_NO,s,QCString());return s;
}
} else if (jj_2_88(2147483647)) {
if (!hasError) {
s = variable_assignment_statement();
}
if (!hasError) {
-FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
+FlowChart::addFlowChart(FlowChart::TEXT_NO,s,QCString());return s;
}
} else if (jj_2_89(3)) {
if (!hasError) {
s = procedure_call_statement();
}
if (!hasError) {
-FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
+FlowChart::addFlowChart(FlowChart::TEXT_NO,s,QCString());return s;
}
} else if (jj_2_90(3)) {
if (!hasError) {
@@ -7751,7 +7755,7 @@ return s;
s = return_statement();
}
if (!hasError) {
-FlowChart::addFlowChart(FlowChart::RETURN_NO,s.data(),0);return s;
+FlowChart::addFlowChart(FlowChart::RETURN_NO,s,QCString());return s;
}
} else {
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
@@ -7762,7 +7766,7 @@ FlowChart::addFlowChart(FlowChart::RETURN_NO,s.data(),0);return s;
s = null_statement();
}
if (!hasError) {
-FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;
+FlowChart::addFlowChart(FlowChart::TEXT_NO,s,QCString());return s;
}
break;
}
@@ -7906,14 +7910,14 @@ QCString VhdlParser::signal_assignment_statement() {QCString s,s1,s2,s3;
conditional_signal_assignment_wave();
}
if (!hasError) {
-return "";
+return QCString();
}
} else if (jj_2_98(2147483647)) {
if (!hasError) {
selected_signal_assignment_wave();
}
if (!hasError) {
-return "";
+return QCString();
}
} else {
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
@@ -8273,7 +8277,7 @@ QCString VhdlParser::string_literal() {Token *tok=0;
if (!hasError) {
tok = jj_consume_token(STRINGLITERAL);
}
-return tok->image.c_str();
+return QCString(tok->image);
assert(false);
}
@@ -8289,9 +8293,9 @@ void VhdlParser::subprogram_body() {QCString s;
if (!hasError) {
if (s.data())
{
- FlowChart::addFlowChart(FlowChart::VARIABLE_NO,s,0);
+ FlowChart::addFlowChart(FlowChart::VARIABLE_NO,s,QCString());
}
- FlowChart::addFlowChart(FlowChart::BEGIN_NO,"BEGIN",0);
+ FlowChart::addFlowChart(FlowChart::BEGIN_NO,"BEGIN",QCString());
}
if (!hasError) {
jj_consume_token(BEGIN_T);
@@ -8403,7 +8407,7 @@ QCString VhdlParser::subprogram_declarative_item() {QCString s;
subprogram_declaration();
}
if (!hasError) {
-return "";
+return QCString();
}
break;
}
@@ -8421,7 +8425,7 @@ return s;
subprogram_body();
}
if (!hasError) {
-return "";
+return QCString();
}
break;
}
@@ -9048,7 +9052,6 @@ QCString VhdlParser::type_definition() {QCString s;
case RANGE_T:
case LPAREN_T:{
if (!hasError) {
- //try{
s = scalar_type_definition();
}
if (!hasError) {
@@ -9091,7 +9094,7 @@ return s;
protected_type_body();
}
if (!hasError) {
-return "";
+return QCString();
}
} else {
switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
@@ -9100,7 +9103,7 @@ return "";
protected_type_declaration();
}
if (!hasError) {
-return "";
+return QCString();
}
break;
}
@@ -9204,14 +9207,22 @@ s+=",";s+=s1;
if (!hasError) {
jj_consume_token(SEMI_T);
}
-QCStringList ql1=QCStringList::split(",",s);
- for (uint j=0;j<ql1.count();j++)
+auto ql1=split(s.str(),",");
+ for (const auto &name : ql1)
{
- QCStringList ql=QCStringList::split(".",ql1[j]);
- QCString it=ql[1];
- if ( m_sharedState->parse_sec==0 && Config_getBool(SHOW_INCLUDE_FILES) )
+ auto ql2=split(name,".");
+ if (ql2.size()>1)
{
- outlineParser()->addVhdlType(it.data(),outlineParser()->getLine(),Entry::VARIABLE_SEC,VhdlDocGen::USE,it.data(),"_use_",Public);
+ std::string it=ql2[1];
+ if ( m_sharedState->parse_sec==0 && Config_getBool(SHOW_INCLUDE_FILES) )
+ {
+ outlineParser()->addVhdlType(it.c_str(),
+ outlineParser()->getLine(),
+ Entry::VARIABLE_SEC,
+ VhdlDocGen::USE,
+ it.c_str(),
+ "_use_",Public);
+ }
}
}
s1="use "+s;
@@ -9264,7 +9275,7 @@ return s+s1+":="+s2+";";
selected_variable_assignment();
}
if (!hasError) {
-return "";
+return QCString();
}
break;
}
@@ -9551,7 +9562,7 @@ QCString VhdlParser::protected_type_body() {
;
}
}
-return "";
+return QCString();
assert(false);
}
@@ -9724,7 +9735,7 @@ outlineParser()->error_skipto(END_T);
;
}
}
-return "";
+return QCString();
assert(false);
}
@@ -10403,7 +10414,7 @@ QCString VhdlParser::sig_stat() {Token *t;
t = jj_consume_token(CONSTANT_T);
}
if (!hasError) {
-return t->image.data();
+return QCString(t->image);
}
break;
}
@@ -10412,7 +10423,7 @@ return t->image.data();
t = jj_consume_token(SIGNAL_T);
}
if (!hasError) {
-return t->image.data();
+return QCString(t->image);
}
break;
}
@@ -10421,7 +10432,7 @@ return t->image.data();
t = jj_consume_token(VARIABLE_T);
}
if (!hasError) {
-return t->image.data();
+return QCString(t->image);
}
break;
}
@@ -11314,7 +11325,7 @@ QCString q;
if (a>b) b=a;
outlineParser()->addVhdlType(m_sharedState->current->name.data(),b,Entry::VARIABLE_SEC,VhdlDocGen::GENERIC,ss.data(),0,Public);
}
- m_sharedState->currP=0;return "";
+ m_sharedState->currP=0;return QCString();
assert(false);
}
diff --git a/vhdlparser/VhdlParser.h b/vhdlparser/VhdlParser.h
index 891b085..c2f2cb2 100644
--- a/vhdlparser/VhdlParser.h
+++ b/vhdlparser/VhdlParser.h
@@ -1407,16 +1407,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_97()
- {
- if (jj_done) return true;
- if (jj_scan_token(FILE_T)) return true;
- if (jj_3R_205()) return true;
- if (jj_scan_token(COLON_T)) return true;
- if (jj_3R_89()) return true;
- return false;
- }
-
inline bool jj_3R_693()
{
if (jj_done) return true;
@@ -1424,17 +1414,20 @@ void parseInline();
return false;
}
- inline bool jj_3R_414()
+ inline bool jj_3R_97()
{
if (jj_done) return true;
- if (jj_3R_513()) return true;
+ if (jj_scan_token(FILE_T)) return true;
+ if (jj_3R_205()) return true;
+ if (jj_scan_token(COLON_T)) return true;
+ if (jj_3R_89()) return true;
return false;
}
- inline bool jj_3_46()
+ inline bool jj_3R_414()
{
if (jj_done) return true;
- if (jj_3R_98()) return true;
+ if (jj_3R_513()) return true;
return false;
}
@@ -1450,6 +1443,13 @@ void parseInline();
return false;
}
+ inline bool jj_3_46()
+ {
+ if (jj_done) return true;
+ if (jj_3R_98()) return true;
+ return false;
+ }
+
inline bool jj_3R_572()
{
if (jj_done) return true;
@@ -1528,24 +1528,24 @@ void parseInline();
return false;
}
- inline bool jj_3R_427()
+ inline bool jj_3R_631()
{
if (jj_done) return true;
- if (jj_scan_token(ALL_T)) return true;
+ if (jj_3R_74()) return true;
return false;
}
- inline bool jj_3R_426()
+ inline bool jj_3R_427()
{
if (jj_done) return true;
- if (jj_scan_token(OTHER_T)) return true;
+ if (jj_scan_token(ALL_T)) return true;
return false;
}
- inline bool jj_3R_631()
+ inline bool jj_3R_426()
{
if (jj_done) return true;
- if (jj_3R_74()) return true;
+ if (jj_scan_token(OTHER_T)) return true;
return false;
}
@@ -1629,56 +1629,56 @@ void parseInline();
return false;
}
- inline bool jj_3R_628()
+ inline bool jj_3R_535()
{
if (jj_done) return true;
- if (jj_3R_61()) return true;
+ if (jj_scan_token(LPAREN_T)) return true;
+ if (jj_3R_327()) return true;
+ if (jj_scan_token(RPAREN_T)) return true;
return false;
}
- inline bool jj_3R_627()
+ inline bool jj_3R_628()
{
if (jj_done) return true;
- if (jj_3R_72()) return true;
+ if (jj_3R_61()) return true;
return false;
}
- inline bool jj_3R_577()
+ inline bool jj_3_125()
{
if (jj_done) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (!jj_3R_627()) return false;
- jj_scanpos = xsp;
- if (jj_3R_628()) return true;
+ if (jj_3R_61()) return true;
+ if (jj_scan_token(WHEN_T)) return true;
return false;
}
- inline bool jj_3R_535()
+ inline bool jj_3R_442()
{
if (jj_done) return true;
- if (jj_scan_token(LPAREN_T)) return true;
- if (jj_3R_327()) return true;
- if (jj_scan_token(RPAREN_T)) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (jj_scan_token(77)) jj_scanpos = xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_535()) jj_scanpos = xsp;
return false;
}
- inline bool jj_3_125()
+ inline bool jj_3R_627()
{
if (jj_done) return true;
- if (jj_3R_61()) return true;
- if (jj_scan_token(WHEN_T)) return true;
+ if (jj_3R_72()) return true;
return false;
}
- inline bool jj_3R_442()
+ inline bool jj_3R_577()
{
if (jj_done) return true;
Token * xsp;
xsp = jj_scanpos;
- if (jj_scan_token(77)) jj_scanpos = xsp;
- xsp = jj_scanpos;
- if (jj_3R_535()) jj_scanpos = xsp;
+ if (!jj_3R_627()) return false;
+ jj_scanpos = xsp;
+ if (jj_3R_628()) return true;
return false;
}
@@ -1696,15 +1696,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_547()
- {
- if (jj_done) return true;
- if (jj_scan_token(TYPE_T)) return true;
- if (jj_3R_74()) return true;
- if (jj_scan_token(SEMI_T)) return true;
- return false;
- }
-
inline bool jj_3R_401()
{
if (jj_done) return true;
@@ -1719,19 +1710,20 @@ void parseInline();
return false;
}
- inline bool jj_3R_546()
+ inline bool jj_3R_547()
{
if (jj_done) return true;
- if (jj_scan_token(COMMA_T)) return true;
- if (jj_3R_466()) return true;
+ if (jj_scan_token(TYPE_T)) return true;
+ if (jj_3R_74()) return true;
+ if (jj_scan_token(SEMI_T)) return true;
return false;
}
- inline bool jj_3R_630()
+ inline bool jj_3R_546()
{
if (jj_done) return true;
- if (jj_scan_token(ELSE_T)) return true;
- if (jj_3R_268()) return true;
+ if (jj_scan_token(COMMA_T)) return true;
+ if (jj_3R_466()) return true;
return false;
}
@@ -1750,6 +1742,14 @@ void parseInline();
return false;
}
+ inline bool jj_3R_630()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(ELSE_T)) return true;
+ if (jj_3R_268()) return true;
+ return false;
+ }
+
inline bool jj_3R_443()
{
if (jj_done) return true;
@@ -1761,16 +1761,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_629()
- {
- if (jj_done) return true;
- if (jj_scan_token(ELSIF_T)) return true;
- if (jj_3R_83()) return true;
- if (jj_scan_token(THEN_T)) return true;
- if (jj_3R_268()) return true;
- return false;
- }
-
inline bool jj_3R_361()
{
if (jj_done) return true;
@@ -1787,6 +1777,16 @@ void parseInline();
return false;
}
+ inline bool jj_3R_629()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(ELSIF_T)) return true;
+ if (jj_3R_83()) return true;
+ if (jj_scan_token(THEN_T)) return true;
+ if (jj_3R_268()) return true;
+ return false;
+ }
+
inline bool jj_3R_362()
{
if (jj_done) return true;
@@ -1804,6 +1804,31 @@ void parseInline();
return false;
}
+ inline bool jj_3R_203()
+ {
+ if (jj_done) return true;
+ if (jj_3R_361()) return true;
+ return false;
+ }
+
+ inline bool jj_3R_202()
+ {
+ if (jj_done) return true;
+ if (jj_3R_360()) return true;
+ return false;
+ }
+
+ inline bool jj_3R_94()
+ {
+ if (jj_done) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (!jj_3R_202()) return false;
+ jj_scanpos = xsp;
+ if (jj_3R_203()) return true;
+ return false;
+ }
+
inline bool jj_3R_264()
{
if (jj_done) return true;
@@ -1836,31 +1861,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_203()
- {
- if (jj_done) return true;
- if (jj_3R_361()) return true;
- return false;
- }
-
- inline bool jj_3R_202()
- {
- if (jj_done) return true;
- if (jj_3R_360()) return true;
- return false;
- }
-
- inline bool jj_3R_94()
- {
- if (jj_done) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (!jj_3R_202()) return false;
- jj_scanpos = xsp;
- if (jj_3R_203()) return true;
- return false;
- }
-
inline bool jj_3R_205()
{
if (jj_done) return true;
@@ -1884,13 +1884,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_171()
- {
- if (jj_done) return true;
- if (jj_scan_token(BASIC_IDENTIFIER)) return true;
- return false;
- }
-
inline bool jj_3R_400()
{
if (jj_done) return true;
@@ -1903,6 +1896,13 @@ void parseInline();
return false;
}
+ inline bool jj_3R_171()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(BASIC_IDENTIFIER)) return true;
+ return false;
+ }
+
inline bool jj_3R_170()
{
if (jj_done) return true;
@@ -1962,19 +1962,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_68()
- {
- if (jj_done) return true;
- if (jj_scan_token(GROUP_T)) return true;
- if (jj_3R_74()) return true;
- if (jj_scan_token(IS_T)) return true;
- if (jj_scan_token(LPAREN_T)) return true;
- if (jj_3R_491()) return true;
- if (jj_scan_token(RPAREN_T)) return true;
- if (jj_scan_token(SEMI_T)) return true;
- return false;
- }
-
inline bool jj_3R_317()
{
if (jj_done) return true;
@@ -1993,15 +1980,14 @@ void parseInline();
return false;
}
- inline bool jj_3R_398()
+ inline bool jj_3R_68()
{
if (jj_done) return true;
if (jj_scan_token(GROUP_T)) return true;
if (jj_3R_74()) return true;
- if (jj_scan_token(COLON_T)) return true;
- if (jj_3R_74()) return true;
+ if (jj_scan_token(IS_T)) return true;
if (jj_scan_token(LPAREN_T)) return true;
- if (jj_3R_492()) return true;
+ if (jj_3R_491()) return true;
if (jj_scan_token(RPAREN_T)) return true;
if (jj_scan_token(SEMI_T)) return true;
return false;
@@ -2025,15 +2011,17 @@ void parseInline();
return false;
}
- inline bool jj_3R_492()
+ inline bool jj_3R_398()
{
if (jj_done) return true;
- if (jj_3R_559()) return true;
- Token * xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_560()) { jj_scanpos = xsp; break; }
- }
+ if (jj_scan_token(GROUP_T)) return true;
+ if (jj_3R_74()) return true;
+ if (jj_scan_token(COLON_T)) return true;
+ if (jj_3R_74()) return true;
+ if (jj_scan_token(LPAREN_T)) return true;
+ if (jj_3R_492()) return true;
+ if (jj_scan_token(RPAREN_T)) return true;
+ if (jj_scan_token(SEMI_T)) return true;
return false;
}
@@ -2061,28 +2049,15 @@ void parseInline();
return false;
}
- inline bool jj_3R_620()
- {
- if (jj_done) return true;
- if (jj_3R_369()) return true;
- return false;
- }
-
- inline bool jj_3R_619()
- {
- if (jj_done) return true;
- if (jj_3R_63()) return true;
- return false;
- }
-
- inline bool jj_3R_559()
+ inline bool jj_3R_492()
{
if (jj_done) return true;
+ if (jj_3R_559()) return true;
Token * xsp;
- xsp = jj_scanpos;
- if (!jj_3R_619()) return false;
- jj_scanpos = xsp;
- if (jj_3R_620()) return true;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_560()) { jj_scanpos = xsp; break; }
+ }
return false;
}
@@ -2093,14 +2068,10 @@ void parseInline();
return false;
}
- inline bool jj_3R_73()
+ inline bool jj_3R_620()
{
if (jj_done) return true;
- if (jj_scan_token(GENERIC_T)) return true;
- if (jj_scan_token(MAP_T)) return true;
- if (jj_scan_token(LPAREN_T)) return true;
- if (jj_3R_169()) return true;
- if (jj_scan_token(RPAREN_T)) return true;
+ if (jj_3R_369()) return true;
return false;
}
@@ -2130,6 +2101,35 @@ void parseInline();
return false;
}
+ inline bool jj_3R_619()
+ {
+ if (jj_done) return true;
+ if (jj_3R_63()) return true;
+ return false;
+ }
+
+ inline bool jj_3R_559()
+ {
+ if (jj_done) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (!jj_3R_619()) return false;
+ jj_scanpos = xsp;
+ if (jj_3R_620()) return true;
+ return false;
+ }
+
+ inline bool jj_3R_73()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(GENERIC_T)) return true;
+ if (jj_scan_token(MAP_T)) return true;
+ if (jj_scan_token(LPAREN_T)) return true;
+ if (jj_3R_169()) return true;
+ if (jj_scan_token(RPAREN_T)) return true;
+ return false;
+ }
+
inline bool jj_3R_587()
{
if (jj_done) return true;
@@ -2160,21 +2160,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_162()
- {
- if (jj_done) return true;
- if (jj_3R_327()) return true;
- return false;
- }
-
- inline bool jj_3_39()
- {
- if (jj_done) return true;
- if (jj_3R_74()) return true;
- if (jj_scan_token(COLON_T)) return true;
- return false;
- }
-
inline bool jj_3R_314()
{
if (jj_done) return true;
@@ -2198,6 +2183,13 @@ void parseInline();
return false;
}
+ inline bool jj_3R_162()
+ {
+ if (jj_done) return true;
+ if (jj_3R_327()) return true;
+ return false;
+ }
+
inline bool jj_3R_464()
{
if (jj_done) return true;
@@ -2205,14 +2197,11 @@ void parseInline();
return false;
}
- inline bool jj_3R_69()
+ inline bool jj_3_39()
{
if (jj_done) return true;
- if (jj_scan_token(GENERIC_T)) return true;
- if (jj_scan_token(LPAREN_T)) return true;
- if (jj_3R_162()) return true;
- if (jj_scan_token(RPAREN_T)) return true;
- if (jj_scan_token(SEMI_T)) return true;
+ if (jj_3R_74()) return true;
+ if (jj_scan_token(COLON_T)) return true;
return false;
}
@@ -2241,6 +2230,17 @@ void parseInline();
return false;
}
+ inline bool jj_3R_69()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(GENERIC_T)) return true;
+ if (jj_scan_token(LPAREN_T)) return true;
+ if (jj_3R_162()) return true;
+ if (jj_scan_token(RPAREN_T)) return true;
+ if (jj_scan_token(SEMI_T)) return true;
+ return false;
+ }
+
inline bool jj_3R_336()
{
if (jj_done) return true;
@@ -2248,6 +2248,13 @@ void parseInline();
return false;
}
+ inline bool jj_3R_462()
+ {
+ if (jj_done) return true;
+ if (jj_3R_420()) return true;
+ return false;
+ }
+
inline bool jj_3R_174()
{
if (jj_done) return true;
@@ -2266,13 +2273,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_462()
- {
- if (jj_done) return true;
- if (jj_3R_420()) return true;
- return false;
- }
-
inline bool jj_3R_149()
{
if (jj_done) return true;
@@ -2301,15 +2301,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_78()
- {
- if (jj_done) return true;
- if (jj_3R_74()) return true;
- if (jj_scan_token(COLON_T)) return true;
- if (jj_3R_174()) return true;
- return false;
- }
-
inline bool jj_3_122()
{
if (jj_done) return true;
@@ -2317,13 +2308,12 @@ void parseInline();
return false;
}
- inline bool jj_3R_110()
+ inline bool jj_3R_78()
{
if (jj_done) return true;
- if (jj_3R_63()) return true;
- if (jj_scan_token(LPAREN_T)) return true;
- if (jj_3R_236()) return true;
- if (jj_scan_token(RPAREN_T)) return true;
+ if (jj_3R_74()) return true;
+ if (jj_scan_token(COLON_T)) return true;
+ if (jj_3R_174()) return true;
return false;
}
@@ -2344,6 +2334,16 @@ void parseInline();
return false;
}
+ inline bool jj_3R_110()
+ {
+ if (jj_done) return true;
+ if (jj_3R_63()) return true;
+ if (jj_scan_token(LPAREN_T)) return true;
+ if (jj_3R_236()) return true;
+ if (jj_scan_token(RPAREN_T)) return true;
+ return false;
+ }
+
inline bool jj_3R_278()
{
if (jj_done) return true;
@@ -2377,13 +2377,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_481()
- {
- if (jj_done) return true;
- if (jj_3R_549()) return true;
- return false;
- }
-
inline bool jj_3R_313()
{
if (jj_done) return true;
@@ -2400,6 +2393,13 @@ void parseInline();
return false;
}
+ inline bool jj_3R_481()
+ {
+ if (jj_done) return true;
+ if (jj_3R_549()) return true;
+ return false;
+ }
+
inline bool jj_3R_147()
{
if (jj_done) return true;
@@ -2420,6 +2420,16 @@ void parseInline();
return false;
}
+ inline bool jj_3R_148()
+ {
+ if (jj_done) return true;
+ if (jj_3R_74()) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_313()) jj_scanpos = xsp;
+ return false;
+ }
+
inline bool jj_3R_592()
{
if (jj_done) return true;
@@ -2436,13 +2446,11 @@ void parseInline();
return false;
}
- inline bool jj_3R_148()
+ inline bool jj_3R_647()
{
if (jj_done) return true;
- if (jj_3R_74()) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (jj_3R_313()) jj_scanpos = xsp;
+ if (jj_scan_token(NEG_T)) return true;
+ if (jj_scan_token(DOT_T)) return true;
return false;
}
@@ -2457,14 +2465,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_647()
- {
- if (jj_done) return true;
- if (jj_scan_token(NEG_T)) return true;
- if (jj_scan_token(DOT_T)) return true;
- return false;
- }
-
inline bool jj_3R_623()
{
if (jj_done) return true;
@@ -2477,16 +2477,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_66()
- {
- if (jj_done) return true;
- if (jj_3R_63()) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (jj_3R_160()) jj_scanpos = xsp;
- return false;
- }
-
inline bool jj_3_119()
{
if (jj_done) return true;
@@ -2506,63 +2496,73 @@ void parseInline();
return false;
}
- inline bool jj_3R_582()
+ inline bool jj_3R_66()
{
if (jj_done) return true;
- if (jj_3R_327()) return true;
+ if (jj_3R_63()) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_160()) jj_scanpos = xsp;
return false;
}
- inline bool jj_3R_413()
+ inline bool jj_3R_622()
{
if (jj_done) return true;
- if (jj_scan_token(INTEGER)) return true;
+ if (jj_scan_token(DOT_T)) return true;
+ if (jj_3R_74()) return true;
return false;
}
- inline bool jj_3R_622()
+ inline bool jj_3R_582()
+ {
+ if (jj_done) return true;
+ if (jj_3R_327()) return true;
+ return false;
+ }
+
+ inline bool jj_3R_621()
{
if (jj_done) return true;
if (jj_scan_token(DOT_T)) return true;
+ if (jj_3R_147()) return true;
if (jj_3R_74()) return true;
return false;
}
- inline bool jj_3R_326()
+ inline bool jj_3R_568()
{
if (jj_done) return true;
Token * xsp;
xsp = jj_scanpos;
- if (!jj_3R_412()) return false;
+ if (!jj_3R_621()) return false;
jj_scanpos = xsp;
- if (jj_3R_413()) return true;
+ if (jj_3R_622()) return true;
return false;
}
- inline bool jj_3R_412()
+ inline bool jj_3R_413()
{
if (jj_done) return true;
- if (jj_3R_63()) return true;
+ if (jj_scan_token(INTEGER)) return true;
return false;
}
- inline bool jj_3R_621()
+ inline bool jj_3R_326()
{
if (jj_done) return true;
- if (jj_scan_token(DOT_T)) return true;
- if (jj_3R_147()) return true;
- if (jj_3R_74()) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (!jj_3R_412()) return false;
+ jj_scanpos = xsp;
+ if (jj_3R_413()) return true;
return false;
}
- inline bool jj_3R_568()
+ inline bool jj_3R_412()
{
if (jj_done) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (!jj_3R_621()) return false;
- jj_scanpos = xsp;
- if (jj_3R_622()) return true;
+ if (jj_3R_63()) return true;
return false;
}
@@ -2614,15 +2614,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_659()
- {
- if (jj_done) return true;
- if (jj_scan_token(FILE_T)) return true;
- if (jj_scan_token(OF_T)) return true;
- if (jj_3R_161()) return true;
- return false;
- }
-
inline bool jj_3R_508()
{
if (jj_done) return true;
@@ -2630,14 +2621,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_591()
- {
- if (jj_done) return true;
- if (jj_scan_token(OPEN_T)) return true;
- if (jj_3R_61()) return true;
- return false;
- }
-
inline bool jj_3R_410()
{
if (jj_done) return true;
@@ -2658,6 +2641,23 @@ void parseInline();
return false;
}
+ inline bool jj_3R_659()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(FILE_T)) return true;
+ if (jj_scan_token(OF_T)) return true;
+ if (jj_3R_161()) return true;
+ return false;
+ }
+
+ inline bool jj_3R_591()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(OPEN_T)) return true;
+ if (jj_3R_61()) return true;
+ return false;
+ }
+
inline bool jj_3R_549()
{
if (jj_done) return true;
@@ -2671,13 +2671,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_593()
- {
- if (jj_done) return true;
- if (jj_3R_61()) return true;
- return false;
- }
-
inline bool jj_3_114()
{
if (jj_done) return true;
@@ -2693,6 +2686,13 @@ void parseInline();
return false;
}
+ inline bool jj_3R_593()
+ {
+ if (jj_done) return true;
+ if (jj_3R_61()) return true;
+ return false;
+ }
+
inline bool jj_3R_323()
{
if (jj_done) return true;
@@ -2713,6 +2713,13 @@ void parseInline();
return false;
}
+ inline bool jj_3R_284()
+ {
+ if (jj_done) return true;
+ if (jj_3R_137()) return true;
+ return false;
+ }
+
inline bool jj_3R_467()
{
if (jj_done) return true;
@@ -2735,10 +2742,10 @@ void parseInline();
return false;
}
- inline bool jj_3R_284()
+ inline bool jj_3_116()
{
if (jj_done) return true;
- if (jj_3R_137()) return true;
+ if (jj_3R_146()) return true;
return false;
}
@@ -2749,13 +2756,6 @@ void parseInline();
return false;
}
- inline bool jj_3_116()
- {
- if (jj_done) return true;
- if (jj_3R_146()) return true;
- return false;
- }
-
inline bool jj_3R_295()
{
if (jj_done) return true;
@@ -2815,6 +2815,13 @@ void parseInline();
return false;
}
+ inline bool jj_3R_296()
+ {
+ if (jj_done) return true;
+ if (jj_3R_74()) return true;
+ return false;
+ }
+
inline bool jj_3R_251()
{
if (jj_done) return true;
@@ -2823,6 +2830,13 @@ void parseInline();
return false;
}
+ inline bool jj_3R_246()
+ {
+ if (jj_done) return true;
+ if (jj_3R_137()) return true;
+ return false;
+ }
+
inline bool jj_3R_152()
{
if (jj_done) return true;
@@ -2831,10 +2845,11 @@ void parseInline();
return false;
}
- inline bool jj_3R_296()
+ inline bool jj_3_115()
{
if (jj_done) return true;
- if (jj_3R_74()) return true;
+ if (jj_3R_145()) return true;
+ if (jj_scan_token(COLON_T)) return true;
return false;
}
@@ -2859,32 +2874,42 @@ void parseInline();
return false;
}
- inline bool jj_3R_246()
+ inline bool jj_3R_406()
{
if (jj_done) return true;
- if (jj_3R_137()) return true;
+ if (jj_scan_token(NOR_T)) return true;
return false;
}
- inline bool jj_3R_406()
+ inline bool jj_3R_405()
{
if (jj_done) return true;
- if (jj_scan_token(NOR_T)) return true;
+ if (jj_scan_token(NAND_T)) return true;
return false;
}
- inline bool jj_3_115()
+ inline bool jj_3R_144()
{
if (jj_done) return true;
- if (jj_3R_145()) return true;
- if (jj_scan_token(COLON_T)) return true;
+ if (jj_scan_token(END_T)) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_296()) jj_scanpos = xsp;
+ if (jj_scan_token(SEMI_T)) return true;
return false;
}
- inline bool jj_3R_405()
+ inline bool jj_3R_648()
{
if (jj_done) return true;
- if (jj_scan_token(NAND_T)) return true;
+ if (jj_3R_137()) return true;
+ return false;
+ }
+
+ inline bool jj_3R_188()
+ {
+ if (jj_done) return true;
+ if (jj_3R_349()) return true;
return false;
}
@@ -2914,31 +2939,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_144()
- {
- if (jj_done) return true;
- if (jj_scan_token(END_T)) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (jj_3R_296()) jj_scanpos = xsp;
- if (jj_scan_token(SEMI_T)) return true;
- return false;
- }
-
- inline bool jj_3R_648()
- {
- if (jj_done) return true;
- if (jj_3R_137()) return true;
- return false;
- }
-
- inline bool jj_3R_188()
- {
- if (jj_done) return true;
- if (jj_3R_349()) return true;
- return false;
- }
-
inline bool jj_3R_61()
{
if (jj_done) return true;
@@ -2982,6 +2982,16 @@ void parseInline();
return false;
}
+ inline bool jj_3R_136()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(GENERIC_T)) return true;
+ if (jj_scan_token(LPAREN_T)) return true;
+ if (jj_3R_327()) return true;
+ if (jj_scan_token(RPAREN_T)) return true;
+ return false;
+ }
+
inline bool jj_3R_116()
{
if (jj_done) return true;
@@ -2996,20 +3006,21 @@ void parseInline();
return false;
}
- inline bool jj_3R_136()
+ inline bool jj_3R_218()
{
if (jj_done) return true;
- if (jj_scan_token(GENERIC_T)) return true;
- if (jj_scan_token(LPAREN_T)) return true;
- if (jj_3R_327()) return true;
- if (jj_scan_token(RPAREN_T)) return true;
+ if (jj_3R_369()) return true;
return false;
}
- inline bool jj_3R_218()
+ inline bool jj_3R_137()
{
if (jj_done) return true;
- if (jj_3R_369()) return true;
+ if (jj_scan_token(GENERIC_T)) return true;
+ if (jj_scan_token(MAP_T)) return true;
+ if (jj_scan_token(LPAREN_T)) return true;
+ if (jj_3R_169()) return true;
+ if (jj_scan_token(RPAREN_T)) return true;
return false;
}
@@ -3031,17 +3042,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_137()
- {
- if (jj_done) return true;
- if (jj_scan_token(GENERIC_T)) return true;
- if (jj_scan_token(MAP_T)) return true;
- if (jj_scan_token(LPAREN_T)) return true;
- if (jj_3R_169()) return true;
- if (jj_scan_token(RPAREN_T)) return true;
- return false;
- }
-
inline bool jj_3R_685()
{
if (jj_done) return true;
@@ -3067,6 +3067,22 @@ void parseInline();
return false;
}
+ inline bool jj_3R_135()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(FUNCTION_T)) return true;
+ if (jj_3R_74()) return true;
+ if (jj_scan_token(IS_T)) return true;
+ if (jj_scan_token(NEW_T)) return true;
+ if (jj_3R_63()) return true;
+ if (jj_3R_245()) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_284()) jj_scanpos = xsp;
+ if (jj_scan_token(SEMI_T)) return true;
+ return false;
+ }
+
inline bool jj_3R_645()
{
if (jj_done) return true;
@@ -3089,22 +3105,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_135()
- {
- if (jj_done) return true;
- if (jj_scan_token(FUNCTION_T)) return true;
- if (jj_3R_74()) return true;
- if (jj_scan_token(IS_T)) return true;
- if (jj_scan_token(NEW_T)) return true;
- if (jj_3R_63()) return true;
- if (jj_3R_245()) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (jj_3R_284()) jj_scanpos = xsp;
- if (jj_scan_token(SEMI_T)) return true;
- return false;
- }
-
inline bool jj_3R_95()
{
if (jj_done) return true;
@@ -3127,22 +3127,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_488()
- {
- if (jj_done) return true;
- if (jj_3R_554()) return true;
- if (jj_scan_token(COLON_T)) return true;
- if (jj_3R_555()) return true;
- return false;
- }
-
- inline bool jj_3R_662()
- {
- if (jj_done) return true;
- if (jj_3R_245()) return true;
- return false;
- }
-
inline bool jj_3R_91()
{
if (jj_done) return true;
@@ -3159,17 +3143,19 @@ void parseInline();
return false;
}
- inline bool jj_3R_438()
+ inline bool jj_3R_488()
{
if (jj_done) return true;
- if (jj_3R_348()) return true;
+ if (jj_3R_554()) return true;
+ if (jj_scan_token(COLON_T)) return true;
+ if (jj_3R_555()) return true;
return false;
}
- inline bool jj_3R_597()
+ inline bool jj_3R_438()
{
if (jj_done) return true;
- if (jj_scan_token(ALL_T)) return true;
+ if (jj_3R_348()) return true;
return false;
}
@@ -3180,10 +3166,10 @@ void parseInline();
return false;
}
- inline bool jj_3R_596()
+ inline bool jj_3R_662()
{
if (jj_done) return true;
- if (jj_scan_token(OTHER_T)) return true;
+ if (jj_3R_245()) return true;
return false;
}
@@ -3207,6 +3193,20 @@ void parseInline();
return false;
}
+ inline bool jj_3R_597()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(ALL_T)) return true;
+ return false;
+ }
+
+ inline bool jj_3R_596()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(OTHER_T)) return true;
+ return false;
+ }
+
inline bool jj_3R_595()
{
if (jj_done) return true;
@@ -3259,20 +3259,20 @@ void parseInline();
return false;
}
- inline bool jj_3R_644()
+ inline bool jj_3R_263()
{
if (jj_done) return true;
- if (jj_3R_661()) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (jj_3R_662()) jj_scanpos = xsp;
+ if (jj_3R_382()) return true;
return false;
}
- inline bool jj_3R_263()
+ inline bool jj_3R_644()
{
if (jj_done) return true;
- if (jj_3R_382()) return true;
+ if (jj_3R_661()) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_662()) jj_scanpos = xsp;
return false;
}
@@ -3309,20 +3309,6 @@ void parseInline();
return false;
}
- inline bool jj_3_36()
- {
- if (jj_done) return true;
- if (jj_3R_91()) return true;
- return false;
- }
-
- inline bool jj_3_34()
- {
- if (jj_done) return true;
- if (jj_3R_67()) return true;
- return false;
- }
-
inline bool jj_3R_720()
{
if (jj_done) return true;
@@ -3337,18 +3323,17 @@ void parseInline();
return false;
}
- inline bool jj_3_35()
+ inline bool jj_3_36()
{
if (jj_done) return true;
- if (jj_3R_68()) return true;
+ if (jj_3R_91()) return true;
return false;
}
- inline bool jj_3R_558()
+ inline bool jj_3_34()
{
if (jj_done) return true;
- if (jj_scan_token(COMMA_T)) return true;
- if (jj_3R_557()) return true;
+ if (jj_3R_67()) return true;
return false;
}
@@ -3372,6 +3357,21 @@ void parseInline();
return false;
}
+ inline bool jj_3_35()
+ {
+ if (jj_done) return true;
+ if (jj_3R_68()) return true;
+ return false;
+ }
+
+ inline bool jj_3R_558()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(COMMA_T)) return true;
+ if (jj_3R_557()) return true;
+ return false;
+ }
+
inline bool jj_3R_681()
{
if (jj_done) return true;
@@ -3431,13 +3431,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_618()
- {
- if (jj_done) return true;
- if (jj_scan_token(BOX_T)) return true;
- return false;
- }
-
inline bool jj_3_113()
{
if (jj_done) return true;
@@ -3459,18 +3452,17 @@ void parseInline();
return false;
}
- inline bool jj_3R_714()
+ inline bool jj_3R_618()
{
if (jj_done) return true;
- if (jj_3R_67()) return true;
+ if (jj_scan_token(BOX_T)) return true;
return false;
}
- inline bool jj_3R_366()
+ inline bool jj_3R_714()
{
if (jj_done) return true;
- if (jj_scan_token(ENTITY_T)) return true;
- if (jj_3R_74()) return true;
+ if (jj_3R_67()) return true;
return false;
}
@@ -3495,6 +3487,14 @@ void parseInline();
return false;
}
+ inline bool jj_3R_366()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(ENTITY_T)) return true;
+ if (jj_3R_74()) return true;
+ return false;
+ }
+
inline bool jj_3R_710()
{
if (jj_done) return true;
@@ -3523,18 +3523,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_491()
- {
- if (jj_done) return true;
- if (jj_3R_557()) return true;
- Token * xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_558()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
inline bool jj_3R_706()
{
if (jj_done) return true;
@@ -3582,6 +3570,18 @@ void parseInline();
return false;
}
+ inline bool jj_3R_491()
+ {
+ if (jj_done) return true;
+ if (jj_3R_557()) return true;
+ Token * xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_558()) { jj_scanpos = xsp; break; }
+ }
+ return false;
+ }
+
inline bool jj_3R_557()
{
if (jj_done) return true;
@@ -3592,6 +3592,14 @@ void parseInline();
return false;
}
+ inline bool jj_3R_544()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(AFTER_T)) return true;
+ if (jj_3R_61()) return true;
+ return false;
+ }
+
inline bool jj_3R_626()
{
if (jj_done) return true;
@@ -3601,6 +3609,21 @@ void parseInline();
return false;
}
+ inline bool jj_3R_143()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(PROTECTED_T)) return true;
+ if (jj_scan_token(BODY_T)) return true;
+ if (jj_3R_680()) return true;
+ if (jj_scan_token(END_T)) return true;
+ if (jj_scan_token(PROTECTED_T)) return true;
+ if (jj_scan_token(BODY_T)) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_681()) jj_scanpos = xsp;
+ return false;
+ }
+
inline bool jj_3R_614()
{
if (jj_done) return true;
@@ -3608,11 +3631,11 @@ void parseInline();
return false;
}
- inline bool jj_3R_544()
+ inline bool jj_3R_519()
{
if (jj_done) return true;
- if (jj_scan_token(AFTER_T)) return true;
- if (jj_3R_61()) return true;
+ if (jj_scan_token(COMMA_T)) return true;
+ if (jj_3R_463()) return true;
return false;
}
@@ -3637,21 +3660,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_143()
- {
- if (jj_done) return true;
- if (jj_scan_token(PROTECTED_T)) return true;
- if (jj_scan_token(BODY_T)) return true;
- if (jj_3R_680()) return true;
- if (jj_scan_token(END_T)) return true;
- if (jj_scan_token(PROTECTED_T)) return true;
- if (jj_scan_token(BODY_T)) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (jj_3R_681()) jj_scanpos = xsp;
- return false;
- }
-
inline bool jj_3R_610()
{
if (jj_done) return true;
@@ -3659,14 +3667,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_519()
- {
- if (jj_done) return true;
- if (jj_scan_token(COMMA_T)) return true;
- if (jj_3R_463()) return true;
- return false;
- }
-
inline bool jj_3R_609()
{
if (jj_done) return true;
@@ -3730,27 +3730,27 @@ void parseInline();
return false;
}
- inline bool jj_3R_600()
+ inline bool jj_3R_463()
{
if (jj_done) return true;
- if (jj_scan_token(CONFIGURATION_T)) return true;
+ if (jj_3R_61()) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_544()) jj_scanpos = xsp;
return false;
}
- inline bool jj_3R_599()
+ inline bool jj_3R_600()
{
if (jj_done) return true;
- if (jj_scan_token(ARCHITECTURE_T)) return true;
+ if (jj_scan_token(CONFIGURATION_T)) return true;
return false;
}
- inline bool jj_3R_463()
+ inline bool jj_3R_599()
{
if (jj_done) return true;
- if (jj_3R_61()) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (jj_3R_544()) jj_scanpos = xsp;
+ if (jj_scan_token(ARCHITECTURE_T)) return true;
return false;
}
@@ -3802,6 +3802,13 @@ void parseInline();
return false;
}
+ inline bool jj_3R_422()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(UNAFFECTED_T)) return true;
+ return false;
+ }
+
inline bool jj_3R_576()
{
if (jj_done) return true;
@@ -3817,10 +3824,26 @@ void parseInline();
return false;
}
- inline bool jj_3R_422()
+ inline bool jj_3R_332()
{
if (jj_done) return true;
- if (jj_scan_token(UNAFFECTED_T)) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (!jj_3R_421()) return false;
+ jj_scanpos = xsp;
+ if (jj_3R_422()) return true;
+ return false;
+ }
+
+ inline bool jj_3R_421()
+ {
+ if (jj_done) return true;
+ if (jj_3R_463()) return true;
+ Token * xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_519()) { jj_scanpos = xsp; break; }
+ }
return false;
}
@@ -3848,29 +3871,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_332()
- {
- if (jj_done) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (!jj_3R_421()) return false;
- jj_scanpos = xsp;
- if (jj_3R_422()) return true;
- return false;
- }
-
- inline bool jj_3R_421()
- {
- if (jj_done) return true;
- if (jj_3R_463()) return true;
- Token * xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_519()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
inline bool jj_3R_260()
{
if (jj_done) return true;
@@ -3896,14 +3896,6 @@ void parseInline();
return false;
}
- inline bool jj_3_33()
- {
- if (jj_done) return true;
- if (jj_3R_90()) return true;
- if (jj_scan_token(ARROW_T)) return true;
- return false;
- }
-
inline bool jj_3R_705()
{
if (jj_done) return true;
@@ -3914,6 +3906,14 @@ void parseInline();
return false;
}
+ inline bool jj_3_33()
+ {
+ if (jj_done) return true;
+ if (jj_3R_90()) return true;
+ if (jj_scan_token(ARROW_T)) return true;
+ return false;
+ }
+
inline bool jj_3_32()
{
if (jj_done) return true;
@@ -3954,31 +3954,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_168()
- {
- if (jj_done) return true;
- if (jj_3R_89()) return true;
- return false;
- }
-
- inline bool jj_3R_167()
- {
- if (jj_done) return true;
- if (jj_3R_88()) return true;
- return false;
- }
-
- inline bool jj_3R_72()
- {
- if (jj_done) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (!jj_3R_167()) return false;
- jj_scanpos = xsp;
- if (jj_3R_168()) return true;
- return false;
- }
-
inline bool jj_3R_480()
{
if (jj_done) return true;
@@ -3987,12 +3962,10 @@ void parseInline();
return false;
}
- inline bool jj_3R_489()
+ inline bool jj_3R_168()
{
if (jj_done) return true;
- if (jj_3R_556()) return true;
- if (jj_scan_token(COLON_T)) return true;
- if (jj_3R_63()) return true;
+ if (jj_3R_89()) return true;
return false;
}
@@ -4012,44 +3985,45 @@ void parseInline();
return false;
}
- inline bool jj_3R_490()
+ inline bool jj_3R_167()
{
if (jj_done) return true;
- if (jj_scan_token(COMMA_T)) return true;
- if (jj_3R_434()) return true;
+ if (jj_3R_88()) return true;
return false;
}
- inline bool jj_3R_458()
+ inline bool jj_3R_72()
{
if (jj_done) return true;
- if (jj_3R_542()) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (!jj_3R_167()) return false;
+ jj_scanpos = xsp;
+ if (jj_3R_168()) return true;
return false;
}
- inline bool jj_3R_397()
+ inline bool jj_3R_458()
{
if (jj_done) return true;
- if (jj_scan_token(DISCONNECT_T)) return true;
- if (jj_3R_489()) return true;
- if (jj_scan_token(AFTER_T)) return true;
- if (jj_3R_61()) return true;
- if (jj_scan_token(SEMI_T)) return true;
+ if (jj_3R_542()) return true;
return false;
}
- inline bool jj_3_111()
+ inline bool jj_3R_489()
{
if (jj_done) return true;
- if (jj_3R_74()) return true;
+ if (jj_3R_556()) return true;
if (jj_scan_token(COLON_T)) return true;
+ if (jj_3R_63()) return true;
return false;
}
- inline bool jj_3R_166()
+ inline bool jj_3_111()
{
if (jj_done) return true;
- if (jj_scan_token(DOWNTO_T)) return true;
+ if (jj_3R_74()) return true;
+ if (jj_scan_token(COLON_T)) return true;
return false;
}
@@ -4077,6 +4051,32 @@ void parseInline();
return false;
}
+ inline bool jj_3R_490()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(COMMA_T)) return true;
+ if (jj_3R_434()) return true;
+ return false;
+ }
+
+ inline bool jj_3R_397()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(DISCONNECT_T)) return true;
+ if (jj_3R_489()) return true;
+ if (jj_scan_token(AFTER_T)) return true;
+ if (jj_3R_61()) return true;
+ if (jj_scan_token(SEMI_T)) return true;
+ return false;
+ }
+
+ inline bool jj_3R_166()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(DOWNTO_T)) return true;
+ return false;
+ }
+
inline bool jj_3R_477()
{
if (jj_done) return true;
@@ -4142,18 +4142,18 @@ void parseInline();
return false;
}
- inline bool jj_3R_573()
+ inline bool jj_3_106()
{
if (jj_done) return true;
- if (jj_scan_token(REJECT_T)) return true;
- if (jj_3R_61()) return true;
+ if (jj_3R_139()) return true;
return false;
}
- inline bool jj_3_106()
+ inline bool jj_3R_573()
{
if (jj_done) return true;
- if (jj_3R_139()) return true;
+ if (jj_scan_token(REJECT_T)) return true;
+ if (jj_3R_61()) return true;
return false;
}
@@ -4216,13 +4216,6 @@ void parseInline();
return false;
}
- inline bool jj_3_29()
- {
- if (jj_done) return true;
- if (jj_3R_65()) return true;
- return false;
- }
-
inline bool jj_3R_193()
{
if (jj_done) return true;
@@ -4237,24 +4230,24 @@ void parseInline();
return false;
}
- inline bool jj_3R_187()
+ inline bool jj_3_29()
{
if (jj_done) return true;
- if (jj_3R_348()) return true;
+ if (jj_3R_65()) return true;
return false;
}
- inline bool jj_3_28()
+ inline bool jj_3R_187()
{
if (jj_done) return true;
- if (jj_3R_86()) return true;
+ if (jj_3R_348()) return true;
return false;
}
- inline bool jj_3R_186()
+ inline bool jj_3_28()
{
if (jj_done) return true;
- if (jj_3R_87()) return true;
+ if (jj_3R_86()) return true;
return false;
}
@@ -4272,10 +4265,10 @@ void parseInline();
return false;
}
- inline bool jj_3R_185()
+ inline bool jj_3R_186()
{
if (jj_done) return true;
- if (jj_3R_347()) return true;
+ if (jj_3R_87()) return true;
return false;
}
@@ -4286,6 +4279,13 @@ void parseInline();
return false;
}
+ inline bool jj_3R_185()
+ {
+ if (jj_done) return true;
+ if (jj_3R_347()) return true;
+ return false;
+ }
+
inline bool jj_3R_640()
{
if (jj_done) return true;
@@ -4348,35 +4348,35 @@ void parseInline();
return false;
}
- inline bool jj_3R_139()
+ inline bool jj_3R_192()
{
if (jj_done) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (!jj_3R_285()) return false;
- jj_scanpos = xsp;
- if (jj_3R_286()) return true;
+ if (jj_3R_63()) return true;
return false;
}
- inline bool jj_3R_285()
+ inline bool jj_3R_476()
{
if (jj_done) return true;
- if (jj_3R_86()) return true;
+ if (jj_3R_547()) return true;
return false;
}
- inline bool jj_3R_192()
+ inline bool jj_3R_139()
{
if (jj_done) return true;
- if (jj_3R_63()) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (!jj_3R_285()) return false;
+ jj_scanpos = xsp;
+ if (jj_3R_286()) return true;
return false;
}
- inline bool jj_3R_476()
+ inline bool jj_3R_285()
{
if (jj_done) return true;
- if (jj_3R_547()) return true;
+ if (jj_3R_86()) return true;
return false;
}
@@ -4453,6 +4453,13 @@ void parseInline();
return false;
}
+ inline bool jj_3R_256()
+ {
+ if (jj_done) return true;
+ if (jj_3R_114()) return true;
+ return false;
+ }
+
inline bool jj_3R_389()
{
if (jj_done) return true;
@@ -4467,13 +4474,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_256()
- {
- if (jj_done) return true;
- if (jj_3R_114()) return true;
- return false;
- }
-
inline bool jj_3R_119()
{
if (jj_done) return true;
@@ -4513,27 +4513,27 @@ void parseInline();
return false;
}
- inline bool jj_3R_396()
+ inline bool jj_3R_227()
{
if (jj_done) return true;
- if (jj_scan_token(FOR_T)) return true;
- if (jj_3R_181()) return true;
- if (jj_3R_344()) return true;
- if (jj_scan_token(SEMI_T)) return true;
+ if (jj_3R_321()) return true;
return false;
}
- inline bool jj_3R_227()
+ inline bool jj_3R_226()
{
if (jj_done) return true;
- if (jj_3R_321()) return true;
+ if (jj_3R_369()) return true;
return false;
}
- inline bool jj_3R_226()
+ inline bool jj_3R_396()
{
if (jj_done) return true;
- if (jj_3R_369()) return true;
+ if (jj_scan_token(FOR_T)) return true;
+ if (jj_3R_181()) return true;
+ if (jj_3R_344()) return true;
+ if (jj_scan_token(SEMI_T)) return true;
return false;
}
@@ -4566,6 +4566,13 @@ void parseInline();
return false;
}
+ inline bool jj_3_105()
+ {
+ if (jj_done) return true;
+ if (jj_3R_138()) return true;
+ return false;
+ }
+
inline bool jj_3R_578()
{
if (jj_done) return true;
@@ -4584,13 +4591,6 @@ void parseInline();
return false;
}
- inline bool jj_3_105()
- {
- if (jj_done) return true;
- if (jj_3R_138()) return true;
- return false;
- }
-
inline bool jj_3R_89()
{
if (jj_done) return true;
@@ -4616,15 +4616,6 @@ void parseInline();
return false;
}
- inline bool jj_3_25()
- {
- if (jj_done) return true;
- if (jj_scan_token(WHEN_T)) return true;
- if (jj_3R_83()) return true;
- if (jj_scan_token(ELSE_T)) return true;
- return false;
- }
-
inline bool jj_3R_388()
{
if (jj_done) return true;
@@ -4643,6 +4634,15 @@ void parseInline();
return false;
}
+ inline bool jj_3_25()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(WHEN_T)) return true;
+ if (jj_3R_83()) return true;
+ if (jj_scan_token(ELSE_T)) return true;
+ return false;
+ }
+
inline bool jj_3R_584()
{
if (jj_done) return true;
@@ -4792,13 +4792,6 @@ void parseInline();
return false;
}
- inline bool jj_3_22()
- {
- if (jj_done) return true;
- if (jj_3R_80()) return true;
- return false;
- }
-
inline bool jj_3R_364()
{
if (jj_done) return true;
@@ -4826,6 +4819,13 @@ void parseInline();
return false;
}
+ inline bool jj_3_22()
+ {
+ if (jj_done) return true;
+ if (jj_3R_80()) return true;
+ return false;
+ }
+
inline bool jj_3R_79()
{
if (jj_done) return true;
@@ -4895,42 +4895,35 @@ void parseInline();
return false;
}
- inline bool jj_3R_76()
- {
- if (jj_done) return true;
- if (jj_3R_74()) return true;
- if (jj_scan_token(COLON_T)) return true;
- return false;
- }
-
- inline bool jj_3_18()
+ inline bool jj_3_101()
{
if (jj_done) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (jj_3R_76()) jj_scanpos = xsp;
- if (jj_scan_token(BLOCK_T)) return true;
+ if (jj_3R_67()) return true;
return false;
}
- inline bool jj_3_101()
+ inline bool jj_3R_675()
{
if (jj_done) return true;
- if (jj_3R_67()) return true;
+ if (jj_3R_398()) return true;
return false;
}
- inline bool jj_3R_675()
+ inline bool jj_3R_76()
{
if (jj_done) return true;
- if (jj_3R_398()) return true;
+ if (jj_3R_74()) return true;
+ if (jj_scan_token(COLON_T)) return true;
return false;
}
- inline bool jj_3_20()
+ inline bool jj_3_18()
{
if (jj_done) return true;
- if (jj_3R_78()) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (jj_3R_76()) jj_scanpos = xsp;
+ if (jj_scan_token(BLOCK_T)) return true;
return false;
}
@@ -4955,6 +4948,13 @@ void parseInline();
return false;
}
+ inline bool jj_3_20()
+ {
+ if (jj_done) return true;
+ if (jj_3R_78()) return true;
+ return false;
+ }
+
inline bool jj_3R_672()
{
if (jj_done) return true;
@@ -4976,13 +4976,6 @@ void parseInline();
return false;
}
- inline bool jj_3_17()
- {
- if (jj_done) return true;
- if (jj_3R_75()) return true;
- return false;
- }
-
inline bool jj_3R_669()
{
if (jj_done) return true;
@@ -5004,6 +4997,13 @@ void parseInline();
return false;
}
+ inline bool jj_3_17()
+ {
+ if (jj_done) return true;
+ if (jj_3R_75()) return true;
+ return false;
+ }
+
inline bool jj_3R_667()
{
if (jj_done) return true;
@@ -5025,13 +5025,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_176()
- {
- if (jj_done) return true;
- if (jj_3R_337()) return true;
- return false;
- }
-
inline bool jj_3R_664()
{
if (jj_done) return true;
@@ -5072,41 +5065,33 @@ void parseInline();
return false;
}
- inline bool jj_3R_175()
+ inline bool jj_3R_176()
{
if (jj_done) return true;
- if (jj_3R_75()) return true;
+ if (jj_3R_337()) return true;
return false;
}
- inline bool jj_3_16()
+ inline bool jj_3R_479()
{
if (jj_done) return true;
- if (jj_3R_74()) return true;
- if (jj_scan_token(COLON_T)) return true;
+ if (jj_scan_token(VARASSIGN_T)) return true;
+ if (jj_3R_61()) return true;
return false;
}
- inline bool jj_3R_479()
+ inline bool jj_3R_175()
{
if (jj_done) return true;
- if (jj_scan_token(VARASSIGN_T)) return true;
- if (jj_3R_61()) return true;
+ if (jj_3R_75()) return true;
return false;
}
- inline bool jj_3R_80()
+ inline bool jj_3_16()
{
if (jj_done) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (jj_3_16()) jj_scanpos = xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(79)) jj_scanpos = xsp;
- xsp = jj_scanpos;
- if (!jj_3R_175()) return false;
- jj_scanpos = xsp;
- if (jj_3R_176()) return true;
+ if (jj_3R_74()) return true;
+ if (jj_scan_token(COLON_T)) return true;
return false;
}
@@ -5135,6 +5120,21 @@ void parseInline();
return false;
}
+ inline bool jj_3R_80()
+ {
+ if (jj_done) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (jj_3_16()) jj_scanpos = xsp;
+ xsp = jj_scanpos;
+ if (jj_scan_token(79)) jj_scanpos = xsp;
+ xsp = jj_scanpos;
+ if (!jj_3R_175()) return false;
+ jj_scanpos = xsp;
+ if (jj_3R_176()) return true;
+ return false;
+ }
+
inline bool jj_3_15()
{
if (jj_done) return true;
@@ -5156,39 +5156,26 @@ void parseInline();
return false;
}
- inline bool jj_3_14()
- {
- if (jj_done) return true;
- if (jj_3R_74()) return true;
- if (jj_scan_token(COLON_T)) return true;
- return false;
- }
-
- inline bool jj_3_13()
+ inline bool jj_3R_209()
{
if (jj_done) return true;
- if (jj_3R_73()) return true;
+ if (jj_3R_364()) return true;
+ if (jj_3R_365()) return true;
return false;
}
- inline bool jj_3R_209()
+ inline bool jj_3_14()
{
if (jj_done) return true;
- if (jj_3R_364()) return true;
- if (jj_3R_365()) return true;
+ if (jj_3R_74()) return true;
+ if (jj_scan_token(COLON_T)) return true;
return false;
}
- inline bool jj_3R_92()
+ inline bool jj_3_13()
{
if (jj_done) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (jj_3_14()) jj_scanpos = xsp;
- xsp = jj_scanpos;
- if (jj_scan_token(79)) jj_scanpos = xsp;
- if (jj_3R_196()) return true;
- if (jj_scan_token(SEMI_T)) return true;
+ if (jj_3R_73()) return true;
return false;
}
@@ -5225,6 +5212,19 @@ void parseInline();
return false;
}
+ inline bool jj_3R_92()
+ {
+ if (jj_done) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (jj_3_14()) jj_scanpos = xsp;
+ xsp = jj_scanpos;
+ if (jj_scan_token(79)) jj_scanpos = xsp;
+ if (jj_3R_196()) return true;
+ if (jj_scan_token(SEMI_T)) return true;
+ return false;
+ }
+
inline bool jj_3R_679()
{
if (jj_done) return true;
@@ -5264,6 +5264,13 @@ void parseInline();
return false;
}
+ inline bool jj_3R_478()
+ {
+ if (jj_done) return true;
+ if (jj_3R_548()) return true;
+ return false;
+ }
+
inline bool jj_3R_487()
{
if (jj_done) return true;
@@ -5271,10 +5278,11 @@ void parseInline();
return false;
}
- inline bool jj_3R_478()
+ inline bool jj_3R_164()
{
if (jj_done) return true;
- if (jj_3R_548()) return true;
+ if (jj_3R_133()) return true;
+ if (jj_3R_134()) return true;
return false;
}
@@ -5287,14 +5295,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_164()
- {
- if (jj_done) return true;
- if (jj_3R_133()) return true;
- if (jj_3R_134()) return true;
- return false;
- }
-
inline bool jj_3R_540()
{
if (jj_done) return true;
@@ -5348,6 +5348,14 @@ void parseInline();
return false;
}
+ inline bool jj_3R_453()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(COMMA_T)) return true;
+ if (jj_3R_63()) return true;
+ return false;
+ }
+
inline bool jj_3R_183()
{
if (jj_done) return true;
@@ -5363,19 +5371,18 @@ void parseInline();
return false;
}
- inline bool jj_3R_453()
+ inline bool jj_3R_195()
{
if (jj_done) return true;
- if (jj_scan_token(COMMA_T)) return true;
- if (jj_3R_63()) return true;
+ if (jj_scan_token(BAR_T)) return true;
+ if (jj_3R_194()) return true;
return false;
}
- inline bool jj_3R_195()
+ inline bool jj_3R_163()
{
if (jj_done) return true;
- if (jj_scan_token(BAR_T)) return true;
- if (jj_3R_194()) return true;
+ if (jj_3R_328()) return true;
return false;
}
@@ -5399,13 +5406,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_163()
- {
- if (jj_done) return true;
- if (jj_3R_328()) return true;
- return false;
- }
-
inline bool jj_3R_70()
{
if (jj_done) return true;
@@ -5471,18 +5471,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_90()
- {
- if (jj_done) return true;
- if (jj_3R_194()) return true;
- Token * xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_195()) { jj_scanpos = xsp; break; }
- }
- return false;
- }
-
inline bool jj_3R_245()
{
if (jj_done) return true;
@@ -5496,10 +5484,15 @@ void parseInline();
return false;
}
- inline bool jj_3_11()
+ inline bool jj_3R_90()
{
if (jj_done) return true;
- if (jj_3R_70()) return true;
+ if (jj_3R_194()) return true;
+ Token * xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_195()) { jj_scanpos = xsp; break; }
+ }
return false;
}
@@ -5510,10 +5503,10 @@ void parseInline();
return false;
}
- inline bool jj_3R_354()
+ inline bool jj_3_11()
{
if (jj_done) return true;
- if (jj_scan_token(OTHER_T)) return true;
+ if (jj_3R_70()) return true;
return false;
}
@@ -5524,18 +5517,10 @@ void parseInline();
return false;
}
- inline bool jj_3_10()
- {
- if (jj_done) return true;
- if (jj_3R_70()) return true;
- if (jj_3R_71()) return true;
- return false;
- }
-
- inline bool jj_3R_353()
+ inline bool jj_3R_354()
{
if (jj_done) return true;
- if (jj_3R_74()) return true;
+ if (jj_scan_token(OTHER_T)) return true;
return false;
}
@@ -5564,6 +5549,21 @@ void parseInline();
return false;
}
+ inline bool jj_3_10()
+ {
+ if (jj_done) return true;
+ if (jj_3R_70()) return true;
+ if (jj_3R_71()) return true;
+ return false;
+ }
+
+ inline bool jj_3R_353()
+ {
+ if (jj_done) return true;
+ if (jj_3R_74()) return true;
+ return false;
+ }
+
inline bool jj_3R_590()
{
if (jj_done) return true;
@@ -5657,6 +5657,13 @@ void parseInline();
return false;
}
+ inline bool jj_3_98()
+ {
+ if (jj_done) return true;
+ if (jj_3R_132()) return true;
+ return false;
+ }
+
inline bool jj_3R_632()
{
if (jj_done) return true;
@@ -5667,10 +5674,10 @@ void parseInline();
return false;
}
- inline bool jj_3_98()
+ inline bool jj_3_97()
{
if (jj_done) return true;
- if (jj_3R_132()) return true;
+ if (jj_3R_131()) return true;
return false;
}
@@ -5681,13 +5688,6 @@ void parseInline();
return false;
}
- inline bool jj_3_97()
- {
- if (jj_done) return true;
- if (jj_3R_131()) return true;
- return false;
- }
-
inline bool jj_3R_541()
{
if (jj_done) return true;
@@ -5753,6 +5753,13 @@ void parseInline();
return false;
}
+ inline bool jj_3R_417()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(MINUS_T)) return true;
+ return false;
+ }
+
inline bool jj_3R_265()
{
if (jj_done) return true;
@@ -5764,10 +5771,21 @@ void parseInline();
return false;
}
- inline bool jj_3R_417()
+ inline bool jj_3R_328()
{
if (jj_done) return true;
- if (jj_scan_token(MINUS_T)) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (!jj_3R_416()) return false;
+ jj_scanpos = xsp;
+ if (jj_3R_417()) return true;
+ return false;
+ }
+
+ inline bool jj_3R_416()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(PLUS_T)) return true;
return false;
}
@@ -5793,24 +5811,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_328()
- {
- if (jj_done) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (!jj_3R_416()) return false;
- jj_scanpos = xsp;
- if (jj_3R_417()) return true;
- return false;
- }
-
- inline bool jj_3R_416()
- {
- if (jj_done) return true;
- if (jj_scan_token(PLUS_T)) return true;
- return false;
- }
-
inline bool jj_3R_567()
{
if (jj_done) return true;
@@ -5898,6 +5898,13 @@ void parseInline();
return false;
}
+ inline bool jj_3_95()
+ {
+ if (jj_done) return true;
+ if (jj_3R_130()) return true;
+ return false;
+ }
+
inline bool jj_3_9()
{
if (jj_done) return true;
@@ -5905,10 +5912,10 @@ void parseInline();
return false;
}
- inline bool jj_3_95()
+ inline bool jj_3_94()
{
if (jj_done) return true;
- if (jj_3R_130()) return true;
+ if (jj_3R_129()) return true;
return false;
}
@@ -5922,13 +5929,6 @@ void parseInline();
return false;
}
- inline bool jj_3_94()
- {
- if (jj_done) return true;
- if (jj_3R_129()) return true;
- return false;
- }
-
inline bool jj_3_93()
{
if (jj_done) return true;
@@ -5983,32 +5983,32 @@ void parseInline();
return false;
}
- inline bool jj_3R_311()
+ inline bool jj_3R_118()
{
if (jj_done) return true;
- if (jj_3R_398()) return true;
+ if (jj_3R_74()) return true;
+ if (jj_scan_token(COLON_T)) return true;
return false;
}
- inline bool jj_3_7()
+ inline bool jj_3R_311()
{
if (jj_done) return true;
- if (jj_3R_67()) return true;
+ if (jj_3R_398()) return true;
return false;
}
- inline bool jj_3R_118()
+ inline bool jj_3R_253()
{
if (jj_done) return true;
- if (jj_3R_74()) return true;
- if (jj_scan_token(COLON_T)) return true;
+ if (jj_3R_378()) return true;
return false;
}
- inline bool jj_3R_253()
+ inline bool jj_3_7()
{
if (jj_done) return true;
- if (jj_3R_378()) return true;
+ if (jj_3R_67()) return true;
return false;
}
@@ -6023,6 +6023,13 @@ void parseInline();
return false;
}
+ inline bool jj_3_87()
+ {
+ if (jj_done) return true;
+ if (jj_3R_122()) return true;
+ return false;
+ }
+
inline bool jj_3_8()
{
if (jj_done) return true;
@@ -6044,10 +6051,10 @@ void parseInline();
return false;
}
- inline bool jj_3_87()
+ inline bool jj_3_86()
{
if (jj_done) return true;
- if (jj_3R_122()) return true;
+ if (jj_3R_121()) return true;
return false;
}
@@ -6065,27 +6072,6 @@ void parseInline();
return false;
}
- inline bool jj_3_86()
- {
- if (jj_done) return true;
- if (jj_3R_121()) return true;
- return false;
- }
-
- inline bool jj_3R_305()
- {
- if (jj_done) return true;
- if (jj_3R_394()) return true;
- return false;
- }
-
- inline bool jj_3R_306()
- {
- if (jj_done) return true;
- if (jj_3R_67()) return true;
- return false;
- }
-
inline bool jj_3_85()
{
if (jj_done) return true;
@@ -6093,13 +6079,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_304()
- {
- if (jj_done) return true;
- if (jj_3R_393()) return true;
- return false;
- }
-
inline bool jj_3R_520()
{
if (jj_done) return true;
@@ -6110,17 +6089,24 @@ void parseInline();
return false;
}
- inline bool jj_3R_303()
+ inline bool jj_3R_305()
{
if (jj_done) return true;
- if (jj_3R_392()) return true;
+ if (jj_3R_394()) return true;
return false;
}
- inline bool jj_3R_302()
+ inline bool jj_3R_306()
{
if (jj_done) return true;
- if (jj_3R_391()) return true;
+ if (jj_3R_67()) return true;
+ return false;
+ }
+
+ inline bool jj_3R_304()
+ {
+ if (jj_done) return true;
+ if (jj_3R_393()) return true;
return false;
}
@@ -6164,17 +6150,17 @@ void parseInline();
return false;
}
- inline bool jj_3R_301()
+ inline bool jj_3R_303()
{
if (jj_done) return true;
- if (jj_3R_390()) return true;
+ if (jj_3R_392()) return true;
return false;
}
- inline bool jj_3R_300()
+ inline bool jj_3R_302()
{
if (jj_done) return true;
- if (jj_3R_389()) return true;
+ if (jj_3R_391()) return true;
return false;
}
@@ -6186,6 +6172,20 @@ void parseInline();
return false;
}
+ inline bool jj_3R_301()
+ {
+ if (jj_done) return true;
+ if (jj_3R_390()) return true;
+ return false;
+ }
+
+ inline bool jj_3R_300()
+ {
+ if (jj_done) return true;
+ if (jj_3R_389()) return true;
+ return false;
+ }
+
inline bool jj_3R_299()
{
if (jj_done) return true;
@@ -6214,6 +6214,13 @@ void parseInline();
return false;
}
+ inline bool jj_3_83()
+ {
+ if (jj_done) return true;
+ if (jj_3R_117()) return true;
+ return false;
+ }
+
inline bool jj_3R_146()
{
if (jj_done) return true;
@@ -6260,13 +6267,6 @@ void parseInline();
return false;
}
- inline bool jj_3_83()
- {
- if (jj_done) return true;
- if (jj_3R_117()) return true;
- return false;
- }
-
inline bool jj_3R_268()
{
if (jj_done) return true;
@@ -6298,15 +6298,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_250()
- {
- if (jj_done) return true;
- if (jj_scan_token(LPAREN_T)) return true;
- if (jj_3R_61()) return true;
- if (jj_scan_token(RPAREN_T)) return true;
- return false;
- }
-
inline bool jj_3R_440()
{
if (jj_done) return true;
@@ -6319,6 +6310,15 @@ void parseInline();
return false;
}
+ inline bool jj_3R_250()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(LPAREN_T)) return true;
+ if (jj_3R_61()) return true;
+ if (jj_scan_token(RPAREN_T)) return true;
+ return false;
+ }
+
inline bool jj_3R_357()
{
if (jj_done) return true;
@@ -6344,13 +6344,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_100()
- {
- if (jj_done) return true;
- if (jj_scan_token(BIT_STRING_LITERAL)) return true;
- return false;
- }
-
inline bool jj_3R_380()
{
if (jj_done) return true;
@@ -6359,17 +6352,10 @@ void parseInline();
return false;
}
- inline bool jj_3R_430()
- {
- if (jj_done) return true;
- if (jj_3R_341()) return true;
- return false;
- }
-
- inline bool jj_3R_429()
+ inline bool jj_3R_100()
{
if (jj_done) return true;
- if (jj_3R_73()) return true;
+ if (jj_scan_token(BIT_STRING_LITERAL)) return true;
return false;
}
@@ -6387,6 +6373,20 @@ void parseInline();
return false;
}
+ inline bool jj_3R_430()
+ {
+ if (jj_done) return true;
+ if (jj_3R_341()) return true;
+ return false;
+ }
+
+ inline bool jj_3R_429()
+ {
+ if (jj_done) return true;
+ if (jj_3R_73()) return true;
+ return false;
+ }
+
inline bool jj_3R_428()
{
if (jj_done) return true;
@@ -6408,13 +6408,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_249()
- {
- if (jj_done) return true;
- if (jj_3R_63()) return true;
- return false;
- }
-
inline bool jj_3R_337()
{
if (jj_done) return true;
@@ -6436,6 +6429,13 @@ void parseInline();
return false;
}
+ inline bool jj_3R_249()
+ {
+ if (jj_done) return true;
+ if (jj_3R_63()) return true;
+ return false;
+ }
+
inline bool jj_3R_434()
{
if (jj_done) return true;
@@ -6571,13 +6571,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_372()
- {
- if (jj_done) return true;
- if (jj_scan_token(RANGE_T)) return true;
- return false;
- }
-
inline bool jj_3R_319()
{
if (jj_done) return true;
@@ -6600,6 +6593,13 @@ void parseInline();
return false;
}
+ inline bool jj_3R_372()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(RANGE_T)) return true;
+ return false;
+ }
+
inline bool jj_3R_230()
{
if (jj_done) return true;
@@ -6674,6 +6674,20 @@ void parseInline();
return false;
}
+ inline bool jj_3R_499()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(LESSTHAN_T)) return true;
+ return false;
+ }
+
+ inline bool jj_3R_498()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(GREATERTHAN_T)) return true;
+ return false;
+ }
+
inline bool jj_3_6()
{
if (jj_done) return true;
@@ -6693,10 +6707,10 @@ void parseInline();
return false;
}
- inline bool jj_3R_499()
+ inline bool jj_3R_497()
{
if (jj_done) return true;
- if (jj_scan_token(LESSTHAN_T)) return true;
+ if (jj_scan_token(EQU_T)) return true;
return false;
}
@@ -6708,20 +6722,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_498()
- {
- if (jj_done) return true;
- if (jj_scan_token(GREATERTHAN_T)) return true;
- return false;
- }
-
- inline bool jj_3R_497()
- {
- if (jj_done) return true;
- if (jj_scan_token(EQU_T)) return true;
- return false;
- }
-
inline bool jj_3R_496()
{
if (jj_done) return true;
@@ -6789,18 +6789,18 @@ void parseInline();
return false;
}
- inline bool jj_3R_418()
+ inline bool jj_3R_697()
{
if (jj_done) return true;
- if (jj_3R_66()) return true;
- if (jj_scan_token(ARROW_T)) return true;
+ if (jj_3R_705()) return true;
return false;
}
- inline bool jj_3R_697()
+ inline bool jj_3R_418()
{
if (jj_done) return true;
- if (jj_3R_705()) return true;
+ if (jj_3R_66()) return true;
+ if (jj_scan_token(ARROW_T)) return true;
return false;
}
@@ -6814,14 +6814,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_257()
- {
- if (jj_done) return true;
- if (jj_3R_145()) return true;
- if (jj_scan_token(COLON_T)) return true;
- return false;
- }
-
inline bool jj_3R_690()
{
if (jj_done) return true;
@@ -6839,6 +6831,14 @@ void parseInline();
return false;
}
+ inline bool jj_3R_257()
+ {
+ if (jj_done) return true;
+ if (jj_3R_145()) return true;
+ if (jj_scan_token(COLON_T)) return true;
+ return false;
+ }
+
inline bool jj_3R_120()
{
if (jj_done) return true;
@@ -6887,19 +6887,19 @@ void parseInline();
return false;
}
- inline bool jj_3_5()
+ inline bool jj_3_79()
{
if (jj_done) return true;
- if (jj_scan_token(ARRAY_T)) return true;
- if (jj_3R_65()) return true;
- if (jj_scan_token(OF_T)) return true;
+ if (jj_3R_114()) return true;
return false;
}
- inline bool jj_3_79()
+ inline bool jj_3_5()
{
if (jj_done) return true;
- if (jj_3R_114()) return true;
+ if (jj_scan_token(ARRAY_T)) return true;
+ if (jj_3R_65()) return true;
+ if (jj_scan_token(OF_T)) return true;
return false;
}
@@ -6946,6 +6946,13 @@ void parseInline();
return false;
}
+ inline bool jj_3R_237()
+ {
+ if (jj_done) return true;
+ if (jj_3R_114()) return true;
+ return false;
+ }
+
inline bool jj_3R_695()
{
if (jj_done) return true;
@@ -6964,13 +6971,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_237()
- {
- if (jj_done) return true;
- if (jj_3R_114()) return true;
- return false;
- }
-
inline bool jj_3R_64()
{
if (jj_done) return true;
@@ -7067,13 +7067,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_551()
- {
- if (jj_done) return true;
- if (jj_scan_token(CHARACTER_LITERAL)) return true;
- return false;
- }
-
inline bool jj_3R_197()
{
if (jj_done) return true;
@@ -7082,23 +7075,10 @@ void parseInline();
return false;
}
- inline bool jj_3R_550()
- {
- if (jj_done) return true;
- if (jj_3R_74()) return true;
- return false;
- }
-
- inline bool jj_3R_482()
+ inline bool jj_3R_551()
{
if (jj_done) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (!jj_3R_550()) return false;
- jj_scanpos = xsp;
- if (!jj_3R_551()) return false;
- jj_scanpos = xsp;
- if (jj_3R_552()) return true;
+ if (jj_scan_token(CHARACTER_LITERAL)) return true;
return false;
}
@@ -7128,6 +7108,26 @@ void parseInline();
return false;
}
+ inline bool jj_3R_550()
+ {
+ if (jj_done) return true;
+ if (jj_3R_74()) return true;
+ return false;
+ }
+
+ inline bool jj_3R_482()
+ {
+ if (jj_done) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (!jj_3R_550()) return false;
+ jj_scanpos = xsp;
+ if (!jj_3R_551()) return false;
+ jj_scanpos = xsp;
+ if (jj_3R_552()) return true;
+ return false;
+ }
+
inline bool jj_3R_358()
{
if (jj_done) return true;
@@ -7153,18 +7153,18 @@ void parseInline();
return false;
}
- inline bool jj_3R_483()
+ inline bool jj_3R_533()
{
if (jj_done) return true;
- if (jj_scan_token(COLON_T)) return true;
- if (jj_3R_89()) return true;
+ if (jj_3R_347()) return true;
return false;
}
- inline bool jj_3R_533()
+ inline bool jj_3R_483()
{
if (jj_done) return true;
- if (jj_3R_347()) return true;
+ if (jj_scan_token(COLON_T)) return true;
+ if (jj_3R_89()) return true;
return false;
}
@@ -7205,20 +7205,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_114()
- {
- if (jj_done) return true;
- if (jj_scan_token(LPAREN_T)) return true;
- if (jj_3R_247()) return true;
- Token * xsp;
- while (true) {
- xsp = jj_scanpos;
- if (jj_3R_248()) { jj_scanpos = xsp; break; }
- }
- if (jj_scan_token(RPAREN_T)) return true;
- return false;
- }
-
inline bool jj_3_77()
{
if (jj_done) return true;
@@ -7240,6 +7226,20 @@ void parseInline();
return false;
}
+ inline bool jj_3R_114()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(LPAREN_T)) return true;
+ if (jj_3R_247()) return true;
+ Token * xsp;
+ while (true) {
+ xsp = jj_scanpos;
+ if (jj_3R_248()) { jj_scanpos = xsp; break; }
+ }
+ if (jj_scan_token(RPAREN_T)) return true;
+ return false;
+ }
+
inline bool jj_3R_528()
{
if (jj_done) return true;
@@ -7254,6 +7254,13 @@ void parseInline();
return false;
}
+ inline bool jj_3R_526()
+ {
+ if (jj_done) return true;
+ if (jj_3R_387()) return true;
+ return false;
+ }
+
inline bool jj_3R_282()
{
if (jj_done) return true;
@@ -7268,18 +7275,18 @@ void parseInline();
return false;
}
- inline bool jj_3R_526()
+ inline bool jj_3_3()
{
if (jj_done) return true;
- if (jj_3R_387()) return true;
+ if (jj_3R_63()) return true;
+ if (jj_scan_token(LPAREN_T)) return true;
return false;
}
- inline bool jj_3_3()
+ inline bool jj_3R_525()
{
if (jj_done) return true;
- if (jj_3R_63()) return true;
- if (jj_scan_token(LPAREN_T)) return true;
+ if (jj_3R_98()) return true;
return false;
}
@@ -7303,13 +7310,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_525()
- {
- if (jj_done) return true;
- if (jj_3R_98()) return true;
- return false;
- }
-
inline bool jj_3R_441()
{
if (jj_done) return true;
@@ -7357,23 +7357,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_516()
- {
- if (jj_done) return true;
- if (jj_3R_63()) return true;
- if (jj_scan_token(LPAREN_T)) return true;
- if (jj_3R_62()) return true;
- if (jj_scan_token(RPAREN_T)) return true;
- return false;
- }
-
- inline bool jj_3R_515()
- {
- if (jj_done) return true;
- if (jj_scan_token(BOX_T)) return true;
- return false;
- }
-
inline bool jj_3_76()
{
if (jj_done) return true;
@@ -7393,23 +7376,20 @@ void parseInline();
return false;
}
- inline bool jj_3R_514()
+ inline bool jj_3R_516()
{
if (jj_done) return true;
+ if (jj_3R_63()) return true;
+ if (jj_scan_token(LPAREN_T)) return true;
if (jj_3R_62()) return true;
+ if (jj_scan_token(RPAREN_T)) return true;
return false;
}
- inline bool jj_3R_419()
+ inline bool jj_3R_515()
{
if (jj_done) return true;
- Token * xsp;
- xsp = jj_scanpos;
- if (!jj_3R_514()) return false;
- jj_scanpos = xsp;
- if (!jj_3R_515()) return false;
- jj_scanpos = xsp;
- if (jj_3R_516()) return true;
+ if (jj_scan_token(BOX_T)) return true;
return false;
}
@@ -7423,10 +7403,23 @@ void parseInline();
return false;
}
- inline bool jj_3R_236()
+ inline bool jj_3R_514()
{
if (jj_done) return true;
- if (jj_3R_169()) return true;
+ if (jj_3R_62()) return true;
+ return false;
+ }
+
+ inline bool jj_3R_419()
+ {
+ if (jj_done) return true;
+ Token * xsp;
+ xsp = jj_scanpos;
+ if (!jj_3R_514()) return false;
+ jj_scanpos = xsp;
+ if (!jj_3R_515()) return false;
+ jj_scanpos = xsp;
+ if (jj_3R_516()) return true;
return false;
}
@@ -7444,6 +7437,13 @@ void parseInline();
return false;
}
+ inline bool jj_3R_236()
+ {
+ if (jj_done) return true;
+ if (jj_3R_169()) return true;
+ return false;
+ }
+
inline bool jj_3R_213()
{
if (jj_done) return true;
@@ -7465,24 +7465,24 @@ void parseInline();
return false;
}
- inline bool jj_3R_155()
+ inline bool jj_3R_212()
{
if (jj_done) return true;
- if (jj_3R_74()) return true;
+ if (jj_3R_91()) return true;
return false;
}
- inline bool jj_3R_212()
+ inline bool jj_3R_211()
{
if (jj_done) return true;
- if (jj_3R_91()) return true;
+ if (jj_3R_367()) return true;
return false;
}
- inline bool jj_3R_211()
+ inline bool jj_3R_155()
{
if (jj_done) return true;
- if (jj_3R_367()) return true;
+ if (jj_3R_74()) return true;
return false;
}
@@ -7519,6 +7519,13 @@ void parseInline();
return false;
}
+ inline bool jj_3_72()
+ {
+ if (jj_done) return true;
+ if (jj_3R_63()) return true;
+ return false;
+ }
+
inline bool jj_3R_154()
{
if (jj_done) return true;
@@ -7526,10 +7533,10 @@ void parseInline();
return false;
}
- inline bool jj_3_72()
+ inline bool jj_3_71()
{
if (jj_done) return true;
- if (jj_3R_63()) return true;
+ if (jj_3R_112()) return true;
return false;
}
@@ -7553,13 +7560,6 @@ void parseInline();
return false;
}
- inline bool jj_3_71()
- {
- if (jj_done) return true;
- if (jj_3R_112()) return true;
- return false;
- }
-
inline bool jj_3R_475()
{
if (jj_done) return true;
@@ -7574,18 +7574,18 @@ void parseInline();
return false;
}
- inline bool jj_3R_658()
+ inline bool jj_3R_474()
{
if (jj_done) return true;
- if (jj_scan_token(ACCESS_T)) return true;
- if (jj_3R_89()) return true;
+ if (jj_3R_113()) return true;
return false;
}
- inline bool jj_3R_474()
+ inline bool jj_3R_658()
{
if (jj_done) return true;
- if (jj_3R_113()) return true;
+ if (jj_scan_token(ACCESS_T)) return true;
+ if (jj_3R_89()) return true;
return false;
}
@@ -7603,6 +7603,22 @@ void parseInline();
return false;
}
+ inline bool jj_3_68()
+ {
+ if (jj_done) return true;
+ if (jj_scan_token(LPAREN_T)) return true;
+ if (jj_3R_61()) return true;
+ if (jj_scan_token(RPAREN_T)) return true;
+ return false;
+ }
+
+ inline bool jj_3R_472()
+ {
+ if (jj_done) return true;
+ if (jj_3R_112()) return true;
+ return false;
+ }
+
inline bool jj_3R_235()
{
if (jj_done) return true;
@@ -7610,12 +7626,10 @@ void parseInline();
return false;
}
- inline bool jj_3_68()
+ inline bool jj_3R_702()
{
if (jj_done) return true;
- if (jj_scan_token(LPAREN_T)) return true;
- if (jj_3R_61()) return true;
- if (jj_scan_token(RPAREN_T)) return true;
+ if (jj_3R_63()) return true;
return false;
}
@@ -7626,10 +7640,10 @@ void parseInline();
return false;
}
- inline bool jj_3R_472()
+ inline bool jj_3_67()
{
if (jj_done) return true;
- if (jj_3R_112()) return true;
+ if (jj_3R_110()) return true;
return false;
}
@@ -7653,20 +7667,6 @@ void parseInline();
return false;
}
- inline bool jj_3R_702()
- {
- if (jj_done) return true;
- if (jj_3R_63()) return true;
- return false;
- }
-
- inline bool jj_3_67()
- {
- if (jj_done) return true;
- if (jj_3R_110()) return true;
- return false;
- }
-
inline bool jj_3R_471()
{
if (jj_done) return true;
diff --git a/vhdlparser/VhdlParserTokenManager.cc b/vhdlparser/VhdlParserTokenManager.cc
index 341469f..3b7b396 100644
--- a/vhdlparser/VhdlParserTokenManager.cc
+++ b/vhdlparser/VhdlParserTokenManager.cc
@@ -3503,7 +3503,7 @@ void VhdlParserTokenManager::SkipLexicalActions(Token *matchedToken){
if (count == 1)
parser->outlineParser()->oneLineComment(doc);
else
- parser->outlineParser()->handleCommentBlock(image.data(),FALSE); ;
+ parser->outlineParser()->handleCommentBlock(QCString(image),FALSE); ;
}
break;
}
@@ -3521,7 +3521,7 @@ void VhdlParserTokenManager::SkipLexicalActions(Token *matchedToken){
image.append(input_stream->GetSuffix(jjimageLen + (lengthOfMatch = jjmatchedPos + 1)));
{
QCString q = filter2008VhdlComment(image.data());
- parser->outlineParser()->handleCommentBlock(q.data(),TRUE);image.clear();
+ parser->outlineParser()->handleCommentBlock(QCString(q),TRUE);image.clear();
}
break;
}
diff --git a/vhdlparser/vhdl_adj.py b/vhdlparser/vhdl_adj.py
index a431970..388864a 100644
--- a/vhdlparser/vhdl_adj.py
+++ b/vhdlparser/vhdl_adj.py
@@ -18,7 +18,7 @@ def main():
inputFile = open(sys.argv[1], 'r')
outputFile = open(sys.argv[2], 'w')
for line in inputFile:
- outputFile.write(line.replace("assert(false);","assert(false);return \"\";"))
+ outputFile.write(line.replace("assert(false);","assert(false);return QCString();"))
if __name__ == '__main__':
main()
diff --git a/vhdlparser/vhdlparser.jj b/vhdlparser/vhdlparser.jj
index e263289..3ef732e 100755
--- a/vhdlparser/vhdlparser.jj
+++ b/vhdlparser/vhdlparser.jj
@@ -110,7 +110,7 @@ SKIP:
if (count == 1)
parser->outlineParser()->oneLineComment(doc);
else
- parser->outlineParser()->handleCommentBlock(image.data(),FALSE); ;
+ parser->outlineParser()->handleCommentBlock(QCString(image),FALSE); ;
}
}
@@ -128,7 +128,7 @@ SKIP :
{
{
QCString q = filter2008VhdlComment(image.data());
- parser->outlineParser()->handleCommentBlock(q.data(),TRUE);image.clear();
+ parser->outlineParser()->handleCommentBlock(QCString(q),TRUE);image.clear();
}
}
| <MULT_VHDL_2008_COMMENT : "/*" (~["*"])* "*" ("*" | ~["*","/"] (~["*"])* "*")* "/">
@@ -337,22 +337,22 @@ TOKEN:
QCString abstract_literal() :
{Token *tok;}
{
- tok=<DECIMAL_LITERAL> { return tok->image.c_str(); }
- | tok=<INTEGER> { return tok->image.c_str(); }
- | tok=<BASED_LITERAL> { return tok->image.c_str(); }
+ tok=<DECIMAL_LITERAL> { return QCString(tok->image); }
+ | tok=<INTEGER> { return QCString(tok->image); }
+ | tok=<BASED_LITERAL> { return QCString(tok->image); }
}
QCString access_type_definition() :
{Token *tok=0;QCString str,str1;}
{
- tok=<ACCESS_T> str1=subtype_indication() { str=tok->image.c_str(); return str+str1; }
+ tok=<ACCESS_T> str1=subtype_indication() { str=tok->image; return str+str1; }
}
QCString actual_designator() :
{QCString str;Token *t=0;}
{
-t=<OPEN_T> { return t->image.c_str(); }
+t=<OPEN_T> { return QCString(t->image); }
|
LOOKAHEAD(expression())
str=expression() { return str; }
@@ -392,7 +392,7 @@ QCString adding_operator () :
QCString aggregate() : {QCString s,s1,s2;}
{
- <LPAREN_T> s=element_association() (<COMMA_T> s1=element_association(){s+=","+s1;})* <RPAREN_T> { return "("+s+")";}
+ <LPAREN_T> s=element_association() (<COMMA_T> s1=element_association(){s+=","+s1;})* <RPAREN_T> { return QCString("("+s+")");}
}
QCString alias_declaration() : {QCString s,s1,s2;}
@@ -411,7 +411,7 @@ QCString alias_declaration() : {QCString s,s1,s2;}
QCString alias_designator() : {Token *tok=0;QCString s;}
{
s=identifier() { return s;}
- | tok=<CHARACTER_LITERAL> { return tok->image.c_str(); }
+ | tok=<CHARACTER_LITERAL> { return QCString(tok->image); }
| s=operator_symbol() { return s; }
}
@@ -431,7 +431,7 @@ void architecture_body() : {QCString s,s1;}
m_sharedState->genLabels.resize(0);
outlineParser()->pushLabel(m_sharedState->genLabels,s1);
m_sharedState->lastCompound=m_sharedState->current;
- outlineParser()->addVhdlType(t,outlineParser()->getLine(ARCHITECTURE_T),Entry::CLASS_SEC,VhdlDocGen::ARCHITECTURE,0,0,Private);
+ outlineParser()->addVhdlType(t.data(),outlineParser()->getLine(ARCHITECTURE_T),Entry::CLASS_SEC,VhdlDocGen::ARCHITECTURE,0,0,Private);
}
try
{
@@ -511,7 +511,7 @@ QCString attribute_declaration() : {QCString s,s1;}
QCString attribute_designator (): {QCString s;Token *tok=0;}
{
s=identifier() { return s;}
- | tok=<RANGE_T> { return tok->image.c_str(); }
+ | tok=<RANGE_T> { return QCString(tok->image); }
}
@@ -532,12 +532,12 @@ QCString attribute_specification(): {QCString s,s1,s2;}
QCString base() : {Token *tok=0;}
{
- tok=<INTEGER> { return tok->image.c_str();}
+ tok=<INTEGER> { return QCString(tok->image);}
}
QCString base_specifier (): {Token *tok=0;}
{
- tok=<BASIC_IDENTIFIER> { return tok->image.c_str();}
+ tok=<BASIC_IDENTIFIER> { return QCString(tok->image);}
}
QCString base_unit_declaration() :
@@ -548,17 +548,17 @@ QCString base_unit_declaration() :
QCString based_integer() : {Token *tok=0;}
{
- tok=<BASIC_IDENTIFIER> { return tok->image.c_str();}
+ tok=<BASIC_IDENTIFIER> { return QCString(tok->image);}
}
QCString based_literal(): {Token *tok=0;}
{
- tok=<BASED_LITERAL> { return tok->image.c_str();}
+ tok=<BASED_LITERAL> { return QCString(tok->image);}
}
QCString basic_identifier() : {Token *tok=0;}
{
- tok=<BASIC_IDENTIFIER> { return tok->image.c_str();}
+ tok=<BASIC_IDENTIFIER> { return QCString(tok->image);}
}
void binding_indication() : {}
@@ -570,13 +570,13 @@ void binding_indication() : {}
QCString bit_string_literal (): {Token *tok=0;}
{
- tok=<BIT_STRING_LITERAL> { return tok->image.c_str();}
+ tok=<BIT_STRING_LITERAL> { return QCString(tok->image);}
}
QCString bit_value() : {Token *tok=0;}
{
- tok=<BASIC_IDENTIFIER> { return tok->image.c_str();}
+ tok=<BASIC_IDENTIFIER> { return QCString(tok->image);}
}
void block_configuration() : {}
@@ -653,7 +653,7 @@ void case_statement() : {QCString s;}
<CASE_T> s=expression()
{
QCString ca="case "+s;
- FlowChart::addFlowChart(FlowChart::CASE_NO,0,ca);
+ FlowChart::addFlowChart(FlowChart::CASE_NO,QCString(),ca);
}
<IS_T>
case_statement_alternative()
@@ -661,7 +661,7 @@ void case_statement() : {QCString s;}
<END_T> <CASE_T> [ identifier() ] <SEMI_T>
{
FlowChart::moveToPrevLevel();
- FlowChart::addFlowChart(FlowChart::END_CASE,"end case",0);
+ FlowChart::addFlowChart(FlowChart::END_CASE,"end case",QCString());
}
}
@@ -669,16 +669,16 @@ void case_statement_alternative() : {QCString s;}
{
<WHEN_T> s=choices() <ARROW_T>
{
- QCString t="when ";
+ QCString t("when ");
t+=s+"=> ";
- FlowChart::addFlowChart(FlowChart::WHEN_NO,s.data(),t);
+ FlowChart::addFlowChart(FlowChart::WHEN_NO,s,t);
}
sequence_of_statement(){FlowChart::moveToPrevLevel(); }
}
QCString character_literal() : {Token *tok=0;}
{
- tok=<CHARACTER_LITERAL>{ return tok->image.c_str();}
+ tok=<CHARACTER_LITERAL>{ return QCString(tok->image);}
}
QCString choice() : {QCString s;}
@@ -731,8 +731,8 @@ void component_instantiation_statement() : {QCString s,s1;}
{
QCString s3;
if (s1.contains("|")) {
- s3=VhdlDocGen::getIndexWord(s1.data(),0);
- s1=VhdlDocGen::getIndexWord(s1.data(),1);
+ s3=VhdlDocGen::getIndexWord(s1,0);
+ s1=VhdlDocGen::getIndexWord(s1,1);
}
outlineParser()->addCompInst(s.lower().data(),s1.lower().data(),s3.data(),outlineParser()->getLine());
@@ -914,7 +914,7 @@ void context_item() : {}
QCString decimal_literal() : {Token *tok=0;}
{
- tok=<DECIMAL_LITERAL> { return tok->image.c_str(); }
+ tok=<DECIMAL_LITERAL> { return QCString(tok->image); }
}
@@ -944,8 +944,8 @@ QCString designator() : {QCString s;}
QCString direction (): {Token *tok=0;}
{
-tok=<TO_T> { return tok->image.c_str();}
-| tok=<DOWNTO_T> { return tok->image.c_str();}
+tok=<TO_T> { return QCString(tok->image);}
+| tok=<DOWNTO_T> { return QCString(tok->image);}
}
void disconnection_specification() : {}
@@ -979,27 +979,31 @@ return s1;
QCString element_declaration() : {QCString rec_name,s1,s2;}
{
-rec_name=identifier_list() <COLON_T> s1=subtype_indication() <SEMI_T>
-{
- QCString name;
- QCStringList ql=QCStringList::split(",",rec_name);
- for (uint j=0;j<ql.count();j++)
- {
- name=ql[j]+"~";
- name+=outlineParser()->getNameID().data();;
- outlineParser()->addVhdlType(name.data(),outlineParser()->getLine(),Entry::VARIABLE_SEC,VhdlDocGen::RECORD,0,s1.data(),Public);
- }
- s2=rec_name+":"+s1;
- return s2;
- }
+ rec_name=identifier_list() <COLON_T> s1=subtype_indication() <SEMI_T>
+ {
+ auto ql = split(rec_name.str(),",");
+ for (const auto &n : ql)
+ {
+ std::string name=n+"~";
+ name+=outlineParser()->getNameID().data();
+ outlineParser()->addVhdlType(
+ name.c_str(),outlineParser()->getLine(),
+ Entry::VARIABLE_SEC,
+ VhdlDocGen::RECORD,0,
+ s1.data(),
+ Public);
+ }
+ s2=rec_name+":"+s1;
+ return s2;
+ }
}
QCString entity_aspect() : {Token *tok=0;QCString s,s1;}
{
tok=<ENTITY_T> s=name() [ LOOKAHEAD(1)<LPAREN_T> s1=identifier() <RPAREN_T> {s+="("+s1+")";} ] { return s;}
-| tok=<CONFIGURATION_T> s=name() { return tok->image.c_str()+s;}
-| tok=<OPEN_T> { return tok->image.c_str(); }
+| tok=<CONFIGURATION_T> s=name() { return QCString(tok->image)+s;}
+| tok=<OPEN_T> { return QCString(tok->image); }
}
QCString entity_class() : {}
@@ -1152,7 +1156,7 @@ QCString exit_statement() : {QCString s,s1,s2;Token *t=0;Token *t1=0;}
m_sharedState->lab.resize(0);
if(t) s+=":";
if(t1) s2.prepend(" when ");
- FlowChart::addFlowChart(FlowChart::EXIT_NO,"exit",s2.data(),s1.data());
+ FlowChart::addFlowChart(FlowChart::EXIT_NO,"exit",s2,s1);
return s+s1+s2+";";
}
@@ -1176,7 +1180,7 @@ QCString logop() : {}
QCString extended_identifier (): {Token *t;}
{
- t=<EXTENDED_CHARACTER> { return t->image.c_str(); }
+ t=<EXTENDED_CHARACTER> { return QCString(t->image); }
}
QCString factor(): {QCString s,s1;}
@@ -1222,7 +1226,7 @@ QCString floating_type_definition() : {QCString s;}
QCString formal_designator() : {QCString s;Token *tok=0;}
{
s=name() { return s; }
- |tok=<INTEGER> { return tok->image.c_str();}
+ |tok=<INTEGER> { return QCString(tok->image);}
}
@@ -1340,8 +1344,8 @@ void guarded_signal_specification() : {}
QCString identifier() : {Token *tok=0;}
{
- tok=<EXTENDED_CHARACTER>{ return tok->image.c_str(); }
- |tok=<BASIC_IDENTIFIER> { return tok->image.c_str(); }
+ tok=<EXTENDED_CHARACTER>{ return QCString(tok->image); }
+ |tok=<BASIC_IDENTIFIER> { return QCString(tok->image); }
}
QCString identifier_list() : {QCString str,str1;}
@@ -1355,25 +1359,25 @@ void if_statement() : {QCString s,s1;}
<IF_T> s=condition() <THEN_T>
{
s.prepend("if ");
- FlowChart::addFlowChart(FlowChart::IF_NO,0,s);
+ FlowChart::addFlowChart(FlowChart::IF_NO,QCString(),s);
}
sequence_of_statement()
(
<ELSIF_T> s1=condition() <THEN_T>
{
s1.prepend("elsif ");
- FlowChart::addFlowChart(FlowChart::ELSIF_NO,0,s1.data());
+ FlowChart::addFlowChart(FlowChart::ELSIF_NO,QCString(),s1);
}
sequence_of_statement()
)*
[LOOKAHEAD(1) <ELSE_T>
{
- FlowChart::addFlowChart(FlowChart::ELSE_NO,0,0);
+ FlowChart::addFlowChart(FlowChart::ELSE_NO,QCString(),QCString());
}
sequence_of_statement() ] <END_T> <IF_T> [ identifier() ] <SEMI_T>
{
FlowChart::moveToPrevLevel();
- FlowChart::addFlowChart(FlowChart::ENDIF_NO,0,0);
+ FlowChart::addFlowChart(FlowChart::ENDIF_NO,QCString(),QCString());
}
}
@@ -1385,11 +1389,9 @@ QCString incomplete_type_declaration() : {QCString s;}
}
}
-QCString index_constraint() : {QCString s="("; QCString s1,s2;}
+QCString index_constraint() : {QCString s("("); QCString s1,s2;}
{
- //try{
<LPAREN_T> s2=discrete_range(){s+=s2;}(LOOKAHEAD(1)<COMMA_T> s1=discrete_range(){s+=",";s+=s1;})* <RPAREN_T> {return s+")";}
-//}catch(...){ outlineParser()->error_skipto(SEMI_T);hasError=false;return "";}
}
QCString index_specification() : {QCString s;}
@@ -1414,13 +1416,13 @@ QCString instantiation_unit() : {QCString s,s1,s2;}
QCString instantiation_list() : {QCString s;Token *tok=0;}
{
s=identifier_list() { return s;}
-| tok=<OTHER_T> {return tok->image.c_str();}
-| tok=<ALL_T> {return tok->image.c_str();}
+| tok=<OTHER_T> {return QCString(tok->image);}
+| tok=<ALL_T> {return QCString(tok->image);}
}
QCString integer() : {Token *t;}
{
- t=<INTEGER> {return t->image.c_str();}
+ t=<INTEGER> {return QCString(t->image);}
}
QCString integer_type_definition() : {QCString s;}
@@ -1464,7 +1466,7 @@ QCString interface_file_declaration() : {QCString s,s1;}
<FILE_T> s=identifier_list() <COLON_T> s1=subtype_indication()
{
outlineParser()->addVhdlType(s.data(),outlineParser()->getLine(),Entry::VARIABLE_SEC,VhdlDocGen::VFILE,0,s1.data(),Public);
- return " file "+s+":"+s1;
+ return QCString(" file "+s+":"+s1);
}
}
@@ -1482,7 +1484,7 @@ QCString interface_variable_declaration() : {Token *tok=0;Token *tok1=0;Token *
s2=subtype_indication() [ tok1=<BUS_T> ] [ tok2=<VARASSIGN_T> s4=expression() ]
{
if(tok)
- s5=tok->image.c_str();
+ s5=QCString(tok->image);
if(tok1)
s3=tok1->image.data();
@@ -1516,14 +1518,14 @@ QCString iteration_scheme() : {QCString s;}
<WHILE_T> s=condition()
{
s.prepend("while ");
- FlowChart::addFlowChart(FlowChart::WHILE_NO,0,s.data(),m_sharedState->lab.data());
+ FlowChart::addFlowChart(FlowChart::WHILE_NO,QCString(),s,m_sharedState->lab);
m_sharedState->lab="";
return s;
}
| <FOR_T> s=parameter_specification()
{
QCString q=m_sharedState->lab+" for "+s;
- FlowChart::addFlowChart(FlowChart::FOR_NO,0,q.data(),m_sharedState->lab.data());
+ FlowChart::addFlowChart(FlowChart::FOR_NO,QCString(),q,m_sharedState->lab);
m_sharedState->lab="";
return q;
}
@@ -1584,7 +1586,7 @@ QCString loop_statement() : {QCString s,s1,s2,s3;}
[ s1=iteration_scheme() ]
{
if(s1.isEmpty())
- FlowChart::addFlowChart(FlowChart::LOOP_NO,0,"infinite");
+ FlowChart::addFlowChart(FlowChart::LOOP_NO,QCString(),"infinite");
}
<LOOP_T>
s2=sequence_of_statement()
@@ -1593,7 +1595,7 @@ QCString loop_statement() : {QCString s,s1,s2,s3;}
QCString q = s+" loop "+s2+" end loop" +s3;
QCString endLoop="end loop" + s3;
FlowChart::moveToPrevLevel();
- FlowChart::addFlowChart(FlowChart::END_LOOP,endLoop.data(),0);
+ FlowChart::addFlowChart(FlowChart::END_LOOP,endLoop,QCString());
return q;
}
@@ -1602,9 +1604,9 @@ QCString loop_statement() : {QCString s,s1,s2,s3;}
QCString miscellaneous_operator():{Token *t=0;}
{
- <DOUBLEMULT_T> {return "**";}
- | <ABS_T> {return "abs";}
- | <NOT_T> {return "not";}
+ <DOUBLEMULT_T> { return "**"; }
+ | <ABS_T> { return "abs"; }
+ | <NOT_T> { return "not"; }
}
QCString mode() : {Token *tok=0;}
@@ -1618,10 +1620,10 @@ tok=<IN_T> { return "in"; }
QCString multiplying_operation() : {Token *tok=0;}
{
-tok=<MULT_T> { return tok->image.c_str(); }
-| tok=<SLASH_T> { return tok->image.c_str(); }
-| tok=<MOD_T> { return tok->image.c_str(); }
-| tok=<REM_T> { return tok->image.c_str(); }
+tok=<MULT_T> { return QCString(tok->image); }
+| tok=<SLASH_T> { return QCString(tok->image); }
+| tok=<MOD_T> { return QCString(tok->image); }
+| tok=<REM_T> { return QCString(tok->image); }
}
@@ -1683,7 +1685,7 @@ QCString next_statement() : {QCString s,s1,s2;Token *t=0;Token *t1=0;}
[ t1=<WHEN_T> s2=condition() ] <SEMI_T>
{
if(t) s+=":";
- FlowChart::addFlowChart(FlowChart::NEXT_NO,"next ",s2.data(),s1.data());
+ FlowChart::addFlowChart(FlowChart::NEXT_NO,"next ",s2,s1);
m_sharedState->lab.resize(0);
if(t1) s2.prepend("when ");
return s+s1+s2+";";
@@ -1715,7 +1717,7 @@ QCString object_class() : {}
QCString operator_symbol() : {Token *tok=0;}
{
-tok=<STRINGLITERAL> {return tok->image.c_str();}
+tok=<STRINGLITERAL> {return QCString(tok->image);}
}
void options() : {}
@@ -1729,7 +1731,7 @@ void package_body() : {QCString s;}
{
m_sharedState->lastCompound=m_sharedState->current;
s.prepend("_");
- outlineParser()->addVhdlType(s,outlineParser()->getLine(),Entry::CLASS_SEC,VhdlDocGen::PACKAGE_BODY,0,0,Protected);
+ outlineParser()->addVhdlType(s.data(),outlineParser()->getLine(),Entry::CLASS_SEC,VhdlDocGen::PACKAGE_BODY,0,0,Protected);
}
package_body_declarative_part()
@@ -1778,7 +1780,7 @@ void package_declaration(): {QCString s;}
clone->bodyLine=outlineParser()->getLine(PACKAGE_T);
clone->protection=Package;
m_sharedState->current_root->moveToSubEntryAndKeep(clone);
- outlineParser()->addVhdlType(s,outlineParser()->getLine(PACKAGE_T),Entry::CLASS_SEC,VhdlDocGen::PACKAGE,0,0,Package);
+ outlineParser()->addVhdlType(s.data(),outlineParser()->getLine(PACKAGE_T),Entry::CLASS_SEC,VhdlDocGen::PACKAGE,0,0,Package);
}
package_header()
package_declarative_part()
@@ -1883,7 +1885,7 @@ LOOKAHEAD(name())
s=name() { return s;}
|
LOOKAHEAD(allocator())
-allocator() { return "";}
+allocator() { return QCString();}
|
s=aggregate() { return s; }
}
@@ -1920,7 +1922,7 @@ QCString procedure_call_statement() : {QCString s,s1;}
QCString process_declarative_item() : {QCString s;}
{
-subprogram_declaration() { return "";}
+subprogram_declaration() { return QCString();}
//| subprogram_body()
| s=type_declaration() { return s;}
| s=subtype_declaration() { return s;}
@@ -1958,8 +1960,8 @@ void process_statement() : {QCString s,s1,s2;Token *tok=0;Token *tok1=0;}
s2=process_declarative_part()
{
if (s2.data())
- FlowChart::addFlowChart(FlowChart::VARIABLE_NO,s2.data(),0);
- FlowChart::addFlowChart(FlowChart::BEGIN_NO,"BEGIN",0);
+ FlowChart::addFlowChart(FlowChart::VARIABLE_NO,s2,QCString());
+ FlowChart::addFlowChart(FlowChart::BEGIN_NO,"BEGIN",QCString());
}
<BEGIN_T>
process_statement_part()
@@ -1976,8 +1978,8 @@ void process_statement() : {QCString s,s1,s2;Token *tok=0;Token *tok1=0;}
m_sharedState->current->endBodyLine=outlineParser()->getLine();
m_sharedState->currP=0;
if(tok)
- s1=tok->image.data();
- outlineParser()->createFunction(m_sharedState->currName,VhdlDocGen::PROCESS,s1.data());
+ s1=tok->image;
+ outlineParser()->createFunction(m_sharedState->currName.data(),VhdlDocGen::PROCESS,s1.data());
outlineParser()->createFlow();
m_sharedState->currName="";
outlineParser()->newEntry();
@@ -2042,7 +2044,7 @@ QCString relation_operator() : {}
|<QG_T> { return "?>";}
|<QL_T> { return "?<";}
|<QEQU_T> { return "?=";}
- |<QNEQU_T> {return "?/="; }
+ |<QNEQU_T> {return "?/="; }
}
@@ -2128,22 +2130,22 @@ QCString sequence_of_statement() : {QCString s,s1;}
QCString sequential_statement() :{QCString s;}
{
LOOKAHEAD( [ identifier() ":" ] target() "<=")
- s=signal_assignment_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;}
+ s=signal_assignment_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s,QCString());return s;}
|
LOOKAHEAD(3)
- s=assertion_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;}
+ s=assertion_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s,QCString());return s;}
|
LOOKAHEAD(3)
- s=report_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;}
+ s=report_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s,QCString());return s;}
|
LOOKAHEAD(3)
- s=wait_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;}
+ s=wait_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s,QCString());return s;}
|
LOOKAHEAD( [ identifier() ":" ] target() ":=" )
- s=variable_assignment_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;}
+ s=variable_assignment_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s,QCString());return s;}
|
LOOKAHEAD(3)
- s=procedure_call_statement(){ FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s; }
+ s=procedure_call_statement(){ FlowChart::addFlowChart(FlowChart::TEXT_NO,s,QCString());return s; }
|
LOOKAHEAD(3)
if_statement(){return s;}
@@ -2161,9 +2163,9 @@ QCString sequential_statement() :{QCString s;}
s=exit_statement(){return s;}
|
LOOKAHEAD(3)
- s=return_statement(){FlowChart::addFlowChart(FlowChart::RETURN_NO,s.data(),0);return s;}
+ s=return_statement(){FlowChart::addFlowChart(FlowChart::RETURN_NO,s,QCString());return s;}
|
- s=null_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s.data(),0);return s;}
+ s=null_statement(){FlowChart::addFlowChart(FlowChart::TEXT_NO,s,QCString());return s;}
}
QCString shift_expression() : {QCString s,s1,s2;}
@@ -2190,10 +2192,10 @@ QCString signal_assignment_statement() : {QCString s,s1,s2,s3;}
{
LOOKAHEAD(conditional_signal_assignment_wave())
- conditional_signal_assignment_wave(){ return ""; }
+ conditional_signal_assignment_wave(){ return QCString(); }
|
LOOKAHEAD(selected_signal_assignment_wave())
- selected_signal_assignment_wave() { return ""; }
+ selected_signal_assignment_wave() { return QCString(); }
|
[LOOKAHEAD(2) s=identifier() <COLON_T> {s+=":";} ]
s1=target() <LESSTHAN_T>
@@ -2259,7 +2261,7 @@ QCString slice_name() : {QCString s,s1;}
QCString string_literal() : {Token *tok=0;}
{
-tok=<STRINGLITERAL> {return tok->image.c_str();}
+tok=<STRINGLITERAL> {return QCString(tok->image);}
}
void subprogram_body() : {QCString s;}
@@ -2271,9 +2273,9 @@ tok=<STRINGLITERAL> {return tok->image.c_str();}
{
if (s.data())
{
- FlowChart::addFlowChart(FlowChart::VARIABLE_NO,s,0);
+ FlowChart::addFlowChart(FlowChart::VARIABLE_NO,s,QCString());
}
- FlowChart::addFlowChart(FlowChart::BEGIN_NO,"BEGIN",0);
+ FlowChart::addFlowChart(FlowChart::BEGIN_NO,"BEGIN",QCString());
}
// }catch(...){outlineParser()->error_skipto(BEGIN_T);}
<BEGIN_T>
@@ -2303,9 +2305,9 @@ void subprogram_1() : {}
QCString subprogram_declarative_item() : {QCString s;}
{
-subprogram_declaration(){ return "";}
+subprogram_declaration(){ return QCString();}
|s=type_declaration(){ return s;}
- | subprogram_body(){ return "";}
+ | subprogram_body(){ return QCString();}
| s=subtype_declaration(){ return s;}
| s=constant_declaration(){ return s;}
| s=variable_declaration(){ return s;}
@@ -2438,16 +2440,14 @@ s=full_type_declaration(){ return s;}
QCString type_definition() : {QCString s;}
{
-//try{
s=scalar_type_definition(){ return s;}
| s=composite_type_definition(){ return s;}
| s=access_type_definition(){ return s;}
| s=file_type_definition(){ return s;}
|
LOOKAHEAD(2)
- protected_type_body() { return ""; }
-| protected_type_declaration() { return ""; }
-//}catch(...){outlineParser()->error_skipto(SEMI_T); return "";}
+ protected_type_body() { return QCString(); }
+| protected_type_declaration() { return QCString(); }
}
QCString type_mark() : {QCString s; }
@@ -2465,14 +2465,22 @@ QCString unconstraint_array_definition() : {QCString s,s1,s2,s3;}
{
<USE_T> s=selected_name()(<COMMA_T> s1=selected_name(){s+=",";s+=s1;})* <SEMI_T>
{
- QCStringList ql1=QCStringList::split(",",s);
- for (uint j=0;j<ql1.count();j++)
+ auto ql1=split(s.str(),",");
+ for (const auto &name : ql1)
{
- QCStringList ql=QCStringList::split(".",ql1[j]);
- QCString it=ql[1];
- if ( m_sharedState->parse_sec==0 && Config_getBool(SHOW_INCLUDE_FILES) )
+ auto ql2=split(name,".");
+ if (ql2.size()>1)
{
- outlineParser()->addVhdlType(it.data(),outlineParser()->getLine(),Entry::VARIABLE_SEC,VhdlDocGen::USE,it.data(),"_use_",Public);
+ std::string it=ql2[1];
+ if ( m_sharedState->parse_sec==0 && Config_getBool(SHOW_INCLUDE_FILES) )
+ {
+ outlineParser()->addVhdlType(it.c_str(),
+ outlineParser()->getLine(),
+ Entry::VARIABLE_SEC,
+ VhdlDocGen::USE,
+ it.c_str(),
+ "_use_",Public);
+ }
}
}
s1="use "+s;
@@ -2486,7 +2494,7 @@ QCString variable_assignment_statement() : {QCString s,s1,s2;}
s1=target() <VARASSIGN_T> s2=expression() <SEMI_T>
{return s+s1+":="+s2+";";}
|
- selected_variable_assignment() { return ""; }
+ selected_variable_assignment() { return QCString(); }
}
QCString variable_declaration() : {Token *tok=0;Token *t1=0;QCString s,s1,s2;}
@@ -2555,7 +2563,7 @@ QCString protected_type_body() :{ }
protected_type_body_declarative_part()
//}catch(...){outlineParser()->error_skipto(END_T);}
- <END_T><PROTECTED_T> <BODY_T> [identifier()] {return "";}
+ <END_T><PROTECTED_T> <BODY_T> [identifier()] {return QCString();}
}
void protected_type_body_declarative_item() : { }
@@ -2591,7 +2599,7 @@ QCString protected_type_declaration() : { }
try{
protected_type_declarative_part()
}catch(...){outlineParser()->error_skipto(END_T);}
- <END_T><PROTECTED_T> [ identifier() ] { return "";}
+ <END_T><PROTECTED_T> [ identifier() ] { return QCString();}
}
@@ -2742,9 +2750,9 @@ QCString external_name(): {QCString s,s1,s2;}
QCString sig_stat(): {Token *t;}
{
- t=<CONSTANT_T> { return t->image.data(); }
- | t=<SIGNAL_T> { return t->image.data(); }
- | t=<VARIABLE_T> { return t->image.data(); }
+ t=<CONSTANT_T> { return QCString(t->image); }
+ | t=<SIGNAL_T> { return QCString(t->image); }
+ | t=<VARIABLE_T> { return QCString(t->image); }
}
@@ -2917,7 +2925,7 @@ QCString ifunc():{QCString s,s1,s2,s3;Token *t=0;Token *t1=0;Token *t2=0;}
if (a>b) b=a;
outlineParser()->addVhdlType(m_sharedState->current->name.data(),b,Entry::VARIABLE_SEC,VhdlDocGen::GENERIC,ss.data(),0,Public);
}
- m_sharedState->currP=0;return "";
+ m_sharedState->currP=0;return QCString();
}
}