|
0
|
1 |
/*
|
|
|
2 |
* Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
|
3 |
* All rights reserved.
|
|
|
4 |
* This component and the accompanying materials are made available
|
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
|
6 |
* which accompanies this distribution, and is available
|
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
|
8 |
*
|
|
|
9 |
* Initial Contributors:
|
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
|
11 |
*
|
|
|
12 |
* Contributors:
|
|
|
13 |
*
|
|
|
14 |
* Description:
|
|
|
15 |
*
|
|
|
16 |
*/
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
#ifndef FUNCTIONNODEANALYSIS_H_
|
|
|
20 |
#define FUNCTIONNODEANALYSIS_H_
|
|
|
21 |
|
|
|
22 |
#ifdef __WIN__
|
|
|
23 |
#pragma warning(disable:4786)
|
|
|
24 |
#endif
|
|
|
25 |
#include <xercesc/dom/DOM.hpp>
|
|
|
26 |
#include "HANodeIterator.h"
|
|
|
27 |
#include "NodeAnalysis.h"
|
|
|
28 |
|
|
|
29 |
using namespace std;
|
|
|
30 |
|
|
|
31 |
XERCES_CPP_NAMESPACE_USE
|
|
|
32 |
|
|
|
33 |
template <TIssueType IssueType>
|
|
|
34 |
void AddIssueFunction(const HANodeIterator* self,TIssueIdentity funcType, const HANodeIterator& ignorenode, int lineNo, const XMLCh* fileid=NULL)
|
|
|
35 |
{
|
|
|
36 |
switch (funcType)
|
|
|
37 |
{
|
|
|
38 |
case EIssueIdentityExportedFunction:
|
|
|
39 |
AddIssue<EIssueIdentityExportedFunction,IssueType>(self,ignorenode,lineNo,fileid);
|
|
|
40 |
break;
|
|
|
41 |
case EIssueIdentityInlineFunction:
|
|
|
42 |
AddIssue<EIssueIdentityInlineFunction,IssueType>(self,ignorenode,lineNo,fileid);
|
|
|
43 |
break;
|
|
|
44 |
default:
|
|
|
45 |
assert(false);
|
|
|
46 |
break;
|
|
|
47 |
|
|
|
48 |
};
|
|
|
49 |
|
|
|
50 |
}
|
|
|
51 |
|
|
|
52 |
/**
|
|
|
53 |
* Changes in function signatures are analyzed. Any change in the signature of an
|
|
|
54 |
* accessible function is considered to be a binary break.
|
|
|
55 |
*/
|
|
|
56 |
class FunctionNodeAnalysis: public NodeAnalysis
|
|
|
57 |
{
|
|
|
58 |
public:
|
|
|
59 |
/**
|
|
|
60 |
* Constructor
|
|
|
61 |
* @return pointer NodeAnalysis object
|
|
|
62 |
*/
|
|
|
63 |
static NodeAnalysis* Construct();
|
|
|
64 |
public:
|
|
|
65 |
|
|
|
66 |
FunctionNodeAnalysis();
|
|
|
67 |
|
|
|
68 |
/**
|
|
|
69 |
* Finds node to analyse it
|
|
|
70 |
* @param baseline baseline node
|
|
|
71 |
* @param current current node
|
|
|
72 |
* @return 0, if there was no issues
|
|
|
73 |
*/
|
|
|
74 |
int FindNodeAndAnalyse(HANodeIterator baseline,HANodeIterator current);
|
|
|
75 |
|
|
|
76 |
/**
|
|
|
77 |
* Analyse
|
|
|
78 |
* @param baseline baseline node
|
|
|
79 |
* @param current current node
|
|
|
80 |
* @param report report or not (default= true)
|
|
|
81 |
* @return 0, if there was no issues
|
|
|
82 |
*/
|
|
|
83 |
int Analyse(HANodeIterator baseline,HANodeIterator current, bool report = true);
|
|
|
84 |
|
|
|
85 |
/**
|
|
|
86 |
* Destructor
|
|
|
87 |
*/
|
|
|
88 |
~FunctionNodeAnalysis(){}
|
|
|
89 |
|
|
|
90 |
private:
|
|
|
91 |
//! Type of function found
|
|
|
92 |
TIssueIdentity iFuncType;
|
|
|
93 |
};
|
|
|
94 |
|
|
|
95 |
#endif
|