SNAP Library , Developer Reference  2013-01-07 14:03:36
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
TMIn Class Reference

#include <fl.h>

Inheritance diagram for TMIn:
Collaboration diagram for TMIn:

List of all members.

Public Member Functions

 TMIn (const void *_Bf, const int &_BfL, const bool &TakeBf=false)
 TMIn (TSIn &SIn)
 TMIn (const char *CStr)
 TMIn (const TStr &Str)
 TMIn (const TChA &ChA)
 ~TMIn ()
bool Eof ()
int Len () const
char GetCh ()
char PeekCh ()
int GetBf (const void *LBf, const TSize &LBfL)
void Reset ()
char * GetBfAddr ()

Static Public Member Functions

static PSIn New (const char *CStr)
static PSIn New (const TStr &Str)
static PSIn New (const TChA &ChA)

Private Member Functions

 TMIn ()
 TMIn (const TMIn &)
TMInoperator= (const TMIn &)

Private Attributes

char * Bf
int BfC
int BfL

Detailed Description

Definition at line 379 of file fl.h.


Constructor & Destructor Documentation

TMIn::TMIn ( ) [private]

Referenced by New().

Here is the caller graph for this function:

TMIn::TMIn ( const TMIn ) [private]
TMIn::TMIn ( const void *  _Bf,
const int &  _BfL,
const bool &  TakeBf = false 
)

Definition at line 437 of file fl.cpp.

References Bf, and BfL.

                                                              :
  TSBase("Input-Memory"), TSIn("Input-Memory"), Bf(NULL), BfC(0), BfL(_BfL){
  if (TakeBf){
    Bf=(char*)_Bf;
  } else {
    Bf=new char[BfL]; memmove(Bf, _Bf, BfL);
  }
}
TMIn::TMIn ( TSIn SIn)

Definition at line 446 of file fl.cpp.

References Bf, BfC, BfL, TSIn::GetCh(), and TSIn::Len().

                   :
  TSBase("Input-Memory"), TSIn("Input-Memory"), Bf(NULL), BfC(0), BfL(0){
  BfL=SIn.Len(); Bf=new char[BfL];
  for (int BfC=0; BfC<BfL; BfC++){Bf[BfC]=SIn.GetCh();}
}

Here is the call graph for this function:

TMIn::TMIn ( const char *  CStr)

Definition at line 452 of file fl.cpp.

References Bf, and BfL.

                          :
  TSBase("Input-Memory"), TSIn("Input-Memory"), Bf(NULL), BfC(0), BfL(0){
  BfL=int(strlen(CStr)); Bf=new char[BfL+1]; strcpy(Bf, CStr);
}
TMIn::TMIn ( const TStr Str)

Definition at line 457 of file fl.cpp.

References Bf, BfL, TStr::CStr(), and TStr::Len().

                         :
  TSBase("Input-Memory"), TSIn("Input-Memory"), Bf(NULL), BfC(0), BfL(0){
  BfL=Str.Len(); Bf=new char[BfL]; strncpy(Bf, Str.CStr(), BfL);
}

Here is the call graph for this function:

TMIn::TMIn ( const TChA ChA)

Definition at line 462 of file fl.cpp.

References Bf, BfL, TChA::CStr(), and TChA::Len().

                         :
  TSBase("Input-Memory"), TSIn("Input-Memory"), Bf(NULL), BfC(0), BfL(0){
  BfL=ChA.Len(); Bf=new char[BfL]; strncpy(Bf, ChA.CStr(), BfL);
}

Here is the call graph for this function:

TMIn::~TMIn ( ) [inline]

Definition at line 396 of file fl.h.

References Bf.

{if (Bf!=NULL){delete[] Bf;}}

Member Function Documentation

bool TMIn::Eof ( ) [inline, virtual]

Implements TSIn.

Definition at line 398 of file fl.h.

References BfC, and BfL.

{return BfC==BfL;}
int TMIn::GetBf ( const void *  LBf,
const TSize LBfL 
) [virtual]

Implements TSIn.

Definition at line 489 of file fl.cpp.

References Bf, BfC, BfL, and EAssertR.

                                                 {
  EAssertR(TSize(BfC+LBfL)<=TSize(BfL), "Reading beyond the end of stream.");
  int LBfS=0;
  for (TSize LBfC=0; LBfC<LBfL; LBfC++){
    LBfS+=(((char*)LBf)[LBfC]=Bf[BfC++]);}
  return LBfS;
}
char* TMIn::GetBfAddr ( ) [inline]

Definition at line 405 of file fl.h.

References Bf.

{return Bf;}
char TMIn::GetCh ( ) [virtual]

Implements TSIn.

Definition at line 479 of file fl.cpp.

References Bf, BfC, BfL, and EAssertR.

                {
  EAssertR(BfC<BfL, "Reading beyond the end of stream.");
  return Bf[BfC++];
}
int TMIn::Len ( ) const [inline, virtual]

Implements TSIn.

Definition at line 399 of file fl.h.

References BfC, and BfL.

{return BfL-BfC;}
PSIn TMIn::New ( const char *  CStr) [static]

Definition at line 467 of file fl.cpp.

References TMIn().

                              {
  return PSIn(new TMIn(CStr));
}

Here is the call graph for this function:

PSIn TMIn::New ( const TStr Str) [static]

Definition at line 471 of file fl.cpp.

References TMIn().

                             {
  return PSIn(new TMIn(Str));
}

Here is the call graph for this function:

PSIn TMIn::New ( const TChA ChA) [static]

Definition at line 475 of file fl.cpp.

References TMIn().

                             {
  return PSIn(new TMIn(ChA));
}

Here is the call graph for this function:

TMIn& TMIn::operator= ( const TMIn ) [private]
char TMIn::PeekCh ( ) [virtual]

Implements TSIn.

Definition at line 484 of file fl.cpp.

References Bf, BfC, BfL, and EAssertR.

                 {
  EAssertR(BfC<BfL, "Reading beyond the end of stream.");
  return Bf[BfC];
}
void TMIn::Reset ( ) [inline, virtual]

Reimplemented from TSIn.

Definition at line 403 of file fl.h.

References BfC, and TSBase::Cs.

{Cs=TCs(); BfC=0;}

Member Data Documentation

char* TMIn::Bf [private]

Definition at line 381 of file fl.h.

Referenced by GetBf(), GetBfAddr(), GetCh(), PeekCh(), TMIn(), and ~TMIn().

int TMIn::BfC [private]

Definition at line 382 of file fl.h.

Referenced by Eof(), GetBf(), GetCh(), Len(), PeekCh(), Reset(), and TMIn().

int TMIn::BfL [private]

Definition at line 382 of file fl.h.

Referenced by Eof(), GetBf(), GetCh(), Len(), PeekCh(), and TMIn().


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