SNAP Library 2.4, Developer Reference  2015-05-11 19:40:56
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TFRnd Class Reference

#include <fl.h>

Collaboration diagram for TFRnd:

Public Member Functions

 TFRnd (const TStr &_FNm, const TFAccess &FAccess, const bool &CreateIfNo=true, const int &_HdLen=-1, const int &_RecLen=-1)
 
 ~TFRnd ()
 
TStr GetFNm () const
 
void SetHdRecLen (const int &_HdLen, const int &_RecLen)
 
void SetFPos (const int &FPos)
 
void MoveFPos (const int &DFPos)
 
int GetFPos ()
 
int GetFLen ()
 
bool Empty ()
 
bool Eof ()
 
void SetRecN (const int &RecN)
 
int GetRecN ()
 
int GetRecs ()
 
void GetBf (void *Bf, const TSize &BfL)
 
void PutBf (const void *Bf, const TSize &BfL)
 
void Flush ()
 
void GetHd (void *Hd)
 
void PutHd (const void *Hd)
 
void GetRec (void *Rec, const int &RecN=-1)
 
void PutRec (const void *Rec, const int &RecN=-1)
 
void PutCs (const TCs &Cs)
 
TCs GetCs ()
 
void PutCh (const char &Ch)
 
void PutCh (const char &Ch, const int &Chs)
 
char GetCh ()
 
void PutUCh (const uchar &UCh)
 
uchar GetUCh ()
 
void PutInt (const int &Int)
 
int GetInt ()
 
void PutUInt (const uint &UInt)
 
uint GetUInt ()
 
void PutStr (const TStr &Str)
 
TStr GetStr (const int &StrLen)
 
TStr GetStr (const int &MxStrLen, bool &IsOk)
 
void PutSIn (const PSIn &SIn, TCs &Cs)
 
PSIn GetSIn (const int &SInLen, TCs &Cs)
 

Static Public Member Functions

static PFRnd New (const TStr &FNm, const TFAccess &FAccess, const bool &CreateIfNo=true, const int &HdLen=-1, const int &RecLen=-1)
 
static TStr GetStrFromFAccess (const TFAccess &FAccess)
 
static TFAccess GetFAccessFromStr (const TStr &Str)
 

Private Member Functions

void RefreshFPos ()
 
 TFRnd (const TFRnd &)
 
TFRndoperator= (const TFRnd &)
 

Private Attributes

TCRef CRef
 
TFileId FileId
 
TSStr FNm
 
bool RecAct
 
int HdLen
 
int RecLen
 

Friends

class TPt< TFRnd >
 

Detailed Description

Definition at line 491 of file fl.h.

Constructor & Destructor Documentation

TFRnd::TFRnd ( const TFRnd )
private
TFRnd::TFRnd ( const TStr _FNm,
const TFAccess FAccess,
const bool &  CreateIfNo = true,
const int &  _HdLen = -1,
const int &  _RecLen = -1 
)

Definition at line 766 of file fl.cpp.

References TSStr::CStr(), EAssertR, faAppend, faCreate, Fail, faRdOnly, faUpdate, FileId, FNm, HdLen, RecAct, RecLen, and SEEK_END.

767  :
768  FileId(NULL), FNm(_FNm.CStr()),
769  RecAct(false), HdLen(_HdLen), RecLen(_RecLen){
770  RecAct=(HdLen>=0)&&(RecLen>0);
771  switch (FAccess){
772  case faCreate: FileId=fopen(FNm.CStr(), "w+b"); break;
773  case faUpdate: FileId=fopen(FNm.CStr(), "r+b"); break;
774  case faAppend: FileId=fopen(FNm.CStr(), "r+b");
775  if (FileId!=NULL){fseek(FileId, SEEK_END, 0);} break;
776  case faRdOnly: FileId=fopen(FNm.CStr(), "rb"); break;
777  default: Fail;
778  }
779  if ((FileId==NULL)&&(CreateIfNo)){
780  FileId=fopen(FNm.CStr(), "w+b");}
781  EAssertR(FileId!=NULL, "Can not open file '"+_FNm+"'.");
782 }
char * CStr()
Definition: bd.h:531
Definition: fl.h:347
#define SEEK_END
Definition: fl.cpp:754
bool RecAct
Definition: fl.h:495
#define Fail
Definition: bd.h:238
TFileId FileId
Definition: fl.h:493
Definition: fl.h:347
Definition: fl.h:347
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283
TSStr FNm
Definition: fl.h:494
int HdLen
Definition: fl.h:496
char * CStr()
Definition: dt.h:476
int RecLen
Definition: fl.h:496
Definition: fl.h:347

