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

#include <fl.h>

Inherits TSIn.

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]
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.

                                                              :
  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.

                   :
  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();}
}
TMIn::TMIn ( const char *  CStr)

Definition at line 546 of file fl.cpp.

                          :
  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.

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

Definition at line 556 of file fl.cpp.

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

Definition at line 402 of file fl.h.

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

Member Function Documentation

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

Implements TSIn.

Definition at line 404 of file fl.h.

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

Implements TSIn.

Definition at line 587 of file fl.cpp.

                                                 {
  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.

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

Implements TSIn.

Definition at line 577 of file fl.cpp.

                {
  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.

                                 {
  // not implemented
  FailR(TStr::Fmt("TMIn::GetNextLnBf: not implemented").CStr());
  return false;
}
int TMIn::Len ( ) const [inline, virtual]

Implements TSIn.

Definition at line 405 of file fl.h.

{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.

                                                                  {
  return PSIn(new TMIn(_Bf, _BfL, TakeBf));
}
PSIn TMIn::New ( const char *  CStr) [static]

Definition at line 565 of file fl.cpp.

                              {
  return PSIn(new TMIn(CStr));
}
PSIn TMIn::New ( const TStr Str) [static]

Definition at line 569 of file fl.cpp.

                             {
  return PSIn(new TMIn(Str));
}
PSIn TMIn::New ( const TChA ChA) [static]

Definition at line 573 of file fl.cpp.

                             {
  return PSIn(new TMIn(ChA));
}
TMIn& TMIn::operator= ( const TMIn ) [private]
char TMIn::PeekCh ( ) [virtual]

Implements TSIn.

Definition at line 582 of file fl.cpp.

                 {
  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.

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

Member Data Documentation

char* TMIn::Bf [private]

Definition at line 386 of file fl.h.

int TMIn::BfC [private]

Definition at line 387 of file fl.h.

int TMIn::BfL [private]

Definition at line 387 of file fl.h.


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