OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 | 78 |
79 class FilesystemInterface { | 79 class FilesystemInterface { |
80 public: | 80 public: |
81 virtual ~FilesystemInterface() {} | 81 virtual ~FilesystemInterface() {} |
82 | 82 |
83 // This will attempt to delete the path located at filename. | 83 // This will attempt to delete the path located at filename. |
84 // It DCHECKs and returns false if the path points to a folder or a | 84 // It DCHECKs and returns false if the path points to a folder or a |
85 // non-existent file. | 85 // non-existent file. |
86 virtual bool DeleteFile(const Pathname &filename) = 0; | 86 virtual bool DeleteFile(const Pathname &filename) = 0; |
87 | 87 |
88 // This will attempt to delete the empty folder located at 'folder' | |
89 // It DCHECKs and returns false if the path points to a file or a non-existent | |
90 // folder. It fails normally if the folder is not empty or can otherwise | |
91 // not be deleted. | |
92 virtual bool DeleteEmptyFolder(const Pathname &folder) = 0; | |
93 | |
94 // Creates a directory. This will call itself recursively to create /foo/bar | 88 // Creates a directory. This will call itself recursively to create /foo/bar |
95 // even if /foo does not exist. Returns true if the function succeeds. | 89 // even if /foo does not exist. Returns true if the function succeeds. |
96 virtual bool CreateFolder(const Pathname &pathname) = 0; | 90 virtual bool CreateFolder(const Pathname &pathname) = 0; |
97 | 91 |
98 // This moves a file from old_path to new_path, where "old_path" is a | 92 // This moves a file from old_path to new_path, where "old_path" is a |
99 // plain file. This DCHECKs and returns false if old_path points to a | 93 // plain file. This DCHECKs and returns false if old_path points to a |
100 // directory, and returns true if the function succeeds. | 94 // directory, and returns true if the function succeeds. |
101 virtual bool MoveFile(const Pathname &old_path, const Pathname &new_path) = 0; | 95 virtual bool MoveFile(const Pathname &old_path, const Pathname &new_path) = 0; |
102 | 96 |
103 // Returns true if pathname refers to a directory | 97 // Returns true if pathname refers to a directory |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 private: | 221 private: |
228 static FilesystemInterface* default_filesystem_; | 222 static FilesystemInterface* default_filesystem_; |
229 | 223 |
230 static FilesystemInterface *EnsureDefaultFilesystem(); | 224 static FilesystemInterface *EnsureDefaultFilesystem(); |
231 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Filesystem); | 225 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Filesystem); |
232 }; | 226 }; |
233 | 227 |
234 } // namespace rtc | 228 } // namespace rtc |
235 | 229 |
236 #endif // WEBRTC_BASE_FILEUTILS_H_ | 230 #endif // WEBRTC_BASE_FILEUTILS_H_ |
OLD | NEW |