Changeset 8 for trunk/Packages/Common
- Timestamp:
- Apr 13, 2026, 11:12:39 PM (2 weeks ago)
- File:
-
- 1 edited
-
trunk/Packages/Common/XML.pas (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/XML.pas
r7 r8 15 15 procedure WriteDateTime(Node: TDOMNode; Name: string; Value: TDateTime); 16 16 procedure WriteDouble(Node: TDOMNode; Name: string; Value: Double); 17 procedure WriteCurrency(Node: TDOMNode; Name: string; Value: Currency); 17 18 function ReadInteger(Node: TDOMNode; Name: string; DefaultValue: Integer): Integer; 18 19 function ReadInt64(Node: TDOMNode; Name: string; DefaultValue: Int64): Int64; … … 21 22 function ReadDateTime(Node: TDOMNode; Name: string; DefaultValue: TDateTime): TDateTime; 22 23 function ReadDouble(Node: TDOMNode; Name: string; DefaultValue: Double): Double; 24 function ReadCurrency(Node: TDOMNode; Name: string; DefaultValue: Currency): Currency; 23 25 procedure ReadXMLFileParser(out Doc: TXMLDocument; FileName: string); 24 26 … … 60 62 if Assigned(NewNode) then 61 63 Result := StrToFloat(string(NewNode.TextContent), XmlFormatSettings); 64 end; 65 66 function ReadCurrency(Node: TDOMNode; Name: string; DefaultValue: Currency 67 ): Currency; 68 var 69 NewNode: TDOMNode; 70 begin 71 Result := DefaultValue; 72 NewNode := Node.FindNode(DOMString(Name)); 73 if Assigned(NewNode) then 74 Result := StrToCurr(string(NewNode.TextContent), XmlFormatSettings); 62 75 end; 63 76 … … 247 260 end; 248 261 262 procedure WriteCurrency(Node: TDOMNode; Name: string; Value: Currency); 263 var 264 NewNode: TDOMNode; 265 begin 266 NewNode := Node.OwnerDocument.CreateElement(DOMString(Name)); 267 NewNode.TextContent := DOMString(CurrToStr(Value, XmlFormatSettings)); 268 Node.AppendChild(NewNode); 269 end; 270 249 271 function ReadInteger(Node: TDOMNode; Name: string; DefaultValue: Integer): Integer; 250 272 var
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/edc-stats/chrome/site/your_project_logo.png)