| 406 |
return found; |
return found; |
| 407 |
} |
} |
| 408 |
|
|
| 409 |
|
bool GEDCOMParser::LineageLinkageGedcom::hasSpouse(GEDCOMParser::IndividualRecord const * const individu) const |
| 410 |
|
{ |
| 411 |
|
std::string fam_id; |
| 412 |
|
std::string spouse_id; |
| 413 |
|
FamilyRecords_t::const_iterator fam_iter; |
| 414 |
|
IndividualRecords_t::const_iterator spouse_iter; |
| 415 |
|
bool found = false; |
| 416 |
|
|
| 417 |
|
if (individu != 0) |
| 418 |
|
{ |
| 419 |
|
SpouseToFamilyLinks_t spouse_to_family_links = individu->getSpouseToFamilyLinks(); |
| 420 |
|
SpouseToFamilyLinks_t::const_iterator spouse_to_family_links_iter = spouse_to_family_links.begin(); |
| 421 |
|
while ((!found) && (spouse_to_family_links_iter != spouse_to_family_links.end())) |
| 422 |
|
{ |
| 423 |
|
fam_id = (*spouse_to_family_links_iter)->getFamsXref(); |
| 424 |
|
fam_iter = _family_records.find(fam_id); |
| 425 |
|
if (fam_iter != _family_records.end()) |
| 426 |
|
{ |
| 427 |
|
if (individu->getSex() == "M") |
| 428 |
|
{ |
| 429 |
|
spouse_id = (*fam_iter).second->getWife(); |
| 430 |
|
} |
| 431 |
|
else |
| 432 |
|
{ |
| 433 |
|
spouse_id = (*fam_iter).second->getHusb(); |
| 434 |
|
} |
| 435 |
|
if (spouse_id != "") |
| 436 |
|
{ |
| 437 |
|
found = true; |
| 438 |
|
} |
| 439 |
|
} |
| 440 |
|
spouse_to_family_links_iter++; |
| 441 |
|
} |
| 442 |
|
} |
| 443 |
|
return found; |
| 444 |
|
} |
| 445 |
|
|
| 446 |
|
|
| 447 |
bool GEDCOMParser::LineageLinkageGedcom::FamilyIsUsed(GEDCOMParser::FamilyRecord const * const family) const |
bool GEDCOMParser::LineageLinkageGedcom::FamilyIsUsed(GEDCOMParser::FamilyRecord const * const family) const |
| 448 |
{ |
{ |
| 474 |
|
|
| 475 |
GEDCOMParser::IndividualRecords_t GEDCOMParser::LineageLinkageGedcom::getRootIndividuals(void) const |
GEDCOMParser::IndividualRecords_t GEDCOMParser::LineageLinkageGedcom::getRootIndividuals(void) const |
| 476 |
{ |
{ |
|
int cpt_individus = 0; |
|
| 477 |
GEDCOMParser::IndividualRecords_t children; |
GEDCOMParser::IndividualRecords_t children; |
| 478 |
for (GEDCOMParser::IndividualRecords_t::const_iterator iter = _individual_records.begin(); iter != _individual_records.end() ; iter++) |
for (GEDCOMParser::IndividualRecords_t::const_iterator iter = _individual_records.begin(); iter != _individual_records.end() ; iter++) |
| 479 |
{ |
{ |
| 480 |
if (hasChildren((*iter).second.getPtr()) == false) |
if (hasChildren((*iter).second.getPtr()) == false) |
| 481 |
{ |
{ |
| 482 |
children[(*iter).second->getId()] = (*iter).second; |
children[(*iter).second->getId()] = (*iter).second; |
|
cpt_individus++; |
|
| 483 |
} |
} |
| 484 |
} |
} |
| 485 |
return children; |
return children; |