Here is the call graph for this function:

TFRnd::~TFRnd ( )

Definition at line 784 of file fl.cpp.

References EAssertR, FileId, and FNm.

784  {
785  EAssertR(fclose(FileId)==0, "Can not close file '"+TStr(FNm)+"'.");
786 }
TFileId FileId
Definition: fl.h:493
Definition: dt.h:412
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283
TSStr FNm
Definition: fl.h:494

Member Function Documentation

bool TFRnd::Empty ( )
inline

Definition at line 519 of file fl.h.

Referenced by TGBlobBs::TGBlobBs().

519 {return GetFLen()==0;}
int GetFLen()
Definition: fl.cpp:810

Here is the caller graph for this function:

bool TFRnd::Eof ( )
inline

Definition at line 520 of file fl.h.

520 {return GetFPos()==GetFLen();}
int GetFLen()
Definition: fl.cpp:810
int GetFPos()
Definition: fl.cpp:804
void TFRnd::Flush ( )

Definition at line 851 of file fl.cpp.

References EAssertR, FileId, and FNm.

Referenced by TGBlobBs::DelBlob(), TGBlobBs::PutBlob(), TGBlobBs::TGBlobBs(), and TGBlobBs::~TGBlobBs().

851  {
852  EAssertR(fflush(FileId)==0, "Can not flush file '"+TStr(FNm)+"'.");
853 }
TFileId FileId
Definition: fl.h:493
Definition: dt.h:412
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283
TSStr FNm
Definition: fl.h:494

Here is the caller graph for this function:

void TFRnd::GetBf ( void *  Bf,
const TSize BfL 
)

Definition at line 837 of file fl.cpp.

References EAssertR, FileId, FNm, and RefreshFPos().

Referenced by GetSIn(), and GetStr().

837  {
838  RefreshFPos();
839  EAssertR(
840  fread(Bf, 1, BfL, FileId)==BfL,
841  "Error reading file '"+TStr(FNm)+"'.");
842 }
TFileId FileId
Definition: fl.h:493
Definition: dt.h:412
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283
TSStr FNm
Definition: fl.h:494
void RefreshFPos()
Definition: fl.cpp:760

Here is the call graph for this function:

Here is the caller graph for this function:

char TFRnd::GetCh ( )
inline

Definition at line 543 of file fl.h.

Referenced by TBlobBs::AssertBlobState(), and TBlobBs::GetBlobState().

543 {char Ch; GetBf(&Ch, sizeof(Ch)); return Ch;}
void GetBf(void *Bf, const TSize &BfL)
Definition: fl.cpp:837

Here is the caller graph for this function:

TCs TFRnd::GetCs ( )
inline

Definition at line 540 of file fl.h.

Referenced by TGBlobBs::FNextBlobPt(), and TGBlobBs::GetBlob().

540 {TCs Cs; GetBf(&Cs, sizeof(Cs)); return Cs;}
Definition: fl.h:11
void GetBf(void *Bf, const TSize &BfL)
Definition: fl.cpp:837

Here is the caller graph for this function:

TFAccess TFRnd::GetFAccessFromStr ( const TStr Str)
static

Definition at line 917 of file fl.cpp.

References faAppend, faCreate, faRdOnly, faRestore, faUndef, faUpdate, and TStr::GetUc().

917  {
918  TStr UcStr=Str.GetUc();
919  if (UcStr=="CREATE"){return faCreate;}
920  if (UcStr=="UPDATE"){return faUpdate;}
921  if (UcStr=="APPEND"){return faAppend;}
922  if (UcStr=="READONLY"){return faRdOnly;}
923  if (UcStr=="RESTORE"){return faRestore;}
924 
925  if (UcStr=="NEW"){return faCreate;}
926  if (UcStr=="CONT"){return faUpdate;}
927  if (UcStr=="CONTINUE"){return faUpdate;}
928  if (UcStr=="REST"){return faRestore;}
929  if (UcStr=="RESTORE"){return faRestore;}
930  return faUndef;
931 }
Definition: fl.h:347
TStr GetUc() const
Definition: dt.h:493
Definition: fl.h:347
Definition: fl.h:347
Definition: fl.h:347
Definition: fl.h:347
Definition: dt.h:412
Definition: fl.h:347

