X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Ffs%2Fstat.h;h=6ae551fd13836955bbd6a11f347a2b236abe0022;hp=0d5f6de184b6f7a725e648119172573125799375;hb=5a006c4fce0893b63f881a6c9ecd010f15770428;hpb=3ba7e8ca4cc6a2c77028d49687d29364f9e1ca26 diff --git a/source/fs/stat.h b/source/fs/stat.h index 0d5f6de..6ae551f 100644 --- a/source/fs/stat.h +++ b/source/fs/stat.h @@ -30,6 +30,7 @@ class Stat private: struct Private; + bool exists; FileType type; FileSize size; FileSize alloc_size; @@ -37,8 +38,9 @@ private: std::string owner; std::string group; - Stat(); public: + Stat(); + FileType get_type() const { return type; } bool is_regular() const { return type==REGULAR; } bool is_directory() const { return type==DIRECTORY; } @@ -49,6 +51,8 @@ public: const std::string &get_owner() const { return owner; } const std::string &get_group() const { return group; } + operator bool() const { return exists; } + /// Returns a Stat object describing a file. static Stat stat(const Path &); static Stat lstat(const Path &);