OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef BASE_FILES_SCOPED_TEMP_DIR_H_ | 5 #ifndef BASE_FILES_SCOPED_TEMP_DIR_H_ |
6 #define BASE_FILES_SCOPED_TEMP_DIR_H_ | 6 #define BASE_FILES_SCOPED_TEMP_DIR_H_ |
7 | 7 |
8 // An object representing a temporary / scratch directory that should be cleaned | 8 // An object representing a temporary / scratch directory that should be cleaned |
9 // up (recursively) when this object goes out of scope. Note that since | 9 // up (recursively) when this object goes out of scope. Note that since |
10 // deletion occurs during the destructor, no further error handling is possible | 10 // deletion occurs during the destructor, no further error handling is possible |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 // when this object goes out of scope. | 47 // when this object goes out of scope. |
48 FilePath Take(); | 48 FilePath Take(); |
49 | 49 |
50 // Returns the path to the created directory. Call one of the | 50 // Returns the path to the created directory. Call one of the |
51 // CreateUniqueTempDir* methods before getting the path. | 51 // CreateUniqueTempDir* methods before getting the path. |
52 const FilePath& GetPath() const; | 52 const FilePath& GetPath() const; |
53 | 53 |
54 // Returns true if path_ is non-empty and exists. | 54 // Returns true if path_ is non-empty and exists. |
55 bool IsValid() const; | 55 bool IsValid() const; |
56 | 56 |
| 57 // Returns the prefix used for temp directory names generated by |
| 58 // ScopedTempDirs. |
| 59 static const FilePath::CharType* GetTempDirPrefix(); |
| 60 |
57 private: | 61 private: |
58 FilePath path_; | 62 FilePath path_; |
59 | 63 |
60 DISALLOW_COPY_AND_ASSIGN(ScopedTempDir); | 64 DISALLOW_COPY_AND_ASSIGN(ScopedTempDir); |
61 }; | 65 }; |
62 | 66 |
63 } // namespace base | 67 } // namespace base |
64 | 68 |
65 #endif // BASE_FILES_SCOPED_TEMP_DIR_H_ | 69 #endif // BASE_FILES_SCOPED_TEMP_DIR_H_ |
OLD | NEW |