My Project
Public Member Functions | Public Attributes | List of all members
ParaScripting::ParaZipWriter Class Reference

ParaZipWriter class: creating zip files. More...

#include <ParaScriptingIO.h>

Public Member Functions

 ParaZipWriter (CZipWriter *writer)
 
bool IsValid ()
 whether it is valid
 
DWORD ZipAdd (const char *dstzn, const char *fn)
 add a zip file to the zip. More...
 
DWORD ZipAddData (const char *dstzn, const std::string &buff)
 add a data to the zip. More...
 
DWORD ZipAddFolder (const char *dstzn)
 add a zip folder to the zip file. More...
 
DWORD AddDirectory (const char *dstzn, const char *filepattern, int nSubLevel=0)
 add everything in side a directory to the zip. More...
 
DWORD close ()
 call this when you have finished adding files and folders to the zip file. More...
 

Public Attributes

ref_ptr< CZipWriterm_writer
 

Detailed Description

ParaZipWriter class: creating zip files.

e.g. (1) Traditional use, creating a zipfile from existing files local writer = ParaIO.CreateZip("c:\\simple1.zip",""); writer:ZipAdd("znsimple.bmp", "c:\\simple.bmp"); writer:ZipAdd("znsimple.txt", "c:\\simple.txt"); writer:close();

Member Function Documentation

§ AddDirectory()

DWORD ParaScripting::ParaZipWriter::AddDirectory ( const char *  dstzn,
const char *  filepattern,
int  nSubLevel = 0 
)

add everything in side a directory to the zip.

e.g. AddDirectory("myworld/", "worlds/myworld/ *.*", 10);

Parameters
dstznall files in fn will be appended with this string to be saved in the zip file.
filepatternfile patterns, which can include wild characters in the file portion.
nSubLevelsub directory levels. 0 means only files at parent directory.

§ close()

DWORD ParaScripting::ParaZipWriter::close ( )

call this when you have finished adding files and folders to the zip file.

Note: you can't add any more after calling this.

§ ZipAdd()

DWORD ParaScripting::ParaZipWriter::ZipAdd ( const char *  dstzn,
const char *  fn 
)

add a zip file to the zip.

file call this for each file to be added to the zip.

Returns
: 0 if succeed.

§ ZipAddData()

DWORD ParaScripting::ParaZipWriter::ZipAddData ( const char *  dstzn,
const std::string &  buff 
)

add a data to the zip.

Returns
: 0 if succeed.

§ ZipAddFolder()

DWORD ParaScripting::ParaZipWriter::ZipAddFolder ( const char *  dstzn)

add a zip folder to the zip file.

call this for each folder to be added to the zip.

Returns
: 0 if succeed.

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