SNAP Library 2.1, Developer Reference  2013-09-25 10:47:25
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
THtmlLx Class Reference

#include <html.h>

Collaboration diagram for THtmlLx:

List of all members.

Public Types

typedef TStrKdV TArgNmValV

Public Member Functions

 THtmlLx (const PSIn &_SIn, const bool &_DoParseArg=true)
THtmlLxoperator= (const THtmlLx &)
void PutCh (const char &_Ch)
void PutStr (const TStr &Str)
THtmlLxSym GetSym ()
PHtmlTok GetTok (const bool &DoUc=true)
TStr GetPreSpaceStr () const
int GetArgs () const
TStr GetArgNm (const int &ArgN) const
TStr GetArgVal (const int &ArgN) const
bool IsArg (const TStr &ArgNm) const
TStr GetArg (const TStr &ArgNm, const TStr &DfArgVal=TStr()) const
void PutArg (const TStr &ArgNm, const TStr &ArgVal)
TStr GetFullBTagStr () const
void MoveToStrOrEof (const TStr &Str)
void MoveToBTagOrEof (const TStr &TagNm)
void MoveToBTag2OrEof (const TStr &TagNm1, const TStr &TagNm2)
void MoveToBTag3OrEof (const TStr &TagNm1, const TStr &TagNm2, const TStr &TagNm3)
void MoveToBTagOrETagOrEof (const TStr &BTagNm, const TStr &ETagNm)
void MoveToBTagArgOrEof (const TStr &TagNm, const TStr &ArgNm, const TStr &ArgVal)
void MoveToBTagArg2OrEof (const TStr &TagNm, const TStr &ArgNm1, const TStr &ArgVal1, const TStr &ArgNm2, const TStr &ArgVal2, const bool &AndOpP=true)
void MoveToBTagOrEof (const TStr &TagNm1, const TStr &ArgNm1, const TStr &ArgVal1, const TStr &TagNm2, const TStr &ArgNm2, const TStr &ArgVal2)
void MoveToETagOrEof (const TStr &TagNm)
TStr GetTextOnlyStrToEof ()
TStr GetStrToBTag (const TStr &TagNm, const bool &TxtOnlyP=false)
TStr GetStrToBTag (const TStr &TagNm, const TStr &ArgNm, const TStr &ArgVal, const bool &TxtOnlyP=false)
TStr GetStrToETag (const TStr &TagNm, const bool &TxtOnlyP=false)
TStr GetStrToETag2 (const TStr &TagNm1, const TStr &TagNm2, const bool &TxtOnlyP=false)
TStr GetStrInTag (const TStr &TagNm, const bool &TxtOnlyP=false)
TStr GetHRefBeforeStr (const TStr &Str)
bool IsGetBTag (const TStr &TagNm)
bool IsGetETag (const TStr &TagNm)

Static Public Member Functions

static TStr GetSymStr (const THtmlLxSym &Sym)
static TStr GetEscapedStr (const TChA &ChA)
static TStr GetAsciiStr (const TChA &ChA, const char &GenericCh='_')
static void GetTokStrV (const TStr &Str, TStrV &TokStrV)
static TStr GetNoTag (const TStr &Str)

Public Attributes

THtmlLxSym Sym
int SymBChX
int SymEChX
TChA ChA
TChA UcChA
TChA SymChA
int PreSpaces
TChA PreSpaceChA
TArgNmValV ArgNmValV

Private Member Functions

void GetCh ()
void GetEscCh ()
void GetMetaTag ()
void GetTag ()

Private Attributes

PSIn SIn
TSInRSIn
bool DoParseArg
TChA ChStack
char Ch
int ChX
bool EscCh
TChA EscChA
TChA ArgNm
TChA ArgVal

Static Private Attributes

static THtmlLxChDef ChDef

Detailed Description

Definition at line 82 of file html.h.


Member Typedef Documentation

Definition at line 114 of file html.h.


Constructor & Destructor Documentation

THtmlLx::THtmlLx ( const PSIn _SIn,
const bool &  _DoParseArg = true 
) [inline]

Definition at line 117 of file html.h.

                                                         :
    SIn(_SIn), RSIn(*SIn), DoParseArg(_DoParseArg),
    ChStack(), Ch(' '), ChX(0), EscCh(false),
    EscChA(), ArgNm(), ArgVal(),
    Sym(hsyUndef), SymBChX(0), SymEChX(0), ChA(), UcChA(),
    PreSpaces(0), PreSpaceChA(), ArgNmValV(){}

Member Function Documentation

TStr THtmlLx::GetArg ( const TStr ArgNm,
const TStr DfArgVal = TStr() 
) const [inline]

