LoadFromFile(FileName: String);
FileName - a file that contains a list of the repository objects that are checked and their checksums.
The LoadFromFile method loads from the file and verifies checksums of repository objects.
Executing the example requires the control.crc file that contains a list of repository objects and their checksums in the root of the disk C.
Sub Main;
Var
MB: IMetabase;
CheckList: IMetabaseCheckList;
ListItem: IMetabaseCheckListItem;
Begin
MB := MetabaseClass.Active;
CheckList := MB.CreateCheckList;
CheckList.LoadFromFile("c:\control.crc");
For Each ListItem In CheckList Do
Debug.Write("Identifier: " + ListItem.Id);
Debug.Write(" Hash code: " + ListItem.Hash);
Debug.Write(" Status:");
Select Case ListItem.Status As Integer
Case 1: Debug.WriteLine(" - Object is identical");
Case 2: Debug.WriteLine(" - Objects are not identical");
Case 3: Debug.WriteLine(" - Object is not present in the repository");
End Select;
End For;
End Sub Main;
After executing the example the checksums of the repository objects, the list of which is contained in the control.crc file are checked. Identifier of the objects, the hash code and the result of checksums comparison are displayed in the development environment console.
See also: