IMetabaseCheckList.LoadFromStream

Syntax

LoadFromStream(Reader: IIOStream);

LoadFromStream(Reader: System.IO.Stream);

Parameters

Reader. Stream where checksums of repository objects are saved.

Description

The LoadFromStream method loads from the stream and verifies checksums of repository objects.

Comments

To save checksums to the stream, the SaveToStream method is used. Before loading checksums using the LoadFromStream method, it is recommended to put the cursor in the stream sent in the Reader parameter to the beginning, using the IIOStream.Seek method.

Example

Add links to the IO, Metabase system assemblies.

Sub LoadCheckList(Reader: IIOStream);
Var
    MB: IMetabase;
    CheckList: IMetabaseCheckList;
    ListItem: IMetabaseCheckListItem;
Begin
    MB := MetabaseClass.Active;
    CheckList := MB.CreateCheckList;
    Reader.Seek(
0, SeekOrigin.Beginning);
    CheckList.LoadFromStream(Reader);
    
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 the identical");
            
Case 2: Debug.WriteLine(" - Object has differences");
            
Case 3: Debug.WriteLine(" - Object is absent in repository");
        
End Select;
    
End For;
End Sub LoadCheckList;

Public Shared Sub LoadCheckList(MB: IMetabase; Reader: Stream);
Var
    CheckList: IMetabaseCheckList;
    ListItem: IMetabaseCheckListItem;
Begin
    CheckList := MB.CreateCheckList();
    Reader.Seek(
0, SeekOrigin.@Begin);
    CheckList.LoadFromStream(Reader);
    
For Each ListItem In CheckList Do
        System.Diagnostics.Debug.Write(
"Identifier: " + ListItem.Id);
        System.Diagnostics.Debug.Write(
" Hash code: " + ListItem.Hash);
        System.Diagnostics.Debug.Write(
" Status:");
        
Select Case ListItem.Status As Integer
            
Case 1: System.Diagnostics.Debug.WriteLine(" - Object is identical");
            
Case 2: System.Diagnostics.Debug.WriteLine(" - Object has differences");
            
Case 3: System.Diagnostics.Debug.WriteLine(" - Object is absent in repository");
        
End Select;
    
End For;
End Sub;

The specified procedure enables loading checksums from the stream and display the information by objects to the development environment console.The stream from which loading is executed is sent as input parameter.

See also:

IMetabaseCheckList