Main Page | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals

htmlbox.h

Go to the documentation of this file.
00001 #ifndef _HTMLBOX_
00002 #define _HTMLBOX_
00003 
00004 #include <string>
00005 #include <map>
00006 
00007 #include "stree.h"
00008 
00009 #ifndef DOXYSKIP
00010 using namespace std;
00011 #endif
00012 
00014 class HTMLBox{
00015 
00016  public:
00018   class Putter : public Node::Transformer{
00019     HTMLBox &htmlBox;
00020   public:
00022     Putter(HTMLBox &ihtmlBox) : htmlBox(ihtmlBox) {};
00023     virtual Node* transform(Node* node) const;
00024   } putter;
00025 
00027   class Replacer : public Node::Transformer{
00028     HTMLBox &htmlBox;
00029   public:
00031     Replacer(HTMLBox &ihtmlBox) : htmlBox(ihtmlBox) {};
00032     virtual Node* transform(Node* node) const;
00033   } replacer;
00034 
00035  private:
00036 
00038   class CollectedHTMLInfo{
00039   public:
00040     CollectedHTMLInfo() : occurences(0) {}; 
00042     int occurences;
00044     string html;
00045   };
00046 
00048   typedef map<string,CollectedHTMLInfo> CollectedHTMLInfoMap;
00049 
00051   CollectedHTMLInfoMap collectedHTML;
00052   
00054   string outDir;
00055 
00057   int usedNames;
00058 
00060   int regenerated;
00061 
00063   string generateIncludeName();
00064 
00065  public:
00067   HTMLBox() : putter(*this), replacer(*this), usedNames(0), regenerated(0) {};
00068 
00070   void setOutDir(const string &ioutDir) { outDir = ioutDir; };
00071   
00073 
00077   void putHTML(const string &html);
00078 
00080   void regenerate();
00081 
00083   string getHTML(const string &html);
00084   
00086   string normalize(const string &html);
00087 };
00088 
00089 
00090 #endif
00091 

Generated on Fri Nov 21 17:54:02 2003 for PHPX by doxygen 1.3.3