Chromium Code Reviews| Index: base/file_util.h |
| diff --git a/base/file_util.h b/base/file_util.h |
| index 177711ec0e83a8866cdfc4a50b535224fe5b6b26..4bdd8da52d9fa15f07ba62a215ba9bafa6e86169 100644 |
| --- a/base/file_util.h |
| +++ b/base/file_util.h |
| @@ -438,6 +438,18 @@ class ScopedFILEClose { |
| typedef scoped_ptr_malloc<FILE, ScopedFILEClose> ScopedFILE; |
| +// A class to handle auto-deleting a directory. |
|
Mark Mentovai
2012/02/07 19:36:42
Would ScopedTempDir (base/scoped_temp_dir.h) work
jeremy
2012/02/09 10:52:51
Done.
|
| +class ScopedDirectoryDelete { |
| + public: |
| + inline void operator()(FilePath* x) const { |
| + if (x) { |
| + file_util::Delete(*x, true); |
| + } |
| + } |
| +}; |
| + |
| +typedef scoped_ptr_malloc<FilePath, ScopedDirectoryDelete> ScopedDirectory; |
| + |
| #if defined(OS_POSIX) |
| // A class to handle auto-closing of FDs. |
| class ScopedFDClose { |