Doxygen
Loading...
Searching...
No Matches
mandocvisitor.cpp
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2020 by Dimitri van Heesch.
4 *
5 * Permission to use, copy, modify, and distribute this software and its
6 * documentation under the terms of the GNU General Public License is hereby
7 * granted. No representations are made about the suitability of this software
8 * for any purpose. It is provided "as is" without express or implied warranty.
9 * See the GNU General Public License for more details.
10 *
11 * Documents produced by Doxygen are derivative works derived from the
12 * input used in their production; they are not affected by this license.
13 *
14 */
15
16// own header
17#include "mandocvisitor.h"
18
19// other includes
20#include "cite.h"
21#include "code.h"
22#include "codefragment.h"
23#include "docparser.h"
24#include "dot.h"
25#include "doxygen.h"
26#include "emoji.h"
27#include "filedef.h"
28#include "fileinfo.h"
29#include "htmlentity.h"
30#include "language.h"
31#include "message.h"
32#include "outputlist.h"
33#include "parserintf.h"
34#include "util.h"
35
37 const DString &langExt)
38 : m_t(t), m_ci(ci), m_insidePre(false), m_hide(false), m_firstCol(false),
39 m_indent(0), m_langExt(langExt)
40{
41}
42
43 //--------------------------------------
44 // visitor functions for leaf nodes
45 //--------------------------------------
46
48{
49 if (m_hide) return;
50 filter(w.word());
51 m_firstCol=false;
52}
53
55{
56 if (m_hide) return;
57 m_t << "\\fB";
58 filter(w.word());
59 m_t << "\\fP";
60 m_firstCol=false;
61}
62
64{
65 if (m_hide) return;
66 if (m_insidePre)
67 {
68 m_t << w.chars();
69 m_firstCol=w.chars().at(w.chars().length()-1)=='\n';
70 }
71 else if (!m_firstCol)
72 {
73 m_t << " ";
74 }
75 else
76 {
77 m_firstCol=false;
78 }
79}
80
82{
83 if (m_hide) return;
84 const char *res = HtmlEntityMapper::instance().man(s.symbol());
85 if (res)
86 {
87 m_t << res;
88 }
89 else
90 {
91 // no error or warning to be supplied
92 // err("man: non supported HTML-entity found: &{};\n",get_symbol_item(s->symbol()));
93 }
94 m_firstCol=false;
95}
96
98{
99 if (m_hide) return;
100 const char *res = EmojiEntityMapper::instance().name(s.index());
101 if (res)
102 {
103 m_t << res;
104 }
105 else
106 {
107 m_t << s.name();
108 }
109 m_firstCol=false;
110}
111
113{
114 if (m_hide) return;
115 m_t << u.url();
116 m_firstCol=false;
117}
118
120{
121 if (m_hide) return;
122 m_t << "\n.br\n";
123 m_firstCol=true;
124}
125
127{
128 if (m_hide) return;
129 if (!m_firstCol) m_t << "\n";
130 m_t << ".PP\n";
131 m_firstCol=true;
132}
133
135{
136 if (m_hide) return;
137 switch (s.style())
138 {
140 if (s.enable()) m_t << "\\fB"; else m_t << "\\fP";
141 m_firstCol=false;
142 break;
146 /* not supported */
147 break;
148 case DocStyleChange::Underline: //underline is shown as emphasis
150 if (s.enable()) m_t << "\\fI"; else m_t << "\\fP";
151 m_firstCol=false;
152 break;
154 if (s.enable()) m_t << "\\fI"; else m_t << "\\fP";
155 m_firstCol=false;
156 break;
160 if (s.enable()) m_t << "\\fR"; else m_t << "\\fP";
161 m_firstCol=false;
162 break;
164 if (s.enable()) m_t << "\\*<"; else m_t << "\\*> ";
165 m_firstCol=false;
166 break;
168 if (s.enable()) m_t << "\\*{"; else m_t << "\\*} ";
169 m_firstCol=false;
170 break;
172 /* not supported */
173 break;
175 /* not supported */
176 break;
178 /* not supported */
179 break;
181 if (s.enable())
182 {
183 if (!m_firstCol) m_t << "\n";
184 m_t << ".PP\n";
185 m_t << ".nf\n";
186 m_insidePre=true;
187 }
188 else
189 {
190 m_insidePre=false;
191 if (!m_firstCol) m_t << "\n";
192 m_t << ".fi\n";
193 m_t << ".PP\n";
194 m_firstCol=true;
195 }
196 break;
197 case DocStyleChange::Div: /* HTML only */ break;
198 case DocStyleChange::Span: /* HTML only */ break;
199 }
200}
201
203{
204 if (m_hide) return;
205 DString lang = m_langExt;
206 if (!s.language().empty()) // explicit language setting
207 {
208 lang = s.language();
209 }
210 SrcLangExt langExt = getLanguageFromCodeLang(lang);
211 switch (s.type())
212 {
214 if (!m_firstCol) m_t << "\n";
215 m_t << ".PP\n";
216 m_t << ".nf\n";
218 langExt,
219 Config_getBool(STRIP_CODE_COMMENTS),
220 CodeParserOptions().setExample(s.isExample(),s.exampleFile())
221 );
222 if (!m_firstCol) m_t << "\n";
223 m_t << ".fi\n";
224 m_t << ".PP\n";
225 m_firstCol=true;
226 break;
228 filter(s.text(),true);
229 break;
231 m_t << "\\fR\n";
232 filter(s.text(),true);
233 m_t << "\\fP\n";
234 break;
236 if (!m_firstCol) m_t << "\n";
237 m_t << ".PP\n";
238 m_t << ".nf\n";
239 filter(s.text(),true);
240 if (!m_firstCol) m_t << "\n";
241 m_t << ".fi\n";
242 m_t << ".PP\n";
243 m_firstCol=true;
244 break;
246 m_t << s.text();
247 break;
253 case DocVerbatim::Dot:
254 case DocVerbatim::Msc:
257 /* nothing */
258 break;
259 }
260}
261
263{
264 /* no support for anchors in man pages */
265}
266
268{
269 if (m_hide) return;
271 switch(inc.type())
272 {
274 {
275 if (!m_firstCol) m_t << "\n";
276 m_t << ".PP\n";
277 m_t << ".nf\n";
278 FileInfo cfi( inc.file().str() );
279 auto fd = createFileDef( cfi.dirPath(), cfi.fileName() );
281 inc.text(),
282 langExt,
283 inc.stripCodeComments(),
285 .setExample(inc.isExample(),inc.exampleFile())
286 .setFileDef(fd.get())
287 .setInlineFragment(true)
288 );
289 m_t << ".fi\n";
290 m_t << ".PP\n";
291 m_firstCol=true;
292 }
293 break;
295 if (!m_firstCol) m_t << "\n";
296 m_t << ".PP\n";
297 m_t << ".nf\n";
299 inc.text(),
300 langExt,
301 inc.stripCodeComments(),
303 .setExample(inc.isExample(),inc.exampleFile())
304 .setInlineFragment(true)
305 .setShowLineNumbers(false)
306 );
307 m_t << ".fi\n";
308 m_t << ".PP\n";
309 m_firstCol=true;
310 break;
318 break;
320 m_t << inc.text();
321 break;
323 if (!m_firstCol) m_t << "\n";
324 m_t << ".PP\n";
325 m_t << ".nf\n";
326 m_t << inc.text();
327 if (!m_firstCol) m_t << "\n";
328 m_t << ".fi\n";
329 m_t << ".PP\n";
330 m_firstCol=true;
331 break;
334 if (!m_firstCol) m_t << "\n";
335 m_t << ".PP\n";
336 m_t << ".nf\n";
338 inc.file(),
339 inc.blockId(),
340 inc.context(),
342 inc.trimLeft(),
344 );
345 m_t << ".fi\n";
346 m_t << ".PP\n";
347 m_firstCol=true;
348 break;
349 }
350}
351
353{
355 if (locLangExt.empty()) locLangExt = m_langExt;
356 SrcLangExt langExt = getLanguageFromFileName(locLangExt);
357 //printf("DocIncOperator: type=%d first=%d, last=%d text='%s'\n",
358 // op.type(),op.isFirst(),op.isLast(),qPrint(op.text()));
359 if (op.isFirst())
360 {
361 if (!m_hide)
362 {
363 if (!m_firstCol) m_t << "\n";
364 m_t << ".PP\n";
365 m_t << ".nf\n";
366 }
368 m_hide = true;
369 }
370 if (op.type()!=DocIncOperator::Skip)
371 {
372 m_hide = popHidden();
373 if (!m_hide)
374 {
375 std::unique_ptr<FileDef> fd;
376 if (!op.includeFileName().empty())
377 {
378 FileInfo cfi( op.includeFileName().str() );
379 fd = createFileDef( cfi.dirPath(), cfi.fileName() );
380 }
381
382 getCodeParser(locLangExt).parseCode(m_ci,op.context(),op.text(),langExt,
385 .setExample(op.isExample(),op.exampleFile())
386 .setFileDef(fd.get())
388 );
389 }
391 m_hide=true;
392 }
393 if (op.isLast())
394 {
395 m_hide = popHidden();
396 if (!m_hide)
397 {
398 if (!m_firstCol) m_t << "\n";
399 m_t << ".fi\n";
400 m_t << ".PP\n";
401 m_firstCol=true;
402 }
403 }
404 else
405 {
406 if (!m_hide) m_t << "\n";
407 }
408}
409
411{
412 if (m_hide) return;
413 m_t << f.text();
414}
415
419
423
425{
426 if (m_hide) return;
427 m_t << "\\fB";
428 auto opt = cite.option();
429 DString txt;
430 if (!cite.file().empty())
431 {
432 txt = cite.getText();
433 filter(txt, false, true);
434 }
435 else
436 {
437 if (!opt.noPar()) txt += "[";
438 txt += cite.target();
439 if (!opt.noPar()) txt += "]";
440 filter(txt);
441 }
442 m_t << "\\fP";
443}
444
446{
447 if (m_hide) return;
448 m_t << s.chars();
449}
450
451
452//--------------------------------------
453// visitor functions for compound nodes
454//--------------------------------------
455
457{
458 if (m_hide) return;
459 m_indent++;
460 visitChildren(l);
461 m_indent--;
462 m_t << ".PP\n";
463}
464
466{
467 if (m_hide) return;
468 DString ws;
469 if (m_indent>0) ws.fill(' ',2*(m_indent-1));
470 if (!m_firstCol) m_t << "\n";
471 m_t << ".IP \"" << ws;
472 const DocAutoList *list = std::get_if<DocAutoList>(li.parent());
473 if (list && list->isEnumList())
474 {
475 m_t << li.itemNumber() << ".\" " << (2*(m_indent+1));
476 }
477 else // bullet list
478 {
479 switch (li.itemNumber())
480 {
481 case DocAutoList::Unchecked: // unchecked
482 m_t << "[ ]\" " << (2*m_indent) + 2;
483 break;
484 case DocAutoList::Checked_x: // checked with x
485 m_t << "[x]\" " << (2*m_indent) + 2;
486 break;
487 case DocAutoList::Checked_X: // checked with X
488 m_t << "[X]\" " << (2*m_indent) + 2;
489 break;
490 default:
491 m_t << "\\(bu\" " << (2*m_indent);
492 break;
493 }
494 }
495 m_t << "\n";
496 m_firstCol=true;
497 visitChildren(li);
498 m_t << "\n";
499 m_firstCol=true;
500}
501
503{
504 if (m_hide) return;
505 visitChildren(p);
506 if (!p.isLast() && // omit <p> for last paragraph
507 !(p.parent() && // and for parameter sections
508 std::get_if<DocParamSect>(p.parent())
509 )
510 )
511 {
512 if (!m_firstCol) m_t << "\n";
513 m_t << "\n.PP\n";
514 m_firstCol=true;
515 }
516}
517
519{
520 visitChildren(r);
521}
522
524{
525 if (m_hide) return;
526 if (!m_firstCol)
527 {
528 m_t << "\n";
529 m_t << ".PP\n";
530 }
531 m_t << "\\fB";
532 switch(s.type())
533 {
535 m_t << theTranslator->trSeeAlso(); break;
537 m_t << theTranslator->trReturns(); break;
539 m_t << theTranslator->trAuthor(true,true); break;
541 m_t << theTranslator->trAuthor(true,false); break;
543 m_t << theTranslator->trVersion(); break;
545 m_t << theTranslator->trSince(); break;
547 m_t << theTranslator->trDate(); break;
549 m_t << theTranslator->trNote(); break;
551 m_t << theTranslator->trWarning(); break;
553 m_t << theTranslator->trPrecondition(); break;
555 m_t << theTranslator->trPostcondition(); break;
557 m_t << theTranslator->trCopyright(); break;
559 m_t << theTranslator->trInvariant(); break;
561 m_t << theTranslator->trRemarks(); break;
563 m_t << theTranslator->trAttention(); break;
565 m_t << theTranslator->trImportant(); break;
566 case DocSimpleSect::User: break;
567 case DocSimpleSect::Rcs: break;
568 case DocSimpleSect::Unknown: break;
569 }
570
571 // special case 1: user defined title
572 if (s.title())
573 {
574 std::visit(*this,*s.title());
575 }
576 m_t << "\\fP\n";
577 m_t << ".RS 4\n";
578 visitChildren(s);
579 if (!m_firstCol) m_t << "\n";
580 m_t << ".RE\n";
581 m_t << ".PP\n";
582 m_firstCol=true;
583}
584
586{
587 if (m_hide) return;
588 visitChildren(t);
589}
590
592{
593 if (m_hide) return;
594 m_indent++;
595 if (!m_firstCol) m_t << "\n";
596 m_t << ".PD 0\n";
597 m_firstCol=true;
598 visitChildren(l);
599 m_indent--;
600 m_t << ".PP\n";
601}
602
604{
605 if (m_hide) return;
606 DString ws;
607 if (m_indent>0) ws.fill(' ',2*(m_indent-1));
608 if (!m_firstCol) m_t << "\n";
609 m_t << ".IP \"" << ws << "\\(bu\" " << m_indent << "\n";
610 m_firstCol=true;
611 if (li.paragraph())
612 {
613 visit(*this,*li.paragraph());
614 }
615 m_t << "\n";
616 m_firstCol=true;
617}
618
620{
621 if (m_hide) return;
622 if (!m_firstCol) m_t << "\n";
623 if (s.level()==1) m_t << ".SH"; else m_t << ".SS";
624 m_t << " \"";
625 if (s.title())
626 {
627 std::visit(*this,*s.title());
628 }
629 m_t << "\"\n";
630 if (s.level()==1) m_t << ".PP\n";
631 m_firstCol=true;
632 visitChildren(s);
633}
634
636{
637 if (m_hide) return;
638 m_indent++;
639 if (!m_firstCol) m_t << "\n";
640 m_t << ".PD 0\n";
641 m_firstCol=true;
642 int indent = std::min(m_indent,maxIndentLevels-1);
643 m_listItemInfo[indent].number = 1;
644 m_listItemInfo[indent].type = '1';
645 for (const auto &opt : l.attribs())
646 {
647 if (opt.name=="type")
648 {
649 m_listItemInfo[indent].type = opt.value[0];
650 }
651 if (opt.name=="start")
652 {
653 bool ok = false;
654 int val = opt.value.toInt(&ok);
655 if (ok) m_listItemInfo[indent].number = val;
656 }
657 }
658 visitChildren(l);
659 m_indent--;
660 if (!m_firstCol) m_t << "\n";
661 m_t << ".PP\n";
662}
663
665{
666 if (m_hide) return;
667 DString ws;
668 if (m_indent>0) ws.fill(' ',2*(m_indent-1));
669 if (!m_firstCol) m_t << "\n";
670 m_t << ".IP \"" << ws;
671 const DocHtmlList *list = std::get_if<DocHtmlList>(li.parent());
672 if (list && list->type()==DocHtmlList::Ordered)
673 {
674 int indent = std::min(m_indent,maxIndentLevels-1);
675 for (const auto &opt : li.attribs())
676 {
677 if (opt.name=="value")
678 {
679 bool ok = false;
680 int val = opt.value.toInt(&ok);
681 if (ok) m_listItemInfo[indent].number = val;
682 }
683 }
684 switch (m_listItemInfo[indent].type)
685 {
686 case '1':
687 m_t << m_listItemInfo[indent].number;
688 break;
689 case 'a':
690 m_t << DString::integerToAlpha(m_listItemInfo[indent].number,false);
691 break;
692 case 'A':
693 m_t << DString::integerToAlpha(m_listItemInfo[indent].number);
694 break;
695 case 'i':
696 m_t << DString::integerToRoman(m_listItemInfo[indent].number,false);
697 break;
698 case 'I':
699 m_t << DString::integerToRoman(m_listItemInfo[indent].number);
700 break;
701 default:
702 m_t << m_listItemInfo[indent].number;
703 break;
704 }
705 m_t << ".\" " << ((m_indent+1)*2);
706 m_listItemInfo[indent].number++;
707 }
708 else // bullet list
709 {
710 m_t << "\\(bu\" " << (m_indent*2);
711 }
712 m_t << "\n";
713 m_firstCol=true;
714 visitChildren(li);
715 m_t << "\n";
716 m_firstCol=true;
717}
718
720{
721 if (m_hide) return;
722 m_indent+=2;
723 visitChildren(dl);
724 m_indent-=2;
725 if (!m_firstCol) m_t << "\n";
726 m_t << "\n.PP\n";
727 m_firstCol=true;
728}
729
731{
732 if (m_hide) return;
733 if (!m_firstCol) m_t << "\n";
734 m_t << "\n.PP";
735 m_t << "\n.IP \"\\fB";
736 m_firstCol=false;
737 visitChildren(dt);
738}
739
741{
742 if (!m_firstCol) m_t << "\n";
743 m_t << ".IP \"\" 1c\n";
744 m_firstCol=true;
745 visitChildren(dd);
746}
747
749{
750 visitChildren(t);
751}
752
757
759{
760 visitChildren(r);
761}
762
764{
765 visitChildren(c);
766}
767
769{
770 visitChildren(i);
771}
772
774{
775 if (m_hide) return;
776 m_t << "\\fR";
777 visitChildren(href);
778 m_t << "\\fP";
779}
780
782{
783 m_t << "\\fB";
784 visitChildren(s);
785 m_t << "\\fP\n.PP\n";
786}
787
789{
790 if (m_hide) return;
791 if (!m_firstCol)
792 {
793 m_t << "\n";
794 m_t << ".PP\n";
795 }
796 auto summary = d.summary();
797 if (summary)
798 {
799 std::visit(*this,*summary);
800 m_t << ".PP\n";
801 m_t << ".RS 4\n";
802 }
803 visitChildren(d);
804 if (!m_firstCol) m_t << "\n";
805 if (summary)
806 {
807 m_t << ".RE\n";
808 }
809 m_t << ".PP\n";
810 m_firstCol=true;
811}
812
814{
815 if (m_hide) return;
816 if (!m_firstCol) m_t << "\n";
817 if (header.level()==1) m_t << ".SH"; else m_t << ".SS";
818 m_t << " \"";
819 visitChildren(header);
820 m_t << "\"\n";
821 if (header.level()==1) m_t << ".PP\n";
822 m_firstCol=true;
823}
824
826{
827}
828
830{
831}
832
834{
835}
836
838{
839}
840
844
848
850{
851 if (m_hide) return;
852 m_t << "\\fB";
853 visitChildren(dl);
854 m_t << "\\fP";
855}
856
858{
859 if (m_hide) return;
860 m_t << "\\fB";
861 if (!ref.hasLinkText()) filter(ref.targetTitle());
862 visitChildren(ref);
863 m_t << "\\fP";
864}
865
867{
868 if (m_hide) return;
869 DString ws;
870 if (m_indent>0) ws.fill(' ',2*(m_indent-1));
871 if (!m_firstCol) m_t << "\n";
872 m_t << ".IP \"" << ws << "\\(bu\" " << (2*m_indent) << "\n";
873 m_firstCol=true;
874 visitChildren(ref);
875 m_t << "\n";
876 m_firstCol=true;
877}
878
880{
881 if (m_hide) return;
882 m_indent++;
883 visitChildren(l);
884 m_indent--;
885 if (!m_firstCol) m_t << "\n";
886 m_t << ".PP\n";
887}
888
890{
891 if (m_hide) return;
892 if (!m_firstCol)
893 {
894 m_t << "\n";
895 m_t << ".PP\n";
896 }
897 m_t << "\\fB";
898 switch(s.type())
899 {
901 m_t << theTranslator->trParameters(); break;
903 m_t << theTranslator->trReturnValues(); break;
905 m_t << theTranslator->trExceptions(); break;
908 default:
909 ASSERT(0);
910 }
911 m_t << "\\fP\n";
912 m_t << ".RS 4\n";
913 visitChildren(s);
914 if (!m_firstCol) m_t << "\n";
915 m_t << ".RE\n";
916 m_t << ".PP\n";
917 m_firstCol=true;
918}
919
921{
922 if (m_hide) return;
923 m_t << "\\fI";
924 bool first=true;
925 for (const auto &param : pl.parameters())
926 {
927 if (!first) m_t << ","; else first=false;
928 std::visit(*this,param);
929 }
930 m_t << "\\fP ";
931 for (const auto &par : pl.paragraphs())
932 {
933 std::visit(*this,par);
934 }
935 if (!pl.isLast())
936 {
937 if (!m_firstCol) m_t << "\n";
938 m_t << ".br\n";
939 }
940}
941
943{
944 if (m_hide) return;
945 if (x.title().empty()) return;
946 if (!m_firstCol)
947 {
948 m_t << "\n";
949 m_t << ".PP\n";
950 }
951 m_t << "\\fB";
952 filter(x.title());
953 m_t << "\\fP\n";
954 m_t << ".RS 4\n";
955 visitChildren(x);
956 if (x.title().empty()) return;
957 if (!m_firstCol) m_t << "\n";
958 m_t << ".RE\n";
959 m_t << ".PP\n";
960 m_firstCol=true;
961}
962
964{
965 if (m_hide) return;
966 m_t << "\\fB";
967 visitChildren(ref);
968 m_t << "\\fP";
969}
970
972{
973 visitChildren(t);
974}
975
977{
978 if (m_hide) return;
979 if (!m_firstCol)
980 {
981 m_t << "\n";
982 m_t << ".PP\n";
983 }
984 m_t << ".RS 4\n"; // TODO: add support for nested block quotes
985 visitChildren(q);
986 if (!m_firstCol) m_t << "\n";
987 m_t << ".RE\n";
988 m_t << ".PP\n";
989 m_firstCol=true;
990}
991
995
997{
998 visitChildren(pb);
999}
1000
1001void ManDocVisitor::filter(const DString &str, const bool retainNewline, const bool citeEntry)
1002{
1003 if (!str.empty())
1004 {
1005 const char *p=str.data();
1006 char c=0;
1007 bool insideDoubleQuote = false;
1008 while ((c=*p++))
1009 {
1010 switch(c)
1011 {
1012 case '.': m_t << "\\&."; break; // see bug652277
1013 case '\\': m_t << "\\\\"; break;
1014 case '\"': m_t << "\""; insideDoubleQuote = !insideDoubleQuote; break;
1015 case '\n': if (retainNewline || !insideDoubleQuote) m_t << c; break;
1016 case '&': // possibility to have a special symbol
1017 if (!citeEntry) { m_t << c; break;}
1019 m_t,
1020 p-1,
1021 [](HtmlEntityMapper::SymType symType) { return HtmlEntityMapper::instance().man(symType); },
1022 "&");
1023 break;
1024 default: m_t << c; break;
1025 }
1026 }
1027 }
1028}
1029
static CodeFragmentManager & instance()
void parseCodeFragment(OutputCodeList &codeOutList, const DString &fileName, const DString &blockId, const DString &scopeName, bool showLineNumbers, bool trimLeft, bool stripCodeComments)
virtual void parseCode(OutputCodeList &codeOutList, const DString &scopeName, const DString &input, SrcLangExt lang, bool stripCodeComments, const CodeParserOptions &options)=0
Parses a source file or fragment with the goal to produce highlighted and cross-referenced output.
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:84
static DString integerToAlpha(int n, bool upper=true)
Definition dstring.cpp:622
DString fill(char c, size_t len)
Fills a string with a predefined character.
Definition dstring.h:278
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:148
static DString integerToRoman(int n, bool upper=true)
Definition dstring.cpp:638
char & at(size_t i)
Returns a reference to the character at index i.
Definition dstring.h:686
const std::string & str() const
Definition dstring.h:645
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition dstring.h:157
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition dstring.h:151
Node representing an anchor.
Definition docnode.h:229
Node representing an auto List.
Definition docnode.h:571
bool isEnumList() const
Definition docnode.h:580
Node representing an item of a auto list.
Definition docnode.h:595
int itemNumber() const
Definition docnode.h:598
Node representing a citation of some bibliographic reference.
Definition docnode.h:245
DString getText() const
Definition docnode.cpp:979
CiteInfoOption option() const
Definition docnode.h:253
DString target() const
Definition docnode.h:252
DString file() const
Definition docnode.h:248
Node representing a dia file.
Definition docnode.h:731
Node representing a dot file.
Definition docnode.h:713
Node representing an emoji.
Definition docnode.h:341
int index() const
Definition docnode.h:345
DString name() const
Definition docnode.h:344
Node representing an item of a cross-referenced list.
Definition docnode.h:529
DString text() const
Definition docnode.h:533
Node representing a Hypertext reference.
Definition docnode.h:832
Node representing a horizontal ruler.
Definition docnode.h:216
Node representing an HTML blockquote.
Definition docnode.h:1296
Node representing a HTML table caption.
Definition docnode.h:1233
Node representing a HTML table cell.
Definition docnode.h:1198
Node representing a HTML description data.
Definition docnode.h:1186
Node representing a Html description list.
Definition docnode.h:910
Node representing a Html description item.
Definition docnode.h:897
Node Html details.
Definition docnode.h:866
const DocNodeVariant * summary() const
Definition docnode.h:873
Node Html heading.
Definition docnode.h:882
int level() const
Definition docnode.h:886
Node representing a Html list.
Definition docnode.h:1009
const HtmlAttribList & attribs() const
Definition docnode.h:1015
Type type() const
Definition docnode.h:1014
Node representing a HTML list item.
Definition docnode.h:1170
const HtmlAttribList & attribs() const
Definition docnode.h:1175
Node representing a HTML table row.
Definition docnode.h:1251
Node Html summary.
Definition docnode.h:853
Node representing a HTML table.
Definition docnode.h:1274
Node representing an image.
Definition docnode.h:642
Node representing a include/dontinclude operator block.
Definition docnode.h:477
bool stripCodeComments() const
Definition docnode.h:506
bool isLast() const
Definition docnode.h:503
DString text() const
Definition docnode.h:499
DString context() const
Definition docnode.h:501
DString exampleFile() const
Definition docnode.h:508
DString includeFileName() const
Definition docnode.h:509
Type type() const
Definition docnode.h:485
bool isFirst() const
Definition docnode.h:502
bool showLineNo() const
Definition docnode.h:498
bool isExample() const
Definition docnode.h:507
Node representing an included text block from file.
Definition docnode.h:435
bool stripCodeComments() const
Definition docnode.h:455
DString blockId() const
Definition docnode.h:454
@ LatexInclude
Definition docnode.h:437
@ SnippetWithLines
Definition docnode.h:438
@ DontIncWithLines
Definition docnode.h:439
@ IncWithLines
Definition docnode.h:438
@ HtmlInclude
Definition docnode.h:437
@ VerbInclude
Definition docnode.h:437
@ DontInclude
Definition docnode.h:437
@ DocbookInclude
Definition docnode.h:439
DString context() const
Definition docnode.h:453
Type type() const
Definition docnode.h:451
DString exampleFile() const
Definition docnode.h:457
DString text() const
Definition docnode.h:452
DString file() const
Definition docnode.h:449
DString extension() const
Definition docnode.h:450
bool trimLeft() const
Definition docnode.h:459
bool isExample() const
Definition docnode.h:456
Node representing an entry in the index.
Definition docnode.h:552
Node representing an internal section of documentation.
Definition docnode.h:978
Node representing an internal reference to some item.
Definition docnode.h:816
Node representing a line break.
Definition docnode.h:202
Node representing a word that can be linked to something.
Definition docnode.h:165
DString word() const
Definition docnode.h:170
Node representing a mermaid file.
Definition docnode.h:749
Node representing a msc file.
Definition docnode.h:722
DocNodeVariant * parent()
Definition docnode.h:89
Node representing an block of paragraphs.
Definition docnode.h:988
Node representing a paragraph in the documentation tree.
Definition docnode.h:1089
bool isLast() const
Definition docnode.h:1097
Node representing a parameter list.
Definition docnode.h:1130
const DocNodeList & parameters() const
Definition docnode.h:1134
bool isLast() const
Definition docnode.h:1142
const DocNodeList & paragraphs() const
Definition docnode.h:1136
Node representing a parameter section.
Definition docnode.h:1062
Type type() const
Definition docnode.h:1077
Node representing a uml file.
Definition docnode.h:740
Node representing a reference to some item.
Definition docnode.h:787
bool hasLinkText() const
Definition docnode.h:797
DString targetTitle() const
Definition docnode.h:795
Root node of documentation tree.
Definition docnode.h:1318
Node representing a reference to a section.
Definition docnode.h:944
Node representing a list of section references.
Definition docnode.h:968
Node representing a normal section.
Definition docnode.h:923
int level() const
Definition docnode.h:927
const DocNodeVariant * title() const
Definition docnode.h:928
Node representing a separator.
Definition docnode.h:365
DString chars() const
Definition docnode.h:369
Node representing a simple list.
Definition docnode.h:999
Node representing a simple list item.
Definition docnode.h:1158
const DocNodeVariant * paragraph() const
Definition docnode.h:1162
Node representing a simple section.
Definition docnode.h:1026
Type type() const
Definition docnode.h:1035
const DocNodeVariant * title() const
Definition docnode.h:1042
Node representing a separator between two simple sections of the same type.
Definition docnode.h:1053
Node representing a style change.
Definition docnode.h:268
Style style() const
Definition docnode.h:307
bool enable() const
Definition docnode.h:309
Node representing a special symbol.
Definition docnode.h:328
HtmlEntityMapper::SymType symbol() const
Definition docnode.h:332
Root node of a text fragment.
Definition docnode.h:1309
Node representing a simple section title.
Definition docnode.h:608
Node representing a URL (or email address).
Definition docnode.h:188
DString url() const
Definition docnode.h:192
Node representing a verbatim, unparsed text fragment.
Definition docnode.h:376
DString text() const
Definition docnode.h:383
DString language() const
Definition docnode.h:388
bool isExample() const
Definition docnode.h:385
Type type() const
Definition docnode.h:382
DString exampleFile() const
Definition docnode.h:386
DString context() const
Definition docnode.h:384
@ JavaDocLiteral
Definition docnode.h:378
Node representing a VHDL flow chart.
Definition docnode.h:758
void pushHidden(bool hide)
CodeParserInterface & getCodeParser(const DString &langExt)
bool popHidden()
Node representing some amount of white space.
Definition docnode.h:354
DString chars() const
Definition docnode.h:358
Node representing a word.
Definition docnode.h:153
DString word() const
Definition docnode.h:156
Node representing an item of a cross-referenced list.
Definition docnode.h:621
DString title() const
Definition docnode.h:626
const char * name(int index) const
Access routine to the name of the Emoji entity.
Definition emoji.cpp:2029
static EmojiEntityMapper & instance()
Returns the one and only instance of the Emoji entity mapper.
Definition emoji.cpp:1981
Minimal replacement for QFileInfo.
Definition fileinfo.h:26
std::string fileName() const
Definition fileinfo.cpp:122
std::string dirPath(bool absPath=true) const
Definition fileinfo.cpp:141
const char * writeHtmlEntity(T &result, const char *s, HtmlEntityMapperFunc &&mapper, const char *fallback)
Definition htmlentity.h:127
static HtmlEntityMapper & instance()
Returns the one and only instance of the HTML entity mapper.
const char * man(SymType symb) const
Access routine to the man code of the HTML entity.
std::array< ManListItemInfo, maxIndentLevels > m_listItemInfo
TextStream & m_t
void operator()(const DocWord &)
ManDocVisitor(TextStream &t, OutputCodeList &ci, const DString &langExt)
OutputCodeList & m_ci
static const int maxIndentLevels
void filter(const DString &str, const bool retainNewline=false, const bool citeEntry=false)
void visitChildren(const T &t)
Class representing a list of different code generators.
Definition outputlist.h:162
Text streaming class that buffers data.
Definition textstream.h:36
virtual DString trExceptions()=0
virtual DString trReturns()=0
virtual DString trParameters()=0
virtual DString trCopyright()=0
virtual DString trWarning()=0
virtual DString trSince()=0
virtual DString trNote()=0
virtual DString trAuthor(bool first_capital, bool singular)=0
virtual DString trReturnValues()=0
virtual DString trVersion()=0
virtual DString trTemplateParameters()=0
virtual DString trImportant()=0
virtual DString trPrecondition()=0
virtual DString trAttention()=0
virtual DString trInvariant()=0
virtual DString trRemarks()=0
virtual DString trDate()=0
virtual DString trSeeAlso()=0
virtual DString trPostcondition()=0
#define Config_getBool(name)
Definition config.h:33
std::unique_ptr< FileDef > createFileDef(const DString &p, const DString &n, const DString &ref, const DString &dn)
Definition filedef.cpp:267
Translator * theTranslator
Definition language.cpp:76
#define ASSERT(x)
Definition message.h:142
Options to configure the code parser.
Definition parserintf.h:77
CodeParserOptions & setInlineFragment(bool enable)
Definition parserintf.h:106
CodeParserOptions & setShowLineNumbers(bool enable)
Definition parserintf.h:112
CodeParserOptions & setFileDef(const FileDef *fd)
Definition parserintf.h:97
SrcLangExt
Definition types.h:207
DString getFileNameExtension(const DString &fn)
Definition util.cpp:4210
SrcLangExt getLanguageFromFileName(const DString &fileName, SrcLangExt defLang)
Definition util.cpp:4168
SrcLangExt getLanguageFromCodeLang(DString &fileName)
Routine to handle the language attribute of the \code command.
Definition util.cpp:4186
A bunch of utility functions.