5#ifndef QQMLTCOUTPUTPRIMITIVES_P_H
6#define QQMLTCOUTPUTPRIMITIVES_P_H
19#include <QtCore/qstack.h>
20#include <QtCore/qstring.h>
21#include <QtCore/qstringbuilder.h>
37 template<
typename String>
38 static void rawAppend(QString &out,
const String &what,
int extraIndent = 0)
40 constexpr char16_t newLine[] = u"\n";
41 out += QString(extraIndent * 4, u' ') + what + newLine;
62 m_code->memberScopes.push(str);
86 template<
typename String>
89 rawAppend(m_code.header, what,
headerIndent + extraIndent);
94 template<
typename String>
97 rawAppend(m_code.cpp, what,
cppIndent + extraIndent);
102 template<
typename String>
105 QString signatureScope;
106 for (
const auto &scope : std::as_const(memberScopes))
107 signatureScope += scope + u"::";
108 rawAppendToCpp(signatureScope + what, extraIndent);
void rawAppendToHeader(const String &what, int extraIndent=0)
void rawAppendSignatureToCpp(const String &what, int extraIndent=0)
void rawAppendToCpp(const String &what, int extraIndent=0)
QStack< QString > memberScopes
const Output & code() const
OutputWrapper(Output &code)
CppIndentationScope(OutputWrapper *code)
MemberNameScope(OutputWrapper *code, const QString &str)