SNAP Library 2.2, User Reference  2014-03-11 19:15:55
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TSIn Class Reference

#include <fl.h>

Inherits TSBase.

Inherited by TChAIn, TFIn, TMemIn, TMIn, TSInOut, TStdIn, TStrIn, and TZipIn.

List of all members.

Public Member Functions

 TSIn ()
 TSIn (const TStr &Str)
virtual ~TSIn ()
virtual bool Eof ()=0
virtual int Len () const =0
virtual char GetCh ()=0
virtual char PeekCh ()=0
virtual int GetBf (const void *Bf, const TSize &BfL)=0
virtual bool GetNextLnBf (TChA &LnChA)=0
virtual void Reset ()
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)

Static Public Attributes

static const TPt< TSInStdIn = PSIn(new TStdIn())

Private Member Functions

 TSIn (const TSIn &)
TSInoperator= (const TSIn &)

Private Attributes

bool FastMode

Friends

class TPt< TSIn >

Detailed Description

Definition at line 58 of file fl.h.


Constructor & Destructor Documentation

TSIn::TSIn ( const TSIn ) [private]
TSIn::TSIn ( ) [inline]

Definition at line 65 of file fl.h.

: TSBase("Input-Stream"), FastMode(false){}
TSIn::TSIn ( const TStr Str)

Definition at line 26 of file fl.cpp.

: TSBase(Str.CStr()), FastMode(false){}
virtual TSIn::~TSIn ( ) [inline, virtual]

Definition at line 67 of file fl.h.

{}

Member Function Documentation

virtual bool TSIn::Eof ( ) [pure virtual]

Implemented in TStrIn, TMIn, TFInOut, TChAIn, TFIn, TStdIn, TMemIn, and TZipIn.

virtual int TSIn::GetBf ( const void *  Bf,
const TSize BfL 
) [pure virtual]

Implemented in TStrIn, TMIn, TFInOut, TChAIn, TFIn, TStdIn, TMemIn, and TZipIn.

virtual char TSIn::GetCh ( ) [pure virtual]

Implemented in TStrIn, TMIn, TFInOut, TChAIn, TFIn, TStdIn, TMemIn, and TZipIn.

bool TSIn::GetNextLn ( TStr LnStr)

Definition at line 43 of file fl.cpp.

                               {
  TChA LnChA;
  const bool IsNext=GetNextLn(LnChA);
  LnStr=LnChA;
  return IsNext;
}
bool TSIn::GetNextLn ( TChA LnChA)

Definition at line 50 of file fl.cpp.

                               {
  LnChA.Clr();
  while (!Eof()){
    const char Ch=GetCh();
    if (Ch=='\n'){return true;}
    if (Ch=='\r' && PeekCh()=='\n'){GetCh(); return true;}
    LnChA.AddCh(Ch);
  }
  return !LnChA.Empty();
}
virtual bool TSIn::GetNextLnBf ( TChA LnChA) [pure virtual]

Implemented in TStrIn, TMIn, TFInOut, TChAIn, TFIn, TStdIn, TMemIn, and TZipIn.

bool TSIn::IsFastMode ( ) const [inline]

Definition at line 77 of file fl.h.

{return FastMode;}
virtual int TSIn::Len ( ) const [pure virtual]

Implemented in TStrIn, TMIn, TFInOut, TChAIn, TFIn, TStdIn, TMemIn, and TZipIn.

void TSIn::Load ( bool &  Bool) [inline]

Definition at line 84 of file fl.h.

{Cs+=GetBf(&Bool, sizeof(Bool));}
void TSIn::Load ( uchar UCh) [inline]

Definition at line 85 of file fl.h.

{Cs+=GetBf(&UCh, sizeof(UCh));}
void TSIn::Load ( char &  Ch) [inline]

Definition at line 86 of file fl.h.

{Cs+=GetBf(&Ch, sizeof(Ch));}
void TSIn::Load ( short &  Short) [inline]

Definition at line 87 of file fl.h.

{Cs+=GetBf(&Short, sizeof(Short));} //J:
void TSIn::Load ( ushort UShort) [inline]

Definition at line 88 of file fl.h.

{Cs+=GetBf(&UShort, sizeof(UShort));} //J:
void TSIn::Load ( int &  Int) [inline]

Definition at line 89 of file fl.h.

{Cs+=GetBf(&Int, sizeof(Int));}
void TSIn::Load ( uint UInt) [inline]

Definition at line 90 of file fl.h.

{Cs+=GetBf(&UInt, sizeof(UInt));}
void TSIn::Load ( int64 Int) [inline]

Definition at line 91 of file fl.h.

{Cs+=GetBf(&Int, sizeof(Int));}
void TSIn::Load ( uint64 UInt) [inline]

Definition at line 92 of file fl.h.

{Cs+=GetBf(&UInt, sizeof(UInt));}
void TSIn::Load ( double &  Flt) [inline]

Definition at line 93 of file fl.h.

{Cs+=GetBf(&Flt, sizeof(Flt));}
void TSIn::Load ( sdouble SFlt) [inline]

