Delete unused method FilesystemInterface::IsAbsent.
BUG=webrtc:6424 Review-Url: https://codereview.webrtc.org/3012583002 Cr-Commit-Position: refs/heads/master@{#19620}
This commit is contained in:
parent
46f9b6cbb8
commit
125e95eaf6
@ -98,10 +98,6 @@ class FilesystemInterface {
|
||||
// Returns true if pathname refers to a file
|
||||
virtual bool IsFile(const Pathname& pathname) = 0;
|
||||
|
||||
// Returns true if pathname refers to no filesystem object, every parent
|
||||
// directory either exists, or is also absent.
|
||||
virtual bool IsAbsent(const Pathname& pathname) = 0;
|
||||
|
||||
virtual std::string TempFilename(const Pathname &dir,
|
||||
const std::string &prefix) = 0;
|
||||
|
||||
@ -147,10 +143,6 @@ class Filesystem {
|
||||
return EnsureDefaultFilesystem()->IsFile(pathname);
|
||||
}
|
||||
|
||||
static bool IsAbsent(const Pathname &pathname) {
|
||||
return EnsureDefaultFilesystem()->IsAbsent(pathname);
|
||||
}
|
||||
|
||||
static std::string TempFilename(const Pathname &dir,
|
||||
const std::string &prefix) {
|
||||
return EnsureDefaultFilesystem()->TempFilename(dir, prefix);
|
||||
|
||||
@ -144,14 +144,6 @@ bool UnixFilesystem::IsFile(const Pathname& pathname) {
|
||||
return res == 0 && !S_ISDIR(st.st_mode);
|
||||
}
|
||||
|
||||
bool UnixFilesystem::IsAbsent(const Pathname& pathname) {
|
||||
struct stat st;
|
||||
int res = ::stat(pathname.pathname().c_str(), &st);
|
||||
// Note: we specifically maintain ENOTDIR as an error, because that implies
|
||||
// that you could not call CreateFolder(pathname).
|
||||
return res != 0 && ENOENT == errno;
|
||||
}
|
||||
|
||||
bool UnixFilesystem::GetFileSize(const Pathname& pathname, size_t *size) {
|
||||
struct stat st;
|
||||
if (::stat(pathname.pathname().c_str(), &st) != 0)
|
||||
|
||||
@ -46,10 +46,6 @@ class UnixFilesystem : public FilesystemInterface {
|
||||
// Returns true of pathname represents an existing file
|
||||
bool IsFile(const Pathname& pathname) override;
|
||||
|
||||
// Returns true if pathname refers to no filesystem object, every parent
|
||||
// directory either exists, or is also absent.
|
||||
bool IsAbsent(const Pathname& pathname) override;
|
||||
|
||||
std::string TempFilename(const Pathname& dir,
|
||||
const std::string& prefix) override;
|
||||
|
||||
|
||||
@ -111,15 +111,6 @@ bool Win32Filesystem::IsFile(const Pathname &path) {
|
||||
return (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) == 0;
|
||||
}
|
||||
|
||||
bool Win32Filesystem::IsAbsent(const Pathname& path) {
|
||||
WIN32_FILE_ATTRIBUTE_DATA data = {0};
|
||||
if (0 != ::GetFileAttributesEx(ToUtf16(path.pathname()).c_str(),
|
||||
GetFileExInfoStandard, &data))
|
||||
return false;
|
||||
DWORD err = ::GetLastError();
|
||||
return (ERROR_FILE_NOT_FOUND == err || ERROR_PATH_NOT_FOUND == err);
|
||||
}
|
||||
|
||||
bool Win32Filesystem::GetFileSize(const Pathname &pathname, size_t *size) {
|
||||
WIN32_FILE_ATTRIBUTE_DATA data = {0};
|
||||
if (::GetFileAttributesEx(ToUtf16(pathname.pathname()).c_str(),
|
||||
|
||||
@ -38,10 +38,6 @@ class Win32Filesystem : public FilesystemInterface {
|
||||
// Returns true if a file exists at path
|
||||
bool IsFile(const Pathname& path) override;
|
||||
|
||||
// Returns true if pathname refers to no filesystem object, every parent
|
||||
// directory either exists, or is also absent.
|
||||
bool IsAbsent(const Pathname& pathname) override;
|
||||
|
||||
// All of the following functions set pathname and return true if successful.
|
||||
// Returned paths always include a trailing backslash.
|
||||
// If create is true, the path will be recursively created.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user