IConditionGenerator Interface

Provides methods for handling named entities and generating special conditions.

IConditionGenerator Members

DefaultPhrase This method attempts to produce a phrase that, when recognized by this instance of IConditionGenerator, represents the type and value pair for an entity, relationship, or named entity.
GenerateForLeaf Generates a special query expression for what would otherwise become a leaf query expression.
Initialize Resets all states of the interface to default values and retrieves any necessary information from the schema.
RecognizeNamedEntities Identifies named entities in an input string, and creates a collection containing them. The value of each named entity is expressed as a string, which is then used by IConditionGenerator::GenerateForLeaf. The string can contain any data and be in any format, because it is not examined by any other components.


When an object that supports IConditionGenerator has been registered with a query parser as a semantic type T (using the IQueryParser::SetMultiOption method with the SQMO_GENERATOR_FOR_TYPE constant), and that query parser is about to generate a leaf condition node with semantic type T, the query parser first calls the IConditionGenerator::GenerateForLeaf method of the condition generator. If that method returns S_OK, the returned condition tree (which need not be a leaf node) is used. If it returns S_FALSE, then normal processing ia resumed, which generates a leaf node.

A query parser has condition generators preregistered for the known semantic types representing numbers, Booleans, date/time and file paths.

Interface Information

Inherits from IUnknown
Header and IDL files structuredquery.h, structuredquery.idl
Minimum operating systems Windows XP sp2, Windows Server 2003 sp1, Windows Vista

See Also