aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Lima <hugo.lima@openbossa.org>2009-08-20 20:56:20 -0300
committerHugo Lima <hugo.lima@openbossa.org>2009-08-21 17:35:58 -0300
commitd3d7fd878d497e410f9d0aeb71a95facb67f5bfd (patch)
treec552bcf162c610c2e07c302286b35be006cd1ce8
parentc645e083901079dd073eca84a0b822d37daf0293 (diff)
Added a lot of helper methods to APIExtractor interface
Reviewed by Setanta
-rw-r--r--apiextractor.cpp51
-rw-r--r--apiextractor.h12
2 files changed, 63 insertions, 0 deletions
diff --git a/apiextractor.cpp b/apiextractor.cpp
index 8a280538..b81689ba 100644
--- a/apiextractor.cpp
+++ b/apiextractor.cpp
@@ -57,11 +57,22 @@ void ApiExtractor::addTypesystemSearchPath ( const QString& path )
TypeDatabase::instance()->addTypesystemPath(path);
}
+void ApiExtractor::addTypesystemSearchPath ( const QStringList& paths )
+{
+ foreach (QString path, paths)
+ addTypesystemSearchPath(path);
+}
+
void ApiExtractor::addIncludePath ( const QString& path )
{
m_includePaths << path;
}
+void ApiExtractor::addIncludePath ( const QStringList& paths )
+{
+ m_includePaths << paths;
+}
+
void ApiExtractor::setCppFileName(const QString& cppFileName)
{
m_cppFileName = cppFileName;
@@ -87,6 +98,46 @@ void ApiExtractor::setSilent ( bool value )
ReportHandler::setSilent(value);
}
+AbstractMetaEnumList ApiExtractor::globalEnums() const
+{
+ Q_ASSERT(m_builder);
+ return m_builder->globalEnums();
+}
+
+AbstractMetaFunctionList ApiExtractor::globalFunctions() const
+{
+ Q_ASSERT(m_builder);
+ return m_builder->globalFunctions();
+}
+
+AbstractMetaClassList ApiExtractor::classes() const
+{
+ Q_ASSERT(m_builder);
+ return m_builder->classes();
+}
+
+PrimitiveTypeEntryList ApiExtractor::primitiveTypes() const
+{
+ return TypeDatabase::instance()->primitiveTypes();
+}
+
+ContainerTypeEntryList ApiExtractor::containerTypes() const
+{
+ return TypeDatabase::instance()->containerTypes();
+}
+
+QSet<QString> ApiExtractor::qtMetaTypeDeclaredTypeNames() const
+{
+ Q_ASSERT(m_builder);
+ return m_builder->qtMetaTypeDeclaredTypeNames();
+}
+
+int ApiExtractor::classCount() const
+{
+ Q_ASSERT(m_builder);
+ return m_builder->classes().count();
+}
+
bool ApiExtractor::run()
{
if (m_builder)
diff --git a/apiextractor.h b/apiextractor.h
index 8cad8f1d..2c65ed46 100644
--- a/apiextractor.h
+++ b/apiextractor.h
@@ -25,6 +25,7 @@
#define APIEXTRACTOR_H
#include "reporthandler.h"
+#include "abstractmetalang.h"
#include <QStringList>
class AbstractMetaBuilder;
@@ -42,7 +43,18 @@ public:
void setSuppressWarnings(bool value);
void setSilent(bool value);
void addTypesystemSearchPath(const QString& path);
+ void addTypesystemSearchPath(const QStringList& paths);
void addIncludePath(const QString& path);
+ void addIncludePath(const QStringList& paths);
+
+ AbstractMetaEnumList globalEnums() const;
+ AbstractMetaFunctionList globalFunctions() const;
+ AbstractMetaClassList classes() const;
+ PrimitiveTypeEntryList primitiveTypes() const;
+ ContainerTypeEntryList containerTypes() const;
+ QSet<QString> qtMetaTypeDeclaredTypeNames() const;
+
+ int classCount() const;
bool run();
private: