30#include <osl/diagnose.h>
32#include <rtl/string.hxx>
33#include <rtl/ustring.hxx>
44 m_manager(
std::move(
manager)),
m_map(dependencies.getMap()), m_hpp(hpp),
45 m_includeCassert(false),
46 m_includeAny(dependencies.hasAnyDependency()), m_includeReference(false),
47 m_includeSequence(dependencies.hasSequenceDependency()),
48 m_includeType(dependencies.hasTypeDependency()),
49 m_includeCppuMacrosHxx(false), m_includeCppuUnotypeHxx(false),
50 m_includeOslMutexHxx(false),
51 m_includeRtlStrbufHxx(false), m_includeRtlStringH(false),
52 m_includeRtlTextencH(false), m_includeRtlUstrbufHxx(false),
53 m_includeRtlUstringH(false),
54 m_includeRtlUstringHxx(dependencies.hasStringDependency()),
55 m_includeRtlInstanceHxx(false),
57 dependencies.hasBooleanDependency() || dependencies.hasByteDependency()
58 || dependencies.hasShortDependency()
59 || dependencies.hasUnsignedShortDependency()
60 || dependencies.hasLongDependency()
61 || dependencies.hasUnsignedLongDependency()
62 || dependencies.hasHyperDependency()
63 || dependencies.hasUnsignedHyperDependency()
64 || dependencies.hasCharDependency()),
65 m_includeTypelibTypeclassH(false),
66 m_includeTypelibTypedescriptionH(false)
74 std::vector< OString >
args;
104 for (
const OString& arg :
args)
119 "unexpected type \"" +
b2u(entityName)
120 +
"\" in call to codemaker::cppumaker::Includes::add");
126void dumpEmptyLineBeforeFirst(
FileStream & out,
bool * first) {
127 OSL_ASSERT(first !=
nullptr);
137 FileStream & out, OUString
const * companionHdl,
bool exceptions)
139 OSL_ASSERT(companionHdl ==
nullptr ||
m_hpp);
141 for (
const auto& pair :
m_map)
149 out <<
"#include \"sal/config.h\"\n";
151 out <<
"\n#include <cassert>\n";
158 for (
const auto& pair :
m_map)
161 dumpEmptyLineBeforeFirst(out, &
first);
166 if (!companionHdl || *companionHdl != pair.first) {
185 static char const * hxxExtension[2] = {
"h",
"hxx" };
187 dumpEmptyLineBeforeFirst(out, &
first);
188 out <<
"#include \"com/sun/star/uno/Any." << hxxExtension[
m_hpp]
192 dumpEmptyLineBeforeFirst(out, &
first);
193 out <<
"#include \"com/sun/star/uno/Reference." << hxxExtension[
m_hpp]
197 dumpEmptyLineBeforeFirst(out, &
first);
198 out <<
"#include \"com/sun/star/uno/Sequence." << hxxExtension[
m_hpp]
202 dumpEmptyLineBeforeFirst(out, &
first);
203 out <<
"#include \"com/sun/star/uno/Type." << hxxExtension[
m_hpp]
207 dumpEmptyLineBeforeFirst(out, &
first);
208 out <<
"#include \"cppu/macros.hxx\"\n";
211 dumpEmptyLineBeforeFirst(out, &
first);
212 out <<
"#include \"cppu/unotype.hxx\"\n";
215 dumpEmptyLineBeforeFirst(out, &
first);
216 out <<
"#include \"osl/mutex.hxx\"\n";
219 dumpEmptyLineBeforeFirst(out, &
first);
220 out <<
"#include \"rtl/strbuf.hxx\"\n";
223 dumpEmptyLineBeforeFirst(out, &
first);
224 out <<
"#include \"rtl/string.h\"\n";
227 dumpEmptyLineBeforeFirst(out, &
first);
228 out <<
"#include \"rtl/textenc.h\"\n";
231 dumpEmptyLineBeforeFirst(out, &
first);
232 out <<
"#include \"rtl/ustrbuf.hxx\"\n";
235 dumpEmptyLineBeforeFirst(out, &
first);
236 out <<
"#include \"rtl/ustring.h\"\n";
239 dumpEmptyLineBeforeFirst(out, &
first);
240 out <<
"#include \"rtl/ustring.hxx\"\n";
243 dumpEmptyLineBeforeFirst(out, &
first);
244 out <<
"#include \"rtl/instance.hxx\"\n";
247 dumpEmptyLineBeforeFirst(out, &
first);
248 out <<
"#include \"sal/types.h\"\n";
251 dumpEmptyLineBeforeFirst(out, &
first);
252 out <<
"#include \"typelib/typeclass.h\"\n";
255 dumpEmptyLineBeforeFirst(out, &
first);
256 out <<
"#include \"typelib/typedescription.h\"\n";
263 FileStream & out, OString
const & entityName,
bool hpp)
265 out <<
"#include \"" << entityName.replace(
'.',
'/') <<
"."
266 << (hpp ?
"hpp" :
"hdl") <<
"\"\n";
A simple class to track which other entities a given entity depends on.
bool m_includeRtlTextencH
void add(OString const &entityName)
bool m_includeTypelibTypeclassH
bool m_includeOslMutexHxx
bool isInterfaceType(std::string_view entityName) const
bool m_includeRtlStrbufHxx
bool m_includeRtlUstrbufHxx
bool m_includeTypelibTypedescriptionH
static void dumpInclude(FileStream &out, OString const &entityName, bool hpp)
bool m_includeRtlUstringH
void dump(FileStream &out, OUString const *companionHdl, bool exceptions)
bool m_includeCppuUnotypeHxx
rtl::Reference< TypeManager > m_manager
bool m_includeRtlInstanceHxx
bool m_includeRtlUstringHxx
bool m_includeCppuMacrosHxx
std::vector< OUString > m_custom
rtl::Reference< ParseManager > manager
@ PolymorphicStructTemplate
rtl::OString decompose(rtl::OString const &type, sal_Int32 *rank=nullptr, std::vector< rtl::OString > *arguments=nullptr)
Decomposes a UNO type name or UNO type registry name.
void dumpTypeIdentifier(FileStream &out, std::u16string_view entityName)
bool dumpNamespaceClose(FileStream &out, std::u16string_view entityName, bool fullModuleType)
bool dumpNamespaceOpen(FileStream &out, std::u16string_view entityName, bool fullModuleType)
constexpr OUStringLiteral first
OUString b2u(std::string_view s)
OString u2b(std::u16string_view s)