| 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 |
| 11 #ifndef WEBRTC_RTC_BASE_UNIXFILESYSTEM_H_ | 11 #ifndef WEBRTC_RTC_BASE_UNIXFILESYSTEM_H_ |
| 12 #define WEBRTC_RTC_BASE_UNIXFILESYSTEM_H_ | 12 #define WEBRTC_RTC_BASE_UNIXFILESYSTEM_H_ |
| 13 | 13 |
| 14 #include <sys/types.h> | 14 #include <sys/types.h> |
| 15 | 15 |
| 16 #include "webrtc/rtc_base/fileutils.h" | 16 #include "webrtc/rtc_base/fileutils.h" |
| 17 | 17 |
| 18 namespace rtc { | 18 namespace rtc { |
| 19 | 19 |
| 20 class UnixFilesystem : public FilesystemInterface { | 20 class UnixFilesystem : public FilesystemInterface { |
| 21 public: | 21 public: |
| 22 UnixFilesystem(); | 22 UnixFilesystem(); |
| 23 ~UnixFilesystem() override; | 23 ~UnixFilesystem() override; |
| 24 | 24 |
| 25 // This will attempt to delete the file located at filename. | 25 // This will attempt to delete the file located at filename. |
| 26 // It will fail with VERIY if you pass it a non-existant file, or a directory. | 26 // It will fail with VERIY if you pass it a non-existant file, or a directory. |
| 27 bool DeleteFile(const Pathname& filename) override; | 27 bool DeleteFile(const Pathname& filename) override; |
| 28 | 28 |
| 29 // Creates a directory. This will call itself recursively to create /foo/bar | 29 // Creates a directory with the given mode. Parent directory must |
| 30 // even if /foo does not exist. All created directories are created with the | 30 // already exist. Returns TRUE if function succeeds. |
| 31 // given mode. | |
| 32 // Returns TRUE if function succeeds | |
| 33 virtual bool CreateFolder(const Pathname &pathname, mode_t mode); | 31 virtual bool CreateFolder(const Pathname &pathname, mode_t mode); |
| 34 | 32 |
| 35 // As above, with mode = 0755. | 33 // As above, with mode = 0755. |
| 36 bool CreateFolder(const Pathname& pathname) override; | 34 bool CreateFolder(const Pathname& pathname) override; |
| 37 | 35 |
| 38 // This moves a file from old_path to new_path, where "file" can be a plain | 36 // This moves a file from old_path to new_path, where "file" can be a plain |
| 39 // file or directory, which will be moved recursively. | 37 // file or directory, which will be moved recursively. |
| 40 // Returns true if function succeeds. | 38 // Returns true if function succeeds. |
| 41 bool MoveFile(const Pathname& old_path, const Pathname& new_path) override; | 39 bool MoveFile(const Pathname& old_path, const Pathname& new_path) override; |
| 42 | 40 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 62 #else | 60 #else |
| 63 static char* app_temp_path_; | 61 static char* app_temp_path_; |
| 64 #endif | 62 #endif |
| 65 | 63 |
| 66 static char* CopyString(const std::string& str); | 64 static char* CopyString(const std::string& str); |
| 67 }; | 65 }; |
| 68 | 66 |
| 69 } // namespace rtc | 67 } // namespace rtc |
| 70 | 68 |
| 71 #endif // WEBRTC_RTC_BASE_UNIXFILESYSTEM_H_ | 69 #endif // WEBRTC_RTC_BASE_UNIXFILESYSTEM_H_ |
| OLD | NEW |