Definition at line 94 of file fl.h.

{Cs+=GetBf(&SFlt, sizeof(SFlt));}
void TSIn::Load ( ldouble LFlt) [inline]

Definition at line 95 of file fl.h.

{Cs+=GetBf(&LFlt, sizeof(LFlt));}
void TSIn::Load ( char *&  CStr,
const int &  MxCStrLen,
const int &  CStrLen 
) [inline]

Definition at line 96 of file fl.h.

                                                                  {
    CStr=new char[MxCStrLen+1]; Cs+=GetBf(CStr, CStrLen+1);}
void TSIn::Load ( char *&  CStr)

Definition at line 34 of file fl.cpp.

                          {
  char Ch; Load(Ch);
  int CStrLen=int(Ch);
  EAssertR(CStrLen>=0, "Error reading stream '"+GetSNm()+"'.");
  CStr=new char[CStrLen+1];
  if (CStrLen>0){Cs+=GetBf(CStr, CStrLen);}
  CStr[CStrLen]=TCh::NullCh;
}
void TSIn::LoadBf ( const void *  Bf,
const TSize BfL 
) [inline]

Definition at line 81 of file fl.h.

{Cs+=GetBf(Bf, BfL);}
void TSIn::LoadCs ( )

Definition at line 28 of file fl.cpp.

                 {
  TCs CurCs=Cs; TCs TestCs;
  Cs+=GetBf(&TestCs, sizeof(TestCs));
  EAssertR(CurCs==TestCs, "Invalid checksum reading '"+GetSNm()+"'.");
}
void* TSIn::LoadNewBf ( const int &  BfL) [inline]

Definition at line 82 of file fl.h.

                                 {
    void* Bf=(void*)new char[BfL]; Cs+=GetBf(Bf, BfL); return Bf;}
TSIn& TSIn::operator= ( const TSIn ) [private]
TSIn& TSIn::operator>> ( bool &  Bool) [inline]

Definition at line 100 of file fl.h.

{Cs+=GetBf(&Bool, sizeof(Bool)); return *this;}
TSIn& TSIn::operator>> ( uchar UCh) [inline]

Definition at line 101 of file fl.h.

{Cs+=GetBf(&UCh, sizeof(UCh)); return *this;}
TSIn& TSIn::operator>> ( char &  Ch) [inline]

Definition at line 102 of file fl.h.

{Cs+=GetBf(&Ch, sizeof(Ch)); return *this;}
TSIn& TSIn::operator>> ( short &  Sh) [inline]

Definition at line 103 of file fl.h.

{Cs+=GetBf(&Sh, sizeof(Sh)); return *this;}
TSIn& TSIn::operator>> ( ushort USh) [inline]

Definition at line 104 of file fl.h.

{Cs+=GetBf(&USh, sizeof(USh)); return *this;}
TSIn& TSIn::operator>> ( int &  Int) [inline]

Definition at line 105 of file fl.h.

{Cs+=GetBf(&Int, sizeof(Int)); return *this;}
TSIn& TSIn::operator>> ( uint UInt) [inline]

Definition at line 106 of file fl.h.

{Cs+=GetBf(&UInt, sizeof(UInt)); return *this;}
TSIn& TSIn::operator>> ( int64 Int) [inline]

Definition at line 107 of file fl.h.

{Cs+=GetBf(&Int, sizeof(Int)); return *this;}
TSIn& TSIn::operator>> ( uint64 UInt) [inline]

Definition at line 108 of file fl.h.

{Cs+=GetBf(&UInt, sizeof(UInt)); return *this;}
TSIn& TSIn::operator>> ( float &  Flt) [inline]

Definition at line 109 of file fl.h.

{Cs+=GetBf(&Flt, sizeof(Flt)); return *this;}
TSIn& TSIn::operator>> ( double &  Double) [inline]

Definition at line 110 of file fl.h.

{Cs+=GetBf(&Double, sizeof(Double)); return *this;}
TSIn& TSIn::operator>> ( long double &  LDouble) [inline]

Definition at line 111 of file fl.h.

{Cs+=GetBf(&LDouble, sizeof(LDouble)); return *this;}
virtual char TSIn::PeekCh ( ) [pure virtual]

Implemented in TStrIn, TMIn, TFInOut, TChAIn, TFIn, TStdIn, TMemIn, and TZipIn.

virtual void TSIn::Reset ( ) [inline, virtual]

Reimplemented in TStrIn, TMIn, TChAIn, TFIn, TStdIn, and TMemIn.

Definition at line 75 of file fl.h.

{Fail;}
void TSIn::SetFastMode ( const bool &  _FastMode) [inline]

Definition at line 78 of file fl.h.

{FastMode=_FastMode;}

Friends And Related Function Documentation

friend class TPt< TSIn > [friend]

Definition at line 117 of file fl.h.


Member Data Documentation

bool TSIn::FastMode [private]

Definition at line 60 of file fl.h.

const PSIn TSIn::StdIn = PSIn(new TStdIn()) [static]

Definition at line 116 of file fl.h.


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