Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(476)

Side by Side Diff: runtime/bin/file_system_watcher.h

Issue 19263003: Add FileSystemWatcher class to dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix android socket. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/file_patch.dart ('k') | runtime/bin/file_system_watcher.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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 BIN_FILE_SYSTEM_WATCHER_H_
6 #define BIN_FILE_SYSTEM_WATCHER_H_
7
8 #include <stdlib.h>
9 #include <string.h>
10 #include <stdio.h>
11 #include <sys/types.h>
12
13 #include "bin/builtin.h"
14 #include "bin/dartutils.h"
15
16
17 namespace dart {
18 namespace bin {
19
20 class FileSystemWatcher {
21 public:
22 enum EventType {
23 kCreate = 1 << 0,
24 kModifyContent = 1 << 1,
25 kDelete = 1 << 2,
26 kMove = 1 << 3,
27 kModefyAttribute = 1 << 4
28 };
29
30 struct Event {
31 intptr_t path_id;
32 int event;
33 const char* filename;
34 int link;
35 };
36
37 static intptr_t WatchPath(const char* path, int events, bool recursive);
38 static void UnwatchPath(intptr_t id);
39 static intptr_t GetSocketId(intptr_t id);
40 static Dart_Handle ReadEvents(intptr_t id);
41
42 private:
43 DISALLOW_COPY_AND_ASSIGN(FileSystemWatcher);
44 };
45
46 } // namespace bin
47 } // namespace dart
48
49 #endif // BIN_FILE_SYSTEM_WATCHER_H_
50
OLDNEW
« no previous file with comments | « runtime/bin/file_patch.dart ('k') | runtime/bin/file_system_watcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698