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
TUrlLx Class Reference
Collaboration diagram for TUrlLx:

Public Member Functions

 TUrlLx (const TStr &_Str)
 
bool Eof () const
 
char GetCh ()
 
char PeekCh () const
 
char GetCh (const char &Ch)
 
TStr GetStr (const TStr &Str)
 
const char * GetStr (const char *Str)
 
bool IsSchemeCh () const
 
char GetSchemeCh ()
 
bool IsDigitCh () const
 
char GetDigitCh ()
 
bool IsHSegmentCh () const
 
char GetHSegmentCh ()
 
TStr GetToCh (const char &Ch=TUrlLxChDef::EofCh)
 
TStr GetScheme ()
 
TStr GetHost ()
 
TStr GetDigits ()
 
TStr GetHostPort (TStr &HostNm, TStr &PortStr, int &PortN)
 
TStr GetHPath (TStrV &PathSegV)
 
TStr GetSearch ()
 

Static Public Attributes

static const TUrlLxChDef ChDef
 

Private Attributes

TChA Bf
 
int BfC
 

Static Private Attributes

static const char EofCh =TUrlLxChDef::EofCh
 

Detailed Description

Definition at line 76 of file url.cpp.

Constructor & Destructor Documentation

TUrlLx::TUrlLx ( const TStr _Str)
inline

Definition at line 83 of file url.cpp.

83 : Bf(_Str), BfC(0){}
TChA Bf
Definition: url.cpp:79
int BfC
Definition: url.cpp:80

Member Function Documentation

bool TUrlLx::Eof ( ) const
inline

Definition at line 84 of file url.cpp.

References Bf, BfC, and TChA::Len().

Referenced by TUrl::GetAbs(), GetCh(), and PeekCh().

84 {return BfC==Bf.Len();};
int Len() const
Definition: dt.h:259
TChA Bf
Definition: url.cpp:79
int BfC
Definition: url.cpp:80

Here is the call graph for this function:

Here is the caller graph for this function:

char TUrlLx::GetCh ( )
inline

Definition at line 85 of file url.cpp.

References Bf, BfC, Eof(), and EofCh.

Referenced by TUrl::GetAbs(), GetDigitCh(), GetHost(), GetHostPort(), GetHPath(), GetHSegmentCh(), GetScheme(), GetSchemeCh(), GetStr(), and GetToCh().

85 {if (Eof()){return EofCh;} else {return Bf[BfC++];}}
static const char EofCh
Definition: url.cpp:78
bool Eof() const
Definition: url.cpp:84
TChA Bf
Definition: url.cpp:79
int BfC
Definition: url.cpp:80

Here is the call graph for this function:

Here is the caller graph for this function:

char TUrlLx::GetCh ( const char &  Ch)
inline

Definition at line 87 of file url.cpp.

References EAssertR, and GetCh().

Referenced by GetCh().

87 {EAssertR(GetCh()==Ch, ""); return Ch;}
char GetCh()
Definition: url.cpp:85
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283

Here is the call graph for this function:

Here is the caller graph for this function:

char TUrlLx::GetDigitCh ( )
inline

Definition at line 99 of file url.cpp.

References EAssertR, GetCh(), and IsDigitCh().

Referenced by GetDigits().

99 {EAssertR(IsDigitCh(), ""); return GetCh();}
char GetCh()
Definition: url.cpp:85
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283
bool IsDigitCh() const
Definition: url.cpp:98

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TUrlLx::GetDigits ( )
inline

Definition at line 109 of file url.cpp.

References GetDigitCh(), and IsDigitCh().

Referenced by GetHostPort().

109  {TChA Str;
110  do {Str+=GetDigitCh();} while (IsDigitCh()); return Str;}
Definition: dt.h:201
char GetDigitCh()
Definition: url.cpp:99
bool IsDigitCh() const
Definition: url.cpp:98

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TUrlLx::GetHost ( )

Definition at line 119 of file url.cpp.

References ChDef, TChA::Clr(), EAssertR, GetCh(), TUrlLxChDef::IsHostCh(), PeekCh(), and TChA::ToLc().

Referenced by GetHostPort().

