AcUtils
A high performance abstraction layer for AccuRev
Public Member Functions | List of all members
AcUtils.CmdValidate Class Reference

The default logic for determining if an AcUtilsException should be thrown based on the command's AccuRev program return value. More...

Collaboration diagram for AcUtils.CmdValidate:
Collaboration graph
[legend]

Public Member Functions

virtual bool isValid (string command, int retval)
 Default logic used to determine if an AcUtilsException should be thrown based on AccuRev's program retval for command and the version of AccuRev in use. More...
 

Detailed Description

The default logic for determining if an AcUtilsException should be thrown based on the command's AccuRev program return value.

Definition at line 97 of file AcCommand.cs.

Member Function Documentation

virtual bool AcUtils.CmdValidate.isValid ( string  command,
int  retval 
)
inlinevirtual

Default logic used to determine if an AcUtilsException should be thrown based on AccuRev's program retval for command and the version of AccuRev in use.

AccuRev's program return value is usually zero (0) for success and one (1) for error, except in the case of merge and diff where zero (0) for no conflicts/differences found, one (1) for conflicts/differences found, and two (2) on program error. Also, starting with AccuRev 6.0, the files command returns zero (0) for files found and one (1) for no files found.

Parameters
commandThe command that was issued.
retvalThe AccuRev program return value for command.
Returns
true if command should succeed, otherwise false to have an AcUtilsException thrown.
if (retval == 0 || (retval == 1 && (
command.StartsWith("diff", StringComparison.OrdinalIgnoreCase) ||
command.StartsWith("merge", StringComparison.OrdinalIgnoreCase)))
)
return true;
else
return false;
See also
AcCommand.runAsync, AcCommand.run

Implements AcUtils.ICmdValidate.

Definition at line 122 of file AcCommand.cs.