2.2.1.6 CPropertyRestriction
The CPropertyRestriction structure contains a property to get from each row, a comparison operator, and a constant. For each row, the value returned by the specific property in the row is compared against the constant to determine if it has the relationship specified by the _relop field. For the comparison to be true, the data types of the values must match.
|
|
|
|
|
|
|
|
|
|
1 |
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
3 |
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
_relop |
|||||||||||||||||||||||||||||||
_Property (variable) |
|||||||||||||||||||||||||||||||
... |
|||||||||||||||||||||||||||||||
_prval (variable) |
|||||||||||||||||||||||||||||||
... |
_relop (4 bytes): A 32-bit unsigned integer specifying the relation to perform on the property. _relop MUST be one of the values in the following tables.
-
Value
Meaning
PRLT
0x00000000
A less-than comparison.
PRLE
0x00000001
A less-than-or-equal-to comparison.
PRGT
0x00000002
A greater-than comparison.
PRGE
0x00000003
A greater-than-or-equal-to comparison.
PREQ
0x00000004
An equality comparison.
PRNE
0x00000005
A not-equal comparison.
PRRE
0x00000006
A regular expression comparison.
-
For PRRE relations, regular expressions are expressed with a string that contains special symbols. Any character except an asterisk (*), period (.), question mark (?), or vertical bar (|) matches itself. A regular expression can be enclosed in a pair of quotation marks ("…"), and MUST be enclosed in quotation marks if the expression contains a space or a closing parenthesis.
-
The asterisk matches any number of characters. The period matches the end of a string. The question mark matches any one character. The vertical bar (|) is an escape character, which indicates special behavior for the characters shown in the following table. The following table explains the meanings of special characters in regular expressions.
-
Character
Meaning
(
An opening parenthesis opens a group. It MUST be followed by a matching closing parenthesis.
)
A closing parenthesis closes a group. It MUST be preceded by a matching opening parenthesis.
[
An opening bracket preceded (escaped) by a vertical bar opens a character class. It MUST be followed by a matching (nonescaped) closing square bracket.
{
An opening brace opens a counted match. It MUST be followed by a matching closing brace.
}
A closing brace closes a counted match. It MUST be preceded by a matching opening brace.
,
A comma separates OR clauses.
*
An asterisk matches zero or more occurrences of the preceding expression.
?
A question mark matches zero or one occurrence of the preceding expression.
+
A plus sign matches one or more occurrences of the preceding expression.
Other
All other characters match themselves.
-
-
The following table describes characters which, when located between brackets ([ ]), have special meanings.
-
Character
Meaning
^
A caret matches everything but following classes. (It MUST be the first character in the string.)
]
A closing bracket matches another closing bracket. It MAY be preceded only by a caret (^); otherwise, it closes the class.
-
A hyphen is a range operator. It is preceded and followed by normal characters.
Other
All other characters match themselves (or begin or end a range).
-
-
The following table describes the syntax used between braces ({ }).
-
Character
Meaning
{m}
Matches exactly m occurrences of the preceding expression (0 < m < 256).
{m,}
Matches at least m occurrences of the preceding expression (1 < m < 256).
{m, n}
Matches between m and n occurrences of the preceding expression, inclusive (0 < m < 256, 0 < n < 256).
-
-
To match the asterisk and question mark, enclose them in brackets. For example, [*]sample matches "*sample".
-
Value
Meaning
PRAllBits
0x00000007
A bitwise AND that returns the value equal to _prval.
PRSomeBits
0x00000008
A bitwise AND that returns a nonzero value.
-
-
For vector properties, the behavior of the relational operators depends on the result of a logical OR using a mask and the relational operator.
-
If there is no mask, then the restriction is true if the relational operator holds between each element of a property value and the corresponding element in the _prval field. If, in addition, the two vectors have different lengths, then the vector lengths are compared using the relational operator.
-
If there is a mask, the possible values are as follows.
-
Value
Meaning
PRAll
0x00000100
The restriction is true if every element in a property value has the relationship with some element in the _prval field.
PRAny
0x00000200
The restriction is true if any element in the property value has the relationship with some element in the _prval field.
-
_Property (variable): A CFullPropSpec structure indicating the property on which to perform a match operation.
_prval (variable): A CBaseStorageVariant structure containing the value to relate to the property.