X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=blobdiff_plain;f=helm%2FDEVEL%2Fmathml_editor%2Fsrc%2FDiff.hh;fp=helm%2FDEVEL%2Fmathml_editor%2Fsrc%2FDiff.hh;h=0000000000000000000000000000000000000000;hp=a047d6baa31868e9008fb3f3c37075cf9190c700;hb=3ef089a4c58fbe429dd539af6215991ecbe11ee2;hpb=1c7fb836e2af4f2f3d18afd0396701f2094265ff diff --git a/helm/DEVEL/mathml_editor/src/Diff.hh b/helm/DEVEL/mathml_editor/src/Diff.hh deleted file mode 100644 index a047d6baa..000000000 --- a/helm/DEVEL/mathml_editor/src/Diff.hh +++ /dev/null @@ -1,77 +0,0 @@ -/* This file is part of EdiTeX, an editor of mathematical - * expressions based on TeX syntax. - * - * Copyright (C) 2002-2003 Luca Padovani , - * 2003 Paolo Marinelli . - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - * For more information, please visit the project's home page - * http://helm.cs.unibo.it/editex/ - * or send an email to - */ - -#ifndef __Diff_hh__ -#define __Diff_hh__ - -#include - -#define XMLNS_NS_URI "http://www.w3.org/2000/xmlns/" -#define DDIFF_NS_URI "http://helm.cs.unibo.it/2002/DDIFF" - -namespace GdomeSmartDOMExt -{ - - using namespace GdomeSmartDOM; - - class Diff - { - public: - typedef bool (*flatNodeEq)(const Node&, const Node&); - static bool defaultFlatNodeEq(const Node&, const Node&); - - private: - Diff(const Node& n, const Document& d, flatNodeEq e) : dest(n), doc(d), eq(e) { }; - - public: - static Diff diff(const Document&, const Document&, flatNodeEq = defaultFlatNodeEq); - static Diff diff(const Element&, const Element&, flatNodeEq = defaultFlatNodeEq); - - Document document(void) const { return doc; }; - Node node(void) const { return dest; }; - - void patch(void) const; - - struct BADDiff - { - BADDiff(const std::string& s) : msg(s) { }; - const std::string msg; - }; - - private: - Node diffNodes(const Node&, const Node&) const; - bool diffChildren(const Node&, const Node&, const Node&) const; - void sameChunk(const Node&, unsigned long) const; - void patchRootNode(const Node&, const Element&) const; - void patchChildren(const Node&, const Element&) const; - - Document doc; - Node dest; - flatNodeEq eq; - }; - -} - -#endif // __ddiff_hh__