Interface ILeakReport

Unit

Declaration

type ILeakReport = interface(IInterface)

Description

<sumary> This class aims to interpret the memory leak trace file and produce a simpler report summarizing enough information to locate the problem at its source. )

Attributes
GUID['{A6E7FB5F-E747-4D5C-B98E-DEFE441E95A4}']

Hierarchy

Overview

Methods

Public procedure SetCommandBuilder(ABuilder: ICommandBuilder);
Public function AddItem(AItem: ILeakItem): ILeakItem;
Public procedure CreateLeakItem(AContent: TStringList; AStart: Integer);
Public function GetNextStringOf(const AText, AField: string): string;
Public function AddRelativePath(const AFile: string): string;
Public procedure Output;
Public function ParseHeapTrace(const AContent: string): ILeakReport;
Public function GetExecutable: string;
Public procedure SetExecutable(const AValue: string);
Public function GetProjectSource: string;
Public procedure SetProjectSource(const AValue: string);
Public function GetLeakData: TArray<ILeakItem>;

Properties

Public property Executable: string read GetExecutable write SetExecutable;
Public property ProjectSource: string read GetProjectSource write SetProjectSource;
Public property LeakData: TArray<ILeakItem> read GetLeakData;

Description

Methods

Public procedure SetCommandBuilder(ABuilder: ICommandBuilder);

Set the command builder used to produce the report

Public function AddItem(AItem: ILeakItem): ILeakItem;

Adds a new memory leak item to the report.

Public procedure CreateLeakItem(AContent: TStringList; AStart: Integer);

Scans the contents of the AContent variable to summarize the details of a memory leak reported in the trace file. If a memory leak is found then it added to the report calling AddItem method.

Public function GetNextStringOf(const AText, AField: string): string;

Considering the content of AText, it searches for the string AField, if successful, returns the value immediately to the right of that string. The returned value will be limited until it finds the next space or the end of the string.

Public function AddRelativePath(const AFile: string): string;

Given a filename, try to locate it recursively in the projects folder, then in the current directory. If the file is found, the relative path will be added to the file name.

Public procedure Output;

Prints a report using ICommandBuilder's Output Callback. This report will have data regarding possible memory leaks like size, source method and source code file with line number. If no leak was found, it will display a message indicating the same.

Public function ParseHeapTrace(const AContent: string): ILeakReport;

Parses the contents of the trace file generated by the HeapTrace unit. Groups the information into a TLeakItem list.

Parameters
AContent
Accepts the contents of the memory leak trace file. If an empty string is passed, the method will try to locate the heap.trc file in the test project's executable directory.
Public function GetExecutable: string;

This item has no description.

Public procedure SetExecutable(const AValue: string);

This item has no description.

Public function GetProjectSource: string;

This item has no description.

Public procedure SetProjectSource(const AValue: string);

This item has no description.

Public function GetLeakData: TArray<ILeakItem>;

This item has no description.

Properties

Public property Executable: string read GetExecutable write SetExecutable;

Test project excutable name.

Public property ProjectSource: string read GetProjectSource write SetProjectSource;

Path to test project source files

Public property LeakData: TArray<ILeakItem> read GetLeakData;

Array of TLeakItem that is generated after calling ParseHeapTrace method.


Generated by PasDoc 1.0.4.