summaryrefslogtreecommitdiff
path: root/codemaker/source/cppumaker/includes.cxx
diff options
context:
space:
mode:
authorSarper Akdemir <sarper.akdemir.extern@allotropia.de>2023-08-07 14:41:32 +0300
committerSarper Akdemir <sarper.akdemir.extern@allotropia.de>2023-09-18 19:59:57 +0200
commit841f898574affb526a516224d7c3db9b137ea62b (patch)
treeb26718c1a063f47b2a75eb939b4fd0d55f90f79f /codemaker/source/cppumaker/includes.cxx
parent971425f9b7613183a565e9b4ec5792b3f67bb133 (diff)
JavaScript uno bindings for WASM with Embind - first cut
A rough implementation of uno bindings for LOWA using embind. Adds new parameter '-W' to cppumaker to generate _embind.cxx files alongside .hdl & .hpp. For usage examples see static/README.wasm.md Change-Id: Iee5d05e37bfba8e101c08212b15c05f7f2fa6c33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156273 Tested-by: Jenkins Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
Diffstat (limited to 'codemaker/source/cppumaker/includes.cxx')
-rw-r--r--codemaker/source/cppumaker/includes.cxx19
1 files changed, 10 insertions, 9 deletions
diff --git a/codemaker/source/cppumaker/includes.cxx b/codemaker/source/cppumaker/includes.cxx
index 9dacdf268265..05f768bbc505 100644
--- a/codemaker/source/cppumaker/includes.cxx
+++ b/codemaker/source/cppumaker/includes.cxx
@@ -20,6 +20,7 @@
#include "includes.hxx"
+#include "cpputype.hxx"
#include "dependencies.hxx"
#include "dumputils.hxx"
@@ -40,8 +41,8 @@ using codemaker::cppumaker::Includes;
Includes::Includes(
rtl::Reference< TypeManager > manager,
- codemaker::cppumaker::Dependencies const & dependencies, bool hpp):
- m_manager(std::move(manager)), m_map(dependencies.getMap()), m_hpp(hpp),
+ codemaker::cppumaker::Dependencies const & dependencies, FileType eFileType):
+ m_manager(std::move(manager)), m_map(dependencies.getMap()), m_filetype(eFileType),
m_includeCassert(false),
m_includeAny(dependencies.hasAnyDependency()), m_includeReference(false),
m_includeSequence(dependencies.hasSequenceDependency()),
@@ -136,7 +137,7 @@ void dumpEmptyLineBeforeFirst(FileStream & out, bool * first) {
void Includes::dump(
FileStream & out, OUString const * companionHdl, bool exceptions)
{
- OSL_ASSERT(companionHdl == nullptr || m_hpp);
+ OSL_ASSERT(companionHdl == nullptr || m_filetype == FileType::HPP);
if (!m_includeReference) {
for (const auto& pair : m_map)
{
@@ -159,12 +160,12 @@ void Includes::dump(
{
if (exceptions || pair.second != Dependencies::KIND_EXCEPTION) {
dumpEmptyLineBeforeFirst(out, &first);
- if (m_hpp || pair.second == Dependencies::KIND_BASE
+ if ((m_filetype == FileType::HPP) || pair.second == Dependencies::KIND_BASE
|| !isInterfaceType(u2b(pair.first)))
{
// If we know our name, then avoid including ourselves.
if (!companionHdl || *companionHdl != pair.first) {
- dumpInclude(out, u2b(pair.first), m_hpp);
+ dumpInclude(out, u2b(pair.first), (m_filetype == FileType::HPP));
}
} else {
bool ns = dumpNamespaceOpen(out, pair.first, false);
@@ -185,22 +186,22 @@ void Includes::dump(
static char const * hxxExtension[2] = { "h", "hxx" };
if (m_includeAny) {
dumpEmptyLineBeforeFirst(out, &first);
- out << "#include \"com/sun/star/uno/Any." << hxxExtension[m_hpp]
+ out << "#include \"com/sun/star/uno/Any." << hxxExtension[(m_filetype == FileType::HPP)]
<< "\"\n";
}
if (m_includeReference) {
dumpEmptyLineBeforeFirst(out, &first);
- out << "#include \"com/sun/star/uno/Reference." << hxxExtension[m_hpp]
+ out << "#include \"com/sun/star/uno/Reference." << hxxExtension[(m_filetype == FileType::HPP)]
<< "\"\n";
}
if (m_includeSequence) {
dumpEmptyLineBeforeFirst(out, &first);
- out << "#include \"com/sun/star/uno/Sequence." << hxxExtension[m_hpp]
+ out << "#include \"com/sun/star/uno/Sequence." << hxxExtension[(m_filetype == FileType::HPP)]
<< "\"\n";
}
if (m_includeType) {
dumpEmptyLineBeforeFirst(out, &first);
- out << "#include \"com/sun/star/uno/Type." << hxxExtension[m_hpp]
+ out << "#include \"com/sun/star/uno/Type." << hxxExtension[(m_filetype == FileType::HPP)]
<< "\"\n";
}
if (m_includeCppuMacrosHxx) {