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

Get user preferences retrieved by way of the getpref command. More...

Static Public Member Functions

static async Task< bool[]> getIgnoreOptionsAsync ()
 Get the user's Diff/Merge and Ignore Options (AccuRev Diff only) preferences. More...
 
static async Task< bool?> getUseIgnoreElemsOptimizationAsync ()
 Get the user's USE_IGNORE_ELEMS_OPTIMIZATION setting. More...
 
static async Task< string > getAcHomeFolderAsync ()
 Get the AccuRev home folder for the current user. More...
 

Static Private Member Functions

static async Task< string > getPreferencesAsync ()
 Get user preferences retrieved by way of the getpref command. More...
 

Detailed Description

Get user preferences retrieved by way of the getpref command.

Definition at line 27 of file AcPreferences.cs.

Member Function Documentation

static async Task<string> AcUtils.AcPreferences.getAcHomeFolderAsync ( )
inlinestatic

Get the AccuRev home folder for the current user.

Returns
The full path to the user's AccuRev home folder on success, otherwise null on error.
Exceptions
Exceptioncaught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on failure to handle a range of exceptions.

Definition at line 123 of file AcPreferences.cs.

static async Task<bool[]> AcUtils.AcPreferences.getIgnoreOptionsAsync ( )
inlinestatic

Get the user's Diff/Merge and Ignore Options (AccuRev Diff only) preferences.

Ignore Whitespace is true if spaces, tabs and empty lines should be ignored, false otherwise. A setting of true overrides Ignore Changes in Whitespace setting.
Ignore Changes in Whitespace is true if a change in the amount of whitespace should be considered a change to that line, false otherwise.
Ignore Case is true if uppercase and lowercase characters should be considered the same when comparing text, false otherwise.

Returns
An array initialized as bool[]={ignoreWhitespace, ignoreWhitespaceChanges, ignoreCase} on success, otherwise null.
AccuNote:
Selecting "Ignore Whitespace" and "Ignore Changes in Whitespace" applies to diff only. The merge command does not use these settings and will show all conflicts.
Exceptions
Exceptioncaught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on failure to handle a range of exceptions.

Definition at line 48 of file AcPreferences.cs.

static async Task<string> AcUtils.AcPreferences.getPreferencesAsync ( )
inlinestaticprivate

Get user preferences retrieved by way of the getpref command.

Returns
The full path to a temp file with the XML results from the getpref command, otherwise null on error. The caller is responsible for deleting the file.
getpref command:
getpref
AccuNote:
When using the AccuRev GUI client, changes in User Preferences do not always persist. As a workaround, use setpref:
  1. Exit the AccuRev client.
  2. Put the setting(s) needed in a file named set_pref.xml
  3. Open a command window and cd to the folder where the file is located.
  4. Run the command accurev setpref -l set_pref.xml (-l switch is a lowercase L)
  5. Run the AccuRev client and verify the setting(s).
    <AcRequest>
    <USE_IGNORE_ELEMS_OPTIMIZATION>true</USE_IGNORE_ELEMS_OPTIMIZATION>
    ...
    </AcRequest>
    
Exceptions
AcUtilsExceptioncaught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on getpref command failure.
Exceptioncaught and logged in same on failure to handle a range of exceptions.

Definition at line 178 of file AcPreferences.cs.

Referenced by AcUtils.AcPreferences.getAcHomeFolderAsync(), and AcUtils.AcPreferences.getUseIgnoreElemsOptimizationAsync().

static async Task<bool?> AcUtils.AcPreferences.getUseIgnoreElemsOptimizationAsync ( )
inlinestatic

Get the user's USE_IGNORE_ELEMS_OPTIMIZATION setting.

Returns
A bool set to true or false on operation success, otherwise null on error.
Exceptions
Exceptioncaught and logged in %LOCALAPPDATA%\AcTools\Logs\<prog_name>-YYYY-MM-DD.log on failure to handle a range of exceptions.

Definition at line 87 of file AcPreferences.cs.