VcsToLocalFormat
Return to Introduction  Previous page  Next page
Team Coherence supports code formatters to allow you to work with shared files using the code layout you are used to. To handle this, you can implement the VcsToLocalFormat and VcsToServerFormat methods to reformat your code when it is retrieved and sent to the server.

VcsToLocalFormat

procedure VcsToLocalFormat( pLocalFile: PChar; Action: Word; var Converted: Boolean ); stdcall; export;  

This function is called after a CheckOut or Get action to allow you to convert the retrieved file into the format the user wants to work with. If you implement this function, you should also implement the reverse function VcsToServerFormat function so that unnecessary revisions are not created.

Parameters

Name
Description
pLocalFile
The name of the local file to format.
Action
The type of action just completed. See TCVcsConst.pas for a list of the action types.
Converted
So that multiple formatters can be chained, you should return True if you modified the file. If the value is already True, it means another addin also modified it.



VcsToServerFormat


procedure VcsToServerFormat( pLocalFile: PChar; Action: Word; var Converted: Boolean ); stdcall; export;  

This function is called before a CheckIn action to allow you to convert the local file back the format the server knows. This function is called before the CRC for the file is calculated so the ToLocal and ToServer file formatting tools should be 100% reversible to prevent unnecessary checkins occurring.

Parameters

Name
Description
pLocalFile
The name of the local file to format.
Action
The type of action about to occur. See TCVcsConst.pas for a list of the action types.
Converted
So that multiple formatters can be chained, you should return True if you modified the file. If the value is already True, it means another addin also modified it.



 


© 1995-2018 MCN Software