Definition at line 139 of file html.h.

References ArgNmValV, and TVec< TVal, TSizeTy >::SearchForw().

Referenced by THtmlDoc::_IsTagRedir(), GetHRefBeforeStr(), GetStrToBTag(), MoveToBTagArg2OrEof(), MoveToBTagArgOrEof(), and MoveToBTagOrEof().

                                                                    {
    int ArgN=ArgNmValV.SearchForw(TStrKd(ArgNm));
    if (ArgN==-1){return DfArgVal;} else {return ArgNmValV[ArgN].Dat;}}

Here is the call graph for this function:

Here is the caller graph for this function:

TStr THtmlLx::GetArgNm ( const int &  ArgN) const [inline]

Definition at line 136 of file html.h.

References ArgNmValV.

Referenced by GetFullBTagStr(), and THtmlDoc::SaveHtmlToXml().

{return ArgNmValV[ArgN].Key;}

Here is the caller graph for this function:

int THtmlLx::GetArgs ( ) const [inline]

Definition at line 135 of file html.h.

References ArgNmValV, and TVec< TVal, TSizeTy >::Len().

Referenced by GetFullBTagStr(), and THtmlDoc::SaveHtmlToXml().

{return ArgNmValV.Len();}

Here is the call graph for this function:

Here is the caller graph for this function:

TStr THtmlLx::GetArgVal ( const int &  ArgN) const [inline]

Definition at line 137 of file html.h.

References ArgNmValV.

Referenced by GetFullBTagStr(), and THtmlDoc::SaveHtmlToXml().

{return ArgNmValV[ArgN].Dat;}

Here is the caller graph for this function:

TStr THtmlLx::GetAsciiStr ( const TChA ChA,
const char &  GenericCh = '_' 
) [static]

Definition at line 584 of file html.cpp.

References Ch, and TChA::Len().

                                                               {
  TChA AsciiChA;
  for (int ChN=0; ChN<ChA.Len(); ChN++){
    char Ch=ChA[ChN];
    if ((Ch<' ')||('~'<Ch)){
      Ch=GenericCh;}
    AsciiChA+=Ch;
  }
  return AsciiChA;
}

Here is the call graph for this function:

void THtmlLx::GetCh ( ) [inline, private]

Definition at line 95 of file html.h.

References Ch, ChStack, ChX, TChA::Empty(), TSIn::Eof(), TCh::EofCh, TSIn::GetCh(), TChA::Pop(), RSIn, and SymChA.

