From 58a6886ed3128dcb3c219fb776c16f14d6e710b5 Mon Sep 17 00:00:00 2001 From: michael Date: Mon, 21 Jan 2013 10:52:38 +0000 Subject: [PATCH] * Allow to set the write buffer size (enlarged to 4k) git-svn-id: trunk@23468 - --- packages/fcl-xml/src/htmwrite.pp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/fcl-xml/src/htmwrite.pp b/packages/fcl-xml/src/htmwrite.pp index 0000f381de..30366c3aa8 100644 --- a/packages/fcl-xml/src/htmwrite.pp +++ b/packages/fcl-xml/src/htmwrite.pp @@ -72,7 +72,7 @@ type procedure VisitDocumentType(Node: TDOMNode); procedure VisitPI(Node: TDOMNode); public - constructor Create(AStream: TStream); + constructor Create(AStream: TStream; ACapacity : Cardinal = 4096); destructor Destroy; override; end; @@ -111,14 +111,14 @@ end; THTMLWriter ---------------------------------------------------------------------} -constructor THTMLWriter.Create(AStream: TStream); +constructor THTMLWriter.Create(AStream: TStream; ACapacity : Cardinal = 4096); begin inherited Create; FStream := AStream; // some overhead - always be able to write at least one extra UCS4 - FBuffer := AllocMem(512+32); + FCapacity := ACapacity; + FBuffer := AllocMem(FCapacity+32); FBufPos := FBuffer; - FCapacity := 512; // Later on, this may be put under user control // for now, take OS setting FLineBreak := sLineBreak;