Here is the call graph for this function:

int TFRnd::GetFLen ( )

Definition at line 810 of file fl.cpp.

References EAssertR, FileId, FNm, GetFPos(), SEEK_END, and SetFPos().

Referenced by TGBlobBs::FNextBlobPt(), GetRecs(), GetStr(), and TGBlobBs::PutBlob().

810  {
811  int FPos=GetFPos();
812  EAssertR(
813  fseek(FileId, 0, SEEK_END)==0,
814  "Error seeking into file '"+TStr(FNm)+"'.");
815  int FLen=GetFPos(); SetFPos(FPos); return FLen;
816 }
#define SEEK_END
Definition: fl.cpp:754
TFileId FileId
Definition: fl.h:493
void SetFPos(const int &FPos)
Definition: fl.cpp:792
Definition: dt.h:412
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283
TSStr FNm
Definition: fl.h:494
int GetFPos()
Definition: fl.cpp:804

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TFRnd::GetFNm ( ) const

Definition at line 788 of file fl.cpp.

References TSStr::CStr(), and FNm.

788  {
789  return FNm.CStr();
790 }
char * CStr()
Definition: bd.h:531
TSStr FNm
Definition: fl.h:494

Here is the call graph for this function:

int TFRnd::GetFPos ( )

Definition at line 804 of file fl.cpp.

References EAssertR, FileId, and FNm.

Referenced by TGBlobBs::DelBlob(), TGBlobBs::FNextBlobPt(), GetFLen(), GetRecN(), GetStr(), TGBlobBs::PutBlob(), and TGBlobBs::TGBlobBs().

804  {
805  int FPos= (int) ftell(FileId);
806  EAssertR(FPos!=-1, "Error seeking into file '"+TStr(FNm)+"'.");
807  return FPos;
808 }
TFileId FileId
Definition: fl.h:493
Definition: dt.h:412
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283
TSStr FNm
Definition: fl.h:494

Here is the caller graph for this function:

void TFRnd::GetHd ( void *  Hd)
inline

Definition at line 530 of file fl.h.

References IAssert.

Referenced by TFRec< THd, TRec >::GetHd().

530  {IAssert(RecAct);
531  int FPos=GetFPos(); SetFPos(0); GetBf(Hd, HdLen); SetFPos(FPos);}
#define IAssert(Cond)
Definition: bd.h:262
bool RecAct
Definition: fl.h:495
void SetFPos(const int &FPos)
Definition: fl.cpp:792
int HdLen
Definition: fl.h:496
int GetFPos()
Definition: fl.cpp:804
void GetBf(void *Bf, const TSize &BfL)
Definition: fl.cpp:837

Here is the caller graph for this function:

int TFRnd::GetInt ( )
inline

Definition at line 547 of file fl.h.

Referenced by TGBlobBs::DelBlob(), TGBlobBs::FNextBlobPt(), TGBlobBs::GetBlob(), TBlobBs::GetBlockLenV(), TBlobBs::GetFFreeBlobPtV(), TBlobBs::GetMxSegLen(), and TGBlobBs::PutBlob().

547 {int Int; GetBf(&Int, sizeof(Int)); return Int;}
void GetBf(void *Bf, const TSize &BfL)
Definition: fl.cpp:837

Here is the caller graph for this function:

void TFRnd::GetRec ( void *  Rec,
const int &  RecN = -1 
)
inline

Definition at line 534 of file fl.h.

References IAssert.

Referenced by TFRec< THd, TRec >::GetRec().

534  {
535  IAssert(RecAct); if (RecN!=-1){SetRecN(RecN);} GetBf(Rec, RecLen);}
#define IAssert(Cond)
Definition: bd.h:262
bool RecAct
Definition: fl.h:495
void SetRecN(const int &RecN)
Definition: fl.cpp:818
void GetBf(void *Bf, const TSize &BfL)
Definition: fl.cpp:837
int RecLen
Definition: fl.h:496

Here is the caller graph for this function:

int TFRnd::GetRecN ( )

Definition at line 823 of file fl.cpp.

