TValidateRepository
Return to Introduction  Previous page  Next page
A pointer to a method of this type is passed by the server as a parameter to the VcsInitAddin method. This method can be called to validate the state of a running repository. Depending on the parameters you provide, it will do the validation on the Project or Archive level. Feedback is provided through the callback method, of type TFeedbackProc, that you provide in the method call.

type  
  TFeedbackProc = procedure( pText: PChar ); stdcall;  
 
  TValidateRepository = procedure ( pPath, pFile: PChar; ValidateProjects: Boolean;   
                                    ValidateArchives: Boolean; fbProc: TFeedbackProc ); stdcall;  

Parameters

Name
Description
pPath
The path to the repository you want to validate. Normally the path passed into VcsInitAddin
pFile
Pass in the name of the file that the Validator can use to output results. Results are output as text and highlight any errors found. Can be nil.
ValidateProjects
Set this to True to validate the project files
ValidateArchives
Set this to True to validate individual file archives
fbProc
Procedure of type TFeedbackProc that is called for each Project or Archive that is validated. The parameter pText contains the result of the validation.



Example (Delphi)

procedure TValidateThread.Validate;  
begin  
  FBusy := True;  
  try  
    // Validation can only be executed when the server is disabled  
    DoDisableServer;  
    try  
      // Flush the buffers before running the Validation routine as it  
      // validates the physical files...  
      DoFlushBuffers;  
      // This addin cannot have a UI, so we will pass in a file  
      if FileExists( RepositoryPath + 'Validate.txt' ) then  
        DeleteFile( RepositoryPath + 'Validate.txt' );  
      DoValidateRepository( PChar( RepositoryPath ), PChar( RepositoryPath + 'Validate.txt' ), True, True, nil );  
    finally  
      DoEnableServer;  
    end;  
  finally  
    FBusy := False;  
  end;  
end;  
 

 


© 1995-2011 Quality Software Components Ltd