fce4895d18
- Add subfolder src/kits/debugger which contains the debugger's core functionality and lower layers. Correspondingly add headers/private/debugger for shared headers to be used by clients such as the Debugger application and eventual remote_debug_server. Adjust various files to account for differences as a result of the split and moves. - Add libdebugger.so to minimal Jamfile.
48 lines
886 B
C++
48 lines
886 B
C++
/*
|
|
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef SOURCE_FILE_H
|
|
#define SOURCE_FILE_H
|
|
|
|
#include <Referenceable.h>
|
|
|
|
|
|
class SourceFile;
|
|
|
|
|
|
class SourceFileOwner {
|
|
public:
|
|
virtual ~SourceFileOwner();
|
|
|
|
virtual void SourceFileUnused(SourceFile* sourceFile) = 0;
|
|
virtual void SourceFileDeleted(SourceFile* sourceFile) = 0;
|
|
};
|
|
|
|
|
|
|
|
class SourceFile : public BReferenceable {
|
|
public:
|
|
SourceFile(SourceFileOwner* owner);
|
|
~SourceFile();
|
|
|
|
status_t Init(const char* path);
|
|
|
|
int32 CountLines() const;
|
|
const char* LineAt(int32 index) const;
|
|
int32 LineLengthAt(int32 index) const;
|
|
|
|
protected:
|
|
virtual void LastReferenceReleased();
|
|
|
|
private:
|
|
SourceFileOwner* fOwner;
|
|
char* fFileContent;
|
|
int32* fLineOffsets;
|
|
int32 fLineCount;
|
|
};
|
|
|
|
|
|
|
|
#endif // SOURCE_FILE_H
|