Skip to content

Commit edbceb5

Browse files
committed
document some things
1 parent 005b391 commit edbceb5

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

include/mrdox/RecursiveWriter.hpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,19 @@ struct Scope;
3434

3535
//------------------------------------------------
3636

37+
/** An abstract writer for recursive output formats.
38+
39+
The implementation visits the global namespace
40+
and then each child namespace recursively. The
41+
scope for each namespace is also iterated and
42+
emitted. Subclasses should override the relevant
43+
visitation functions (the default implementations
44+
do nothing).
45+
46+
This base class is suitable for writing a single
47+
file using a recursive syntax such as that found
48+
in XML, HTML, or JSON.
49+
*/
3750
class RecursiveWriter
3851
{
3952
llvm::raw_fd_ostream* fd_os_ = nullptr;
@@ -50,6 +63,8 @@ class RecursiveWriter
5063
void adjustNesting(int levels);
5164

5265
public:
66+
/** Describes an item in the list of all symbols.
67+
*/
5368
struct AllSymbol
5469
{
5570
/** The fully qualified name of this symbol.
@@ -67,13 +82,19 @@ class RecursiveWriter
6782
AllSymbol(Info const& I);
6883
};
6984

85+
/** Constructor.
86+
*/
7087
RecursiveWriter(
7188
Corpus const& corpus,
7289
Config const& config,
7390
Reporter& R) noexcept;
7491

92+
/** Write the contents of the corpus to the output stream.
93+
*/
94+
/** @{ */
7595
void write(llvm::raw_fd_ostream& os);
7696
void write(llvm::raw_string_ostream& os);
97+
/** @} */
7798

7899
/** Called to open and close the document.
79100

source/lib/XML.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ struct XMLGenerator : Generator
6969

7070
//------------------------------------------------
7171

72+
/** A writer which outputs XML.
73+
*/
7274
class XMLGenerator::Writer
7375
: public RecursiveWriter
7476
{
@@ -81,8 +83,8 @@ class XMLGenerator::Writer
8183
Config const& config,
8284
Reporter& R) noexcept;
8385

84-
virtual void beginDoc() override;
85-
virtual void endDoc() override;
86+
void beginDoc() override;
87+
void endDoc() override;
8688

8789
void writeAllSymbols(std::vector<AllSymbol> const& list) override;
8890

0 commit comments

Comments
 (0)