Simplify using designated initializers
[LibreOffice.git] / codemaker / source / netmaker / netproduce.hxx
blob4b90fff427f3d3c806999025e44ef3a29ccdb5f2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
10 #pragma once
12 #include <unordered_set>
13 #include <string_view>
15 #include <codemaker/typemanager.hxx>
16 #include <rtl/string.hxx>
17 #include <unoidl/unoidl.hxx>
19 #include "netoptions.hxx"
21 class NetProducer
23 public:
24 NetProducer()
25 : m_manager(new TypeManager())
26 , m_verbose(false)
27 , m_dryRun(false)
31 public:
32 void initProducer(const NetOptions& options);
33 void produceAll();
35 private:
36 void produceType(const OString& name);
37 void produceModule(std::string_view name, const rtl::Reference<unoidl::MapCursor>& cursor);
38 void produceEnum(std::string_view name, const rtl::Reference<unoidl::EnumTypeEntity>& entity);
39 void producePlainStruct(std::string_view name,
40 const rtl::Reference<unoidl::PlainStructTypeEntity>& entity);
41 void
42 producePolyStruct(std::string_view name,
43 const rtl::Reference<unoidl::PolymorphicStructTypeTemplateEntity>& entity);
44 void produceException(std::string_view name,
45 const rtl::Reference<unoidl::ExceptionTypeEntity>& entity);
46 void produceInterface(std::string_view name,
47 const rtl::Reference<unoidl::InterfaceTypeEntity>& entity);
48 void produceTypedef(std::string_view name, const rtl::Reference<unoidl::TypedefEntity>& entity);
49 void produceConstantGroup(std::string_view name,
50 const rtl::Reference<unoidl::ConstantGroupEntity>& entity);
51 void produceService(std::string_view name,
52 const rtl::Reference<unoidl::SingleInterfaceBasedServiceEntity>& entity);
53 void produceSingleton(std::string_view name,
54 const rtl::Reference<unoidl::InterfaceBasedSingletonEntity>& entity);
56 OString getNetName(std::string_view name);
57 OString getNetName(std::u16string_view name);
59 private:
60 rtl::Reference<TypeManager> m_manager;
62 std::unordered_set<OString> m_startingTypes;
63 std::unordered_set<OString> m_typesProduced;
64 std::unordered_map<OString, OString> m_typedefs;
66 OString m_outputDir;
67 bool m_verbose;
68 bool m_dryRun;
71 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */