diff options
author | Hugo Lima <hugo.lima@openbossa.org> | 2009-08-20 13:48:45 -0300 |
---|---|---|
committer | Hugo Lima <hugo.lima@openbossa.org> | 2009-08-20 13:48:45 -0300 |
commit | dfa423ac3109e0e40cba5f43471b34b98ed3189d (patch) | |
tree | e900a9c1aeb99aa5a9cb2f90489c6629c81e6a57 /typesystem.cpp | |
parent | 8f9ed5bd51827d96bda708121008b24bb3d55801 (diff) |
Removed all generator stuff from APIExtractor, this stuff should be moved to the generator,
and the apiextractor library should be just what their name means, an API extractor.
This break the APIExtractor source compatibility with no mercy!
Diffstat (limited to 'typesystem.cpp')
-rw-r--r-- | typesystem.cpp | 78 |
1 files changed, 1 insertions, 77 deletions
diff --git a/typesystem.cpp b/typesystem.cpp index 2a17d703b..6475db065 100644 --- a/typesystem.cpp +++ b/typesystem.cpp @@ -22,10 +22,7 @@ */ #include "typesystem.h" -#include "generator.h" - -#include <reporthandler.h> - +#include "reporthandler.h" #include <Qt/QtXml> QString strings_Object = QLatin1String("Object"); @@ -1923,79 +1920,6 @@ QString fixCppTypeName(const QString &name) return name; } -QString formattedCodeHelper(QTextStream &s, Indentor &indentor, QStringList &lines) -{ - bool multilineComment = false; - bool lastEmpty = true; - QString lastLine; - while (!lines.isEmpty()) { - const QString line = lines.takeFirst().trimmed(); - if (line.isEmpty()) { - if (!lastEmpty) - s << endl; - lastEmpty = true; - continue; - } else - lastEmpty = false; - - if (line.startsWith("/*")) - multilineComment = true; - - if (multilineComment) { - s << indentor; - if (line.startsWith("*")) - s << " "; - s << line << endl; - if (line.endsWith("*/")) - multilineComment = false; - } else if (line.startsWith("}")) - return line; - else if (line.endsWith("")) { - s << indentor << line << endl; - return 0; - } else if (line.endsWith("{")) { - s << indentor << line << endl; - QString tmp; - { - Indentation indent(indentor); - tmp = formattedCodeHelper(s, indentor, lines); - } - if (!tmp.isNull()) - s << indentor << tmp << endl; - - lastLine = tmp; - continue; - } else { - s << indentor; - if (!lastLine.isEmpty() && - !lastLine.endsWith(";") && - !line.startsWith("@") && - !line.startsWith("//") && - !lastLine.startsWith("//") && - !lastLine.endsWith("}") && - !line.startsWith("{")) - s << " "; - s << line << endl; - } - lastLine = line; - } - return 0; -} - - -QTextStream &CodeSnip::formattedCode(QTextStream &s, Indentor &indentor) const -{ - QStringList lst(code().split("\n")); - while (!lst.isEmpty()) { - QString tmp = formattedCodeHelper(s, indentor, lst); - if (!tmp.isNull()) - s << indentor << tmp << endl; - - } - s.flush(); - return s; -} - QString TemplateInstance::expandCode() const { TemplateEntry *templateEntry = TypeDatabase::instance()->findTemplate(m_name); |