|
SNAP Library 2.0, User Reference
2013-05-13 16:33:57
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <fl.h>
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 &) | |
| TFRnd & | operator= (const TFRnd &) |
Private Attributes | |
| TCRef | CRef |
| TFileId | FileId |
| TSStr | FNm |
| bool | RecAct |
| int | HdLen |
| int | RecLen |
Friends | |
| class | TPt< TFRnd > |
| 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 759 of file fl.cpp.
: FileId(NULL), FNm(_FNm.CStr()), RecAct(false), HdLen(_HdLen), RecLen(_RecLen){ RecAct=(HdLen>=0)&&(RecLen>0); switch (FAccess){ case faCreate: FileId=fopen(FNm.CStr(), "w+b"); break; case faUpdate: FileId=fopen(FNm.CStr(), "r+b"); break; case faAppend: FileId=fopen(FNm.CStr(), "r+b"); if (FileId!=NULL){fseek(FileId, SEEK_END, 0);} break; case faRdOnly: FileId=fopen(FNm.CStr(), "rb"); break; default: Fail; } if ((FileId==NULL)&&(CreateIfNo)){ FileId=fopen(FNm.CStr(), "w+b");} EAssertR(FileId!=NULL, "Can not open file '"+_FNm+"'."); }
| TFRnd::~TFRnd | ( | ) |
| bool TFRnd::Empty | ( | ) | [inline] |
| bool TFRnd::Eof | ( | ) | [inline] |
| void TFRnd::Flush | ( | ) |
| void TFRnd::GetBf | ( | void * | Bf, |
| const TSize & | BfL | ||
| ) |
| char TFRnd::GetCh | ( | ) | [inline] |
| TCs TFRnd::GetCs | ( | ) | [inline] |
| TFAccess TFRnd::GetFAccessFromStr | ( | const TStr & | Str | ) | [static] |
Definition at line 910 of file fl.cpp.
{
TStr UcStr=Str.GetUc();
if (UcStr=="CREATE"){return faCreate;}
if (UcStr=="UPDATE"){return faUpdate;}
if (UcStr=="APPEND"){return faAppend;}
if (UcStr=="READONLY"){return faRdOnly;}
if (UcStr=="RESTORE"){return faRestore;}
if (UcStr=="NEW"){return faCreate;}
if (UcStr=="CONT"){return faUpdate;}
if (UcStr=="CONTINUE"){return faUpdate;}
if (UcStr=="REST"){return faRestore;}
if (UcStr=="RESTORE"){return faRestore;}
return faUndef;
}
| int TFRnd::GetFLen | ( | ) |
| int TFRnd::GetFPos | ( | ) |
| void TFRnd::GetHd | ( | void * | Hd | ) | [inline] |
| int TFRnd::GetInt | ( | ) | [inline] |
| void TFRnd::GetRec | ( | void * | Rec, |
| const int & | RecN = -1 |
||
| ) | [inline] |
| int TFRnd::GetRecN | ( | ) |
| int TFRnd::GetRecs | ( | ) |
| PSIn TFRnd::GetSIn | ( | const int & | SInLen, |
| TCs & | Cs | ||
| ) |
| TStr TFRnd::GetStr | ( | const int & | StrLen | ) |
| TStr TFRnd::GetStr | ( | const int & | MxStrLen, |
| bool & | IsOk | ||
| ) |
| TStr TFRnd::GetStrFromFAccess | ( | const TFAccess & | FAccess | ) | [static] |
| uchar TFRnd::GetUCh | ( | ) | [inline] |
| uint TFRnd::GetUInt | ( | ) | [inline] |
| void TFRnd::MoveFPos | ( | const int & | DFPos | ) |
| static PFRnd TFRnd::New | ( | const TStr & | FNm, |
| const TFAccess & | FAccess, | ||
| const bool & | CreateIfNo = true, |
||
| const int & | HdLen = -1, |
||
| const int & | RecLen = -1 |
||
| ) | [inline, static] |
| void TFRnd::PutBf | ( | const void * | Bf, |
| const TSize & | BfL | ||
| ) |
| void TFRnd::PutCh | ( | const char & | Ch | ) | [inline] |
| void TFRnd::PutCh | ( | const char & | Ch, |
| const int & | Chs | ||
| ) |
| void TFRnd::PutCs | ( | const TCs & | Cs | ) | [inline] |
| void TFRnd::PutHd | ( | const void * | Hd | ) | [inline] |
| void TFRnd::PutInt | ( | const int & | Int | ) | [inline] |
| void TFRnd::PutRec | ( | const void * | Rec, |
| const int & | RecN = -1 |
||
| ) | [inline] |
| void TFRnd::PutSIn | ( | const PSIn & | SIn, |
| TCs & | Cs | ||
| ) |
Definition at line 882 of file fl.cpp.
{
int BfL=SIn->Len();
char* Bf=new char[BfL];
SIn->GetBf(Bf, BfL);
Cs=TCs::GetCsFromBf(Bf, BfL);
PutBf(Bf, BfL);
delete[] Bf;
}
| void TFRnd::PutStr | ( | const TStr & | Str | ) |
| void TFRnd::PutUCh | ( | const uchar & | UCh | ) | [inline] |
| void TFRnd::PutUInt | ( | const uint & | UInt | ) | [inline] |
| void TFRnd::RefreshFPos | ( | ) | [private] |
| void TFRnd::SetFPos | ( | const int & | FPos | ) |
| void TFRnd::SetHdRecLen | ( | const int & | _HdLen, |
| const int & | _RecLen | ||
| ) | [inline] |
| void TFRnd::SetRecN | ( | const int & | RecN | ) |
TCRef TFRnd::CRef [private] |
TFileId TFRnd::FileId [private] |
TSStr TFRnd::FNm [private] |
int TFRnd::HdLen [private] |
bool TFRnd::RecAct [private] |
int TFRnd::RecLen [private] |