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