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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 class FilesystemInterface { | 77 class FilesystemInterface { |
78 public: | 78 public: |
79 virtual ~FilesystemInterface() {} | 79 virtual ~FilesystemInterface() {} |
80 | 80 |
81 // This will attempt to delete the path located at filename. | 81 // This will attempt to delete the path located at filename. |
82 // It DCHECKs and returns false if the path points to a folder or a | 82 // It DCHECKs and returns false if the path points to a folder or a |
83 // non-existent file. | 83 // non-existent file. |
84 virtual bool DeleteFile(const Pathname &filename) = 0; | 84 virtual bool DeleteFile(const Pathname &filename) = 0; |
85 | 85 |
86 // Creates a directory. This will call itself recursively to create /foo/bar | 86 // Creates a directory. Parent directory must already exist. Returns |
87 // even if /foo does not exist. Returns true if the function succeeds. | 87 // true if the function succeeds. |
88 virtual bool CreateFolder(const Pathname &pathname) = 0; | 88 virtual bool CreateFolder(const Pathname &pathname) = 0; |
89 | 89 |
90 // This moves a file from old_path to new_path, where "old_path" is a | 90 // This moves a file from old_path to new_path, where "old_path" is a |
91 // plain file. This DCHECKs and returns false if old_path points to a | 91 // plain file. This DCHECKs and returns false if old_path points to a |
92 // directory, and returns true if the function succeeds. | 92 // directory, and returns true if the function succeeds. |
93 virtual bool MoveFile(const Pathname &old_path, const Pathname &new_path) = 0; | 93 virtual bool MoveFile(const Pathname &old_path, const Pathname &new_path) = 0; |
94 | 94 |
95 // Returns true if pathname refers to a directory | 95 // Returns true if pathname refers to a directory |
96 virtual bool IsFolder(const Pathname& pathname) = 0; | 96 virtual bool IsFolder(const Pathname& pathname) = 0; |
97 | 97 |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 private: | 163 private: |
164 static FilesystemInterface* default_filesystem_; | 164 static FilesystemInterface* default_filesystem_; |
165 | 165 |
166 static FilesystemInterface *EnsureDefaultFilesystem(); | 166 static FilesystemInterface *EnsureDefaultFilesystem(); |
167 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Filesystem); | 167 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Filesystem); |
168 }; | 168 }; |
169 | 169 |
170 } // namespace rtc | 170 } // namespace rtc |
171 | 171 |
172 #endif // WEBRTC_RTC_BASE_FILEUTILS_H_ | 172 #endif // WEBRTC_RTC_BASE_FILEUTILS_H_ |
OLD | NEW |