SNAP Library 2.3, Developer Reference  2014-06-16 11:58:46
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
TXmlTok Class Reference

#include <xml.h>

Collaboration diagram for TXmlTok:

Public Member Functions

 TXmlTok ()
 
 TXmlTok (const TXmlLxSym &_Sym)
 
 TXmlTok (const TXmlLxSym &_Sym, const TStr &_Str)
 
 TXmlTok (const TXmlLxSym &_Sym, const TStr &_Str, const TStrKdV &_ArgNmValV)
 
 TXmlTok (TSIn &)
 
void Save (TSOut &)
 
TXmlTokoperator= (const TXmlTok &)
 
TXmlLxSym GetSym () const
 
TStr GetSymStr () const
 
void PutStr (const TStr &_Str)
 
TStr GetStr () const
 
bool IsTag () const
 
bool IsTag (const TStr &TagNm) const
 
TStr GetTagNm () const
 
void AddArg (const TStr &ArgNm, const bool &ArgVal)
 
void AddArg (const TStr &ArgNm, const int &ArgVal)
 
void AddArg (const TStr &ArgNm, const uint64 &ArgVal)
 
void AddArg (const TStr &ArgNm, const double &ArgVal)
 
void AddArg (const TStr &ArgNm, const TStr &ArgVal)
 
int GetArgs () const
 
void GetArg (const int &ArgN, TStr &ArgNm, TStr &ArgVal) const
 
bool IsArg (const TStr &ArgNm) const
 
bool IsArg (const TStr &ArgNm, TStr &ArgVal) const
 
void PutArgVal (const TStr &ArgNm, const TStr &ArgVal)
 
TStr GetArgVal (const TStr &ArgNm) const
 
TStr GetArgVal (const TStr &ArgNm, const TStr &DfArgVal) const
 
bool GetBoolArgVal (const TStr &ArgNm, const bool &DfVal=false) const
 
bool GetBoolArgVal (const TStr &ArgNm, const TStr &TrueVal, const bool &DfVal=false) const
 
bool GetBoolArgVal (const TStr &ArgNm, const TStr &TrueVal, const TStr &FalseVal, const bool &DfVal=false) const
 
int GetIntArgVal (const TStr &ArgNm, const int &DfVal=0) const
 
double GetFltArgVal (const TStr &ArgNm, const double &DfVal=0) const
 
TStr GetStrArgVal (const TStr &ArgNm, const TStr &DfVal=TStr()) const
 
bool IsSubTag (const TStr &TagNm) const
 
bool IsSubTag (const TStr &TagNm, PXmlTok &Tok) const
 
void AddSubTok (const PXmlTok &Tok)
 
int GetSubToks () const
 
PXmlTok GetSubTok (const int &SubTokN) const
 
void ClrSubTok ()
 
void PutSubTok (const PXmlTok &Tok, const int &SubTokN=-1)
 
bool IsTagTok (const TStr &TagPath, PXmlTok &TagTok) const
 
bool IsTagTok (const TStr &TagPath) const
 
PXmlTok GetTagTok (const TStr &TagPath) const
 
void GetTagTokV (const TStr &TagPath, TXmlTokV &XmlTokV) const
 
void GetTagValV (const TStr &TagNm, const bool &XmlP, TStrV &ValV) const
 
TStr GetTagVal (const TStr &TagNm, const bool &XmlP) const
 
TStr GetTagTokStr (const TStr &TagPath) const
 
TStr GetTagTokStrOrDf (const TStr &TagPath, const TStr &DfVal=TStr()) const
 
void AddTokToChA (const bool &XmlP, TChA &ChA) const
 
TStr GetTokStr (const bool &XmlP=true) const
 

Static Public Member Functions

static PXmlTok New ()
 
static PXmlTok New (const TXmlLxSym &Sym)
 
static PXmlTok New (const TXmlLxSym &Sym, const TStr &Str)
 
static PXmlTok New (const TXmlLxSym &Sym, const TStr &Str, const TStrKdV &ArgNmValV)
 
static PXmlTok New (const TStr &TagNm, const TStrKdV &ArgNmValV)
 
static PXmlTok New (const TStr &TagNm)
 
static PXmlTok New (const TStr &TagNm, const TStr &ValStr)
 
static PXmlTok New (const TStr &TagNm, const PXmlTok &XmlTok1, const PXmlTok &XmlTok2=NULL)
 
static PXmlTok Load (TSIn &)
 
static TStr GetTokVStr (const TXmlTokV &TokV, const bool &XmlP=true)
 
static PXmlTok GetTok (TXmlLx &Lx)
 

Private Attributes

TCRef CRef
 
TXmlLxSym Sym
 
TStr Str
 
TStrKdV ArgNmValV
 
TXmlTokV SubTokV
 

Friends

class TPt< TXmlTok >
 

Detailed Description

Definition at line 198 of file xml.h.

Constructor & Destructor Documentation

TXmlTok::TXmlTok ( )
inline

Definition at line 205 of file xml.h.

205 : Sym(xsyUndef), Str(), ArgNmValV(), SubTokV(){}
TXmlTokV SubTokV
Definition: xml.h:203
Definition: xml.h:90
TXmlLxSym Sym
Definition: xml.h:200
TStr Str
Definition: xml.h:201
TStrKdV ArgNmValV
Definition: xml.h:202
TXmlTok::TXmlTok ( const TXmlLxSym _Sym)
inline

