/[ghosts]/ghosts/gedcomparser/src/GEDCOMParser/Predicates/NameEqualsTo.hh
ViewVC logotype

Diff of /ghosts/gedcomparser/src/GEDCOMParser/Predicates/NameEqualsTo.hh

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

revision 1.2 by cpcp, Sun Jul 27 19:35:22 2003 UTC revision 1.3 by cpcp, Sun Aug 3 19:50:47 2003 UTC
# Line 5  Line 5 
5  #include "GEDCOMParser/PersonalName.hh"  #include "GEDCOMParser/PersonalName.hh"
6  #include <string>  #include <string>
7  #include <functional>  #include <functional>
8    #include <iostream>
9    
10  namespace GEDCOMParser {  namespace GEDCOMParser {
11    namespace Predicates {    namespace Predicates {
# Line 12  namespace GEDCOMParser { Line 13  namespace GEDCOMParser {
13      public:      public:
14        bool operator()(std::string name, GEDCOMParser::IndividualRecords_elem_t individu) const        bool operator()(std::string name, GEDCOMParser::IndividualRecords_elem_t individu) const
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);              if (name_iter != names.end())
23              name_iter++;                {
24                    if (!(*name_iter).Null())
25                      {
26                        found = ((*name_iter)->getSurn() == name);
27                      }
28                    name_iter++;
29                  }
30            }            }
31          while ((!found) && (name_iter != names.end()));          while ((!found) && (name_iter != names.end()));
32          res = found;          res = found;

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

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