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 // Returns a DirectoryIterator for a given pathname. | 83 // Returns a DirectoryIterator for a given pathname. |
84 // TODO: Do fancy abstracted stuff | 84 // TODO: Do fancy abstracted stuff |
85 virtual DirectoryIterator* IterateDirectory(); | 85 virtual DirectoryIterator* IterateDirectory(); |
86 | 86 |
87 // Opens a file. Returns an open StreamInterface if function succeeds. | 87 // Opens a file. Returns an open StreamInterface if function succeeds. |
88 // Otherwise, returns NULL. | 88 // Otherwise, returns null. |
89 // TODO: Add an error param to indicate failure reason, similar to | 89 // TODO: Add an error param to indicate failure reason, similar to |
90 // FileStream::Open | 90 // FileStream::Open |
91 virtual FileStream *OpenFile(const Pathname &filename, | 91 virtual FileStream *OpenFile(const Pathname &filename, |
92 const std::string &mode) = 0; | 92 const std::string &mode) = 0; |
93 | 93 |
94 // This will attempt to delete the path located at filename. | 94 // This will attempt to delete the path located at filename. |
95 // It DCHECKs and returns false if the path points to a folder or a | 95 // It DCHECKs and returns false if the path points to a folder or a |
96 // non-existent file. | 96 // non-existent file. |
97 virtual bool DeleteFile(const Pathname &filename) = 0; | 97 virtual bool DeleteFile(const Pathname &filename) = 0; |
98 | 98 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 private: | 292 private: |
293 static FilesystemInterface* default_filesystem_; | 293 static FilesystemInterface* default_filesystem_; |
294 | 294 |
295 static FilesystemInterface *EnsureDefaultFilesystem(); | 295 static FilesystemInterface *EnsureDefaultFilesystem(); |
296 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Filesystem); | 296 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Filesystem); |
297 }; | 297 }; |
298 | 298 |
299 } // namespace rtc | 299 } // namespace rtc |
300 | 300 |
301 #endif // WEBRTC_BASE_FILEUTILS_H_ | 301 #endif // WEBRTC_BASE_FILEUTILS_H_ |
OLD | NEW |