Definition at line 206 of file xml.h.

206  :
207  Sym(_Sym), Str(), ArgNmValV(), SubTokV(){}
TXmlTokV SubTokV
Definition: xml.h:203
TXmlLxSym Sym
Definition: xml.h:200
TStr Str
Definition: xml.h:201
TStrKdV ArgNmValV
Definition: xml.h:202
TXmlTok::TXmlTok ( const TXmlLxSym _Sym,
const TStr _Str 
)
inline

Definition at line 208 of file xml.h.

208  :
209  Sym(_Sym), Str(_Str), ArgNmValV(), SubTokV(){}
TXmlTokV SubTokV
Definition: xml.h:203
TXmlLxSym Sym
Definition: xml.h:200
TStr Str
Definition: xml.h:201
TStrKdV ArgNmValV
Definition: xml.h:202
TXmlTok::TXmlTok ( const TXmlLxSym _Sym,
const TStr _Str,
const TStrKdV _ArgNmValV 
)
inline

Definition at line 210 of file xml.h.

210  :
211  Sym(_Sym), Str(_Str), ArgNmValV(_ArgNmValV){}
TXmlLxSym Sym
Definition: xml.h:200
TStr Str
Definition: xml.h:201
TStrKdV ArgNmValV
Definition: xml.h:202
TXmlTok::TXmlTok ( TSIn )
inline

Definition at line 234 of file xml.h.

References Fail.

234 {Fail;}
#define Fail
Definition: bd.h:238

Member Function Documentation

void TXmlTok::AddArg ( const TStr ArgNm,
const bool &  ArgVal 
)
inline

Definition at line 252 of file xml.h.

References TBool::GetStr().

Referenced by TSecTm::GetXmlTok().

252  {
253  ArgNmValV.Add(TStrKd(ArgNm, TBool::GetStr(ArgVal)));}
TStrKdV ArgNmValV
Definition: xml.h:202
static TStr GetStr(const bool &Val)
Definition: dt.h:918
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:559
TKeyDat< TStr, TStr > TStrKd
Definition: ds.h:395

Here is the call graph for this function:

Here is the caller graph for this function:

void TXmlTok::AddArg ( const TStr ArgNm,
const int &  ArgVal 
)
inline

Definition at line 254 of file xml.h.

References TInt::GetStr().

254  {
255  ArgNmValV.Add(TStrKd(ArgNm, TInt::GetStr(ArgVal)));}
TStr GetStr() const
Definition: dt.h:1104
TStrKdV ArgNmValV
Definition: xml.h:202
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:559
TKeyDat< TStr, TStr > TStrKd
Definition: ds.h:395

Here is the call graph for this function:

void TXmlTok::AddArg ( const TStr ArgNm,
const uint64 ArgVal 
)
inline

Definition at line 256 of file xml.h.

References TUInt64::GetStr().

256  {
257  ArgNmValV.Add(TStrKd(ArgNm, TUInt64::GetStr(ArgVal)));}
TStr GetStr() const
Definition: dt.h:1266
TStrKdV ArgNmValV
Definition: xml.h:202
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:559
TKeyDat< TStr, TStr > TStrKd
Definition: ds.h:395

Here is the call graph for this function:

void TXmlTok::AddArg ( const TStr ArgNm,
const double &  ArgVal 
)
inline

Definition at line 258 of file xml.h.

References TFlt::GetStr().

258  {
259  ArgNmValV.Add(TStrKd(ArgNm, TFlt::GetStr(ArgVal)));}
TStrKdV ArgNmValV
Definition: xml.h:202
TStr GetStr() const
Definition: dt.h:1365
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:559
TKeyDat< TStr, TStr > TStrKd
Definition: ds.h:395

Here is the call graph for this function:

void TXmlTok::AddArg ( const TStr ArgNm,
const TStr ArgVal 
)
inline

Definition at line 260 of file xml.h.

260  {
261  ArgNmValV.Add(TStrKd(ArgNm, ArgVal));}
TStrKdV ArgNmValV
Definition: xml.h:202
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:559
TKeyDat< TStr, TStr > TStrKd
Definition: ds.h:395
void TXmlTok::AddSubTok ( const PXmlTok Tok)
inline

Definition at line 292 of file xml.h.

Referenced by TXmlDoc::LoadTxtElement(), New(), PutSubTok(), and TXmlDoc::PutTagTokStr().

292 {SubTokV.Add(Tok);}
TXmlTokV SubTokV
Definition: xml.h:203
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:559

Here is the caller graph for this function:

void TXmlTok::AddTokToChA ( const bool &  XmlP,
TChA ChA 
) const

Definition at line 1185 of file xml.cpp.

References AddTokToChA(), Fail, GetArg(), GetArgs(), TXmlLx::GetArgValQCh(), GetSubTok(), GetSubToks(), TXmlLx::GetXmlStrFromPlainStr(), Str, Sym, xsyQStr, xsyStr, xsyTag, and xsyWs.

Referenced by AddTokToChA().

