SNAP Library 4.0, Developer Reference  2017-07-27 13:18:06
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
THttpChDef Class Reference
Collaboration diagram for THttpChDef:

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 94 of file http.cpp.

Constructor & Destructor Documentation

THttpChDef::THttpChDef ( )

Definition at line 134 of file http.cpp.

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

134  :
136 
137  // Character-Types
139  SetChTy(hpctAlpha, "ABCDEFGHIJKLMNOPQRSTUVWXYZ");
140  SetChTy(hpctAlpha, "abcdefghijklmnopqrstuvwxyz");
141  SetChTy(hpctDigit, "0123456789");
142  for (char Ch=0; Ch<=31; Ch++){SetChTy(hpctCtl, Ch);}
143  SetChTy(hpctCtl, 127);
144  SetChTy(hpctSpec, "()<>@,;:\\\"/[]?={}"); // +char(9)+char(32)
145 
146  // Lower-Case
147  {for (int Ch=TCh::Mn; Ch<=TCh::Mx; Ch++){LcChV[Ch-TCh::Mn]=TCh(char(Ch));}}
148  SetLcCh("aA"); SetLcCh("bB"); SetLcCh("cC"); SetLcCh("dD"); SetLcCh("eE");
149  SetLcCh("fF"); SetLcCh("gG"); SetLcCh("hH"); SetLcCh("iI"); SetLcCh("jJ");
150  SetLcCh("kK"); SetLcCh("lL"); SetLcCh("mM"); SetLcCh("nN"); SetLcCh("oO");
151  SetLcCh("pP"); SetLcCh("qQ"); SetLcCh("rR"); SetLcCh("sS"); SetLcCh("tT");
152  SetLcCh("uU"); SetLcCh("vV"); SetLcCh("wW"); SetLcCh("xX"); SetLcCh("yY");
153  SetLcCh("zZ");
154 }
static const char Mx
Definition: dt.h:1030
void PutAll(const TVal &Val)
Sets all elements of the vector to value Val.
Definition: ds.h:1229
Definition: dt.h:1025
static const char Mn
Definition: dt.h:1029
Definition: dt.h:1134
Definition: http.cpp:92
TIntV ChTyV
Definition: http.cpp:96
TChV LcChV
Definition: http.cpp:97
void SetLcCh(const TStr &Str)
Definition: http.cpp:131
static const int Vals
Definition: dt.h:1031
void SetChTy(const THttpChTy &ChTy, const char &Ch)
Definition: http.cpp:125

Here is the call graph for this function:

Member Function Documentation

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

Definition at line 106 of file http.cpp.

References ChTyV, and TCh::Mn.

106 {return ChTyV[Ch-TCh::Mn];}
static const char Mn
Definition: dt.h:1029
TIntV ChTyV
Definition: http.cpp:96
char THttpChDef::GetLcCh ( const char &  Ch)
inline

Definition at line 121 of file http.cpp.

References LcChV, and TCh::Mn.

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

121 {return LcChV[Ch-TCh::Mn];}
static const char Mn
Definition: dt.h:1029
TChV LcChV
Definition: http.cpp:97

Here is the caller graph for this function:

TStr THttpChDef::GetLcStr ( const TStr Str)

Definition at line 156 of file http.cpp.

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

Referenced by THttpLx::GetNrStr().

156  {
157  TChA LcStr;
158  for (int ChN=0; ChN<Str.Len(); ChN++){LcStr+=GetLcCh(Str[ChN]);}
159  return LcStr;
160 }
int Len() const
Definition: dt.h:487
Definition: dt.h:201
char GetLcCh(const char &Ch)
Definition: http.cpp:121

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 107 of file http.cpp.

References ChTyV, hpctAlpha, and TCh::Mn.

Referenced by THttpLx::GetRqMethod().

107 {return ChTyV[Ch-TCh::Mn]==int(hpctAlpha);}
static const char Mn
Definition: dt.h:1029
TIntV ChTyV
Definition: http.cpp:96