References EAssertR, FNm, GetFPos(), HdLen, IAssert, RecAct, and RecLen.

Referenced by TFRec< THd, TRec >::GetRecN().

823  {
824  IAssert(RecAct);
825  int FPos=GetFPos()-HdLen;
826  EAssertR(FPos%RecLen==0, "Invalid position in file'"+TStr(FNm)+"'.");
827  return FPos/RecLen;
828 }
#define IAssert(Cond)
Definition: bd.h:262
bool RecAct
Definition: fl.h:495
Definition: dt.h:412
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283
TSStr FNm
Definition: fl.h:494
int HdLen
Definition: fl.h:496
int GetFPos()
Definition: fl.cpp:804
int RecLen
Definition: fl.h:496

Here is the call graph for this function:

Here is the caller graph for this function:

int TFRnd::GetRecs ( )

Definition at line 830 of file fl.cpp.

References EAssertR, FNm, GetFLen(), HdLen, IAssert, RecAct, and RecLen.

Referenced by TFRec< THd, TRec >::GetRecs().

830  {
831  IAssert(RecAct);
832  int FLen=GetFLen()-HdLen;
833  EAssertR(FLen%RecLen==0, "Invalid length of file'"+TStr(FNm)+"'.");
834  return FLen/RecLen;
835 }
#define IAssert(Cond)
Definition: bd.h:262
bool RecAct
Definition: fl.h:495
int GetFLen()
Definition: fl.cpp:810
Definition: dt.h:412
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283
TSStr FNm
Definition: fl.h:494
int HdLen
Definition: fl.h:496
int RecLen
Definition: fl.h:496

Here is the call graph for this function:

Here is the caller graph for this function:

PSIn TFRnd::GetSIn ( const int &  SInLen,
TCs Cs 
)

Definition at line 898 of file fl.cpp.

References GetBf(), and TCs::GetCsFromBf().

Referenced by TGBlobBs::FNextBlobPt(), and TGBlobBs::GetBlob().

898  {
899  char* Bf=new char[BfL];
900  GetBf(Bf, BfL);
901  Cs=TCs::GetCsFromBf(Bf, BfL);
902  PSIn SIn=PSIn(new TMIn(Bf, BfL, true));
903  return SIn;
904 }
Definition: fl.h:384
static TCs GetCsFromBf(char *Bf, const int &BfL)
Definition: fl.cpp:12
Definition: bd.h:196
TPt< TSIn > PSIn
Definition: fl.h:119
void GetBf(void *Bf, const TSize &BfL)
Definition: fl.cpp:837

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TFRnd::GetStr ( const int &  StrLen)

Definition at line 879 of file fl.cpp.

References EAssertR, FNm, GetBf(), and TCh::NullCh.

Referenced by TBlobBs::AssertBlobBsStateStr(), TBlobBs::AssertVersionStr(), TBlobBs::GetBlockLenV(), TBlobBs::GetFFreeBlobPtV(), and TBlobBs::GetMxSegLen().

879  {
880  TStr Str;
881  char* CStr=new char[StrLen+1];
882  GetBf(CStr, StrLen+1);
883  EAssertR(CStr[StrLen+1-1]==TCh::NullCh, "Error reading file '"+TStr(FNm)+"'.");
884  Str=CStr;
885  delete[] CStr;
886  return Str;
887 }
static const char NullCh
Definition: dt.h:943
Definition: dt.h:412
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283
TSStr FNm
Definition: fl.h:494
void GetBf(void *Bf, const TSize &BfL)
Definition: fl.cpp:837

Here is the call graph for this function:

Here is the caller graph for this function:

TStr TFRnd::GetStr ( const int &  MxStrLen,
bool &  IsOk 
)

Definition at line 868 of file fl.cpp.

References GetBf(), GetFLen(), GetFPos(), and TCh::NullCh.

868  {
869  IsOk=false; TStr Str;
870  if (GetFPos()+StrLen+1<=GetFLen()){
871  char* CStr=new char[StrLen+1];
872  GetBf(CStr, StrLen+1);
873  if (CStr[StrLen+1-1]==TCh::NullCh){IsOk=true; Str=CStr;}
874  delete[] CStr;
875  }
876  return Str;
877 }
int GetFLen()
Definition: fl.cpp:810
static const char NullCh
Definition: dt.h:943
Definition: dt.h:412
int GetFPos()
Definition: fl.cpp:804
void GetBf(void *Bf, const TSize &BfL)
Definition: fl.cpp:837

