xref: /haiku/headers/private/debugger/model/SourceCode.h (revision faf79e7f783976326856422ff006b4c6ae9c3031)
1 /*
2  * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3  * Distributed under the terms of the MIT License.
4  */
5 #ifndef SOURCE_CODE_H
6 #define SOURCE_CODE_H
7 
8 
9 #include <Referenceable.h>
10 
11 #include "LineDataSource.h"
12 #include "TargetAddressRange.h"
13 
14 
15 class LocatableFile;
16 class SourceLanguage;
17 class SourceLocation;
18 class Statement;
19 
20 
21 class SourceCode : public LineDataSource {
22 public:
23 	virtual						~SourceCode();
24 
25 	// Locking needed for GetStatementLocationRange(), since that might use
26 	// mutable data.
27 	virtual	bool				Lock() = 0;
28 	virtual	void				Unlock() = 0;
29 
30 	virtual	SourceLanguage*		GetSourceLanguage() const = 0;
31 
32 	virtual	bool				GetStatementLocationRange(
33 									const SourceLocation& location,
34 									SourceLocation& _start,
35 									SourceLocation& _end) const = 0;
36 
37 	virtual	LocatableFile*		GetSourceFile() const = 0;
38 };
39 
40 
41 #endif	// SOURCE_CODE_H
42