forked from qt-creator/qt-creator
Remove ICheck project.
This commit is contained in:
@@ -1,5 +0,0 @@
|
||||
# ----------------------------------------------------
|
||||
# This file is generated by the Qt Visual Studio Add-in.
|
||||
# ------------------------------------------------------
|
||||
|
||||
SOURCES += ./main.cpp
|
||||
@@ -1,6 +0,0 @@
|
||||
TEMPLATE = subdirs
|
||||
CONFIG += ordered
|
||||
|
||||
SUBDIRS = \
|
||||
ICheckLib \
|
||||
ICheckApp
|
||||
@@ -1,23 +0,0 @@
|
||||
#-------------------------------------------------
|
||||
#
|
||||
# Project created by QtCreator 2010-01-18T15:27:35
|
||||
#
|
||||
#-------------------------------------------------
|
||||
|
||||
QT -= gui
|
||||
|
||||
TARGET = ICheckApp
|
||||
CONFIG += console
|
||||
CONFIG -= app_bundle
|
||||
|
||||
TEMPLATE = app
|
||||
|
||||
INCLUDEPATH += ../ICheckLib
|
||||
CONFIG(debug, debug|release){
|
||||
LIBS += -L../ICheckLib/debug -lICheckLibd
|
||||
}
|
||||
else {
|
||||
LIBS += -L../ICheckLib/release -lICheckLib
|
||||
}
|
||||
|
||||
SOURCES += main.cpp
|
||||
@@ -1,129 +0,0 @@
|
||||
#include "ichecklib.h"
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <iostream>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QProcess>
|
||||
|
||||
using namespace std;
|
||||
|
||||
QStringList getQTIncludePath()
|
||||
{
|
||||
QStringList ret;
|
||||
QStringList processevironment = QProcess::systemEnvironment();
|
||||
foreach(QString item, processevironment){
|
||||
if(item.indexOf("QTDIR=") == 0){
|
||||
QString qtpath = item.remove("QTDIR=");
|
||||
ret << qtpath + "\\include\\QtCore";
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
int ret = 0;
|
||||
if(argc == 3){
|
||||
try{
|
||||
//Extract the file name and path from the arguments
|
||||
QString interfaceHeaderFile = argv[1];
|
||||
QString checkHeaderFile = argv[2];
|
||||
QString curpath = QDir::currentPath();
|
||||
//Create FileInfos for the header files
|
||||
QFile ifile(interfaceHeaderFile);
|
||||
if (!ifile.exists()){
|
||||
QString err = "File does not exist: " + interfaceHeaderFile;
|
||||
throw err;
|
||||
}
|
||||
QFile chfile(checkHeaderFile);
|
||||
if (!chfile.exists()){
|
||||
QString err = "File does not exist: " + checkHeaderFile;
|
||||
throw err;
|
||||
}
|
||||
QFileInfo iFileInfo(ifile);
|
||||
QFileInfo chFileInfo(chfile);
|
||||
|
||||
//Now create a list of the include path
|
||||
QString chIncludepath = chFileInfo.absolutePath();
|
||||
QStringList chIncludepathlist;
|
||||
chIncludepathlist << chIncludepath;
|
||||
chIncludepathlist << getQTIncludePath();
|
||||
|
||||
QString iIncludepath = iFileInfo.absolutePath();
|
||||
QStringList iIncludepathlist;
|
||||
iIncludepathlist << iIncludepath;
|
||||
|
||||
//Create a list of all the soucre files they need to be parsed.
|
||||
//In our case it is just the header file
|
||||
QStringList chFilelist;
|
||||
chFilelist << chFileInfo.filePath();
|
||||
|
||||
QStringList iFilelist;
|
||||
iFilelist << iFileInfo.filePath();
|
||||
|
||||
ICheckLib i_ichecklib;
|
||||
i_ichecklib.ParseHeader(iIncludepathlist, iFilelist);
|
||||
|
||||
ICheckLib ichecklib;
|
||||
ichecklib.ParseHeader(chIncludepathlist, chFilelist);
|
||||
|
||||
if(!ichecklib.check(i_ichecklib)){
|
||||
cout << "Folowing interface items are missing:" << endl;
|
||||
QStringList errorlist = ichecklib.getErrorMsg();
|
||||
foreach(QString msg, errorlist){
|
||||
cout << (const char *)msg.toLatin1() << endl;
|
||||
}
|
||||
ret = -1;
|
||||
}
|
||||
else
|
||||
cout << "Interface is full defined.";
|
||||
|
||||
/*
|
||||
//Parse the interface header
|
||||
CPlusPlus::ParseManager* iParseManager = new CPlusPlus::ParseManager();
|
||||
iParseManager->setIncludePath(iIncludepathlist);
|
||||
iParseManager->parse(iFilelist);
|
||||
|
||||
//Parse the header that needs to be compared against the interface header
|
||||
CPlusPlus::ParseManager* chParseManager = new CPlusPlus::ParseManager();
|
||||
chIncludepathlist << getQTIncludePath();
|
||||
chParseManager->setIncludePath(chIncludepathlist);
|
||||
chParseManager->parse(chFilelist);
|
||||
|
||||
if(!chParseManager->checkAllMetadatas(iParseManager)){
|
||||
cout << "Folowing interface items are missing:" << endl;
|
||||
QStringList errorlist = chParseManager->getErrorMsg();
|
||||
foreach(QString msg, errorlist){
|
||||
cout << (const char *)msg.toLatin1() << endl;
|
||||
}
|
||||
ret = -1;
|
||||
}
|
||||
else
|
||||
cout << "Interface is full defined.";
|
||||
|
||||
delete iParseManager;
|
||||
delete chParseManager;
|
||||
*/
|
||||
}
|
||||
catch (QString msg)
|
||||
{
|
||||
cout << endl << "Error:" << endl;
|
||||
cout << (const char *)msg.toLatin1();
|
||||
ret = -2;
|
||||
}
|
||||
}
|
||||
else{
|
||||
cout << "CompareHeaderWithHeader.exe";
|
||||
cout << " \"Interface header\"";
|
||||
cout << " \"headerfile to check\"";
|
||||
}
|
||||
|
||||
qDebug() << endl << endl << "return value: " << ret;
|
||||
getchar();
|
||||
return ret;
|
||||
}
|
||||
@@ -1,110 +0,0 @@
|
||||
# ----------------------------------------------------
|
||||
# This file is generated by the Qt Visual Studio Add-in.
|
||||
# ------------------------------------------------------
|
||||
HEADERS += $$REL_PATH_TO_SRC/shared/cplusplus/Array.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/AST.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/ASTMatcher.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/ASTVisitor.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/CheckDeclaration.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/CheckDeclarator.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/CheckExpression.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/CheckName.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/CheckSpecifier.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/CheckStatement.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Control.h \
|
||||
$$REL_PATH_TO_SRC/plugins/coreplugin/core_global.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/CoreTypes.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/CPlusPlusForwardDeclarations.h \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/CppBindings.h \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/CppDocument.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/DiagnosticClient.h \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/FastPreprocessor.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/FullySpecifiedType.h \
|
||||
./ichecklib.h \
|
||||
./ICheckLib_global.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Lexer.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Literals.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/LiteralTable.h \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/Macro.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/MemoryPool.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Name.h \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/NamePrettyPrinter.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Names.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/NameVisitor.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/ObjectiveCTypeQualifiers.h \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/Overview.h \
|
||||
./ParseManager.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Parser.h \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/pp-cctype.h \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/pp-engine.h \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/pp-macro-expander.h \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/pp-scanner.h \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/pp.h \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/PreprocessorClient.h \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/PreprocessorEnvironment.h \
|
||||
$$REL_PATH_TO_SRC/libs/utils/qtcassert.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Scope.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Semantic.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/SemanticCheck.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Symbol.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Symbols.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/SymbolVisitor.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Token.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/TranslationUnit.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Type.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/TypeMatcher.h \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/TypePrettyPrinter.h \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/TypeVisitor.h
|
||||
SOURCES += $$REL_PATH_TO_SRC/shared/cplusplus/Array.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/AST.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/ASTMatch0.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/ASTMatcher.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/ASTVisit.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/ASTVisitor.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/CheckDeclaration.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/CheckDeclarator.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/CheckExpression.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/CheckName.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/CheckSpecifier.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/CheckStatement.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Control.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/CoreTypes.cpp \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/CppBindings.cpp \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/CppDocument.cpp \
|
||||
$$REL_PATH_TO_SRC/plugins/cpptools/cppmodelmanager.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/DiagnosticClient.cpp \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/FastPreprocessor.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/FullySpecifiedType.cpp \
|
||||
./ichecklib.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Keywords.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Lexer.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Literals.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/LiteralTable.cpp \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/Macro.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/MemoryPool.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Name.cpp \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/NamePrettyPrinter.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Names.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/NameVisitor.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/ObjectiveCAtKeywords.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/ObjectiveCTypeQualifiers.cpp \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/Overview.cpp \
|
||||
./ParseManager.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Parser.cpp \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/pp-engine.cpp \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/pp-macro-expander.cpp \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/pp-scanner.cpp \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/PreprocessorClient.cpp \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/PreprocessorEnvironment.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Scope.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Semantic.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/SemanticCheck.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Symbol.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Symbols.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/SymbolVisitor.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Token.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/TranslationUnit.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/Type.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/TypeMatcher.cpp \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus/TypePrettyPrinter.cpp \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus/TypeVisitor.cpp
|
||||
@@ -1,35 +0,0 @@
|
||||
REL_PATH_TO_SRC = ../../../
|
||||
|
||||
TEMPLATE = lib
|
||||
|
||||
CONFIG(debug, debug|release){
|
||||
TARGET = ICheckLibd
|
||||
DESTDIR = ./debug
|
||||
DLLDESTDIR = ../ICheckApp/debug
|
||||
MOC_DIR += ./debug/GeneratedFiles
|
||||
OBJECTS_DIR += ./debug
|
||||
INCLUDEPATH += ./ \
|
||||
./debug/GeneratedFiles \
|
||||
$$REL_PATH_TO_SRC/plugins \
|
||||
$$REL_PATH_TO_SRC/libs \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus \
|
||||
$(QTDIR)
|
||||
}
|
||||
else {
|
||||
TARGET = ICheckLib
|
||||
DESTDIR = ./release
|
||||
DLLDESTDIR = ../ICheckApp/release
|
||||
MOC_DIR += ./release/GeneratedFiles
|
||||
OBJECTS_DIR += ./release
|
||||
INCLUDEPATH += ./ \
|
||||
./release/GeneratedFiles \
|
||||
$$REL_PATH_TO_SRC/plugins \
|
||||
$$REL_PATH_TO_SRC/libs \
|
||||
$$REL_PATH_TO_SRC/shared/cplusplus \
|
||||
$$REL_PATH_TO_SRC/libs/cplusplus \
|
||||
$(QTDIR)
|
||||
}
|
||||
|
||||
DEFINES += ICHECKLIB_LIBRARY ICHECK_BUILD
|
||||
include(ICheckLib.pri)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,300 +0,0 @@
|
||||
/**************************************************************************
|
||||
**
|
||||
** This file is part of Qt Creator
|
||||
**
|
||||
** Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
||||
**
|
||||
** Contact: Nokia Corporation (qt-info@nokia.com)
|
||||
**
|
||||
** Commercial Usage
|
||||
**
|
||||
** Licensees holding valid Qt Commercial licenses may use this file in
|
||||
** accordance with the Qt Commercial License Agreement provided with the
|
||||
** Software or, alternatively, in accordance with the terms contained in
|
||||
** a written agreement between you and Nokia.
|
||||
**
|
||||
** GNU Lesser General Public License Usage
|
||||
**
|
||||
** Alternatively, this file may be used under the terms of the GNU Lesser
|
||||
** General Public License version 2.1 as published by the Free Software
|
||||
** Foundation and appearing in the file LICENSE.LGPL included in the
|
||||
** packaging of this file. Please review the following information to
|
||||
** ensure the GNU Lesser General Public License version 2.1 requirements
|
||||
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
||||
**
|
||||
** If you are unsure which license is appropriate for your use, please
|
||||
** contact the sales department at http://qt.nokia.com/contact.
|
||||
**
|
||||
** Description:
|
||||
**
|
||||
** The ParseManager parses and compares to different header files
|
||||
** of its metadata. This can be used for checking if an Interface
|
||||
** is implemented complete.
|
||||
**
|
||||
** How to use it:
|
||||
**
|
||||
** //Parse the interface header
|
||||
** ParseManager* iParseManager = new ParseManager();
|
||||
** iParseManager->setIncludePath(iIncludepathlist);
|
||||
** iParseManager->parse(iFilelist);
|
||||
**
|
||||
** //Parse the header that needs to be compared against the interface header
|
||||
** ParseManager* chParseManager = new ParseManager();
|
||||
** chIncludepathlist << getQTIncludePath();
|
||||
** chParseManager->setIncludePath(chIncludepathlist);
|
||||
** chParseManager->parse(chFilelist);
|
||||
**
|
||||
** if(!chParseManager->checkAllMetadatas(iParseManager)){
|
||||
** cout << "Folowing interface items are missing:" << endl;
|
||||
** QStringList errorlist = chParseManager->getErrorMsg();
|
||||
** foreach(QString msg, errorlist){
|
||||
** cout << (const char *)msg.toLatin1() << endl;
|
||||
** }
|
||||
** return -1;
|
||||
** }
|
||||
** else
|
||||
** cout << "Interface is full defined.";
|
||||
**
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef PARSEMANAGER_H
|
||||
#define PARSEMANAGER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QList>
|
||||
#include <QFuture>
|
||||
#include <QStringList>
|
||||
#include "cplusplus/CppDocument.h"
|
||||
|
||||
namespace CppTools{
|
||||
namespace Internal{
|
||||
class CppPreprocessor;
|
||||
}
|
||||
}
|
||||
|
||||
namespace CPlusPlus {
|
||||
class TranslationUnit;
|
||||
class AST;
|
||||
class ClassSpecifierAST;
|
||||
class SimpleDeclarationAST;
|
||||
class QPropertyDeclarationAST;
|
||||
class QEnumDeclarationAST;
|
||||
class QFlagsDeclarationAST;
|
||||
class QDeclareFlagsDeclarationAST;
|
||||
class EnumSpecifierAST;
|
||||
class Function;
|
||||
|
||||
class ParseManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
struct CLASSLISTITEM
|
||||
{
|
||||
CPlusPlus::TranslationUnit* trlUnit;
|
||||
ClassSpecifierAST* classspec;
|
||||
};
|
||||
struct CLASSTREE
|
||||
{
|
||||
CLASSLISTITEM* highestlevelclass;
|
||||
QList<CLASSLISTITEM*> classlist;
|
||||
};
|
||||
struct FUNCTIONITEM
|
||||
{
|
||||
const CLASSLISTITEM* highestlevelclass;
|
||||
CPlusPlus::TranslationUnit* trlUnit;
|
||||
ClassSpecifierAST* classAst;
|
||||
QStringList classWichIsNotFound;
|
||||
CPlusPlus::Function* function;
|
||||
SimpleDeclarationAST* ast;
|
||||
|
||||
bool isEqualTo(FUNCTIONITEM* cpfct, bool ignoreName = true);
|
||||
void init()
|
||||
{
|
||||
highestlevelclass = 0;
|
||||
trlUnit = 0;
|
||||
classAst = 0;
|
||||
function = 0;
|
||||
ast = 0;
|
||||
}
|
||||
};
|
||||
struct PROPERTYITEM
|
||||
{
|
||||
const CLASSLISTITEM* highestlevelclass;
|
||||
QStringList classWichIsNotFound;
|
||||
QPropertyDeclarationAST *ast;
|
||||
CPlusPlus::TranslationUnit* trlUnit;
|
||||
bool readdefined;
|
||||
FUNCTIONITEM *readFct;
|
||||
bool writedefined;
|
||||
FUNCTIONITEM *writeFct;
|
||||
bool resetdefined;
|
||||
FUNCTIONITEM *resetFct;
|
||||
bool notifydefined;
|
||||
FUNCTIONITEM *notifyFct;
|
||||
bool foundalldefinedfct;
|
||||
|
||||
bool isEqualTo(PROPERTYITEM* cpppt);
|
||||
void init()
|
||||
{
|
||||
highestlevelclass = 0;
|
||||
ast = 0;
|
||||
trlUnit = 0;
|
||||
readdefined = false;
|
||||
readFct = 0;
|
||||
writedefined = false;
|
||||
writeFct = 0;
|
||||
resetdefined = false;
|
||||
resetFct = 0;
|
||||
notifydefined = false;
|
||||
notifyFct = 0;
|
||||
foundalldefinedfct = false;
|
||||
}
|
||||
};
|
||||
|
||||
struct QENUMITEM
|
||||
{
|
||||
const CLASSLISTITEM* highestlevelclass;
|
||||
CPlusPlus::TranslationUnit* trlUnit;
|
||||
QStringList classWichIsNotFound;
|
||||
QEnumDeclarationAST* ast;
|
||||
//an item in this list will be shown like:
|
||||
//EnumName.EnumItemName.Value
|
||||
//ConnectionState.disconnected.0
|
||||
QStringList values;
|
||||
bool foundallenums;
|
||||
|
||||
bool isEqualTo(QENUMITEM *cpenum);
|
||||
void init()
|
||||
{
|
||||
highestlevelclass = 0;
|
||||
trlUnit = 0;
|
||||
ast = 0;
|
||||
values.clear();
|
||||
foundallenums = true;
|
||||
}
|
||||
};
|
||||
|
||||
struct ENUMITEM
|
||||
{
|
||||
const CLASSLISTITEM* highestlevelclass;
|
||||
CPlusPlus::TranslationUnit* trlUnit;
|
||||
QStringList classWichIsNotFound;
|
||||
EnumSpecifierAST* ast;
|
||||
|
||||
void init()
|
||||
{
|
||||
highestlevelclass = 0;
|
||||
trlUnit = 0;
|
||||
ast = 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct QFLAGITEM
|
||||
{
|
||||
const CLASSLISTITEM* highestlevelclass;
|
||||
CPlusPlus::TranslationUnit* trlUnit;
|
||||
QStringList classWichIsNotFound;
|
||||
QFlagsDeclarationAST* ast;
|
||||
QStringList enumvalues;
|
||||
bool foundallenums;
|
||||
|
||||
bool isEqualTo(QFLAGITEM *cpflag);
|
||||
void init()
|
||||
{
|
||||
highestlevelclass = 0;
|
||||
trlUnit = 0;
|
||||
ast = 0;
|
||||
enumvalues.clear();
|
||||
foundallenums = true;
|
||||
}
|
||||
};
|
||||
|
||||
struct QDECLAREFLAGSITEM
|
||||
{
|
||||
const CLASSLISTITEM* highestlevelclass;
|
||||
CPlusPlus::TranslationUnit* trlUnit;
|
||||
QStringList classWichIsNotFound;
|
||||
QDeclareFlagsDeclarationAST* ast;
|
||||
|
||||
void init()
|
||||
{
|
||||
highestlevelclass = 0;
|
||||
trlUnit = 0;
|
||||
ast = 0;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
public:
|
||||
ParseManager();
|
||||
virtual ~ParseManager();
|
||||
void setIncludePath(const QStringList &includePath);
|
||||
void parse(const QStringList &sourceFiles);
|
||||
bool checkAllMetadatas(ParseManager* pInterfaceParserManager);
|
||||
CppTools::Internal::CppPreprocessor *getPreProcessor() { return pCppPreprocessor; }
|
||||
QList<CLASSTREE*> CreateClassLists();
|
||||
QStringList getErrorMsg() { return m_errormsgs; }
|
||||
|
||||
private:
|
||||
void parse(CppTools::Internal::CppPreprocessor *preproc, const QStringList &files);
|
||||
void getBaseClasses(const CLASSLISTITEM* pclass, QList<CLASSLISTITEM*> &baseclasslist, const QList<CLASSLISTITEM*> &allclasslist);
|
||||
void getElements(QList<FUNCTIONITEM*> &functionlist
|
||||
, QList<PROPERTYITEM*> &propertylist
|
||||
, QList<QENUMITEM*> &qenumlist
|
||||
, QList<ENUMITEM*> &enumlist
|
||||
, QList<QFLAGITEM*> &qflaglist
|
||||
, QList<QDECLAREFLAGSITEM*> &qdeclareflaglist
|
||||
, const QList<CLASSLISTITEM*> classitems
|
||||
, const CLASSLISTITEM* highestlevelclass);
|
||||
|
||||
//<--- for Metadata functions checks
|
||||
QList<FUNCTIONITEM*> checkMetadataFunctions(const QList<QList<FUNCTIONITEM*> > &classfctlist, const QList<QList<FUNCTIONITEM*> > &iclassfctlist);
|
||||
bool isMetaObjFunction(FUNCTIONITEM* fct);
|
||||
QList<FUNCTIONITEM*> containsAllMetadataFunction(const QList<FUNCTIONITEM*> &classfctlist, const QList<FUNCTIONITEM*> &iclassfctlist);
|
||||
QString getErrorMessage(FUNCTIONITEM* fct);
|
||||
//--->
|
||||
|
||||
//<--- for Q_PROPERTY functions checks
|
||||
QList<PROPERTYITEM*> checkMetadataProperties(const QList<QList<PROPERTYITEM*> > &classproplist
|
||||
, const QList<QList<FUNCTIONITEM*> > &classfctlist
|
||||
, const QList<QList<PROPERTYITEM*> > &iclassproplist
|
||||
, const QList<QList<FUNCTIONITEM*> > &iclassfctlist);
|
||||
void assignPropertyFunctions(PROPERTYITEM* prop, const QList<QList<FUNCTIONITEM*> > &fctlookuplist);
|
||||
QList<PROPERTYITEM*> containsAllPropertyFunction(const QList<PROPERTYITEM*> &classproplist, const QList<PROPERTYITEM*> &iclassproplist);
|
||||
QString getErrorMessage(PROPERTYITEM* ppt);
|
||||
//--->
|
||||
|
||||
//<--- for Q_ENUMS checks
|
||||
QList<QENUMITEM*> checkMetadataEnums(const QList<QList<QENUMITEM*> > &classqenumlist
|
||||
, const QList<QList<ENUMITEM*> > &classenumlist
|
||||
, const QList<QList<QENUMITEM*> > &iclassqenumlist
|
||||
, const QList<QList<ENUMITEM*> > &iclassenumlist);
|
||||
QStringList getEnumValueStringList(ENUMITEM *penum, QString mappedenumname = "");
|
||||
void assignEnumValues(QENUMITEM* qenum, const QList<QList<ENUMITEM*> > &enumlookuplist);
|
||||
QList<QENUMITEM*> containsAllEnums(const QList<QENUMITEM*> &classqenumlist, const QList<QENUMITEM*> &iclassqenumlist);
|
||||
QString getErrorMessage(QENUMITEM* qenum);
|
||||
//--->
|
||||
|
||||
//<--- for QFlags checks --->
|
||||
QList<QFLAGITEM*> checkMetadataFlags(const QList<QList<QFLAGITEM*> > &classqflaglist
|
||||
, const QList<QList<QDECLAREFLAGSITEM*> > &classqdeclareflaglist
|
||||
, const QList<QList<ENUMITEM*> > &classenumlist
|
||||
, const QList<QList<QFLAGITEM*> > &iclassqflaglist
|
||||
, const QList<QList<QDECLAREFLAGSITEM*> > &iclassqdeclareflaglist
|
||||
, const QList<QList<ENUMITEM*> > &iclassenumlist);
|
||||
void assignFlagValues(QFLAGITEM* qflags, const QList<QList<QDECLAREFLAGSITEM*> > &qdeclareflagslookuplist, const QList<QList<ENUMITEM*> > &enumlookuplist);
|
||||
QList<QFLAGITEM*> containsAllFlags(const QList<QFLAGITEM*> &classqflaglist, const QList<QFLAGITEM*> &iclassqflaglist);
|
||||
QString getErrorMessage(QFLAGITEM* pfg);
|
||||
//--->
|
||||
|
||||
private:
|
||||
// cache
|
||||
QStringList m_includePaths;
|
||||
QStringList m_frameworkPaths;
|
||||
QByteArray m_definedMacros;
|
||||
CppTools::Internal::CppPreprocessor* pCppPreprocessor;
|
||||
QString m_strHeaderFile;
|
||||
QStringList m_errormsgs;
|
||||
};
|
||||
}
|
||||
#endif // PARSEMANAGER_H
|
||||
@@ -1,60 +0,0 @@
|
||||
#include "ichecklib.h"
|
||||
#include "ParseManager.h"
|
||||
#include <QtCore/QCoreApplication>
|
||||
#include <QString>
|
||||
#include <QStringList>
|
||||
#include <iostream>
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QFileInfo>
|
||||
#include <QProcess>
|
||||
|
||||
QStringList getQTIncludePath()
|
||||
{
|
||||
QStringList ret;
|
||||
QStringList processevironment = QProcess::systemEnvironment();
|
||||
foreach(QString item, processevironment){
|
||||
if(item.indexOf("QTDIR=") == 0){
|
||||
QString qtpath = item.remove("QTDIR=");
|
||||
ret << qtpath + "\\include\\QtCore";
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
ICheckLib::ICheckLib()
|
||||
: pParseManager(0)
|
||||
{
|
||||
}
|
||||
|
||||
void ICheckLib::ParseHeader(const QStringList& includePath, const QStringList& filelist)
|
||||
{
|
||||
if(pParseManager)
|
||||
delete pParseManager;
|
||||
pParseManager = 0;
|
||||
pParseManager = new CPlusPlus::ParseManager();
|
||||
pParseManager->setIncludePath(includePath);
|
||||
pParseManager->parse(filelist);
|
||||
}
|
||||
|
||||
bool ICheckLib::check(const ICheckLib& ichecklib /*ICheckLib from interface header*/)
|
||||
{
|
||||
if(pParseManager){
|
||||
CPlusPlus::ParseManager* cpparsemanager = ichecklib.pParseManager;
|
||||
return pParseManager->checkAllMetadatas(cpparsemanager);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
QStringList ICheckLib::getErrorMsg()
|
||||
{
|
||||
QStringList ret;
|
||||
if(pParseManager){
|
||||
ret.append(pParseManager->getErrorMsg());
|
||||
}
|
||||
else
|
||||
ret << "no file was parsed.";
|
||||
return ret;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
#ifndef ICHECKLIB_H
|
||||
#define ICHECKLIB_H
|
||||
|
||||
#include <QStringList>
|
||||
#include "ichecklib_global.h"
|
||||
|
||||
namespace CPlusPlus{
|
||||
class ParseManager;
|
||||
}
|
||||
|
||||
class ICHECKLIBSHARED_EXPORT ICheckLib {
|
||||
public:
|
||||
ICheckLib();
|
||||
void ParseHeader(const QStringList& includePath, const QStringList& filelist);
|
||||
bool check(const ICheckLib& ichecklib /*ICheckLib from interface header*/);
|
||||
QStringList getErrorMsg();
|
||||
private:
|
||||
CPlusPlus::ParseManager* pParseManager;
|
||||
};
|
||||
|
||||
#endif // ICHECKLIB_H
|
||||
@@ -1,12 +0,0 @@
|
||||
#ifndef ICHECKLIB_GLOBAL_H
|
||||
#define ICHECKLIB_GLOBAL_H
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#if defined(ICHECKLIB_LIBRARY)
|
||||
# define ICHECKLIBSHARED_EXPORT Q_DECL_EXPORT
|
||||
#else
|
||||
# define ICHECKLIBSHARED_EXPORT Q_DECL_IMPORT
|
||||
#endif
|
||||
|
||||
#endif // ICHECKLIB_GLOBAL_H
|
||||
@@ -1,2 +1,2 @@
|
||||
TEMPLATE = subdirs
|
||||
win32:SUBDIRS = qtcdebugger ICheck
|
||||
win32:SUBDIRS = qtcdebugger
|
||||
|
||||
Reference in New Issue
Block a user