lazutils: compwriter virtual methiods

git-svn-id: trunk@60630 -
This commit is contained in:
mattias 2019-03-09 12:12:41 +00:00
parent aab3418c8c
commit 59f5c68e94

View File

@ -120,47 +120,48 @@ type
FSignatureBegin: String;
FSignatureEnd: String;
FStream: TStream;
procedure AddToAncestorList(Component: TComponent);
procedure DetermineAncestor(Component: TComponent);
procedure SetNeededUnits(const AValue: TStrings);
procedure SetRoot(const AValue: TComponent);
procedure WriteComponentData(Instance: TComponent);
procedure WriteChildren(Component: TComponent; Step: TCWPChildrenStep);
procedure WriteProperty(Instance: TPersistent; PropInfo: PPropInfo);
procedure WriteProperties(Instance: TPersistent);
procedure WriteDefineProperties(Instance: TPersistent);
procedure WriteCollection(PropName: string; Collection: TCollection);
function ShortenFloat(s: string): string;
protected
procedure AddToAncestorList(Component: TComponent); virtual;
procedure DetermineAncestor(Component: TComponent); virtual;
procedure SetNeededUnits(const AValue: TStrings); virtual;
procedure SetRoot(const AValue: TComponent); virtual;
procedure WriteComponentData(Instance: TComponent); virtual;
procedure WriteChildren(Component: TComponent; Step: TCWPChildrenStep); virtual;
procedure WriteProperty(Instance: TPersistent; PropInfo: PPropInfo); virtual;
procedure WriteProperties(Instance: TPersistent); virtual;
procedure WriteDefineProperties(Instance: TPersistent); virtual;
procedure WriteCollection(PropName: string; Collection: TCollection); virtual;
function ShortenFloat(s: string): string; virtual;
public
constructor Create(AStream: TStream);
constructor Create(AStream: TStream); virtual;
destructor Destroy; override;
// stream a component:
procedure WriteDescendant(ARoot: TComponent; AAncestor: TComponent = nil);
procedure WriteDescendant(ARoot: TComponent; AnAncestor: TComponent = nil); virtual;
// utility functions:
procedure WriteComponentCreate(Component: TComponent);
procedure WriteComponent(Component: TComponent);
procedure WriteIndent;
procedure Write(const s: string);
procedure WriteLn;
procedure WriteStatement(const s: string);
procedure WriteAssign(const LHS, RHS: string);
procedure WriteWithDo(const Expr: string);
procedure WriteWithEnd;
function GetComponentPath(Component: TComponent): string;
function GetBoolLiteral(b: boolean): string;
function GetCharLiteral(c: integer): string;
function GetWideCharLiteral(c: integer): string;
function GetStringLiteral(const s: string): string;
function GetWStringLiteral(p: PWideChar; Count: integer): string;
function GetFloatLiteral(const e: Extended): string;
function GetCurrencyLiteral(const c: currency): string;
procedure WriteComponentCreate(Component: TComponent); virtual;
procedure WriteComponent(Component: TComponent); virtual;
procedure WriteIndent; virtual;
procedure Write(const s: string); virtual;
procedure WriteLn; virtual;
procedure WriteStatement(const s: string); virtual;
procedure WriteAssign(const LHS, RHS: string); virtual;
procedure WriteWithDo(const Expr: string); virtual;
procedure WriteWithEnd; virtual;
function GetComponentPath(Component: TComponent): string; virtual;
function GetBoolLiteral(b: boolean): string; virtual;
function GetCharLiteral(c: integer): string; virtual;
function GetWideCharLiteral(c: integer): string; virtual;
function GetStringLiteral(const s: string): string; virtual;
function GetWStringLiteral(p: PWideChar; Count: integer): string; virtual;
function GetFloatLiteral(const e: Extended): string; virtual;
function GetCurrencyLiteral(const c: currency): string; virtual;
function GetEnumExpr(TypeInfo: PTypeInfo; Value: integer;
AllowOutOfRange: boolean): string;
function GetVersionStatement: string;
function CreatedByAncestor(Component: TComponent): boolean;
procedure AddNeededUnit(const AnUnitName: string);
procedure Indent;
procedure Unindent;
AllowOutOfRange: boolean): string; virtual;
function GetVersionStatement: string; virtual;
function CreatedByAncestor(Component: TComponent): boolean; virtual;
procedure AddNeededUnit(const AnUnitName: string); virtual;
procedure Indent; virtual;
procedure Unindent; virtual;
property Stream: TStream read FStream;
property Root: TComponent read FRoot write SetRoot;
property LookupRoot: TComponent read FLookupRoot;
@ -1513,11 +1514,11 @@ begin
end;
end;
procedure TCompWriterPas.WriteDescendant(ARoot: TComponent; AAncestor: TComponent);
procedure TCompWriterPas.WriteDescendant(ARoot: TComponent; AnAncestor: TComponent);
begin
FRoot := ARoot;
FAncestor := AAncestor;
FRootAncestor := AAncestor;
FAncestor := AnAncestor;
FRootAncestor := AnAncestor;
FLookupRoot := ARoot;
FNeedAccessClass := false;
if not (cwpoNoSignature in Options) then