119  {TChA Str;
120  EAssertR(ChDef.IsHostCh(PeekCh()), "");
121  do {
122  while (ChDef.IsHostCh(PeekCh())){Str+=GetCh();}
123  if (PeekCh()=='.'){Str+=GetCh('.');}
124  else if (PeekCh()=='@'){GetCh('@'); Str.Clr();} // still unexplained
125  } while (ChDef.IsHostCh(PeekCh()));
126  Str.ToLc();
127  return Str;
128 }
bool IsHostCh(const char &Ch) const
Definition: url.cpp:21
char GetCh()
Definition: url.cpp:85
void Clr()
Definition: dt.h:258
char PeekCh() const
Definition: url.cpp:86
static const TUrlLxChDef ChDef
Definition: url.cpp:82
TChA & ToLc()
Definition: dt.cpp:552
Definition: dt.h:201
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TUrlLx::GetHostPort ( TStr HostNm,
TStr PortStr,
int &  PortN 
)

Definition at line 130 of file url.cpp.

References GetCh(), GetDigits(), GetHost(), TStr::GetInt(), IsDigitCh(), and PeekCh().

Referenced by TUrl::GetAbs().

130  {TChA Str;
131  Str+=HostNm=GetHost();
132  if (PeekCh()==':'){
133  Str+=GetCh(':');
134  if (IsDigitCh()){Str+=PortStr=GetDigits(); PortN=PortStr.GetInt();}
135  }
136  return Str;
137 }
int GetInt() const
Definition: dt.h:578
char GetCh()
Definition: url.cpp:85
TStr GetDigits()
Definition: url.cpp:109
char PeekCh() const
Definition: url.cpp:86
Definition: dt.h:201
TStr GetHost()
Definition: url.cpp:119
bool IsDigitCh() const
Definition: url.cpp:98

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TUrlLx::GetHPath ( TStrV PathSegV)

Definition at line 139 of file url.cpp.

References TVec< TVal, TSizeTy >::Add(), TChA::Clr(), GetCh(), GetHSegmentCh(), IsHSegmentCh(), and PeekCh().

Referenced by TUrl::GetAbs().

139  {TChA Str; TChA HSegStr; bool Cont;
140  do {
141  while (PeekCh()=='/'){GetCh('/');} // prevent multiple '/'
142  HSegStr.Clr(); while (IsHSegmentCh()){HSegStr+=GetHSegmentCh();}
143  Str+=HSegStr; PathSegV.Add(HSegStr);
144  Cont=(PeekCh()=='/'); if (Cont){Str+=GetCh('/');}
145  } while (Cont);
146  return Str;
147 }
char GetCh()
Definition: url.cpp:85
void Clr()
Definition: dt.h:258
bool IsHSegmentCh() const
Definition: url.cpp:100
char PeekCh() const
Definition: url.cpp:86
Definition: dt.h:201
char GetHSegmentCh()
Definition: url.cpp:101
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:602

Here is the call graph for this function:

Here is the caller graph for this function:

char TUrlLx::GetHSegmentCh ( )
inline

Definition at line 101 of file url.cpp.

References EAssertR, GetCh(), and IsHSegmentCh().

Referenced by GetHPath().

101 {EAssertR(IsHSegmentCh(), ""); return GetCh();}
char GetCh()
Definition: url.cpp:85
bool IsHSegmentCh() const
Definition: url.cpp:100
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TUrlLx::GetScheme ( )
inline

Definition at line 105 of file url.cpp.

References GetCh(), GetSchemeCh(), IsSchemeCh(), and TChA::ToLc().

Referenced by TUrl::GetAbs().

105  {TChA Str;
106  Str+=GetSchemeCh(); while (IsSchemeCh()){Str+=GetCh();}
107  Str.ToLc(); return Str;}
char GetSchemeCh()
Definition: url.cpp:97
char GetCh()
Definition: url.cpp:85
bool IsSchemeCh() const
Definition: url.cpp:96
TChA & ToLc()
Definition: dt.cpp:552
Definition: dt.h:201

Here is the call graph for this function:

Here is the caller graph for this function:

char TUrlLx::GetSchemeCh ( )
inline

Definition at line 97 of file url.cpp.

References EAssertR, GetCh(), and IsSchemeCh().

Referenced by GetScheme().

97 {EAssertR(IsSchemeCh(), ""); return GetCh();}
char GetCh()
Definition: url.cpp:85
bool IsSchemeCh() const
Definition: url.cpp:96
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TUrlLx::GetSearch ( )
inline

Definition at line 113 of file url.cpp.

References GetToCh().

Referenced by TUrl::GetAbs().

113 {return GetToCh('#');}
TStr GetToCh(const char &Ch=TUrlLxChDef::EofCh)
Definition: url.cpp:102

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TUrlLx::GetStr ( const TStr Str)
inline

