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

Side by Side Diff: base/directory_watcher.h

Issue 6377: Add a DirectoryWatcher class, allowing objects to be notified whenever... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 2 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
Property Changes:
Added: svn:eol-style
+ LF
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // This module provides a way to monitor a directory for changes.
6
7 #ifndef BASE_DIRECTORY_WATCHER_H_
8 #define BASE_DIRECTORY_WATCHER_H_
9
10 #include <string>
11 #include "base/basictypes.h"
12 #include "base/ref_counted.h"
13
14 class FilePath;
15
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
18 // directory.
19 class DirectoryWatcher {
20 public:
21 class Delegate {
22 public:
23 virtual void OnDirectoryChanged(const FilePath& path) = 0;
24 };
25
26 DirectoryWatcher();
27 ~DirectoryWatcher();
28
29 // Register interest in any changes in the directory |path|.
30 // OnDirectoryChanged will be called back for each change within the dir.
31 // Returns false on error.
32 bool Watch(const FilePath& path, Delegate* delegate);
33
34 private:
35 class Impl;
36 friend class Impl;
37 scoped_refptr<Impl> impl_;
38
39 DISALLOW_COPY_AND_ASSIGN(DirectoryWatcher);
40 };
41
42 #endif // BASE_DIRECTORY_WATCHER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698