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

int CZipArchive::FindFile ( LPCTSTR  lpszFileName,
int  iCaseSensitive = ffDefault,
bool  bFileNameOnly = false 
)

Find the file in the archive. If the archive wasn't opened with CZipCentralDir::m_bConvertAfterOpen set to true, this function automatically convert all the filenames with the function CZipCentralDir::ConvertAll and set CZipCentralDir::m_bConvertAfterOpen to true. This function requires FindFast feature enabled.

Parameters:
lpszFileName the name of the file to be found in the archive; must be with path unless you set bFileNameOnly to true. Use path separators the same as they are for your system ("\" for Windows and "/" for Unix/Linux)
iCaseSensitive can be one of FFCaseSens values
bFileNameOnly if true, the function tries to find a filename without a path (a less effective search is performed); if you wish to find a directory name, do not end it with the path separator, which is required if you set bFileName to false
Returns:

  • the index of the file found
  • -1 if there is no such a file in the archive
See also:
CZipCentralDir::FindFileNameIndex

EnableFindFast

CZipCentralDir::ConvertAll

SetConvertAfterOpen

Definition at line 158 of file ziparchive.cpp.

References ffCaseSens, ffNoCaseSens, CZipCentralDir::FindFile(), IsClosed(), m_bCaseSensitive, and m_centralDir.

Referenced by GetIndexes(), UpdateReplaceIndex(), and WillBeDuplicated().

{
      if (IsClosed())
      {
            TRACE(_T("%s(%i) : ZipArchive is closed.\n"),__FILE__,__LINE__);
            return (int)-1;
      }
      bool bCS;
      bool bSporadically;
      switch (iCaseSensitive)
      {
      case ffCaseSens:
            bCS = true;
            bSporadically = true;
            break;
      case ffNoCaseSens:
            bCS = false;
            bSporadically = true;
            break;
      default:
            bCS = m_bCaseSensitive;
            bSporadically = false;
      }
      return m_centralDir.FindFile(lpszFileName, bCS, bSporadically, bFileNameOnly);
}


Generated by  Doxygen 1.6.0   Back to index