SNAP Library 2.2, Developer 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
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 ()
bool GetNextLnBf (TChA &LnChA)
char * GetBfAddr ()

Static Public Member Functions

static PSIn New (const void *_Bf, const int &_BfL, const bool &TakeBf=false)
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 384 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 531 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 540 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 546 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 551 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 556 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 402 of file fl.h.

References Bf.

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

Member Function Documentation

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

Implements TSIn.

Definition at line 404 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 587 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 412 of file fl.h.

References Bf.

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

Implements TSIn.

Definition at line 577 of file fl.cpp.

References Bf, BfC, BfL, and EAssertR.

                {
  EAssertR(BfC<BfL, "Reading beyond the end of stream.");
  return Bf[BfC++];
}
bool TMIn::GetNextLnBf ( TChA LnChA) [virtual]

Implements TSIn.

Definition at line 595 of file fl.cpp.

References FailR, and TStr::Fmt().

                                 {
  // not implemented
  FailR(TStr::Fmt("TMIn::GetNextLnBf: not implemented").CStr());
  return false;
}

Here is the call graph for this function:

int TMIn::Len ( ) const [inline, virtual]

Implements TSIn.

Definition at line 405 of file fl.h.

References BfC, and BfL.

{return BfL-BfC;}
PSIn TMIn::New ( const void *  _Bf,
const int &  _BfL,
const bool &  TakeBf = false 
) [static]

Definition at line 561 of file fl.cpp.

References TMIn().

                                                                  {
  return PSIn(new TMIn(_Bf, _BfL, TakeBf));
}

Here is the call graph for this function:

PSIn TMIn::New ( const char *  CStr) [static]

Definition at line 565 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 569 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 573 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 582 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 409 of file fl.h.

References BfC, and TSBase::Cs.

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

Member Data Documentation

char* TMIn::Bf [private]

Definition at line 386 of file fl.h.

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

int TMIn::BfC [private]

Definition at line 387 of file fl.h.

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

int TMIn::BfL [private]

Definition at line 387 of file fl.h.

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


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