@@ -68,8 +68,6 @@ TCodeImporter = class(TNoPublicConstructObject)
68
68
strict private
69
69
// / <summary>Version of file being imported.</summary>
70
70
fVersion: Integer;
71
- // / <summary>Information about user who created export.</summary>
72
- fUserInfo: TUserInfo;
73
71
// / <summary>List of snippets read from XML.</summary>
74
72
fSnippetInfo: TSnippetInfoList;
75
73
// / <summary>Extended XML document object.</summary>
@@ -91,14 +89,12 @@ TCodeImporter = class(TNoPublicConstructObject)
91
89
public
92
90
// / <summary>Destroys object.</summary>
93
91
destructor Destroy; override;
94
- // / <summary>Imports snippets and optional user data from XML.</summary>
95
- // / <param name="UserInfo">TUserInfo [out] Receives user information. Set
96
- // / to null if no user information was available.</param>
92
+ // / <summary>Imports snippets from XML.</summary>
97
93
// / <param name="SnippetInfo">TSnippetInfoList [out] Receives information
98
94
// / about each imported snippet.</param>
99
95
// / <param name="Data">TBytes [in] Byte array containing XML data.</param>
100
- class procedure ImportData (out UserInfo: TUserInfo ;
101
- out SnippetInfo: TSnippetInfoList; const Data: TBytes);
96
+ class procedure ImportData (out SnippetInfo: TSnippetInfoList ;
97
+ const Data: TBytes);
102
98
end ;
103
99
104
100
type
@@ -469,7 +465,6 @@ procedure TCodeImporter.Execute(const Data: TBytes);
469
465
// Error message
470
466
sParseError = ' Import file has an invalid format' ;
471
467
var
472
- UserNode: IXMLNode; // node containing any user info
473
468
SnippetNodes: IXMLSimpleNodeList; // list of snippet nodes
474
469
SnippetNode: IXMLNode; // each snippet node in list
475
470
Idx: Integer; // loops thru snippet node list
@@ -482,21 +477,6 @@ procedure TCodeImporter.Execute(const Data: TBytes);
482
477
// Validate loaded document and get version number
483
478
fVersion := ValidateDoc;
484
479
485
- // Get user info
486
- UserNode := fXMLDoc.FindNode(cExportRootNode + ' \' + cUserInfoNode);
487
- if Assigned(UserNode) then
488
- begin
489
- fUserInfo.Details.Name := TXMLDocHelper.GetSubTagText(
490
- fXMLDoc, UserNode, cUserNameNode
491
- );
492
- fUserInfo.Details.Email := TXMLDocHelper.GetSubTagText(
493
- fXMLDoc, UserNode, cUserEmailNode
494
- );
495
- fUserInfo.Comments := TXMLDocHelper.GetSubTagText(
496
- fXMLDoc, UserNode, cUserCommentsNode
497
- );
498
- end ;
499
-
500
480
// Read in all snippets
501
481
SnippetNodes := GetAllSnippetNodes;
502
482
SetLength(fSnippetInfo, SnippetNodes.Count);
@@ -574,15 +554,14 @@ function TCodeImporter.GetAllSnippetNodes: IXMLSimpleNodeList;
574
554
Result := fXMLDoc.FindChildNodes(SnippetsNode, cSnippetNode);
575
555
end ;
576
556
577
- class procedure TCodeImporter.ImportData (out UserInfo: TUserInfo ;
578
- out SnippetInfo: TSnippetInfoList; const Data: TBytes);
557
+ class procedure TCodeImporter.ImportData (out SnippetInfo: TSnippetInfoList ;
558
+ const Data: TBytes);
579
559
var
580
560
Idx: Integer; // loops through all imported snippets
581
561
begin
582
562
with InternalCreate do
583
563
try
584
564
Execute(Data);
585
- UserInfo.Assign(fUserInfo);
586
565
SetLength(SnippetInfo, Length(fSnippetInfo));
587
566
for Idx := Low(fSnippetInfo) to High(fSnippetInfo) do
588
567
SnippetInfo[Idx].Assign(fSnippetInfo[Idx]);
@@ -599,7 +578,6 @@ constructor TCodeImporter.InternalCreate;
599
578
fXMLDoc := TXMLDocHelper.CreateXMLDoc;
600
579
// Initialise fields that receive imported data
601
580
SetLength(fSnippetInfo, 0 );
602
- fUserInfo.Init;
603
581
end ;
604
582
605
583
function TCodeImporter.ValidateDoc : Integer;
0 commit comments