X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Ffs%2Fstat.h;h=3f056a5609eea802716037eb734c3d42ef51905d;hp=6ae551fd13836955bbd6a11f347a2b236abe0022;hb=817e584903996a041692640720a5a272d847a3c7;hpb=5a006c4fce0893b63f881a6c9ecd010f15770428 diff --git a/source/fs/stat.h b/source/fs/stat.h index 6ae551f..3f056a5 100644 --- a/source/fs/stat.h +++ b/source/fs/stat.h @@ -2,6 +2,7 @@ #define MSP_FS_STAT_H_ #include +#include #include #include "path.h" @@ -16,11 +17,7 @@ enum FileType SYMLINK }; -#ifdef MSVC -typedef __uint64 FileSize; -#else -typedef unsigned long long FileSize; -#endif +typedef UInt64 FileSize; /** Holds file information. @@ -30,16 +27,25 @@ class Stat private: struct Private; + struct OwnerInfo + { + std::string owner; + std::string group; + }; + bool exists; FileType type; FileSize size; FileSize alloc_size; Time::TimeStamp mtime; - std::string owner; - std::string group; + mutable OwnerInfo owner_info; + Private *priv; public: Stat(); + Stat(const Stat &); + Stat &operator=(const Stat &); + ~Stat(); FileType get_type() const { return type; } bool is_regular() const { return type==REGULAR; } @@ -48,8 +54,8 @@ public: FileSize get_size() const { return size; } FileSize get_alloc_size() const { return alloc_size; } const Time::TimeStamp &get_modify_time() const { return mtime; } - const std::string &get_owner() const { return owner; } - const std::string &get_group() const { return group; } + const std::string &get_owner() const; + const std::string &get_group() const; operator bool() const { return exists; }