SNAP Library 6.0, Developer Reference
2020-12-09 16:24:20
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
|
#include <zipfl.h>
Public Member Functions | |
TZipOut (const TStr &_FNm) | |
~TZipOut () | |
int | PutCh (const char &Ch) |
int | PutBf (const void *LBf, const TSize &LBfL) |
void | Flush () |
Public Member Functions inherited from TSOut | |
TSOut () | |
TSOut (const TStr &Str) | |
virtual | ~TSOut () |
void | EnableLnTrunc (const int &_MxLnLen) |
void | DisableLnTrunc () |
virtual TFileId | GetFileId () const |
int | PutMem (const TMem &Mem) |
int | PutCh (const char &Ch, const int &Chs) |
int | PutBool (const bool &Bool) |
int | PutInt (const int &Int) |
int | PutInt (const int &Int, const char *FmtStr) |
int | PutUInt (const uint &Int) |
int | PutUInt (const uint &Int, const char *FmtStr) |
int | PutFlt (const double &Flt) |
int | PutFlt (const double &Flt, const char *FmtStr) |
int | PutStr (const char *CStr) |
int | PutStr (const TChA &ChA) |
int | PutStr (const TStr &Str, const char *FmtStr) |
int | PutStr (const TStr &Str, const bool &ForceInLn=false) |
int | PutStrLn (const TStr &Str, const bool &ForceInLn=false) |
int | PutStrFmt (const char *FmtStr,...) |
int | PutStrFmtLn (const char *FmtStr,...) |
int | PutIndent (const int &IndentLev=1) |
int | PutLn (const int &Lns=1) |
int | PutDosLn (const int &Lns=1) |
int | PutSep (const int &NextStrLen=0) |
int | PutSepLn (const int &Lns=0) |
void | SaveCs () |
void | SaveBf (const void *Bf, const TSize &BfL) |
void | Save (const bool &Bool) |
void | Save (const char &Ch) |
void | Save (const uchar &UCh) |
void | Save (const short &Short) |
void | Save (const ushort &UShort) |
void | Save (const int &Int) |
void | Save (const uint &UInt) |
void | Save (const int64 &Int) |
void | Save (const uint64 &UInt) |
void | Save (const double &Flt) |
void | Save (const sdouble &SFlt) |
void | Save (const ldouble &LFlt) |
void | Save (const char *CStr, const TSize &CStrLen) |
void | Save (const char *CStr) |
void | Save (TSIn &SIn, const TSize &BfL=-1) |
void | Save (const PSIn &SIn, const TSize &BfL=-1) |
void | Save (const void *Bf, const TSize &BfL) |
TSOut & | operator<< (const bool &Bool) |
TSOut & | operator<< (const uchar &UCh) |
TSOut & | operator<< (const char &Ch) |
TSOut & | operator<< (const short &Sh) |
TSOut & | operator<< (const ushort &USh) |
TSOut & | operator<< (const int &Int) |
TSOut & | operator<< (const uint &Int) |
TSOut & | operator<< (const int64 &Int) |
TSOut & | operator<< (const uint64 &UInt) |
TSOut & | operator<< (const float &Flt) |
TSOut & | operator<< (const double &Double) |
TSOut & | operator<< (const long double &LDouble) |
TSOut & | operator<< (const TSOutMnp &Mnp) |
TSOut & | operator<< (TSOut &(*FuncPt)(TSOut &)) |
TSOut & | operator<< (TSIn &SIn) |
TSOut & | operator<< (PSIn &SIn) |
Public Member Functions inherited from TSBase | |
TSBase (const TSStr &Nm) | |
virtual | ~TSBase () |
virtual TStr | GetSNm () const |
Static Public Member Functions | |
static PSOut | New (const TStr &FNm) |
static bool | IsZipFNm (const TStr &FNm) |
Check whether the file extension of FNm is that of a compressed file (.gz, .7z, .rar, .zip, .cab, .arj. bzip2). More... | |
static bool | IsZipExt (const TStr &FNmExt) |
Check whether the file extension FNmExt is that of a compressed file (.gz, .7z, .rar, .zip, .cab, .arj. bzip2). More... | |
static TStr | GetCmd (const TStr &ZipFNm) |
Return a command-line string that is executed in order to decompress a file to standard output. More... | |
static PSOut | NewIfZip (const TStr &FNm) |
Private Member Functions | |
void | FlushBf () |
void | CreateZipProcess (const TStr &Cmd, const TStr &ZipFNm) |
TZipOut () | |
TZipOut (const TZipOut &) | |
TZipOut & | operator= (const TZipOut &) |
Static Private Member Functions | |
static void | FillFExtToCmdH () |
Private Attributes | |
FILE * | ZipStdinRd |
FILE * | ZipStdinWr |
char * | Bf |
TSize | BfL |
Static Private Attributes | |
static const TSize | MxBfL =4*1024 |
static TStrStrH | FExtToCmdH |
Additional Inherited Members | |
Static Public Attributes inherited from TSOut | |
static const TPt< TSOut > | StdOut =PSOut(new TStdOut()) |
Protected Attributes inherited from TSBase | |
TCRef | CRef |
TSStr | SNm |
TCs | Cs |
Compressed File Output Stream. The class directly writes to a compressed file. This is eachieved by TZipFl outputing into a pipe from which 7ZIP then reads and compresses. The class requires 7ZIP to be installed on the machine. Go to http://www.7-zip.org to install the software. 7z (7z.exe) is an executable and can decompress the following formats: .gz, .7z, .rar, .zip, .cab, .arj. bzip2. The class TZIpOut expects that '7z' ('7z.exe') is in the working path. Note2: For 7z to work properly you need both the 7z executable and the directory 'Codecs'. Note3: Use TZipIn::SevenZipPath to set the path to 7z executable.
|
private |
|
private |
TZipOut::TZipOut | ( | const TStr & | _FNm | ) |
Definition at line 337 of file zipfl.cpp.
References Bf, BfL, CreateZipProcess(), EAssertR, TStr::Empty(), GetCmd(), MxBfL, ZipStdinRd, and ZipStdinWr.
TZipOut::~TZipOut | ( | ) |
Definition at line 360 of file zipfl.cpp.
References Bf, BfL, EAssertR, FlushBf(), ZipStdinRd, and ZipStdinWr.
Definition at line 307 of file zipfl.cpp.
References TStr::CStr(), EAssertR, TStr::Fmt(), ZipStdinRd, and ZipStdinWr.
Referenced by TZipOut().
|
staticprivate |
Definition at line 402 of file zipfl.cpp.
References THash< TKey, TDat, THashFunc >::AddDat(), THash< TKey, TDat, THashFunc >::Empty(), and FExtToCmdH.
Referenced by GetCmd(), and IsZipExt().
|
virtual |
Implements TSOut.
Definition at line 388 of file zipfl.cpp.
References EAssertR, FlushBf(), TSBase::GetSNm(), and ZipStdinWr.
|
private |
Definition at line 296 of file zipfl.cpp.
References Bf, BfL, EAssert, EAssertR, TSBase::GetSNm(), and ZipStdinWr.
Referenced by Flush(), PutCh(), and ~TZipOut().
Return a command-line string that is executed in order to decompress a file to standard output.
Definition at line 421 of file zipfl.cpp.
References TStr::CStr(), EAssertR, THash< TKey, TDat, THashFunc >::Empty(), FExtToCmdH, FillFExtToCmdH(), TStr::Fmt(), THash< TKey, TDat, THashFunc >::GetDat(), TStr::GetFExt(), TStr::GetFMid(), TStr::GetLc(), and THash< TKey, TDat, THashFunc >::IsKey().
Referenced by TZipOut().
|
static |
Check whether the file extension FNmExt is that of a compressed file (.gz, .7z, .rar, .zip, .cab, .arj. bzip2).
Definition at line 397 of file zipfl.cpp.
References THash< TKey, TDat, THashFunc >::Empty(), FExtToCmdH, FillFExtToCmdH(), and THash< TKey, TDat, THashFunc >::IsKey().
Referenced by IsZipFNm().
|
inlinestatic |
Check whether the file extension of FNm is that of a compressed file (.gz, .7z, .rar, .zip, .cab, .arj. bzip2).
Definition at line 103 of file zipfl.h.
References TStr::GetFExt(), and IsZipExt().
Referenced by NewIfZip().
Definition at line 356 of file zipfl.cpp.
References TZipOut().
Referenced by NewIfZip().
Definition at line 108 of file zipfl.h.
References IsZipFNm(), New(), and TFOut::New().
|
virtual |
|
virtual |
|
private |
|
private |
|
staticprivate |
Definition at line 77 of file zipfl.h.
Referenced by FillFExtToCmdH(), GetCmd(), and IsZipExt().
|
staticprivate |
|
private |
Definition at line 81 of file zipfl.h.
Referenced by CreateZipProcess(), TZipOut(), and ~TZipOut().
|
private |
Definition at line 81 of file zipfl.h.
Referenced by CreateZipProcess(), Flush(), FlushBf(), TZipOut(), and ~TZipOut().