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 <lx.h>
Public Member Functions | |
TLxChDef (const TLxChDefTy &ChDefTy) | |
TLxChDef (TSIn &SIn) | |
void | Save (TSOut &SOut) |
TLxChDef & | operator= (const TLxChDef &ChDef) |
int | GetChTy (const char &Ch) const |
bool | IsTerm (const char &Ch) const |
bool | IsSpace (const char &Ch) const |
bool | IsAlpha (const char &Ch) const |
bool | IsNum (const char &Ch) const |
bool | IsAlNum (const char &Ch) const |
char | GetUc (const char &Ch) const |
bool | IsNmStr (const TStr &Str) const |
TStr | GetUcStr (const TStr &Str) const |
Static Public Member Functions | |
static PLxChDef | New (const TLxChDefTy &ChDefTy=lcdtUsAscii) |
static PLxChDef | Load (TSIn &SIn) |
static PLxChDef | GetChDef (const TLxChDefTy &ChDefTy=lcdtUsAscii) |
Private Member Functions | |
void | SetUcCh (const TStr &Str) |
void | SetChTy (const TLxChTy &ChTy, const TStr &Str) |
Private Attributes | |
TCRef | CRef |
TIntV | ChTyV |
TChV | UcChV |
Friends | |
class | TPt< TLxChDef > |
TLxChDef::TLxChDef | ( | const TLxChDefTy & | ChDefTy | ) |
Definition at line 13 of file lx.cpp.
: ChTyV(TCh::Vals), UcChV(TCh::Vals){ if (ChDefTy==lcdtUsAscii){ // Character-Types ChTyV.PutAll(TInt(lctSpace)); SetChTy(lctNum, "0123456789"); SetChTy(lctAlpha, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); SetChTy(lctAlpha, "abcdefghijklmnopqrstuvwxyz"); SetChTy(lctAlpha, "@_"); SetChTy(lctSSym, "\"'.,:;+-*/%!#|&<=>?()[]{}"); SetChTy(lctTerm, TStr(TCh::CrCh)); SetChTy(lctTerm, TStr(TCh::LfCh)); SetChTy(lctTerm, TStr(TCh::EofCh)); // Upper-Case for (int Ch=TCh::Mn; Ch<=TCh::Mx; Ch++){UcChV[Ch-TCh::Mn]=TCh(char(Ch));} SetUcCh("Aa"); SetUcCh("Bb"); SetUcCh("Cc"); SetUcCh("Dd"); SetUcCh("Ee"); SetUcCh("Ff"); SetUcCh("Gg"); SetUcCh("Hh"); SetUcCh("Ii"); SetUcCh("Jj"); SetUcCh("Kk"); SetUcCh("Ll"); SetUcCh("Mm"); SetUcCh("Nn"); SetUcCh("Oo"); SetUcCh("Pp"); SetUcCh("Qq"); SetUcCh("Rr"); SetUcCh("Ss"); SetUcCh("Tt"); SetUcCh("Uu"); SetUcCh("Vv"); SetUcCh("Ww"); SetUcCh("Xx"); SetUcCh("Yy"); SetUcCh("Zz"); } else if (ChDefTy==lcdtYuAscii){ // Character-Types ChTyV.PutAll(TInt(lctSpace)); SetChTy(lctNum, "0123456789"); SetChTy(lctAlpha, "ABC^]D\\EFGHIJKLMNOPQRS[TUVWXYZ@"); SetChTy(lctAlpha, "abc~}d|efghijklmnopqrs{tuvwxyz`"); SetChTy(lctAlpha, "_"); SetChTy(lctSSym, "\".,:;+-*/%!#&<=>?()"); SetChTy(lctTerm, TStr(TCh::CrCh)); SetChTy(lctTerm, TStr(TCh::LfCh)); SetChTy(lctTerm, TStr(TCh::EofCh)); // Upper-Case for (int Ch=TCh::Mn; Ch<=TCh::Mx; Ch++){UcChV[Ch-TCh::Mn]=TCh(char(Ch));} SetUcCh("Aa"); SetUcCh("Bb"); SetUcCh("Cc"); SetUcCh("^~"); SetUcCh("]}"); SetUcCh("Dd"); SetUcCh("\\|"); SetUcCh("Ee"); SetUcCh("Ff"); SetUcCh("Gg"); SetUcCh("Hh"); SetUcCh("Ii"); SetUcCh("Jj"); SetUcCh("Kk"); SetUcCh("Ll"); SetUcCh("Mm"); SetUcCh("Nn"); SetUcCh("Oo"); SetUcCh("Pp"); SetUcCh("Qq"); SetUcCh("Rr"); SetUcCh("Ss"); SetUcCh("[{"); SetUcCh("Tt"); SetUcCh("Uu"); SetUcCh("Vv"); SetUcCh("Ww"); SetUcCh("Xx"); SetUcCh("Yy"); SetUcCh("Zz"); SetUcCh("@`"); } else { Fail; } }
TLxChDef::TLxChDef | ( | TSIn & | SIn | ) | [inline] |
PLxChDef TLxChDef::GetChDef | ( | const TLxChDefTy & | ChDefTy = lcdtUsAscii | ) | [static] |
Definition at line 79 of file lx.cpp.
{ static PLxChDef UsAsciiChDef=NULL; static PLxChDef YuAsciiChDef=NULL; switch (ChDefTy){ case lcdtUsAscii: if (UsAsciiChDef.Empty()){UsAsciiChDef=TLxChDef::New(lcdtUsAscii);} return UsAsciiChDef; case lcdtYuAscii: if (YuAsciiChDef.Empty()){YuAsciiChDef=TLxChDef::New(lcdtYuAscii);} return YuAsciiChDef; default: Fail; return NULL; } }
int TLxChDef::GetChTy | ( | const char & | Ch | ) | const [inline] |
char TLxChDef::GetUc | ( | const char & | Ch | ) | const [inline] |
TStr TLxChDef::GetUcStr | ( | const TStr & | Str | ) | const |
bool TLxChDef::IsAlNum | ( | const char & | Ch | ) | const [inline] |
bool TLxChDef::IsAlpha | ( | const char & | Ch | ) | const [inline] |
bool TLxChDef::IsNmStr | ( | const TStr & | Str | ) | const |
bool TLxChDef::IsNum | ( | const char & | Ch | ) | const [inline] |
bool TLxChDef::IsSpace | ( | const char & | Ch | ) | const [inline] |
bool TLxChDef::IsTerm | ( | const char & | Ch | ) | const [inline] |
static PLxChDef TLxChDef::Load | ( | TSIn & | SIn | ) | [inline, static] |
static PLxChDef TLxChDef::New | ( | const TLxChDefTy & | ChDefTy = lcdtUsAscii | ) | [inline, static] |
void TLxChDef::Save | ( | TSOut & | SOut | ) | [inline] |
void TLxChDef::SetChTy | ( | const TLxChTy & | ChTy, |
const TStr & | Str | ||
) | [private] |
void TLxChDef::SetUcCh | ( | const TStr & | Str | ) | [private] |
TIntV TLxChDef::ChTyV [private] |
TCRef TLxChDef::CRef [private] |
TChV TLxChDef::UcChV [private] |