22 #if !defined(ZIPARCHIVE_FILEFILTER_DOT_H)
23 #define ZIPARCHIVE_FILEFILTER_DOT_H
27 #pragma warning( push )
28 #pragma warning (disable : 4100) // unreferenced formal parameter
32 #include "ZipExport.h"
36 #include "ZipCollections.h"
38 namespace ZipArchiveLib
62 :m_bInverted(bInverted)
106 bool Evaluate(LPCTSTR lpszParentDir, LPCTSTR lpszName,
const CFileInfo& info)
108 bool ret = Accept(lpszParentDir, lpszName, info);
109 if (!HandlesInversion())
110 return m_bInverted ? !ret : ret;
130 void SetInverted(
bool bInverted =
true) { m_bInverted = bInverted;}
210 virtual bool Accept(LPCTSTR lpszParentDir, LPCTSTR lpszName,
const CFileInfo& info)
236 virtual bool HandlesInversion()
const
258 int m_iAppliesToTypes;
274 toAll = toFile | toDirectory
307 :
CFileFilter(bInverted), m_matcher(lpszPattern, bCaseSensitive)
309 m_iAppliesToTypes = iAppliesToTypes;
326 bool AppliesToType(
int iType)
328 return (m_iAppliesToTypes & iType) == iType;
376 return info.
IsDirectory() ? AppliesToType(toDirectory) : AppliesToType(toFile);
379 virtual bool Accept(LPCTSTR, LPCTSTR lpszName,
const CFileInfo& info)
381 return m_matcher.IsMatch(lpszName);
432 :
CFileFilter(bInverted), m_iType(groupType), m_bAutoDelete(bAutoDelete)
444 m_filters.Add(pFilter);
455 return m_filters[uIndex];
466 return m_filters[uIndex];
477 return GetAt(uIndex);
488 return GetAt(uIndex);
502 void RemoveAt(ZIP_ARRAY_SIZE_TYPE uIndex)
506 m_filters.RemoveAt(uIndex);
524 if (m_filters.GetSize() == 0)
527 ZIP_ARRAY_SIZE_TYPE i = m_filters.GetSize() - 1;
544 ZIP_ARRAY_SIZE_TYPE GetSize()
546 return m_filters.GetSize();
609 for (ZIP_ARRAY_SIZE_TYPE i = 0; i < m_filters.GetSize(); i++)
611 if (m_filters[i]->HandlesFile(info))
624 virtual bool Accept(LPCTSTR lpszParentDir, LPCTSTR lpszName,
const CFileInfo& info);
634 bool HandlesInversion()
const
643 #if (_MSC_VER > 1000) && (defined ZIP_HAS_DLL)
644 #pragma warning (push)
645 #pragma warning( disable : 4251 ) // needs to have dll-interface to be used by clients of class
648 CZipArray<CFileFilter*> m_filters;
650 #if (_MSC_VER > 1000) && (defined ZIP_HAS_DLL)
651 #pragma warning( pop)
658 #pragma warning( pop )