SNAP Library 2.1, User Reference
2013-09-25 10:47:25
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.
: 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] |
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.
{ 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] |
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] |
bool TXmlChDef::IsPubid | ( | const uchar & | Ch | ) | const [inline] |
Definition at line 74 of file xml.h.
{return PubidChSet.GetBit(Ch);}
bool TXmlChDef::IsWs | ( | const uchar & | Ch | ) | const [inline] |
Definition at line 76 of file xml.h.
{ 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] |
void TXmlChDef::SetChTy | ( | TBSet & | ChSet, |
const TStr & | Str | ||
) | [private] |
void TXmlChDef::SetEntityVal | ( | const TStr & | Nm, |
const TStr & | Val | ||
) | [private] |
Definition at line 204 of file xml.cpp.
{ EntityNmToValH.AddDat(Nm, Val); }
TBSet TXmlChDef::CharChSet [private] |
TInt TXmlChDef::Chs [private] |
TBSet TXmlChDef::CombChSet [private] |
TCRef TXmlChDef::CRef [private] |
TBSet TXmlChDef::DigitChSet [private] |
TStrStrH TXmlChDef::EntityNmToValH [private] |
TBSet TXmlChDef::ExtChSet [private] |
TBSet TXmlChDef::LetterChSet [private] |
TBSet TXmlChDef::NameChSet [private] |
TBSet TXmlChDef::PubidChSet [private] |