SNAP Library 2.0, Developer Reference  2013-05-13 16:33:57
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TUrlLx Class Reference
Collaboration diagram for TUrlLx:

List of all members.

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.

: Bf(_Str), BfC(0){}

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().

{return BfC==Bf.Len();};

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().

{if (Eof()){return EofCh;} else {return Bf[BfC++];}}

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().

{EAssertR(GetCh()==Ch, ""); return Ch;}

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().

{EAssertR(IsDigitCh(), ""); return GetCh();}

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().

                  {TChA Str;
    do {Str+=GetDigitCh();} while (IsDigitCh()); return Str;}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 119 of file url.cpp.

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

Referenced by GetHostPort().

                    {TChA Str;
  EAssertR(ChDef.IsHostCh(PeekCh()), "");
  do {
    while (ChDef.IsHostCh(PeekCh())){Str+=GetCh();}
    if (PeekCh()=='.'){Str+=GetCh('.');}
    else if (PeekCh()=='@'){GetCh('@'); Str.Clr();} // still unexplained
  } while (ChDef.IsHostCh(PeekCh()));
  Str.ToLc();
  return Str;
}

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().

                                                               {TChA Str;
  Str+=HostNm=GetHost();
  if (PeekCh()==':'){
    Str+=GetCh(':');
    if (IsDigitCh()){Str+=PortStr=GetDigits(); PortN=PortStr.GetInt();}
  }
  return Str;
}

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().

                                    {TChA Str; TChA HSegStr; bool Cont;
  do {
    while (PeekCh()=='/'){GetCh('/');} // prevent multiple '/'
    HSegStr.Clr(); while (IsHSegmentCh()){HSegStr+=GetHSegmentCh();}
    Str+=HSegStr; PathSegV.Add(HSegStr);
    Cont=(PeekCh()=='/'); if (Cont){Str+=GetCh('/');}
  } while (Cont);
  return Str;
}

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().

{EAssertR(IsHSegmentCh(), ""); return GetCh();}

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().

                  {TChA Str;
    Str+=GetSchemeCh(); while (IsSchemeCh()){Str+=GetCh();}
    Str.ToLc(); return Str;}

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().

{EAssertR(IsSchemeCh(), ""); return GetCh();}

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().

{return GetToCh('#');}

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().

                              {
    for (int ChN=0; ChN<Str.Len(); ChN++){GetCh(Str[ChN]);} return Str;}

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().

                                     {
        int Len = (int) strlen(Str);
    for (int ChN=0; ChN<Len; ChN++){GetCh(Str[ChN]);} 
        return Str;
  }

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().

                                               {TChA Str;
    while ((PeekCh()!=EofCh)&&(PeekCh()!=Ch)){Str+=GetCh();} return Str;}

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().

{return ChDef.IsDigitCh(PeekCh());}

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().

{return ChDef.IsHSegmentCh(PeekCh());}

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().

{return ChDef.IsSchemeCh(PeekCh());}

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().

{if (Eof()){return EofCh;} else {return Bf[BfC];}}

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 [static, private]

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: