mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 16:09:23 +02:00
* Patch from Bart Broersma to implement Int64 support in xmlreg (bug ID 35227)
git-svn-id: trunk@41810 -
This commit is contained in:
parent
848a563128
commit
17aa8da99f
@ -10,7 +10,7 @@ uses
|
||||
|
||||
Type
|
||||
|
||||
TDataType = (dtUnknown,dtDWORD,dtString,dtBinary,dtStrings);
|
||||
TDataType = (dtUnknown,dtDWORD,dtString,dtBinary,dtStrings,dtQWord);
|
||||
TDataInfo = record
|
||||
DataType : TDataType;
|
||||
DataSize : Integer;
|
||||
@ -306,6 +306,7 @@ Var
|
||||
U : UnicodeString;
|
||||
HasData: Boolean;
|
||||
D : DWord;
|
||||
Q : QWord;
|
||||
|
||||
begin
|
||||
//writeln('TXmlRegistry.DoGetValueData: Name=',Name,' IsUnicode=',IsUnicode);
|
||||
@ -332,6 +333,12 @@ begin
|
||||
if Result then
|
||||
PCardinal(@Data)^:=D;
|
||||
end;
|
||||
dtQWORD : begin // DataNode is required
|
||||
NS:=SizeOf(QWORD);
|
||||
Result:=HasData and TryStrToQWord(String(DataNode.NodeValue),Q) and (DataSize>=NS);
|
||||
if Result then
|
||||
PUInt64(@Data)^:=Q;
|
||||
end;
|
||||
dtString : // DataNode is optional
|
||||
if HasData then
|
||||
begin
|
||||
@ -396,6 +403,7 @@ begin
|
||||
|
||||
Case DataType of
|
||||
dtDWORD : SW:=UnicodeString(IntToStr(PCardinal(@Data)^));
|
||||
dtQWORD : SW:=UnicodeString(IntToStr(PUInt64(@Data)^));
|
||||
dtString : begin
|
||||
if IsUnicode then
|
||||
SW:=UnicodeString(PUnicodeChar(@Data))
|
||||
|
@ -20,6 +20,7 @@ begin
|
||||
rdInteger : Result := dtDword;
|
||||
rdBinary : Result := dtBinary;
|
||||
rdMultiString : Result := dtStrings;
|
||||
rdInt64 : Result := dtQword;
|
||||
else
|
||||
Raise ERegistryException.CreateFmt(SErrTypeNotSupported,[GetEnumName(TypeInfo(TRegDataType),Ord(RegData))]);
|
||||
end;
|
||||
@ -31,6 +32,7 @@ begin
|
||||
Case DataType of
|
||||
dtUnknown: Result:=rdUnknown;
|
||||
dtDword : Result:=rdInteger;
|
||||
dtQword : Result:=rdInt64;
|
||||
dtString : Result:=rdString;
|
||||
dtBinary : Result:=rdBinary;
|
||||
dtStrings : Result:=rdMultiString;
|
||||
|
Loading…
Reference in New Issue
Block a user