Qt 4.8
|
Base class for classes implementing values related to time, date or both. More...
#include <qabstractdatetime_p.h>
Classes | |
class | CaptureTable |
Acts as a mapping table for AbstractDateTime::create() and describes where certain fields in a QRegExp pattern can be found for a particular W3C XML Schema date/time type. More... | |
Public Types | |
enum | { DefaultYear = 2000, DefaultMonth = 1, DefaultDay = 1 } |
typedef QExplicitlySharedDataPointer< AbstractDateTime > | Ptr |
Public Types inherited from QPatternist::AtomicValue | |
typedef QList< AtomicValue::Ptr > | List |
typedef QExplicitlySharedDataPointer< AtomicValue > | Ptr |
Public Functions | |
AbstractDateTime (const QDateTime &dateTime) | |
QString | dateToString () const |
virtual Item | fromValue (const QDateTime &dt) const |
QString | timeToString () const |
const QDateTime & | toDateTime () const |
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 () |
Static Public Functions | |
static bool | isRangeValid (const QDate &date, QString &message) |
static QString | serializeMSeconds (const MSecondProperty msecs) |
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) |
Protected Functions | |
QString | zoneOffsetToString () const |
Protected Functions inherited from QPatternist::AtomicValue | |
AtomicValue () | |
Protected Functions inherited from QPatternist::CppCastingHelper< AtomicValue > | |
CppCastingHelper () | |
Static Protected Functions | |
static void | copyTimeSpec (const QDateTime &from, QDateTime &to) |
Makes the QDateTime::timeSpec() and QDateTime::zoneOffset() of ot * consistent to from . More... | |
static QDateTime | create (AtomicValue::Ptr &errorMessage, const QString &lexicalSource, const CaptureTable &captTable) |
Protected Variables | |
const QDateTime | m_dateTime |
Private Types | |
enum | ZoneOffsetParseResult { Error, Offset, LocalTime, UTC } |
Static Private Functions | |
static ZOTotal | parseZoneOffset (ZoneOffsetParseResult &result, const QStringList &capts, const CaptureTable &captTable) |
Parses the zone offset. All types use zone offsets. More... | |
static void | setUtcOffset (QDateTime &result, const ZoneOffsetParseResult zoResult, const int zoOffset) |
Additional Inherited Members | |
Public Variables inherited from QSharedData | |
QAtomicInt | ref |
Base class for classes implementing values related to time, date or both.
Definition at line 80 of file qabstractdatetime_p.h.
Definition at line 83 of file qabstractdatetime_p.h.
anonymous enum |
|
private |
Enumerator | |
---|---|
Error | syntax or logical error was encountered. |
Offset | It's a valid offset from UTC. |
LocalTime | No zone offset was specified, it's an implementation defined zone offset. |
UTC |
Definition at line 221 of file qabstractdatetime_p.h.
AbstractDateTime::AbstractDateTime | ( | const QDateTime & | dateTime | ) |
Definition at line 55 of file qabstractdatetime.cpp.
Makes the QDateTime::timeSpec() and QDateTime::zoneOffset() of ot
* consistent to from
.
Definition at line 373 of file qabstractdatetime.cpp.
Referenced by QPatternist::Date::fromDateTime(), QPatternist::GDay::fromDateTime(), QPatternist::GYearMonth::fromDateTime(), QPatternist::GYear::fromDateTime(), QPatternist::GMonthDay::fromDateTime(), QPatternist::GMonth::fromDateTime(), and QPatternist::SchemaTime::fromDateTime().
|
staticprotected |
Definition at line 64 of file qabstractdatetime.cpp.
Referenced by QPatternist::Date::fromLexical(), QPatternist::GDay::fromLexical(), QPatternist::GMonthDay::fromLexical(), QPatternist::GYearMonth::fromLexical(), QPatternist::GYear::fromLexical(), QPatternist::GMonth::fromLexical(), QPatternist::SchemaTime::fromLexical(), and QPatternist::DateTime::fromLexical().
QString AbstractDateTime::dateToString | ( | ) | const |
Definition at line 307 of file qabstractdatetime.cpp.
Referenced by QPatternist::Date::stringValue(), and QPatternist::DateTime::stringValue().
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 in QPatternist::DateTime, QPatternist::SchemaTime, and QPatternist::Date.
Definition at line 394 of file qabstractdatetime.cpp.
Determines whether dt
is a date-time that can be represented, and isn't too early or too late. If it is valid, true
is returned. Otherwise, false
is returned and message
is set to contain a translated message for human consumption, describing the error.
Definition at line 295 of file qabstractdatetime.cpp.
Referenced by QPatternist::DateTimeDurationMathematician::calculate().
|
staticprivate |
Parses the zone offset. All types use zone offsets.
If result is set to Offset, the offset is returned, otherwise the return value is undefined.
The offset is in seconds.
Definition at line 200 of file qabstractdatetime.cpp.
Referenced by create().
|
static |
Serializes the milli seconds msecs
into a string representation. For example, if msecs
is 1, ".001" is returned; if msecs
is 100 then is ".1" returned.
Definition at line 312 of file qabstractdatetime.cpp.
Referenced by timeToString().
|
inlinestaticprivate |
Definition at line 276 of file qabstractdatetime.cpp.
Referenced by create().
QString AbstractDateTime::timeToString | ( | ) | const |
Definition at line 330 of file qabstractdatetime.cpp.
Referenced by QPatternist::SchemaTime::stringValue(), and QPatternist::DateTime::stringValue().
|
inline |
Definition at line 97 of file qabstractdatetime_p.h.
Referenced by QPatternist::AbstractDateTimeMathematician::calculate(), QPatternist::AbstractDateTimeToGYearCaster::castFrom(), QPatternist::AbstractDateTimeToGYearMonthCaster::castFrom(), QPatternist::AbstractDateTimeToGMonthCaster::castFrom(), QPatternist::AbstractDateTimeToGMonthDayCaster::castFrom(), QPatternist::AbstractDateTimeToGDayCaster::castFrom(), QPatternist::AbstractDateTimeToDateTimeCaster::castFrom(), QPatternist::AbstractDateTimeToDateCaster::castFrom(), QPatternist::AbstractDateTimeToTimeCaster::castFrom(), QPatternist::XsdTypeChecker::checkConstrainingFacets(), QPatternist::AbstractDateTimeComparator::equals(), QPatternist::DateTimeFN::evaluateSingleton(), QPatternist::AdjustTimezone::evaluateSingleton(), QPatternist::ExtractFromDateTimeFN< TimezoneFromAbstractDateTimeFN >::evaluateSingleton(), and QPatternist::AtomicValue::toQt().
|
protected |
Definition at line 341 of file qabstractdatetime.cpp.
Referenced by QPatternist::Date::stringValue(), QPatternist::GDay::stringValue(), QPatternist::GYear::stringValue(), QPatternist::GYearMonth::stringValue(), QPatternist::GMonth::stringValue(), QPatternist::GMonthDay::stringValue(), QPatternist::SchemaTime::stringValue(), and QPatternist::DateTime::stringValue().
|
protected |
Definition at line 218 of file qabstractdatetime_p.h.
Referenced by dateToString(), QPatternist::GYearMonth::stringValue(), QPatternist::GDay::stringValue(), QPatternist::GYear::stringValue(), QPatternist::GMonth::stringValue(), QPatternist::GMonthDay::stringValue(), timeToString(), toDateTime(), and zoneOffsetToString().