SNAP Library 3.0, User Reference  2016-07-20 17:56:49
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
TCh Class Reference

#include <dt.h>

Public Member Functions

 TCh ()
 
 TCh (const char &_Val)
 
 operator char () const
 
 TCh (TSIn &SIn)
 
void Load (TSIn &SIn)
 
void Save (TSOut &SOut) const
 
void LoadXml (const PXmlTok &XmlTok, const TStr &Nm)
 
void SaveXml (TSOut &SOut, const TStr &Nm) const
 
TChoperator= (const TCh &Ch)
 
bool operator== (const TCh &Ch) const
 
bool operator< (const TCh &Ch) const
 
char operator() () const
 
int GetMemUsed () const
 
int GetPrimHashCd () const
 
int GetSecHashCd () const
 

Static Public Member Functions

static bool IsHashCh (const char &Ch)
 
static bool IsWs (const char &Ch)
 
static bool IsAlpha (const char &Ch)
 
static bool IsNum (const char &Ch)
 
static bool IsAlNum (const char &Ch)
 
static int GetNum (const char &Ch)
 
static bool IsHex (const char &Ch)
 
static int GetHex (const char &Ch)
 
static char GetHexCh (const int &Val)
 
static char IsUc (const char &Ch)
 
static char GetUc (const char &Ch)
 
static char GetUsFromYuAscii (const char &Ch)
 
static TStr GetStr (const TCh &Ch)
 

Public Attributes

char Val
 

Static Public Attributes

static const char Mn =CHAR_MIN
 
static const char Mx =CHAR_MAX
 
static const int Vals =int(TCh::Mx)-int(TCh::Mn)+1
 
static const char NullCh =char(0)
 
static const char TabCh =char(9)
 
static const char LfCh =char(10)
 
static const char CrCh =char(13)
 
static const char EofCh =char(26)
 
static const char HashCh ='#'
 

Detailed Description

Definition at line 935 of file dt.h.

Constructor & Destructor Documentation

TCh::TCh ( )
inline

Definition at line 950 of file dt.h.

950 : Val(TCh::NullCh){}
static const char NullCh
Definition: dt.h:943
char Val
Definition: dt.h:937
TCh::TCh ( const char &  _Val)
inline

Definition at line 951 of file dt.h.

951 : Val(_Val){}
char Val
Definition: dt.h:937
TCh::TCh ( TSIn SIn)
inlineexplicit

Definition at line 953 of file dt.h.

953 {SIn.Load(Val);}
void Load(bool &Bool)
Definition: fl.h:84
char Val
Definition: dt.h:937

Member Function Documentation

static int TCh::GetHex ( const char &  Ch)
inlinestatic

Definition at line 979 of file dt.h.

979  {
980  if (('0'<=Ch)&&(Ch<='9')){return Ch-'0';}
981  else if (('A'<=Ch)&&(Ch<='F')){return Ch-'A'+10;}
982  else if (('a'<=Ch)&&(Ch<='f')){return Ch-'a'+10;}
983  else Fail; return 0;}
#define Fail
Definition: bd.h:238
static char TCh::GetHexCh ( const int &  Val)
inlinestatic

Definition at line 984 of file dt.h.

984  {
985  if ((0<=Val)&&(Val<=9)){return char('0'+char(Val));}
986  else if ((10<=Val)&&(Val<=15)){return char('A'+char(Val-10));}
987  else Fail; return 0;}
#define Fail
Definition: bd.h:238
char Val
Definition: dt.h:937
int TCh::GetMemUsed ( ) const
inline

Definition at line 963 of file dt.h.

963 {return sizeof(TCh);}
TCh()
Definition: dt.h:950
static int TCh::GetNum ( const char &  Ch)
inlinestatic

Definition at line 976 of file dt.h.

976 {Assert(IsNum(Ch)); return Ch-'0';}
static bool IsNum(const char &Ch)
Definition: dt.h:974
#define Assert(Cond)
Definition: bd.h:251
int TCh::GetPrimHashCd ( ) const
inline

Definition at line 965 of file dt.h.

965 {return Val;}
char Val
Definition: dt.h:937
int TCh::GetSecHashCd ( ) const
inline

Definition at line 966 of file dt.h.

966 {return Val;}
char Val
Definition: dt.h:937
static TStr TCh::GetStr ( const TCh Ch)
inlinestatic

Definition at line 994 of file dt.h.

994  {
995  return TStr(Ch.Val);}
Definition: dt.h:412
char Val
Definition: dt.h:937
static char TCh::GetUc ( const char &  Ch)
inlinestatic

Definition at line 990 of file dt.h.

990  {
991  if (('a'<=Ch)&&(Ch<='z')){return Ch-'a'+'A';} else {return Ch;}}
char TCh::GetUsFromYuAscii ( const char &  Ch)
static

Definition at line 1885 of file dt.cpp.

1885  {
1886  switch (Ch){
1887  case '~': return 'c';
1888  case '^': return 'C';
1889  case '{': return 's';
1890  case '[': return 'S';
1891  case '`': return 'z';
1892  case '@': return 'Z';
1893  case '|': return 'd';
1894  case '\\': return 'D';
1895  default: return Ch;
1896  }
1897 }
static bool TCh::IsAlNum ( const char &  Ch)
inlinestatic

