version 1.1.2.3, 2001/12/03 02:23:25
|
version 1.1.2.5, 2001/12/12 17:45:53
|
|
|
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
/** This class represents a compiled WBEMSQl1 select statement. |
/** This class represents a compiled WQL1 select statement. |
| |
An instance of WQLSelectStatement is passed to WQLParser::parse() which | An instance of WQLSelectStatement is passed to WQLParser::parse() which |
parses and WBEMSQL1 SELECT statement and initializes the WQLSelectStatement |
parses the WQL1 SELECT statement and initializes the WQLSelectStatement |
instance. The WBEMSWL1 SELECT statement has the following form: |
instance. A WQL1 SELECT statement has the following form: |
| |
<pre> | <pre> |
SELECT <property>... |
SELECT <property>... |
FROM <class name> |
FROM <class name> |
WHERE <where clause> |
WHERE <where clause> |
</pre> | </pre> |
| |
The properties may be obtained with the getProperties() method. |
There are methods for obtaining the various elements of the select |
The class name may be obtained with getClassName(). The where clause |
statement. |
may be evaluated by calling evaluateWhereClause() with the appropriate |
|
arguments. If hasWhereClause() returns false, then there is no where |
|
clause. |
|
| |
The components of the where clause are stored in two arrays: one for | The components of the where clause are stored in two arrays: one for |
operands and one for operators (these are placed in proper order by the | operands and one for operators (these are placed in proper order by the |
|
|
/** Returns the number of property names which were indicated in the | /** Returns the number of property names which were indicated in the |
selection list. | selection list. |
*/ | */ |
Uint32 getPropertyNameCount() const |
Uint32 getSelectPropertyNameCount() const |
{ | { |
return _propertyNames.size(); |
return _selectPropertyNames.size(); |
} | } |
| |
/** Gets the i-th property name in the list. |
/** Gets the i-th selected property name in the list. |
*/ | */ |
const String& getPropertyName(Uint32 i) |
const String& getSelectPropertyName(Uint32 i) |
{ | { |
return _propertyNames[i]; |
return _selectPropertyNames[i]; |
} | } |
| |
/** Appends a property name to the property name list. This user should | /** Appends a property name to the property name list. This user should |
not call this method; it should only be called by the parser. | not call this method; it should only be called by the parser. |
*/ | */ |
void appendPropertyName(const String& x) |
void appendSelectPropertyName(const String& x) |
{ | { |
_propertyNames.append(x); |
_selectPropertyNames.append(x); |
} | } |
| |
|
/** Returns the number of unique property names from the where clause. |
|
*/ |
|
Uint32 getWherePropertyNameCount() const |
|
{ |
|
return _wherePropertyNames.size(); |
|
} |
|
|
|
/** Gets the i-th unique property appearing in the where clause. |
|
*/ |
|
const String& getWherePropertyName(Uint32 i) |
|
{ |
|
return _wherePropertyNames[i]; |
|
} |
|
|
|
/** Appends a property name to the where property name list. This user |
|
should not call this method; it should only be called by the parser. |
|
|
|
@param x name of the property. |
|
@return false if a property with that name already exists. |
|
*/ |
|
Boolean appendWherePropertyName(const String& x); |
|
|
/** Appends an operation to the operation array. This method should only | /** Appends an operation to the operation array. This method should only |
be called by the parser itself. | be called by the parser itself. |
*/ | */ |
|
|
// WHERE ... | // WHERE ... |
// | // |
| |
Array<String> _propertyNames; |
Array<String> _selectPropertyNames; |
|
|
|
// |
|
// The unique list of property names appearing in the WHERE clause. |
|
// Although a property may occur many times in the WHERE clause, it will |
|
// only appear once in this list. |
|
// |
|
|
|
Array<String> _wherePropertyNames; |
| |
// | // |
// The list of operations encountered while parsing the WHERE clause. | // The list of operations encountered while parsing the WHERE clause. |
|
|
// | // |
| |
Array<WQLOperand> _operands; | Array<WQLOperand> _operands; |
|
|
|
void f() const { } |
}; | }; |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |