Cogs.Core
Cogs.Foundation
Source
Platform
FileSystemWatcher.h
1
#pragma once
2
3
#include "../StringView.h"
4
5
#include <functional>
6
#include <memory>
7
8
namespace
Cogs
{
9
struct
Storage;
10
11
class
COGSFOUNDATION_API
FileSystemWatcher
{
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
{
22
StringView
path;
23
EventType eventType;
24
};
25
26
using
CallbackFn = std::function<void (
const
Event
&)>;
27
using
CallbackList = std::vector<CallbackFn>;
28
29
FileSystemWatcher
();
30
~FileSystemWatcher
();
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
}
Cogs::FileSystemWatcher
Definition:
FileSystemWatcher.h:11
Cogs::StringView
Provides a weakly referenced view over the contents of a string.
Definition:
StringView.h:24
Cogs
Contains all Cogs related functionality.
Definition:
FieldSetter.h:23
Cogs::FileSystemWatcher::Event
Definition:
FileSystemWatcher.h:21
Cogs::Storage
Definition:
FileSystemWatcher.Linux.cpp:29
Generated by
1.9.6