SNAP Library 3.0, User Reference  2016-07-20 17:56:49
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
TFFile Class Reference

#include <xfl.h>

Public Member Functions

 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)
 
 ~TFFile ()
 
 TFFile (TSIn &)
 
void Save (TSOut &)
 
bool Next (TStr &FNm)
 
bool Next ()
 
TStr GetFNm () const
 
int GetFNmN () const
 
bool IsDir () const
 

Static Public Member Functions

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)
 
static PFFile Load (TSIn &SIn)
 
static void GetFNmV (const TStr &FPath, const TStrV &FExtV, const bool &RecurseP, TStrV &FNmV)
 

Private Member Functions

 UndefDefaultCopyAssign (TFFile)
 

Private Attributes

TCRef CRef
 
TStrV FPathV
 
TStrV FExtV
 
TStr FBaseWc
 
bool CsImpP
 
bool RecurseP
 
int FPathN
 
PFFileDesc FFileDesc
 
PFFile SubFFile
 
TStr CurFNm
 
int CurFNmN
 

Friends

class TPt< TFFile >
 

Detailed Description

Definition at line 30 of file xfl.h.

Constructor & Destructor Documentation

TFFile::TFFile ( const TStr _FNmWc,
const bool &  _RecurseP = false 
)

Definition at line 37 of file xfl.cpp.

37  :
38  FPathV(), FExtV(), FBaseWc(),
39  CsImpP(false), RecurseP(_RecurseP), FPathN(0-1),
41  // prepare file-base-name wild-card
42  FBaseWc=FNmWc.GetFBase(); if (!CsImpP){FBaseWc.ToUc();}
43  // get & assign file-name
44  TStr FPath=FNmWc.GetFPath();
45  FPathV.Add(TStr::GetNrFPath(FPath));
46 }
TStrV FExtV
Definition: xfl.h:32
TStr GetFPath() const
Definition: dt.cpp:1389
PFFileDesc FFileDesc
Definition: xfl.h:37
static PFFileDesc New()
Definition: xfl.h:16
bool RecurseP
Definition: xfl.h:35
PFFile SubFFile
Definition: xfl.h:38
bool CsImpP
Definition: xfl.h:34
TStr CurFNm
Definition: xfl.h:39
TStr FBaseWc
Definition: xfl.h:33
static TStr GetNrFPath(const TStr &FPath)
Definition: dt.cpp:1430
int FPathN
Definition: xfl.h:36
TStr & ToUc()
Definition: dt.cpp:752
Definition: dt.h:412
TStrV FPathV
Definition: xfl.h:32
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:574
TStr GetFBase() const
Definition: dt.cpp:1396
int CurFNmN
Definition: xfl.h:40
TFFile::TFFile ( const TStr _FPath,
const TStr _FExt,
const bool &  _RecurseP = false 
)

Definition at line 48 of file xfl.cpp.

48  :
49  FPathV(), FExtV(), FBaseWc(),
50  CsImpP(false), RecurseP(_RecurseP), FPathN(0-1),
52  FPathV.Add(TStr::GetNrFPath(_FPath));
53  if (!_FExt.Empty()){
54  FExtV.Add(TStr::GetNrFExt(_FExt));
55  if (!CsImpP){FExtV.Last().ToUc();}
56  }
57 }
TStrV FExtV
Definition: xfl.h:32
PFFileDesc FFileDesc
Definition: xfl.h:37
static PFFileDesc New()
Definition: xfl.h:16
bool RecurseP
Definition: xfl.h:35
PFFile SubFFile
Definition: xfl.h:38
bool CsImpP
Definition: xfl.h:34
TStr CurFNm
Definition: xfl.h:39
TStr FBaseWc
Definition: xfl.h:33
const TVal & Last() const
Returns a reference to the last element of the vector.
Definition: ds.h:551
static TStr GetNrFPath(const TStr &FPath)
Definition: dt.cpp:1430
static TStr GetNrFExt(const TStr &FExt)
Definition: dt.cpp:1455
int FPathN
Definition: xfl.h:36
TStr & ToUc()
Definition: dt.cpp:752
bool Empty() const
Definition: dt.h:488
TStrV FPathV
Definition: xfl.h:32
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:574
int CurFNmN
Definition: xfl.h:40
TFFile::TFFile ( const TStrV _FPathV,
const TStrV _FExtV,
const TStr _FBaseWc,
const bool &  _RecurseP 
)

Definition at line 59 of file xfl.cpp.

60  :
61  FPathV(_FPathV), FExtV(_FExtV), FBaseWc(_FBaseWc),
62  CsImpP(false), RecurseP(_RecurseP), FPathN(0-1),
64  // prepare file-paths
65  for (int FPathN=0; FPathN<FPathV.Len(); FPathN++){
67  // prepare file-extensions
68  for (int FExtN=0; FExtN<FExtV.Len(); FExtN++){
69  FExtV[FExtN]=TStr::GetNrFExt(FExtV[FExtN]);
70  if (!CsImpP){FExtV[FExtN].ToUc();}
71  }
72  // prepare file-base wild-card
73  if (!CsImpP){FBaseWc.ToUc();}
74 }
TStrV FExtV
Definition: xfl.h:32
PFFileDesc FFileDesc
Definition: xfl.h:37
TSizeTy Len() const
Returns the number of elements in the vector.
Definition: ds.h:547
static PFFileDesc New()
Definition: xfl.h:16
bool RecurseP
Definition: xfl.h:35
PFFile SubFFile
Definition: xfl.h:38
bool CsImpP
Definition: xfl.h:34
TStr CurFNm
Definition: xfl.h:39
TStr FBaseWc
Definition: xfl.h:33
static TStr GetNrFPath(const TStr &FPath)
Definition: dt.cpp:1430
static TStr GetNrFExt(const TStr &FExt)
Definition: dt.cpp:1455
int FPathN
Definition: xfl.h:36
TStr & ToUc()
Definition: dt.cpp:752
TStrV FPathV
Definition: xfl.h:32
int CurFNmN
Definition: xfl.h:40
TFFile::~TFFile ( )
TFFile::TFFile ( TSIn )
inline

