24 |
#include "GEDCOMParser/GEDCOMFactory.hh" |
#include "GEDCOMParser/GEDCOMFactory.hh" |
25 |
#include "GEDCOMParser/GEDCOMFactoryAccessor.hh" |
#include "GEDCOMParser/GEDCOMFactoryAccessor.hh" |
26 |
#include "GEDCOMParser/ParseErrorManagement/ParseErrorManager.hh" |
#include "GEDCOMParser/ParseErrorManagement/ParseErrorManager.hh" |
27 |
|
#include "GEDCOMParser/Serializer/Writer.hh" |
28 |
|
#include "GEDCOMParser/Serializer/GEDCOMWriter.hh" |
29 |
|
#include "GEDCOMParser/Visitor/GEDCOMVisitor.hh" |
30 |
|
#include "GEDCOMParser/Visitor/GEDCOMSerializerVisitor.hh" |
31 |
|
|
32 |
|
|
33 |
bool BakeryGateway::Document::load(void) |
bool BakeryGateway::Document::load(void) |
34 |
{ |
{ |
54 |
|
|
55 |
bool BakeryGateway::Document::save(void) |
bool BakeryGateway::Document::save(void) |
56 |
{ |
{ |
57 |
return Bakery::Document::save(); |
std::string gedcom_content; |
58 |
|
bool res; |
59 |
|
GEDCOMParser::Writer * writer = new GEDCOMParser::GEDCOMWriter(); |
60 |
|
GEDCOMParser::GEDCOMSerializerVisitor * visitor = new GEDCOMParser::GEDCOMSerializerVisitor(); |
61 |
|
GEDCOMParser::LineageLinkageGedcom * lineage = static_cast < GEDCOMParser::LineageLinkageGedcom * >(this); |
62 |
|
visitor->setWriter(writer); |
63 |
|
lineage->Accept(visitor); |
64 |
|
gedcom_content = writer->getBuffer(); |
65 |
|
set_contents(gedcom_content); |
66 |
|
set_modified(); |
67 |
|
delete writer; writer = 0; |
68 |
|
delete visitor; visitor = 0; |
69 |
|
res = Bakery::Document::save(); |
70 |
|
return res; |
71 |
} |
} |
72 |
|
|