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

Side by Side Diff: base/directory_watcher.h

Issue 13255: Properly fix DirWatcherTest.SubDir on Vista. (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years 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 | « no previous file | base/directory_watcher_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This module provides a way to monitor a directory for changes. 5 // This module provides a way to monitor a directory for changes.
6 6
7 #ifndef BASE_DIRECTORY_WATCHER_H_ 7 #ifndef BASE_DIRECTORY_WATCHER_H_
8 #define BASE_DIRECTORY_WATCHER_H_ 8 #define BASE_DIRECTORY_WATCHER_H_
9 9
10 #include <string> 10 #include <string>
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/ref_counted.h" 12 #include "base/ref_counted.h"
13 13
14 class FilePath; 14 class FilePath;
15 15
16 // This class lets you register interest in changes on a directory. 16 // This class lets you register interest in changes on a directory.
17 // The delegate will get called whenever a file is added or changed in the 17 // The delegate will get called whenever a file is added, deleted,
18 // directory. 18 // renamed or modified in the directory, and also when a directory
19 // is created, deleted or renamed in the directory. Does not watch
20 // subdirectories.
19 class DirectoryWatcher { 21 class DirectoryWatcher {
20 public: 22 public:
21 class Delegate { 23 class Delegate {
22 public: 24 public:
23 virtual void OnDirectoryChanged(const FilePath& path) = 0; 25 virtual void OnDirectoryChanged(const FilePath& path) = 0;
24 }; 26 };
25 27
26 DirectoryWatcher(); 28 DirectoryWatcher();
27 ~DirectoryWatcher(); 29 ~DirectoryWatcher();
28 30
29 // Register interest in any changes in the directory |path|. 31 // Register interest in any changes in the directory |path|.
30 // OnDirectoryChanged will be called back for each change within the dir. 32 // OnDirectoryChanged will be called back for each change within the dir.
31 // Returns false on error. 33 // Returns false on error.
32 bool Watch(const FilePath& path, Delegate* delegate); 34 bool Watch(const FilePath& path, Delegate* delegate);
33 35
34 private: 36 private:
35 class Impl; 37 class Impl;
36 friend class Impl; 38 friend class Impl;
37 scoped_refptr<Impl> impl_; 39 scoped_refptr<Impl> impl_;
38 40
39 DISALLOW_COPY_AND_ASSIGN(DirectoryWatcher); 41 DISALLOW_COPY_AND_ASSIGN(DirectoryWatcher);
40 }; 42 };
41 43
42 #endif // BASE_DIRECTORY_WATCHER_H_ 44 #endif // BASE_DIRECTORY_WATCHER_H_
OLDNEW
« no previous file with comments | « no previous file | base/directory_watcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698