gdNetStrings.h

Go to the documentation of this file.
00001 #ifndef X_GDNETSTRINGS_H
00002 #define X_GDNETSTRINGS_H
00003 
00004 #include "ghttp.h"
00005 ////////////////////////////////////////////////////////////
00006 struct sHtmlEntSymbol {
00007     char* sName;
00008     t_uint32 vAscii;
00009     char symRef;  // C:capital, S:small, n:numeric, U:usual-symbol
00010     char* sDesc;
00011 };
00012 ////////////////////////////////////////////////////////////
00013 // CLASS gHtmlString
00014 ////////////////////////////////////////////////////////////
00015 class gHtmlString : public gString {
00016 public:
00017     gHtmlString (char* s=nil, bool aIgnoreAmp=false) ;
00018     virtual ~gHtmlString () ;
00019 
00020     // Public data-members
00021     int lastOpError;
00022     bool doIgnoreAmp;
00023 
00024     // Get methods
00025     virtual bool IsOk () {
00026         return lastOpError==0;
00027     }
00028     virtual char* AsciiToString (t_uchar v) ;
00029 
00030     // Special methods
00031     virtual int ConvertToHString (char* s) ;
00032     virtual int ConvertAmpToAscii (char* s, gString& sResult) ;
00033     virtual int ConvertHToAscii (char* sAmp, t_uchar& cRes) ;
00034 
00035 protected:
00036     static unsigned nTblSymUsu;
00037     static t_uint32 vTblSymUsuMin;
00038     static unsigned nTblSymIsoLatin1;
00039     static t_uint32 vTblSymIsoL1Min, vTblSymIsoL1Max;
00040     static sHtmlEntSymbol tblSymUsu[191-160+10/* +1 would be enough*/];
00041     static sHtmlEntSymbol tblSymIsoLatin1[255-198+30];
00042 
00043     int thisConvertToHStringIgnoreAmp (char* s) ;
00044 
00045     char* thisSymbolString (t_uint32 val) ;
00046 
00047     char* thisFindSymbolISO (short tblIdx,
00048                              t_uint32 val,
00049                              unsigned nEntries,
00050                              unsigned& idx) ;
00051 
00052     int thisConvertHToAscii (gString& s,
00053                              short& tblIdx,
00054                              unsigned& idx,
00055                              t_uchar& cRes) ;
00056 
00057     char* thisStrSymbolAmp (char* s) ;
00058 
00059 private:
00060     int thisFillUpTables () ;
00061 
00062     gString sEntStr;
00063     gString sOriStr;  // Original string
00064 
00065     // Operators,empty
00066     gHtmlString (gHtmlString& ) ; //empty
00067     gHtmlString& operator= (gHtmlString& ) ; //empty
00068 };
00069 ////////////////////////////////////////////////////////////
00070 #endif //X_GDNETSTRINGS_H
00071 

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