/[ghosts]/ghosts/gedcomparser/src/GEDCOMParser/Event.cpp
ViewVC logotype

Diff of /ghosts/gedcomparser/src/GEDCOMParser/Event.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.2.1 by cpcp, Sun Aug 18 19:49:21 2002 UTC revision 1.1.2.2 by cpcp, Wed Oct 23 20:44:48 2002 UTC
# Line 28  void GEDCOMParser::Event::_setType(std:: Line 28  void GEDCOMParser::Event::_setType(std::
28    return;    return;
29  }  }
30    
31  void GEDCOMParser::Event::_setDate(std::string const & value)  void GEDCOMParser::Event::_setDate(GEDCOMParser::DateManagement::DateValue const &date)
32  {  {
33    _date = value;    if ((_date != 0) && (_date != &date))
34        {
35          delete _date; _date = 0;
36        }
37      if (_date != &date)
38        {
39          _date = new GEDCOMParser::DateManagement::DateValue(date);
40        }
41    return;    return;
42  }  }
43    
44    
45  void GEDCOMParser::Event::_setPlace(SmartPtr<GEDCOMParser::Place> const & value)  void GEDCOMParser::Event::_setPlace(SmartPtr<GEDCOMParser::Place> const & value)
46  {  {
47    _place = value;    _place = value;
# Line 91  void GEDCOMParser::Event::setType(std::s Line 99  void GEDCOMParser::Event::setType(std::s
99    
100  void GEDCOMParser::Event::setDate(std::string const &  value)  void GEDCOMParser::Event::setDate(std::string const &  value)
101  {  {
102    _setDate(value);    if (_date == 0)
103        {
104          _date = new GEDCOMParser::DateManagement::DateValue(value);
105        }
106      else
107        {
108          _date->setValue(value);
109        }
110    _updated_attr = e_Date;    _updated_attr = e_Date;
111    return;    return;
112  }  }
# Line 163  void GEDCOMParser::Event::copyLastUpdate Line 178  void GEDCOMParser::Event::copyLastUpdate
178        }        }
179      case e_Date:      case e_Date:
180        {        {
181          _setDate(e._date);          _setDate(*(e._date));
182          break;          break;
183        }        }
184      case e_Place:      case e_Place:
# Line 254  std::string const &GEDCOMParser::Event:: Line 269  std::string const &GEDCOMParser::Event::
269  {  {
270    return _type;    return _type;
271  }  }
272  std::string const &GEDCOMParser::Event::getDate(void) const  
273    std::string const GEDCOMParser::Event::getDate(void) const
274  {  {
275    return _date;    std::string res;
276      if (_date != 0)
277        {
278          res  = _date->getDisplayValue();
279        }
280      return res;
281  }  }
282    
283  std::string const &GEDCOMParser::Event::getAge(void) const  std::string const &GEDCOMParser::Event::getAge(void) const

Legend:
Removed from v.1.1.2.1  
changed lines
  Added in v.1.1.2.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26