/** Copyright 2002 Cyril Picard This file is part of the GEDCOMParser library (developed within the Genealogy Free Software Tools project). The GEDCOMParser library is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. The GEDCOMParser library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the GEDCOMParser library ; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA **/ #ifndef _GEDCOMPARSER_DATEMANAGEMENT_DATE_HH_ #define _GEDCOMPARSER_DATEMANAGEMENT_DATE_HH_ #include namespace GEDCOMParser { namespace DateManagement { class Date /** @memo Implements the GEDCOM 5.5 DATE primitive element */ { public: /// @memo Implements the GEDCOM 5.5 CALENDARS enumeration (typedef'd to enumCalendars) enum _enumCalendars { /// e_Gregorian, /// e_Julian, /// e_French, /// e_Hebrew, /// e_Future, /// e_Unknown }; typedef enum _enumCalendars enumCalendars; /// @memo Implements the GEDCOM 5.5 DATE PRECISIONS enumeration (typedef'd to enumPrecisionDateTypes) enum _enumPrecisionDateTypes { /// e_PrecisionNull, /// e_Exact, /// e_About, /// e_Calculated, /// e_Estimated }; typedef enum _enumPrecisionDateTypes enumPrecisionDateTypes; /// @memo Implements the months enumeration (typedef'd to enumMonths) enum _enumMonths { /// e_MonthNull, /// e_Jan, /// e_Feb, /// e_Mar, /// e_Apr, /// e_May, /// e_Jun, /// e_Jul, /// e_Aug, /// e_Sep, /// e_Oct, /// e_Nov, /// e_Dec, /// e_Hebr_Tsh, /// e_Hebr_Csh, /// e_Hebr_Ksl, /// e_Hebr_Tvt, /// e_Hebr_Shv, /// e_Hebr_Adr, /// e_Hebr_Ads, /// e_Hebr_Nsn, /// e_Hebr_Iyr, /// e_Hebr_Svn, /// e_Hebr_Tmz, /// e_Hebr_Aav, /// e_Hebr_Ell, /// e_Fren_Vend, /// e_Fren_Brum, /// e_Fren_Frim, /// e_Fren_Nivo, /// e_Fren_Pluv, /// e_Fren_Vent, /// e_Fren_Germ, /// e_Fren_Flor, /// e_Fren_Prai, /// e_Fren_Mess, /// e_Fren_Ther, /// e_Fren_Fruc, /// e_Fren_Comp }; typedef enum _enumMonths enumMonths; Date(void) : _calendar(e_Gregorian), _day(""), _month(e_MonthNull), _year(""), _precision(e_PrecisionNull) {}; Date(Date const &d) : _calendar(d._calendar), _day(d._day), _month(d._month), _year(d._year), _precision(d._precision) { }; void setCalendar(enumCalendars cal); void setDay(std::string const &day); void setMonth(enumMonths month); void setYear(std::string const &year); void setPrecision(enumPrecisionDateTypes prec); std::string const getDisplayValue(void) const; private: enumCalendars _calendar; std::string _day; enumMonths _month; std::string _year; enumPrecisionDateTypes _precision; }; }; }; #endif