| 22 |
#include "BakeryGateway/Document.hh" |
#include "BakeryGateway/Document.hh" |
| 23 |
#include "GEDCOMParser/Parser.hh" |
#include "GEDCOMParser/Parser.hh" |
| 24 |
#include "GEDCOMParser/GEDCOMFactory.hh" |
#include "GEDCOMParser/GEDCOMFactory.hh" |
| 25 |
|
#include "GEDCOMParser/ParseErrorManagement/ParseErrorManager.hh" |
| 26 |
|
|
| 27 |
bool BakeryGateway::Document::load(void) |
bool BakeryGateway::Document::load(void) |
| 28 |
{ |
{ |
| 29 |
|
bool res; |
| 30 |
GEDCOMParser::GEDCOMFactory factory; |
GEDCOMParser::GEDCOMFactory factory; |
| 31 |
GEDCOMParser::Parser parser(&factory, this); |
GEDCOMParser::Parser parser(&factory, this); |
| 32 |
std::string filename = Bakery::Document::get_filepath(); |
std::string filename = Bakery::Document::get_filepath(); |
| 33 |
parser.Parse(filename, PARSERDEBUG); |
GEDCOMParser::ParseErrorManagement::ParseErrorManager parse_error_manager = parser.Parse(filename, PARSERDEBUG); |
| 34 |
textdomain (PACKAGE); |
textdomain (PACKAGE); |
| 35 |
if(m_pView) |
if (parse_error_manager.ErrorCount() > 0) |
| 36 |
m_pView->load_from_document(); |
{ |
| 37 |
return true; |
res = false; |
| 38 |
|
} |
| 39 |
|
else |
| 40 |
|
{ |
| 41 |
|
if(m_pView) |
| 42 |
|
m_pView->load_from_document(); |
| 43 |
|
res = true; |
| 44 |
|
} |
| 45 |
|
return res; |
| 46 |
} |
} |
| 47 |
|
|
| 48 |
bool BakeryGateway::Document::save(void) |
bool BakeryGateway::Document::save(void) |