btrfs: [] on the end of a struct field is a variable length array.
[haiku.git] / headers / private / debugger / model / FileSourceCode.h
blob42f661081b4012b231d082e644272f33600dc8bb
1 /*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef FILE_SOURCE_CODE_H
6 #define FILE_SOURCE_CODE_H
9 #include <Locker.h>
11 #include <Array.h>
13 #include "SourceCode.h"
16 class LocatableFile;
17 class SourceFile;
20 class FileSourceCode : public SourceCode {
21 public:
22 FileSourceCode(LocatableFile* file,
23 SourceFile* sourceFile,
24 SourceLanguage* language);
25 virtual ~FileSourceCode();
27 status_t Init();
28 status_t AddSourceLocation(
29 const SourceLocation& location);
31 virtual bool Lock();
32 virtual void Unlock();
34 virtual SourceLanguage* GetSourceLanguage() const;
36 virtual bool GetStatementLocationRange(
37 const SourceLocation& location,
38 SourceLocation& _start,
39 SourceLocation& _end) const;
41 virtual LocatableFile* GetSourceFile() const;
43 // LineDataSource
44 virtual int32 CountLines() const;
45 virtual const char* LineAt(int32 index) const;
46 virtual int32 LineLengthAt(int32 index) const;
48 private:
49 int32 _FindSourceLocationIndex(
50 const SourceLocation& location,
51 bool& _foundMatch) const;
53 private:
54 BLocker fLock;
55 LocatableFile* fFile;
56 SourceFile* fSourceFile;
57 SourceLanguage* fLanguage;
58 Array<SourceLocation> fSourceLocations;
62 #endif // FILE_BASED_SOURCE_CODE_H