Referenced by GetEscCh(), GetMetaTag(), GetSym(), and GetTag().

              {
    if (ChStack.Empty()){
      if (RSIn.Eof()){Ch=TCh::EofCh;} else {Ch=RSIn.GetCh(); ChX++;}
    } else {
      Ch=ChStack.Pop(); ChX++;
    }
    SymChA+=Ch;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

TStr THtmlLx::GetEscapedStr ( const TChA ChA) [static]

Definition at line 568 of file html.cpp.

References Ch, and TChA::Len().

                                          {
  TChA EscapedChA;
  for (int ChN=0; ChN<ChA.Len(); ChN++){
    char Ch=ChA[ChN];
    switch (Ch){
      case '"': EscapedChA+="&quot;"; break;
      case '&': EscapedChA+="&amp;"; break;
      case '\'': EscapedChA+="&apos;"; break;
      case '<': EscapedChA+="&lt;"; break;
      case '>': EscapedChA+="&gt;"; break;
      default: EscapedChA+=Ch;
    }
  }
  return EscapedChA;
}

Here is the call graph for this function:

void THtmlLx::GetEscCh ( ) [private]

Definition at line 195 of file html.cpp.

References TChA::AddCh(), Ch, ChDef, TChA::Clr(), EscCh, EscChA, GetCh(), THtmlLxChDef::GetEscStr(), PutCh(), and PutStr().

Referenced by GetMetaTag(), GetSym(), and GetTag().

                      {
  GetCh();
  EscCh=(Ch=='&');
  if (EscCh){
    EscChA.Clr(); EscChA.AddCh(Ch); GetCh();
    if (Ch=='#'){
      EscChA.AddCh(Ch); GetCh();
      if (('0'<=Ch)&&(Ch<='9')){
        do {EscChA.AddCh(Ch); GetCh();} while (('0'<=Ch)&&(Ch<='9'));
        if (Ch==';'){GetCh();}
        PutStr(ChDef.GetEscStr(EscChA));
      } else {
        PutCh('#'); PutCh('&');
      }
    } else
    if ((('a'<=Ch)&&(Ch<='z'))||(('A'<=Ch)&&(Ch<='Z'))){
      do {
        EscChA.AddCh(Ch); GetCh();
      } while ((('A'<=Ch)&&(Ch<='Z'))||(('a'<=Ch)&&(Ch<='z'))||(('0'<=Ch)&&(Ch<='9')));
      if (Ch==';'){
        GetCh(); PutStr(ChDef.GetEscStr(EscChA));
      } else {
        PutStr(EscChA);
      }      
    } else {
      PutCh('&');
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 358 of file html.cpp.

References ChA, GetArgNm(), GetArgs(), GetArgVal(), hsyBTag, IAssert, TChA::Pop(), and Sym.

Referenced by THtmlDoc::GetRedirHtmlDocStr().

                                   {
  IAssert(Sym==hsyBTag);
  TChA BTagChA;
  BTagChA+=ChA; BTagChA.Pop();
  for (int ArgN=0; ArgN<GetArgs(); ArgN++){
    BTagChA+=' '; BTagChA+=GetArgNm(ArgN);
    BTagChA+='='; BTagChA+='"'; BTagChA+=GetArgVal(ArgN); BTagChA+='"';
  }
  BTagChA+='>';
  return BTagChA;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 530 of file html.cpp.

References ChA, forever, GetArg(), GetSym(), hsyBTag, hsyEof, hsyStr, Sym, and UcChA.

                                             {
  TStr HRefStr;
  forever {
    GetSym();
    if (Sym==hsyEof){HRefStr=""; break;}
    if ((Sym==hsyBTag)&&(UcChA=="<A>")){HRefStr=GetArg("HREF");}
    if ((Sym==hsyStr)&&(ChA==Str)){break;}
  }
  return HRefStr;
}

Here is the call graph for this function:

void THtmlLx::GetMetaTag ( ) [private]

Definition at line 225 of file html.cpp.

References Ch, TCh::EofCh, GetCh(), GetEscCh(), hsyMTag, and Sym.

Referenced by GetSym().

                        {
  Sym=hsyMTag;
  if (Ch=='-'){
    char PCh=' ';
    while ((Ch!=TCh::EofCh) && ((PCh!='-')||(Ch!='>'))){PCh=Ch; GetCh();}
  } else {
    while ((Ch!=TCh::EofCh) && (Ch!='>')){GetCh();}
  }
  if (Ch!=TCh::EofCh){GetEscCh();}
}

Here is the call graph for this function:

Here is the caller graph for this function:

TStr THtmlLx::GetNoTag ( const TStr Str) [static]

Definition at line 606 of file html.cpp.

References ChA, GetSym(), hsyEof, hsyNum, hsySSym, hsyStr, hsyUndef, TStrIn::New(), PreSpaces, SIn, and Sym.

                                      {
  PSIn SIn=TStrIn::New(Str);
  THtmlLx Lx(SIn);
  Lx.GetSym();
  TChA ChA;
  while (Lx.Sym!=hsyEof){
    switch (Lx.Sym){
          case hsyUndef: 
          case hsyStr: 
          case hsyNum: 
          case hsySSym:
                if (Lx.PreSpaces > 0) { ChA += ' '; }
                ChA += Lx.ChA;
          default: break;
        }
        Lx.GetSym();
  }
  return ChA;
}

Here is the call graph for this function:

TStr THtmlLx::GetPreSpaceStr ( ) const [inline]

Definition at line 132 of file html.h.

References TStr::GetSpaceStr(), and PreSpaces.

Here is the call graph for this function:

TStr THtmlLx::GetStrInTag ( const TStr TagNm,
const bool &  TxtOnlyP = false 
)

Definition at line 525 of file html.cpp.

References GetStrToETag(), and MoveToBTagOrEof().

                                                                {
  MoveToBTagOrEof(TagNm);
  return GetStrToETag(TagNm, TxtOnlyP);
}

Here is the call graph for this function:

TStr THtmlLx::GetStrToBTag ( const TStr TagNm,
const bool &  TxtOnlyP = false 
)

Definition at line 462 of file html.cpp.

References ChA, forever, GetSym(), hsyBTag, hsyEof, hsyETag, PreSpaces, Sym, and UcChA.

                                                                 {
  TChA OutChA;
  forever {
    GetSym();
    if ((Sym==hsyEof)||((Sym==hsyBTag)&&(UcChA==TagNm))){
      break;
    } else {
      if (PreSpaces>0){OutChA+=' ';}
      if ((TxtOnlyP&&(Sym!=hsyBTag)&&(Sym!=hsyETag))||(!TxtOnlyP)){
        OutChA+=ChA;}
    }
  }
  return OutChA;
}

Here is the call graph for this function:

TStr THtmlLx::GetStrToBTag ( const TStr TagNm,
const TStr ArgNm,
const TStr ArgVal,
const bool &  TxtOnlyP = false 
)

Definition at line 477 of file html.cpp.

References ChA, forever, GetArg(), GetSym(), hsyBTag, hsyEof, hsyETag, IsArg(), PreSpaces, Sym, and UcChA.

                                          {
  TChA OutChA;
  forever {
    GetSym();
    if ((Sym==hsyEof)||((Sym==hsyBTag)&&(UcChA==TagNm)&&
     (IsArg(ArgNm))&&(GetArg(ArgNm)==ArgVal))){
      break;
    } else {
      if (PreSpaces>0){OutChA+=' ';}
      if ((TxtOnlyP&&(Sym!=hsyBTag)&&(Sym!=hsyETag))||(!TxtOnlyP)){
        OutChA+=ChA;}
    }
  }
  return OutChA;
}

Here is the call graph for this function:

TStr THtmlLx::GetStrToETag ( const TStr TagNm,
const bool &  TxtOnlyP = false 
)

Definition at line 494 of file html.cpp.

References ChA, forever, GetSym(), hsyBTag, hsyEof, hsyETag, PreSpaces, Sym, and UcChA.

Referenced by GetStrInTag().

                                                                 {
  TChA OutChA;
  forever {
    GetSym();
    if ((Sym==hsyEof)||((Sym==hsyETag)&&(UcChA==TagNm))){
      break;
    } else {
      if (PreSpaces>0){OutChA+=' ';}
      if ((TxtOnlyP&&(Sym!=hsyBTag)&&(Sym!=hsyETag))||(!TxtOnlyP)){
        OutChA+=ChA;}
    }
  }
  return OutChA;
}

Here is the call graph for this function:

Here is the caller graph for this function:

TStr THtmlLx::GetStrToETag2 ( const TStr TagNm1,
const TStr TagNm2,
const bool &  TxtOnlyP = false 
)

Definition at line 509 of file html.cpp.

References ChA, forever, GetSym(), hsyBTag, hsyEof, hsyETag, PreSpaces, Sym, and UcChA.

                                          {
  TChA OutChA;
  forever {
    GetSym();
    if ((Sym==hsyEof)||((Sym==hsyETag)&&(UcChA==TagNm1))||((Sym==hsyETag)&&(UcChA==TagNm2))){
      break;
    } else {
      if (PreSpaces>0){OutChA+=' ';}
      if ((TxtOnlyP&&(Sym!=hsyBTag)&&(Sym!=hsyETag))||(!TxtOnlyP)){
        OutChA+=ChA;}
    }
  }
  return OutChA;
}

Here is the call graph for this function:

Definition at line 277 of file html.cpp.

References TChA::AddCh(), ArgNmValV, Ch, ChA, ChDef, ChX, TChA::Clr(), TVec< TVal, TSizeTy >::Clr(), TChA::Empty(), EscCh, forever, GetCh(), THtmlLxChDef::GetChTy(), GetEscCh(), GetMetaTag(), GetTag(), THtmlLxChDef::GetUc(), hlctAlpha, hlctEof, hlctLTag, hlctNum, hlctRTag, hlctSym, hsyEof, hsyNum, hsySSym, hsyStr, hsyUndef, THtmlLxChDef::IsAlNum(), THtmlLxChDef::IsAlpha(), THtmlLxChDef::IsNum(), THtmlLxChDef::IsSpace(), TChA::LastCh(), TChA::Pop(), PreSpaceChA, PreSpaces, PutCh(), Sym, SymBChX, SymChA, SymEChX, and UcChA.

Referenced by GetHRefBeforeStr(), GetNoTag(), THtmlDoc::GetRedirHtmlDocStr(), GetStrToBTag(), GetStrToETag(), GetStrToETag2(), GetTextOnlyStrToEof(), GetTokStrV(), THtmlDoc::GetTxtLnDoc(), IsGetBTag(), IsGetETag(), MoveToBTag2OrEof(), MoveToBTag3OrEof(), MoveToBTagArg2OrEof(), MoveToBTagArgOrEof(), MoveToBTagOrEof(), MoveToBTagOrETagOrEof(), MoveToETagOrEof(), MoveToStrOrEof(), THtmlDoc::SaveHtmlToXml(), and THtmlDoc::THtmlDoc().

                          {
  // prepare symbol descriptions
  ChA.Clr(); UcChA.Clr();
  PreSpaces=0; PreSpaceChA.Clr();
  ArgNmValV.Clr();
  // skip white-space
  while (ChDef.IsSpace(Ch)){
    if (ChX>0){PreSpaceChA+=Ch; PreSpaces++;} GetEscCh();}
  // parse symbol
  SymChA.Clr(); SymChA+=Ch; SymBChX=ChX;
  switch (ChDef.GetChTy(Ch)){
    case hlctAlpha:
      Sym=hsyStr;
      forever{
        do {
          ChA.AddCh(Ch); UcChA.AddCh(ChDef.GetUc(Ch)); GetEscCh();
        } while (ChDef.IsAlNum(Ch));
        if (Ch=='.'){
          GetCh();
          if (ChDef.IsAlNum(Ch)){ChA.AddCh('.'); UcChA.AddCh('.');}
          else {PutCh(Ch); Ch='.'; break;}
        } else {break;}
      }
      break;
    case hlctNum:
      Sym=hsyNum;
      forever{
        do {
          ChA.AddCh(Ch); UcChA.AddCh(Ch); GetEscCh();
        } while (ChDef.IsNum(Ch));
        if (Ch=='.'){
          GetCh();
          if (ChDef.IsAlNum(Ch)){ChA.AddCh('.'); UcChA.AddCh('.');}
          else {PutCh(Ch); Ch='.'; break;}
        } else if (ChDef.IsAlpha(Ch)){
          Sym=hsyStr;
        } else {
          break;
        }
      }
      break;
    case hlctSym:
      Sym=hsySSym; ChA.AddCh(Ch); UcChA.AddCh(Ch); GetEscCh();
      if ((ChA.LastCh()=='.')&&(ChDef.IsAlNum(Ch))){
        Sym=hsyStr;
        do {
          ChA.AddCh(Ch); UcChA.AddCh(ChDef.GetUc(Ch)); GetEscCh();
        } while (ChDef.IsAlNum(Ch));
      }
      break;
    case hlctLTag:
      if (EscCh){
        Sym=hsySSym; ChA.AddCh(Ch); UcChA.AddCh(Ch); GetEscCh();
      } else {
        GetCh();
        if (Ch=='!'){GetCh(); GetMetaTag();} else {GetTag();}
      }
      break;
    case hlctRTag:
      if (EscCh){
        Sym=hsySSym; ChA.AddCh(Ch); UcChA.AddCh(Ch); GetEscCh();
      } else {
        Sym=hsySSym; ChA.AddCh(Ch); UcChA.AddCh(Ch);  GetEscCh();
      }
      break;
    case hlctEof: Sym=hsyEof; break;
    default: Sym=hsyUndef; GetEscCh();
  }
  // set symbol last-character-position
  SymEChX=ChX-1;
  // delete last character
  if (!SymChA.Empty()){SymChA.Pop();}
  // return symbol
  return Sym;
}

Here is the call graph for this function:

Here is the caller graph for this function:

TStr THtmlLx::GetSymStr ( const THtmlLxSym Sym) [static]

Definition at line 553 of file html.cpp.

References Fail, hsyBTag, hsyEof, hsyETag, hsyMTag, hsyNum, hsySSym, hsyStr, hsyUndef, and hsyUrl.

Referenced by THtmlTok::SaveTxt().

                                            {
  switch (Sym){
    case hsyUndef: return "Undef";
    case hsyStr: return "Str";
    case hsyNum: return "Num";
    case hsySSym: return "SSym";
    case hsyUrl: return "Url";
    case hsyBTag: return "BTag";
    case hsyETag: return "ETag";
    case hsyMTag: return "MTag";
    case hsyEof: return "Eof";
    default: Fail; return TStr();
  }
}

Here is the caller graph for this function:

void THtmlLx::GetTag ( ) [private]

Definition at line 236 of file html.cpp.

References TVec< TVal, TSizeTy >::Add(), TChA::AddCh(), ArgNm, ArgNmValV, ArgVal, Ch, ChA, ChDef, TChA::Clr(), DoParseArg, TCh::EofCh, GetCh(), GetEscCh(), THtmlLxChDef::GetUc(), hsyBTag, hsyETag, THtmlLxChDef::IsAlNum(), THtmlLxChDef::IsAlpha(), THtmlLxChDef::IsEoln(), THtmlLxChDef::IsWs(), Sym, and UcChA.

Referenced by GetSym().

                    {
  if (Ch=='/'){Sym=hsyETag; GetCh();} else {Sym=hsyBTag;}
  UcChA.AddCh('<');
  while (ChDef.IsAlNum(Ch)||(Ch==':')){
    UcChA.AddCh(ChDef.GetUc(Ch)); GetCh();}
  UcChA.AddCh('>');
  ChA=UcChA;

  if (DoParseArg){
    while ((Ch!='>')&&(Ch!=TCh::EofCh)){
      while ((!ChDef.IsAlpha(Ch))&&(Ch!='>')&&(Ch!=TCh::EofCh)){GetCh();}
      if (ChDef.IsAlpha(Ch)){
        ArgNm.Clr(); ArgVal.Clr();
        while (ChDef.IsAlNum(Ch)||(Ch=='-')){ArgNm.AddCh(ChDef.GetUc(Ch)); GetCh();}
        while (ChDef.IsWs(Ch)){GetCh();}
        if (Ch=='='){
          GetCh(); while (ChDef.IsWs(Ch)){GetCh();}
          if (Ch=='"'){
            GetCh();
            while ((Ch!=TCh::EofCh)&&(Ch!='"')&&(Ch!='>')){
              if (!ChDef.IsEoln(Ch)){ArgVal.AddCh(Ch);} GetCh();}
            if (Ch=='"'){GetCh();}
          } else if (Ch=='\''){
            GetCh();
            while ((Ch!=TCh::EofCh)&&(Ch!='\'')&&(Ch!='>')){
              if (!ChDef.IsEoln(Ch)){ArgVal.AddCh(Ch);} GetCh();}
            if (Ch=='\''){GetCh();}
          } else {
            while ((!ChDef.IsWs(Ch))&&(Ch!='>')&&(Ch!=TCh::EofCh)){
              ArgVal.AddCh(Ch); GetCh();}
          }
          ArgNmValV.Add(TStrKd(ArgNm, ArgVal));
        }
      }
    }
  } else {
    while ((Ch!='>')&&(Ch!=TCh::EofCh)){GetCh();}
  }
  if (Ch!=TCh::EofCh){GetEscCh();}
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 447 of file html.cpp.

References ChA, forever, GetSym(), hsyBTag, hsyEof, hsyETag, PreSpaces, and Sym.

                                 {
  TChA OutChA;
  forever {
    GetSym();
    if (Sym==hsyEof){
      break;
    } else {
      if (PreSpaces>0){OutChA+=' ';}
      if ((Sym!=hsyBTag)&&(Sym!=hsyETag)){
        OutChA+=ChA;}
    }
  }
  return OutChA;
}

Here is the call graph for this function:

PHtmlTok THtmlLx::GetTok ( const bool &  DoUc = true)

Definition at line 353 of file html.cpp.

References ArgNmValV, ChA, Sym, and UcChA.

Referenced by THtmlDoc::GetTxtLnDoc(), THtmlDoc::SaveHtmlToXml(), and THtmlDoc::THtmlDoc().

                                        {
  if (DoUc){return PHtmlTok(new THtmlTok(Sym, UcChA, ArgNmValV));}
  else {return PHtmlTok(new THtmlTok(Sym, ChA, ArgNmValV));}
}

Here is the caller graph for this function:

void THtmlLx::GetTokStrV ( const TStr Str,
TStrV TokStrV 
) [static]

Definition at line 595 of file html.cpp.

References TVec< TVal, TSizeTy >::Add(), ChA, TVec< TVal, TSizeTy >::Clr(), GetSym(), hsyEof, TStrIn::New(), SIn, and Sym.

                                                       {
  PSIn SIn=TStrIn::New(Str);
  THtmlLx Lx(SIn);
  Lx.GetSym();
  TokStrV.Clr();
  while (Lx.Sym!=hsyEof){
    TokStrV.Add(Lx.ChA);
    Lx.GetSym();
  }
}

Here is the call graph for this function:

bool THtmlLx::IsArg ( const TStr ArgNm) const [inline]

Definition at line 138 of file html.h.

References ArgNmValV, and TVec< TVal, TSizeTy >::IsIn().

Referenced by THtmlDoc::_IsTagRedir(), GetStrToBTag(), MoveToBTagArg2OrEof(), MoveToBTagArgOrEof(), and MoveToBTagOrEof().

{return ArgNmValV.IsIn(TStrKd(ArgNm));}

Here is the call graph for this function:

Here is the caller graph for this function:

bool THtmlLx::IsGetBTag ( const TStr TagNm)

Definition at line 541 of file html.cpp.

References ChA, GetSym(), and hsyBTag.

                                        {
  if (GetSym()==hsyBTag){
    return ChA==TagNm;
  } else {return false;}
}

Here is the call graph for this function:

bool THtmlLx::IsGetETag ( const TStr TagNm)

Definition at line 547 of file html.cpp.

References ChA, GetSym(), and hsyETag.

                                        {
  if (GetSym()==hsyETag){
    return ChA==TagNm;
  } else {return false;}
}

Here is the call graph for this function:

void THtmlLx::MoveToBTag2OrEof ( const TStr TagNm1,
const TStr TagNm2 
)

Definition at line 382 of file html.cpp.

References GetSym(), hsyBTag, hsyEof, Sym, and UcChA.

                                                                    {
  do {
    GetSym();
  } while ((Sym!=hsyEof)&&((Sym!=hsyBTag)||((UcChA!=TagNm1)&&(UcChA!=TagNm2))));
}

Here is the call graph for this function:

void THtmlLx::MoveToBTag3OrEof ( const TStr TagNm1,
const TStr TagNm2,
const TStr TagNm3 
)

Definition at line 388 of file html.cpp.

References GetSym(), hsyBTag, hsyEof, Sym, and UcChA.

                                                                                        {
  do {
    GetSym();
  } while ((Sym!=hsyEof)&&((Sym!=hsyBTag)||((UcChA!=TagNm1)&&(UcChA!=TagNm2)&&(UcChA!=TagNm3))));
}

Here is the call graph for this function:

void THtmlLx::MoveToBTagArg2OrEof ( const TStr TagNm,
const TStr ArgNm1,
const TStr ArgVal1,
const TStr ArgNm2,
const TStr ArgVal2,
const bool &  AndOpP = true 
)

Definition at line 410 of file html.cpp.

References forever, GetArg(), GetSym(), hsyBTag, hsyEof, IsArg(), Sym, and UcChA.

                                                             {
  forever {
    GetSym();
    if (Sym==hsyEof){break;}
    if (AndOpP){
      if ((Sym==hsyBTag)&&(UcChA==TagNm)&&
       (IsArg(ArgNm1))&&(GetArg(ArgNm1)==ArgVal1)&&
       (IsArg(ArgNm2))&&(GetArg(ArgNm2)==ArgVal2)){break;}
    } else {
      if ((Sym==hsyBTag)&&(UcChA==TagNm)&&
       (((IsArg(ArgNm1))&&(GetArg(ArgNm1)==ArgVal1))||
        ((IsArg(ArgNm2))&&(GetArg(ArgNm2)==ArgVal2)))){break;}
    }
  }
}

Here is the call graph for this function:

void THtmlLx::MoveToBTagArgOrEof ( const TStr TagNm,
const TStr ArgNm,
const TStr ArgVal 
)

Definition at line 400 of file html.cpp.

References forever, GetArg(), GetSym(), hsyBTag, hsyEof, IsArg(), Sym, and UcChA.

                                                          {
  forever {
    GetSym();
    if (Sym==hsyEof){break;}
    if ((Sym==hsyBTag)&&(UcChA==TagNm)&&
     (IsArg(ArgNm))&&(GetArg(ArgNm)==ArgVal)){break;}
  }
}

Here is the call graph for this function:

void THtmlLx::MoveToBTagOrEof ( const TStr TagNm)

Definition at line 376 of file html.cpp.

References GetSym(), hsyBTag, hsyEof, Sym, and UcChA.

Referenced by GetStrInTag().

                                              {
  do {
    GetSym();
  } while ((Sym!=hsyEof)&&((Sym!=hsyBTag)||(UcChA!=TagNm)));
}

Here is the call graph for this function:

Here is the caller graph for this function:

void THtmlLx::MoveToBTagOrEof ( const TStr TagNm1,
const TStr ArgNm1,
const TStr ArgVal1,
const TStr TagNm2,
const TStr ArgNm2,
const TStr ArgVal2 
)

Definition at line 428 of file html.cpp.

References forever, GetArg(), GetSym(), hsyBTag, hsyEof, IsArg(), Sym, and UcChA.

                                                             {
  forever {
    GetSym();
    if (Sym==hsyEof){break;}
    if ((Sym==hsyBTag)&&(UcChA==TagNm1)&&
     (IsArg(ArgNm1))&&(GetArg(ArgNm1)==ArgVal1)){break;}
    if ((Sym==hsyBTag)&&(UcChA==TagNm2)&&
     (IsArg(ArgNm2))&&(GetArg(ArgNm2)==ArgVal2)){break;}
  }
}

Here is the call graph for this function:

void THtmlLx::MoveToBTagOrETagOrEof ( const TStr BTagNm,
const TStr ETagNm 
)

Definition at line 394 of file html.cpp.

References GetSym(), hsyBTag, hsyEof, hsyETag, Sym, and UcChA.

                                                                         {
  do {
    GetSym();
  } while ((Sym!=hsyEof) && ((Sym!=hsyBTag)||(UcChA!=BTagNm)) && ((Sym!=hsyETag) || (UcChA!=ETagNm)));
}

Here is the call graph for this function:

void THtmlLx::MoveToETagOrEof ( const TStr TagNm)

Definition at line 441 of file html.cpp.

References GetSym(), hsyEof, hsyETag, Sym, and UcChA.

                                              {
  do {
    GetSym();
  } while ((Sym!=hsyEof)&&((Sym!=hsyETag)||(UcChA!=TagNm)));
}

Here is the call graph for this function:

void THtmlLx::MoveToStrOrEof ( const TStr Str)

Definition at line 370 of file html.cpp.

References ChA, GetSym(), hsyEof, hsyStr, and Sym.

                                           {
  do {
    GetSym();
  } while ((Sym!=hsyEof)&&((Sym!=hsyStr)||(ChA!=Str)));
}

Here is the call graph for this function:

THtmlLx& THtmlLx::operator= ( const THtmlLx ) [inline]

Definition at line 124 of file html.h.

References Fail.

{Fail; return *this;}
void THtmlLx::PutArg ( const TStr ArgNm,
const TStr ArgVal 
) [inline]

Definition at line 142 of file html.h.

References TVec< TVal, TSizeTy >::Add(), ArgNmValV, and TVec< TVal, TSizeTy >::SearchForw().

Referenced by THtmlDoc::_IsTagRedir().

                                                    {
    int ArgN=ArgNmValV.SearchForw(TStrKd(ArgNm));
    if (ArgN==-1){ArgNmValV.Add(TStrKd(ArgNm, ArgVal));}
    else {ArgNmValV[ArgN]=TStrKd(ArgNm, ArgVal);}}

Here is the call graph for this function:

Here is the caller graph for this function:

void THtmlLx::PutCh ( const char &  _Ch) [inline]

Definition at line 126 of file html.h.

References Ch, ChStack, ChX, TChA::Empty(), TChA::Pop(), TChA::Push(), and SymChA.

Referenced by GetEscCh(), GetSym(), and PutStr().

                             {
    ChStack.Push(Ch); if (!SymChA.Empty()){SymChA.Pop();} Ch=_Ch; ChX--;}

Here is the call graph for this function:

Here is the caller graph for this function:

void THtmlLx::PutStr ( const TStr Str) [inline]

Definition at line 128 of file html.h.

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

Referenced by GetEscCh().

                              {
    for (int ChN=Str.Len()-1; ChN>=0; ChN--){PutCh(Str[ChN]);}}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

TChA THtmlLx::ArgNm [private]

Definition at line 93 of file html.h.

Referenced by GetTag().

TChA THtmlLx::ArgVal [private]

Definition at line 94 of file html.h.

Referenced by GetTag().

char THtmlLx::Ch [private]

Definition at line 89 of file html.h.

Referenced by GetAsciiStr(), GetCh(), GetEscapedStr(), GetEscCh(), GetMetaTag(), GetSym(), GetTag(), and PutCh().

THtmlLxChDef THtmlLx::ChDef [static, private]

Definition at line 84 of file html.h.

Referenced by GetEscCh(), GetSym(), and GetTag().

Definition at line 88 of file html.h.

Referenced by GetCh(), and PutCh().

int THtmlLx::ChX [private]

Definition at line 90 of file html.h.

Referenced by GetCh(), GetSym(), and PutCh().

bool THtmlLx::DoParseArg [private]

Definition at line 87 of file html.h.

Referenced by GetTag().

bool THtmlLx::EscCh [private]

Definition at line 91 of file html.h.

Referenced by GetEscCh(), and GetSym().

TChA THtmlLx::EscChA [private]

Definition at line 92 of file html.h.

Referenced by GetEscCh().

Definition at line 113 of file html.h.

Referenced by THtmlDoc::GetRedirHtmlDocStr(), and GetSym().

TSIn& THtmlLx::RSIn [private]

Definition at line 86 of file html.h.

Referenced by GetCh().

PSIn THtmlLx::SIn [private]

Definition at line 85 of file html.h.

Referenced by GetNoTag(), and GetTokStrV().

Definition at line 108 of file html.h.

Referenced by GetSym().

Definition at line 111 of file html.h.

Referenced by GetCh(), THtmlDoc::GetRedirHtmlDocStr(), GetSym(), and PutCh().

Definition at line 108 of file html.h.

Referenced by GetSym().


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