Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Tobias Hunger
qt-creator
Commits
e134e249
Commit
e134e249
authored
Feb 03, 2010
by
Wolfgang Beck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Source update.
parent
cc278a59
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
616 additions
and
202 deletions
+616
-202
src/plugins/cpptools/cppmodelmanager.cpp
src/plugins/cpptools/cppmodelmanager.cpp
+25
-24
src/plugins/cpptools/cppmodelmanager.h
src/plugins/cpptools/cppmodelmanager.h
+14
-9
src/shared/cplusplus/AST.h
src/shared/cplusplus/AST.h
+8
-0
src/shared/cplusplus/ASTClone.cpp
src/shared/cplusplus/ASTClone.cpp
+61
-0
src/shared/cplusplus/CheckDeclarator.cpp
src/shared/cplusplus/CheckDeclarator.cpp
+1
-1
src/shared/cplusplus/Control.cpp
src/shared/cplusplus/Control.cpp
+11
-0
src/shared/cplusplus/Parser.cpp
src/shared/cplusplus/Parser.cpp
+5
-2
src/shared/cplusplus/Symbols.cpp
src/shared/cplusplus/Symbols.cpp
+5
-1
tests/auto/icheckbuild/icheckbuild.pro
tests/auto/icheckbuild/icheckbuild.pro
+2
-2
tests/auto/icheckbuild/ichecklib.cpp
tests/auto/icheckbuild/ichecklib.cpp
+69
-3
tests/auto/icheckbuild/ichecklib.h
tests/auto/icheckbuild/ichecklib.h
+42
-1
tests/auto/icheckbuild/ichecklib.pri
tests/auto/icheckbuild/ichecklib.pri
+3
-1
tests/auto/icheckbuild/ichecklib_global.h
tests/auto/icheckbuild/ichecklib_global.h
+41
-0
tests/auto/icheckbuild/parsemanager.cpp
tests/auto/icheckbuild/parsemanager.cpp
+311
-147
tests/auto/icheckbuild/parsemanager.h
tests/auto/icheckbuild/parsemanager.h
+18
-11
No files found.
src/plugins/cpptools/cppmodelmanager.cpp
View file @
e134e249
...
@@ -33,30 +33,32 @@
...
@@ -33,30 +33,32 @@
#include <cplusplus/CheckUndefinedSymbols.h>
#include <cplusplus/CheckUndefinedSymbols.h>
#include "cppmodelmanager.h"
#include "cppmodelmanager.h"
#include "cpptoolsconstants.h"
#ifndef ICHECK_BUILD
#include "cpptoolseditorsupport.h"
# include "cpptoolsconstants.h"
#include "cppfindreferences.h"
# include "cpptoolseditorsupport.h"
# include "cppfindreferences.h"
#endif
#include <functional>
#include <functional>
#include <QtConcurrentRun>
#include <QtConcurrentRun>
#i
nclude <QFutureSynchronizer>
#i
fndef ICHECK_BUILD
#include <
qtconcurrent/runextensions.h
>
#
include <
QFutureSynchronizer
>
# include <qtconcurrent/runextensions.h>
#include <texteditor/itexteditor.h>
#
include <texteditor/itexteditor.h>
#include <texteditor/basetexteditor.h>
#
include <texteditor/basetexteditor.h>
# include <projectexplorer/project.h>
#include <projectexplorer/project.h>
#
include <projectexplorer/project
explorer
.h>
#include <projectexplorer/projectexplorer.h>
#
include <projectexplorer/projectexplorer
constants
.h>
#include <projectexplorer/
projectexplorerconstants
.h>
#
include <projectexplorer/
session
.h>
#include <
projectexplorer/session
.h>
#
include <
coreplugin/icore
.h>
# include <coreplugin/uniqueidmanager.h>
#include <coreplugin/
icor
e.h>
#
include <coreplugin/
mimedatabas
e.h>
#include <coreplugin/
uniqueid
manager.h>
#
include <coreplugin/
editormanager/editor
manager.h>
#include <coreplugin/
mimedatabase
.h>
#
include <coreplugin/
progressmanager/progressmanager
.h>
#include <
coreplugin/editormanager/editor
manager.h>
#
include <
extensionsystem/plugin
manager.h>
#
include <coreplugin/progressmanager/progressmanager.h>
#
else
# include <QDir>
#
include <extensionsystem/pluginmanager.h>
#
endif
#include <utils/qtcassert.h>
#include <utils/qtcassert.h>
...
@@ -199,9 +201,8 @@ void CppPreprocessor::setProjectFiles(const QStringList &files)
...
@@ -199,9 +201,8 @@ void CppPreprocessor::setProjectFiles(const QStringList &files)
void
CppPreprocessor
::
setTodo
(
const
QStringList
&
files
)
void
CppPreprocessor
::
setTodo
(
const
QStringList
&
files
)
{
m_todo
=
QSet
<
QString
>::
fromList
(
files
);
}
{
m_todo
=
QSet
<
QString
>::
fromList
(
files
);
}
namespace
{
#ifndef ICHECK_BUILD
#ifndef ICHECK_BUILD
namespace
{
class
Process
:
public
std
::
unary_function
<
Document
::
Ptr
,
void
>
class
Process
:
public
std
::
unary_function
<
Document
::
Ptr
,
void
>
{
{
QPointer
<
CppModelManager
>
_modelManager
;
QPointer
<
CppModelManager
>
_modelManager
;
...
@@ -256,8 +257,8 @@ public:
...
@@ -256,8 +257,8 @@ public:
_modelManager
->
emitDocumentUpdated
(
doc
);
// ### TODO: compress
_modelManager
->
emitDocumentUpdated
(
doc
);
// ### TODO: compress
}
}
};
};
#endif
}
// end of anonymous namespace
}
// end of anonymous namespace
#endif
void
CppPreprocessor
::
run
(
const
QString
&
fileName
)
void
CppPreprocessor
::
run
(
const
QString
&
fileName
)
{
{
...
...
src/plugins/cpptools/cppmodelmanager.h
View file @
e134e249
...
@@ -31,21 +31,26 @@
...
@@ -31,21 +31,26 @@
#define CPPMODELMANAGER_H
#define CPPMODELMANAGER_H
#include <cpptools/cppmodelmanagerinterface.h>
#include <cpptools/cppmodelmanagerinterface.h>
#include <projectexplorer/project.h>
#ifndef ICHECK_BUILD
# include <projectexplorer/project.h>
#endif
#include <cplusplus/CppDocument.h>
#include <cplusplus/CppDocument.h>
#include <cplusplus/PreprocessorClient.h>
#include <cplusplus/PreprocessorClient.h>
#include <texteditor/basetexteditor.h>
#ifndef ICHECK_BUILD
# include <texteditor/basetexteditor.h>
#endif
#include <cplusplus/PreprocessorEnvironment.h>
#include <cplusplus/PreprocessorEnvironment.h>
#include <cplusplus/pp-engine.h>
#include <cplusplus/pp-engine.h>
#ifdef ICHECK_BUILD
#ifdef ICHECK_BUILD
# include "ParseManager.h"
# include "parsemanager.h"
#else
# include <QtCore/QHash>
# include <QtCore/QFutureInterface>
# include <QtCore/QFutureSynchronizer>
# include <QtCore/QMutex>
# include <QtCore/QTimer>
# include <QtGui/QTextEdit> // for QTextEdit::ExtraSelection
#endif
#endif
#include <QtCore/QHash>
#include <QtCore/QFutureInterface>
#include <QtCore/QFutureSynchronizer>
#include <QtCore/QMutex>
#include <QtCore/QTimer>
#include <QtGui/QTextEdit> // for QTextEdit::ExtraSelection
namespace
Core
{
namespace
Core
{
class
ICore
;
class
ICore
;
...
...
src/shared/cplusplus/AST.h
View file @
e134e249
...
@@ -586,6 +586,8 @@ public:
...
@@ -586,6 +586,8 @@ public:
virtual
unsigned
firstToken
()
const
;
virtual
unsigned
firstToken
()
const
;
virtual
unsigned
lastToken
()
const
;
virtual
unsigned
lastToken
()
const
;
virtual
QPropertyDeclarationAST
*
clone
(
MemoryPool
*
pool
)
const
;
protected:
protected:
virtual
void
accept0
(
ASTVisitor
*
visitor
);
virtual
void
accept0
(
ASTVisitor
*
visitor
);
virtual
bool
match0
(
AST
*
,
ASTMatcher
*
);
virtual
bool
match0
(
AST
*
,
ASTMatcher
*
);
...
@@ -606,6 +608,8 @@ public:
...
@@ -606,6 +608,8 @@ public:
virtual
unsigned
firstToken
()
const
;
virtual
unsigned
firstToken
()
const
;
virtual
unsigned
lastToken
()
const
;
virtual
unsigned
lastToken
()
const
;
virtual
QEnumDeclarationAST
*
clone
(
MemoryPool
*
pool
)
const
;
protected:
protected:
virtual
void
accept0
(
ASTVisitor
*
visitor
);
virtual
void
accept0
(
ASTVisitor
*
visitor
);
virtual
bool
match0
(
AST
*
,
ASTMatcher
*
);
virtual
bool
match0
(
AST
*
,
ASTMatcher
*
);
...
@@ -626,6 +630,8 @@ public:
...
@@ -626,6 +630,8 @@ public:
virtual
unsigned
firstToken
()
const
;
virtual
unsigned
firstToken
()
const
;
virtual
unsigned
lastToken
()
const
;
virtual
unsigned
lastToken
()
const
;
virtual
QFlagsDeclarationAST
*
clone
(
MemoryPool
*
pool
)
const
;
protected:
protected:
virtual
void
accept0
(
ASTVisitor
*
visitor
);
virtual
void
accept0
(
ASTVisitor
*
visitor
);
virtual
bool
match0
(
AST
*
,
ASTMatcher
*
);
virtual
bool
match0
(
AST
*
,
ASTMatcher
*
);
...
@@ -647,6 +653,8 @@ public:
...
@@ -647,6 +653,8 @@ public:
virtual
unsigned
firstToken
()
const
;
virtual
unsigned
firstToken
()
const
;
virtual
unsigned
lastToken
()
const
;
virtual
unsigned
lastToken
()
const
;
virtual
QDeclareFlagsDeclarationAST
*
clone
(
MemoryPool
*
pool
)
const
;
protected:
protected:
virtual
void
accept0
(
ASTVisitor
*
visitor
);
virtual
void
accept0
(
ASTVisitor
*
visitor
);
virtual
bool
match0
(
AST
*
,
ASTMatcher
*
);
virtual
bool
match0
(
AST
*
,
ASTMatcher
*
);
...
...
src/shared/cplusplus/ASTClone.cpp
View file @
e134e249
...
@@ -138,6 +138,67 @@ AccessDeclarationAST *AccessDeclarationAST::clone(MemoryPool *pool) const
...
@@ -138,6 +138,67 @@ AccessDeclarationAST *AccessDeclarationAST::clone(MemoryPool *pool) const
return
ast
;
return
ast
;
}
}
#ifdef ICHECK_BUILD
QPropertyDeclarationAST
*
QPropertyDeclarationAST
::
clone
(
MemoryPool
*
pool
)
const
{
QPropertyDeclarationAST
*
ast
=
new
(
pool
)
QPropertyDeclarationAST
;
ast
->
property_specifier_token
=
property_specifier_token
;
ast
->
lparen_token
=
lparen_token
;
ast
->
type_token
=
type_token
;
ast
->
type_name_token
=
type_name_token
;
ast
->
read_token
=
read_token
;
ast
->
read_function_token
=
read_function_token
;
ast
->
write_token
=
write_token
;
ast
->
write_function_token
=
write_function_token
;
ast
->
reset_token
=
reset_token
;
ast
->
reset_function_token
=
reset_function_token
;
ast
->
notify_token
=
notify_token
;
ast
->
notify_function_token
=
notify_function_token
;
ast
->
rparen_token
=
rparen_token
;
return
ast
;
}
QEnumDeclarationAST
*
QEnumDeclarationAST
::
clone
(
MemoryPool
*
pool
)
const
{
QEnumDeclarationAST
*
ast
=
new
(
pool
)
QEnumDeclarationAST
;
ast
->
enum_specifier_token
=
enum_specifier_token
;
ast
->
lparen_token
=
lparen_token
;
ast
->
rparen_token
=
rparen_token
;
EnumeratorListAST
*
enumerator_list
;
for
(
EnumeratorListAST
*
iter
=
enumerator_list
,
**
ast_iter
=
&
ast
->
enumerator_list
;
iter
;
iter
=
iter
->
next
,
ast_iter
=
&
(
*
ast_iter
)
->
next
)
*
ast_iter
=
new
(
pool
)
EnumeratorListAST
((
iter
->
value
)
?
iter
->
value
->
clone
(
pool
)
:
0
);
return
ast
;
}
QFlagsDeclarationAST
*
QFlagsDeclarationAST
::
clone
(
MemoryPool
*
pool
)
const
{
QFlagsDeclarationAST
*
ast
=
new
(
pool
)
QFlagsDeclarationAST
;
ast
->
flags_specifier_token
=
flags_specifier_token
;
ast
->
lparen_token
=
lparen_token
;
ast
->
rparen_token
=
rparen_token
;
EnumeratorListAST
*
enumerator_list
;
for
(
EnumeratorListAST
*
iter
=
enumerator_list
,
**
ast_iter
=
&
ast
->
enumerator_list
;
iter
;
iter
=
iter
->
next
,
ast_iter
=
&
(
*
ast_iter
)
->
next
)
*
ast_iter
=
new
(
pool
)
EnumeratorListAST
((
iter
->
value
)
?
iter
->
value
->
clone
(
pool
)
:
0
);
return
ast
;
}
QDeclareFlagsDeclarationAST
*
QDeclareFlagsDeclarationAST
::
clone
(
MemoryPool
*
pool
)
const
{
QDeclareFlagsDeclarationAST
*
ast
=
new
(
pool
)
QDeclareFlagsDeclarationAST
;
ast
->
declareflags_specifier_token
=
declareflags_specifier_token
;
ast
->
lparen_token
=
lparen_token
;
ast
->
flag_token
=
flag_token
;
ast
->
enum_token
=
enum_token
;
ast
->
rparen_token
=
rparen_token
;
return
ast
;
}
#endif
AsmDefinitionAST
*
AsmDefinitionAST
::
clone
(
MemoryPool
*
pool
)
const
AsmDefinitionAST
*
AsmDefinitionAST
::
clone
(
MemoryPool
*
pool
)
const
{
{
AsmDefinitionAST
*
ast
=
new
(
pool
)
AsmDefinitionAST
;
AsmDefinitionAST
*
ast
=
new
(
pool
)
AsmDefinitionAST
;
...
...
src/shared/cplusplus/CheckDeclarator.cpp
View file @
e134e249
...
@@ -272,7 +272,7 @@ bool CheckDeclarator::visit(ObjCMethodPrototypeAST *ast)
...
@@ -272,7 +272,7 @@ bool CheckDeclarator::visit(ObjCMethodPrototypeAST *ast)
if
(
semantic
()
->
isObjCClassMethod
(
tokenKind
(
ast
->
method_type_token
)))
if
(
semantic
()
->
isObjCClassMethod
(
tokenKind
(
ast
->
method_type_token
)))
method
->
setStorage
(
Symbol
::
Static
);
method
->
setStorage
(
Symbol
::
Static
);
if
(
ast
->
selector
->
asObjCSelectorWithArguments
())
{
if
(
ast
->
selector
&&
ast
->
selector
->
asObjCSelectorWithArguments
())
{
for
(
ObjCMessageArgumentDeclarationListAST
*
it
=
ast
->
argument_list
;
it
;
it
=
it
->
next
)
{
for
(
ObjCMessageArgumentDeclarationListAST
*
it
=
ast
->
argument_list
;
it
;
it
=
it
->
next
)
{
ObjCMessageArgumentDeclarationAST
*
argDecl
=
it
->
value
;
ObjCMessageArgumentDeclarationAST
*
argDecl
=
it
->
value
;
...
...
src/shared/cplusplus/Control.cpp
View file @
e134e249
...
@@ -210,6 +210,16 @@ public:
...
@@ -210,6 +210,16 @@ public:
}
// end of anonymous namespace
}
// end of anonymous namespace
#ifdef ICHECK_BUILD
//Symbian compiler has some difficulties to understand the templates.
static
void
delete_array_entries
(
std
::
vector
<
Symbol
*>
vt
)
{
std
::
vector
<
Symbol
*>::
iterator
it
;
for
(
it
=
vt
.
begin
();
it
!=
vt
.
end
();
++
it
)
{
delete
*
it
;
}
}
#else
template
<
typename
_Iterator
>
template
<
typename
_Iterator
>
static
void
delete_array_entries
(
_Iterator
first
,
_Iterator
last
)
static
void
delete_array_entries
(
_Iterator
first
,
_Iterator
last
)
{
{
...
@@ -220,6 +230,7 @@ static void delete_array_entries(_Iterator first, _Iterator last)
...
@@ -220,6 +230,7 @@ static void delete_array_entries(_Iterator first, _Iterator last)
template
<
typename
_Array
>
template
<
typename
_Array
>
static
void
delete_array_entries
(
const
_Array
&
a
)
static
void
delete_array_entries
(
const
_Array
&
a
)
{
delete_array_entries
(
a
.
begin
(),
a
.
end
());
}
{
delete_array_entries
(
a
.
begin
(),
a
.
end
());
}
#endif
class
Control
::
Data
class
Control
::
Data
{
{
...
...
src/shared/cplusplus/Parser.cpp
View file @
e134e249
...
@@ -1748,11 +1748,12 @@ bool Parser::parseAccessSpecifier(SpecifierAST *&node)
...
@@ -1748,11 +1748,12 @@ bool Parser::parseAccessSpecifier(SpecifierAST *&node)
bool
Parser
::
parseAccessDeclaration
(
DeclarationAST
*&
node
)
bool
Parser
::
parseAccessDeclaration
(
DeclarationAST
*&
node
)
{
{
DEBUG_THIS_RULE
();
DEBUG_THIS_RULE
();
if
(
LA
()
==
T_PUBLIC
||
LA
()
==
T_PROTECTED
||
LA
()
==
T_PRIVATE
||
LA
()
==
T_Q_SIGNALS
)
{
if
(
LA
()
==
T_PUBLIC
||
LA
()
==
T_PROTECTED
||
LA
()
==
T_PRIVATE
||
LA
()
==
T_Q_SIGNALS
||
LA
()
==
T_Q_SLOTS
)
{
bool
isSignals
=
LA
()
==
T_Q_SIGNALS
;
bool
isSignals
=
LA
()
==
T_Q_SIGNALS
;
bool
isSlots
=
LA
()
==
T_Q_SLOTS
;
AccessDeclarationAST
*
ast
=
new
(
_pool
)
AccessDeclarationAST
;
AccessDeclarationAST
*
ast
=
new
(
_pool
)
AccessDeclarationAST
;
ast
->
access_specifier_token
=
consumeToken
();
ast
->
access_specifier_token
=
consumeToken
();
if
(
!
isSignals
&&
LA
()
==
T_Q_SLOTS
)
if
(
!
isSignals
&&
(
LA
()
==
T_Q_SLOTS
||
isSlots
)
)
ast
->
slots_token
=
consumeToken
();
ast
->
slots_token
=
consumeToken
();
match
(
T_COLON
,
&
ast
->
colon_token
);
match
(
T_COLON
,
&
ast
->
colon_token
);
node
=
ast
;
node
=
ast
;
...
@@ -1930,6 +1931,7 @@ bool Parser::parseMemberSpecification(DeclarationAST *&node)
...
@@ -1930,6 +1931,7 @@ bool Parser::parseMemberSpecification(DeclarationAST *&node)
case
T_PUBLIC
:
case
T_PUBLIC
:
case
T_PROTECTED
:
case
T_PROTECTED
:
case
T_PRIVATE
:
case
T_PRIVATE
:
case
T_Q_SLOTS
:
return
parseAccessDeclaration
(
node
);
return
parseAccessDeclaration
(
node
);
#ifdef ICHECK_BUILD
#ifdef ICHECK_BUILD
...
@@ -2426,6 +2428,7 @@ bool Parser::parseStatement(StatementAST *&node)
...
@@ -2426,6 +2428,7 @@ bool Parser::parseStatement(StatementAST *&node)
return
parseExpressionOrDeclarationStatement
(
node
);
return
parseExpressionOrDeclarationStatement
(
node
);
}
// switch
}
// switch
return
false
;
//Avoid compiler warning
}
}
bool
Parser
::
parseBreakStatement
(
StatementAST
*&
node
)
bool
Parser
::
parseBreakStatement
(
StatementAST
*&
node
)
...
...
src/shared/cplusplus/Symbols.cpp
View file @
e134e249
...
@@ -222,7 +222,9 @@ bool Function::isEqualTo(const Type *other) const
...
@@ -222,7 +222,9 @@ bool Function::isEqualTo(const Type *other) const
else
if
(
isVolatile
()
!=
o
->
isVolatile
())
else
if
(
isVolatile
()
!=
o
->
isVolatile
())
return
false
;
return
false
;
#ifdef ICHECK_BUILD
#ifdef ICHECK_BUILD
else
if
(
isInvokable
()
!=
o
->
isInvokable
())
else
if
(
isInvokable
()
!=
o
->
isInvokable
())
return
false
;
else
if
(
isSignal
()
!=
o
->
isSignal
())
return
false
;
return
false
;
#endif
#endif
...
@@ -258,6 +260,8 @@ bool Function::isEqualTo(const Function* fct, bool ignoreName/* = false*/) const
...
@@ -258,6 +260,8 @@ bool Function::isEqualTo(const Function* fct, bool ignoreName/* = false*/) const
return
false
;
return
false
;
else
if
(
isInvokable
()
!=
fct
->
isInvokable
())
else
if
(
isInvokable
()
!=
fct
->
isInvokable
())
return
false
;
return
false
;
else
if
(
isSignal
()
!=
fct
->
isSignal
())
return
false
;
if
(
_arguments
->
symbolCount
()
!=
fct
->
_arguments
->
symbolCount
())
if
(
_arguments
->
symbolCount
()
!=
fct
->
_arguments
->
symbolCount
())
return
false
;
return
false
;
...
...
tests/auto/icheckbuild/icheckbuild.pro
View file @
e134e249
...
@@ -20,6 +20,6 @@ TARGET=tst_$$TARGET
...
@@ -20,6 +20,6 @@ TARGET=tst_$$TARGET
include
(.
/
ichecklib
.
pri
)
include
(.
/
ichecklib
.
pri
)
HEADERS
+=
.
/
ichecklib
.
h
\
HEADERS
+=
.
/
ichecklib
.
h
\
.
/
ichecklib_global
.
h
\
.
/
ichecklib_global
.
h
\
.
/
P
arse
M
anager
.
h
.
/
p
arse
m
anager
.
h
SOURCES
+=
.
/
ichecklib
.
cpp
\
SOURCES
+=
.
/
ichecklib
.
cpp
\
.
/
P
arse
M
anager
.
cpp
.
/
p
arse
m
anager
.
cpp
tests/auto/icheckbuild/ichecklib.cpp
View file @
e134e249
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include "ichecklib.h"
#include "ichecklib.h"
#include "
P
arse
M
anager.h"
#include "
p
arse
m
anager.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QCoreApplication>
#include <QString>
#include <QString>
#include <QStringList>
#include <QStringList>
...
@@ -17,7 +58,32 @@ QStringList getQTIncludePath()
...
@@ -17,7 +58,32 @@ QStringList getQTIncludePath()
foreach
(
QString
item
,
processevironment
){
foreach
(
QString
item
,
processevironment
){
if
(
item
.
indexOf
(
"QTDIR="
)
==
0
){
if
(
item
.
indexOf
(
"QTDIR="
)
==
0
){
QString
qtpath
=
item
.
remove
(
"QTDIR="
);
QString
qtpath
=
item
.
remove
(
"QTDIR="
);
ret
<<
qtpath
+
"/include"
;
ret
<<
qtpath
+
"/include/ActiveQt"
;
ret
<<
qtpath
+
"/include/phonon"
;
ret
<<
qtpath
+
"/include/phonon_compat"
;
ret
<<
qtpath
+
"/include/Qt"
;
ret
<<
qtpath
+
"/include/Qt3Support"
;
ret
<<
qtpath
+
"/include/QtAssistant"
;
ret
<<
qtpath
+
"/include/QtCore"
;
ret
<<
qtpath
+
"/include/QtCore"
;
ret
<<
qtpath
+
"/include/QtDBus"
;
ret
<<
qtpath
+
"/include/QtDeclarative"
;
ret
<<
qtpath
+
"/include/QtDesigner"
;
ret
<<
qtpath
+
"/include/QtGui"
;
ret
<<
qtpath
+
"/include/QtHelp"
;
ret
<<
qtpath
+
"/include/QtMultimedia"
;
ret
<<
qtpath
+
"/include/QtNetwork"
;
ret
<<
qtpath
+
"/include/QtOpenGL"
;
ret
<<
qtpath
+
"/include/QtOpenVG"
;
ret
<<
qtpath
+
"/include/QtScript"
;
ret
<<
qtpath
+
"/include/QtScriptTools"
;
ret
<<
qtpath
+
"/include/QtSql"
;
ret
<<
qtpath
+
"/include/QtSvg"
;
ret
<<
qtpath
+
"/include/QtTest"
;
ret
<<
qtpath
+
"/include/QtUiTools"
;
ret
<<
qtpath
+
"/include/QtWebKit"
;
ret
<<
qtpath
+
"/include/QtXml"
;
ret
<<
qtpath
+
"/include/QtXmlPatterns"
;
break
;
break
;
}
}
}
}
...
@@ -39,11 +105,11 @@ void ICheckLib::ParseHeader(const QStringList& includePath, const QStringList& f
...
@@ -39,11 +105,11 @@ void ICheckLib::ParseHeader(const QStringList& includePath, const QStringList& f
pParseManager
->
parse
(
filelist
);
pParseManager
->
parse
(
filelist
);
}
}
bool
ICheckLib
::
check
(
const
ICheckLib
&
ichecklib
/*ICheckLib from interface header*/
)
bool
ICheckLib
::
check
(
const
ICheckLib
&
ichecklib
/*ICheckLib from interface header*/
,
QString
outputfile
)
{
{
if
(
pParseManager
){
if
(
pParseManager
){
CPlusPlus
::
ParseManager
*
cpparsemanager
=
ichecklib
.
pParseManager
;
CPlusPlus
::
ParseManager
*
cpparsemanager
=
ichecklib
.
pParseManager
;
return
pParseManager
->
checkAllMetadatas
(
cpparsemanager
);
return
pParseManager
->
checkAllMetadatas
(
cpparsemanager
,
outputfile
);
}
}
return
false
;
return
false
;
}
}
...
...
tests/auto/icheckbuild/ichecklib.h
View file @
e134e249
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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.
**
** In addition, as a special exception, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**
**
**
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#ifndef ICHECKLIB_H
#ifndef ICHECKLIB_H
#define ICHECKLIB_H
#define ICHECKLIB_H
...
@@ -11,7 +52,7 @@ class ICHECKLIBSHARED_EXPORT ICheckLib {
...
@@ -11,7 +52,7 @@ class ICHECKLIBSHARED_EXPORT ICheckLib {
public:
public:
ICheckLib
();
ICheckLib
();
void
ParseHeader
(
const
QStringList
&
includePath
,
const
QStringList
&
filelist
);
void
ParseHeader
(
const
QStringList
&
includePath
,
const
QStringList
&
filelist
);
bool
check
(
const
ICheckLib
&
ichecklib
/*ICheckLib from interface header*/
);
bool
check
(
const
ICheckLib
&
ichecklib
/*ICheckLib from interface header*/
,
QString
outputfile
);
QStringList
getErrorMsg
();
QStringList
getErrorMsg
();
private:
private:
CPlusPlus
::
ParseManager
*
pParseManager
;
CPlusPlus
::
ParseManager
*
pParseManager
;
...
...
tests/auto/icheckbuild/ichecklib.pri
View file @
e134e249
...
@@ -56,11 +56,13 @@ HEADERS += $$REL_PATH_TO_SRC/shared/cplusplus/Array.h \
...
@@ -56,11 +56,13 @@ HEADERS += $$REL_PATH_TO_SRC/shared/cplusplus/Array.h \
$$REL_PATH_TO_SRC/shared/cplusplus/Type.h \
$$REL_PATH_TO_SRC/shared/cplusplus/Type.h \
$$REL_PATH_TO_SRC/shared/cplusplus/TypeMatcher.h \
$$REL_PATH_TO_SRC/shared/cplusplus/TypeMatcher.h \
$$REL_PATH_TO_SRC/libs/cplusplus/TypePrettyPrinter.h \
$$REL_PATH_TO_SRC/libs/cplusplus/TypePrettyPrinter.h \
$$REL_PATH_TO_SRC/shared/cplusplus/TypeVisitor.h
$$REL_PATH_TO_SRC/shared/cplusplus/TypeVisitor.h \
$$REL_PATH_TO_SRC/plugins/cpptools/cpptools_global.h
SOURCES += $$REL_PATH_TO_SRC/shared/cplusplus/Array.cpp \
SOURCES += $$REL_PATH_TO_SRC/shared/cplusplus/Array.cpp \
$$REL_PATH_TO_SRC/shared/cplusplus/AST.cpp \
$$REL_PATH_TO_SRC/shared/cplusplus/AST.cpp \
$$REL_PATH_TO_SRC/shared/cplusplus/ASTMatch0.cpp \
$$REL_PATH_TO_SRC/shared/cplusplus/ASTMatch0.cpp \
$$REL_PATH_TO_SRC/shared/cplusplus/ASTMatcher.cpp \
$$REL_PATH_TO_SRC/shared/cplusplus/ASTMatcher.cpp \
$$REL_PATH_TO_SRC/shared/cplusplus/ASTClone.cpp \
$$REL_PATH_TO_SRC/shared/cplusplus/ASTVisit.cpp \
$$REL_PATH_TO_SRC/shared/cplusplus/ASTVisit.cpp \
$$REL_PATH_TO_SRC/shared/cplusplus/ASTVisitor.cpp \
$$REL_PATH_TO_SRC/shared/cplusplus/ASTVisitor.cpp \
$$REL_PATH_TO_SRC/shared/cplusplus/CheckDeclaration.cpp \
$$REL_PATH_TO_SRC/shared/cplusplus/CheckDeclaration.cpp \
...
...
tests/auto/icheckbuild/ichecklib_global.h
View file @
e134e249
/****************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the Qt Mobility Components.
**
** $QT_BEGIN_LICENSE:LGPL$
** No Commercial Usage
** This file contains pre-release code and may not be distributed.