Changeset 13 for trunk/Packages
- Timestamp:
- Apr 2, 2016, 1:06:34 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/UXMLUtils.pas
r4 r13 12 12 function DateTimeToXMLTime(Value: TDateTime; ApplyLocalBias: Boolean = True): WideString; 13 13 procedure WriteInteger(Node: TDOMNode; Name: string; Value: Integer); 14 procedure WriteInt64(Node: TDOMNode; Name: string; Value: Int64); 14 15 procedure WriteBoolean(Node: TDOMNode; Name: string; Value: Boolean); 15 16 procedure WriteString(Node: TDOMNode; Name: string; Value: string); 16 17 procedure WriteDateTime(Node: TDOMNode; Name: string; Value: TDateTime); 17 18 function ReadInteger(Node: TDOMNode; Name: string; DefaultValue: Integer): Integer; 19 function ReadInt64(Node: TDOMNode; Name: string; DefaultValue: Int64): Int64; 18 20 function ReadBoolean(Node: TDOMNode; Name: string; DefaultValue: Boolean): Boolean; 19 21 function ReadString(Node: TDOMNode; Name: string; DefaultValue: string): string; … … 142 144 end; 143 145 146 procedure WriteInt64(Node: TDOMNode; Name: string; Value: Int64); 147 var 148 NewNode: TDOMNode; 149 begin 150 NewNode := Node.OwnerDocument.CreateElement(Name); 151 NewNode.TextContent := IntToStr(Value); 152 Node.AppendChild(NewNode); 153 end; 154 144 155 procedure WriteBoolean(Node: TDOMNode; Name: string; Value: Boolean); 145 156 var … … 170 181 171 182 function ReadInteger(Node: TDOMNode; Name: string; DefaultValue: Integer): Integer; 183 var 184 NewNode: TDOMNode; 185 begin 186 Result := DefaultValue; 187 NewNode := Node.FindNode(Name); 188 if Assigned(NewNode) then 189 Result := StrToInt(NewNode.TextContent); 190 end; 191 192 function ReadInt64(Node: TDOMNode; Name: string; DefaultValue: Int64): Int64; 172 193 var 173 194 NewNode: TDOMNode;
Note:
See TracChangeset
for help on using the changeset viewer.