diff options
Diffstat (limited to 'sources/shiboken2/generator/generator.h')
-rw-r--r-- | sources/shiboken2/generator/generator.h | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/sources/shiboken2/generator/generator.h b/sources/shiboken2/generator/generator.h index cdf6d89b3..04840427f 100644 --- a/sources/shiboken2/generator/generator.h +++ b/sources/shiboken2/generator/generator.h @@ -29,6 +29,7 @@ #ifndef GENERATOR_H #define GENERATOR_H +#include "indentor.h" #include <abstractmetalang_typedefs.h> #include <typedatabase_typedefs.h> #include <dependency.h> @@ -54,7 +55,6 @@ QT_END_NAMESPACE class PrimitiveTypeEntry; class ContainerTypeEntry; -class Indentor; QTextStream& formatCode(QTextStream &s, const QString& code, Indentor &indentor); void verifyDirectoryFor(const QString &file); @@ -417,41 +417,5 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Generator::Options) typedef QSharedPointer<Generator> GeneratorPtr; typedef QVector<GeneratorPtr> Generators; -/** -* Utility class to store the identation level, use it in a QTextStream. -*/ -class Indentor -{ -public: - Indentor() : indent(0) {} - int indent; -}; - -/** -* Class that use the RAII idiom to set and unset the identation level. -*/ -class Indentation -{ -public: - Indentation(Indentor &indentor) : indentor(indentor) - { - indentor.indent++; - } - ~Indentation() - { - indentor.indent--; - } - -private: - Indentor &indentor; -}; - -inline QTextStream &operator <<(QTextStream &s, const Indentor &indentor) -{ - for (int i = 0; i < indentor.indent; ++i) - s << " "; - return s; -} - #endif // GENERATOR_H |