SNAP Library, User Reference  2012-10-02 12:56:23
SNAP, a general purpose network analysis and graph mining library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TZipIn Class Reference

Inherits TSIn.

List of all members.

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)
uint64 GetFLen () const
uint64 GetCurFPos () 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).
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).
static TStr GetCmd (const TStr &ZipFNm)
 Return a command-line string that is executed in order to decompress a file to standard output.
static uint64 GetFLen (const TStr &ZipFNm)
 Return the uncompressed size (in bytes) of the compressed file ZipFNm.

Detailed Description

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>' Note: You can only load .gz files of uncompressed size <2GB. If you load some other format (like .bz2 or rar) there is no such limitation. Note2: For 7z to work properly you need both the 7z executable and the directory 'Codecs'.


Constructor & Destructor Documentation

TZipIn::TZipIn ( const TStr FNm)
TZipIn::TZipIn ( const TStr FNm,
bool &  OpenedP 
)

Member Function Documentation

bool TZipIn::Eof ( ) [inline, virtual]

Implements TSIn.

int TZipIn::GetBf ( const void *  LBf,
const TSize LBfL 
) [virtual]

Implements TSIn.

char TZipIn::GetCh ( ) [inline, virtual]

Implements TSIn.

TStr TZipIn::GetCmd ( const TStr ZipFNm) [static]

Return a command-line string that is executed in order to decompress a file to standard output.

uint64 TZipIn::GetCurFPos ( ) const [inline]
uint64 TZipIn::GetFLen ( ) const [inline]
uint64 TZipIn::GetFLen ( const TStr ZipFNm) [static]

Return the uncompressed size (in bytes) of the compressed file ZipFNm.

bool TZipIn::IsZipExt ( const TStr FNmExt) [static]

Check whether the file extension FNmExt is that of a compressed file (.gz, .7z, .rar, .zip, .cab, .arj. bzip2).

static bool TZipIn::IsZipFNm ( const TStr FNm) [inline, static]

Check whether the file extension of FNm is that of a compressed file (.gz, .7z, .rar, .zip, .cab, .arj. bzip2).

int TZipIn::Len ( ) const [inline, virtual]

Implements TSIn.

PSIn TZipIn::New ( const TStr FNm) [static]
PSIn TZipIn::New ( const TStr FNm,
bool &  OpenedP 
) [static]
char TZipIn::PeekCh ( ) [inline, virtual]

Implements TSIn.


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