SNAP Library 4.0, Developer Reference  2017-07-27 13:18:06
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 1025 of file dt.h.

Constructor & Destructor Documentation

TCh::TCh ( )
inline

Definition at line 1040 of file dt.h.

Referenced by GetMemUsed().

1040 : Val(TCh::NullCh){}
static const char NullCh
Definition: dt.h:1033
char Val
Definition: dt.h:1027

Here is the caller graph for this function:

TCh::TCh ( const char &  _Val)
inline

Definition at line 1041 of file dt.h.

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

Definition at line 1043 of file dt.h.

References TSIn::Load(), and Val.

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

Here is the call graph for this function:

Member Function Documentation

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

Definition at line 1069 of file dt.h.

References Fail.

Referenced by TUrl::DecodeUrlStr(), TStr::FromHex(), TXmlLx::GetPlainStrFromXmlStr(), TXmlParser::GetPlainStrFromXmlStr(), TXmlLx::GetReference(), TILx::GetSym(), TStr::IsHexInt(), TStr::IsHexInt64(), and THttpRq::ParseSearch().

1069  {
1070  if (('0'<=Ch)&&(Ch<='9')){return Ch-'0';}
1071  else if (('A'<=Ch)&&(Ch<='F')){return Ch-'A'+10;}
1072  else if (('a'<=Ch)&&(Ch<='f')){return Ch-'a'+10;}
1073  else Fail; return 0;}
#define Fail
Definition: bd.h:238

Here is the caller graph for this function:

static char TCh::GetHexCh ( const int &  Val)
inlinestatic

Definition at line 1074 of file dt.h.

References Fail.

Referenced by TMd5::GetSigStr(), TMd5Sig::GetStr(), and TStr::ToHex().

1074  {
1075  if ((0<=Val)&&(Val<=9)){return char('0'+char(Val));}
1076  else if ((10<=Val)&&(Val<=15)){return char('A'+char(Val-10));}
1077  else Fail; return 0;}
#define Fail
Definition: bd.h:238
char Val
Definition: dt.h:1027

Here is the caller graph for this function:

int TCh::GetMemUsed ( ) const
inline

Definition at line 1053 of file dt.h.

References TCh().

1053 {return sizeof(TCh);}
TCh()
Definition: dt.h:1040

Here is the call graph for this function:

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

Definition at line 1066 of file dt.h.

References Assert, and IsNum().

Referenced by TSsParserMP::GetInt(), TSsParser::GetInt(), TSsParserMP::GetIntFromFldV(), TXmlLx::GetPlainStrFromXmlStr(), TXmlParser::GetPlainStrFromXmlStr(), TXmlLx::GetReference(), TSsParser::GetUInt64(), TStr::IsInt(), TStr::IsInt64(), TStr::IsUInt(), and TStr::IsUInt64().

1066 {Assert(IsNum(Ch)); return Ch-'0';}
static bool IsNum(const char &Ch)
Definition: dt.h:1064
#define Assert(Cond)
Definition: bd.h:251

Here is the call graph for this function:

Here is the caller graph for this function:

int TCh::GetPrimHashCd ( ) const
inline

Definition at line 1055 of file dt.h.

References Val.

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

Definition at line 1056 of file dt.h.

References Val.

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

Definition at line 1084 of file dt.h.

References Val.

1084  {
1085  return TStr(Ch.Val);}
Definition: dt.h:412
char Val
Definition: dt.h:1027
static char TCh::GetUc ( const char &  Ch)
inlinestatic

Definition at line 1080 of file dt.h.

1080  {
1081  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.

Referenced by TRStr::ConvUsFromYuAscii().

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 }

Here is the caller graph for this function:

static bool TCh::IsAlNum ( const char &  Ch)
inlinestatic

Definition at line 1065 of file dt.h.

References IsAlpha(), and IsNum().

Referenced by TStrUtil::GetCleanStr(), TStrUtil::GetCleanWrdStr(), TStr::GetNrFMid(), TStr::IsWord(), TStr::SplitOnNonAlNum(), TStrUtil::SplitSentences(), and TStrUtil::SplitWords().

1065 {return IsAlpha(Ch)||IsNum(Ch);}
static bool IsNum(const char &Ch)
Definition: dt.h:1064
static bool IsAlpha(const char &Ch)
Definition: dt.h:1062

Here is the call graph for this function:

Here is the caller graph for this function:

static bool TCh::IsAlpha ( const char &  Ch)
inlinestatic

Definition at line 1062 of file dt.h.

Referenced by IsAlNum(), and TStr::IsWord().

1062  {
1063  return (('A'<=Ch)&&(Ch<='Z'))||(('a'<=Ch)&&(Ch<='z'));}

Here is the caller graph for this function:

static bool TCh::IsHashCh ( const char &  Ch)
inlinestatic

Definition at line 1058 of file dt.h.

References HashCh.

Referenced by TMIn::SkipCommentLines().

1058  {
1059  return (Ch==HashCh);}
static const char HashCh
Definition: dt.h:1038

Here is the caller graph for this function:

static bool TCh::IsHex ( const char &  Ch)
inlinestatic

Definition at line 1067 of file dt.h.

Referenced by TUrl::DecodeUrlStr(), TXmlLx::GetPlainStrFromXmlStr(), TXmlParser::GetPlainStrFromXmlStr(), TXmlLx::GetReference(), TILx::GetSym(), TStr::IsHexInt(), TStr::IsHexInt64(), and THttpRq::ParseSearch().

1067  {return
1068  (('0'<=Ch)&&(Ch<='9'))||(('A'<=Ch)&&(Ch<='F'))||(('a'<=Ch)&&(Ch<='f'));}

Here is the caller graph for this function:

static char TCh::IsUc ( const char &  Ch)
inlinestatic

Definition at line 1078 of file dt.h.

Referenced by TStr::IsWord().

1078  {
1079  return ('A'<=Ch)&&(Ch<='Z');}

Here is the caller graph for this function:

void TCh::Load ( TSIn SIn)
inline

Definition at line 1044 of file dt.h.

References TSIn::Load(), and Val.

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

Here is the call graph for this function:

void TCh::LoadXml ( const PXmlTok XmlTok,
const TStr Nm 
)

Definition at line 1876 of file dt.cpp.

References TXmlObjSer::GetIntArg(), Val, and XLoadHd.

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:1027

Here is the call graph for this function:

TCh::operator char ( ) const
inline

Definition at line 1042 of file dt.h.

References Val.

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

Definition at line 1052 of file dt.h.

References Val.

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

Definition at line 1051 of file dt.h.

References Val.

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

Definition at line 1049 of file dt.h.

References Val.

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

Definition at line 1050 of file dt.h.

References Val.

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

Definition at line 1045 of file dt.h.

References TSOut::Save(), and Val.

1045 {SOut.Save(Val);}
void Save(const bool &Bool)
Definition: fl.h:173
char Val
Definition: dt.h:1027

Here is the call graph for this function:

void TCh::SaveXml ( TSOut SOut,
const TStr Nm 
) const

Definition at line 1881 of file dt.cpp.

References TInt::GetStr(), Val, and XSaveBETagArg.

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

Here is the call graph for this function:

Member Data Documentation

const char TCh::HashCh ='#'
static

Definition at line 1038 of file dt.h.

Referenced by IsHashCh().

const char TCh::Mx =CHAR_MAX
static

Definition at line 1030 of file dt.h.

Referenced by THtmlLxChDef::THtmlLxChDef(), THttpChDef::THttpChDef(), and TLxChDef::TLxChDef().

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

Definition at line 1031 of file dt.h.

Referenced by TStr::GetDChStr().


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