1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * @brief Declaration file for DirItem
9 #define POCO_NO_UNWINDOWS 1
10 #include <Poco/File.h>
11 #include <Poco/Timestamp.h>
12 #include <boost/flyweight.hpp>
13 #include "UnicodeString.h"
14 #include "FileVersion.h"
17 * @brief Class for fileflags.
21 unsigned attributes; /**< Fileattributes for item */
22 FileFlags() : attributes(0) { }
23 void reset() { attributes = 0; } /// Reset fileattributes
24 String ToString() const;
28 * @brief Information for file.
29 * This class stores basic information from a file or folder.
30 * Information consists of item name, times, size and attributes.
31 * Also version info can be get for files supporting it.
33 * @note times in are seconds since January 1, 1970.
34 * See Dirscan.cpp/fentry and Dirscan.cpp/LoadFiles()
38 Poco::Timestamp ctime; /**< time of creation */
39 Poco::Timestamp mtime; /**< time of last modify */
40 Poco::File::FileSize size; /**< file size in bytes, FILE_SIZE_NONE (== -1) means file does not exist*/
41 boost::flyweight<String> filename; /**< filename for this item */
42 boost::flyweight<String> path; /**< full path (excluding filename) for the item */
43 FileVersion version; /**< string of fixed file version, eg, 1.2.3.4 */
44 FileFlags flags; /**< file attributes */
46 enum : uint64_t { FILE_SIZE_NONE = UINT64_MAX };
47 DirItem() : ctime(0), mtime(0), size(DirItem::FILE_SIZE_NONE) { }
48 void SetFile(const String &fullPath);
49 String GetFile() const;
50 bool Update(const String &sFilePath);