summaryrefslogtreecommitdiff
path: root/src/shared/directoryentry.h
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-02-14 08:01:27 -0500
committerisanae <14251494+isanae@users.noreply.github.com>2020-02-18 17:25:04 -0500
commit4a74102736a20a6fa5bf9df9cc7716cbecb5b777 (patch)
tree5ecde6b6a1c2bea7e07058e730f5b3191f7d7262 /src/shared/directoryentry.h
parent75359bc9c2bd9f593c59fb156186b3491d0b7c47 (diff)
moved dump() to DirectoryEntry
static functions instead of lambdas
Diffstat (limited to 'src/shared/directoryentry.h')
-rw-r--r--src/shared/directoryentry.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/shared/directoryentry.h b/src/shared/directoryentry.h
index f406ced6..ce50da44 100644
--- a/src/shared/directoryentry.h
+++ b/src/shared/directoryentry.h
@@ -537,6 +537,8 @@ public:
void removeFiles(const std::set<FileEntry::Index> &indices);
+ void dump(const std::wstring& file) const;
+
private:
using FilesMap = std::map<std::wstring, FileEntry::Index>;
using FilesLookup = std::unordered_map<FileKey, FileEntry::Index>;
@@ -556,9 +558,9 @@ private:
std::set<int> m_Origins;
bool m_Populated;
bool m_TopLevel;
- std::mutex m_SubDirMutex;
- std::mutex m_FilesMutex;
- std::mutex m_OriginsMutex;
+ mutable std::mutex m_SubDirMutex;
+ mutable std::mutex m_FilesMutex;
+ mutable std::mutex m_OriginsMutex;
DirectoryEntry(const DirectoryEntry &reference);
@@ -600,6 +602,13 @@ private:
void addFileToList(std::wstring fileNameLower, FileEntry::Index index);
void removeFileFromList(FileEntry::Index index);
void removeFilesFromList(const std::set<FileEntry::Index>& indices);
+
+ struct Context;
+ static void onDirectoryStart(Context* cx, std::wstring_view path);
+ static void onDirectoryEnd(Context* cx, std::wstring_view path);
+ static void onFile(Context* cx, std::wstring_view path, FILETIME ft);
+
+ void dump(std::FILE* f, const std::wstring& parentPath) const;
};
} // namespace MOShared