1185  {
1186  switch (Sym){
1187  case xsyWs:
1188  ChA+=Str; break;
1189  case xsyStr:
1190  if (XmlP){ChA+=TXmlLx::GetXmlStrFromPlainStr(Str);} else {ChA+=Str;} break;
1191  case xsyQStr:
1192  if (XmlP){ChA+="<![CDATA[";}
1193  ChA+=Str;
1194  if (XmlP){ChA+="]]>";} break;
1195  case xsyTag:
1196  if (XmlP){
1197  ChA+='<'; ChA+=Str;
1198  for (int ArgN=0; ArgN<GetArgs(); ArgN++){
1199  TStr ArgNm; TStr ArgVal; GetArg(ArgN, ArgNm, ArgVal);
1200  if (XmlP){ArgVal=TXmlLx::GetXmlStrFromPlainStr(ArgVal);}
1201  char ArgValQCh=TXmlLx::GetArgValQCh(ArgVal);
1202  ChA+=' '; ChA+=ArgNm; ChA+='=';
1203  ChA+=ArgValQCh; ChA+=ArgVal; ChA+=ArgValQCh;
1204  }
1205  }
1206  if (GetSubToks()==0){
1207  if (XmlP){ChA+="/>";}
1208  } else {
1209  if (XmlP){ChA+=">";}
1210  for (int SubTokN=0; SubTokN<GetSubToks(); SubTokN++){
1211  GetSubTok(SubTokN)->AddTokToChA(XmlP, ChA);}
1212  if (XmlP){ChA+="</"; ChA+=Str; ChA+='>';}
1213  }
1214  break;
1215  default: Fail;
1216  }
1217 }
int GetArgs() const
Definition: xml.h:262
void GetArg(const int &ArgN, TStr &ArgNm, TStr &ArgVal) const
Definition: xml.h:263
Definition: xml.h:93
#define Fail
Definition: bd.h:238
PXmlTok GetSubTok(const int &SubTokN) const
Definition: xml.h:294
void AddTokToChA(const bool &XmlP, TChA &ChA) const
Definition: xml.cpp:1185
Definition: xml.h:93
static char GetArgValQCh(const TStr &ArgVal)
Definition: xml.h:171
TXmlLxSym Sym
Definition: xml.h:200
Definition: xml.h:93
TStr Str
Definition: xml.h:201
Definition: dt.h:412
Definition: xml.h:90
int GetSubToks() const
Definition: xml.h:293
static TStr GetXmlStrFromPlainStr(const TChA &PlainChA)
Definition: xml.cpp:968

Here is the call graph for this function:

Here is the caller graph for this function:

void TXmlTok::ClrSubTok ( )
inline

Definition at line 295 of file xml.h.

Referenced by PutSubTok(), and TXmlDoc::PutTagTokStr().

295 {SubTokV.Clr();}
TXmlTokV SubTokV
Definition: xml.h:203
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
Definition: ds.h:953

Here is the caller graph for this function:

void TXmlTok::GetArg ( const int &  ArgN,
TStr ArgNm,
TStr ArgVal 
) const
inline

Definition at line 263 of file xml.h.

Referenced by AddTokToChA().

263  {
264  ArgNm=ArgNmValV[ArgN].Key; ArgVal=ArgNmValV[ArgN].Dat;}
TStrKdV ArgNmValV
Definition: xml.h:202

Here is the caller graph for this function:

int TXmlTok::GetArgs ( ) const
inline

Definition at line 262 of file xml.h.

Referenced by AddTokToChA().

262 {return ArgNmValV.Len();}
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:535
TStrKdV ArgNmValV
Definition: xml.h:202

Here is the caller graph for this function:

TStr TXmlTok::GetArgVal ( const TStr ArgNm) const
inline

Definition at line 273 of file xml.h.

Referenced by TPreproc::TPreproc().

273  {
274  return ArgNmValV[ArgNmValV.SearchForw(TStrKd(ArgNm))].Dat;}
TStrKdV ArgNmValV
Definition: xml.h:202
TSizeTy SearchForw(const TVal &Val, const TSizeTy &BValN=0) const
Returns the position of an element with value Val.
Definition: ds.h:1440
TKeyDat< TStr, TStr > TStrKd
Definition: ds.h:395

Here is the caller graph for this function:

TStr TXmlTok::GetArgVal ( const TStr ArgNm,
const TStr DfArgVal 
) const
inline

Definition at line 275 of file xml.h.

275  {
276  int ArgN=ArgNmValV.SearchForw(TStrKd(ArgNm));
277  return (ArgN==-1) ? DfArgVal : ArgNmValV[ArgN].Dat;}
TStrKdV ArgNmValV
Definition: xml.h:202
TSizeTy SearchForw(const TVal &Val, const TSizeTy &BValN=0) const
Returns the position of an element with value Val.
Definition: ds.h:1440
TKeyDat< TStr, TStr > TStrKd
Definition: ds.h:395
bool TXmlTok::GetBoolArgVal ( const TStr ArgNm,
const bool &  DfVal = false 
) const

Definition at line 1089 of file xml.cpp.

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

Referenced by TXmlDoc::GetTagTokBoolArgVal().

1089  {
1090  int ArgN=ArgNmValV.SearchForw(TStrKd(ArgNm));
1091  return (ArgN==-1) ? DfVal : (ArgNmValV[ArgN].Dat==TBool::TrueStr);
1092 }
TStrKdV ArgNmValV
Definition: xml.h:202
TSizeTy SearchForw(const TVal &Val, const TSizeTy &BValN=0) const
Returns the position of an element with value Val.
Definition: ds.h:1440
static const TStr TrueStr
Definition: dt.h:891
TKeyDat< TStr, TStr > TStrKd
Definition: ds.h:395