Here is the call graph for this function:

TStr TFRnd::GetStrFromFAccess ( const TFAccess FAccess)
static

Definition at line 906 of file fl.cpp.

References faAppend, faCreate, Fail, faRdOnly, faRestore, and faUpdate.

906  {
907  switch (FAccess){
908  case faCreate: return "Create";
909  case faUpdate: return "Update";
910  case faAppend: return "Append";
911  case faRdOnly: return "ReadOnly";
912  case faRestore: return "Restore";
913  default: Fail; return TStr();
914  }
915 }
Definition: fl.h:347
#define Fail
Definition: bd.h:238
Definition: fl.h:347
Definition: fl.h:347
Definition: fl.h:347
Definition: dt.h:412
Definition: fl.h:347
uchar TFRnd::GetUCh ( )
inline

Definition at line 545 of file fl.h.

Referenced by TBlobPt::Load().

545 {uchar UCh; GetBf(&UCh, sizeof(UCh)); return UCh;}
unsigned char uchar
Definition: bd.h:10
void GetBf(void *Bf, const TSize &BfL)
Definition: fl.cpp:837

Here is the caller graph for this function:

uint TFRnd::GetUInt ( )
inline

Definition at line 549 of file fl.h.

Referenced by TBlobBs::AssertBlobTag(), TBlobPt::Load(), and TBlobPt::LoadAddr().

549 {uint UInt; GetBf(&UInt, sizeof(UInt)); return UInt;}
unsigned int uint
Definition: bd.h:11
void GetBf(void *Bf, const TSize &BfL)
Definition: fl.cpp:837

Here is the caller graph for this function:

void TFRnd::MoveFPos ( const int &  DFPos)

Definition at line 798 of file fl.cpp.

References EAssertR, FileId, FNm, and SEEK_CUR.

Referenced by TGBlobBs::FNextBlobPt(), and TGBlobBs::GetBlob().

798  {
799  EAssertR(
800  fseek(FileId, DFPos, SEEK_CUR)==0,
801  "Error seeking into file '"+TStr(FNm)+"'.");
802 }
#define SEEK_CUR
Definition: fl.cpp:753
TFileId FileId
Definition: fl.h:493
Definition: dt.h:412
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283
TSStr FNm
Definition: fl.h:494

Here is the caller graph for this function:

static PFRnd TFRnd::New ( const TStr FNm,
const TFAccess FAccess,
const bool &  CreateIfNo = true,
const int &  HdLen = -1,
const int &  RecLen = -1 
)
inlinestatic

Definition at line 505 of file fl.h.

Referenced by TGBlobBs::TGBlobBs().

507  {
508  return new TFRnd(FNm, FAccess, CreateIfNo, HdLen, RecLen);}
TFRnd(const TFRnd &)
int HdLen
Definition: fl.h:496
int RecLen
Definition: fl.h:496

Here is the caller graph for this function:

TFRnd& TFRnd::operator= ( const TFRnd )
private
void TFRnd::PutBf ( const void *  Bf,
const TSize BfL 
)

Definition at line 844 of file fl.cpp.

References EAssertR, FileId, FNm, and RefreshFPos().

Referenced by PutCh(), PutSIn(), and PutStr().

844  {
845  RefreshFPos();
846  EAssertR(
847  fwrite(Bf, 1, BfL, FileId)==BfL,
848  "Error writting to the file '"+TStr(FNm)+"'.");
849 }
TFileId FileId
Definition: fl.h:493
Definition: dt.h:412
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283
TSStr FNm
Definition: fl.h:494
void RefreshFPos()
Definition: fl.cpp:760

Here is the call graph for this function:

Here is the caller graph for this function:

void TFRnd::PutCh ( const char &  Ch)
inline

Definition at line 541 of file fl.h.

Referenced by TGBlobBs::DelBlob(), TGBlobBs::PutBlob(), and TBlobBs::PutBlobState().

541 {PutBf(&Ch, sizeof(Ch));}
void PutBf(const void *Bf, const TSize &BfL)
Definition: fl.cpp:844

Here is the caller graph for this function:

void TFRnd::PutCh ( const char &  Ch,
const int &  Chs 
)

