|
1 /* |
|
2 * Copyright (c) 2010 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 the License "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 #ifndef __SYMBOLPROCESSUNIT_H__ |
|
18 #define __SYMBOLPROCESSUNIT_H__ |
|
19 #include <vector> |
|
20 #include <string> |
|
21 #include <iostream> |
|
22 #include <fstream> |
|
23 using namespace std; |
|
24 |
|
25 |
|
26 typedef vector<string> stringlist; |
|
27 |
|
28 class SymbolProcessUnit |
|
29 { |
|
30 public: |
|
31 virtual void ProcessExecutableFile(const string& aFile) = 0; |
|
32 virtual void ProcessDataFile(const string& afile) = 0; |
|
33 virtual void FlushStdOut(ostream& aOut) = 0; |
|
34 virtual void FlushSymbolContent(ostream &aOut) = 0; |
|
35 virtual void ResetContentLog() = 0; |
|
36 virtual ~SymbolProcessUnit() {} |
|
37 }; |
|
38 |
|
39 class CommenSymbolProcessUnit : public SymbolProcessUnit |
|
40 { |
|
41 public: |
|
42 virtual void ProcessExecutableFile(const string& aFile); |
|
43 virtual void ProcessDataFile(const string& afile); |
|
44 virtual void FlushStdOut(ostream& aOut); |
|
45 virtual void FlushSymbolContent(ostream &aOut); |
|
46 virtual void ResetContentLog(); |
|
47 private: |
|
48 void ProcessArmv5File( const string& fileName, ifstream& aMap ); |
|
49 void ProcessGcceOrArm4File( const string& fileName, ifstream& aMap ); |
|
50 int GetSizeFromBinFile( const string& fileName ); |
|
51 private: |
|
52 stringlist iStdoutLog; |
|
53 stringlist iSymbolContentLog; |
|
54 }; |
|
55 #endif |