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:
nisse 2017-08-31 00:22:06 -07:00 committed by Commit Bot
parent 46f9b6cbb8
commit 125e95eaf6
5 changed files with 0 additions and 33 deletions

View File

@ -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);

View File

@ -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)

View File

@ -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;

View File

@ -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(),

View File

@ -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.