|
1 /* |
|
2 * Copyright (c) 1997-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 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 |
|
18 |
|
19 #if !defined(__FILELINE_H__) |
|
20 #define __FILELINE_H__ |
|
21 #if !defined(__ASTRING_H__) |
|
22 #include "ASTRING.H" |
|
23 #endif |
|
24 |
|
25 #ifdef __VC32__ |
|
26 #pragma warning( disable : 4786 ) // identifier truncated in debugging information. |
|
27 #pragma warning( push, 1 ) // MS STL libraries do not compile cleanly, temporarily set warning level to 1 |
|
28 #pragma warning( disable : 4710 ) // function not inlined. |
|
29 #endif |
|
30 #include <set> |
|
31 #ifdef __VC32__ |
|
32 #pragma warning( pop ) |
|
33 #endif |
|
34 |
|
35 class FileLineManager |
|
36 { |
|
37 public: |
|
38 FileLineManager(); |
|
39 virtual ~FileLineManager(); |
|
40 void SetBase(const String& aFileName,int aLineNumber); |
|
41 void SetPath(const String& aDriveAndDirectory); |
|
42 void SetInclude(const String& aNameText,int aLineNumber); |
|
43 void PostInclude(char* aNameText,char* aRealLineNumber,int aLineNumber); |
|
44 int GetErrorLine(int aCurrentLineNumber) const; |
|
45 const String* GetCurrentFile() const; |
|
46 |
|
47 private: |
|
48 void SetCurrentFile(const String&); |
|
49 String ExtractFileName(const String& aText); |
|
50 |
|
51 private: |
|
52 const String* iCurrentFileName; |
|
53 const String* iBaseFileName; |
|
54 int iOffsetLineNumber; // Line number of line in preprocessed file corresponding to # line for CurrentFileName. |
|
55 String iBasePath; |
|
56 // All filenames that have ever been seen. |
|
57 std::set<String, StringLess> iAllFileNames; |
|
58 }; |
|
59 |
|
60 #endif //__FILELINE_H__ |