Here is the call graph for this function:

Here is the caller graph for this function:

bool TXmlTok::GetBoolArgVal ( const TStr ArgNm,
const TStr TrueVal,
const bool &  DfVal = false 
) const

Definition at line 1094 of file xml.cpp.

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

1095  {
1096  int ArgN=ArgNmValV.SearchForw(TStrKd(ArgNm));
1097  return (ArgN==-1) ? DfVal : (ArgNmValV[ArgN].Dat==TrueVal);
1098 }
TStrKdV ArgNmValV
Definition: xml.h:202
TSizeTy SearchForw(const TVal &Val, const TSizeTy &BValN=0) const
Returns the position of an element with value Val.
Definition: ds.h:1440
TKeyDat< TStr, TStr > TStrKd
Definition: ds.h:395

Here is the call graph for this function:

bool TXmlTok::GetBoolArgVal ( const TStr ArgNm,
const TStr TrueVal,
const TStr FalseVal,
const bool &  DfVal = false 
) const

Definition at line 1100 of file xml.cpp.

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

1101  {
1102  int ArgN=ArgNmValV.SearchForw(TStrKd(ArgNm));
1103  if (ArgN==-1){return DfVal;}
1104  TStr ArgVal=ArgNmValV[ArgN].Dat;
1105  if (ArgVal==TrueVal){return true;}
1106  IAssert(ArgVal == FalseVal); return false;
1107 }
#define IAssert(Cond)
Definition: bd.h:262
TStrKdV ArgNmValV
Definition: xml.h:202
Definition: dt.h:412
TSizeTy SearchForw(const TVal &Val, const TSizeTy &BValN=0) const
Returns the position of an element with value Val.
Definition: ds.h:1440
TKeyDat< TStr, TStr > TStrKd
Definition: ds.h:395

Here is the call graph for this function:

double TXmlTok::GetFltArgVal ( const TStr ArgNm,
const double &  DfVal = 0 
) const

Definition at line 1119 of file xml.cpp.

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

Referenced by TXmlDoc::GetTagTokFltArgVal().

1119  {
1120  int ArgN=ArgNmValV.SearchForw(TStrKd(ArgNm));
1121  if (ArgN==-1){
1122  return DfVal;
1123  } else {
1124  double Val;
1125  if (ArgNmValV[ArgN].Dat.IsFlt(Val)){return Val;} else {return DfVal;}
1126  }
1127 }
TStrKdV ArgNmValV
Definition: xml.h:202
TSizeTy SearchForw(const TVal &Val, const TSizeTy &BValN=0) const
Returns the position of an element with value Val.
Definition: ds.h:1440
TKeyDat< TStr, TStr > TStrKd
Definition: ds.h:395

Here is the call graph for this function:

Here is the caller graph for this function:

int TXmlTok::GetIntArgVal ( const TStr ArgNm,
const int &  DfVal = 0 
) const

Definition at line 1109 of file xml.cpp.

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

Referenced by TXmlDoc::GetTagTokIntArgVal(), and TSecTm::TSecTm().

1109  {
1110  int ArgN=ArgNmValV.SearchForw(TStrKd(ArgNm));
1111  if (ArgN==-1){
1112  return DfVal;
1113  } else {
1114  int Val;
1115  if (ArgNmValV[ArgN].Dat.IsInt(Val)){return Val;} else {return DfVal;}
1116  }
1117 }
TStrKdV ArgNmValV
Definition: xml.h:202
TSizeTy SearchForw(const TVal &Val, const TSizeTy &BValN=0) const
Returns the position of an element with value Val.
Definition: ds.h:1440
TKeyDat< TStr, TStr > TStrKd
Definition: ds.h:395

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TXmlTok::GetStr ( ) const
inline

Definition at line 244 of file xml.h.

Referenced by TXmlObjSer::AssertXmlHd(), GetTagTok(), TXmlDoc::GetTagTok(), GetTagTokV(), TXmlDoc::GetTagTokV(), and TXmlDoc::LoadTxtElement().

244 {return Str;}
TStr Str
Definition: xml.h:201

Here is the caller graph for this function:

TStr TXmlTok::GetStrArgVal ( const TStr ArgNm,
const TStr DfVal = TStr() 
) const

Definition at line 1129 of file xml.cpp.

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

Referenced by TXmlObjSer::AssertXmlHd(), and TXmlDoc::GetTagTokStrArgVal().

1129  {
1130  int ArgN=ArgNmValV.SearchForw(TStrKd(ArgNm));
1131  return (ArgN==-1) ? DfVal : ArgNmValV[ArgN].Dat;
1132 }
TStrKdV ArgNmValV
Definition: xml.h:202
TSizeTy SearchForw(const TVal &Val, const TSizeTy &BValN=0) const
Returns the position of an element with value Val.
Definition: ds.h:1440
TKeyDat< TStr, TStr > TStrKd
Definition: ds.h:395

Here is the call graph for this function:

Here is the caller graph for this function:

PXmlTok TXmlTok::GetSubTok ( const int &  SubTokN) const
inline

