Patternist::DateTime Class Reference
[XQuery/XPath Data Model]

Implements the value instance of the xs:dateTime type. More...

#include <DateTime.h>

Inheritance diagram for Patternist::DateTime:

Inheritance graph
[legend]
Collaboration diagram for Patternist::DateTime:

Collaboration graph
[legend]
List of all members.

Public Types

typedef AtomicValue::Ptr Ptr

Public Member Functions

virtual Item::Ptr fromValue (const KDateTime &dt) const
virtual QString stringValue () const
 Returns the string value of this Item.
virtual ItemType::Ptr type () const
 Returns the ItemType this Item is of.

Static Public Member Functions

static DateTime::Ptr fromDateTime (const KDateTime &dt)
static DateTime::Ptr fromLexical (const QString &string)

Protected Member Functions

 DateTime (const KDateTime &dateTime)

Friends

class CommonValues

Detailed Description

Implements the value instance of the xs:dateTime type.

Author:
Frans Englich <frans.englich@telia.com>

Definition at line 28 of file DateTime.h.


Member Typedef Documentation

typedef AtomicValue::Ptr Patternist::DateTime::Ptr

A smart pointer wrapping AtomicValue instances.

Reimplemented from Patternist::AbstractDateTime.

Definition at line 31 of file DateTime.h.


Member Function Documentation

DateTime::Ptr DateTime::fromLexical ( const QString &  string  )  [static]

Creates an instance from the lexical representation string.

Definition at line 25 of file DateTime.cpp.

References Patternist::AbstractDateTime::create(), and DateTime().

Referenced by Patternist::StringToDateTimeCaster::castFrom().

Here is the call graph for this function:

Here is the caller graph for this function:

Item::Ptr DateTime::fromValue ( const KDateTime dt  )  const [virtual]

A factory function for creating instances that are of the dynamic type of this class, that represents dt.

The default implementation performs an assert() call. This function is not pure virtual because all sub-classes do not use it.

Reimplemented from Patternist::AbstractDateTime.

Definition at line 69 of file DateTime.cpp.

References fromDateTime(), and KDateTime::isValid().

Here is the call graph for this function:

QString DateTime::stringValue (  )  const [virtual]

Returns the string value of this Item.

In the case of a node, it is the node value corresponding to the particular node type. For atomic values, it is equivalent to the value cast as xs:string.

Conceptually, this functions corresponds to the dm:string-value accessor.

See also:
XQuery 1.0 and XPath 2.0 Data Model, 5.13 string-value Accessor
Returns:
the string value.

Implements Patternist::Item.

Definition at line 75 of file DateTime.cpp.

References Patternist::AbstractDateTime::dateToString(), Patternist::AbstractDateTime::timeToString(), and Patternist::AbstractDateTime::zoneOffsetToString().

Here is the call graph for this function:

ItemType::Ptr DateTime::type (  )  const [virtual]

Returns the ItemType this Item is of.

For example, if this Item is an XML node, more specifically a text node, text() is returned. That is, BuiltinTypes::text. However, if this Item is an atomic value of type xs:long that is what's returned, BuiltinTypes::xsLong.

Returns:
the type of this Item.

Implements Patternist::Item.

Definition at line 80 of file DateTime.cpp.

References Patternist::BuiltinTypes::xsDateTime.


The documentation for this class was generated from the following files:
Generated on Thu Feb 8 14:54:32 2007 for Patternist by  doxygen 1.5.1