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

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

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

revision 1.10 by cpcp, Sun Nov 16 15:22:12 2003 UTC revision 1.11 by cpcp, Mon Dec 1 20:20:52 2003 UTC
# Line 53  GEDCOMParser::FamilyEvent * GEDCOMParser Line 53  GEDCOMParser::FamilyEvent * GEDCOMParser
53    return _events.back().getPtr();    return _events.back().getPtr();
54  }  }
55    
 GEDCOMParser::FamilyEvent * GEDCOMParser::FamilyRecord::getMarriageEvent(void) const  
 {  
   GEDCOMParser::FamilyEvent * res = 0;  
     
   GEDCOMParser::FamilyEvents_t::const_iterator event_iter = find(_events.begin(), _events.end(), GEDCOMParser::FamilyEvent::e_Marr);  
   if (event_iter != _events.end())  
     {  
       res = (*event_iter).getPtr();  
     }  
   return res;  
 }  
   
56  void GEDCOMParser::FamilyRecord::setHusb(std::string const & value)  void GEDCOMParser::FamilyRecord::setHusb(std::string const & value)
57  {  {
58    _husb = value;    _husb = value;
# Line 77  void GEDCOMParser::FamilyRecord::setWife Line 65  void GEDCOMParser::FamilyRecord::setWife
65    return;    return;
66  }  }
67    
 void GEDCOMParser::FamilyRecord::setSpouse(GEDCOMParser::IndividualRecord const &individual)  
 {  
   if (individual.getSex() == GEDCOMParser::IndividualRecord::MALE)  
     {  
       setHusb(individual.getId());  
     }  
   else  
     {  
       setWife(individual.getId());  
     }  
   return;  
 }  
   
 void GEDCOMParser::FamilyRecord::setSpouse(SmartPtr < GEDCOMParser::IndividualRecord > const &individual)  
 {  
   if (! individual.Null())  
     {  
       setSpouse(*(individual.getPtr()));  
     }  
   return;  
 }  
   
 std::string GEDCOMParser::FamilyRecord::getSpouseId(GEDCOMParser::IndividualRecord const &individual) const  
 {  
   std::string res = getHusb();  
   if (individual.getSex() == GEDCOMParser::IndividualRecord::MALE)  
     {  
       res = getWife();  
     }  
   return res;  
 }  
   
 void GEDCOMParser::FamilyRecord::RemoveSpouse(GEDCOMParser::IndividualRecord const &individual)  
 {  
   if (individual.getSex() == GEDCOMParser::IndividualRecord::MALE)  
     {  
       if (getHusb() == individual.getId())  
         {  
           setHusb("");  
         }  
     }  
   else  
     {  
       if (getWife() == individual.getId())  
         {  
           setWife("");  
         }  
     }  
   return;  
 }  
   
68  void GEDCOMParser::FamilyRecord::addChilXref(std::string const & value)  void GEDCOMParser::FamilyRecord::addChilXref(std::string const & value)
69  {  {
70    _chil_xrefs.push_back(value);    _chil_xrefs.push_back(value);

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

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