Definition at line 55 of file xfl.h.

55 {Fail;}
#define Fail
Definition: bd.h:238

Member Function Documentation

TStr TFFile::GetFNm ( ) const
inline

Definition at line 61 of file xfl.h.

61 {return CurFNm;}
TStr CurFNm
Definition: xfl.h:39
int TFFile::GetFNmN ( ) const
inline

Definition at line 62 of file xfl.h.

62 {return CurFNmN;}
int CurFNmN
Definition: xfl.h:40
void TFFile::GetFNmV ( const TStr FPath,
const TStrV FExtV,
const bool &  RecurseP,
TStrV FNmV 
)
static

Definition at line 219 of file xfl.cpp.

220  {
221  // prepare file-directory traversal
222  TStrV FPathV; FPathV.Add(FPath);
223  TFFile FFile(FPathV, FExtV, "", RecurseP); TStr FNm;
224  // traverse directory
225  FNmV.Clr();
226  while (FFile.Next(FNm)){
227  FNmV.Add(FNm);
228  }
229 }
Definition: xfl.h:30
bool RecurseP
Definition: xfl.h:35
void Clr(const bool &DoDel=true, const TSizeTy &NoDelLim=-1)
Clears the contents of the vector.
Definition: ds.h:971
Definition: dt.h:412
TStrV FPathV
Definition: xfl.h:32
TSizeTy Add()
Adds a new element at the end of the vector, after its current last element.
Definition: ds.h:574
Vector is a sequence TVal objects representing an array that can change in size.
Definition: ds.h:429
bool TFFile::IsDir ( ) const
inline

Definition at line 67 of file xfl.h.

67  {
68  return FFileDesc->IsDir();}
PFFileDesc FFileDesc
Definition: xfl.h:37
bool IsDir() const
static PFFile TFFile::Load ( TSIn SIn)
inlinestatic

Definition at line 56 of file xfl.h.

56 {return new TFFile(SIn);}
TFFile(const TStr &_FNmWc, const bool &_RecurseP=false)
Definition: xfl.cpp:37
static PFFile TFFile::New ( const TStr FNmWc,
const bool &  RecurseP 
)
inlinestatic

Definition at line 47 of file xfl.h.

47  {
48  return PFFile(new TFFile(FNmWc, RecurseP));}
bool RecurseP
Definition: xfl.h:35
TFFile(const TStr &_FNmWc, const bool &_RecurseP=false)
Definition: xfl.cpp:37
TPt< TFFile > PFFile
Definition: xfl.h:30
static PFFile TFFile::New ( const TStrV FPathV,
const TStrV FExtV,
const TStr  FBaseWc,
const bool &  RecurseP 
)
inlinestatic

Definition at line 49 of file xfl.h.

50  {
51  return PFFile(new TFFile(FPathV, FExtV, FBaseWc, RecurseP));}
bool RecurseP
Definition: xfl.h:35
TFFile(const TStr &_FNmWc, const bool &_RecurseP=false)
Definition: xfl.cpp:37
TPt< TFFile > PFFile
Definition: xfl.h:30
static PFFile TFFile::New ( const TStr FPath,
const TStr FExt,
const bool &  RecurseP 
)
inlinestatic

Definition at line 52 of file xfl.h.

52  {
53  return PFFile(new TFFile(FPath, FExt, RecurseP));}
bool RecurseP
Definition: xfl.h:35
TFFile(const TStr &_FNmWc, const bool &_RecurseP=false)
Definition: xfl.cpp:37
TPt< TFFile > PFFile
Definition: xfl.h:30
bool TFFile::Next ( TStr FNm)
bool TFFile::Next ( )
inline

Definition at line 60 of file xfl.h.

60 {TStr FNm; return Next(FNm);}
bool Next()
Definition: xfl.h:60
Definition: dt.h:412
void TFFile::Save ( TSOut )
inline

Definition at line 57 of file xfl.h.

57 {Fail;}
#define Fail
Definition: bd.h:238
TFFile::UndefDefaultCopyAssign ( TFFile  )
private

Friends And Related Function Documentation

friend class TPt< TFFile >
friend

Definition at line 30 of file xfl.h.

Member Data Documentation

TCRef TFFile::CRef
private

Definition at line 30 of file xfl.h.

bool TFFile::CsImpP
private

Definition at line 34 of file xfl.h.

TStr TFFile::CurFNm
private

Definition at line 39 of file xfl.h.

int TFFile::CurFNmN
private

Definition at line 40 of file xfl.h.

TStr TFFile::FBaseWc
private

Definition at line 33 of file xfl.h.

TStrV TFFile::FExtV
private

Definition at line 32 of file xfl.h.

PFFileDesc TFFile::FFileDesc
private

Definition at line 37 of file xfl.h.

int TFFile::FPathN
private

Definition at line 36 of file xfl.h.

TStrV TFFile::FPathV
private

Definition at line 32 of file xfl.h.

bool TFFile::RecurseP
private

Definition at line 35 of file xfl.h.

PFFile TFFile::SubFFile
private

Definition at line 38 of file xfl.h.


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