SNAP Library, Developer Reference
2012-10-15 15:06:59
SNAP, a general purpose network analysis and graph mining library
|
Go to the source code of this file.
Classes | |
class | TCs |
class | TSOutMnp |
class | TSBase |
class | TSIn |
class | TSOut |
class | TSInOut |
class | TStdIn |
class | TStdOut |
class | TFIn |
class | TFOut |
class | TFInOut |
class | TMIn |
class | TMOut |
class | TChRet |
class | TLnRet |
class | TFile |
Typedefs | |
typedef TPt< TSIn > | PSIn |
typedef TPt< TSOut > | PSOut |
typedef TPt< TSInOut > | PSInOut |
Enumerations | |
enum | TFAccess { faUndef, faCreate, faUpdate, faAppend, faRdOnly, faRestore } |
Functions | |
template<class T > | |
TSIn & | operator>> (TSIn &SIn, T &Val) |
template<class T > | |
TSOut & | operator<< (TSOut &SOut, const T &Val) |
void | RefreshFPos () |
TFRnd (const TFRnd &) | |
TFRnd & | operator= (const TFRnd &) |
TFRnd (const TStr &_FNm, const TFAccess &FAccess, const bool &CreateIfNo=true, const int &_HdLen=-1, const int &_RecLen=-1) | |
static PFRnd | New (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 TStr | GetStrFromFAccess (const TFAccess &FAccess) |
static TFAccess | GetFAccessFromStr (const TStr &Str) |
Variables | |
ClassTP(TFRnd, PFRnd) private TSStr | FNm |
bool | RecAct |
int | HdLen |
int | RecLen |
enum TFAccess |
bool Empty | ( | ) |
bool Eof | ( | ) |
void Flush | ( | ) |
Referenced by TCache< TKey, TDat, THashFunc >::FlushAndClr().
char GetCh | ( | ) |
TFAccess TFRnd::GetFAccessFromStr | ( | const TStr & | Str | ) | [static] |
Definition at line 795 of file fl.cpp.
References faAppend, faCreate, faRdOnly, faRestore, faUndef, faUpdate, and TStr::GetUc().
{ 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 GetFPos | ( | ) |
void GetHd | ( | void * | Hd | ) |
int GetInt | ( | ) |
void GetRec | ( | void * | Rec, |
const int & | RecN = -1 |
||
) |
int GetRecN | ( | ) |
TStr TFRnd::GetStrFromFAccess | ( | const TFAccess & | FAccess | ) | [static] |
void TFRnd::MoveFPos | ( | const int & | DFPos | ) |
Definition at line 211 of file fl.h.
References TSOut::Save().
{
Val.Save(SOut); return SOut;
}
Definition at line 119 of file fl.h.
References TSIn::Load().
{
Val.Load(SIn); return SIn;
}
void PutCh | ( | const char & | Ch | ) |
void PutCh | ( | const char & | Ch, |
const int & | Chs | ||
) |
void PutHd | ( | const void * | Hd | ) |
void PutInt | ( | const int & | Int | ) |
void PutRec | ( | const void * | Rec, |
const int & | RecN = -1 |
||
) |
void TFRnd::PutSIn | ( | const PSIn & | SIn, |
TCs & | Cs | ||
) |
Definition at line 767 of file fl.cpp.
References Bf, TSIn::GetBf(), TCs::GetCsFromBf(), TSIn::Len(), and PutBf().
{ 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::RefreshFPos | ( | ) | [private] |
void SetFPos | ( | const int & | FPos | ) |
void SetHdRecLen | ( | const int & | _HdLen, |
const int & | _RecLen | ||
) |
void SetRecN | ( | const int & | RecN | ) |
TFRnd::TFRnd | ( | const TStr & | _FNm, |
const TFAccess & | FAccess, | ||
const bool & | CreateIfNo = true , |
||
const int & | _HdLen = -1 , |
||
const int & | _RecLen = -1 |
||
) |
Definition at line 644 of file fl.cpp.
References TSStr::CStr(), EAssertR, faAppend, faCreate, Fail, faRdOnly, faUpdate, FNm, HdLen, RecAct, RecLen, and SEEK_END.
: 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 | ( | ) |
Definition at line 481 of file fl.h.
Referenced by TFile::DelWc(), TGHash< TDat >::DrawGViz(), TStr::GetFNmStr(), GetFNmV(), TFile::GetUniqueFNm(), MoveFPos(), Next(), TStr::PutFBaseIfEmpty(), TStr::PutFExtIfEmpty(), RefreshFPos(), SaveToErrLog(), TFRnd(), TNcpGraphsBase::TNcpGraphsBase(), and ~TFRnd().
int HdLen |
bool RecAct |