Qt 4.8
Public Functions | List of all members
QPatternist::AbstractDurationToDurationCaster Class Reference

Casts an AbstractDuration instance to Duration. More...

#include <qatomiccasters_p.h>

Inheritance diagram for QPatternist::AbstractDurationToDurationCaster:
QPatternist::AtomicCaster QPatternist::AtomicTypeVisitorResult QSharedData

Public Functions

virtual Item castFrom (const Item &from, const QExplicitlySharedDataPointer< DynamicContext > &context) const
 
- Public Functions inherited from QPatternist::AtomicCaster
 AtomicCaster ()
 
virtual ~AtomicCaster ()
 
- Public Functions inherited from QPatternist::AtomicTypeVisitorResult
 AtomicTypeVisitorResult ()
 
virtual ~AtomicTypeVisitorResult ()
 
- 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...
 

Additional Inherited Members

- Public Types inherited from QPatternist::AtomicCaster
typedef QExplicitlySharedDataPointer< AtomicCasterPtr
 
- Public Types inherited from QPatternist::AtomicTypeVisitorResult
typedef QExplicitlySharedDataPointer< AtomicTypeVisitorResultPtr
 
- Public Variables inherited from QSharedData
QAtomicInt ref
 

Detailed Description

Casts an AbstractDuration instance to Duration.

Author
Frans Englich frans.nosp@m..eng.nosp@m.lich@.nosp@m.noki.nosp@m.a.com

Definition at line 580 of file qatomiccasters_p.h.

Functions

◆ castFrom()

Item AbstractDurationToDurationCaster::castFrom ( const Item from,
const QExplicitlySharedDataPointer< DynamicContext > &  context 
) const
virtual

Casts from to an atomic value of the type this class casts to, and returns that value. The context is used for reporting errors in case the casting fails, and to in general access information from the dynamic context.

Implements QPatternist::AtomicCaster.

Definition at line 243 of file qatomiccasters.cpp.

245 {
246  const AbstractDuration *const val = from.as<AbstractDuration>();
247 
248  return Duration::fromComponents(val->isPositive(),
249  val->years(),
250  val->months(),
251  val->days(),
252  val->hours(),
253  val->minutes(),
254  val->seconds(),
255  val->mseconds());
256 }
virtual SecondProperty seconds() const =0
Base class for classes implementing durations.
virtual MinuteProperty minutes() const =0
static Duration::Ptr fromComponents(const bool isPositive, const YearProperty years, const MonthProperty months, const DayCountProperty days, const HourProperty hours, const MinuteProperty minutes, const SecondProperty seconds, const MSecondProperty mseconds)
Definition: qduration.cpp:113
virtual MonthProperty months() const =0
virtual DayCountProperty days() const =0
virtual HourProperty hours() const =0
virtual YearProperty years() const =0
TCastTarget * as() const
Definition: qitem_p.h:278
virtual MSecondProperty mseconds() const =0

The documentation for this class was generated from the following files: