ContentFindValue
 
ContentFindValue is called to search directly for a specific search string. This function is new since Total Commander 10, plugin interface version 2.12.
Normally Total Commander would just call ContentGetValue and compare the returned value by itself with the search string. However, by returning the new flag contflags_fieldsearch, it's possible to tell Total Commander to call this function instead for specific fields. This can be useful e.g. for passing a search string directly to a search database. ContentGetSupportedOperators can be called to define your own search operators instead of the default like "contains".
 
Declaration:
 
int __stdcall ContentFindValue(char* FileName, int FieldIndex, int UnitIndex, int OperationIndex, int FieldType, int flags, void* FieldValue);
 
Description of parameters:
 
FileName The name of the file for which to do the search.
 
FieldIndex The index of the field for which to do the search. This is the same index as the FieldIndex value in ContentGetSupportedField.
 
UnitIndex The index of the unit used. Example:
If the plugin returned the following unit string in ContentGetSupportedField:
bytes|kbytes|Mbytes
Then a UnitIndex of 0 would mean bytes, 1 means kbytes and 2 means MBytes
If no unit string was returned, UnitIndex is 0.
 
OperationIndex The index of the operation as displayed in the "OP" column in Total Commander search function. If you use ContentGetSupportedOperators, you will get back the index of the operator chosen by the user from that list. Otherwise the index depends on the FieldType. The default operators are:
ft_numeric_32,ft_numeric_64,ft_numeric_floating,ft_datetime,ft_date,ft_time:
    >  <  >=  <=  =  !=
ft_boolean:
    =
ft_multiplechoice
    =  !=
ft_string, ft_stringw:
    contains  !contains  cont.(case)  !cont.(case)  =  !=  =(case)  !=(case)  regex  !regex
ft_fulltext, ft_fulltextw
    contains  !contains  cont.(case)  !cont.(case)  regex  !regex   
 
FieldType The type of data sent to the plugin in FieldValue
 
flags Currently only one flag is defined:
CONTENT_DELAYIFSLOW: If this flag is set, the plugin should return ft_delayed for fields which take a long time to extract, like file version information. Total Commander will then call the function again in a background thread without the CONTENT_DELAYIFSLOW flag. This means that your plugin must be implemented thread-safe if you plan to return ft_delayed.
 
FieldValue Here the plugin gets the search criteria. The data format depends on the field type:
ft_numeric_32: FieldValue points to a 32-bit signed integer variable.
ft_numeric_64: FieldValue points to a 64-bit signed integer variable.
ft_numeric_floating: FieldValue points to a 64-bit floating point variable (ISO standard double precision)
See remark below about additional string field!
ft_date: FieldValue points to a structure containing year,month,day as 2 byte values.
ft_time: FieldValue points to a structure containing hour,minute,second as 2 byte values.
ft_boolean: FieldValue points to a 32-bit number. 0 means false, anything else means true.
ft_string: FieldValue points to a single pointer pointing to a 0-terminated string.
ft_stringw,
ft_fulltext,
ft_fulltextw: FieldValue is a pointer to 2 separate pointers: The first points to a 0 terminated ANSI string, the second to a 0 terminated Unicode string. Behind it follows a BOOL value telling the user whether the Unicode string contains any characters which cannot be represented by the ANSI string.
ft_multiplechoice: FieldValue is a pointer to a 0-terminated ANSI string.
ft_datetime: A timestamp of type FILETIME, as returned e.g. by FindFirstFile(). It is a 64-bit value representing the number of 100-nanosecond intervals since January 1, 1601. The time MUST be relative to universal time (Greenwich mean time) as returned by the file system, not local time!
 
Return value:
 
Return the field type in case of success, or one of the following error values otherwise:
ft_found The search string was found
ft_notfound The search string was NOT found
ft_nosuchfield The given FieldIndex is invalid
ft_fileerror Error accessing the specified file FileName
ft_fieldempty The file does not contain the specified field
ft_delayed The extraction of the field would take a long time, so Total Commander should request it again in a background thread. This error may only be returned if the flag CONTENT_DELAYIFSLOW was set, and if the plugin is thread-safe.
 
Remarks:
 
Note about Unicode: ft_stringw, ft_fulltext and ft_fulltextw always pass two pointers to the search function, the first pointing to the ANSI search string, the second to the Unicode search string. It is recommended to