/[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.1 by cpcp, Wed Jun 25 19:59:18 2003 UTC revision 1.2 by cpcp, Sun Jul 27 19:35:22 2003 UTC
# Line 7  Line 7 
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  };  };

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

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