* Added DetectBOM to TCSVDocument

This commit is contained in:
Michaël Van Canneyt 2022-02-07 16:30:06 +01:00
parent e5ac07db13
commit cb03124cc5

View File

@ -56,8 +56,12 @@ type
{$ENDIF}
// Random access to CSV document. Reads entire document into memory.
{ TCSVDocument }
TCSVDocument = class(TCSVHandler)
private
FDetectBOM: Boolean;
FRows: TFPObjectList;
FParser: TCSVParser;
FBuilder: TCSVBuilder;
@ -130,6 +134,9 @@ type
// Remove empty cells at end of rows from entire document
procedure RemoveTrailingEmptyCells;
// Detect bom
Property DetectBOM : Boolean Read FDetectBOM Write FDetectBOM;
// Properties
// Cell data at column ACol, row ARow.
@ -428,6 +435,7 @@ begin
FreeAndNil(FParser);
FParser:=TCSVParser.Create;
FParser.AssignCSVProperties(Self);
FParser.DetectBOM:=Self.DetectBOM;
with FParser do
begin
SetSource(AStream);