Definition at line 294 of file xml.h.

Referenced by AddTokToChA(), GetTagTokV(), TXmlDoc::GetTagTokV(), and GetTagValV().

294 {return SubTokV[SubTokN];}
TXmlTokV SubTokV
Definition: xml.h:203

Here is the caller graph for this function:

int TXmlTok::GetSubToks ( ) const
inline

Definition at line 293 of file xml.h.

Referenced by AddTokToChA(), GetTagTokV(), TXmlDoc::GetTagTokV(), and GetTagValV().

293 {return SubTokV.Len();}
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:535
TXmlTokV SubTokV
Definition: xml.h:203

Here is the caller graph for this function:

TXmlLxSym TXmlTok::GetSym ( ) const
inline

Definition at line 241 of file xml.h.

Referenced by GetTagTok(), TXmlDoc::GetTagTok(), GetTagTokV(), and TXmlDoc::GetTagTokV().

241 {return Sym;}
TXmlLxSym Sym
Definition: xml.h:200

Here is the caller graph for this function:

TStr TXmlTok::GetSymStr ( ) const
inline

Definition at line 242 of file xml.h.

References TXmlLx::GetXmlLxSymStr().

Referenced by TXmlObjSer::AssertXmlHd().

242 {return TXmlLx::GetXmlLxSymStr(Sym);}
static TStr GetXmlLxSymStr(const TXmlLxSym &XmlLxSym)
Definition: xml.cpp:904
TXmlLxSym Sym
Definition: xml.h:200

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TXmlTok::GetTagNm ( ) const
inline

Definition at line 249 of file xml.h.

References IAssert, and xsyTag.

249 {IAssert(Sym==xsyTag); return Str;}
#define IAssert(Cond)
Definition: bd.h:262
Definition: xml.h:93
TXmlLxSym Sym
Definition: xml.h:200
TStr Str
Definition: xml.h:201
PXmlTok TXmlTok::GetTagTok ( const TStr TagPath) const

Definition at line 1142 of file xml.cpp.

References TStr::Empty(), TPt< TRec >::Empty(), GetStr(), GetSym(), GetTagTok(), TVec< TVal, TSizeTy >::Len(), TStr::SplitOnCh(), SubTokV, and xsyTag.

Referenced by GetTagTok(), TXmlDoc::GetTagTok(), GetTagTokV(), and TExpHelp::LoadXml().

1142  {
1143  if (TagPath.Empty()){
1144  return (TXmlTok*)this;
1145  } else {
1146  TStr TagNm; TStr RestTagPath; TagPath.SplitOnCh(TagNm, '|', RestTagPath);
1147  PXmlTok SubTok;
1148  for (int SubTokN=0; SubTokN<SubTokV.Len(); SubTokN++){
1149  SubTok=SubTokV[SubTokN];
1150  if ((SubTok->GetSym()==xsyTag)&&(SubTok->GetStr()==TagNm)){break;}
1151  else {SubTok=NULL;}
1152  }
1153  if ((SubTok.Empty())||(RestTagPath.Empty())){return SubTok;}
1154  else {return SubTok->GetTagTok(RestTagPath);}
1155  }
1156 }
Definition: xml.h:93
bool Empty() const
Definition: bd.h:501
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:535
TXmlTokV SubTokV
Definition: xml.h:203
void SplitOnCh(TStr &LStr, const char &SplitCh, TStr &RStr) const
Definition: dt.cpp:901
Definition: xml.h:198
Definition: dt.h:412
bool Empty() const
Definition: dt.h:488
Definition: bd.h:196

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TXmlTok::GetTagTokStr ( const TStr TagPath) const
inline

Definition at line 307 of file xml.h.

307  {
308  return GetTagTok(TagPath)->GetTokStr(false);}
TStr GetTokStr(const bool &XmlP=true) const
Definition: xml.h:316
PXmlTok GetTagTok(const TStr &TagPath) const
Definition: xml.cpp:1142
TStr TXmlTok::GetTagTokStrOrDf ( const TStr TagPath,
const TStr DfVal = TStr() 
) const
inline

Definition at line 309 of file xml.h.

References GetTokStr().

309  {
310  PXmlTok TagTok;
311  if (IsTagTok(TagPath, TagTok)){return TagTok->GetTokStr(false);}
312  else {return DfVal;}}
bool IsTagTok(const TStr &TagPath, PXmlTok &TagTok) const
Definition: xml.h:299
Definition: bd.h:196

Here is the call graph for this function:

void TXmlTok::GetTagTokV ( const TStr TagPath,
TXmlTokV XmlTokV 
) const

Definition at line 1158 of file xml.cpp.

References TVec< TVal, TSizeTy >::Add(), TVec< TVal, TSizeTy >::Clr(), TPt< TRec >::Empty(), GetStr(), GetSubTok(), GetSubToks(), GetSym(), GetTagTok(), TStr::SplitOnLastCh(), and xsyTag.

Referenced by TExpHelp::LoadXml(), and TPreproc::TPreproc().

