| type
|
| TEnumerateFilesProc = procedure( pFile: PChar ); stdcall;
|
|
|
| TEnumerateFiles = procedure ( pPath: PChar; EnumerateProjects, EnumerateArchives: Boolean;
|
| EnumerateProc: TEnumerateFilesProc ); stdcall;
|
Parameters
|
Name
|
Description
|
|
pPath
|
The path to the repository you want to enumerate. Normally the path passed into VcsInitAddin
|
|
EnumerateProjects
|
Set this to True to enumerate the project files
|
|
EnumerateArchives
|
Set this to True to enumerate individual file archives
|
|
EnumerateProc
|
Procedure of type TEnumerateFilesProc that is called for each Project or Archive that is enumerated. The parameter pFile contains the full path of the file being enumerated.
|
Example (Delphi)
| procedure EnumFiles( pFile: PChar ); stdcall;
|
| var
|
| BackupFile: String;
|
| begin
|
| // Each file in the repository (depending on user options) will be passed to this procedure.
|
| // Simple backup procedure to copy the passed file to another folder...
|
| BackupFile := FPath + ExtractFileName( String( pFile ) );
|
| if FilesDifferent( String( pFile ), BackupFile ) then
|
| CopyFile( pFile, PChar( BackupFile ), False );
|
| end;
|
|
|
| procedure TBackupThread.Backup;
|
| begin
|
| FBusy := True;
|
| try
|
| // Backup can only be executed when the server is disabled
|
| DoDisableServer;
|
| try
|
| // Flush the buffers before running the Backup routine to make sure
|
| // the files are current
|
| DoFlushBuffers;
|
| // The backup will actually be done in the EnumFiles procedure
|
| DoEnumerateFiles( PChar( RepositoryPath ), True, True, EnumFiles );
|
| finally
|
| DoEnableServer;
|
| end;
|
| finally
|
| FBusy := False;
|
| end;
|
| end;
|
|
|
© 1995-2011 Quality Software Components Ltd