Definition at line 855 of file fl.cpp.

References PutBf().

855  {
856  if (Chs>0){
857  char* CStr=new char[Chs];
858  for (int ChN=0; ChN<Chs; ChN++){CStr[ChN]=Ch;}
859  PutBf(CStr, Chs);
860  delete[] CStr;
861  }
862 }
void PutBf(const void *Bf, const TSize &BfL)
Definition: fl.cpp:844

Here is the call graph for this function:

void TFRnd::PutCs ( const TCs Cs)
inline

Definition at line 539 of file fl.h.

Referenced by TGBlobBs::PutBlob().

539 {PutBf(&Cs, sizeof(Cs));}
void PutBf(const void *Bf, const TSize &BfL)
Definition: fl.cpp:844

Here is the caller graph for this function:

void TFRnd::PutHd ( const void *  Hd)
inline

Definition at line 532 of file fl.h.

References IAssert.

Referenced by TFRec< THd, TRec >::PutHd().

532  {IAssert(RecAct);
533  int FPos=GetFPos(); SetFPos(0); PutBf(Hd, HdLen); SetFPos(FPos);}
#define IAssert(Cond)
Definition: bd.h:262
bool RecAct
Definition: fl.h:495
void SetFPos(const int &FPos)
Definition: fl.cpp:792
int HdLen
Definition: fl.h:496
void PutBf(const void *Bf, const TSize &BfL)
Definition: fl.cpp:844
int GetFPos()
Definition: fl.cpp:804

Here is the caller graph for this function:

void TFRnd::PutInt ( const int &  Int)
inline

Definition at line 546 of file fl.h.

Referenced by TGBlobBs::PutBlob(), TBlobBs::PutBlockLenV(), TBlobBs::PutFFreeBlobPtV(), and TBlobBs::PutMxSegLen().

546 {PutBf(&Int, sizeof(Int));}
void PutBf(const void *Bf, const TSize &BfL)
Definition: fl.cpp:844

Here is the caller graph for this function:

void TFRnd::PutRec ( const void *  Rec,
const int &  RecN = -1 
)
inline

Definition at line 536 of file fl.h.

References IAssert.

Referenced by TFRec< THd, TRec >::PutRec().

536  {
537  IAssert(RecAct); if (RecN!=-1){SetRecN(RecN);} PutBf(Rec, RecLen);}
#define IAssert(Cond)
Definition: bd.h:262
bool RecAct
Definition: fl.h:495
void SetRecN(const int &RecN)
Definition: fl.cpp:818
void PutBf(const void *Bf, const TSize &BfL)
Definition: fl.cpp:844
int RecLen
Definition: fl.h:496

Here is the caller graph for this function:

void TFRnd::PutSIn ( const PSIn SIn,
TCs Cs 
)

Definition at line 889 of file fl.cpp.

References TSIn::GetBf(), TCs::GetCsFromBf(), TSIn::Len(), and PutBf().

Referenced by TGBlobBs::PutBlob().

889  {
890  int BfL=SIn->Len();
891  char* Bf=new char[BfL];
892  SIn->GetBf(Bf, BfL);
893  Cs=TCs::GetCsFromBf(Bf, BfL);
894  PutBf(Bf, BfL);
895  delete[] Bf;
896 }
static TCs GetCsFromBf(char *Bf, const int &BfL)
Definition: fl.cpp:12
void PutBf(const void *Bf, const TSize &BfL)
Definition: fl.cpp:844

Here is the call graph for this function:

Here is the caller graph for this function:

void TFRnd::PutStr ( const TStr Str)

Definition at line 864 of file fl.cpp.

References TStr::CStr(), TStr::Len(), and PutBf().

Referenced by TBlobBs::PutBlobBsStateStr(), TBlobBs::PutBlockLenV(), TBlobBs::PutFFreeBlobPtV(), TBlobBs::PutMxSegLen(), and TBlobBs::PutVersionStr().

864  {
865  PutBf(Str.CStr(), Str.Len()+1);
866 }
int Len() const
Definition: dt.h:487
void PutBf(const void *Bf, const TSize &BfL)
Definition: fl.cpp:844
char * CStr()
Definition: dt.h:476

Here is the call graph for this function:

Here is the caller graph for this function:

void TFRnd::PutUCh ( const uchar UCh)
inline