1158  {
1159  XmlTokV.Clr();
1160  TStr PreTagPath; TStr TagNm; TagPath.SplitOnLastCh(PreTagPath, '|', TagNm);
1161  PXmlTok Tok=GetTagTok(PreTagPath);
1162  if (!Tok.Empty()){
1163  for (int SubTokN=0; SubTokN<Tok->GetSubToks(); SubTokN++){
1164  PXmlTok SubTok=Tok->GetSubTok(SubTokN);
1165  if ((SubTok->GetSym()==xsyTag)&&(SubTok->GetStr()==TagNm)){
1166  XmlTokV.Add(SubTok);}
1167  }
1168  }
1169 }
Definition: xml.h:93
bool Empty() const
Definition: bd.h:501
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
Definition: ds.h:953
PXmlTok GetTagTok(const TStr &TagPath) const
Definition: xml.cpp:1142
Definition: dt.h:412
Definition: bd.h:196
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:559
void SplitOnLastCh(TStr &LStr, const char &SplitCh, TStr &RStr) const
Definition: dt.cpp:912

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TXmlTok::GetTagVal ( const TStr TagNm,
const bool &  XmlP 
) const

Definition at line 1180 of file xml.cpp.

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

1180  {
1181  TStrV ValV; GetTagValV(TagNm, XmlP, ValV);
1182  if (ValV.Len()>0){return ValV[0];} else {return "";}
1183 }
void GetTagValV(const TStr &TagNm, const bool &XmlP, TStrV &ValV) const
Definition: xml.cpp:1171
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:535
Vector is a sequence TVal objects representing an array that can change in size.
Definition: ds.h:420

Here is the call graph for this function:

void TXmlTok::GetTagValV ( const TStr TagNm,
const bool &  XmlP,
TStrV ValV 
) const

Definition at line 1171 of file xml.cpp.

References TVec< TVal, TSizeTy >::Add(), GetSubTok(), GetSubToks(), GetTagValV(), GetTokStr(), Str, Sym, and xsyTag.

Referenced by GetTagVal(), and GetTagValV().

1171  {
1172  if ((Sym==xsyTag)&&(Str==TagNm)){
1173  ValV.Add(GetTokStr(XmlP));
1174  } else {
1175  for (int SubTokN=0; SubTokN<GetSubToks(); SubTokN++){
1176  GetSubTok(SubTokN)->GetTagValV(TagNm, XmlP, ValV);}
1177  }
1178 }
void GetTagValV(const TStr &TagNm, const bool &XmlP, TStrV &ValV) const
Definition: xml.cpp:1171
Definition: xml.h:93
PXmlTok GetSubTok(const int &SubTokN) const
Definition: xml.h:294
TStr GetTokStr(const bool &XmlP=true) const
Definition: xml.h:316
TXmlLxSym Sym
Definition: xml.h:200
TStr Str
Definition: xml.h:201
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:559
int GetSubToks() const
Definition: xml.h:293

Here is the call graph for this function:

Here is the caller graph for this function:

PXmlTok TXmlTok::GetTok ( TXmlLx Lx)
static

Definition at line 1228 of file xml.cpp.

References TXmlLx::ArgNmValKdV, Fail, New(), TXmlLx::Sym, TXmlLx::TagNm, TXmlLx::TxtChA, xsyQStr, xsySETag, xsySTag, xsyStr, xsyTag, and xsyWs.

Referenced by TXmlDoc::LoadTxtElement().

1228  {
1229  switch (Lx.Sym){
1230  case xsyWs:
1231  case xsyStr:
1232  case xsyQStr:
1233  return TXmlTok::New(Lx.Sym, Lx.TxtChA);
1234  case xsySTag:
1235  case xsySETag:
1236  return TXmlTok::New(xsyTag, Lx.TagNm, Lx.ArgNmValKdV);
1237  default: Fail; return NULL;
1238  }
1239 }
TStr TagNm
Definition: xml.h:141
TChA TxtChA
Definition: xml.h:140
Definition: xml.h:93
Definition: xml.h:93
#define Fail
Definition: bd.h:238
static PXmlTok New()
Definition: xml.h:212
Definition: xml.h:93
TStrKdV ArgNmValKdV
Definition: xml.h:142
Definition: xml.h:93
Definition: xml.h:93
Definition: xml.h:90
TXmlLxSym Sym
Definition: xml.h:139

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TXmlTok::GetTokStr ( const bool &  XmlP = true) const
inline

Definition at line 316 of file xml.h.

Referenced by GetTagTokStrOrDf(), GetTagValV(), TExpHelp::LoadXml(), TStr::LoadXml(), and TPreproc::TPreproc().

316  {
317  TChA ChA; AddTokToChA(XmlP, ChA); return ChA;}
void AddTokToChA(const bool &XmlP, TChA &ChA) const
Definition: xml.cpp:1185
Definition: dt.h:201

Here is the caller graph for this function:

TStr TXmlTok::GetTokVStr ( const TXmlTokV TokV,
const bool &  XmlP = true 
)
static

Definition at line 1219 of file xml.cpp.

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

1219  {
1220  TChA TokVChA;
1221  for (int TokN=0; TokN<TokV.Len(); TokN++){
1222  if (TokN>0){TokVChA+=' ';}
1223  TokVChA+=TokV[TokN]->GetTokStr(XmlP);
1224  }
1225  return TokVChA;
1226 }
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:535
Definition: dt.h:201

Here is the call graph for this function:

bool TXmlTok::IsArg ( const TStr ArgNm) const
inline

Definition at line 265 of file xml.h.

