Logo Search packages:      
Sourcecode: harbour version File versions  Download package

bool CZipArchive::GetFromArchive ( CZipArchive zip,
WORD  uIndex,
int  iReplaceIndex = -1,
bool  bKeepSystComp = false 
) [inline]

Acquire a file with the given index from another archive. The compressed data of the file from another archive are copied without decompressing to the current archive. You can set the callback functor with SetCallback.

Parameters:
zip an opened archive to get the file from (must not be multi-disk)
uIndex a zero-based index of the file to get from the zip archive
iReplaceIndex the same as CZipAddNewFileInfo::m_iReplaceIndex
bKeepSystComp if false, which is default, then the file from zip archive system compatibility is converted to the current archive system compatibility (if they differ)
Returns:
false if the operation could not be performed (either of archives is closed, a file inside either of archives is opened, zip archive is multi-disk or the current archive is an existing multi-disk archive)
Note:
Throws exceptions
(when an exception is thrown, you may need to call CloseNewFile with bAfterException set to true, to make the archive reusable).

it is safe to abort the action (by returning false from the callback call) in non-disk spanning archive and when no replacing is taking place (the file not entirely added is removed from the archive)

See also:
SetCallback

GetFromArchive(CZipArchive& , CZipWordArray &, bool)

GetFromArchive(CZipArchive& , CZipStringArray &, bool)

FindMatches

SetAdvanced

Definition at line 730 of file ziparchive.h.

Referenced by AddNewFile(), and GetFromArchive().

      {

            m_info.Init();
            bool bRet;
            try
            {
                  bRet = GetFromArchive(zip, uIndex, iReplaceIndex, bKeepSystComp, GetCallback(cbGetFromArchive));
            }
            catch(...)
            {
                  m_info.ReleaseBuf();
                  throw;
            }
            m_info.ReleaseBuf();
            if (bRet && m_bAutoFlush)
                  Flush();

            return bRet;
      }


Generated by  Doxygen 1.6.0   Back to index