• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDECore

Public Member Functions | Protected Member Functions | List of all members
KTimeZoneSource Class Reference
Time zone classes

#include <ktimezone.h>

Inheritance diagram for KTimeZoneSource:
Inheritance graph
[legend]

Public Member Functions

 KTimeZoneSource ()
 
virtual ~KTimeZoneSource ()
 
virtual KTimeZoneData * parse (const KTimeZone &zone) const
 
bool useZoneParse () const
 

Protected Member Functions

 KTimeZoneSource (bool useZoneParse)
 

Detailed Description

Base class representing a source of time zone information.

Derive subclasses from KTimeZoneSource to read and parse time zone details from a time zone database or other source of time zone information. If can know in advance what KTimeZone instances to create without having to parse the source data, you should reimplement the virtual method parse(const KTimeZone&). Otherwise, you need to define your own parse() methods with appropriate signatures, to both read and parse the new data, and create new KTimeZone instances.

KTimeZoneSource itself may be used as a dummy source which returns empty time zone details.

Base class representing a source of time zone information

See also
KTimeZone, KTimeZoneData
Author
David Jarvie djarv.nosp@m.ie@k.nosp@m.de.or.nosp@m.g.
S.R.Haque srhaq.nosp@m.ue@i.nosp@m.ee.or.nosp@m.g.

Definition at line 1230 of file ktimezone.h.

Constructor & Destructor Documentation

KTimeZoneSource::KTimeZoneSource ( )

Definition at line 959 of file ktimezone.cpp.

KTimeZoneSource::~KTimeZoneSource ( )
virtual

Definition at line 971 of file ktimezone.cpp.

KTimeZoneSource::KTimeZoneSource ( bool  useZoneParse)
explicitprotected

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
useZoneParsetrue if parse(const KTimeZone&) works, false if parsing must be performed by other methods

Definition at line 965 of file ktimezone.cpp.

Member Function Documentation

KTimeZoneData * KTimeZoneSource::parse ( const KTimeZone &  zone) const
virtual

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
zonethe 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.

Reimplemented in KSystemTimeZoneSource, KTzfileTimeZoneSource, and KSystemTimeZoneSourceWindows.

Definition at line 976 of file ktimezone.cpp.

bool KTimeZoneSource::useZoneParse ( ) const

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

Definition at line 982 of file ktimezone.cpp.


The documentation for this class was generated from the following files:
  • ktimezone.h
  • ktimezone.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:13 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDECore

Skip menu "KDECore"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal