Make UEFI boot-platform build again
[haiku.git] / headers / private / debugger / files / SourceFile.h
blob45052901973e0b7304d50b43ad4963f15f2f0327
1 /*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef SOURCE_FILE_H
6 #define SOURCE_FILE_H
8 #include <Referenceable.h>
11 class SourceFile;
14 class SourceFileOwner {
15 public:
16 virtual ~SourceFileOwner();
18 virtual void SourceFileUnused(SourceFile* sourceFile) = 0;
19 virtual void SourceFileDeleted(SourceFile* sourceFile) = 0;
24 class SourceFile : public BReferenceable {
25 public:
26 SourceFile(SourceFileOwner* owner);
27 ~SourceFile();
29 status_t Init(const char* path);
31 int32 CountLines() const;
32 const char* LineAt(int32 index) const;
33 int32 LineLengthAt(int32 index) const;
35 protected:
36 virtual void LastReferenceReleased();
38 private:
39 SourceFileOwner* fOwner;
40 char* fFileContent;
41 int32* fLineOffsets;
42 int32 fLineCount;
47 #endif // SOURCE_FILE_H