Cogs.Foundation
Loading...
Searching...
No Matches
FileSystemWatcher.h
Go to the documentation of this file.
1#pragma once
2
3#include "../StringView.h"
4
5#include <functional>
6#include <memory>
7
8namespace Cogs {
9 struct Storage;
10
12 public:
13 enum class EventType {
14 None = 0,
15 FileCreated = 1,
16 FileDeleted = 2,
17 FileRenamed = 3,
18 FileUpdated = 4,
19 };
20
21 struct Event {
24 };
25
26 using CallbackFn = std::function<void (const Event &)>;
27 using CallbackList = std::vector<CallbackFn>;
28
31
32 bool watchFile(const StringView& path, const CallbackFn& callback);
33 bool unwatchFile(const StringView& path);
34
35 private:
36 Storage* storage = nullptr;
37 };
38}
#define COGSFOUNDATION_API
Definition: FoundationBase.h:31
Definition: FileSystemWatcher.h:11
std::vector< CallbackFn > CallbackList
Definition: FileSystemWatcher.h:27
EventType
Definition: FileSystemWatcher.h:13
std::function< void(const Event &)> CallbackFn
Definition: FileSystemWatcher.h:26
Provides a weakly referenced view over the contents of a string.
Definition: StringView.h:24
Main Cogs namespace.
Definition: MortonCode.h:5
Definition: FileSystemWatcher.h:21
EventType eventType
Definition: FileSystemWatcher.h:23
StringView path
Definition: FileSystemWatcher.h:22
Definition: FileSystemWatcher.Linux.cpp:29