SNAP Library , Developer Reference  2013-01-07 14:03:36
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
THttpChDef Class Reference
Collaboration diagram for THttpChDef:

List of all members.

Public Member Functions

 THttpChDef ()
THttpChDefoperator= (const THttpChDef &)
int GetChTy (const char &Ch)
bool IsAlpha (const char &Ch)
bool IsDigit (const char &Ch)
bool IsCtl (const char &Ch)
bool IsLws (const char &Ch)
bool IsText (const char &Ch)
bool IsSpec (const char &Ch)
bool IsCr (const char &Ch)
bool IsLf (const char &Ch)
bool IsSp (const char &Ch)
bool IsHt (const char &Ch)
bool IsDQuote (const char &Ch)
char GetLcCh (const char &Ch)
TStr GetLcStr (const TStr &Str)

Private Member Functions

void SetLcCh (const TStr &Str)
void SetChTy (const THttpChTy &ChTy, const char &Ch)
void SetChTy (const THttpChTy &ChTy, const TStr &Str)

Private Attributes

TIntV ChTyV
TChV LcChV

Detailed Description

Definition at line 93 of file http.cpp.


Constructor & Destructor Documentation

Definition at line 133 of file http.cpp.

References ChTyV, hpctAlpha, hpctCtl, hpctDigit, hpctSpec, hpctUndef, LcChV, TCh::Mn, TCh::Mx, TVec< TVal >::PutAll(), SetChTy(), and SetLcCh().

                      :
  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");
}

Here is the call graph for this function:


Member Function Documentation

int THttpChDef::GetChTy ( const char &  Ch) [inline]

Definition at line 105 of file http.cpp.

References ChTyV, and TCh::Mn.

{return ChTyV[Ch-TCh::Mn];}
char THttpChDef::GetLcCh ( const char &  Ch) [inline]

Definition at line 120 of file http.cpp.

References LcChV, and TCh::Mn.

Referenced by GetLcStr(), and THttpLx::IsRespStatusLn().

{return LcChV[Ch-TCh::Mn];}

Here is the caller graph for this function:

TStr THttpChDef::GetLcStr ( const TStr Str)

Definition at line 155 of file http.cpp.

References GetLcCh(), and TStr::Len().

Referenced by THttpLx::GetNrStr().

                                        {
  TChA LcStr;
  for (int ChN=0; ChN<Str.Len(); ChN++){LcStr+=GetLcCh(Str[ChN]);}
  return LcStr;
}

Here is the call graph for this function:

Here is the caller graph for this function:

bool THttpChDef::IsAlpha ( const char &  Ch) [inline]

Definition at line 106 of file http.cpp.

References ChTyV, hpctAlpha, and TCh::Mn.

Referenced by THttpLx::GetRqMethod().

{return ChTyV[Ch-TCh::Mn]==int(hpctAlpha);}

Here is the caller graph for this function:

bool THttpChDef::IsCr ( const char &  Ch) [inline]

Definition at line 114 of file http.cpp.

{return Ch==13;}
bool THttpChDef::IsCtl ( const char &  Ch) [inline]

Definition at line 108 of file http.cpp.

References ChTyV, hpctCtl, and TCh::Mn.

Referenced by THttpLx::GetToken(), and IsText().

{return ChTyV[Ch-TCh::Mn]==int(hpctCtl);}

Here is the caller graph for this function:

bool THttpChDef::IsDigit ( const char &  Ch) [inline]

Definition at line 107 of file http.cpp.

References ChTyV, hpctDigit, and TCh::Mn.

Referenced by THttpLx::GetInt(), and THttpLx::IsRespStatusLn().

{return ChTyV[Ch-TCh::Mn]==int(hpctDigit);}

Here is the caller graph for this function:

bool THttpChDef::IsDQuote ( const char &  Ch) [inline]

Definition at line 118 of file http.cpp.

{return Ch=='"';}
bool THttpChDef::IsHt ( const char &  Ch) [inline]

Definition at line 117 of file http.cpp.

{return Ch==9;}
bool THttpChDef::IsLf ( const char &  Ch) [inline]

Definition at line 115 of file http.cpp.

{return Ch==10;}
bool THttpChDef::IsLws ( const char &  Ch) [inline]

Definition at line 109 of file http.cpp.

References TCh::CrCh, TCh::LfCh, and TCh::TabCh.

Referenced by IsText().

                            {
    return (Ch==' ')||(Ch==TCh::TabCh)||(Ch==TCh::CrCh)||(Ch==TCh::LfCh);}

Here is the caller graph for this function:

bool THttpChDef::IsSp ( const char &  Ch) [inline]

Definition at line 116 of file http.cpp.

Referenced by THttpLx::GetUrl(), and THttpLx::GetUrlStr().

{return Ch==32;}

Here is the caller graph for this function:

bool THttpChDef::IsSpec ( const char &  Ch) [inline]

Definition at line 112 of file http.cpp.

References ChTyV, hpctSpec, and TCh::Mn.

Referenced by THttpLx::GetSpec(), and THttpLx::GetToken().

                             {
    return (ChTyV[Ch-TCh::Mn]==int(hpctSpec))||(Ch==9)||(Ch==32);}

Here is the caller graph for this function:

bool THttpChDef::IsText ( const char &  Ch) [inline]

Definition at line 111 of file http.cpp.

References IsCtl(), and IsLws().

Referenced by THttpLx::GetFldVal(), and THttpLx::GetRespReasonPhrase().

{return !IsCtl(Ch)||IsLws(Ch);}

Here is the call graph for this function:

Here is the caller graph for this function:

THttpChDef& THttpChDef::operator= ( const THttpChDef ) [inline]

Definition at line 103 of file http.cpp.

References Fail.

{Fail; return *this;}
void THttpChDef::SetChTy ( const THttpChTy ChTy,
const char &  Ch 
) [private]

Definition at line 124 of file http.cpp.

References ChTyV, hpctUndef, IAssert, and TCh::Mn.

Referenced by SetChTy(), and THttpChDef().

                                                             {
  IAssert(ChTyV[Ch-TCh::Mn]==int(hpctUndef)); ChTyV[Ch-TCh::Mn]=TInt(ChTy);}

Here is the caller graph for this function:

void THttpChDef::SetChTy ( const THttpChTy ChTy,
const TStr Str 
) [private]

Definition at line 127 of file http.cpp.

References TStr::Len(), and SetChTy().

                                                              {
  for (int ChN=0; ChN<Str.Len(); ChN++){SetChTy(ChTy, Str[ChN]);}}

Here is the call graph for this function:

void THttpChDef::SetLcCh ( const TStr Str) [private]

Definition at line 130 of file http.cpp.

References LcChV, TStr::Len(), and TCh::Mn.

Referenced by THttpChDef().

                                       {
  for (int ChN=1; ChN<Str.Len(); ChN++){LcChV[Str[ChN]-TCh::Mn]=TCh(Str[0]);}}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 95 of file http.cpp.

Referenced by GetChTy(), IsAlpha(), IsCtl(), IsDigit(), IsSpec(), SetChTy(), and THttpChDef().

Definition at line 96 of file http.cpp.

Referenced by GetLcCh(), SetLcCh(), and THttpChDef().


The documentation for this class was generated from the following file: