1//
2// ApacheCodeWriter.cpp
3//
4// Copyright (c) 2008, Applied Informatics Software Engineering GmbH.
5// and Contributors.
6//
7// SPDX-License-Identifier: BSL-1.0
8//
9
10
11#include "ApacheCodeWriter.h"
12#include "Page.h"
13
14
15ApacheCodeWriter::ApacheCodeWriter(const Page& page, const std::string& clazz):
16 CodeWriter(page, clazz)
17{
18}
19
20
21ApacheCodeWriter::~ApacheCodeWriter()
22{
23}
24
25
26void ApacheCodeWriter::writeHeaderIncludes(std::ostream& ostr)
27{
28 CodeWriter::writeHeaderIncludes(ostr);
29 ostr << "#include \"Poco/Net/HTTPRequestHandlerFactory.h\"\n";
30}
31
32
33void ApacheCodeWriter::writeFactoryClass(std::ostream& ostr)
34{
35 ostr << "\n\n";
36 factoryClass(ostr, "Poco::Net::HTTPRequestHandlerFactory");
37}
38
39
40void ApacheCodeWriter::writeImplIncludes(std::ostream& ostr)
41{
42 CodeWriter::writeImplIncludes(ostr);
43 ostr << "#include \"Poco/ClassLibrary.h\"\n";
44}
45
46
47void ApacheCodeWriter::writeFactory(std::ostream& ostr)
48{
49 ostr << "\n\n";
50 factoryImpl(ostr, "");
51}
52
53
54void ApacheCodeWriter::writeManifest(std::ostream& ostr)
55{
56 std::string ns = page().get("page.namespace", "");
57 if (!ns.empty()) ns += "::";
58 ostr << "\n\n";
59 ostr << "POCO_BEGIN_MANIFEST(Poco::Net::HTTPRequestHandlerFactory)\n";
60 ostr << "\tPOCO_EXPORT_CLASS(" << ns << clazz() << "Factory)\n";
61 ostr << "POCO_END_MANIFEST\n";
62}
63