fast-html-parser icon indicating copy to clipboard operation
fast-html-parser copied to clipboard

'const' string params

Open Alexey-T opened this issue 5 years ago • 1 comments

add 'const' for str params in all funcs where S is not changed.


function IsTag(TagType: string; Tag: string): boolean;
function IsCloseTag(TagType: string; Tag: string): boolean;
function Substr(sub, s: string): boolean;
function StripTabs(s: string): string;
function ReturnsToSpaces(s: string): string;
function LessenSpaces(s: string): string;
function CleanHtm1(s: string): string;

Alexey-T avatar Sep 18 '20 12:09 Alexey-T

here too

    procedure NilOnFoundTag(NoCaseTag, ActualTag: string);
    procedure NilOnFoundText(Text: string);
    procedure ElementOnFoundTag(NoCaseTag, ActualTag: string);
    procedure ElementOnFoundText(Text: string);
  public
    UseTagTextArray: boolean;
    OnFoundTag: TOnFoundTag;
    OnFoundText: TOnFoundText;
    OnFoundTagP: TOnFoundTagP;
    OnFoundTextP: TOnFoundTextP;
    Raw: Pchar;
    constructor Create(sRaw: string);overload;
    constructor Create(pRaw: PChar);overload;
    procedure Exec;
    function GetElementByName(name: string; var Tag: string; var TagEnd: string): string;
    function GetElementById(id: string; var Tag: string; var TagEnd: string): string;

Alexey-T avatar Sep 18 '20 12:09 Alexey-T