Chromium Code Reviews| 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..6567a83dcbd5a2e37c70baf24017a352a7116532 |
| --- /dev/null |
| +++ b/runtime/bin/file_system_watcher.h |
| @@ -0,0 +1,55 @@ |
| +// 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 Init(); |
| + static void Stop(intptr_t id); |
|
Søren Gjesse
2013/08/23 07:47:45
Please add some comments on what the different ids
|
| + static intptr_t GetSocketId(intptr_t id, intptr_t path_id); |
| + static intptr_t AddPath(intptr_t id, |
| + const char* path, |
| + int events, |
| + bool recursive); |
| + static bool RemovePath(intptr_t id, intptr_t path_id); |
| + static intptr_t ReadEvents(intptr_t id, intptr_t path_id, Event** events); |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(FileSystemWatcher); |
| +}; |
| + |
| +} // namespace bin |
| +} // namespace dart |
| + |
| +#endif // BIN_FILE_SYSTEM_WATCHER_H_ |
| + |