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;
00010 char* sDesc;
00011 };
00012
00013
00014
00015 class gHtmlString : public gString {
00016 public:
00017 gHtmlString (char* s=nil, bool aIgnoreAmp=false) ;
00018 virtual ~gHtmlString () ;
00019
00020
00021 int lastOpError;
00022 bool doIgnoreAmp;
00023
00024
00025 virtual bool IsOk () {
00026 return lastOpError==0;
00027 }
00028 virtual char* AsciiToString (t_uchar v) ;
00029
00030
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];
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;
00064
00065
00066 gHtmlString (gHtmlString& ) ;
00067 gHtmlString& operator= (gHtmlString& ) ;
00068 };
00069
00070 #endif //X_GDNETSTRINGS_H
00071