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
|
#include <url.h>
Public Member Functions | |
TUrl (const TStr &_RelUrlStr, const TStr &_BaseUrlStr=TStr()) | |
~TUrl () | |
TUrl (TSIn &) | |
void | Save (TSOut &) |
bool | IsOk (const TUrlScheme _Scheme=usUndef) const |
TUrlScheme | GetScheme () |
TStr | GetUrlStr () const |
TStr | GetRelUrlStr () const |
bool | IsBaseUrl () |
TStr | GetBaseUrlStr () const |
TStr | GetSchemeNm () const |
TStr | GetHostNm () const |
TStr | GetDmNm (const int &MxDmSegs=-1) const |
bool | IsPortOk () const |
TStr | GetPortStr () const |
int | GetPortN () const |
TStr | GetPathStr () const |
int | GetPathSegs () const |
TStr | GetPathSeg (const int &PathSegN) const |
TStr | GetSearchStr () const |
TStr | GetFragIdStr () const |
bool | IsIpNum () const |
void | PutIpNum (const TStr &_IpNum) |
TStr | GetIpNum () const |
TStr | GetIpNumOrHostNm () const |
bool | IsDefFinalUrl () const |
TStr | GetFinalUrlStr () const |
TStr | GetAsFinalUrlStr () const |
TStr | GetFinalHostNm () const |
TStr | GetAsFinalHostNm () const |
void | DefUrlAsFinal () |
void | DefFinalUrl (const TStr &_FinalHostNm) |
void | PutHttpRqStr (const TStr &_HttpRqStr) |
TStr | GetHttpRqStr () const |
bool | IsHttpRqStr () const |
void | ChangeHttpRqStr (const TStr &SrcStr, const TStr &DstStr) |
bool | IsInHost (const TStr &_HostNm) const |
bool | IsInPath (const TStr &_PathStr) const |
void | ToLcPath () |
Static Public Member Functions | |
static PUrl | New (const TStr &RelUrlStr, const TStr &BaseUrlStr=TStr()) |
static PUrl | Load (TSIn &) |
static bool | IsAbs (const TStr &UrlStr) |
static bool | IsScript (const TStr &UrlStr) |
static bool | IsSite (const TStr &UrlStr) |
static PUrl | GetUrlFromShortcut (const TStr &ShortcutUrlStr, const TStr &DfHostNmPrefix, const TStr &DfHostNmSufix) |
static TStr | GetUrlSearchStr (const TStr &Str) |
static TStr | EncodeUrlStr (const TStr &Str) |
static TStr | DecodeUrlStr (const TStr &UrlStr) |
static TStr | GetDocStrFromUrlStr (const TStr &UrlStr, const int &Copies=1) |
static TStr | GetTopDownDocNm (const TStr &UrlStr, const int &MxLen=-1, const bool &HostOnlyP=false) |
Private Member Functions | |
void | GetAbs (const TStr &AbsUrlStr) |
void | GetAbsFromBase (const TStr &RelUrlStr, const TStr &BaseUrlStr) |
UndefDefaultCopyAssign (TUrl) | |
Private Attributes | |
TCRef | CRef |
TUrlScheme | Scheme |
TStr | UrlStr |
TStr | RelUrlStr |
TStr | BaseUrlStr |
TStr | SchemeNm |
TStr | HostNm |
TStr | PortStr |
TStr | PathStr |
TStr | SearchStr |
TStr | FragIdStr |
int | PortN |
TStrV | PathSegV |
TStr | IpNum |
TStr | FinalUrlStr |
TStr | FinalHostNm |
TStr | HttpRqStr |
Static Private Attributes | |
static const TStr | UrlHttpPrefixStr ="http:" |
static const TStr | UrlHttpAbsPrefixStr ="http://" |
Friends | |
class | TPt< TUrl > |
Definition at line 228 of file url.cpp.
References BaseUrlStr, TStr::ChangeStrAll(), GetAbs(), GetAbsFromBase(), IsAbs(), RelUrlStr, Scheme, TStr::ToTrunc(), and usUndef.
|
inline |
Definition at line 75 of file url.h.
Definition at line 386 of file url.cpp.
References TCh::GetHex(), TCh::IsHex(), TChA::Len(), and UrlStr.
void TUrl::DefFinalUrl | ( | const TStr & | _FinalHostNm | ) |
Definition at line 284 of file url.cpp.
References EAssert, TStr::Empty(), FinalHostNm, FinalUrlStr, TStr::GetLc(), HostNm, IsDefFinalUrl(), IsOk(), PathStr, PortStr, SchemeNm, SearchStr, UrlStr, and usHttp.
Referenced by ToLcPath().
|
inline |
|
private |
Definition at line 154 of file url.cpp.
References TStr::Clr(), THttp::DfPortN, EAssertR, TStr::Empty(), TUrlLx::Eof(), FragIdStr, TUrlLx::GetCh(), TUrlLx::GetHostPort(), TUrlLx::GetHPath(), TUrlLx::GetScheme(), TUrlLx::GetSearch(), TUrlLx::GetStr(), TUrlLx::GetToCh(), HostNm, IsAbs(), PathSegV, PathStr, TUrlLx::PeekCh(), PortN, PortStr, Scheme, SchemeNm, SearchStr, UrlStr, usHttp, and usOther.
Referenced by GetAbsFromBase(), and TUrl().
Definition at line 182 of file url.cpp.
References BaseUrlStr, TStr::DelStr(), TStr::DelSubStr(), EAssertR, TStr::Empty(), GetAbs(), TStr::GetLc(), TStr::GetSubStr(), IsAbs(), TStr::IsPrefix(), TStr::Len(), New(), RelUrlStr, TStr::SearchStr(), and UrlHttpPrefixStr.
Referenced by TUrl().
TStr TUrl::GetDmNm | ( | const int & | MxDmSegs = -1 | ) | const |
Definition at line 269 of file url.cpp.
References EAssert, HostNm, IsOk(), TStr::Len(), and TChA::Reverse().
Definition at line 407 of file url.cpp.
References TChA::Empty(), TStr::Len(), TVec< TVal, TSizeTy >::Len(), and TStr::SplitOnNonAlNum().
|
inline |
|
inline |
Definition at line 41 of file url.h.
References EAssert.
Referenced by GetTopDownDocNm(), and THttpRq::THttpRq().
|
inline |
|
inline |
|
inline |
Definition at line 46 of file url.h.
References EAssert.
Referenced by GetTopDownDocNm(), IsSite(), and THttpRq::THttpRq().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 49 of file url.h.
References EAssert.
Referenced by IsSite(), THttpRq::ParseHttpRq(), and THttpRq::THttpRq().
|
static |
Definition at line 421 of file url.cpp.
References GetHostNm(), TStr::GetLc(), GetPathStr(), HostNm, IsOk(), TVec< TVal, TSizeTy >::Len(), New(), TStr::SplitOnAllCh(), and TChA::Trunc().
|
static |
Definition at line 343 of file url.cpp.
References TStr::IsChIn(), IsOk(), New(), UrlHttpAbsPrefixStr, and UrlStr.
Definition at line 368 of file url.cpp.
References TInt::GetHexStr(), and TChA::Len().
Referenced by TUrlEnv::GetFullUrlStr().
|
inline |
Definition at line 36 of file url.h.
Referenced by THtmlDoc::_IsTagRedir(), TWebPg::GetOutDescUrlStrKdV(), THttpRq::GetStr(), THtmlDoc::GetTxtLnDoc(), and THtmlDoc::SaveHtmlToXml().
|
static |
Definition at line 324 of file url.cpp.
References TStr::GetLc(), TStr::IsPrefix(), TStr::SearchCh(), UrlHttpAbsPrefixStr, and UrlHttpPrefixStr.
Referenced by GetAbs(), GetAbsFromBase(), and TUrl().
|
inline |
Definition at line 57 of file url.h.
References EAssert, and usHttp.
Referenced by DefFinalUrl(), and ToLcPath().
|
inline |
Definition at line 78 of file url.h.
References EAssert, and TStr::GetUc().
|
inline |
Definition at line 80 of file url.h.
References EAssert, and TStr::GetUc().
|
inline |
Definition at line 32 of file url.h.
References usUndef.
Referenced by THtmlDoc::_IsTagRedir(), DefFinalUrl(), GetDmNm(), TWebPg::GetOutDescUrlStrKdV(), TWebPg::GetOutUrlV(), GetTopDownDocNm(), THtmlDoc::GetTxtLnDoc(), THttpLx::GetUrl(), GetUrlFromShortcut(), IsSite(), THttpRq::ParseHttpRq(), THtmlDoc::SaveHtmlToXml(), and THttpRq::THttpRq().
|
inline |
|
static |
Definition at line 333 of file url.cpp.
References TStr::IsChIn().
|
static |
Definition at line 337 of file url.cpp.
References TStr::Empty(), GetFragIdStr(), GetPathStr(), GetSearchStr(), IsOk(), New(), and usHttp.
Definition at line 25 of file url.h.
Referenced by THtmlDoc::_IsTagRedir(), GetAbsFromBase(), TWebPg::GetOutDescUrlStrKdV(), TWebPg::GetOutUrlV(), GetTopDownDocNm(), THtmlDoc::GetTxtLnDoc(), TWebPg::GetUrl(), GetUrlFromShortcut(), IsSite(), THttpRq::ParseHttpRq(), and THtmlDoc::SaveHtmlToXml().
|
inline |
void TUrl::ToLcPath | ( | ) |
Definition at line 302 of file url.cpp.
References TStr::Clr(), DefFinalUrl(), TStr::Empty(), FinalHostNm, FinalUrlStr, HostNm, IsDefFinalUrl(), TStr::IsLc(), TVec< TVal, TSizeTy >::Len(), PathSegV, PathStr, PortStr, SchemeNm, SearchStr, TStr::ToLc(), and UrlStr.
|
private |
|
private |
Definition at line 12 of file url.h.
Referenced by GetAbsFromBase(), and TUrl().
|
private |
Definition at line 18 of file url.h.
Referenced by DefFinalUrl(), and ToLcPath().
|
private |
Definition at line 18 of file url.h.
Referenced by DefFinalUrl(), and ToLcPath().
|
private |
Definition at line 13 of file url.h.
Referenced by DefFinalUrl(), GetAbs(), GetDmNm(), GetTopDownDocNm(), and ToLcPath().
|
private |
Definition at line 16 of file url.h.
Referenced by GetAbs(), and ToLcPath().
|
private |
Definition at line 14 of file url.h.
Referenced by DefFinalUrl(), GetAbs(), and ToLcPath().
|
private |
Definition at line 14 of file url.h.
Referenced by DefFinalUrl(), GetAbs(), and ToLcPath().
|
private |
Definition at line 12 of file url.h.
Referenced by GetAbsFromBase(), and TUrl().
|
private |
|
private |
Definition at line 13 of file url.h.
Referenced by DefFinalUrl(), GetAbs(), and ToLcPath().
|
private |
Definition at line 14 of file url.h.
Referenced by DefFinalUrl(), GetAbs(), and ToLcPath().
|
staticprivate |
Definition at line 10 of file url.h.
Referenced by GetUrlFromShortcut(), and IsAbs().
|
staticprivate |
Definition at line 9 of file url.h.
Referenced by GetAbsFromBase(), and IsAbs().
|
private |
Definition at line 12 of file url.h.
Referenced by DecodeUrlStr(), DefFinalUrl(), GetAbs(), GetUrlFromShortcut(), and ToLcPath().