TDfCmpOptions Structure
Summary:
TDfCmpOptions structure contains fields which define parameters of dfCompare function operation.
Syntax:
struct TDfCmpOptions
{
int
iContentCmp;
int
iContentUpdateData;
int
iEqSearchMethod;
int
iMaxMemoryUsageUnit;
unsigned
nMaxMemoryUsage;
int
iFileNameCmp;
int
iFileNameCaseSensitive;
int
iDateTimeCmp;
unsigned
nDateTimePrecision;
int
iAttrCmp;
};
Fields:
ContentCmp – defines whether files content will be compared or not, and if it will not then whether consider it identical or not.
Possible values:
iContentCmp – defines whether files content will be compared or not, and if it will not then whether consider it identical or not.
Possible values:
-1 |
Files content is considered identical (no comparing or search for identical parts is performed). |
0 |
Perform comparing and if content is different then operate according to iContentUpdateData options (default value). |
1 |
Consider files content absolutely different (no comparing or search for identical parts is performed). |
On the first glance it can be considered nonsensical or even absurd to take files content as equal if is not equal in fact, however in this way a mechanism of content updating method selection or content difference ignoring. So that if function dfCompare considers that compared files content is identical (as a result of this flag setting or actual files content comparing) then corresponding df-file, which is built by the following call of dfBuildN/dfBuildH will not contain content updating data and in case of its applying - content of an old file will not be changed.
The same is with fields iFileNameCmp, iDateTimeCmp and iAttrCmp (see description below) with only one difference that they concern names of files, last modification date/time and file attributes.
iContentUpdateData – this parameter defines the method of difference representation within content of compared files.
Ignored if iContentCmp is "-1".
Possible values:
DF_CNTUPD_NONE |
Perform comparing of files content in case of parameter iContentCmp value is equal to 0 and save in df-file only information on the result of file comparing (content is different or not).
In case of presence of difference in content search for identical parts is not performed.
The result df-file cannot be used for old file updating in this case.
Used for results of file comparing caching. |
DF_CNTUPD_SMART_DIFF |
A special algorithm which minimizes the size of data, necessary for content differences encoding is used for identical content parts search (default value).
Equivalent to value of DF_CNTUPD_SAVE_ENTIRE if iContentCmp is "1". |
DF_CNTUPD_B2B_DIFF |
Difference in file content is organized as per-byte difference of parts of the largest length (equal to the size of the smallest among compared file) starting from the zero byte (rarely used).
Equivalent to value of DF_CNTUPD_SAVE_ENTIRE if iContentCmp is "1". |
DF_CNTUPD_SAVE_ENTIRE |
The whole content of new file will be saved in df-file.
Can be used to get rid of the requirement of old file constancy at the applying side. |
iEqSearchMethod – defines the method of identical file content parts search process only if iContentUpdateData=DF_CONTENT_SMART_DIFF. Otherwise field value is ignored.
Possible values:
- DF_METHOD_DEFAULT (in this version of LIBDF it is equal to value of DF_METHOD_GOOD)
- DF_METHOD_FASTEST
- DF_METHOD_FAST
- DF_METHOD_NORMAL
- DF_METHOD_GOOD
- DF_METHOD_BEST
- DF_METHOD_PARANOID
WARNING! DF_METHOD_BEST è DF_METHOD_PARANOID methods can be very slow for big files!
iMaxMemoryUsageUnit – defines units for parameter nMaxMemoryUsage parameter value setting:
"0" - in % from total system RAM (default value);
"1" - in MBytes.
nMaxMemoryUsage – defines max RAM size which can be used during identical content parts search process (actual only if iContentUpdateData=DF_CONTENT_SMART_DIFF).
If equal to "0" then default value is taken: 80% from the total system RAM.
If set in MBytes, then allowed values range is: [1..2000].
iFileNameCmp – defines whether to perform comparing of names of files or not, and if not then whether to consider them identical or not.
Possible values:
-1 |
Consider names of files equal. |
0 |
Perform comparing (default value). |
1 |
Consider names of files different. |
iFileNameCaseSensitive – flag which defines what method will be used for files names comparing - case sensitive or not.
If "0" - comparing method is not case sensitive, otherwise - case sensitive.
Ignored if iFileNameCmp is not equal to "0".
Default value: "0".
iDateTimeCmp – defines whether to perform comparing of files last modification date/time values or not, and if not then whether to consider them equal or not.
Possible values:
-1 |
Consider equal. |
0 |
Perform comparing (default value). |
1 |
Consider different. |
nDateTimePrecision – defines precision of comparing of last modification date/time values of files in milliseconds.
Ignored if iDateTimeCmp is not "0".
Default value: "0".
iAttrCmp – defines whether to perform comparing of attributes of files or not, and if not then whether to consider them equal or not.
Possible values:
-1 |
Consider attributes of files equal. |
0 |
Perform comparing (default value). |
1 |
Consider attributes of files different. |
|