26 |
|
|
27 |
#include "GEDCOMParser/Parser.hh" |
#include "GEDCOMParser/Parser.hh" |
28 |
#include "GEDCOMParser/GEDCOMFactory.hh" |
#include "GEDCOMParser/GEDCOMFactory.hh" |
29 |
|
#include "GEDCOMParser/ParseErrorManagement/ParseErrorManager.hh" |
30 |
|
|
31 |
#include <string> |
#include <string> |
32 |
#include <map> |
#include <map> |
33 |
#include <iostream> |
#include <iostream> |
123 |
{ |
{ |
124 |
arguments.gedcom_filename = ""; |
arguments.gedcom_filename = ""; |
125 |
} |
} |
126 |
viewparser.Parse(arguments.gedcom_filename, arguments.verbose); |
GEDCOMParser::ParseErrorManagement::ParseErrorManager parse_error_manager = viewparser.Parse(arguments.gedcom_filename, arguments.verbose); |
127 |
|
if (parse_error_manager.ErrorCount() == 0) |
128 |
|
{ |
129 |
|
std::cout << _("Parsing passed") << std::endl; |
130 |
|
} |
131 |
|
else |
132 |
|
{ |
133 |
|
std::cout << std::endl << _("Parsing finished with errors : ") << std::endl; |
134 |
|
for (std::vector < GEDCOMParser::ParseErrorManagement::ParseError >::const_iterator err_iter = parse_error_manager.getErrors().begin(); err_iter != parse_error_manager.getErrors().end(); err_iter++) |
135 |
|
{ |
136 |
|
std::cerr << err_iter->getDescription() << std::endl; |
137 |
|
} |
138 |
|
} |
139 |
|
|
|
std::cout << _("Parsing passed") << std::endl; |
|
140 |
|
|
141 |
GEDCOMParser::LineageLinkageGedcom const * const lineage = viewparser.getLineageLinkageGedcom(); |
GEDCOMParser::LineageLinkageGedcom const * const lineage = viewparser.getLineageLinkageGedcom(); |
|
GEDCOMParser::IndividualRecords_t individus = lineage->getIndividualRecords(); |
|
142 |
|
|
143 |
if (arguments.metrics == 1) |
if (arguments.metrics == 1) |
144 |
{ |
{ |
145 |
if (lineage != 0) |
if (lineage != 0) |
146 |
{ |
{ |
147 |
|
GEDCOMParser::IndividualRecords_t individus = lineage->getIndividualRecords(); |
148 |
std::cout << _("Individuals records : ") << individus.size() << std::endl; |
std::cout << _("Individuals records : ") << individus.size() << std::endl; |
149 |
std::cout << _("Individuals records without children : "); |
std::cout << _("Individuals records without children : "); |
150 |
int nb_individus_without_child = std::count_if(individus.begin(), individus.end(), std::compose1(std::logical_not<bool>(), std::bind1st(GEDCOMParser::hasChildObject(), lineage))); |
int nb_individus_without_child = std::count_if(individus.begin(), individus.end(), std::compose1(std::logical_not<bool>(), std::bind1st(GEDCOMParser::hasChildObject(), lineage))); |
151 |
std::cout << nb_individus_without_child << std::endl; |
std::cout << nb_individus_without_child << std::endl; |
152 |
std::cout << _("Family records : ") << lineage->getFamilyRecords().size() << std::endl; |
std::cout << _("Family records : ") << lineage->getFamilyRecords().size() << std::endl; |
153 |
} |
} |
154 |
else |
else |
155 |
{ |
{ |