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
xfl.h File Reference

Go to the source code of this file.

Classes

class  TDir
class  TFPathNotify

Functions

 TFFileDesc ()
static PFFileDesc New ()
 ~TFFileDesc ()
 TFFileDesc (TSIn &)
static PFFileDesc Load (TSIn &SIn)
void Save (TSOut &)
TFFileDescoperator= (const TFFileDesc &)
TStr GetFBase () const
bool IsDir () const
 UndefDefaultCopyAssign (TFFile)
 TFFile (const TStr &_FNmWc, const bool &_RecurseP=false)
 TFFile (const TStr &_FPath, const TStr &_FExt, const bool &_RecurseP=false)
 TFFile (const TStrV &_FPathV, const TStrV &_FExtV, const TStr &_FBaseWc, const bool &_RecurseP)
static PFFile New (const TStr &FNmWc, const bool &RecurseP)
static PFFile New (const TStrV &FPathV, const TStrV &FExtV, const TStr FBaseWc, const bool &RecurseP)
static PFFile New (const TStr &FPath, const TStr &FExt, const bool &RecurseP)
 ~TFFile ()
 TFFile (TSIn &)
bool Next (TStr &FNm)
bool Next ()
TStr GetFNm () const
int GetFNmN () const
static void GetFNmV (const TStr &FPath, const TStrV &FExtV, const bool &RecurseP, TStrV &FNmV)

Variables

ClassTP(TFFileDesc, PFFileDesc)
public dirent * 
DirEnt
ClassTP(TFFile, PFFile)
private TStr 
FBaseWc
bool CsImpP
bool RecurseP
int FPathN
PFFileDesc FFileDesc
PFFile SubFFile
TStr CurFNm
int CurFNmN

Function Documentation

TStr GetFBase ( ) const
TStr GetFNm ( ) const

Definition at line 59 of file xfl.h.

{return CurFNm;}
int GetFNmN ( ) const

Definition at line 60 of file xfl.h.

{return CurFNmN;}
void TFFile::GetFNmV ( const TStr FPath,
const TStrV FExtV,
const bool &  RecurseP,
TStrV FNmV 
) [static]

Definition at line 215 of file xfl.cpp.

                                                                          {
  // prepare file-directory traversal
  TStrV FPathV; FPathV.Add(FPath);
  TFFile FFile(FPathV, FExtV, "", RecurseP); TStr FNm;
  // traverse directory
  FNmV.Clr();
  while (FFile.Next(FNm)){
    FNmV.Add(FNm);
  }
}
bool IsDir ( ) const

Definition at line 65 of file xfl.h.

                     {
   return FFileDesc->IsDir();}
static PFFile Load ( TSIn SIn) [static]

Definition at line 17 of file xfl.h.

{return new TFFileDesc(SIn);}
static PFFileDesc New ( ) [static]

Definition at line 14 of file xfl.h.

{return PFFileDesc(new TFFileDesc());}
static PFFile New ( const TStr FNmWc,
const bool &  RecurseP 
) [static]

Definition at line 45 of file xfl.h.

                                                            {
    return PFFile(new TFFile(FNmWc, RecurseP));}
static PFFile New ( const TStrV FPathV,
const TStrV FExtV,
const TStr  FBaseWc,
const bool &  RecurseP 
) [static]

Definition at line 47 of file xfl.h.

                                            {
    return PFFile(new TFFile(FPathV, FExtV, FBaseWc, RecurseP));}
static PFFile New ( const TStr FPath,
const TStr FExt,
const bool &  RecurseP 
) [static]

Definition at line 50 of file xfl.h.

                                                                              {
    return PFFile(new TFFile(FPath, FExt, RecurseP));}
bool Next ( TStr FNm)
bool Next ( )

Definition at line 58 of file xfl.h.

{TStr FNm; return Next(FNm);}
TFFileDesc& operator= ( const TFFileDesc )

Definition at line 20 of file xfl.h.

{Fail; return *this;}
void Save ( TSOut )

Definition at line 18 of file xfl.h.

{Fail;}
TFFile::TFFile ( const TStr _FNmWc,
const bool &  _RecurseP = false 
)

Definition at line 37 of file xfl.cpp.

                                                      :
  FPathV(), FExtV(), FBaseWc(),
  CsImpP(false), RecurseP(_RecurseP), FPathN(0-1),
  FFileDesc(TFFileDesc::New()), SubFFile(), CurFNm(), CurFNmN(0-1){
  // prepare file-base-name wild-card
  FBaseWc=FNmWc.GetFBase(); if (!CsImpP){FBaseWc.ToUc();}
  // get & assign file-name
  TStr FPath=FNmWc.GetFPath();
  FPathV.Add(TStr::GetNrFPath(FPath));
}
TFFile::TFFile ( const TStr _FPath,
const TStr _FExt,
const bool &  _RecurseP = false 
)

Definition at line 48 of file xfl.cpp.

                                                                          :
  FPathV(), FExtV(), FBaseWc(),
  CsImpP(false), RecurseP(_RecurseP), FPathN(0-1),
  FFileDesc(TFFileDesc::New()), SubFFile(), CurFNm(), CurFNmN(0-1){
  FPathV.Add(TStr::GetNrFPath(_FPath));
  if (!_FExt.Empty()){
    FExtV.Add(TStr::GetNrFExt(_FExt));
    if (!CsImpP){FExtV.Last().ToUc();}
  }
}
TFFile::TFFile ( const TStrV _FPathV,
const TStrV _FExtV,
const TStr _FBaseWc,
const bool &  _RecurseP 
)

Definition at line 59 of file xfl.cpp.

                       :
  FPathV(_FPathV), FExtV(_FExtV), FBaseWc(_FBaseWc),
  CsImpP(false), RecurseP(_RecurseP), FPathN(0-1),
  FFileDesc(TFFileDesc::New()), SubFFile(), CurFNm(), CurFNmN(0-1){
  // prepare file-paths
  for (int FPathN=0; FPathN<FPathV.Len(); FPathN++){
    FPathV[FPathN]=TStr::GetNrFPath(FPathV[FPathN]);}
  // prepare file-extensions
  for (int FExtN=0; FExtN<FExtV.Len(); FExtN++){
    FExtV[FExtN]=TStr::GetNrFExt(FExtV[FExtN]);
    if (!CsImpP){FExtV[FExtN].ToUc();}
  }
  // prepare file-base wild-card
  if (!CsImpP){FBaseWc.ToUc();}
}
TFFile ( TSIn )

Definition at line 53 of file xfl.h.

{Fail;}
TFFileDesc ( TSIn )

Definition at line 16 of file xfl.h.

{Fail;}
~TFFile ( )
~TFFileDesc ( )

Variable Documentation

bool CsImpP

Definition at line 32 of file xfl.h.

Definition at line 37 of file xfl.h.

int CurFNmN

Definition at line 38 of file xfl.h.

ClassTP (TFFileDesc, PFFileDesc) public dirent* DirEnt

Definition at line 3 of file xfl.h.

ClassTP (TFFile, PFFile) private TStr FBaseWc

Definition at line 28 of file xfl.h.

PFFileDesc FFileDesc

Definition at line 35 of file xfl.h.

int FPathN

Definition at line 34 of file xfl.h.

bool RecurseP

Definition at line 33 of file xfl.h.

PFFile SubFFile

Definition at line 36 of file xfl.h.