aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--abstractmetabuilder.cpp18
-rw-r--r--abstractmetabuilder.h3
-rw-r--r--apiextractor.cpp7
-rw-r--r--apiextractor.h3
4 files changed, 26 insertions, 5 deletions
diff --git a/abstractmetabuilder.cpp b/abstractmetabuilder.cpp
index 8602bccb..0ba989dc 100644
--- a/abstractmetabuilder.cpp
+++ b/abstractmetabuilder.cpp
@@ -48,6 +48,7 @@
#include <boost/graph/graph_traits.hpp>
#include <cstdio>
+#include <QDir>
static QString stripTemplateArgs(const QString &name)
{
@@ -55,7 +56,7 @@ static QString stripTemplateArgs(const QString &name)
return pos < 0 ? name : name.left(pos);
}
-AbstractMetaBuilder::AbstractMetaBuilder() : m_currentClass(0)
+AbstractMetaBuilder::AbstractMetaBuilder() : m_currentClass(0), m_logDirectory(QString('.')+QDir::separator())
{
}
@@ -496,6 +497,13 @@ bool AbstractMetaBuilder::build(QIODevice* input)
return true;
}
+void AbstractMetaBuilder::setLogDirectory(const QString& logDir)
+{
+ m_logDirectory = logDir;
+ if (!m_logDirectory.endsWith(QDir::separator()))
+ m_logDirectory.append(QDir::separator());
+}
+
void AbstractMetaBuilder::addAbstractMetaClass(AbstractMetaClass *cls)
{
if (!cls)
@@ -2435,10 +2443,10 @@ static void writeRejectLogFile(const QString &name,
void AbstractMetaBuilder::dumpLog()
{
- writeRejectLogFile("mjb_rejected_classes.log", m_rejectedClasses);
- writeRejectLogFile("mjb_rejected_enums.log", m_rejectedEnums);
- writeRejectLogFile("mjb_rejected_functions.log", m_rejectedFunctions);
- writeRejectLogFile("mjb_rejected_fields.log", m_rejectedFields);
+ writeRejectLogFile(m_logDirectory + "mjb_rejected_classes.log", m_rejectedClasses);
+ writeRejectLogFile(m_logDirectory + "mjb_rejected_enums.log", m_rejectedEnums);
+ writeRejectLogFile(m_logDirectory + "mjb_rejected_functions.log", m_rejectedFunctions);
+ writeRejectLogFile(m_logDirectory + "mjb_rejected_fields.log", m_rejectedFields);
}
AbstractMetaClassList AbstractMetaBuilder::classesTopologicalSorted(const AbstractMetaClass* cppClass) const
diff --git a/abstractmetabuilder.h b/abstractmetabuilder.h
index 3cc5f3ce..4f097912 100644
--- a/abstractmetabuilder.h
+++ b/abstractmetabuilder.h
@@ -86,6 +86,7 @@ public:
void dumpLog();
bool build(QIODevice* input);
+ void setLogDirectory(const QString& logDir);
void figureOutEnumValuesForClass(AbstractMetaClass *metaClass, QSet<AbstractMetaClass *> *classes);
int figureOutEnumValue(const QString &name, int value, AbstractMetaEnum *meta_enum, AbstractMetaFunction *metaFunction = 0);
@@ -220,6 +221,8 @@ private:
// QtScript
QSet<QString> m_qmetatypeDeclaredTypenames;
+
+ QString m_logDirectory;
};
#endif // ABSTRACTMETBUILDER_H
diff --git a/apiextractor.cpp b/apiextractor.cpp
index 66426e92..514a327b 100644
--- a/apiextractor.cpp
+++ b/apiextractor.cpp
@@ -73,6 +73,11 @@ void ApiExtractor::addIncludePath(const QStringList& paths)
m_includePaths << paths;
}
+void ApiExtractor::setLogDirectory(const QString& logDir)
+{
+ m_logDirectory = logDir;
+}
+
void ApiExtractor::setCppFileName(const QString& cppFileName)
{
m_cppFileName = cppFileName;
@@ -159,7 +164,9 @@ bool ApiExtractor::run()
}
ppFile.seek(0);
m_builder = new AbstractMetaBuilder;
+ m_builder->setLogDirectory(m_logDirectory);
m_builder->build(&ppFile);
+
return true;
}
diff --git a/apiextractor.h b/apiextractor.h
index 2c65ed46..b745a91c 100644
--- a/apiextractor.h
+++ b/apiextractor.h
@@ -47,6 +47,8 @@ public:
void addIncludePath(const QString& path);
void addIncludePath(const QStringList& paths);
+ void setLogDirectory(const QString& logDir);
+
AbstractMetaEnumList globalEnums() const;
AbstractMetaFunctionList globalFunctions() const;
AbstractMetaClassList classes() const;
@@ -62,6 +64,7 @@ private:
QString m_cppFileName;
QStringList m_includePaths;
AbstractMetaBuilder* m_builder;
+ QString m_logDirectory;
// disable copy
ApiExtractor(const ApiExtractor&);