summaryrefslogtreecommitdiff
path: root/zen/file_traverser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'zen/file_traverser.cpp')
-rw-r--r--zen/file_traverser.cpp45
1 files changed, 11 insertions, 34 deletions
diff --git a/zen/file_traverser.cpp b/zen/file_traverser.cpp
index aa46d4f0..986e0ad8 100644
--- a/zen/file_traverser.cpp
+++ b/zen/file_traverser.cpp
@@ -225,7 +225,6 @@ struct Win32Traverser
return true;
}
- template <class FindData>
static void extractFileInfo(const FindData& fileInfo, DWORD volumeSerial, TraverseCallback::FileInfo& output)
{
output.fileSize = UInt64(fileInfo.nFileSizeLow, fileInfo.nFileSizeHigh);
@@ -233,23 +232,12 @@ struct Win32Traverser
output.id = FileId();
}
- template <class FindData>
- static Int64 getModTime(const FindData& fileInfo) { return toTimeT(fileInfo.ftLastWriteTime); }
-
- template <class FindData>
- static const FILETIME& getModTimeRaw(const FindData& fileInfo) { return fileInfo.ftLastWriteTime; }
-
- template <class FindData>
+ static Int64 getModTime (const FindData& fileInfo) { return toTimeT(fileInfo.ftLastWriteTime); }
+ static const FILETIME& getModTimeRaw (const FindData& fileInfo) { return fileInfo.ftLastWriteTime; }
static const FILETIME& getCreateTimeRaw(const FindData& fileInfo) { return fileInfo.ftCreationTime; }
-
- template <class FindData>
- static const wchar_t* getShortName(const FindData& fileInfo) { return fileInfo.cFileName; }
-
- template <class FindData>
- static bool isDirectory(const FindData& fileInfo) { return (fileInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; }
-
- template <class FindData>
- static bool isSymlink(const FindData& fileInfo) { return (fileInfo.dwFileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0; }
+ static const wchar_t* getShortName (const FindData& fileInfo) { return fileInfo.cFileName; }
+ static bool isDirectory (const FindData& fileInfo) { return (fileInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; }
+ static bool isSymlink (const FindData& fileInfo) { return zen::isSymlink(fileInfo); } //[!] keep namespace
};
@@ -295,10 +283,10 @@ struct FilePlusTraverser
//else we have a problem... report it:
throw FileError(replaceCpy(_("Cannot read directory %x."), L"%x", fmtFileName(directory)) + L"\n\n" + getLastErrorFormatted(lastError) + L" (+)");
}
+
return true;
}
- template <class FindData>
static void extractFileInfo(const FindData& fileInfo, DWORD volumeSerial, TraverseCallback::FileInfo& output)
{
output.fileSize = fileInfo.fileSize.QuadPart;
@@ -306,23 +294,12 @@ struct FilePlusTraverser
output.id = extractFileID(volumeSerial, fileInfo.fileId);
}
- template <class FindData>
- static Int64 getModTime(const FindData& fileInfo) { return toTimeT(fileInfo.lastWriteTime); }
-
- template <class FindData>
- static const FILETIME& getModTimeRaw(const FindData& fileInfo) { return fileInfo.lastWriteTime; }
-
- template <class FindData>
+ static Int64 getModTime (const FindData& fileInfo) { return toTimeT(fileInfo.lastWriteTime); }
+ static const FILETIME& getModTimeRaw (const FindData& fileInfo) { return fileInfo.lastWriteTime; }
static const FILETIME& getCreateTimeRaw(const FindData& fileInfo) { return fileInfo.creationTime; }
-
- template <class FindData>
- static const wchar_t* getShortName(const FindData& fileInfo) { return fileInfo.shortName; }
-
- template <class FindData>
- static bool isDirectory(const FindData& fileInfo) { return (fileInfo.fileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; }
-
- template <class FindData>
- static bool isSymlink(const FindData& fileInfo) { return (fileInfo.fileAttributes & FILE_ATTRIBUTE_REPARSE_POINT) != 0; }
+ static const wchar_t* getShortName (const FindData& fileInfo) { return fileInfo.shortName; }
+ static bool isDirectory (const FindData& fileInfo) { return (fileInfo.fileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; }
+ static bool isSymlink (const FindData& fileInfo) { return zen::isSymlink(fileInfo.fileAttributes, fileInfo.reparseTag); } //[!] keep namespace
};
bgstack15