THttpChDef::THttpChDef(): ChTyV(TCh::Vals), LcChV(TCh::Vals){ // Character-Types ChTyV.PutAll(TInt(hpctUndef)); SetChTy(hpctAlpha, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); SetChTy(hpctAlpha, "abcdefghijklmnopqrstuvwxyz"); SetChTy(hpctDigit, "0123456789"); for (char Ch=0; Ch<=31; Ch++){SetChTy(hpctCtl, Ch);} SetChTy(hpctCtl, 127); SetChTy(hpctSpec, "()<>@,;:\\\"/[]?={}"); // +char(9)+char(32) // Lower-Case {for (int Ch=TCh::Mn; Ch<=TCh::Mx; Ch++){LcChV[Ch-TCh::Mn]=TCh(char(Ch));}} SetLcCh("aA"); SetLcCh("bB"); SetLcCh("cC"); SetLcCh("dD"); SetLcCh("eE"); SetLcCh("fF"); SetLcCh("gG"); SetLcCh("hH"); SetLcCh("iI"); SetLcCh("jJ"); SetLcCh("kK"); SetLcCh("lL"); SetLcCh("mM"); SetLcCh("nN"); SetLcCh("oO"); SetLcCh("pP"); SetLcCh("qQ"); SetLcCh("rR"); SetLcCh("sS"); SetLcCh("tT"); SetLcCh("uU"); SetLcCh("vV"); SetLcCh("wW"); SetLcCh("xX"); SetLcCh("yY"); SetLcCh("zZ"); }
//////////////////////////////////////////////// // Lexical-Chars void TLxChDef::SetUcCh(const TStr& Str){ for (int CC=1; CC<Str.Len(); CC++){ UcChV[Str[CC]-TCh::Mn]=TCh(Str[0]);} }
void THttpChDef::SetLcCh(const TStr& Str){ for (int ChN=1; ChN<Str.Len(); ChN++){LcChV[Str[ChN]-TCh::Mn]=TCh(Str[0]);}}
TLxChDef::TLxChDef(const TLxChDefTy& ChDefTy): ChTyV(TCh::Vals), UcChV(TCh::Vals) { if (ChDefTy==lcdtUsAscii) { // Character-Types ChTyV.PutAll(TInt(lctSpace)); SetChTy(lctNum, "0123456789"); SetChTy(lctAlpha, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); SetChTy(lctAlpha, "abcdefghijklmnopqrstuvwxyz"); SetChTy(lctAlpha, "@_"); SetChTy(lctSSym, "\"'.,:;+-*/%!#|&<=>?()[]{}"); SetChTy(lctTerm, TStr(TCh::CrCh)); SetChTy(lctTerm, TStr(TCh::LfCh)); SetChTy(lctTerm, TStr(TCh::EofCh)); // Upper-Case for (int Ch=TCh::Mn; Ch<=TCh::Mx; Ch++) { UcChV[Ch-TCh::Mn]=TCh(char(Ch)); } SetUcCh("Aa"); SetUcCh("Bb"); SetUcCh("Cc"); SetUcCh("Dd"); SetUcCh("Ee"); SetUcCh("Ff"); SetUcCh("Gg"); SetUcCh("Hh"); SetUcCh("Ii"); SetUcCh("Jj"); SetUcCh("Kk"); SetUcCh("Ll"); SetUcCh("Mm"); SetUcCh("Nn"); SetUcCh("Oo"); SetUcCh("Pp"); SetUcCh("Qq"); SetUcCh("Rr"); SetUcCh("Ss"); SetUcCh("Tt"); SetUcCh("Uu"); SetUcCh("Vv"); SetUcCh("Ww"); SetUcCh("Xx"); SetUcCh("Yy"); SetUcCh("Zz"); } else if (ChDefTy==lcdtYuAscii) { // Character-Types ChTyV.PutAll(TInt(lctSpace)); SetChTy(lctNum, "0123456789"); SetChTy(lctAlpha, "ABC^]D\\EFGHIJKLMNOPQRS[TUVWXYZ@"); SetChTy(lctAlpha, "abc~}d|efghijklmnopqrs{tuvwxyz`"); SetChTy(lctAlpha, "_"); SetChTy(lctSSym, "\".,:;+-*/%!#&<=>?()"); SetChTy(lctTerm, TStr(TCh::CrCh)); SetChTy(lctTerm, TStr(TCh::LfCh)); SetChTy(lctTerm, TStr(TCh::EofCh)); // Upper-Case for (int Ch=TCh::Mn; Ch<=TCh::Mx; Ch++) { UcChV[Ch-TCh::Mn]=TCh(char(Ch)); } SetUcCh("Aa"); SetUcCh("Bb"); SetUcCh("Cc"); SetUcCh("^~"); SetUcCh("]}"); SetUcCh("Dd"); SetUcCh("\\|"); SetUcCh("Ee"); SetUcCh("Ff"); SetUcCh("Gg"); SetUcCh("Hh"); SetUcCh("Ii"); SetUcCh("Jj"); SetUcCh("Kk"); SetUcCh("Ll"); SetUcCh("Mm"); SetUcCh("Nn"); SetUcCh("Oo"); SetUcCh("Pp"); SetUcCh("Qq"); SetUcCh("Rr"); SetUcCh("Ss"); SetUcCh("[{"); SetUcCh("Tt"); SetUcCh("Uu"); SetUcCh("Vv"); SetUcCh("Ww"); SetUcCh("Xx"); SetUcCh("Yy"); SetUcCh("Zz"); SetUcCh("@`"); } else { Fail; } }