RxFPC:fix compile ex_rx_xml_datapacket

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@9097 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
alexs75
2023-12-20 11:12:58 +00:00
parent 9de5afb44e
commit 5a28aec6af

View File

@ -91,59 +91,63 @@ implementation
uses xmlwrite, xmlread, rxdconst; uses xmlwrite, xmlread, rxdconst;
const function XMLFieldTypeNamesStr(AFieldType:TFieldType):string;
XMLFieldtypenames : Array [TFieldType] of String[15] = begin
( case AFieldType of
'Unknown', //ftUnknown ftUnknown:Result:='';
'string', //ftString, ftString:Result:='string';
'i2', //ftSmallint, ftSmallint:Result:='i2';
'i4', //ftInteger, ftInteger:Result:='i4';
'i4', //ftWord, ftWord:Result:='i4';
'boolean', //ftBoolean, ftBoolean:Result:='boolean';
'r8', //ftFloat, ftFloat:Result:='r8';
'r8', //ftCurrency, ftCurrency:Result:='r8';
'fixed', //ftBCD, ftBCD:Result:='fixed';
'date', //ftDate, ftDate:Result:='date';
'time', //ftTime, ftTime:Result:='time';
'datetime', //ftDateTime, ftDateTime:Result:='datetime';
'bin.hex', //ftBytes, ftBytes:Result:='bin.hex';
'bin.hex', //ftVarBytes, ftVarBytes:Result:='bin.hex';
'i4', //ftAutoInc, ftAutoInc:Result:='i4';
'bin.hex', //ftBlob, ftBlob:Result:='bin.hex';
'bin.hex', //ftMemo, ftMemo:Result:='bin.hex';
'bin.hex', //ftGraphic, ftGraphic:Result:='bin.hex';
'bin.hex', //ftFmtMemo, ftFmtMemo:Result:='bin.hex';
'bin.hex', //ftParadoxOle, ftParadoxOle:Result:='bin.hex';
'bin.hex', //ftDBaseOle, ftDBaseOle:Result:='bin.hex';
'bin.hex', //ftTypedBinary, ftTypedBinary:Result:='bin.hex';
'', //ftCursor, //ftCursor,
'string', //ftFixedChar, ftFixedChar:Result:='string';
'string', //ftWideString, ftWideString:Result:='string';
'i8', //ftLargeint, ftLargeint:Result:='i8';
'', //ftADT, //ftADT,
'', //ftArray, //ftArray,
'', //ftReference, //ftReference,
'', //ftDataSet, //ftDataSet,
'', //ftOraBlob, //ftOraBlob,
'', //ftOraClob, //ftOraClob,
'', //ftVariant, //ftVariant,
'', //ftInterface, //ftInterface,
'', //ftIDispatch, //ftIDispatch,
'', //ftGuid, //ftGuid,
'', //ftTimeStamp, //ftTimeStamp,
'', //ftFMTBcd, //ftFMTBcd,
'', //ftFixedWideChar, //ftFixedWideChar,
'', //ftWideMemo, //ftWideMemo,
//ftOraTimeStamp,
//ftOraInterval,
{$IFDEF RX_USE_DELPHI_EXT_FIELD_TYPES} {$IFDEF RX_USE_DELPHI_EXT_FIELD_TYPES}
'' //ftOraTimeStamp, //ftLongWord,
, '' //ftOraInterval, //ftShortint,
, '' //ftLongWord, //ftByte,
, '' //ftShortint, //ftExtended,
, '' //ftByte, //ftSingle
, '' //ftExtended, {$ENDIF}
, '' //ftSingle else
{$ENDIF} Result:='';
); end;
end;
{ TXMLRxDatapacketReader } { TXMLRxDatapacketReader }
@ -206,7 +210,7 @@ begin
AFieldDef.DataType:=ftUnknown; AFieldDef.DataType:=ftUnknown;
for iFieldType:=low(TFieldType) to high(TFieldType) do for iFieldType:=low(TFieldType) to high(TFieldType) do
if SameText(XMLFieldtypenames[iFieldType],FTString) then if SameText(XMLFieldTypeNamesStr(iFieldType),FTString) then
begin begin
AFieldDef.DataType:=iFieldType; AFieldDef.DataType:=iFieldType;
break; break;
@ -242,7 +246,7 @@ begin
if Name <> '' then AFieldNode.SetAttribute('fieldname',Name); if Name <> '' then AFieldNode.SetAttribute('fieldname',Name);
AFieldNode.SetAttribute('attrname',DisplayName); AFieldNode.SetAttribute('attrname',DisplayName);
if size <> 0 then AFieldNode.SetAttribute('width',IntToStr(Size)); if size <> 0 then AFieldNode.SetAttribute('width',IntToStr(Size));
AFieldNode.SetAttribute('fieldtype',XMLFieldtypenames[DataType]); AFieldNode.SetAttribute('fieldtype',XMLFieldTypeNamesStr(DataType));
case DataType of case DataType of
ftAutoInc : begin ftAutoInc : begin
AFieldNode.SetAttribute('readonly','true'); AFieldNode.SetAttribute('readonly','true');