DirectoryReader: rename Failed() to HasFailed() for consistency with TextFile
This commit is contained in:
parent
df3e7a9248
commit
896015bf53
@ -100,7 +100,7 @@ check_directory(const char *path_utf8, const Path &path_fs)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
const DirectoryReader reader(path_fs);
|
const DirectoryReader reader(path_fs);
|
||||||
if (reader.Failed() && errno == EACCES)
|
if (reader.HasFailed() && errno == EACCES)
|
||||||
g_warning("No permission to read directory: %s", path_utf8);
|
g_warning("No permission to read directory: %s", path_utf8);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,14 +47,14 @@ public:
|
|||||||
* Destroys this instance.
|
* Destroys this instance.
|
||||||
*/
|
*/
|
||||||
~DirectoryReader() {
|
~DirectoryReader() {
|
||||||
if (!Failed())
|
if (!HasFailed())
|
||||||
closedir(dirp);
|
closedir(dirp);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if directory failed to open.
|
* Checks if directory failed to open.
|
||||||
*/
|
*/
|
||||||
bool Failed() const {
|
bool HasFailed() const {
|
||||||
return dirp == nullptr;
|
return dirp == nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ public:
|
|||||||
* Checks if directory entry is available.
|
* Checks if directory entry is available.
|
||||||
*/
|
*/
|
||||||
bool HasEntry() const {
|
bool HasEntry() const {
|
||||||
assert(!Failed());
|
assert(!HasFailed());
|
||||||
return ent != nullptr;
|
return ent != nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ public:
|
|||||||
* Reads next directory entry.
|
* Reads next directory entry.
|
||||||
*/
|
*/
|
||||||
bool ReadEntry() {
|
bool ReadEntry() {
|
||||||
assert(!Failed());
|
assert(!HasFailed());
|
||||||
ent = readdir(dirp);
|
ent = readdir(dirp);
|
||||||
return HasEntry();
|
return HasEntry();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user