summaryrefslogtreecommitdiffstats
path: root/src/tools/moc
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/moc')
-rw-r--r--src/tools/moc/preprocessor.cpp9
-rw-r--r--src/tools/moc/preprocessor.h2
2 files changed, 9 insertions, 2 deletions
diff --git a/src/tools/moc/preprocessor.cpp b/src/tools/moc/preprocessor.cpp
index 07986a71e6..696b32c728 100644
--- a/src/tools/moc/preprocessor.cpp
+++ b/src/tools/moc/preprocessor.cpp
@@ -937,10 +937,15 @@ Symbols Preprocessor::preprocessed(const QByteArray &filename, FILE *file)
{
QFile qfile;
qfile.open(file, QFile::ReadOnly);
- QByteArray input = qfile.readAll();
+ return preprocessed(filename, &qfile);
+}
+
+Symbols Preprocessor::preprocessed(const QByteArray &filename, QIODevice *file)
+{
+ QByteArray input = file->readAll();
if (input.isEmpty())
return symbols;
-
+
// phase 1: get rid of backslash-newlines
input = cleaned(input);
diff --git a/src/tools/moc/preprocessor.h b/src/tools/moc/preprocessor.h
index e0707da4ee..4e0bd6343d 100644
--- a/src/tools/moc/preprocessor.h
+++ b/src/tools/moc/preprocessor.h
@@ -62,6 +62,7 @@ typedef SubArray MacroName;
typedef QHash<MacroName, Macro> Macros;
typedef QVector<MacroName> MacroSafeSet;
+class QIODevice;
class Preprocessor : public Parser
{
@@ -80,6 +81,7 @@ public:
QSet<QByteArray> preprocessedIncludes;
Macros macros;
Symbols preprocessed(const QByteArray &filename, FILE *file);
+ Symbols preprocessed(const QByteArray &filename, QIODevice *device);
void skipUntilEndif();