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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/file_patch.dart ('k') | runtime/bin/file_system_watcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/file_system_watcher.h
diff --git a/runtime/bin/file_system_watcher.h b/runtime/bin/file_system_watcher.h
new file mode 100644
index 0000000000000000000000000000000000000000..31ae8d87519fb02bbf6ae3b5afd7ff750cdc6cb4
--- /dev/null
+++ b/runtime/bin/file_system_watcher.h
@@ -0,0 +1,50 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#ifndef BIN_FILE_SYSTEM_WATCHER_H_
+#define BIN_FILE_SYSTEM_WATCHER_H_
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdio.h>
+#include <sys/types.h>
+
+#include "bin/builtin.h"
+#include "bin/dartutils.h"
+
+
+namespace dart {
+namespace bin {
+
+class FileSystemWatcher {
+ public:
+ enum EventType {
+ kCreate = 1 << 0,
+ kModifyContent = 1 << 1,
+ kDelete = 1 << 2,
+ kMove = 1 << 3,
+ kModefyAttribute = 1 << 4
+ };
+
+ struct Event {
+ intptr_t path_id;
+ int event;
+ const char* filename;
+ int link;
+ };
+
+ static intptr_t WatchPath(const char* path, int events, bool recursive);
+ static void UnwatchPath(intptr_t id);
+ static intptr_t GetSocketId(intptr_t id);
+ static Dart_Handle ReadEvents(intptr_t id);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(FileSystemWatcher);
+};
+
+} // namespace bin
+} // namespace dart
+
+#endif // BIN_FILE_SYSTEM_WATCHER_H_
+
« 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