27 TSOut& _SOut,
const bool& ETagP,
29 const TStr& ArgNm=
"",
const TStr& ArgVal=
"");
31 TSOut& _SOut,
const bool& ETagP,
33 const TStr& ArgNm1,
const TStr& ArgVal1,
34 const TStr& ArgNm2,
const TStr& ArgVal2,
35 const TStr& ArgNm3=
"",
const TStr& ArgVal3=
"",
36 const TStr& ArgNm4=
"",
const TStr& ArgVal4=
"");
45 TBSet CharChSet, CombChSet, ExtChSet;
46 TBSet LetterChSet, DigitChSet, NameChSet, PubidChSet;
48 void SetChTy(
TBSet& ChSet, const
int& MnCh, const
int& MxCh=-1);
49 void SetChTy(
TBSet& ChSet, const
TStr& Str);
50 void SetEntityVal(const
TStr& Nm, const
TStr& Val);
55 CharChSet(SIn), CombChSet(SIn), ExtChSet(SIn),
56 LetterChSet(SIn), DigitChSet(SIn), NameChSet(SIn), PubidChSet(SIn),
61 CharChSet.Save(SOut); CombChSet.Save(SOut); ExtChSet.Save(SOut);
62 LetterChSet.Save(SOut); DigitChSet.Save(SOut); NameChSet.Save(SOut);
63 PubidChSet.Save(SOut);
64 EntityNmToValH.Save(SOut);}
68 bool IsChar(
const uchar& Ch)
const {
return CharChSet.GetBit(Ch);}
69 bool IsComb(
const uchar& Ch)
const {
return CombChSet.GetBit(Ch);}
70 bool IsExt(
const uchar& Ch)
const {
return ExtChSet.GetBit(Ch);}
72 bool IsDigit(
const uchar& Ch)
const {
return DigitChSet.GetBit(Ch);}
73 bool IsName(
const uchar& Ch)
const {
return NameChSet.GetBit(Ch);}
74 bool IsPubid(
const uchar& Ch)
const {
return PubidChSet.GetBit(Ch);}
79 return IsLetter(Ch)||(Ch==
'_')||(Ch==
':');}
84 return EntityNmToValH.IsKeyGetDat(EntityNm, EntityVal);}
110 for (
int ChN=Str.
Len()-1; ChN>=0; ChN--){
PutCh(Str[ChN]);}}
114 void GetWs(
const bool& IsRq);
146 SIn(_SIn), RSIn(*SIn),
147 ChStack(), PrevCh(
' '), Ch(
' '),
148 LnN(1), LnChN(0), ChN(0), Spacing(_Spacing),
149 EntityNmToValH(100), PEntityNmToValH(100),
167 ArgNm=ArgNmValKdV[ArgN].Key; ArgVal=ArgNmValKdV[ArgN].Dat;}
170 if (ArgN==-1){
return DfVal;}
else {
return ArgNmValKdV[ArgN].Dat;}}
172 if (ArgVal.
IsChIn(
'\"')){
return '\'';}
else {
return '\"';}}
176 return EntityNmToValH.
IsKeyGetDat(EntityNm, EntityVal);}
178 EntityNmToValH.
AddDat(Nm, Val);}
180 return PEntityNmToValH.
IsKeyGetDat(EntityNm, EntityVal);}
182 PEntityNmToValH.
AddDat(Nm, Val);}
207 Sym(_Sym), Str(), ArgNmValV(), SubTokV(){}
209 Sym(_Sym), Str(_Str), ArgNmValV(), SubTokV(){}
211 Sym(_Sym), Str(_Str), ArgNmValV(_ArgNmValV){}
227 TagXmlTok->
AddSubTok(StrXmlTok);
return TagXmlTok;}
232 if (!XmlTok2.Empty()){TagXmlTok->
AddSubTok(XmlTok2);}
261 ArgNmValV.Add(
TStrKd(ArgNm, ArgVal));}
264 ArgNm=ArgNmValV[ArgN].Key; ArgVal=ArgNmValV[ArgN].Dat;}
266 return ArgNmValV.SearchForw(
TStrKd(ArgNm))!=-1;}
268 int ArgN=ArgNmValV.SearchForw(
TStrKd(ArgNm));
269 if (ArgN!=-1){ArgVal=ArgNmValV[ArgN].Dat;}
272 ArgNmValV[ArgNmValV.SearchForw(
TStrKd(ArgNm))].Dat=ArgVal;}
274 return ArgNmValV[ArgNmValV.SearchForw(
TStrKd(ArgNm))].Dat;}
276 int ArgN=ArgNmValV.SearchForw(
TStrKd(ArgNm));
277 return (ArgN==-1) ? DfArgVal : ArgNmValV[ArgN].Dat;}
278 bool GetBoolArgVal(
const TStr& ArgNm,
const bool& DfVal=
false)
const;
280 const TStr& ArgNm,
const TStr& TrueVal,
const bool& DfVal=
false)
const;
281 bool GetBoolArgVal(
const TStr& ArgNm,
282 const TStr& TrueVal,
const TStr& FalseVal,
const bool& DfVal=
false)
const;
283 int GetIntArgVal(
const TStr& ArgNm,
const int& DfVal=0)
const;
284 double GetFltArgVal(
const TStr& ArgNm,
const double& DfVal=0)
const;
289 return !GetTagTok(TagNm).Empty();}
291 Tok=GetTagTok(TagNm);
return !Tok.
Empty();}
296 void PutSubTok(
const PXmlTok& Tok,
const int& SubTokN=-1);
300 TagTok=GetTagTok(TagPath);
return !TagTok.
Empty();}
302 PXmlTok TagTok;
return IsTagTok(TagPath, TagTok);}
304 void GetTagTokV(
const TStr& TagPath,
TXmlTokV& XmlTokV)
const;
305 void GetTagValV(
const TStr& TagNm,
const bool& XmlP,
TStrV& ValV)
const;
306 TStr GetTagVal(
const TStr& TagNm,
const bool& XmlP)
const;
308 return GetTagTok(TagPath)->GetTokStr(
false);}
311 if (IsTagTok(TagPath, TagTok)){
return TagTok->
GetTokStr(
false);}
312 else {
return DfVal;}}
315 void AddTokToChA(
const bool& XmlP,
TChA& ChA)
const;
317 TChA ChA; AddTokToChA(XmlP, ChA);
return ChA;}
318 static TStr GetTokVStr(
const TXmlTokV& TokV,
const bool& XmlP=
true);
331 static
void LoadTxtMiscStar(
TXmlLx& Lx);
351 IAssert(Ok); TagTok=GetTagTok(TagPath);
return !TagTok.
Empty();}
353 PXmlTok TagTok;
return IsTagTok(TagPath, TagTok);}
355 void PutTagTokStr(
const TStr& TagPath,
const TStr& TokStr)
const;
357 return GetTagTok(TagPath)->GetTokStr(
false);}
358 void GetTagTokV(
const TStr& TagPath,
TXmlTokV& XmlTokV)
const;
360 IAssert(Ok); Tok->GetTagValV(TagNm, XmlP, ValV);}
362 TStrV ValV; GetTagValV(TagNm, XmlP, ValV);
363 if (ValV.
Len()>0){
return ValV[0];}
else {
return "";}}
364 bool GetTagTokBoolArgVal(
365 const TStr& TagPath,
const TStr& ArgNm,
const bool& DfVal=
false)
const;
366 int GetTagTokIntArgVal(
367 const TStr& TagPath,
const TStr& ArgNm,
const int& DfVal=0)
const;
368 double GetTagTokFltArgVal(
369 const TStr& TagPath,
const TStr& ArgNm,
const double& DfVal=0)
const;
370 TStr GetTagTokStrArgVal(
374 static TStr GetXmlStr(
const TStr& Str);
377 static bool SkipTopTag(
const PSIn& SIn);
384 SOut->
PutStr(GetTok()->GetTokStr());}
388 void SaveStr(
TStr& Str);
void AddArg(const TStr &ArgNm, const int &ArgVal)
void SaveTxt(const PSOut &SOut)
void SkipTillTag(const TChA &_SymStr)
bool IsChar(const uchar &Ch) const
void GetArg(const int &ArgN, TStr &ArgNm, TStr &ArgVal) const
static PSOut New(const TStr &FNm, const bool &Append=false)
void GetArg(const int &ArgN, TStr &ArgNm, TStr &ArgVal) const
static PXmlTok New(const TStr &TagNm, const PXmlTok &XmlTok1, const PXmlTok &XmlTok2=NULL)
bool IsPEntityNm(const TStr &EntityNm, TStr &EntityVal) const
static TStr GetChRefFromYuEntRef(const TStr &YuEntRefStr)
static TStr GetXmlLxSymStr(const TXmlLxSym &XmlLxSym)
TXmlTok(const TXmlLxSym &_Sym)
TXmlDoc & operator=(const TXmlDoc &)
static TStr GetUsAsciiStrFromXmlStr(const TStr &EntRefStr)
void AddArg(const TStr &ArgNm, const TStr &ArgVal)
bool IsIn(const TVal &Val) const
Checks whether element Val is a member of the vector.
TStr GetArgVal(const TStr &ArgNm, const TStr &DfVal=TStr()) const
TStr GetTagTokStr(const TStr &TagPath) const
void PutStr(const TStr &_Str)
void AddArg(const TStr &ArgNm, const uint64 &ArgVal)
static PXmlParser New(const PSIn &SIn)
static TStr GetTagNm(const TStr &TypeNm)
void PutArgVal(const TStr &ArgNm, const TStr &ArgVal)
bool IsComb(const uchar &Ch) const
void AddArg(const TStr &ArgNm, const TStr &ArgVal)
void GetWs(const bool &IsRq)
TSizeTy Len() const
Returns the number of elements in the vector.
TXmlTok(const TXmlLxSym &_Sym, const TStr &_Str)
bool IsTagTok(const TStr &TagPath) const
static TStr GetPlainStrFromXmlStr(const TStr &XmlStr)
bool IsDigit(const uchar &Ch) const
static TStr GetXmlStrFromPlainMem(const TMem &PlainMem)
TXmlChDef & operator=(const TXmlChDef &)
static PXmlTok New(const TStr &TagNm)
bool IsEntityNm(const TStr &EntityNm, TStr &EntityVal) const
bool IsFirstNameCh(const uchar &Ch) const
PXmlTok GetSubTok(const int &SubTokN) const
static int64 GetInt64Arg(const PXmlTok &XmlTok, const TStr &Nm)
static PXmlTok Load(TSIn &)
bool IsArg(const TStr &ArgNm, TStr &ArgVal) const
static PXmlTok New(const TXmlLxSym &Sym)
void EThrow(const TStr &MsgStr) const
static PXmlTok New(const TStr &TagNm, const TStrKdV &ArgNmValV)
bool IsTagTok(const TStr &TagPath, PXmlTok &TagTok) const
TStr GetTokStr(const bool &XmlP=true) const
void PutEntityVal(const TStr &Nm, const TStr &Val)
#define ClassTP(TNm, PNm)
static bool GetBoolArg(const PXmlTok &XmlTok, const TStr &Nm)
#define ClassTPV(TNm, PNm, TNmV)
TStr GetArgVal(const TStr &ArgNm) const
bool IsPubid(const uchar &Ch) const
bool IsTagTok(const TStr &TagPath, PXmlTok &TagTok) const
static PXmlTok New(const TStr &TagNm, const TStr &ValStr)
TXmlLx(const PSIn &_SIn, const TXmlSpacing &_Spacing=xspIntact)
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
TXmlLxSym GetTag(const TChA &TagStr)
bool IsTag(const TStr &TagNm) const
void AddSubTok(const PXmlTok &Tok)
unsigned long long uint64
bool IsKeyGetDat(const TKey &Key, TDat &Dat) const
TXmlObjSerTagNm(TSOut &_SOut, const bool &ETagP, const TStr &Nm, const TStr &TypeNm, const TStr &ArgNm="", const TStr &ArgVal="")
static double GetFltArg(const PXmlTok &XmlTok, const TStr &Nm)
void AddArg(const TStr &ArgNm, const bool &ArgVal)
void PutPEntityVal(const TStr &Nm, const TStr &Val)
void SaveTxt(const TStr &FNm, const bool &Append=false)
static PXmlDoc Load(TSIn &SIn)
static char GetArgValQCh(const TStr &ArgVal)
void PutStr(const TStr &Str)
bool IsArg(const TStr &ArgNm) const
TXmlLx & operator=(const TXmlLx &)
void GetTagValV(const TStr &TagNm, const bool &XmlP, TStrV &ValV) const
bool IsArgNm(const TStr &ArgNm) const
TXmlParser(const PSIn &_SIn)
static PXmlTok New(const TXmlLxSym &Sym, const TStr &Str, const TStrKdV &ArgNmValV)
TStr GetTagTokStr(const TStr &TagPath) const
static int GetIntArg(const PXmlTok &XmlTok, const TStr &Nm)
bool IsName(const uchar &Ch) const
void AddArg(const TStr &ArgNm, const double &ArgVal)
TXmlDoc(const PXmlTok &_Tok)
bool IsTagTok(const TStr &TagPath) const
void PutCh(const uchar &_Ch)
bool IsSubTag(const TStr &TagNm, PXmlTok &Tok) const
static bool IsTagNm(const TStr &Str)
bool IsLetter(const uchar &Ch) const
bool IsChIn(const char &Ch) const
int PutStr(const char *CStr)
TSizeTy SearchForw(const TVal &Val, const TSizeTy &BValN=0) const
Returns the position of an element with value Val.
TStr GetTagTokStrOrDf(const TStr &TagPath, const TStr &DfVal=TStr()) const
static void GetPlainStrFromXmlStr(const TChA &XmlStr, TChA &PlainChA)
static TStr GetStr(const bool &Val)
void Push(const char &Ch)
TStr GetTagVal(const TStr &TagNm, const bool &XmlP) const
UndefDefaultCopyAssign(TXmlObjSerTagNm)
bool IsExt(const uchar &Ch) const
bool IsSubTag(const TStr &TagNm) const
bool IsEntityNm(const TStr &EntityNm, TStr &EntityVal) const
static PXmlChDef Load(TSIn &SIn)
static PXmlDoc New(const PXmlTok &Tok)
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
static void AssertXmlHd(const PXmlTok &XmlTok, const TStr &Nm, const TStr &TypeNm)
bool IsWs(const uchar &Ch) const
bool IsEoln(const uchar &Ch) const
TXmlTok & operator=(const TXmlTok &)
TDat & AddDat(const TKey &Key)
TPt< TXmlParser > PXmlParser
static PXmlTok New(const TXmlLxSym &Sym, const TStr &Str)
static TStrStrH TypeNmToTagNmH
TKeyDat< TStr, TStr > TStrKd
void GetTagVal(const TChA &TagStr, TChA &TagVal)
TXmlTok(const TXmlLxSym &_Sym, const TStr &_Str, const TStrKdV &_ArgNmValV)
TStr GetArgVal(const TStr &ArgNm, const TStr &DfArgVal) const
static TStr GetXmlStrFromPlainStr(const TChA &PlainChA)