SNAP Library 4.1, User Reference  2018-07-26 16:30:42
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

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.

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

Member Function Documentation

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

Definition at line 106 of file http.cpp.

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.

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

Definition at line 156 of file http.cpp.

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
bool THttpChDef::IsAlpha ( const char &  Ch)
inline

Definition at line 107 of file http.cpp.

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

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
bool THttpChDef::IsDigit ( const char &  Ch)
inline

Definition at line 108 of file http.cpp.

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

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
bool THttpChDef::IsSp ( const char &  Ch)
inline

Definition at line 117 of file http.cpp.

117 {return Ch==32;}
bool THttpChDef::IsSpec ( const char &  Ch)
inline

Definition at line 113 of file http.cpp.

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
bool THttpChDef::IsText ( const char &  Ch)
inline

Definition at line 112 of file http.cpp.

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

Definition at line 104 of file http.cpp.

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.

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
void THttpChDef::SetChTy ( const THttpChTy ChTy,
const TStr Str 
)
private

Definition at line 128 of file http.cpp.

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
void THttpChDef::SetLcCh ( const TStr Str)
private

Definition at line 131 of file http.cpp.

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

Member Data Documentation

TIntV THttpChDef::ChTyV
private

Definition at line 96 of file http.cpp.

TChV THttpChDef::LcChV
private

Definition at line 97 of file http.cpp.


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