| 
    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 
   | 
  
  
  
 
#include <fl.h>

Static Public Member Functions | |
| static bool | Exists (const TStr &FNm) | 
| static void | Copy (const TStr &SrcFNm, const TStr &DstFNm, const bool &ThrowExceptP=true, const bool &FailIfExistsP=false) | 
| static void | Del (const TStr &FNm, const bool &ThrowExceptP=true) | 
| static void | DelWc (const TStr &WcStr, const bool &RecurseDirP=false) | 
| static void | Rename (const TStr &SrcFNm, const TStr &DstFNm) | 
| static TStr | GetUniqueFNm (const TStr &FNm) | 
| static uint64 | GetSize (const TStr &FNm) | 
| static uint64 | GetCreateTm (const TStr &FNm) | 
| static uint64 | GetLastAccessTm (const TStr &FNm) | 
| static uint64 | GetLastWriteTm (const TStr &FNm) | 
Static Public Attributes | |
| static const TStr | TxtFExt = ".Txt" | 
| static const TStr | HtmlFExt = ".Html" | 
| static const TStr | HtmFExt = ".Htm" | 
| static const TStr | GifFExt = ".Gif" | 
| static const TStr | JarFExt = ".Jar" | 
| static void TFile::Copy | ( | const TStr & | SrcFNm, | 
| const TStr & | DstFNm, | ||
| const bool & | ThrowExceptP = true,  | 
        ||
| const bool & | FailIfExistsP = false  | 
        ||
| ) |  [static] | 
        
| void TFile::Del | ( | const TStr & | FNm, | 
| const bool & | ThrowExceptP = true  | 
        ||
| ) |  [static] | 
        
Definition at line 1032 of file fl.cpp.
References TStr::CStr(), and EAssertR.
Referenced by DelWc().
                                                        {
  if (ThrowExceptP){
    EAssertR(
     remove(FNm.CStr())==0,
     "Error removing file '"+FNm+"'.");
  } else {
    remove(FNm.CStr());
  }
}


| void TFile::DelWc | ( | const TStr & | WcStr, | 
| const bool & | RecurseDirP = false  | 
        ||
| ) |  [static] | 
        
Definition at line 1042 of file fl.cpp.
References TVec< TVal, TSizeTy >::Add(), Del(), TVec< TVal, TSizeTy >::Len(), and TFFile::Next().
Referenced by TMBlobBs::TMBlobBs().
                                                           {
  // collect file-names
  TStrV FNmV;
  TFFile FFile(WcStr, RecurseDirP); TStr FNm;
  while (FFile.Next(FNm)){
    FNmV.Add(FNm);}
  // delete files
  for (int FNmN=0; FNmN<FNmV.Len(); FNmN++){
    Del(FNmV[FNmN], false);}
}


| bool TFile::Exists | ( | const TStr & | FNm | ) |  [static] | 
        
Definition at line 934 of file fl.cpp.
References TStr::Empty().
Referenced by GetUniqueFNm(), TUniChDb::Test(), TMBlobBs::TMBlobBs(), and TZipIn::TZipIn().


| static uint64 TFile::GetCreateTm | ( | const TStr & | FNm | ) |  [static] | 
        
| static uint64 TFile::GetLastAccessTm | ( | const TStr & | FNm | ) |  [static] | 
        
| static uint64 TFile::GetLastWriteTm | ( | const TStr & | FNm | ) |  [static] | 
        
| static uint64 TFile::GetSize | ( | const TStr & | FNm | ) |  [static] | 
        
| TStr TFile::GetUniqueFNm | ( | const TStr & | FNm | ) |  [static] | 
        
Definition at line 1059 of file fl.cpp.
References TStr::ChangeStr(), Exists(), TStr::Fmt(), forever, TStr::InsStr(), TStr::Len(), and TStr::SearchCh().
Referenced by TForestFire::PlotFire().
                                       {
  // <name>.#.txt --> <name>.<num>.txt
  int Cnt=1; int ch;
  TStr NewFNm; TStr TmpFNm=FNm;
  if (FNm.SearchCh('#') == -1) {
    for (ch = FNm.Len()-1; ch >= 0; ch--) if (FNm[ch] == '.') break;
    if (ch != -1) TmpFNm.InsStr(ch, ".#");
    else TmpFNm += ".#";
  }
  forever{
    NewFNm=TmpFNm;
    NewFNm.ChangeStr("#", TStr::Fmt("%03d", Cnt)); Cnt++;
    if (!TFile::Exists(NewFNm)){break;}
  }
  return NewFNm;
}


| void TFile::Rename | ( | const TStr & | SrcFNm, | 
| const TStr & | DstFNm | ||
| ) |  [static] | 
        
const TStr TFile::GifFExt = ".Gif" [static] | 
        
Definition at line 567 of file fl.h.
Referenced by THttp::IsGifFExt().
const TStr TFile::HtmFExt = ".Htm" [static] | 
        
Definition at line 566 of file fl.h.
Referenced by THttp::IsHtmlFExt().
const TStr TFile::HtmlFExt = ".Html" [static] | 
        
Definition at line 565 of file fl.h.
Referenced by THttp::IsHtmlFExt().
const TStr TFile::JarFExt = ".Jar" [static] | 
        
const TStr TFile::TxtFExt = ".Txt" [static] |