mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00:00
LibCore: Add "static bool Core::File::exists(filename)"
This commit is contained in:
@@ -100,4 +100,10 @@ bool File::is_directory(const String& filename)
|
|||||||
return S_ISDIR(st.st_mode);
|
return S_ISDIR(st.st_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool File::exists(const String& filename)
|
||||||
|
{
|
||||||
|
struct stat st;
|
||||||
|
return stat(filename.characters(), &st) == 0;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,6 +42,8 @@ public:
|
|||||||
bool is_directory() const;
|
bool is_directory() const;
|
||||||
static bool is_directory(const String& filename);
|
static bool is_directory(const String& filename);
|
||||||
|
|
||||||
|
static bool exists(const String& filename);
|
||||||
|
|
||||||
virtual bool open(IODevice::OpenMode) override;
|
virtual bool open(IODevice::OpenMode) override;
|
||||||
|
|
||||||
enum class ShouldCloseFileDescription {
|
enum class ShouldCloseFileDescription {
|
||||||
|
|||||||
Reference in New Issue
Block a user