Definition at line 544 of file fl.h.

Referenced by TBlobPt::Save().

544 {PutBf(&UCh, sizeof(UCh));}
void PutBf(const void *Bf, const TSize &BfL)
Definition: fl.cpp:844

Here is the caller graph for this function:

void TFRnd::PutUInt ( const uint UInt)
inline

Definition at line 548 of file fl.h.

Referenced by TBlobBs::PutBlobTag(), TBlobPt::Save(), and TBlobPt::SaveAddr().

548 {PutBf(&UInt, sizeof(UInt));}
void PutBf(const void *Bf, const TSize &BfL)
Definition: fl.cpp:844

Here is the caller graph for this function:

void TFRnd::RefreshFPos ( )
private

Definition at line 760 of file fl.cpp.

References EAssertR, FileId, FNm, and SEEK_CUR.

Referenced by GetBf(), and PutBf().

760  {
761  EAssertR(
762  fseek(FileId, 0, SEEK_CUR)==0,
763  "Error seeking into file '"+TStr(FNm)+"'.");
764 }
#define SEEK_CUR
Definition: fl.cpp:753
TFileId FileId
Definition: fl.h:493
Definition: dt.h:412
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283
TSStr FNm
Definition: fl.h:494

Here is the caller graph for this function:

void TFRnd::SetFPos ( const int &  FPos)

Definition at line 792 of file fl.cpp.

References EAssertR, FileId, FNm, and SEEK_SET.

Referenced by TGBlobBs::DelBlob(), TGBlobBs::FNextBlobPt(), TGBlobBs::GetBlob(), GetFLen(), TGBlobBs::PutBlob(), SetRecN(), TGBlobBs::TGBlobBs(), and TGBlobBs::~TGBlobBs().

792  {
793  EAssertR(
794  fseek(FileId, FPos, SEEK_SET)==0,
795  "Error seeking into file '"+TStr(FNm)+"'.");
796 }
TFileId FileId
Definition: fl.h:493
#define SEEK_SET
Definition: fl.cpp:755
Definition: dt.h:412
#define EAssertR(Cond, MsgStr)
Definition: bd.h:283
TSStr FNm
Definition: fl.h:494

Here is the caller graph for this function:

void TFRnd::SetHdRecLen ( const int &  _HdLen,
const int &  _RecLen 
)
inline

Definition at line 512 of file fl.h.

512  {
513  HdLen=_HdLen; RecLen=_RecLen; RecAct=(HdLen>=0)&&(RecLen>0);}
bool RecAct
Definition: fl.h:495
int HdLen
Definition: fl.h:496
int RecLen
Definition: fl.h:496
void TFRnd::SetRecN ( const int &  RecN)

Definition at line 818 of file fl.cpp.

References HdLen, IAssert, RecAct, RecLen, and SetFPos().

Referenced by TFRec< THd, TRec >::SetRecN().

818  {
819  IAssert(RecAct);
820  SetFPos(HdLen+RecN*RecLen);
821 }
#define IAssert(Cond)
Definition: bd.h:262
bool RecAct
Definition: fl.h:495
void SetFPos(const int &FPos)
Definition: fl.cpp:792
int HdLen
Definition: fl.h:496
int RecLen
Definition: fl.h:496

Here is the call graph for this function:

Here is the caller graph for this function:

Friends And Related Function Documentation

friend class TPt< TFRnd >
friend

Definition at line 491 of file fl.h.

Member Data Documentation

TCRef TFRnd::CRef
private

Definition at line 491 of file fl.h.

TFileId TFRnd::FileId
private

Definition at line 493 of file fl.h.

Referenced by Flush(), GetBf(), GetFLen(), GetFPos(), MoveFPos(), PutBf(), RefreshFPos(), SetFPos(), TFRnd(), and ~TFRnd().

TSStr TFRnd::FNm
private
int TFRnd::HdLen
private

Definition at line 496 of file fl.h.

Referenced by GetRecN(), GetRecs(), SetRecN(), and TFRnd().

bool TFRnd::RecAct
private

Definition at line 495 of file fl.h.

Referenced by GetRecN(), GetRecs(), SetRecN(), and TFRnd().

int TFRnd::RecLen
private

Definition at line 496 of file fl.h.

Referenced by GetRecN(), GetRecs(), SetRecN(), and TFRnd().


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