"Fossies" - the Fresh Open Source Software Archive

Member "OpenSP-1.5.2/lib/Undo.h" (21 Jul 2005, 1632 Bytes) of package /linux/misc/old/OpenSP-1.5.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "Undo.h" see the Fossies "Dox" file reference documentation.

    1 // Copyright (c) 1994 James Clark
    2 // See the file COPYING for copying permission.
    3 
    4 #ifndef Undo_INCLUDED
    5 #define Undo_INCLUDED 1
    6 #ifdef __GNUG__
    7 #pragma interface
    8 #endif
    9 
   10 #include "Link.h"
   11 #include "ContentToken.h"
   12 #include "OpenElement.h"
   13 #include "Allocator.h"
   14 
   15 #ifdef SP_NAMESPACE
   16 namespace SP_NAMESPACE {
   17 #endif
   18 
   19 class ParserState;
   20 class Event;
   21 
   22 class Undo : public Link {
   23 public:
   24   void *operator new(size_t sz, Allocator &alloc) { return alloc.alloc(sz); }
   25   void *operator new(size_t sz) { return Allocator::allocSimple(sz); }
   26   void operator delete(void *p) { Allocator::free(p); }
   27 #ifdef SP_HAVE_PLACEMENT_OPERATOR_DELETE
   28   void operator delete(void *p, Allocator &) { Allocator::free(p); }
   29 #endif
   30   Undo();
   31   virtual ~Undo();
   32   virtual void undo(ParserState *) = 0;
   33 private:
   34   Undo(const Undo &);       // undefined
   35   void operator=(const Undo &); // undefined
   36 };
   37 
   38 class UndoTransition : public Undo {
   39 public:
   40   UndoTransition(const MatchState &);
   41   void undo(ParserState *);
   42 private:
   43   UndoTransition(const UndoTransition &); // undefined
   44   void operator=(const UndoTransition &); // undefined
   45   MatchState state_;
   46 };
   47 
   48 class UndoStartTag : public Undo {
   49 public:
   50   UndoStartTag();
   51   void undo(ParserState *);
   52 private:
   53   UndoStartTag(const UndoStartTag &); // undefined
   54   void operator=(const UndoStartTag &); // undefined
   55 };
   56 
   57 class UndoEndTag : public Undo {
   58 public:
   59   UndoEndTag(OpenElement *);
   60   void undo(ParserState *);
   61 private:
   62   UndoEndTag(const UndoEndTag &); // undefined
   63   void operator=(const UndoEndTag &); // undefined
   64   Owner<OpenElement> element_;
   65 };
   66 
   67 #ifdef SP_NAMESPACE
   68 }
   69 #endif
   70 
   71 #endif /* not Undo_INCLUDED */