diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-11-17 16:58:30 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-11-25 11:43:05 +0000 |
commit | 3ec934419b1217e2a623e2f91336a8a5628ec5fe (patch) | |
tree | c24ea65ff368fedc083d52e85e40225d7013723b /sources/shiboken6/generator/shiboken/headergenerator.h | |
parent | 0e03a2524e1d98f717f204252e155762e0439e93 (diff) |
shiboken6: Introduce a new Text stream
Add a new text stream wrapping QTextStream with built-in indent.
This removes the need to have INDENT as a separate member variable
or function parameter and to output it at the beginning of each
line.
It also makes it easier to factor out the write() functions since they
no longer need the indent.
Make the write* functions const where possible.
The doc generator is left as-is for the moment.
Rename the old Indentation to Indentation4 to avoid
conflicts.
Change-Id: I6866e7360df119859adeee567d2b18a37cb63a79
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/shiboken6/generator/shiboken/headergenerator.h')
-rw-r--r-- | sources/shiboken6/generator/shiboken/headergenerator.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/sources/shiboken6/generator/shiboken/headergenerator.h b/sources/shiboken6/generator/shiboken/headergenerator.h index 3460e1c77..12087519d 100644 --- a/sources/shiboken6/generator/shiboken/headergenerator.h +++ b/sources/shiboken6/generator/shiboken/headergenerator.h @@ -48,20 +48,20 @@ public: protected: QString fileNameSuffix() const override; QString fileNameForContext(const GeneratorContext &context) const override; - void generateClass(QTextStream &s, const GeneratorContext &classContext) override; + void generateClass(TextStream &s, const GeneratorContext &classContext) override; bool finishGeneration() override; private: - void writeCopyCtor(QTextStream &s, const AbstractMetaClass *metaClass) const; - void writeProtectedFieldAccessors(QTextStream &s, const AbstractMetaField &field) const; - void writeFunction(QTextStream &s, const AbstractMetaFunction *func); - void writeSbkTypeFunction(QTextStream &s, const AbstractMetaEnum &cppEnum) const; - void writeSbkTypeFunction(QTextStream &s, const AbstractMetaClass *cppClass) const; - void writeSbkTypeFunction(QTextStream &s, const AbstractMetaType &metaType) const; - void writeTypeIndexValueLine(QTextStream &s, const TypeEntry *typeEntry) const; - void writeTypeIndexValueLines(QTextStream &s, const AbstractMetaClass *metaClass) const; - void writeProtectedEnumSurrogate(QTextStream &s, const AbstractMetaEnum &cppEnum) const; - void writeInheritedOverloads(QTextStream &s) const; + void writeCopyCtor(TextStream &s, const AbstractMetaClass *metaClass) const; + void writeProtectedFieldAccessors(TextStream &s, const AbstractMetaField &field) const; + void writeFunction(TextStream &s, const AbstractMetaFunction *func); + void writeSbkTypeFunction(TextStream &s, const AbstractMetaEnum &cppEnum) const; + void writeSbkTypeFunction(TextStream &s, const AbstractMetaClass *cppClass) const; + void writeSbkTypeFunction(TextStream &s, const AbstractMetaType &metaType) const; + void writeTypeIndexValueLine(TextStream &s, const TypeEntry *typeEntry) const; + void writeTypeIndexValueLines(TextStream &s, const AbstractMetaClass *metaClass) const; + void writeProtectedEnumSurrogate(TextStream &s, const AbstractMetaEnum &cppEnum) const; + void writeInheritedOverloads(TextStream &s) const; QSet<const AbstractMetaFunction *> m_inheritedOverloads; }; |