|
SNAP Library 2.2, User Reference
2014-03-11 19:15:55
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
Public Member Functions | |
| THttpLx (const PSIn &_SIn) | |
| THttpLx & | operator= (const THttpLx &) |
| bool | Eof () |
| int | Len () |
| char | GetFirstCh () |
| char | GetCh () |
| void | GetRest () |
| void | PutCh (const char &_Ch) |
| void | ClrMemSf () |
| TMem & | GetMemSf () |
| THttpRqMethod | GetRqMethod () |
| PUrl | GetUrl () |
| TStr | GetUrlStr () |
| bool | IsRespStatusLn () |
| TStr | GetRespReasonPhrase () |
| void | GetWs () |
| bool | IsLws () |
| void | GetLws () |
| bool | IsCrLf () |
| void | GetCrLf () |
| void | GetPeriod () |
| TStr | GetToken (const TStr &ExpectStr=TStr()) |
| TStr | GetSpec (const TStr &ExpectStr=TStr()) |
| int | GetInt (const int &RqPlaces=-1) |
| TStr | GetFldVal () |
Static Public Member Functions | |
| static TStr | GetNrStr (const TStr &Str) |
Private Attributes | |
| PSIn | SIn |
| TBoolChS | EofChPrS |
| char | Ch |
| bool | AtEof |
| TMem | SfMem |
Static Private Attributes | |
| static THttpChDef | ChDef |
| THttpLx::THttpLx | ( | const PSIn & | _SIn | ) | [inline] |
| void THttpLx::ClrMemSf | ( | ) | [inline] |
| bool THttpLx::Eof | ( | ) | [inline] |
| char THttpLx::GetCh | ( | ) |
| void THttpLx::GetCrLf | ( | ) |
| char THttpLx::GetFirstCh | ( | ) |
| int THttpLx::GetInt | ( | const int & | RqPlaces = -1 | ) |
| void THttpLx::GetLws | ( | ) |
Definition at line 348 of file http.cpp.
{
forever {
while ((Ch==' ')||(Ch==TCh::TabCh)){GetCh();}
if (Ch==TCh::CrCh){
GetCh();
if (Ch==TCh::LfCh){
GetCh();
if ((Ch==' ')||(Ch==TCh::TabCh)){GetCh();}
else {PutCh(TCh::LfCh); PutCh(TCh::CrCh); break;}
} else {
PutCh(TCh::CrCh); break;
}
} else
if (Ch==TCh::LfCh){
GetCh();
if ((Ch==' ')||(Ch==TCh::TabCh)){GetCh();}
else {PutCh(TCh::LfCh); break;}
} else {
break;
}
}
}
| TMem& THttpLx::GetMemSf | ( | ) | [inline] |
| static TStr THttpLx::GetNrStr | ( | const TStr & | Str | ) | [inline, static] |
| void THttpLx::GetPeriod | ( | ) |
| void THttpLx::GetRest | ( | ) |
Definition at line 261 of file http.cpp.
{
TChA MethodNm;
while (!Eof() && ChDef.IsAlpha(Ch)){
MethodNm+=Ch; GetCh();}
THttpRqMethod Method=hrmUndef;
if (MethodNm==THttp::GetMethodNm){Method=hrmGet;}
else if (MethodNm==THttp::HeadMethodNm){Method=hrmHead;}
else if (MethodNm==THttp::PostMethodNm){Method=hrmPost;}
if (Method==hrmUndef){throw THttpEx(heMethodNmExpected);}
return Method;
}
| TStr THttpLx::GetSpec | ( | const TStr & | ExpectStr = TStr() | ) |
| TStr THttpLx::GetToken | ( | const TStr & | ExpectStr = TStr() | ) |
| PUrl THttpLx::GetUrl | ( | ) |
| void THttpLx::GetWs | ( | ) |
| bool THttpLx::IsCrLf | ( | ) |
| bool THttpLx::IsLws | ( | ) |
Definition at line 327 of file http.cpp.
{
if ((Ch==' ')||(Ch==TCh::TabCh)){
return true;
} else
if (Ch==TCh::CrCh){
GetCh();
if (Ch==TCh::LfCh){
GetCh(); bool Ok=(Ch==' ')||(Ch==TCh::TabCh);
PutCh(TCh::LfCh); PutCh(TCh::CrCh); return Ok;
} else {
PutCh(TCh::CrCh); return false;
}
} else
if (Ch==TCh::LfCh){
GetCh(); bool Ok=(Ch==' ')||(Ch==TCh::TabCh);
PutCh(TCh::LfCh); return Ok;
} else {
return false;
}
}
| bool THttpLx::IsRespStatusLn | ( | ) |
Definition at line 295 of file http.cpp.
{
static const TChA MouldChA="http/N.N NNN ";
TChA TestChA(MouldChA);
int TestLen=TestChA.Len();
if (1+Len()<TestLen){return false;}
TestChA.PutCh(0, ChDef.GetLcCh(Ch));
{for (int ChN=1; ChN<TestLen; ChN++){
TestChA.PutCh(ChN, ChDef.GetLcCh(GetCh()));}}
{for (int ChN=1; ChN<TestLen; ChN++){
PutCh(TestChA[TestLen-ChN-1]);}}
{for (int ChN=0; ChN<MouldChA.Len(); ChN++){
if (MouldChA[ChN]=='N'){
if (!ChDef.IsDigit(TestChA[ChN])){return false;}
} else {
if (MouldChA[ChN]!=TestChA[ChN]){return false;}
}
}}
return true;
}
| int THttpLx::Len | ( | ) | [inline] |
| void THttpLx::PutCh | ( | const char & | _Ch | ) | [inline] |
bool THttpLx::AtEof [private] |
char THttpLx::Ch [private] |
THttpChDef THttpLx::ChDef [static, private] |
TBoolChS THttpLx::EofChPrS [private] |
TMem THttpLx::SfMem [private] |
PSIn THttpLx::SIn [private] |