SNAP Library 6.0, User Reference  2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
TChAIn Class Reference

#include <dt.h>

Inherits TSIn.

Public Member Functions

 TChAIn (const TChA &ChA, const int &_BfC=0)
 
 ~TChAIn ()
 
bool Eof ()
 
int Len () const
 
char GetCh ()
 
char PeekCh ()
 
int GetBf (const void *LBf, const TSize &LBfL)
 
void Reset ()
 
bool GetNextLnBf (TChA &LnChA)
 
- Public Member Functions inherited from TSIn
 TSIn ()
 
 TSIn (const TStr &Str)
 
virtual ~TSIn ()
 
bool IsFastMode () const
 
void SetFastMode (const bool &_FastMode)
 
virtual void LoadCs ()
 
void LoadBf (const void *Bf, const TSize &BfL)
 
void * LoadNewBf (const int &BfL)
 
void Load (bool &Bool)
 
void Load (uchar &UCh)
 
void Load (char &Ch)
 
void Load (short &Short)
 
void Load (ushort &UShort)
 
void Load (int &Int)
 
void Load (uint &UInt)
 
void Load (int64 &Int)
 
void Load (uint64 &UInt)
 
void Load (double &Flt)
 
void Load (sdouble &SFlt)
 
void Load (ldouble &LFlt)
 
void Load (char *&CStr, const int &MxCStrLen, const int &CStrLen)
 
void Load (char *&CStr)
 
TSInoperator>> (bool &Bool)
 
TSInoperator>> (uchar &UCh)
 
TSInoperator>> (char &Ch)
 
TSInoperator>> (short &Sh)
 
TSInoperator>> (ushort &USh)
 
TSInoperator>> (int &Int)
 
TSInoperator>> (uint &UInt)
 
TSInoperator>> (int64 &Int)
 
TSInoperator>> (uint64 &UInt)
 
TSInoperator>> (float &Flt)
 
TSInoperator>> (double &Double)
 
TSInoperator>> (long double &LDouble)
 
bool GetNextLn (TStr &LnStr)
 
bool GetNextLn (TChA &LnChA)
 
- Public Member Functions inherited from TSBase
 TSBase (const TSStr &Nm)
 
virtual ~TSBase ()
 
virtual TStr GetSNm () const
 

Static Public Member Functions

static PSIn New (const TChA &ChA)
 

Private Member Functions

 TChAIn ()
 
 TChAIn (const TChAIn &)
 
TChAInoperator= (const TChAIn &)
 

Private Attributes

const char * Bf
 
int BfC
 
int BfL
 

Additional Inherited Members

- Static Public Attributes inherited from TSIn
static const TPt< TSInStdIn =PSIn(new TStdIn())
 
- Protected Attributes inherited from TSBase
TCRef CRef
 
TSStr SNm
 
TCs Cs
 

Detailed Description

Definition at line 322 of file dt.h.

Constructor & Destructor Documentation

TChAIn::TChAIn ( )
private
TChAIn::TChAIn ( const TChAIn )
private
TChAIn::TChAIn ( const TChA ChA,
const int &  _BfC = 0 
)

Definition at line 641 of file dt.cpp.

641  :
642  TSBase("Input-Char-Array"), TSIn("Input-Char-Array"), Bf(ChA.CStr()), BfC(_BfC), BfL(ChA.Len()){}
TSBase(const TSStr &Nm)
Definition: fl.h:50
int BfL
Definition: dt.h:325
int Len() const
Definition: dt.h:259
char * CStr()
Definition: dt.h:255
const char * Bf
Definition: dt.h:324
TSIn()
Definition: fl.h:65
int BfC
Definition: dt.h:325
TChAIn::~TChAIn ( )
inline

Definition at line 333 of file dt.h.

333 {}

Member Function Documentation

bool TChAIn::Eof ( )
inlinevirtual

Implements TSIn.

Definition at line 335 of file dt.h.

335 {return BfC==BfL;}
int BfL
Definition: dt.h:325
int BfC
Definition: dt.h:325
int TChAIn::GetBf ( const void *  LBf,
const TSize LBfL 
)
virtual

Implements TSIn.

Definition at line 644 of file dt.cpp.

644  {
645  Assert(TSize(BfC+LBfL)<=TSize(BfL));
646  int LBfS=0;
647  for (TSize LBfC=0; LBfC<LBfL; LBfC++){
648  LBfS+=(((char*)LBf)[LBfC]=Bf[BfC++]);}
649  return LBfS;
650 }
int BfL
Definition: dt.h:325
const char * Bf
Definition: dt.h:324
size_t TSize
Definition: bd.h:58
#define Assert(Cond)
Definition: bd.h:251
int BfC
Definition: dt.h:325
char TChAIn::GetCh ( )
inlinevirtual

Implements TSIn.

Definition at line 337 of file dt.h.

337 {Assert(BfC<BfL); return Bf[BfC++];}
int BfL
Definition: dt.h:325
const char * Bf
Definition: dt.h:324
#define Assert(Cond)
Definition: bd.h:251
int BfC
Definition: dt.h:325
bool TChAIn::GetNextLnBf ( TChA LnChA)
virtual

Implements TSIn.

Definition at line 652 of file dt.cpp.

652  {
653  // not implemented
654  FailR(TStr::Fmt("TChAIn::GetNextLnBf: not implemented").CStr());
655  return false;
656 }
#define FailR(Reason)
Definition: bd.h:240
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
int TChAIn::Len ( ) const
inlinevirtual

Implements TSIn.

Definition at line 336 of file dt.h.

336 {return BfL-BfC;}
int BfL
Definition: dt.h:325
int BfC
Definition: dt.h:325
static PSIn TChAIn::New ( const TChA ChA)
inlinestatic

Definition at line 332 of file dt.h.

332 {return PSIn(new TChAIn(ChA));}
TPt< TSIn > PSIn
Definition: fl.h:119
TChAIn& TChAIn::operator= ( const TChAIn )
private
char TChAIn::PeekCh ( )
inlinevirtual

Implements TSIn.

Definition at line 338 of file dt.h.

338 {Assert(BfC<BfL); return Bf[BfC];}
int BfL
Definition: dt.h:325
const char * Bf
Definition: dt.h:324
#define Assert(Cond)
Definition: bd.h:251
int BfC
Definition: dt.h:325
void TChAIn::Reset ( )
inlinevirtual

Reimplemented from TSIn.

Definition at line 340 of file dt.h.

340 {Cs=TCs(); BfC=0;}
int BfC
Definition: dt.h:325
Definition: fl.h:11
TCs Cs
Definition: fl.h:44

Member Data Documentation

const char* TChAIn::Bf
private

Definition at line 324 of file dt.h.

int TChAIn::BfC
private

Definition at line 325 of file dt.h.

int TChAIn::BfL
private

Definition at line 325 of file dt.h.


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