/[ghosts]/ghosts/gedcomviewer/src/BakeryGateway/Document.cpp
ViewVC logotype

Diff of /ghosts/gedcomviewer/src/BakeryGateway/Document.cpp

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

revision 1.3 by cpcp, Mon Feb 17 21:39:13 2003 UTC revision 1.4 by cpcp, Sun Aug 3 19:50:47 2003 UTC
# Line 24  Line 24 
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  {  {
# Line 49  bool BakeryGateway::Document::load(void) Line 54  bool BakeryGateway::Document::load(void)
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    

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

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