1 |
|
/* |
2 |
|
Copyright 2002 Cyril Picard |
3 |
|
|
4 |
|
This file is part of the GEDCOMParser library |
5 |
|
(developed within the Genealogy Free Software Tools project). |
6 |
|
|
7 |
|
The GEDCOMParser library is free software; you can redistribute it and/or modify |
8 |
|
it under the terms of the GNU General Public License as published by |
9 |
|
the Free Software Foundation; either version 2 of the License, or |
10 |
|
(at your option) any later version. |
11 |
|
|
12 |
|
The GEDCOMParser library is distributed in the hope that it will be useful, |
13 |
|
but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 |
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 |
|
GNU General Public License for more details. |
16 |
|
|
17 |
|
You should have received a copy of the GNU General Public License |
18 |
|
along with the GEDCOMParser library ; if not, write to the Free Software |
19 |
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
20 |
|
|
21 |
|
*/ |
22 |
|
|
23 |
|
#ifndef _GEDCOMPARSER_DATEMANAGEMENT_PERIOD_HH_ |
24 |
|
#define _GEDCOMPARSER_DATEMANAGEMENT_PERIOD_HH_ |
25 |
|
|
26 |
|
#include "GEDCOMParser/DateManagement/Date.hh" |
27 |
|
/// |
28 |
|
namespace GEDCOMParser |
29 |
|
{ |
30 |
|
/// |
31 |
|
namespace DateManagement |
32 |
|
{ |
33 |
|
/** @memo Implements the GEDCOM 5.5 DATE_PERIOD primitive element |
34 |
|
**/ |
35 |
|
class Period |
36 |
|
{ |
37 |
|
public: |
38 |
|
Period(void) : |
39 |
|
_date_from(0), |
40 |
|
_date_to(0) |
41 |
|
{}; |
42 |
|
Period(Period const &p) : |
43 |
|
_date_from(0), |
44 |
|
_date_to(0) |
45 |
|
{ |
46 |
|
if (p._date_from != 0) |
47 |
|
{ |
48 |
|
_date_from = new GEDCOMParser::DateManagement::Date(*p._date_from); |
49 |
|
} |
50 |
|
if (p._date_to != 0) |
51 |
|
{ |
52 |
|
_date_to = new GEDCOMParser::DateManagement::Date(*p._date_to); |
53 |
|
} |
54 |
|
}; |
55 |
|
~Period(void) |
56 |
|
{ |
57 |
|
delete _date_from; |
58 |
|
delete _date_to; |
59 |
|
return; |
60 |
|
}; |
61 |
|
///@name Accessors (set) |
62 |
|
//@{ |
63 |
|
/// |
64 |
|
void setDateFrom(GEDCOMParser::DateManagement::Date const &from); |
65 |
|
/// |
66 |
|
void setDateTo(GEDCOMParser::DateManagement::Date const &to); |
67 |
|
//@} |
68 |
|
|
69 |
|
///@name Accessors (get) |
70 |
|
//@{ |
71 |
|
/// |
72 |
|
std::string const getDisplayValue(void) const; |
73 |
|
//@} |
74 |
|
private: |
75 |
|
GEDCOMParser::DateManagement::Date * _date_from; |
76 |
|
GEDCOMParser::DateManagement::Date * _date_to; |
77 |
|
}; |
78 |
|
}; |
79 |
|
}; |
80 |
|
|
81 |
|
#endif |