SleakEngine 0.1.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
FileWatcher.hpp
Go to the documentation of this file.
1#ifndef _FILE_WATCHER_HPP_
2#define _FILE_WATCHER_HPP_
3
4#include <Core/OSDef.hpp>
5#include <memory>
6#include <string>
7#include <vector>
8
9namespace Sleak {
10
11/// Reports files saved inside watched directories. Not recursive.
12/// Generic: shader, library and asset hot reload all build on it.
13/// @ingroup core
14class ENGINE_API FileWatcher {
15 public:
18 FileWatcher(const FileWatcher&) = delete;
20
21 /// Starts watching a directory. Returns false if it can't be watched.
22 bool AddDirectory(const std::string& dir);
23
24 /// Appends full paths of files saved since the last call. Never blocks.
25 void Poll(std::vector<std::string>& outChanged);
26
27 private:
28 struct Impl;
29 std::unique_ptr<Impl> m_impl;
30};
31
32} // namespace Sleak
33
34#endif
FileWatcher & operator=(const FileWatcher &)=delete
void Poll(std::vector< std::string > &outChanged)
Appends full paths of files saved since the last call. Never blocks.
bool AddDirectory(const std::string &dir)
Starts watching a directory. Returns false if it can't be watched.
FileWatcher(const FileWatcher &)=delete
Root namespace for everything the engine exposes.
Definition Camera.hpp:10