Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

out_xupdate.h

Go to the documentation of this file.
00001 /* ===========================================================================
00002  *        Filename:  out_xupdate.h
00003  *     Description:  Header for the "xupdate" output format
00004  * 
00005  *         Version:  $Rev: 11 $
00006  *         Changed:  $Date: 2005-08-04 17:58:36 -0400 (Do, 04 Aug 2005) $
00007  *         Licence:  GPL (read COPYING file for details)
00008  * 
00009  *          Author:  Erich Schubert (eS), erich@debian.org
00010  *                   Institut für Informatik, LMU München
00011  * ======================================================================== */
00012 #ifndef OUT_XUPDATE_H
00013 #define OUT_XUPDATE_H
00014 #include "doc.h"
00015 #include "diff.h"
00016 #include <libxml/tree.h>
00017 
00018 namespace SSD {
00022 class XUpdateWriter {
00023 private:
00025         xmlNodePtr                                              output;
00027         xmlNsPtr                                                ns;
00029         hash_map<xmlNodePtr, xmlNodePtr, hash<void*> >          map;
00031         hash_map<xmlNodePtr, int, hash<void*> >                 map_index;
00033         int                                                     index_num;
00035         hash_map<int, xmlNodePtr, hash<int> >                   map_move_subtrees;
00037         set<xmlNodePtr>                                         known;
00039         hash_map<xmlNodePtr, xmlNodePtr, hash<void*> >          map_clone;
00041         hash_map<xmlNodePtr, xmlNodePtr, hash<void*> >          map_clone_back;
00043         set<xmlNodePtr>                                         dummy_nodes;
00044 
00048         void            initCloneMap(xmlNodePtr r1, xmlNodePtr r3);
00052         void            makePathBuf(xmlBufferPtr buf, xmlNodePtr pos);
00055         xmlChar*        makePath(xmlNodePtr pos);
00062         void            recDiff(xmlNodePtr pos1, xmlNodePtr pos2, xmlNodePtr pos3, xmlNodePtr addedpos, int descend);
00063         /* writer functions for writing nodes to output */
00067         xmlNodePtr      writeStoreSubtree(int num, const xmlChar* path);
00070         xmlNodePtr      writeDeleteSubtree(const xmlChar* path);
00073         xmlNodePtr      writeAppend(const xmlChar* path);
00076         xmlNodePtr      writeInsertAfter(const xmlChar* path);
00079         xmlNodePtr      writeInsertBefore(const xmlChar* path);
00083         xmlNodePtr      writeValueOf(xmlNodePtr where, const xmlChar* path);
00087         xmlNodePtr      writeElement(xmlNodePtr where, const xmlChar* elem);
00090         xmlNodePtr      writeText(xmlNodePtr where);
00094         xmlNodePtr      doInsertCmd(xmlNodePtr insertpos, int insert_mode);
00100         void            execInsert(xmlNodePtr insertpos, xmlNodePtr data, int insert_mode);
00107         bool            tryDeleteTextNode(xmlNodePtr pos3);
00112         void            insertDummyIfNeededForInsert(xmlNodePtr& insertpos, int& insert_mode);
00118         void            insertDummyIfNeededForDelete(xmlNodePtr deletepos, xmlNodePtr& insertpos, int& insert_mode);
00121         void            deleteDummyNodesRec(xmlNodePtr pos);
00124         void            deleteDummyNodes(xmlNodePtr pos);
00125 public:
00127         xmlDocPtr       result;
00132         void            run(Doc& doc1, Doc& doc2, DiffDijkstra& diff);
00134         void            dump();
00136                         XUpdateWriter();
00138                         ~XUpdateWriter();
00139 };
00140 }
00141 #endif

Generated on Thu Aug 4 17:57:12 2005 for SSDDiff by  doxygen 1.4.3-20050530