]> git.tdb.fi Git - libs/core.git/blobdiff - source/fs/stat.h
Defer the retrieval of owner/group names until they are needed
[libs/core.git] / source / fs / stat.h
index 6ae551fd13836955bbd6a11f347a2b236abe0022..8c05771ebe9b85bd27b42fb4e674a4b1a1f5d2b4 100644 (file)
@@ -30,16 +30,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 +57,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; }