SNAP Library 2.4, User Reference  2015-05-11 19:40:56
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 698 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:702
TStr Str
Definition: dt.h:700
TSIn()
Definition: fl.h:65
char * Bf
Definition: dt.h:701
char * CStr()
Definition: dt.h:476
int BfL
Definition: dt.h:702
TStrIn::~TStrIn ( )
inline

Definition at line 710 of file dt.h.

710 {}

Member Function Documentation

bool TStrIn::Eof ( )
inlinevirtual

Implements TSIn.

Definition at line 712 of file dt.h.

712 {return BfC==BfL;}
int BfC
Definition: dt.h:702
int BfL
Definition: dt.h:702
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:702
size_t TSize
Definition: bd.h:58
#define Assert(Cond)
Definition: bd.h:251
char * Bf
Definition: dt.h:701
int BfL
Definition: dt.h:702
char TStrIn::GetCh ( )
inlinevirtual

Implements TSIn.

Definition at line 714 of file dt.h.

714 {Assert(BfC<BfL); return Bf[BfC++];}
int BfC
Definition: dt.h:702
#define Assert(Cond)
Definition: bd.h:251
char * Bf
Definition: dt.h:701
int BfL
Definition: dt.h:702
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 713 of file dt.h.

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

Definition at line 709 of file dt.h.

709 {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 715 of file dt.h.

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

Reimplemented from TSIn.

Definition at line 717 of file dt.h.

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

Member Data Documentation

char* TStrIn::Bf
private

Definition at line 701 of file dt.h.

int TStrIn::BfC
private

Definition at line 702 of file dt.h.

int TStrIn::BfL
private

Definition at line 702 of file dt.h.

TStr TStrIn::Str
private

Definition at line 700 of file dt.h.


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