KHolidays Library
#include <holidayparserdriver_p.h>

Public Member Functions | |
HolidayParserDriver (const QString &filePath) | |
virtual | ~HolidayParserDriver () |
virtual void | error (const QString &errorMessage) |
virtual QString | fileCountryCode () const |
virtual QString | fileDescription () const |
virtual QString | fileLanguageCode () const |
virtual QString | fileName () const |
virtual Holiday::List | parseHolidays (const QDate &startDate, const QDate &endDate, Holiday::MultidayMode multidayMode) |
virtual Holiday::List | parseHolidays (const QDate &date, Holiday::MultidayMode multidayMode) |
virtual Holiday::List | parseHolidays (int calendarYear, const QString &calendarType, Holiday::MultidayMode multidayMode) |
Protected Member Functions | |
virtual void | parse () |
virtual void | parseMetadata () |
virtual void | setParseCalendar (const QString &calendarType) |
virtual void | setParseStartEnd () |
Protected Attributes | |
QString | m_fileCountryCode |
QString | m_fileDescription |
QString | m_fileLanguageCode |
QString | m_fileName |
QString | m_filePath |
Holiday::MultidayMode | m_multidayMode |
KCalendarSystem * | m_parseCalendar |
int | m_parseEndYear |
int | m_parseStartYear |
int | m_parseYear |
QDate | m_requestEnd |
QDate | m_requestStart |
Holiday::List | m_resultList |
Detailed Description
HolidayParserDriver abstract base class.
Defines a standard interface for parsing holiday files of various formats
Derived classes must implemet method parse(), other methods should work for most circumstances
Private, for internal use only
Constructor & Destructor Documentation
HolidayParserDriver::HolidayParserDriver | ( | const QString & | filePath | ) | [explicit] |
Constructor of abstract holiday file parser driver class.
This will be called by derived classes.
- Parameters:
-
filePath full path to holiday file
Definition at line 29 of file holidayparserdriver.cpp.
HolidayParserDriver::~HolidayParserDriver | ( | ) | [virtual] |
Destructor.
Definition at line 35 of file holidayparserdriver.cpp.
Member Function Documentation
void HolidayParserDriver::error | ( | const QString & | errorMessage | ) | [virtual] |
Standard error message handling.
- Parameters:
-
errorMessage error message to log
Reimplemented in KHolidays::HolidayParserDriverPlan, and KHolidays::HolidayParserDriverPlanOld.
Definition at line 97 of file holidayparserdriver.cpp.
QString HolidayParserDriver::fileCountryCode | ( | ) | const [virtual] |
Return the ISO 3166 country/region code of the file.
May be either just a country code ("US" = USA) or may include a regional identifier ("US-CA" = California). Returns "XX" if not a country.
- Returns:
- the full country code of the file
Definition at line 40 of file holidayparserdriver.cpp.
QString HolidayParserDriver::fileDescription | ( | ) | const [virtual] |
Return the untranslated description of the file if available.
- Returns:
- the untranslated description of the file
Definition at line 55 of file holidayparserdriver.cpp.
QString HolidayParserDriver::fileLanguageCode | ( | ) | const [virtual] |
Return the ISO 639-1 language code of the file.
May be either just a language code ("en" = US English) or may include a country identifier ("en_GB" = British English).
- Returns:
- the language code of the file
Definition at line 45 of file holidayparserdriver.cpp.
QString HolidayParserDriver::fileName | ( | ) | const [virtual] |
Return the untranslated name of the file.
- Returns:
- the untranslated name code of the file
Definition at line 50 of file holidayparserdriver.cpp.
void HolidayParserDriver::parse | ( | ) | [protected, virtual] |
Actually parse the file, must be re-implemented by derived classes.
Reimplemented in KHolidays::HolidayParserDriverPlan, and KHolidays::HolidayParserDriverPlanOld.
Definition at line 102 of file holidayparserdriver.cpp.
Holiday::List HolidayParserDriver::parseHolidays | ( | const QDate & | startDate, |
const QDate & | endDate, | ||
Holiday::MultidayMode | multidayMode | ||
) | [virtual] |
Return a list of holidays falling between any two dates.
- Parameters:
-
startDate start date of the holiday parse range endDate end date of the holiday parse range multidayMode how to return multiday holidays
- Returns:
- a list of holidays
Definition at line 60 of file holidayparserdriver.cpp.
Holiday::List HolidayParserDriver::parseHolidays | ( | const QDate & | date, |
Holiday::MultidayMode | multidayMode | ||
) | [virtual] |
Convenience function Return a list of holidays falling on a given date.
- Parameters:
-
date date to return holidays for multidayMode how to return multiday holidays
- Returns:
- a list of holidays
Definition at line 75 of file holidayparserdriver.cpp.
Holiday::List HolidayParserDriver::parseHolidays | ( | int | calendarYear, |
const QString & | calendarType, | ||
Holiday::MultidayMode | multidayMode | ||
) | [virtual] |
Convenience function Return a list of holidays falling in a given calendar year.
- Parameters:
-
calendarYear year to return holidays for calendarType calendar system of year, standard KDE calendar type, see KCalendarSystem multidayMode how to return multiday holidays
- Returns:
- a list of holidays
Definition at line 81 of file holidayparserdriver.cpp.
void HolidayParserDriver::parseMetadata | ( | ) | [protected, virtual] |
Parse the file for metadata only and populate the metadata variables.
Reimplemented in KHolidays::HolidayParserDriverPlan, and KHolidays::HolidayParserDriverPlanOld.
Definition at line 106 of file holidayparserdriver.cpp.
void HolidayParserDriver::setParseCalendar | ( | const QString & | calendarType | ) | [protected, virtual] |
Set the calendar system to use.
- Parameters:
-
calendarType standard KDE calendar type, see KCalendarSystem
Definition at line 110 of file holidayparserdriver.cpp.
void HolidayParserDriver::setParseStartEnd | ( | ) | [protected, virtual] |
Initialise parse year variables for calendar system.
Definition at line 116 of file holidayparserdriver.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 04:38:39 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.