Content matchers filter messages based on their content.
Create a content matcher object.
An application can create a matcher to register interest in a stream of messages.
Content matcher objects are not thread-safe.
Match Syntax:
{
"fieldname1"
: value1
, ...
, "fieldnameN"
: valueN }
- Enclose the list of field:value pairs in curly braces.
- Separate field:value pairs with commas.
- Enclose field names in double-quote characters. Precede quote characters with an escape character, as needed.
- Do not enclose boolean tokens in double-quote characters.
- Each field name can appear at most once.
- Values can be long integers or strings – or the special boolean tokens
true
or false
.
- When value is a string, its maximum length is 256 characters.
- Whitespace is ignored (except within double-quote characters).
Match Semantics:
- If the match string specifies a field with boolean token
true
, that field must be present in the message in order to match.
- If the match string specifies a field with boolean token
false
, that field must be absent from the message in order to match.
- If the match string specifies a field with either a string or long integer value, that field must be present in the message with that value.
- When comparing a field name or a value, all comparisons must be exact. Matching does not support wildcards nor regular expressions.
- Parameters
-
e | The exception object captures information about failures. |
realm | The realm object is the source of configuration information about the application and formats. |
matchString | This string determines message interest. |
- Returns
- On success, this call returns a new content matcher object.
On failure, this call returns NULL
.