]> git.tdb.fi Git - libs/core.git/blobdiff - source/fs/stat.h
Add move semantics to Variant
[libs/core.git] / source / fs / stat.h
index 8c05771ebe9b85bd27b42fb4e674a4b1a1f5d2b4..fd6a2f75ba6092e7f72181b95b7c8fb332428fe8 100644 (file)
@@ -1,7 +1,9 @@
 #ifndef MSP_FS_STAT_H_
 #define MSP_FS_STAT_H_
 
+#include <cstdint>
 #include <string>
+#include <msp/core/mspcore_api.h>
 #include <msp/time/timestamp.h>
 #include "path.h"
 
@@ -16,16 +18,12 @@ enum FileType
        SYMLINK
 };
 
-#ifdef MSVC
-typedef __uint64 FileSize;
-#else
-typedef unsigned long long FileSize;
-#endif
+typedef uint64_t FileSize;
 
 /**
 Holds file information.
 */
-class Stat
+class MSPCORE_API Stat
 {
 private:
        struct Private;
@@ -36,16 +34,16 @@ private:
                std::string group;
        };
 
-       bool exists;
-       FileType type;
-       FileSize size;
-       FileSize alloc_size;
+       bool exists = false;
+       FileType type = UNKNOWN;
+       FileSize size = 0;
+       FileSize alloc_size = 0;
        Time::TimeStamp mtime;
        mutable OwnerInfo owner_info;
-       Private *priv;
+       Private *priv = nullptr;
 
 public:
-       Stat();
+       Stat() = default;
        Stat(const Stat &);
        Stat &operator=(const Stat &);
        ~Stat();
@@ -76,7 +74,7 @@ inline Stat lstat(const Path &path)
 { return Stat::lstat(path); }
 
 /// Tests for existence of a file
-bool exists(const Path &path);
+MSPCORE_API bool exists(const Path &path);
 
 /// Tests whether a path refers to an existing regular file
 inline bool is_reg(const Path &path)