48 template<
typename TSubClass>
51 const Item item(m_operands.first()->evaluateSingleton(context));
54 return static_cast<const TSubClass *
>(
this)->
63 return Integer::fromValue(duration->
years() * (duration->
isPositive() ? 1 : -1));
68 return Integer::fromValue(duration->
months() * (duration->
isPositive() ? 1 : -1));
73 return Integer::fromValue(duration->
days() * (duration->
isPositive() ? 1 : -1));
78 return Integer::fromValue(duration->
hours() * (duration->
isPositive() ? 1 : -1));
83 return Integer::fromValue(duration->
minutes() * (duration->
isPositive() ? 1 : -1));
92 template<
typename TSubClass>
95 const Item item(m_operands.first()->evaluateSingleton(context));
98 return static_cast<const TSubClass *
>(
this)->
107 return Integer::fromValue(dt.
date().
year());
112 return Integer::fromValue(dt.
date().
day());
117 return Integer::fromValue(dt.
time().
minute());
123 return toItem(Decimal::fromValue(time.second() + time.msec() / 1000.0));
129 return toItem(CommonValues::DayTimeDurationZero);
138 return Integer::fromValue(dt.
date().
month());
143 return Integer::fromValue(dt.
time().
hour());
virtual SecondProperty seconds() const =0
Base class for classes implementing durations.
Base class for classes implementing values related to time, date or both.
virtual MinuteProperty minutes() const =0
int month() const
Returns the number corresponding to the month of this date, using the following convention: ...
int day() const
Returns the day of the month (1 to 31) of this date.
Item toItem(const QExplicitlySharedDataPointer< T > atomicValue)
virtual MonthProperty months() const =0
The QTime class provides clock time functions.
virtual DayCountProperty days() const =0
const QDateTime & toDateTime() const
virtual HourProperty hours() const =0
int minute() const
Returns the minute part (0 to 59) of the time.
virtual YearProperty years() const =0
QDate date() const
Returns the date part of the datetime.
The QDateTime class provides date and time functions.
Represents an item in the XPath 2.0 Data Model.
Qt::TimeSpec timeSpec() const
Returns the time specification of the datetime.
int year() const
Returns the year of this date.
QTime time() const
Returns the time part of the datetime.
virtual MSecondProperty mseconds() const =0
int hour() const
Returns the hour part (0 to 23) of the time.