Delete unused methods for replacing the "default filesystem".
Bug: webrtc:6424 Change-Id: I7f76fe71ac395088c3b632e43475933cc13e47cd Reviewed-on: https://webrtc-review.googlesource.com/83725 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Niels Moller <nisse@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23728}
This commit is contained in:
@ -117,17 +117,14 @@ std::string DirectoryIterator::Name() const {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
FilesystemInterface* Filesystem::default_filesystem_ = nullptr;
|
FilesystemInterface* Filesystem::GetFilesystem() {
|
||||||
|
|
||||||
FilesystemInterface* Filesystem::EnsureDefaultFilesystem() {
|
|
||||||
if (!default_filesystem_) {
|
|
||||||
#if defined(WEBRTC_WIN)
|
#if defined(WEBRTC_WIN)
|
||||||
default_filesystem_ = new Win32Filesystem();
|
static FilesystemInterface* const filesystem = new Win32Filesystem();
|
||||||
#else
|
#else
|
||||||
default_filesystem_ = new UnixFilesystem();
|
static FilesystemInterface* const filesystem = new UnixFilesystem();
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
return default_filesystem_;
|
return filesystem;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace rtc
|
} // namespace rtc
|
||||||
|
@ -103,46 +103,28 @@ class FilesystemInterface {
|
|||||||
|
|
||||||
class Filesystem {
|
class Filesystem {
|
||||||
public:
|
public:
|
||||||
static FilesystemInterface* default_filesystem() {
|
|
||||||
RTC_DCHECK(default_filesystem_);
|
|
||||||
return default_filesystem_;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void set_default_filesystem(FilesystemInterface* filesystem) {
|
|
||||||
default_filesystem_ = filesystem;
|
|
||||||
}
|
|
||||||
|
|
||||||
static FilesystemInterface* swap_default_filesystem(
|
|
||||||
FilesystemInterface* filesystem) {
|
|
||||||
FilesystemInterface* cur = default_filesystem_;
|
|
||||||
default_filesystem_ = filesystem;
|
|
||||||
return cur;
|
|
||||||
}
|
|
||||||
|
|
||||||
static bool DeleteFile(const Pathname& filename) {
|
static bool DeleteFile(const Pathname& filename) {
|
||||||
return EnsureDefaultFilesystem()->DeleteFile(filename);
|
return GetFilesystem()->DeleteFile(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool MoveFile(const Pathname& old_path, const Pathname& new_path) {
|
static bool MoveFile(const Pathname& old_path, const Pathname& new_path) {
|
||||||
return EnsureDefaultFilesystem()->MoveFile(old_path, new_path);
|
return GetFilesystem()->MoveFile(old_path, new_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IsFolder(const Pathname& pathname) {
|
static bool IsFolder(const Pathname& pathname) {
|
||||||
return EnsureDefaultFilesystem()->IsFolder(pathname);
|
return GetFilesystem()->IsFolder(pathname);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool IsFile(const Pathname& pathname) {
|
static bool IsFile(const Pathname& pathname) {
|
||||||
return EnsureDefaultFilesystem()->IsFile(pathname);
|
return GetFilesystem()->IsFile(pathname);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool GetFileSize(const Pathname& path, size_t* size) {
|
static bool GetFileSize(const Pathname& path, size_t* size) {
|
||||||
return EnsureDefaultFilesystem()->GetFileSize(path, size);
|
return GetFilesystem()->GetFileSize(path, size);
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static FilesystemInterface* default_filesystem_;
|
static FilesystemInterface* GetFilesystem();
|
||||||
|
|
||||||
static FilesystemInterface* EnsureDefaultFilesystem();
|
|
||||||
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Filesystem);
|
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Filesystem);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user