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
TStrIn Class Reference

#include <dt.h>

Inherits TSIn.

Public Member Functions

 TStrIn (const TStr &_Str)
 
 ~TStrIn ()
 
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)
 
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 TStr &Str)
 

Private Member Functions

 TStrIn ()
 
 TStrIn (const TStrIn &)
 
TStrInoperator= (const TStrIn &)
 

Private Attributes

TStr Str
 
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 697 of file dt.h.

Constructor & Destructor Documentation

TStrIn::TStrIn ( )
private
TStrIn::TStrIn ( const TStrIn )
private
TStrIn::TStrIn ( const TStr _Str)

Definition at line 1643 of file dt.cpp.

1643  :
1644  TSBase("Input-String"), TSIn("Input-String"), Str(_Str), Bf(Str.CStr()), BfC(0), BfL(Str.Len()){}
int Len() const
Definition: dt.h:487
TSBase(const TSStr &Nm)
Definition: fl.h:50
int BfC
Definition: dt.h:701
TStr Str
Definition: dt.h:699
TSIn()
Definition: fl.h:65
char * Bf
Definition: dt.h:700
char * CStr()
Definition: dt.h:476
int BfL
Definition: dt.h:701
TStrIn::~TStrIn ( )
inline

Definition at line 709 of file dt.h.

709 {}

Member Function Documentation

bool TStrIn::Eof ( )
inlinevirtual

Implements TSIn.

Definition at line 711 of file dt.h.

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

Implements TSIn.

Definition at line 1646 of file dt.cpp.

1646  {
1647  Assert(TSize(BfC+LBfL)<=TSize(BfL));
1648  int LBfS=0;
1649  for (TSize LBfC=0; LBfC<LBfL; LBfC++){
1650  LBfS+=(((char*)LBf)[LBfC]=Bf[BfC++]);}
1651  return LBfS;
1652 }
int BfC
Definition: dt.h:701
size_t TSize
Definition: bd.h:58
#define Assert(Cond)
Definition: bd.h:251
char * Bf
Definition: dt.h:700
int BfL
Definition: dt.h:701
char TStrIn::GetCh ( )
inlinevirtual

Implements TSIn.

Definition at line 713 of file dt.h.

713 {Assert(BfC<BfL); return Bf[BfC++];}
int BfC
Definition: dt.h:701
#define Assert(Cond)
Definition: bd.h:251
char * Bf
Definition: dt.h:700
int BfL
Definition: dt.h:701
bool TStrIn::GetNextLnBf ( TChA LnChA)
virtual

Implements TSIn.

Definition at line 1654 of file dt.cpp.

1654  {
1655  // not implemented
1656  FailR(TStr::Fmt("TStrIn::GetNextLnBf: not implemented").CStr());
1657  return false;
1658 }
#define FailR(Reason)
Definition: bd.h:240
static TStr Fmt(const char *FmtStr,...)
Definition: dt.cpp:1599
int TStrIn::Len ( ) const
inlinevirtual

Implements TSIn.

Definition at line 712 of file dt.h.

712 {return BfL-BfC;}
int BfC
Definition: dt.h:701
int BfL
Definition: dt.h:701
static PSIn TStrIn::New ( const TStr Str)
inlinestatic

Definition at line 708 of file dt.h.

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

Implements TSIn.

Definition at line 714 of file dt.h.

714 {Assert(BfC<BfL); return Bf[BfC];}
int BfC
Definition: dt.h:701
#define Assert(Cond)
Definition: bd.h:251
char * Bf
Definition: dt.h:700
int BfL
Definition: dt.h:701
void TStrIn::Reset ( )
inlinevirtual

Reimplemented from TSIn.

Definition at line 716 of file dt.h.

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

Member Data Documentation

char* TStrIn::Bf
private

Definition at line 700 of file dt.h.

int TStrIn::BfC
private

Definition at line 701 of file dt.h.

int TStrIn::BfL
private

Definition at line 701 of file dt.h.

TStr TStrIn::Str
private

Definition at line 699 of file dt.h.


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