Flutter Engine
The Flutter Engine
file_system_watcher.h
Go to the documentation of this file.
1// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5#ifndef RUNTIME_BIN_FILE_SYSTEM_WATCHER_H_
6#define RUNTIME_BIN_FILE_SYSTEM_WATCHER_H_
7
8#include <stdio.h>
9#include <stdlib.h>
10#include <string.h>
11#include <sys/types.h>
12
13#include "bin/builtin.h"
14#include "bin/dartutils.h"
15#include "bin/namespace.h"
16
17namespace dart {
18namespace bin {
19
21 public:
22 enum EventType {
23 kCreate = 1 << 0,
25 kDelete = 1 << 2,
26 kMove = 1 << 3,
28 kDeleteSelf = 1 << 5,
29 kIsDir = 1 << 6
30 };
31
32 struct Event {
33 intptr_t path_id;
34 int event;
35 const char* filename;
36 int link;
37 };
38
39 static bool IsSupported();
40 static intptr_t Init();
41 static void Close(intptr_t id);
42 static intptr_t WatchPath(intptr_t id,
43 Namespace* namespc,
44 const char* path,
45 int events,
46 bool recursive);
47 static void UnwatchPath(intptr_t id, intptr_t path_id);
48 static intptr_t GetSocketId(intptr_t id, intptr_t path_id);
49 static Dart_Handle ReadEvents(intptr_t id, intptr_t path_id);
50
52 delayed_filewatch_callback_ = value;
53 }
55 return delayed_filewatch_callback_;
56 }
57
58 private:
59 static bool delayed_filewatch_callback_;
60 DISALLOW_COPY_AND_ASSIGN(FileSystemWatcher);
61};
62
63} // namespace bin
64} // namespace dart
65
66#endif // RUNTIME_BIN_FILE_SYSTEM_WATCHER_H_
static intptr_t GetSocketId(intptr_t id, intptr_t path_id)
static void Close(intptr_t id)
static void UnwatchPath(intptr_t id, intptr_t path_id)
static void set_delayed_filewatch_callback(bool value)
static Dart_Handle ReadEvents(intptr_t id, intptr_t path_id)
static intptr_t WatchPath(intptr_t id, Namespace *namespc, const char *path, int events, bool recursive)
struct _Dart_Handle * Dart_Handle
Definition: dart_api.h:258
uint8_t value
Definition: dart_vm.cc:33
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57