Referenced by TXmlObjSer::GetBoolArg(), TXmlObjSer::GetFltArg(), TXmlObjSer::GetInt64Arg(), and TXmlObjSer::GetIntArg().

265  {
266  return ArgNmValV.SearchForw(TStrKd(ArgNm))!=-1;}
TStrKdV ArgNmValV
Definition: xml.h:202
TSizeTy SearchForw(const TVal &Val, const TSizeTy &BValN=0) const
Returns the position of an element with value Val.
Definition: ds.h:1440
TKeyDat< TStr, TStr > TStrKd
Definition: ds.h:395

Here is the caller graph for this function:

bool TXmlTok::IsArg ( const TStr ArgNm,
TStr ArgVal 
) const
inline

Definition at line 267 of file xml.h.

267  {
268  int ArgN=ArgNmValV.SearchForw(TStrKd(ArgNm));
269  if (ArgN!=-1){ArgVal=ArgNmValV[ArgN].Dat;}
270  return ArgN!=-1;}
TStrKdV ArgNmValV
Definition: xml.h:202
TSizeTy SearchForw(const TVal &Val, const TSizeTy &BValN=0) const
Returns the position of an element with value Val.
Definition: ds.h:1440
TKeyDat< TStr, TStr > TStrKd
Definition: ds.h:395
bool TXmlTok::IsSubTag ( const TStr TagNm) const
inline

Definition at line 288 of file xml.h.

288  {
289  return !GetTagTok(TagNm).Empty();}
bool Empty() const
Definition: bd.h:501
PXmlTok GetTagTok(const TStr &TagPath) const
Definition: xml.cpp:1142
bool TXmlTok::IsSubTag ( const TStr TagNm,
PXmlTok Tok 
) const
inline

Definition at line 290 of file xml.h.

References TPt< TRec >::Empty().

290  {
291  Tok=GetTagTok(TagNm); return !Tok.Empty();}
bool Empty() const
Definition: bd.h:501
PXmlTok GetTagTok(const TStr &TagPath) const
Definition: xml.cpp:1142

Here is the call graph for this function:

bool TXmlTok::IsTag ( ) const
inline

Definition at line 247 of file xml.h.

References xsyTag.

Referenced by TXmlObjSer::AssertXmlHd().

247 {return (Sym==xsyTag);}
Definition: xml.h:93
TXmlLxSym Sym
Definition: xml.h:200

Here is the caller graph for this function:

bool TXmlTok::IsTag ( const TStr TagNm) const
inline

Definition at line 248 of file xml.h.

References xsyTag.

248 {return (Sym==xsyTag)&&(Str==TagNm);}
Definition: xml.h:93
TXmlLxSym Sym
Definition: xml.h:200
TStr Str
Definition: xml.h:201
bool TXmlTok::IsTagTok ( const TStr TagPath,
PXmlTok TagTok 
) const
inline

Definition at line 299 of file xml.h.

References TPt< TRec >::Empty().

299  {
300  TagTok=GetTagTok(TagPath); return !TagTok.Empty();}
bool Empty() const
Definition: bd.h:501
PXmlTok GetTagTok(const TStr &TagPath) const
Definition: xml.cpp:1142

Here is the call graph for this function:

bool TXmlTok::IsTagTok ( const TStr TagPath) const
inline

Definition at line 301 of file xml.h.

301  {
302  PXmlTok TagTok; return IsTagTok(TagPath, TagTok);}
bool IsTagTok(const TStr &TagPath, PXmlTok &TagTok) const
Definition: xml.h:299
Definition: bd.h:196
static PXmlTok TXmlTok::Load ( TSIn )
inlinestatic

Definition at line 235 of file xml.h.

References Fail.

235 {Fail; return NULL;}
#define Fail
Definition: bd.h:238
static PXmlTok TXmlTok::New ( )
inlinestatic

Definition at line 212 of file xml.h.

Referenced by GetTok(), TSecTm::GetXmlTok(), and TXmlDoc::PutTagTokStr().

212 {return PXmlTok(new TXmlTok());}
TPt< TXmlTok > PXmlTok
Definition: xml.h:198
TXmlTok()
Definition: xml.h:205

Here is the caller graph for this function:

static PXmlTok TXmlTok::New ( const TXmlLxSym Sym)
inlinestatic

Definition at line 213 of file xml.h.

213 {return PXmlTok(new TXmlTok(Sym));}
TPt< TXmlTok > PXmlTok
Definition: xml.h:198
TXmlLxSym Sym
Definition: xml.h:200
TXmlTok()
Definition: xml.h:205
static PXmlTok TXmlTok::New ( const TXmlLxSym Sym,
const TStr Str 
)
inlinestatic

Definition at line 214 of file xml.h.

214  {
215  return PXmlTok(new TXmlTok(Sym, Str));}
TPt< TXmlTok > PXmlTok
Definition: xml.h:198
TXmlLxSym Sym
Definition: xml.h:200
TXmlTok()
Definition: xml.h:205
static PXmlTok TXmlTok::New ( const TXmlLxSym Sym,
const TStr Str,
const TStrKdV ArgNmValV 
)
inlinestatic

Definition at line 216 of file xml.h.

