| 7 |
#include <functional> |
#include <functional> |
| 8 |
|
|
| 9 |
namespace GEDCOMParser { |
namespace GEDCOMParser { |
| 10 |
class NameEqualsTo : public std::binary_function<std::string, GEDCOMParser::IndividualRecords_elem_t, bool> { |
namespace Predicates { |
| 11 |
bool operator()(std::string name, GEDCOMParser::IndividualRecords_elem_t individu) const |
class NameEqualsTo : public std::binary_function<std::string, GEDCOMParser::IndividualRecords_elem_t, bool> { |
| 12 |
{ |
public: |
| 13 |
|
bool operator()(std::string name, GEDCOMParser::IndividualRecords_elem_t individu) const |
| 14 |
|
{ |
| 15 |
|
|
| 16 |
bool res = false; |
bool res = false; |
| 17 |
bool found = false; |
bool found = false; |
| 18 |
GEDCOMParser::PersonalNames_t names = individu.second->getPersonalNames(); |
GEDCOMParser::PersonalNames_t names = individu.second->getPersonalNames(); |
| 19 |
GEDCOMParser::PersonalNames_t::const_iterator name_iter = names.begin(); |
GEDCOMParser::PersonalNames_t::const_iterator name_iter = names.begin(); |
| 20 |
do |
do |
| 21 |
{ |
{ |
| 22 |
found = ((*name_iter)->getSurn() == name); |
found = ((*name_iter)->getSurn() == name); |
| 23 |
name_iter++; |
name_iter++; |
| 24 |
} |
} |
| 25 |
while ((!found) && (name_iter != names.end())); |
while ((!found) && (name_iter != names.end())); |
| 26 |
res = found; |
res = found; |
| 27 |
return res; |
return res; |
| 28 |
|
}; |
| 29 |
}; |
}; |
| 30 |
}; |
}; |
| 31 |
}; |
}; |