SNAP Library, User Reference  2012-10-15 15:06:59
SNAP, a general purpose network analysis and graph mining library
 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 ()
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 377 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 437 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 446 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 452 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 457 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 462 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 394 of file fl.h.

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

Member Function Documentation

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

Implements TSIn.

Definition at line 396 of file fl.h.

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

Implements TSIn.

Definition at line 489 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 403 of file fl.h.

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

Implements TSIn.

Definition at line 479 of file fl.cpp.

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

Implements TSIn.

Definition at line 397 of file fl.h.

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

Definition at line 467 of file fl.cpp.

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

Definition at line 471 of file fl.cpp.

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

Definition at line 475 of file fl.cpp.

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

Implements TSIn.

Definition at line 484 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 401 of file fl.h.

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

Member Data Documentation

char* TMIn::Bf [private]

Definition at line 379 of file fl.h.

int TMIn::BfC [private]

Definition at line 380 of file fl.h.

int TMIn::BfL [private]

Definition at line 380 of file fl.h.


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