IFilterField

[This is preliminary documentation and subject to change.]

This is the heart of the generic filter; the interface through which the numeric or regular expression to match a field in an announcement can be set or retrieved.

Following is a preliminary description of the interface.

enum BPC_FieldType {AddressField, PatternField, NumericField, UndefinedField};
 
interface IFilterField : IDispatch
{
[id(DISPID_VALUE), propget] HRESULT MatchString([out, retval] BSTR *MatchString);
[id(DISPID_VALUE), propput] HRESULT MatchString([in] BSTR MatchString);
[id(1), propput] HRESULT FieldType([in] BPC_FieldType FieldType);
[id(3), propget] HRESULT Name([out, retval] BSTR* lpbstrReturn);
};
 

When added, a field has type BPC_FieldType::UndefinedField. The filter then only requires that the field be present in an announcement, without regard to its content. If a field is given a type of BPC_FieldType:PatternField or BPC_FieldType:NumericField then the MatchString is interpreted as a regular expression to be matched, or a numeric expression to be evaluated for truth or falsehood, respectively.

The numeric expression evaluator accepts the following operators: <, >, >=, <=, ==, !=, +, -, /, *, ), (, &&, ||, &, ~, |, ^, and !. Their meaning is similar to the same in the C language. Anywhere that a question mark appears in the expression, it is replaced by the numeric value of the field. All operations are carried out with double precision floating point numbers.

The regular expression evaluator uses accept the same patterns as the one in the Visual C++ version 4.1 IDE. This should be specified more completely in a future version of this document.

If a field type is set to BPC_FieldType:AddressField, then the value of the field is parsed as an Internet Protocol (IP) address. A variety of formats may be supported for this type.