217  {
218  return PXmlTok(new TXmlTok(Sym, Str, ArgNmValV));}
TPt< TXmlTok > PXmlTok
Definition: xml.h:198
TXmlLxSym Sym
Definition: xml.h:200
TXmlTok()
Definition: xml.h:205
static PXmlTok TXmlTok::New ( const TStr TagNm,
const TStrKdV ArgNmValV 
)
inlinestatic

Definition at line 219 of file xml.h.

References xsyTag.

220  {
221  return PXmlTok(new TXmlTok(xsyTag, TagNm, ArgNmValV));}
TPt< TXmlTok > PXmlTok
Definition: xml.h:198
Definition: xml.h:93
TXmlTok()
Definition: xml.h:205
static PXmlTok TXmlTok::New ( const TStr TagNm)
inlinestatic

Definition at line 222 of file xml.h.

References xsyTag.

222  {
223  return PXmlTok(new TXmlTok(xsyTag, TagNm));}
TPt< TXmlTok > PXmlTok
Definition: xml.h:198
Definition: xml.h:93
TXmlTok()
Definition: xml.h:205
static PXmlTok TXmlTok::New ( const TStr TagNm,
const TStr ValStr 
)
inlinestatic

Definition at line 224 of file xml.h.

References AddSubTok(), xsyStr, and xsyTag.

224  {
225  PXmlTok TagXmlTok=PXmlTok(new TXmlTok(xsyTag, TagNm));
226  PXmlTok StrXmlTok=PXmlTok(new TXmlTok(xsyStr, ValStr));
227  TagXmlTok->AddSubTok(StrXmlTok); return TagXmlTok;}
TPt< TXmlTok > PXmlTok
Definition: xml.h:198
Definition: xml.h:93
Definition: xml.h:93
TXmlTok()
Definition: xml.h:205
Definition: bd.h:196

Here is the call graph for this function:

static PXmlTok TXmlTok::New ( const TStr TagNm,
const PXmlTok XmlTok1,
const PXmlTok XmlTok2 = NULL 
)
inlinestatic

Definition at line 228 of file xml.h.

References AddSubTok(), TPt< TRec >::Empty(), and xsyTag.

229  {
230  PXmlTok TagXmlTok=PXmlTok(new TXmlTok(xsyTag, TagNm));
231  if (!XmlTok1.Empty()){TagXmlTok->AddSubTok(XmlTok1);}
232  if (!XmlTok2.Empty()){TagXmlTok->AddSubTok(XmlTok2);}
233  return TagXmlTok;}
TPt< TXmlTok > PXmlTok
Definition: xml.h:198
Definition: xml.h:93
bool Empty() const
Definition: bd.h:501
TXmlTok()
Definition: xml.h:205
Definition: bd.h:196

Here is the call graph for this function:

TXmlTok& TXmlTok::operator= ( const TXmlTok )
inline

Definition at line 238 of file xml.h.

References Fail.

238 {Fail; return *this;}
#define Fail
Definition: bd.h:238
void TXmlTok::PutArgVal ( const TStr ArgNm,
const TStr ArgVal 
)
inline

Definition at line 271 of file xml.h.

271  {
272  ArgNmValV[ArgNmValV.SearchForw(TStrKd(ArgNm))].Dat=ArgVal;}
TStrKdV ArgNmValV
Definition: xml.h:202
TSizeTy SearchForw(const TVal &Val, const TSizeTy &BValN=0) const
Returns the position of an element with value Val.
Definition: ds.h:1440
TKeyDat< TStr, TStr > TStrKd
Definition: ds.h:395
void TXmlTok::PutStr ( const TStr _Str)
inline

Definition at line 243 of file xml.h.

243 {Str=_Str;}
TStr Str
Definition: xml.h:201
void TXmlTok::PutSubTok ( const PXmlTok Tok,
const int &  SubTokN = -1 
)

Definition at line 1134 of file xml.cpp.

References AddSubTok(), ClrSubTok(), and SubTokV.

1134  {
1135  if (SubTokN==-1){
1136  ClrSubTok(); AddSubTok(Tok);
1137  } else {
1138  SubTokV[SubTokN]=Tok;
1139  }
1140 }
TXmlTokV SubTokV
Definition: xml.h:203
void AddSubTok(const PXmlTok &Tok)
Definition: xml.h:292
void ClrSubTok()
Definition: xml.h:295

Here is the call graph for this function:

void TXmlTok::Save ( TSOut )
inline

Definition at line 236 of file xml.h.

References Fail.

236 {Fail;}
#define Fail
Definition: bd.h:238

Friends And Related Function Documentation

friend class TPt< TXmlTok >
friend

Definition at line 198 of file xml.h.

Member Data Documentation

TStrKdV TXmlTok::ArgNmValV
private

Definition at line 202 of file xml.h.

Referenced by GetBoolArgVal(), GetFltArgVal(), GetIntArgVal(), and GetStrArgVal().

TCRef TXmlTok::CRef
private

Definition at line 198 of file xml.h.

TStr TXmlTok::Str
private

Definition at line 201 of file xml.h.

Referenced by AddTokToChA(), and GetTagValV().

TXmlTokV TXmlTok::SubTokV
private

Definition at line 203 of file xml.h.

Referenced by GetTagTok(), and PutSubTok().

TXmlLxSym TXmlTok::Sym
private

Definition at line 200 of file xml.h.

Referenced by AddTokToChA(), and GetTagValV().


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