harfang3d/harfang/platform/filesystem_watcher.h
2021-10-13 14:40:31 +02:00

26 lines
638 B
C++

// HARFANG(R) Copyright (C) 2021 Emmanuel Julien, NWNC HARFANG. Released under GPL/LGPL/Commercial Licence, see licence.txt for details.
#pragma once
#include <string>
#include <vector>
namespace hg {
struct WatchEvent {
enum Type { FileAdded, FileRemoved, FileModified };
Type type;
std::string path;
bool operator==(const WatchEvent &e) const { return e.type == type && e.path == path; }
};
void WatchDirectory(const std::string &path, bool recursive);
void UnwatchDirectory(const std::string &path);
void UnwatchAllDirectories();
std::vector<WatchEvent> GetDirectoryWatchEvents(const std::string &path);
} // namespace hg