SNAP Library 2.0, Developer Reference  2013-05-13 16:33:57
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TFFile Class Reference

#include <xfl.h>

Collaboration diagram for TFFile:

List of all members.

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.

References TVec< TVal, TSizeTy >::Add(), CsImpP, FBaseWc, FPathV, TStr::GetFBase(), TStr::GetFPath(), TStr::GetNrFPath(), and TStr::ToUc().

                                                      :
  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));
}

Here is the call graph for this function:

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

Definition at line 48 of file xfl.cpp.

References TVec< TVal, TSizeTy >::Add(), CsImpP, TStr::Empty(), FExtV, FPathV, TStr::GetNrFExt(), TStr::GetNrFPath(), TVec< TVal, TSizeTy >::Last(), and TStr::ToUc().

                                                                          :
  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();}
  }
}

Here is the call graph for this function:

TFFile::TFFile ( const TStrV _FPathV,
const TStrV _FExtV,
const TStr _FBaseWc,
const bool &  _RecurseP 
)

Definition at line 59 of file xfl.cpp.

References CsImpP, FBaseWc, FExtV, FPathN, FPathV, TStr::GetNrFExt(), TStr::GetNrFPath(), TVec< TVal, TSizeTy >::Len(), and TStr::ToUc().

                       :
  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();}
}

Here is the call graph for this function:

TFFile::TFFile ( TSIn ) [inline]

Definition at line 55 of file xfl.h.

References Fail.

{Fail;}

Member Function Documentation

TStr TFFile::GetFNm ( ) const [inline]

Definition at line 61 of file xfl.h.

{return CurFNm;}
int TFFile::GetFNmN ( ) const [inline]

Definition at line 62 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.

References TVec< TVal, TSizeTy >::Add(), TVec< TVal, TSizeTy >::Clr(), FPathV, and Next().

                                                                          {
  // 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);
  }
}

Here is the call graph for this function:

bool TFFile::IsDir ( ) const [inline]

Definition at line 67 of file xfl.h.

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

Definition at line 56 of file xfl.h.

{return new TFFile(SIn);}
static PFFile TFFile::New ( const TStr FNmWc,
const bool &  RecurseP 
) [inline, static]

Definition at line 47 of file xfl.h.

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

Definition at line 49 of file xfl.h.

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

Definition at line 52 of file xfl.h.

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

Referenced by TFile::DelWc(), GetFNmV(), and TNcpGraphsBase::TNcpGraphsBase().

Here is the caller graph for this function:

bool TFFile::Next ( ) [inline]

Definition at line 60 of file xfl.h.

References Next().

Referenced by Next().

{TStr FNm; return Next(FNm);}

Here is the call graph for this function:

Here is the caller graph for this function:

void TFFile::Save ( TSOut ) [inline]

Definition at line 57 of file xfl.h.

References Fail.

{Fail;}

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.

Referenced by TFFile().

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.

Referenced by TFFile().

TStrV TFFile::FExtV [private]

Definition at line 32 of file xfl.h.

Referenced by TFFile().

Definition at line 37 of file xfl.h.

int TFFile::FPathN [private]

Definition at line 36 of file xfl.h.

Referenced by TFFile().

TStrV TFFile::FPathV [private]

Definition at line 32 of file xfl.h.

Referenced by GetFNmV(), and TFFile().

bool TFFile::RecurseP [private]

Definition at line 35 of file xfl.h.

Definition at line 38 of file xfl.h.


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