Doxygen
Loading...
Searching...
No Matches
xmlgen.h
Go to the documentation of this file.
1/******************************************************************************
2 *
3 * Copyright (C) 1997-2026 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
17#ifndef XMLGEN_H
18#define XMLGEN_H
19
20#include "outputgen.h"
21
22class TextStream;
23
24class XMLCodeGenerator final : public OutputCodeIntf
25{
26 public:
28
29 OutputType type() const override { return OutputType::XML; }
30
31 void codify(const DString &text) override;
32 void stripCodeComments(bool b) override;
33 void startSpecialComment() override;
34 void endSpecialComment() override;
35 void setStripIndentAmount(size_t amount) override;
36 std::unique_ptr<OutputCodeIntf> clone() override { return std::make_unique<XMLCodeGenerator>(*this); }
38 const DString &ref,const DString &file,
39 const DString &anchor,const DString &name,
40 const DString &tooltip) override;
41 void writeTooltip(const DString &, const DocLinkInfo &, const DString &,
42 const DString &, const SourceLinkInfo &, const SourceLinkInfo &
43 ) override;
44 void startCodeLine(int) override;
45 void endCodeLine() override;
46 void startFontClass(const DString &colorClass) override;
47 void endFontClass() override;
48 void writeCodeAnchor(const DString &) override;
49 void writeLineNumber(const DString &extRef,const DString &compId,
50 const DString &anchorId,int l,bool writeLineAnchor) override;
51 void startCodeFragment(const DString &) override;
52 void endCodeFragment(const DString &) override;
53 void startFold(int,const DString &,const DString &) override {}
54 void endFold() override {}
55
56 private:
60 int m_lineNumber = -1;
61 bool m_isMemberRef = false;
62 size_t m_col = 0;
63
64 bool m_insideCodeLine = false;
66 bool m_insideSpecialHL = false;
67 bool m_stripCodeComments = false;
68 bool m_hide = false;
70};
71
72void generateXML();
73
74#endif
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:88
OutputCodeIntf()=default
Text streaming class that buffers data.
Definition textstream.h:36
bool m_insideSpecialHL
Definition xmlgen.h:66
OutputType type() const override
Definition xmlgen.h:29
void setStripIndentAmount(size_t amount) override
Definition xmlgen.cpp:238
size_t m_stripIndentAmount
Definition xmlgen.h:69
DString m_external
Definition xmlgen.h:59
void startSpecialComment() override
Definition xmlgen.cpp:233
bool m_normalHLNeedStartTag
Definition xmlgen.h:65
void writeCodeLink(CodeSymbolType type, const DString &ref, const DString &file, const DString &anchor, const DString &name, const DString &tooltip) override
Definition xmlgen.cpp:243
void endSpecialComment() override
Definition xmlgen.cpp:228
void endFold() override
Definition xmlgen.h:54
void writeTooltip(const DString &, const DocLinkInfo &, const DString &, const DString &, const SourceLinkInfo &, const SourceLinkInfo &) override
Definition xmlgen.cpp:259
bool m_insideCodeLine
Definition xmlgen.h:64
void stripCodeComments(bool b) override
Definition xmlgen.cpp:223
bool m_stripCodeComments
Definition xmlgen.h:67
void endCodeFragment(const DString &) override
Definition xmlgen.cpp:367
void startCodeFragment(const DString &) override
Definition xmlgen.cpp:361
size_t m_col
Definition xmlgen.h:62
void writeLineNumber(const DString &extRef, const DString &compId, const DString &anchorId, int l, bool writeLineAnchor) override
Definition xmlgen.cpp:344
void codify(const DString &text) override
Generator for producing XML formatted source code.
Definition xmlgen.cpp:212
TextStream * m_t
Definition xmlgen.h:57
DString m_refId
Definition xmlgen.h:58
XMLCodeGenerator(TextStream *t)
Definition xmlgen.cpp:207
void writeCodeAnchor(const DString &) override
Definition xmlgen.cpp:338
void startFold(int, const DString &, const DString &) override
Definition xmlgen.h:53
std::unique_ptr< OutputCodeIntf > clone() override
Definition xmlgen.h:36
bool m_isMemberRef
Definition xmlgen.h:61
static void endCodeLine(yyscan_t yyscanner)
static void startCodeLine(yyscan_t yyscanner)
static void startFontClass(yyscan_t yyscanner, const char *s, bool specialComment=false)
static void endFontClass(yyscan_t yyscanner, bool specialComment=false)
OutputType
Definition outputgen.h:56
CodeSymbolType
Definition types.h:481
void generateXML()
Definition xmlgen.cpp:2316