X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fshared%2Fxparser.pas;h=76ac3c0165483ef90d4066904540d1eef5b7a2dd;hb=3f758d569aeb250474aece9c4051f05ad7362805;hp=3f1d1db5b462a6ed9fc69fa7ff8284029e2270b6;hpb=2b04301f4303668096c37c21e06af70930f55b7f;p=d2df-sdl.git diff --git a/src/shared/xparser.pas b/src/shared/xparser.pas index 3f1d1db..76ac3c0 100644 --- a/src/shared/xparser.pas +++ b/src/shared/xparser.pas @@ -182,6 +182,20 @@ type procedure flush (); override; end; + TStrTextWriter = class(TTextWriter) + private + mStr: AnsiString; + + protected + procedure putBuf (constref buf; len: SizeUInt); override; + + public + constructor Create (); + destructor Destroy (); override; + + property str: AnsiString read mStr; + end; + implementation @@ -732,4 +746,32 @@ begin end; +// ////////////////////////////////////////////////////////////////////////// // +constructor TStrTextWriter.Create (); +begin + mStr := ''; +end; + + +destructor TStrTextWriter.Destroy (); +begin + mStr := ''; + inherited; +end; + + +procedure TStrTextWriter.putBuf (constref buf; len: SizeUInt); +var + st: AnsiString = ''; +begin + if (len > 0) then + begin + SetLength(st, Integer(len)); + Move(buf, PChar(st)^, Integer(len)); + mStr += st; + st := ''; + end; +end; + + end.