mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 04:29:29 +02:00
* boolean for decodestringbase64 to select strict mode.
git-svn-id: trunk@22713 -
This commit is contained in:
parent
65c657006c
commit
7263b3c5a4
@ -87,7 +87,7 @@ type
|
||||
end;
|
||||
|
||||
function EncodeStringBase64(const s:string):String;
|
||||
function DecodeStringBase64(const s:string):String;
|
||||
function DecodeStringBase64(const s:string;strict:boolean=false):String;
|
||||
|
||||
implementation
|
||||
|
||||
@ -417,7 +417,7 @@ begin
|
||||
raise EStreamError.Create('Invalid stream operation');
|
||||
end;
|
||||
|
||||
function DecodeStringBase64(const s:string):String;
|
||||
function DecodeStringBase64(const s:string;strict:boolean=false):String;
|
||||
|
||||
var
|
||||
Instream,
|
||||
@ -428,7 +428,10 @@ begin
|
||||
try
|
||||
Outstream:=TStringStream.Create('');
|
||||
try
|
||||
Decoder:=TBase64DecodingStream.Create(Instream,bdmMIME);
|
||||
if strict then
|
||||
Decoder:=TBase64DecodingStream.Create(Instream,bdmStrict)
|
||||
else
|
||||
Decoder:=TBase64DecodingStream.Create(Instream,bdmMIME);
|
||||
try
|
||||
Outstream.CopyFrom(Decoder,Decoder.Size);
|
||||
Result:=Outstream.DataString;
|
||||
|
Loading…
Reference in New Issue
Block a user