Overview Units Class Hierarchy Classes, Interfaces, Objects and Records Types Variables Constants Functions and Procedures Identifiers |
Class TXQValue
Unit
xquery
Declaration
type TXQValue = class(TInterfacedObject, IXQValue)
Description
Base class for XQuery-variants types, implementing the IXQValue interface. All other type classes are derived from it. (it correspondes to xs:anyType)
See IXQValue for an actual description
Hierarchy
- TInterfacedObject
- TXQValue
Overview
Fields
Methods
Description
Fields
Methods
|
constructor create(atypeAnnotation: TXSType); virtual; |
|
|
constructor create(atypeAnnotation: TXSType; const value: IXQValue); virtual; |
|
|
class function newinstance : tobject; override; |
|
|
procedure AfterConstruction; override; |
|
|
procedure FreeInstance; override; |
|
|
function kind: TXQValueKind; |
Primary type of a value (actually just wraps classKind. Since you can't define class functions in the interface, but we need to do calculations with types itself)
|
|
function typeName: string; |
XPath type name (actually just wraps typeAnnotation.name)
|
|
function typeAnnotation: TXSType; inline; |
Returns the class underlying the interface
|
|
function isUndefined: boolean; virtual; |
Returns true, iff the value is undefined or an empty sequence
|
|
function toBoolean: boolean; virtual; |
Returns the value as boolean; dynamically converted, if necessary
|
|
function toBooleanEffective: boolean; virtual; |
Returns the effective boolean value (the main difference to toBoolean is that toBooleanEffective returns true for the string "false", while toBoolean returns false)
|
|
function toInt64: int64; virtual; |
Returns the value as int64; dynamically converted, if necessary
|
|
function toFloat: xqfloat; virtual; |
Returns the value as xqfloat; dynamically converted, if necessary
|
|
function toDecimal: BigDecimal; virtual; |
Returns the value as BigDecimal; dynamically converted, if necessary
|
|
function toString: string; override; |
Returns the value as string; dynamically converted, if necessary
|
|
function toJoinedString(const sep: string = ' '): string; virtual; |
Returns the value as joined string (string-join($self, $sep)); dynamically converted, if necessary
|
|
function toDateTime: TDateTime; virtual; |
Returns the value as dateTime; dynamically converted, if necessary
|
|
function toNode: TTreeNode; virtual; |
Returns the value as node, or nil if it is not a node
|
|
function toArray: TXQVArray; virtual; |
Returns the value as array; dynamically converted, if necessary. If the value is a single value, the array contains just this value; if it is a sequence, the array contains all members of the sequence
|
|
function toXQVList: TXQVList; virtual; |
Converts the TXQValue dynamically to a TXQVList sequence (and "destroys it", however you have to free the list)
|
|
function toXQuery: string; virtual; |
Converts the value to an XQuery expression that evaluates to an equal value again (intended for debugging, not serialization, so no guarantees)
|
|
function getSequenceCount: integer; virtual; |
Returns the number of values actually contained in this value (0 for undefined, element count for sequences, and 1 for everything else)
|
|
function get(i: integer): IXQValue; virtual; |
Returns the i-th value in this sequence. (non-sequence values are considered to be sequences of length 1)
|
|
function getProperty(const name: string): IXQValue; virtual; |
Returns an object property. Returns empty sequence for non objects.
|
|
function getPropertyEnumerator: TXQValuePropertyEnumerator; virtual; |
Returns an iterator over all object properties. Raises an exception for non-objects
|
|
function debugAsStringWithTypeAnnotation(textOnly: boolean = true): string; deprecated; |
Warning: this symbol is deprecated. |
|
function jsonSerialize(nodeFormat: TTreeNodeSerialization; insertWhitespace: boolean = false; const indent: string = ''): string; virtual; |
|
|
function xmlSerialize(nodeFormat: TTreeNodeSerialization; sequenceTag: string = 'seq'; elementTag: string = 'e'; objectTag: string = 'object'): string; virtual; |
|
|
function query(const q: string): IXQValue; |
Evaluates another XQuery expression on this value using the defaultQueryEngine. The return value is query whereby self is stored in $_. Use this to do an operation on all values of a sequence, e.g. sum($_)
|
|
function query(const q: string; const vs: array of ixqvalue): IXQValue; |
Like query, sets the additional arguments as variables $_1, $_2, ...
|
|
function query(const q: string; const vs: array of string): IXQValue; |
Like query , sets the additional arguments as variables $_1, $_2, ...
|
|
function map(const q: string): IXQValue; virtual; |
Evaluates another XQuery expression on this value using the defaultQueryEngine. The return value is self ! query (i.e. all values in self simply mapped through query)
|
|
function map(const q: string; const vs: array of ixqvalue): IXQValue; virtual; |
Like map, sets the additional arguments as variables $_1, $_2, ...
|
|
function map(const q: string; const vs: array of string): IXQValue; virtual; |
Like map , sets the additional arguments as variables $_1, $_2, ...
|
|
function filter(const q: string): IXQValue; virtual; |
Evaluates another XQuery expression on this value using the defaultQueryEngine. The return value is self [query] (i.e. all values in self filtered through query)
|
|
function filter(const q: string; const vs: array of ixqvalue): IXQValue; virtual; |
Like filter, sets the additional arguments as variables $_1, $_2, ...
|
|
function filter(const q: string; const vs: array of string): IXQValue; virtual; |
Like filter , sets the additional arguments as variables $_1, $_2, ...
|
|
function order(const q: string): IXQValue; virtual; |
Orders the sequence, equivalent to query for $_ in self order by (....) return $_ . The current value is in $_. Kind of slow
|
|
function retrieve(): IXQValue; |
Retrieves referenced resources. This is primarily used for HTTP requests, but can also retrieve files. It will parse the resource as HTML/XML/JSON if possible. It will retrieve each value in a sequence individually
|
|
function GetEnumerator: TXQValueEnumerator; virtual; |
Implements the enumerator for for..in. (Only use with IXQValue references, not TXQValue) Because it returns an IXQValue, it modifies the reference count of all objects in the sequence. For large sequences this is rather slow (e.g. it wastes 1 second to iterate over 10 million values in a simple benchmark.) and it is recommended to use GetEnumeratorPtrUnsafe. (it took 35ms for those 10 million values, comparable to the 30ms of a native loop not involving any enumerators)
|
|
function GetEnumeratorPtrUnsafe: TXQValueEnumeratorPtrUnsafe; virtual; |
Implements a faster version of GetEnumerator. It does not change any reference counts, not even of self, so it must not be used with values returned by functions!
|
Generated by PasDoc 0.14.0.
|