Delete unused method FilesystemInterface::GetFileTime.
BUG=webrtc:6424 Review-Url: https://codereview.webrtc.org/2926713007 Cr-Commit-Position: refs/heads/master@{#18564}
This commit is contained in:
@ -74,8 +74,6 @@ class DirectoryIterator {
|
||||
#endif
|
||||
};
|
||||
|
||||
enum FileTimeType { FTT_CREATED, FTT_MODIFIED, FTT_ACCESSED };
|
||||
|
||||
class FilesystemInterface {
|
||||
public:
|
||||
virtual ~FilesystemInterface() {}
|
||||
@ -114,10 +112,6 @@ class FilesystemInterface {
|
||||
|
||||
// Determines the size of the file indicated by path.
|
||||
virtual bool GetFileSize(const Pathname& path, size_t* size) = 0;
|
||||
|
||||
// Determines a timestamp associated with the file indicated by path.
|
||||
virtual bool GetFileTime(const Pathname& path, FileTimeType which,
|
||||
time_t* time) = 0;
|
||||
};
|
||||
|
||||
class Filesystem {
|
||||
@ -176,11 +170,6 @@ class Filesystem {
|
||||
return EnsureDefaultFilesystem()->GetFileSize(path, size);
|
||||
}
|
||||
|
||||
static bool GetFileTime(const Pathname& path, FileTimeType which,
|
||||
time_t* time) {
|
||||
return EnsureDefaultFilesystem()->GetFileTime(path, which, time);
|
||||
}
|
||||
|
||||
private:
|
||||
static FilesystemInterface* default_filesystem_;
|
||||
|
||||
|
||||
@ -218,27 +218,6 @@ bool UnixFilesystem::GetFileSize(const Pathname& pathname, size_t *size) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool UnixFilesystem::GetFileTime(const Pathname& path, FileTimeType which,
|
||||
time_t* time) {
|
||||
struct stat st;
|
||||
if (::stat(path.pathname().c_str(), &st) != 0)
|
||||
return false;
|
||||
switch (which) {
|
||||
case FTT_CREATED:
|
||||
*time = st.st_ctime;
|
||||
break;
|
||||
case FTT_MODIFIED:
|
||||
*time = st.st_mtime;
|
||||
break;
|
||||
case FTT_ACCESSED:
|
||||
*time = st.st_atime;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
char* UnixFilesystem::CopyString(const std::string& str) {
|
||||
size_t size = str.length() + 1;
|
||||
|
||||
|
||||
@ -72,9 +72,6 @@ class UnixFilesystem : public FilesystemInterface {
|
||||
const std::string* append) override;
|
||||
|
||||
bool GetFileSize(const Pathname& path, size_t* size) override;
|
||||
bool GetFileTime(const Pathname& path,
|
||||
FileTimeType which,
|
||||
time_t* time) override;
|
||||
|
||||
private:
|
||||
#if defined(WEBRTC_ANDROID) || defined(WEBRTC_MAC)
|
||||
|
||||
@ -152,26 +152,4 @@ bool Win32Filesystem::GetFileSize(const Pathname &pathname, size_t *size) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Win32Filesystem::GetFileTime(const Pathname& path, FileTimeType which,
|
||||
time_t* time) {
|
||||
WIN32_FILE_ATTRIBUTE_DATA data = {0};
|
||||
if (::GetFileAttributesEx(ToUtf16(path.pathname()).c_str(),
|
||||
GetFileExInfoStandard, &data) == 0)
|
||||
return false;
|
||||
switch (which) {
|
||||
case FTT_CREATED:
|
||||
FileTimeToUnixTime(data.ftCreationTime, time);
|
||||
break;
|
||||
case FTT_MODIFIED:
|
||||
FileTimeToUnixTime(data.ftLastWriteTime, time);
|
||||
break;
|
||||
case FTT_ACCESSED:
|
||||
FileTimeToUnixTime(data.ftLastAccessTime, time);
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace rtc
|
||||
|
||||
@ -51,9 +51,6 @@ class Win32Filesystem : public FilesystemInterface {
|
||||
const std::string& prefix) override;
|
||||
|
||||
bool GetFileSize(const Pathname& path, size_t* size) override;
|
||||
bool GetFileTime(const Pathname& path,
|
||||
FileTimeType which,
|
||||
time_t* time) override;
|
||||
|
||||
// A folder appropriate for storing temporary files (Contents are
|
||||
// automatically deleted when the program exists)
|
||||
|
||||
Reference in New Issue
Block a user