KTimeZoneSource Class Reference
from PyKDE4.kdecore import *
Detailed Description
Methods | |
__init__ (self) | |
__init__ (self, bool useZoneParse) | |
__init__ (self, KTimeZoneSource other) | |
KTimeZoneData | parse (self, KTimeZone zone) |
bool | useZoneParse (self) |
Method Documentation
__init__ | ( | self ) |
__init__ | ( | self, | ||
bool | useZoneParse | |||
) |
Constructor for use by derived classes, which specifies whether the source database supports the ad hoc extraction of data for individual time zones using parse(const KTimeZone&).
If parse(const KTimeZone&) cannot be used, KTimeZone derived classes which use this KTimeZoneSource derived class must create a KTimeZoneData object at construction time so that KTimeZone.data() will always return a data object.
Note the default constructor is equivalent to KTimeZoneSource(true), i.e. it is only necessary to use this constructor if parse(const KTimeZone&) does not work.
- Parameters:
-
useZoneParse true if parse(const KTimeZone&) works, false if parsing must be performed by other methods
__init__ | ( | self, | ||
KTimeZoneSource | other | |||
) |
KTimeZoneData parse | ( | self, | ||
KTimeZone | zone | |||
) |
Extracts detail information for one time zone from the source database.
In this base class, the method always succeeds and returns an empty data instance. Derived classes should reimplement this method to return an appropriate data class derived from KTimeZoneData. Some source databases may not be compatible with this method of parsing. In these cases, they should use the constructor KTimeZoneSource(false) and calling this method will produce a fatal error.
- Parameters:
-
zone the time zone for which data is to be extracted.
- Returns:
- an instance of a class derived from KTimeZoneData containing the parsed data. The caller is responsible for deleting the KTimeZoneData instance. Null is returned on error.
bool useZoneParse | ( | self ) |
Return whether the source database supports the ad hoc extraction of data for individual time zones using parse(const KTimeZone&).
- Returns:
- true if parse(const KTimeZone&) works, false if parsing must be performed by other methods