class RXmlEngXPathResult |
Represents the result of a XPath expression.
The result may be one of the standard types: string, boolean, number (float), node set or be undefined in the case of error.
The returned result should be freed after use.
Public Member Functions | |
---|---|
RXmlEngXPathResult() | |
IMPORT_C TBool | AsBoolean() |
IMPORT_C RXmlEngNodeSet | AsNodeSet() |
IMPORT_C TReal | AsNumber() |
IMPORT_C void | AsStringL(RBuf8 &) |
void | Close() |
IMPORT_C void | Free() |
IMPORT_C TXmlEngXPathResultType | Type() |
Private Member Functions | |
---|---|
RXmlEngXPathResult(void *) |
Public Member Enumerations | |
---|---|
enum | TXmlEngXPathResultType { EUndefined = 0, ENodeset = 1, EBoolean = 2, ENumber = 3, EString = 4 } |
Private Attributes | |
---|---|
void * | iInternal |
RXmlEngXPathResult | ( | void * | aData | ) | [private] |
Constructor
void * aData | Internal representation of XPath result |
IMPORT_C TBool | AsBoolean | ( | ) | const |
Retrieves a boolean result. Conversion can occur from other types.
Numbers will be returned as true unless it is not a number or 0.0. A string of 0 length will return false, otherwise true. If the node exists it will be returned as true, otherwise false.
Boolean value of the result
IMPORT_C RXmlEngNodeSet | AsNodeSet | ( | ) | const |
Retrieves a node-set result. A Non-RXmlEngNodeSet result will return NULL. No conversion is done from other types.
For more information no NULL nodes: TXmlEngNode
Node-set result
IMPORT_C TReal | AsNumber | ( | ) | const |
Retrieves a numeric value result. Conversion can occur from other types.
Node sets, strings, and booleans will be cast to numbers. Anything else will return NAN (i.e. not a number).
Numeric value of the result.
Math
IMPORT_C void | AsStringL | ( | RBuf8 & | aOutput | ) | const |
Retrieves a string copy of result. leave
KErrNoMemory if out of memory situation occurs.
leave
Otherwise any of the system wide errors.
RBuf8 & aOutput |
IMPORT_C TXmlEngXPathResultType | Type | ( | ) | const |
Retrieves the type of the result (e.g. boolean, number, string, etc.). The type of a result should always be checked before using the result.
If there was an error and no value was set, undefined is returned. Otherwise nodeset is returned.
Type of result.
Result types of a XPath expression. See http://w3.org/TR/xpath#section-Introduction
EUndefined = 0 | |
ENodeset = 1 | |
EBoolean = 2 | |
ENumber = 3 | |
EString = 4 |