Skip to content

Commit c4447cb

Browse files
committed
xml writer in separate file
1 parent 98b03c5 commit c4447cb

File tree

4 files changed

+158
-159
lines changed

4 files changed

+158
-159
lines changed

source/lib/_XML/XMLGenerator.cpp

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
//
2+
// This is a derivative work. originally part of the LLVM Project.
3+
// Licensed under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
// Copyright (c) 2023 Vinnie Falco ([email protected])
8+
//
9+
// Official repository: https://github.com/cppalliance/mrdox
10+
//
11+
12+
#include "XMLGenerator.hpp"
13+
#include "XMLWriter.hpp"
14+
#include "Support/Radix.hpp"
15+
#include <mrdox/Error.hpp>
16+
#include <mrdox/Metadata.hpp>
17+
18+
namespace clang {
19+
namespace mrdox {
20+
namespace xml {
21+
22+
llvm::Error
23+
XMLGenerator::
24+
buildSinglePage(
25+
llvm::raw_ostream& os,
26+
Corpus const& corpus,
27+
Reporter& R,
28+
llvm::raw_fd_ostream* fd_os) const
29+
{
30+
namespace fs = llvm::sys::fs;
31+
XMLWriter w(os, fd_os, corpus, R);
32+
return w.build();
33+
}
34+
35+
} // xml
36+
37+
//------------------------------------------------
38+
39+
std::unique_ptr<Generator>
40+
makeXMLGenerator()
41+
{
42+
return std::make_unique<xml::XMLGenerator>();
43+
}
44+
45+
} // mrdox
46+
} // clang

source/lib/_XML/XMLGenerator.hpp

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
//
2+
// This is a derivative work. originally part of the LLVM Project.
3+
// Licensed under the Apache License v2.0 with LLVM Exceptions.
4+
// See https://llvm.org/LICENSE.txt for license information.
5+
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
//
7+
// Copyright (c) 2023 Vinnie Falco ([email protected])
8+
//
9+
// Official repository: https://github.com/cppalliance/mrdox
10+
//
11+
12+
#ifndef MRDOX_LIB_XML_XMLGENERATOR_HPP
13+
#define MRDOX_LIB_XML_XMLGENERATOR_HPP
14+
15+
#include <mrdox/Platform.hpp>
16+
#include <mrdox/Generator.hpp>
17+
#include <mrdox/MetadataFwd.hpp>
18+
#include <mrdox/Metadata/Javadoc.hpp>
19+
#include <llvm/ADT/Optional.h>
20+
21+
namespace clang {
22+
namespace mrdox {
23+
namespace xml {
24+
25+
//------------------------------------------------
26+
27+
struct XMLGenerator : Generator
28+
{
29+
llvm::StringRef
30+
name() const noexcept override
31+
{
32+
return "xml";
33+
}
34+
35+
llvm::StringRef
36+
displayName() const noexcept override
37+
{
38+
return "Extensible Markup Language (XML)";
39+
}
40+
41+
llvm::StringRef
42+
extension() const noexcept override
43+
{
44+
return "xml";
45+
}
46+
47+
llvm::Error
48+
buildSinglePage(
49+
llvm::raw_ostream& os,
50+
Corpus const& corpus,
51+
Reporter& R,
52+
llvm::raw_fd_ostream* fd_os) const override;
53+
};
54+
55+
} // xml
56+
} // mrdox
57+
} // clang
58+
59+
#endif

0 commit comments

Comments
 (0)