aboutsummaryrefslogtreecommitdiff
path: root/backends/fs/windows/windows-fs.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'backends/fs/windows/windows-fs.cpp')
-rw-r--r--backends/fs/windows/windows-fs.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/backends/fs/windows/windows-fs.cpp b/backends/fs/windows/windows-fs.cpp
index 9e864753c9..c32ad2da94 100644
--- a/backends/fs/windows/windows-fs.cpp
+++ b/backends/fs/windows/windows-fs.cpp
@@ -54,7 +54,7 @@ bool WindowsFilesystemNode::isWritable() const {
return _access(_path.c_str(), W_OK) == 0;
}
-void WindowsFilesystemNode::addFile(AbstractFSList &list, ListMode mode, const char *base, WIN32_FIND_DATA* find_data) {
+void WindowsFilesystemNode::addFile(AbstractFSList &list, ListMode mode, const char *base, bool hidden, WIN32_FIND_DATA* find_data) {
WindowsFilesystemNode entry;
char *asciiName = toAscii(find_data->cFileName);
bool isDirectory;
@@ -63,6 +63,10 @@ void WindowsFilesystemNode::addFile(AbstractFSList &list, ListMode mode, const c
if (!strcmp(asciiName, ".") || !strcmp(asciiName, ".."))
return;
+ // Skip hidden files if asked
+ if ((find_data->dwFileAttributes & FILE_ATTRIBUTE_HIDDEN) && !hidden)
+ return;
+
isDirectory = (find_data->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY ? true : false);
if ((!isDirectory && mode == Common::FSNode::kListDirectoriesOnly) ||
@@ -163,8 +167,6 @@ AbstractFSNode *WindowsFilesystemNode::getChild(const Common::String &n) const {
bool WindowsFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, bool hidden) const {
assert(_isDirectory);
- //TODO: honor the hidden flag
-
if (_isPseudoRoot) {
#ifndef _WIN32_WCE
// Drives enumeration
@@ -200,10 +202,10 @@ bool WindowsFilesystemNode::getChildren(AbstractFSList &myList, ListMode mode, b
if (handle == INVALID_HANDLE_VALUE)
return false;
- addFile(myList, mode, _path.c_str(), &desc);
+ addFile(myList, mode, _path.c_str(), hidden, &desc);
while (FindNextFile(handle, &desc))
- addFile(myList, mode, _path.c_str(), &desc);
+ addFile(myList, mode, _path.c_str(), hidden, &desc);
FindClose(handle);
}