mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 15:09:19 +02:00
* Implement flushbuffer abstract method in TFiler (bug ID 33062)
git-svn-id: trunk@38655 -
This commit is contained in:
parent
ab606d3c8d
commit
a137486439
@ -1135,6 +1135,7 @@ type
|
|||||||
procedure DefineBinaryProperty(const Name: string;
|
procedure DefineBinaryProperty(const Name: string;
|
||||||
ReadData, WriteData: TStreamProc;
|
ReadData, WriteData: TStreamProc;
|
||||||
HasData: Boolean); virtual; abstract;
|
HasData: Boolean); virtual; abstract;
|
||||||
|
Procedure FlushBuffer; virtual; abstract;
|
||||||
property Root: TComponent read FRoot write SetRoot;
|
property Root: TComponent read FRoot write SetRoot;
|
||||||
property LookupRoot: TComponent read FLookupRoot;
|
property LookupRoot: TComponent read FLookupRoot;
|
||||||
property Ancestor: TPersistent read FAncestor write FAncestor;
|
property Ancestor: TPersistent read FAncestor write FAncestor;
|
||||||
@ -1149,8 +1150,11 @@ type
|
|||||||
|
|
||||||
{ TReader }
|
{ TReader }
|
||||||
|
|
||||||
|
{ TAbstractObjectReader }
|
||||||
|
|
||||||
TAbstractObjectReader = class
|
TAbstractObjectReader = class
|
||||||
public
|
public
|
||||||
|
Procedure FlushBuffer; virtual;
|
||||||
function NextValue: TValueType; virtual; abstract;
|
function NextValue: TValueType; virtual; abstract;
|
||||||
function ReadValue: TValueType; virtual; abstract;
|
function ReadValue: TValueType; virtual; abstract;
|
||||||
procedure BeginRootComponent; virtual; abstract;
|
procedure BeginRootComponent; virtual; abstract;
|
||||||
@ -1204,7 +1208,6 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create(Stream: TStream; BufSize: Integer);
|
constructor Create(Stream: TStream; BufSize: Integer);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
|
||||||
function NextValue: TValueType; override;
|
function NextValue: TValueType; override;
|
||||||
function ReadValue: TValueType; override;
|
function ReadValue: TValueType; override;
|
||||||
procedure BeginRootComponent; override;
|
procedure BeginRootComponent; override;
|
||||||
@ -1298,6 +1301,7 @@ type
|
|||||||
public
|
public
|
||||||
constructor Create(Stream: TStream; BufSize: Integer);
|
constructor Create(Stream: TStream; BufSize: Integer);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
|
Procedure FlushBuffer; override;
|
||||||
procedure BeginReferences;
|
procedure BeginReferences;
|
||||||
procedure CheckValue(Value: TValueType);
|
procedure CheckValue(Value: TValueType);
|
||||||
procedure DefineProperty(const Name: string;
|
procedure DefineProperty(const Name: string;
|
||||||
@ -1360,6 +1364,8 @@ type
|
|||||||
|
|
||||||
{ TWriter }
|
{ TWriter }
|
||||||
|
|
||||||
|
{ TAbstractObjectWriter }
|
||||||
|
|
||||||
TAbstractObjectWriter = class
|
TAbstractObjectWriter = class
|
||||||
public
|
public
|
||||||
{ Begin/End markers. Those ones who don't have an end indicator, use
|
{ Begin/End markers. Those ones who don't have an end indicator, use
|
||||||
@ -1374,6 +1380,7 @@ type
|
|||||||
procedure EndList; virtual; abstract;
|
procedure EndList; virtual; abstract;
|
||||||
procedure BeginProperty(const PropName: String); virtual; abstract;
|
procedure BeginProperty(const PropName: String); virtual; abstract;
|
||||||
procedure EndProperty; virtual; abstract;
|
procedure EndProperty; virtual; abstract;
|
||||||
|
Procedure FlushBuffer; virtual;
|
||||||
//Please don't use write, better use WriteBinary whenever possible
|
//Please don't use write, better use WriteBinary whenever possible
|
||||||
procedure Write(const Buffer; Count: Longint); virtual;abstract;
|
procedure Write(const Buffer; Count: Longint); virtual;abstract;
|
||||||
|
|
||||||
@ -1412,13 +1419,12 @@ type
|
|||||||
{$ifndef FPUNONE}
|
{$ifndef FPUNONE}
|
||||||
procedure WriteExtended(e : extended); {$ifdef CLASSESINLINE}inline;{$endif CLASSESINLINE}
|
procedure WriteExtended(e : extended); {$ifdef CLASSESINLINE}inline;{$endif CLASSESINLINE}
|
||||||
{$endif}
|
{$endif}
|
||||||
procedure FlushBuffer;
|
|
||||||
procedure WriteValue(Value: TValueType);
|
procedure WriteValue(Value: TValueType);
|
||||||
public
|
public
|
||||||
constructor Create(Stream: TStream; BufSize: Integer);
|
constructor Create(Stream: TStream; BufSize: Integer);
|
||||||
destructor Destroy; override;
|
destructor Destroy; override;
|
||||||
procedure WriteSignature; override;
|
procedure WriteSignature; override;
|
||||||
|
procedure FlushBuffer; override;
|
||||||
procedure BeginCollection; override;
|
procedure BeginCollection; override;
|
||||||
procedure BeginComponent(Component: TComponent; Flags: TFilerFlags;
|
procedure BeginComponent(Component: TComponent; Flags: TFilerFlags;
|
||||||
ChildPos: Integer); override;
|
ChildPos: Integer); override;
|
||||||
|
@ -617,6 +617,11 @@ begin
|
|||||||
inherited Destroy;
|
inherited Destroy;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure TReader.FlushBuffer;
|
||||||
|
begin
|
||||||
|
Driver.FlushBuffer;
|
||||||
|
end;
|
||||||
|
|
||||||
function TReader.CreateDriver(Stream: TStream; BufSize: Integer): TAbstractObjectReader;
|
function TReader.CreateDriver(Stream: TStream; BufSize: Integer): TAbstractObjectReader;
|
||||||
begin
|
begin
|
||||||
Result := TBinaryObjectReader.Create(Stream, BufSize);
|
Result := TBinaryObjectReader.Create(Stream, BufSize);
|
||||||
@ -1758,3 +1763,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
{ TAbstractObjectReader }
|
||||||
|
|
||||||
|
procedure TAbstractObjectReader.FlushBuffer;
|
||||||
|
begin
|
||||||
|
// Do nothing
|
||||||
|
end;
|
||||||
|
|
||||||
|
@ -1288,3 +1288,10 @@ begin
|
|||||||
Driver.WriteUnicodeString(Value);
|
Driver.WriteUnicodeString(Value);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ TAbstractObjectWriter }
|
||||||
|
|
||||||
|
procedure TAbstractObjectWriter.FlushBuffer;
|
||||||
|
begin
|
||||||
|
// Do nothing
|
||||||
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user