gHtmlSeq.h

Go to the documentation of this file.
00001 #ifndef gHTML_SEQ_X_H
00002 #define gHTML_SEQ_X_H
00003 
00004 #include "gHtmlOpt.h"
00005 #include "gHtmlParser.h"
00006 #include "ghttp.h"
00007 
00008 class gHTree;
00009 ////////////////////////////////////////////////////////////
00010 class gTagTree : public gTagCoord {
00011 public:
00012     gTagTree (char* descStr=nil) ;
00013     virtual ~gTagTree () ;
00014 
00015     gString sDesc;
00016     t_int32 mCoord;
00017     gHTree* myTree;  // Never allocated here
00018 
00019     virtual bool IsOk () {
00020         return myTree!=nil && GetY()>0;
00021     }
00022 
00023     virtual char* Str () ;
00024 
00025     virtual void Reset () ;
00026 
00027 private:
00028     // Operators,empty
00029     gTagTree (gTagTree& ) ; //empty
00030     gTagTree& operator= (gTagTree& ) ; //empty
00031 };
00032 ////////////////////////////////////////////////////////////
00033 class gHNode : public gControl {
00034 public:
00035     gHNode () ;
00036     virtual ~gHNode () ;
00037 
00038     // Public data-members
00039     gHNode* nextNode;
00040     gHTree* tSub;
00041 
00042     // Get methods
00043     virtual bool IsTag () {
00044         return pCouple!=nil && pCouple->IsText()==false;
00045     }
00046 
00047     virtual gHtmlCouple* GetCouple () ;
00048     virtual gHtmlCouple* GetCouplePtr () {
00049         return pCouple;
00050     }
00051 
00052     // Set methods
00053     virtual bool SetCouplePtr (gHtmlCouple* ptrCouple) ;
00054 
00055 protected:
00056     gHtmlCouple* pCouple; //Never allocated
00057 
00058 private:
00059     // Operators,empty
00060     gHNode (gHNode& ) ; //empty
00061     gHNode& operator= (gHNode& ) ; //empty
00062 };
00063 ////////////////////////////////////////////////////////////
00064 class gHTree : public gList {
00065 public:
00066     gHTree () ;
00067     virtual ~gHTree () ;
00068 
00069     // Get methods
00070     virtual bool IsEmpty () {
00071         return pStart==nil;
00072     }
00073     virtual gHNode* StartNode () {
00074         return pStart;
00075     }
00076     virtual gHNode* GetLastNode () ;
00077 
00078     // Set methods
00079     virtual void Reset () ;
00080     virtual int AppendCouplePtr (gHtmlCouple* ptrCouple) ;
00081     virtual int AppendTreePtr (gHTree* pTree) ;
00082 
00083     // Show methods
00084     virtual void Show (bool doShowAll=true) ;
00085     virtual void ShowTree (bool doShowAll=true, int level=0) ;
00086 
00087 protected:
00088     gHNode* pStart;
00089     gHNode* pEnd;
00090 
00091     int thisAppendNode (gHNode* newNode) ;
00092     int thisShowNode (gHNode* pNode, bool doShowAll, int level) ;
00093 
00094 private:
00095     // Operators,empty
00096     gHTree (gHTree& ) ; //empty
00097     gHTree& operator= (gHTree& ) ; //empty
00098 };
00099 ////////////////////////////////////////////////////////////
00100 class gHSeq : public gControl {
00101 public:
00102     gHSeq (FILE* afRepErr) ;
00103     virtual ~gHSeq () ;
00104 
00105     // Public data-members
00106     FILE* fRepErr;
00107     gHTree hTree;
00108 
00109     // Get methods
00110     virtual char* GetURL (char* strURI) ;
00111 
00112     // Set methods
00113     virtual bool SetBaseHRef (gString& aBaseHRef) ;
00114 
00115     // Specific methods
00116     virtual int Build (gHList& lH, eHState state) ;
00117 
00118     // Show methods
00119     void ShowPart (gHList& lH, eHState state, gHtmlOpt& htmlOpt) ;
00120 
00121 protected:
00122     gString sBaseHRef;
00123     gString sOut;
00124     gURI baseURI;
00125     t_int32 nCoords, iCoordStt;
00126     gTagCoord* pTagCoords;  // Allocated at 'Build'
00127 
00128     int thisCheck (gHList& lH, eHState state, unsigned sttLine, unsigned endLine) ;
00129     int thisBuild (gHList& lH) ;
00130     int thisConsolidate (gHTree& hT) ;
00131 
00132     int thisLineSubBlock (int hLine, t_int32 mCoord, bool& doSkip) ;
00133     int thisLineSubBlockCoord (int hLine, t_int32 startCoord, t_int32& fCoord, bool& doSkip) ;
00134 
00135     gHTree* thisFindRememberedBlock (t_int32 mCoord, int hLine, int& idxTagTree) ;
00136 
00137     int thisAppendNormal (gHtmlCouple* pCouple) ;
00138     int thisAppendTree (gHTree* pTree) ;
00139 
00140 private:
00141     int nTagTree;
00142     gTagTree* pTagTree;  // Allocated at 'Build' (remembered trees)
00143     gHTree* NewTree (t_int32 mCoord=-1, int hLine=0, char* descStr=nil, bool doRegister=false) ;
00144 
00145     // Operators,empty
00146     gHSeq (gHSeq& ) ; //empty
00147     gHSeq& operator= (gHSeq& ) ; //empty
00148 };
00149 ////////////////////////////////////////////////////////////
00150 #endif //gHTML_SEQ_X_H
00151 

Generated on Sat Aug 18 02:40:56 2007 for xpfweb_v2x lib by  doxygen 1.4.2