summaryrefslogtreecommitdiffstats
path: root/src/libs/7zip/unix/CPP/Windows/FileFind.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/7zip/unix/CPP/Windows/FileFind.h')
-rw-r--r--src/libs/7zip/unix/CPP/Windows/FileFind.h115
1 files changed, 56 insertions, 59 deletions
diff --git a/src/libs/7zip/unix/CPP/Windows/FileFind.h b/src/libs/7zip/unix/CPP/Windows/FileFind.h
index a1fd0f072..06435bb3d 100644
--- a/src/libs/7zip/unix/CPP/Windows/FileFind.h
+++ b/src/libs/7zip/unix/CPP/Windows/FileFind.h
@@ -1,10 +1,10 @@
// Windows/FileFind.h
-#ifndef __WINDOWS_FILEFIND_H
-#define __WINDOWS_FILEFIND_H
+#ifndef __WINDOWS_FILE_FIND_H
+#define __WINDOWS_FILE_FIND_H
#include "../Common/MyString.h"
-#include "FileName.h"
+#include "../Common/MyTypes.h"
#include "Defs.h"
#include <sys/types.h> /* for DIR */
@@ -26,8 +26,10 @@ namespace NAttributes
}
class CFileInfoBase
-{
- bool MatchesMask(UINT32 mask) const { return ((Attrib & mask) != 0); }
+{
+ bool MatchesMask(UINT32 mask) const { return ((Attrib & mask) != 0); }
+protected:
+ void Clear();
public:
UInt64 Size;
FILETIME CTime;
@@ -35,92 +37,87 @@ public:
FILETIME MTime;
DWORD Attrib;
bool IsDevice;
-
+
+ /*
+ #ifdef UNDER_CE
+ DWORD ObjectID;
+ #else
+ UINT32 ReparseTag;
+ #endif
+ */
+
+ bool IsArchived() const { return MatchesMask(FILE_ATTRIBUTE_ARCHIVE); }
+ bool IsCompressed() const { return MatchesMask(FILE_ATTRIBUTE_COMPRESSED); }
bool IsDir() const { return MatchesMask(FILE_ATTRIBUTE_DIRECTORY); }
+ bool IsEncrypted() const { return MatchesMask(FILE_ATTRIBUTE_ENCRYPTED); }
+ bool IsHidden() const { return MatchesMask(FILE_ATTRIBUTE_HIDDEN); }
+ bool IsNormal() const { return MatchesMask(FILE_ATTRIBUTE_NORMAL); }
+ bool IsOffline() const { return MatchesMask(FILE_ATTRIBUTE_OFFLINE); }
+ bool IsReadOnly() const { return MatchesMask(FILE_ATTRIBUTE_READONLY); }
+ bool HasReparsePoint() const { return MatchesMask(FILE_ATTRIBUTE_REPARSE_POINT); }
+ bool IsSparse() const { return MatchesMask(FILE_ATTRIBUTE_SPARSE_FILE); }
+ bool IsSystem() const { return MatchesMask(FILE_ATTRIBUTE_SYSTEM); }
+ bool IsTemporary() const { return MatchesMask(FILE_ATTRIBUTE_TEMPORARY); }
};
-class CFileInfo: public CFileInfoBase
-{
-public:
- AString Name; // FIXME CSysString Name;
- bool IsDots() const;
- bool Find(LPCSTR wildcard);
-};
+struct CFileInfo: public CFileInfoBase
+{
+ FString Name;
-// FIXME #ifdef _UNICODE
-// typedef CFileInfo CFileInfoW;
-// #else
-class CFileInfoW: public CFileInfoBase
-{
-public:
- UString Name;
bool IsDots() const;
- bool Find(LPCWSTR wildcard);
+ bool Find(CFSTR wildcard, bool ignoreLink = false);
};
-// #endif
class CFindFile
{
friend class CEnumerator;
DIR *_dirp;
AString _pattern;
- AString _directory;
+ AString _directory;
public:
- bool IsHandleAllocated() const { return (_dirp != 0); }
+ bool IsHandleAllocated() const { return (_dirp != 0); }
CFindFile(): _dirp(0) {}
- ~CFindFile() { Close(); }
- // bool FindFirst(LPCTSTR wildcard, CFileInfo &fileInfo);
- bool FindFirst(LPCSTR wildcard, CFileInfo &fileInfo);
+ ~CFindFile() { Close(); }
+ bool FindFirst(CFSTR wildcard, CFileInfo &fileInfo, bool ignoreLink = false);
bool FindNext(CFileInfo &fileInfo);
- // FIXME #ifndef _UNICODE
- bool FindFirst(LPCWSTR wildcard, CFileInfoW &fileInfo);
- bool FindNext(CFileInfoW &fileInfo);
- // FIXME #endif
bool Close();
};
-bool FindFile(LPCSTR wildcard, CFileInfo &fileInfo);
-
-bool DoesFileExist(LPCSTR name);
-bool DoesDirExist(LPCTSTR name);
-bool DoesFileOrDirExist(LPCSTR name);
-// #ifndef _UNICODE
-bool FindFile(LPCWSTR wildcard, CFileInfoW &fileInfo);
-bool DoesFileExist(LPCWSTR name);
-bool DoesDirExist(LPCWSTR name);
-bool DoesFileOrDirExist(LPCWSTR name);
-// #endif
+bool DoesFileExist(CFSTR name);
+bool DoesDirExist(CFSTR name);
+bool DoesFileOrDirExist(CFSTR name);
class CEnumerator
{
CFindFile _findFile;
- AString _wildcard; // FIXME CSysString _wildcard;
+ FString _wildcard;
+
bool NextAny(CFileInfo &fileInfo);
public:
- CEnumerator(): _wildcard(NName::kAnyStringWildcard) {}
- // FIXME CEnumerator(const CSysString &wildcard): _wildcard(wildcard) {}
- CEnumerator(const AString &wildcard): _wildcard(wildcard) {}
+ CEnumerator(const FString &wildcard): _wildcard(wildcard) {}
bool Next(CFileInfo &fileInfo);
bool Next(CFileInfo &fileInfo, bool &found);
};
-// FIXME #ifdef _UNICODE
-// typedef CEnumerator CEnumeratorW;
-// #else
-class CEnumeratorW
+#ifdef _WIN32
+class CFindChangeNotification
{
- CFindFile _findFile;
- UString _wildcard;
- bool NextAny(CFileInfoW &fileInfo);
+ HANDLE _handle;
public:
- CEnumeratorW(): _wildcard(NName::kAnyStringWildcard) {}
- CEnumeratorW(const UString &wildcard): _wildcard(wildcard) {}
- bool Next(CFileInfoW &fileInfo);
- bool Next(CFileInfoW &fileInfo, bool &found);
+ operator HANDLE () { return _handle; }
+ bool IsHandleAllocated() const { return _handle != INVALID_HANDLE_VALUE && _handle != 0; }
+ CFindChangeNotification(): _handle(INVALID_HANDLE_VALUE) {}
+ ~CFindChangeNotification() { Close(); }
+ bool Close();
+ HANDLE FindFirst(CFSTR pathName, bool watchSubtree, DWORD notifyFilter);
+ bool FindNext() { return BOOLToBool(::FindNextChangeNotification(_handle)); }
};
-// FIXME #endif
+#endif
+
+#ifndef UNDER_CE
+bool MyGetLogicalDriveStrings(CObjectVector<FString> &driveStrings);
+#endif
}}}
#endif
-