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
|
#include <zipfl.h>
Inherits TSIn.
Public Member Functions | |
TZipIn (const TStr &FNm) | |
TZipIn (const TStr &FNm, bool &OpenedP) | |
~TZipIn () | |
bool | Eof () |
int | Len () const |
char | GetCh () |
char | PeekCh () |
int | GetBf (const void *LBf, const TSize &LBfL) |
bool | GetNextLnBf (TChA &LnChA) |
uint64 | GetFLen () const |
uint64 | GetCurFPos () const |
Public Member Functions inherited from TSIn | |
TSIn () | |
TSIn (const TStr &Str) | |
virtual | ~TSIn () |
virtual void | Reset () |
bool | IsFastMode () const |
void | SetFastMode (const bool &_FastMode) |
void | LoadCs () |
void | LoadBf (const void *Bf, const TSize &BfL) |
void * | LoadNewBf (const int &BfL) |
void | Load (bool &Bool) |
void | Load (uchar &UCh) |
void | Load (char &Ch) |
void | Load (short &Short) |
void | Load (ushort &UShort) |
void | Load (int &Int) |
void | Load (uint &UInt) |
void | Load (int64 &Int) |
void | Load (uint64 &UInt) |
void | Load (double &Flt) |
void | Load (sdouble &SFlt) |
void | Load (ldouble &LFlt) |
void | Load (char *&CStr, const int &MxCStrLen, const int &CStrLen) |
void | Load (char *&CStr) |
TSIn & | operator>> (bool &Bool) |
TSIn & | operator>> (uchar &UCh) |
TSIn & | operator>> (char &Ch) |
TSIn & | operator>> (short &Sh) |
TSIn & | operator>> (ushort &USh) |
TSIn & | operator>> (int &Int) |
TSIn & | operator>> (uint &UInt) |
TSIn & | operator>> (int64 &Int) |
TSIn & | operator>> (uint64 &UInt) |
TSIn & | operator>> (float &Flt) |
TSIn & | operator>> (double &Double) |
TSIn & | operator>> (long double &LDouble) |
bool | GetNextLn (TStr &LnStr) |
bool | GetNextLn (TChA &LnChA) |
Public Member Functions inherited from TSBase | |
TSBase (const TSStr &Nm) | |
virtual | ~TSBase () |
virtual TStr | GetSNm () const |
Static Public Member Functions | |
static PSIn | New (const TStr &FNm) |
static PSIn | New (const TStr &FNm, bool &OpenedP) |
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 uint64 | GetFLen (const TStr &ZipFNm) |
Return the uncompressed size (in bytes) of the compressed file ZipFNm. More... | |
static PSIn | NewIfZip (const TStr &FNm) |
Static Public Attributes | |
static TStr | SevenZipPath = "/usr/bin" |
Static Public Attributes inherited from TSIn | |
static const TPt< TSIn > | StdIn =PSIn(new TStdIn()) |
Private Member Functions | |
void | FillBf () |
int | FindEol (int &BfN) |
void | CreateZipProcess (const TStr &Cmd, const TStr &ZipFNm) |
TZipIn () | |
TZipIn (const TZipIn &) | |
TZipIn & | operator= (const TZipIn &) |
Static Private Member Functions | |
static void | FillFExtToCmdH () |
Private Attributes | |
FILE * | ZipStdoutRd |
FILE * | ZipStdoutWr |
uint64 | FLen |
uint64 | CurFPos |
char * | Bf |
int | BfC |
int | BfL |
Static Private Attributes | |
static TStrStrH | FExtToCmdH |
static const int | MxBfL =32*1024 |
Additional Inherited Members | |
Protected Attributes inherited from TSBase | |
TCRef | CRef |
TSStr | SNm |
TCs | Cs |
Compressed File Input Stream. The class reads from a compressed file without explicitly uncompressing it. This is eachieved by running external 7ZIP program which uncompresses to standard output, which is then piped to TZipFl. 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 TZipIn expects that '7z' ('7z.exe') is in the working path. Make sure you can execute '7z e -y -bd -so <FILENAME>' For 7z to work properly you need both the 7z executable and the directory 'Codecs'. Use TZipIn::SevenZipPath to set the path to 7z executable.
NOTE: Current implementation of TZipIn supports only .zip format, other compression formats are not supported.
|
private |
|
private |
TZipIn::TZipIn | ( | const TStr & | FNm | ) |
Definition at line 65 of file zipfl.cpp.
TZipIn::TZipIn | ( | const TStr & | FNm, |
bool & | OpenedP | ||
) |
Definition at line 98 of file zipfl.cpp.
|
private |
Definition at line 48 of file zipfl.cpp.
|
virtual |
Return the uncompressed size (in bytes) of the compressed file ZipFNm.
Definition at line 230 of file zipfl.cpp.
|
virtual |
|
static |
|
inlinestatic |
Check whether the file extension of FNm is that of a compressed file (.gz, .7z, .rar, .zip, .cab, .arj. bzip2).
Definition at line 56 of file zipfl.h.
Definition at line 63 of file zipfl.h.