Qt 4.8
|
Base class for classes implementing durations. More...
#include <qabstractduration_p.h>
Classes | |
class | CaptureTable |
Acts as a mapping table for AbstractDuration::create() and describes where certain fields in a QRegExp pattern can be found for a particular W3C XML Schema duration type. More... | |
Public Types | |
typedef QExplicitlySharedDataPointer< AbstractDuration > | Ptr |
typedef qint64 | Value |
The amount in milli seconds. More... | |
Public Types inherited from QPatternist::AtomicValue | |
typedef QList< AtomicValue::Ptr > | List |
typedef QExplicitlySharedDataPointer< AtomicValue > | Ptr |
Public Functions | |
virtual DayCountProperty | days () const =0 |
virtual Item | fromValue (const Value val) const =0 |
virtual HourProperty | hours () const =0 |
bool | isPositive () const |
virtual MinuteProperty | minutes () const =0 |
virtual MonthProperty | months () const =0 |
virtual MSecondProperty | mseconds () const =0 |
bool | operator== (const AbstractDuration &other) const |
virtual SecondProperty | seconds () const =0 |
virtual Value | value () const =0 |
virtual YearProperty | years () const =0 |
Public Functions inherited from QPatternist::AtomicValue | |
virtual bool | evaluateEBV (const QExplicitlySharedDataPointer< DynamicContext > &context) const |
virtual bool | hasError () const |
virtual QString | stringValue () const =0 |
virtual ItemType::Ptr | type () const =0 |
virtual | ~AtomicValue () |
Public Functions inherited from QSharedData | |
QSharedData () | |
Constructs a QSharedData object with a reference count of 0. More... | |
QSharedData (const QSharedData &) | |
Constructs a QSharedData object with reference count 0. More... | |
Public Functions inherited from QPatternist::CppCastingHelper< AtomicValue > | |
const TCastTarget * | as () const |
TCastTarget * | as () |
Protected Functions | |
AbstractDuration (const bool isPos) | |
Protected Functions inherited from QPatternist::AtomicValue | |
AtomicValue () | |
Protected Functions inherited from QPatternist::CppCastingHelper< AtomicValue > | |
CppCastingHelper () | |
Static Protected Functions | |
static AtomicValue::Ptr | create (const CaptureTable &captTable, const QString &lexical, bool *isPositive, YearProperty *years, MonthProperty *months, DayCountProperty *days, HourProperty *hours, MinuteProperty *minutes, SecondProperty *seconds, MSecondProperty *mseconds) |
static QString | serializeMSeconds (const MSecondProperty mseconds) |
Protected Variables | |
const bool | m_isPositive |
Additional Inherited Members | |
Static Public Functions inherited from QPatternist::AtomicValue | |
static ItemType::Ptr | qtToXDMType (const QXmlItem &item) |
static QVariant | toQt (const AtomicValue *const value) |
static QVariant | toQt (const AtomicValue::Ptr &value) |
static Item | toXDM (const QVariant &value) |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
Base class for classes implementing durations.
Definition at line 76 of file qabstractduration_p.h.
Definition at line 79 of file qabstractduration_p.h.
The amount in milli seconds.
Definition at line 84 of file qabstractduration_p.h.
|
protected |
Definition at line 54 of file qabstractduration.cpp.
|
staticprotected |
Definition at line 61 of file qabstractduration.cpp.
Referenced by QPatternist::Duration::fromLexical(), QPatternist::YearMonthDuration::fromLexical(), and QPatternist::DayTimeDuration::fromLexical().
|
pure virtual |
Implemented in QPatternist::YearMonthDuration, QPatternist::DayTimeDuration, and QPatternist::Duration.
Referenced by QPatternist::AbstractDurationComparator::addDurationToDateTime(), QPatternist::AbstractDurationToDurationCaster::castFrom(), QPatternist::AbstractDurationToDayTimeDurationCaster::castFrom(), QPatternist::DaysFromDurationFN::extract(), and operator==().
A polymorphic factory function that returns instances of the sub-class with the value val
.
Implemented in QPatternist::DayTimeDuration, QPatternist::Duration, and QPatternist::YearMonthDuration.
|
pure virtual |
Implemented in QPatternist::YearMonthDuration, QPatternist::DayTimeDuration, and QPatternist::Duration.
Referenced by QPatternist::AbstractDurationComparator::addDurationToDateTime(), QPatternist::AbstractDurationToDurationCaster::castFrom(), QPatternist::AbstractDurationToDayTimeDurationCaster::castFrom(), QPatternist::HoursFromDurationFN::extract(), and operator==().
bool AbstractDuration::isPositive | ( | ) | const |
Determines whether this AbstractDuration is positive. For example, "P10H" is positive, while "-P10H" is not.
true
if this AbstractDuration is positive, otherwise false
. Definition at line 230 of file qabstractduration.cpp.
Referenced by QPatternist::AbstractDurationComparator::addDurationToDateTime(), QPatternist::AbstractDurationToDurationCaster::castFrom(), QPatternist::AbstractDurationToDayTimeDurationCaster::castFrom(), QPatternist::AbstractDurationToYearMonthDurationCaster::castFrom(), QPatternist::YearsFromDurationFN::extract(), QPatternist::MonthsFromDurationFN::extract(), QPatternist::DaysFromDurationFN::extract(), QPatternist::HoursFromDurationFN::extract(), QPatternist::MinutesFromDurationFN::extract(), QPatternist::SecondsFromDurationFN::extract(), and operator==().
|
pure virtual |
Implemented in QPatternist::YearMonthDuration, QPatternist::DayTimeDuration, and QPatternist::Duration.
Referenced by QPatternist::AbstractDurationComparator::addDurationToDateTime(), QPatternist::AbstractDurationToDurationCaster::castFrom(), QPatternist::AbstractDurationToDayTimeDurationCaster::castFrom(), QPatternist::MinutesFromDurationFN::extract(), and operator==().
|
pure virtual |
Implemented in QPatternist::DayTimeDuration, QPatternist::YearMonthDuration, and QPatternist::Duration.
Referenced by QPatternist::AbstractDurationComparator::addDurationToDateTime(), QPatternist::AbstractDurationToDurationCaster::castFrom(), QPatternist::AbstractDurationToYearMonthDurationCaster::castFrom(), QPatternist::MonthsFromDurationFN::extract(), and operator==().
|
pure virtual |
Implemented in QPatternist::YearMonthDuration, QPatternist::DayTimeDuration, and QPatternist::Duration.
Referenced by QPatternist::AbstractDurationComparator::addDurationToDateTime(), QPatternist::AbstractDurationToDurationCaster::castFrom(), QPatternist::AbstractDurationToDayTimeDurationCaster::castFrom(), QPatternist::SecondsFromDurationFN::extract(), operator==(), and serializeMSeconds().
bool AbstractDuration::operator== | ( | const AbstractDuration & | other | ) | const |
Determines whether this Duration is equal to other
.
Definition at line 185 of file qabstractduration.cpp.
|
pure virtual |
Implemented in QPatternist::YearMonthDuration, QPatternist::DayTimeDuration, and QPatternist::Duration.
Referenced by QPatternist::AbstractDurationComparator::addDurationToDateTime(), QPatternist::AbstractDurationToDurationCaster::castFrom(), QPatternist::AbstractDurationToDayTimeDurationCaster::castFrom(), QPatternist::SecondsFromDurationFN::extract(), and operator==().
|
staticprotected |
Definition at line 212 of file qabstractduration.cpp.
Referenced by QPatternist::Duration::stringValue(), and QPatternist::DayTimeDuration::stringValue().
|
pure virtual |
Implemented in QPatternist::DayTimeDuration, QPatternist::Duration, and QPatternist::YearMonthDuration.
|
pure virtual |
Implemented in QPatternist::DayTimeDuration, QPatternist::Duration, and QPatternist::YearMonthDuration.
Referenced by QPatternist::AbstractDurationComparator::addDurationToDateTime(), QPatternist::AbstractDurationToDurationCaster::castFrom(), QPatternist::AbstractDurationToYearMonthDurationCaster::castFrom(), QPatternist::YearsFromDurationFN::extract(), and operator==().
|
protected |
Definition at line 184 of file qabstractduration_p.h.
Referenced by isPositive(), QPatternist::YearMonthDuration::stringValue(), QPatternist::Duration::stringValue(), QPatternist::DayTimeDuration::stringValue(), QPatternist::YearMonthDuration::value(), and QPatternist::DayTimeDuration::value().