Here is the caller graph for this function:

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

Definition at line 115 of file http.cpp.

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

Definition at line 109 of file http.cpp.

References ChTyV, hpctCtl, and TCh::Mn.

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

109 {return ChTyV[Ch-TCh::Mn]==int(hpctCtl);}
static const char Mn
Definition: dt.h:1029
Definition: http.cpp:92
TIntV ChTyV
Definition: http.cpp:96

Here is the caller graph for this function:

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

Definition at line 108 of file http.cpp.

References ChTyV, hpctDigit, and TCh::Mn.

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

108 {return ChTyV[Ch-TCh::Mn]==int(hpctDigit);}
static const char Mn
Definition: dt.h:1029
TIntV ChTyV
Definition: http.cpp:96

Here is the caller graph for this function:

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

Definition at line 119 of file http.cpp.

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

Definition at line 118 of file http.cpp.

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

Definition at line 116 of file http.cpp.

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

Definition at line 110 of file http.cpp.

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

Referenced by IsText().

110  {
111  return (Ch==' ')||(Ch==TCh::TabCh)||(Ch==TCh::CrCh)||(Ch==TCh::LfCh);}
static const char TabCh
Definition: dt.h:1034
static const char LfCh
Definition: dt.h:1035
static const char CrCh
Definition: dt.h:1036

Here is the caller graph for this function:

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

Definition at line 117 of file http.cpp.

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

117 {return Ch==32;}

Here is the caller graph for this function:

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

Definition at line 113 of file http.cpp.

References ChTyV, hpctSpec, and TCh::Mn.

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

113  {
114  return (ChTyV[Ch-TCh::Mn]==int(hpctSpec))||(Ch==9)||(Ch==32);}
static const char Mn
Definition: dt.h:1029
TIntV ChTyV
Definition: http.cpp:96

Here is the caller graph for this function:

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

Definition at line 112 of file http.cpp.

References IsCtl(), and IsLws().

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

112 {return !IsCtl(Ch)||IsLws(Ch);}
bool IsLws(const char &Ch)
Definition: http.cpp:110
bool IsCtl(const char &Ch)
Definition: http.cpp:109

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 104 of file http.cpp.

References Fail.

104 {Fail; return *this;}
#define Fail
Definition: bd.h:238
void THttpChDef::SetChTy ( const THttpChTy ChTy,
const char &  Ch 
)
private

Definition at line 125 of file http.cpp.

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

Referenced by SetChTy(), and THttpChDef().

125  {
126  IAssert(ChTyV[Ch-TCh::Mn]==int(hpctUndef)); ChTyV[Ch-TCh::Mn]=TInt(ChTy);}
#define IAssert(Cond)
Definition: bd.h:262
static const char Mn
Definition: dt.h:1029
Definition: dt.h:1134
TIntV ChTyV
Definition: http.cpp:96

Here is the caller graph for this function:

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

Definition at line 128 of file http.cpp.

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

128  {
129  for (int ChN=0; ChN<Str.Len(); ChN++){SetChTy(ChTy, Str[ChN]);}}
int Len() const
Definition: dt.h:487
void SetChTy(const THttpChTy &ChTy, const char &Ch)
Definition: http.cpp:125

Here is the call graph for this function:

void THttpChDef::SetLcCh ( const TStr Str)
private

Definition at line 131 of file http.cpp.

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

Referenced by THttpChDef().

131  {
132  for (int ChN=1; ChN<Str.Len(); ChN++){LcChV[Str[ChN]-TCh::Mn]=TCh(Str[0]);}}
int Len() const
Definition: dt.h:487
Definition: dt.h:1025
static const char Mn
Definition: dt.h:1029
TChV LcChV
Definition: http.cpp:97

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

TIntV THttpChDef::ChTyV
private

Definition at line 96 of file http.cpp.

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

TChV THttpChDef::LcChV
private

Definition at line 97 of file http.cpp.

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


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