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
|
#include <xml.h>
Public Member Functions | |
TXmlChDef () | |
TXmlChDef (TSIn &SIn) | |
void | Save (TSOut &SOut) |
TXmlChDef & | operator= (const TXmlChDef &) |
bool | IsChar (const uchar &Ch) const |
bool | IsComb (const uchar &Ch) const |
bool | IsExt (const uchar &Ch) const |
bool | IsLetter (const uchar &Ch) const |
bool | IsDigit (const uchar &Ch) const |
bool | IsName (const uchar &Ch) const |
bool | IsPubid (const uchar &Ch) const |
bool | IsWs (const uchar &Ch) const |
bool | IsFirstNameCh (const uchar &Ch) const |
bool | IsEoln (const uchar &Ch) const |
bool | IsEntityNm (const TStr &EntityNm, TStr &EntityVal) const |
Static Public Member Functions | |
static PXmlChDef | Load (TSIn &SIn) |
Private Member Functions | |
void | SetChTy (TBSet &ChSet, const int &MnCh, const int &MxCh=-1) |
void | SetChTy (TBSet &ChSet, const TStr &Str) |
void | SetEntityVal (const TStr &Nm, const TStr &Val) |
Private Attributes | |
TCRef | CRef |
TInt | Chs |
TBSet | CharChSet |
TBSet | CombChSet |
TBSet | ExtChSet |
TBSet | LetterChSet |
TBSet | DigitChSet |
TBSet | NameChSet |
TBSet | PubidChSet |
TStrStrH | EntityNmToValH |
Friends | |
class | TPt< TXmlChDef > |
Definition at line 208 of file xml.cpp.
References CharChSet, Chs, CombChSet, DigitChSet, ExtChSet, TBSet::Gen(), LetterChSet, TUCh::Mx, NameChSet, PubidChSet, SetChTy(), and SetEntityVal().
: Chs(TUCh::Vals), CharChSet(), CombChSet(), ExtChSet(), LetterChSet(), DigitChSet(), NameChSet(), PubidChSet(), EntityNmToValH(100){ // Character-Sets // Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | ... CharChSet.Gen(Chs); // ... because of DMoz (temporary patch) SetChTy(CharChSet, 0x1); SetChTy(CharChSet, 0x3); SetChTy(CharChSet, 0x6); SetChTy(CharChSet, 11); SetChTy(CharChSet, 24); SetChTy(CharChSet, 27); // regular characters SetChTy(CharChSet, 0x9); SetChTy(CharChSet, 0xA); SetChTy(CharChSet, 0xD); SetChTy(CharChSet, 0x20, TUCh::Mx); // BaseChar ::= [#x0041-#x005A] | [#x0061-#x007A] | [#x00C0-#x00D6] | // [#x00D8-#x00F6] | [#x00F8-#x00FF] | ... TBSet BaseChSet(Chs); SetChTy(BaseChSet, 0x41, 0x5A); SetChTy(BaseChSet, 0x61, 0x7A); SetChTy(BaseChSet, 0xC0, 0xD6); SetChTy(BaseChSet, 0xD8, 0xF6); SetChTy(BaseChSet, 0xF8, 0xFF); // Ideographic ::= ... TBSet IdeoChSet(Chs); // CombiningChar ::= ... CombChSet.Gen(Chs); // Extender ::= #x00B7 | ... ExtChSet.Gen(Chs); SetChTy(ExtChSet, 0xB7); // Letter ::= BaseChar | Ideographic LetterChSet=BaseChSet|IdeoChSet; // Digit ::= [#x0030-#x0039] | ... DigitChSet.Gen(Chs); SetChTy(DigitChSet, 0x30, 0x39); // NameChar ::= Letter | Digit | '.' | '-' | '_' | ':' | CombiningChar NameChSet=LetterChSet|DigitChSet| uchar('.')|uchar('-')|uchar('_')|uchar(':')|CombChSet; // PubidChar ::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%] PubidChSet.Gen(Chs); SetChTy(PubidChSet, 0x20); SetChTy(PubidChSet, 0xD); SetChTy(PubidChSet, 0xA); SetChTy(PubidChSet, 'a', 'z'); SetChTy(PubidChSet, 'A', 'Z'); SetChTy(PubidChSet, '0', '9'); SetChTy(PubidChSet, "-'()+,./:=?;!*#@$_%"); // Standard-Entity-Sequences SetEntityVal("amp", "&"); SetEntityVal("lt", "<"); SetEntityVal("gt", ">"); SetEntityVal("apos", "'"); SetEntityVal("quot", "\""); }
TXmlChDef::TXmlChDef | ( | TSIn & | SIn | ) | [inline] |
Definition at line 53 of file xml.h.
: Chs(SIn), CharChSet(SIn), CombChSet(SIn), ExtChSet(SIn), LetterChSet(SIn), DigitChSet(SIn), NameChSet(SIn), PubidChSet(SIn), EntityNmToValH(SIn){}
bool TXmlChDef::IsChar | ( | const uchar & | Ch | ) | const [inline] |
Definition at line 68 of file xml.h.
Referenced by TXmlLx::GetAttList(), TXmlLx::GetAttValue(), TXmlLx::GetCDSect(), TXmlLx::GetComment(), TXmlLx::GetElement(), TXmlLx::GetEntityValue(), TXmlLx::GetNotation(), TXmlLx::GetPI(), TXmlLx::GetSym(), and TXmlLx::GetSystemLiteral().
bool TXmlChDef::IsComb | ( | const uchar & | Ch | ) | const [inline] |
bool TXmlChDef::IsDigit | ( | const uchar & | Ch | ) | const [inline] |
Definition at line 72 of file xml.h.
{return DigitChSet.GetBit(Ch);}
bool TXmlChDef::IsEntityNm | ( | const TStr & | EntityNm, |
TStr & | EntityVal | ||
) | const [inline] |
Definition at line 83 of file xml.h.
Referenced by TXmlLx::GetReference().
{ return EntityNmToValH.IsKeyGetDat(EntityNm, EntityVal);}
bool TXmlChDef::IsEoln | ( | const uchar & | Ch | ) | const [inline] |
bool TXmlChDef::IsExt | ( | const uchar & | Ch | ) | const [inline] |
bool TXmlChDef::IsFirstNameCh | ( | const uchar & | Ch | ) | const [inline] |
Definition at line 78 of file xml.h.
Referenced by TXmlLx::GetName().
{ return IsLetter(Ch)||(Ch=='_')||(Ch==':');}
bool TXmlChDef::IsLetter | ( | const uchar & | Ch | ) | const [inline] |
Definition at line 71 of file xml.h.
{return LetterChSet.GetBit(Ch);}
bool TXmlChDef::IsName | ( | const uchar & | Ch | ) | const [inline] |
Definition at line 73 of file xml.h.
Referenced by TXmlLx::GetName().
bool TXmlChDef::IsPubid | ( | const uchar & | Ch | ) | const [inline] |
Definition at line 74 of file xml.h.
Referenced by TXmlLx::GetPubidLiteral().
{return PubidChSet.GetBit(Ch);}
bool TXmlChDef::IsWs | ( | const uchar & | Ch | ) | const [inline] |
Definition at line 76 of file xml.h.
References TCh::CrCh, TCh::LfCh, and TCh::TabCh.
Referenced by TXmlLx::GetDocTypeDecl(), TXmlLx::GetSym(), TXmlLx::GetWs(), TXmlLx::SkipWs(), and TXmlLx::ToNrSpacing().
{ return (Ch==' ')||(Ch==TCh::CrCh)||(Ch==TCh::LfCh)||(Ch==TCh::TabCh);}
static PXmlChDef TXmlChDef::Load | ( | TSIn & | SIn | ) | [inline, static] |
void TXmlChDef::Save | ( | TSOut & | SOut | ) | [inline] |
Definition at line 59 of file xml.h.
{ Chs.Save(SOut); CharChSet.Save(SOut); CombChSet.Save(SOut); ExtChSet.Save(SOut); LetterChSet.Save(SOut); DigitChSet.Save(SOut); NameChSet.Save(SOut); PubidChSet.Save(SOut); EntityNmToValH.Save(SOut);}
void TXmlChDef::SetChTy | ( | TBSet & | ChSet, |
const int & | MnCh, | ||
const int & | MxCh = -1 |
||
) | [private] |
Definition at line 190 of file xml.cpp.
References Chs, IAssert, and TBSet::Incl().
Referenced by TXmlChDef().
{ IAssert((0<=MnCh)&&((MxCh==-1)||((MnCh<=MxCh)&&(MxCh<Chs)))); ChSet.Incl(MnCh); for (int Ch=MnCh+1; Ch<=MxCh; Ch++){ ChSet.Incl(Ch);} }
void TXmlChDef::SetChTy | ( | TBSet & | ChSet, |
const TStr & | Str | ||
) | [private] |
Definition at line 197 of file xml.cpp.
References TBSet::Incl(), and TStr::Len().
void TXmlChDef::SetEntityVal | ( | const TStr & | Nm, |
const TStr & | Val | ||
) | [private] |
Definition at line 204 of file xml.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), and EntityNmToValH.
Referenced by TXmlChDef().
{ EntityNmToValH.AddDat(Nm, Val); }
TBSet TXmlChDef::CharChSet [private] |
Definition at line 45 of file xml.h.
Referenced by TXmlChDef().
TInt TXmlChDef::Chs [private] |
Definition at line 44 of file xml.h.
Referenced by SetChTy(), and TXmlChDef().
TBSet TXmlChDef::CombChSet [private] |
Definition at line 45 of file xml.h.
Referenced by TXmlChDef().
TCRef TXmlChDef::CRef [private] |
TBSet TXmlChDef::DigitChSet [private] |
Definition at line 46 of file xml.h.
Referenced by TXmlChDef().
TStrStrH TXmlChDef::EntityNmToValH [private] |
Definition at line 47 of file xml.h.
Referenced by SetEntityVal().
TBSet TXmlChDef::ExtChSet [private] |
Definition at line 45 of file xml.h.
Referenced by TXmlChDef().
TBSet TXmlChDef::LetterChSet [private] |
Definition at line 46 of file xml.h.
Referenced by TXmlChDef().
TBSet TXmlChDef::NameChSet [private] |
Definition at line 46 of file xml.h.
Referenced by TXmlChDef().
TBSet TXmlChDef::PubidChSet [private] |
Definition at line 46 of file xml.h.
Referenced by TXmlChDef().