Definition at line 88 of file url.cpp.

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

Referenced by TUrl::GetAbs().

88  {
89  for (int ChN=0; ChN<Str.Len(); ChN++){GetCh(Str[ChN]);} return Str;}
int Len() const
Definition: dt.h:487
char GetCh()
Definition: url.cpp:85

Here is the call graph for this function:

Here is the caller graph for this function:

const char* TUrlLx::GetStr ( const char *  Str)
inline

Definition at line 90 of file url.cpp.

References GetCh().

90  {
91  int Len = (int) strlen(Str);
92  for (int ChN=0; ChN<Len; ChN++){GetCh(Str[ChN]);}
93  return Str;
94  }
char GetCh()
Definition: url.cpp:85

Here is the call graph for this function:

TStr TUrlLx::GetToCh ( const char &  Ch = TUrlLxChDef::EofCh)
inline

Definition at line 102 of file url.cpp.

References EofCh, GetCh(), and PeekCh().

Referenced by TUrl::GetAbs(), and GetSearch().

102  {TChA Str;
103  while ((PeekCh()!=EofCh)&&(PeekCh()!=Ch)){Str+=GetCh();} return Str;}
char GetCh()
Definition: url.cpp:85
static const char EofCh
Definition: url.cpp:78
char PeekCh() const
Definition: url.cpp:86
Definition: dt.h:201

Here is the call graph for this function:

Here is the caller graph for this function:

bool TUrlLx::IsDigitCh ( ) const
inline

Definition at line 98 of file url.cpp.

References ChDef, TUrlLxChDef::IsDigitCh(), and PeekCh().

Referenced by GetDigitCh(), GetDigits(), and GetHostPort().

98 {return ChDef.IsDigitCh(PeekCh());}
char PeekCh() const
Definition: url.cpp:86
static const TUrlLxChDef ChDef
Definition: url.cpp:82
bool IsDigitCh(const char &Ch) const
Definition: url.cpp:19

Here is the call graph for this function:

Here is the caller graph for this function:

bool TUrlLx::IsHSegmentCh ( ) const
inline

Definition at line 100 of file url.cpp.

References ChDef, TUrlLxChDef::IsHSegmentCh(), and PeekCh().

Referenced by GetHPath(), and GetHSegmentCh().

100 {return ChDef.IsHSegmentCh(PeekCh());}
char PeekCh() const
Definition: url.cpp:86
bool IsHSegmentCh(const char &Ch) const
Definition: url.cpp:22
static const TUrlLxChDef ChDef
Definition: url.cpp:82

Here is the call graph for this function:

Here is the caller graph for this function:

bool TUrlLx::IsSchemeCh ( ) const
inline

Definition at line 96 of file url.cpp.

References ChDef, TUrlLxChDef::IsSchemeCh(), and PeekCh().

Referenced by GetScheme(), and GetSchemeCh().

96 {return ChDef.IsSchemeCh(PeekCh());}
bool IsSchemeCh(const char &Ch) const
Definition: url.cpp:20
char PeekCh() const
Definition: url.cpp:86
static const TUrlLxChDef ChDef
Definition: url.cpp:82

Here is the call graph for this function:

Here is the caller graph for this function:

char TUrlLx::PeekCh ( ) const
inline

Definition at line 86 of file url.cpp.

References Bf, BfC, Eof(), and EofCh.

Referenced by TUrl::GetAbs(), GetHost(), GetHostPort(), GetHPath(), GetToCh(), IsDigitCh(), IsHSegmentCh(), and IsSchemeCh().

86 {if (Eof()){return EofCh;} else {return Bf[BfC];}}
static const char EofCh
Definition: url.cpp:78
bool Eof() const
Definition: url.cpp:84
TChA Bf
Definition: url.cpp:79
int BfC
Definition: url.cpp:80

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

TChA TUrlLx::Bf
private

Definition at line 79 of file url.cpp.

Referenced by Eof(), GetCh(), and PeekCh().

int TUrlLx::BfC
private

Definition at line 80 of file url.cpp.

Referenced by Eof(), GetCh(), and PeekCh().

const TUrlLxChDef TUrlLx::ChDef
static

Definition at line 82 of file url.cpp.

Referenced by GetHost(), IsDigitCh(), IsHSegmentCh(), and IsSchemeCh().

const char TUrlLx::EofCh =TUrlLxChDef::EofCh
staticprivate

Definition at line 78 of file url.cpp.

Referenced by GetCh(), GetToCh(), and PeekCh().


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