Definition at line 975 of file dt.h.

975 {return IsAlpha(Ch)||IsNum(Ch);}
static bool IsNum(const char &Ch)
Definition: dt.h:974
static bool IsAlpha(const char &Ch)
Definition: dt.h:972
static bool TCh::IsAlpha ( const char &  Ch)
inlinestatic

Definition at line 972 of file dt.h.

972  {
973  return (('A'<=Ch)&&(Ch<='Z'))||(('a'<=Ch)&&(Ch<='z'));}
static bool TCh::IsHashCh ( const char &  Ch)
inlinestatic

Definition at line 968 of file dt.h.

968  {
969  return (Ch==HashCh);}
static const char HashCh
Definition: dt.h:948
static bool TCh::IsHex ( const char &  Ch)
inlinestatic

Definition at line 977 of file dt.h.

977  {return
978  (('0'<=Ch)&&(Ch<='9'))||(('A'<=Ch)&&(Ch<='F'))||(('a'<=Ch)&&(Ch<='f'));}
static bool TCh::IsNum ( const char &  Ch)
inlinestatic

Definition at line 974 of file dt.h.

974 {return ('0'<=Ch)&&(Ch<='9');}
static char TCh::IsUc ( const char &  Ch)
inlinestatic

Definition at line 988 of file dt.h.

988  {
989  return ('A'<=Ch)&&(Ch<='Z');}
static bool TCh::IsWs ( const char &  Ch)
inlinestatic

Definition at line 970 of file dt.h.

970  {
971  return (Ch==' ')||(Ch==TabCh)||(Ch==CrCh)||(Ch==LfCh);}
static const char TabCh
Definition: dt.h:944
static const char LfCh
Definition: dt.h:945
static const char CrCh
Definition: dt.h:946
void TCh::Load ( TSIn SIn)
inline

Definition at line 954 of file dt.h.

954 {SIn.Load(Val);}
void Load(bool &Bool)
Definition: fl.h:84
char Val
Definition: dt.h:937
void TCh::LoadXml ( const PXmlTok XmlTok,
const TStr Nm 
)

Definition at line 1876 of file dt.cpp.

1876  {
1877  XLoadHd(Nm);
1878  Val=char(TXmlObjSer::GetIntArg(XmlTok, "Val"));
1879 }
#define XLoadHd(Nm)
Definition: bd.h:312
static int GetIntArg(const PXmlTok &XmlTok, const TStr &Nm)
Definition: xml.cpp:74
char Val
Definition: dt.h:937
TCh::operator char ( ) const
inline

Definition at line 952 of file dt.h.

952 {return Val;}
char Val
Definition: dt.h:937
char TCh::operator() ( ) const
inline

Definition at line 962 of file dt.h.

962 {return Val;}
char Val
Definition: dt.h:937
bool TCh::operator< ( const TCh Ch) const
inline

Definition at line 961 of file dt.h.

961 {return Val<Ch.Val;}
char Val
Definition: dt.h:937
TCh& TCh::operator= ( const TCh Ch)
inline

Definition at line 959 of file dt.h.

959 {Val=Ch.Val; return *this;}
char Val
Definition: dt.h:937
bool TCh::operator== ( const TCh Ch) const
inline

Definition at line 960 of file dt.h.

960 {return Val==Ch.Val;}
char Val
Definition: dt.h:937
void TCh::Save ( TSOut SOut) const
inline

Definition at line 955 of file dt.h.

955 {SOut.Save(Val);}
void Save(const bool &Bool)
Definition: fl.h:173
char Val
Definition: dt.h:937
void TCh::SaveXml ( TSOut SOut,
const TStr Nm 
) const

Definition at line 1881 of file dt.cpp.

1881  {
1882  XSaveBETagArg(Nm, "Val", TInt::GetStr(Val));
1883 }
TStr GetStr() const
Definition: dt.h:1107
#define XSaveBETagArg(Nm, ArgNm, ArgVal)
Definition: bd.h:327
char Val
Definition: dt.h:937

Member Data Documentation

const char TCh::CrCh =char(13)
static

Definition at line 946 of file dt.h.

const char TCh::EofCh =char(26)
static

Definition at line 947 of file dt.h.

const char TCh::HashCh ='#'
static

Definition at line 948 of file dt.h.

const char TCh::LfCh =char(10)
static

Definition at line 945 of file dt.h.

const char TCh::Mn =CHAR_MIN
static

Definition at line 939 of file dt.h.

const char TCh::Mx =CHAR_MAX
static

Definition at line 940 of file dt.h.

const char TCh::NullCh =char(0)
static

Definition at line 943 of file dt.h.

const char TCh::TabCh =char(9)
static

Definition at line 944 of file dt.h.

char TCh::Val

Definition at line 937 of file dt.h.

const int TCh::Vals =int(TCh::Mx)-int(TCh::Mn)+1
static

Definition at line 941 of file dt.h.


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