dtkio
dtk library for dtkio.
载入中...
搜索中...
未找到
dtkiotypes.h
浏览该文件的文档.
1// SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd.
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
5#ifndef DTKIOTYPES_H
6#define DTKIOTYPES_H
7
8#include <stdint.h>
9
10#include <string>
11
12#include <QFlags>
13#include <QVariant>
14
15#include "dtkio_global.h"
16
17DIO_BEGIN_NAMESPACE
18
19enum class OpenFlag : quint16 {
20 NotOpen = 0x0000,
21 ReadOnly = 0x0001,
22 WriteOnly = 0x0002,
23 ReadWrite = ReadOnly | WriteOnly,
24 Append = 0x0004,
25 Truncate = 0x0008,
26 Text = 0x0010,
27 Unbuffered = 0x0020,
28 NewOnly = 0x0040,
29 ExistingOnly = 0x0080,
30
31 CustomStart = 0x0100
32};
33Q_DECLARE_FLAGS(OpenFlags, OpenFlag)
34
35enum class CopyFlag : quint8 {
36 None = 0,
37 Overwrite = 1,
38 Backup = 2,
39 NoFollowSymlinks = 3,
40 AllMetadata = 4,
41 NoFallbackForMove = 5,
42 TargetDefaultPerms = 6,
43
44 UserFlag = 0x10
45};
46
47enum class AttributeID : quint16 {
48 StandardType = 0,
49 StandardIsHidden = 1,
50 StandardIsBackup = 2,
51 StandardIsSymlink = 3,
52 StandardIsVirtual = 4,
53 StandardIsVolatile = 5,
54 StandardName = 6,
55 StandardDisplayName = 7,
56 StandardEditName = 8, // string
57 StandardCopyName = 9,
58 StandardIcon = 10,
59 StandardSymbolicIcon = 11,
60 StandardContentType = 12,
61 StandardFastContentType = 13,
62 StandardSize = 14,
63 StandardAllocatedSize = 15,
64 StandardSymlinkTarget = 16,
65 StandardTargetUri = 17,
66 StandardSortOrder = 18,
67 StandardDescription = 19,
68
69 EtagValue = 40,
70
71 IdFile = 60,
72 IdFilesystem = 61,
73
74 AccessCanRead = 100,
75 AccessCanWrite = 101,
76 AccessCanExecute = 102,
77 AccessCanDelete = 103,
78 AccessCanTrash = 104,
79 AccessCanRename = 105,
80
81 MountableCanMount = 130,
82 MountableCanUnmount = 131,
83 MountableCanEject = 132,
84 MountableUnixDevice = 133,
85 MountableUnixDeviceFile = 134,
86 MountableHalUdi = 135,
87 MountableCanPoll = 136,
88 MountableIsMediaCheckAutomatic = 137,
89 MountableCanStart = 138,
90 MountableCanStartDegraded = 139,
91 MountableCanStop = 140,
92 MountableStartStopType = 141,
93
94 TimeModified = 200,
95 TimeModifiedUsec = 201,
96 TimeAccess = 202,
97 TimeAccessUsec = 203,
98 TimeChanged = 204,
99 TimeChangedUsec = 205,
100 TimeCreated = 206,
101 TimeCreatedUsec = 207,
102
103 UnixDevice = 330,
104 UnixInode = 331,
105 UnixMode = 332,
106 UnixNlink = 333,
107 UnixUID = 334,
108 UnixGID = 335,
109 UnixRdev = 336,
110 UnixBlockSize = 337,
111 UnixBlocks = 338,
112 UnixIsMountPoint = 339,
113
114 DosIsArchive = 360,
115 DosIsSystem = 361,
116
117 OwnerUser = 300,
118 OwnerUserReal = 301,
119 OwnerGroup = 302,
120
121 ThumbnailPath = 390,
122 ThumbnailFailed = 391,
123 ThumbnailIsValid = 392,
124
125 PreviewIcon = 420,
126
127 FileSystemSize = 440,
128 FileSystemFree = 441,
129 FileSystemUsed = 442,
130 FileSystemType = 443,
131 FileSystemReadOnly = 444,
132 FileSystemUsePreview = 445,
133 FileSystemRemote = 446,
134
135 GvfsBackend = 470,
136
137 SelinuxContext = 490,
138
139 TrashItemCount = 510,
140 TrashDeletionDate = 511,
141 TrashOrigPath = 512,
142
143 RecentModified = 540,
144
145 CustomStart = 600,
146
147 StandardIsFile = 610,
148 StandardIsDir = 611,
149 StandardIsRoot = 612,
150 StandardSuffix = 613,
151 StandardCompleteSuffix = 614,
152 StandardFilePath = 615,
153 StandardParentPath = 616,
154 StandardBaseName = 617,
155 StandardFileName = 618,
156 StandardCompleteBaseName = 619,
157
158 AttributeIDMax = 999,
159};
160
161enum class SeekType : quint8 {
162 Begin = 0x00,
163 Current = 0x01,
164 End = 0x02
165};
166
167enum class Permission : quint16 {
168 NoPermission = 0x0000,
169
170 ExeOther = 0x0001,
171 WriteOther = 0x0002,
172 ReadOther = 0x0004,
173
174 ExeGroup = 0x0010,
175 WriteGroup = 0x0020,
176 ReadGroup = 0x0040,
177
178 ExeUser = 0x0100,
179 WriteUser = 0x0200,
180 ReadUser = 0x0400,
181
182 ExeOwner = 0x1000,
183 WriteOwner = 0x2000,
184 ReadOwner = 0x4000,
185};
186Q_DECLARE_FLAGS(Permissions, Permission)
187
188enum class AttributeType : quint8 {
189 TypeInvalid = 0,
190 TypeString = 1,
191 TypeByteString = 2,
192 TypeBool = 3,
193 TypeUInt32 = 4,
194 TypeInt32 = 5,
195 TypeUInt64 = 6,
196 TypeInt64 = 7,
197 TypeObject = 8,
198 TypeStringV = 9
199};
200
201enum class FileQueryInfoFlags : quint8 {
202 TypeNone,
203 TypeNoFollowSymlinks
204};
205
206enum class DirFilter : qint16 {
207 NoFilter = 0x0000,
208 Dirs = 0x0001,
209 Files = 0x0002,
210 Drives = 0x0004,
211 AllEntries = Dirs | Files | Drives,
212 NoSymLinks = 0x0008,
213
214 Readable = 0x0010,
215 Writable = 0x0020,
216 Executable = 0x0040,
217 Modified = 0x0080,
218
219 Hidden = 0x0100,
220 System = 0x0200,
221 AllDirs = 0x0400,
222 CaseSensitive = 0x0800,
223
224 NoDot = 0x2000,
225 NoDotDot = 0x4000,
226 NoDotAndDotDot = NoDot | NoDotDot,
227};
228Q_DECLARE_FLAGS(DirFilters, DirFilter)
229
230enum class IteratorFlag : quint8 {
231 NoIteratorFlags = 0x00,
232 FollowSymlinks = 0x01,
233 Subdirectories = 0x02,
234};
235Q_DECLARE_FLAGS(IteratorFlags, IteratorFlag)
236
237enum class WatchType : quint8 {
238 Auto = 0x00,
239 Dir = 0x01,
240 File = 0x02,
241};
242
244{
245 AttributeID id;
246 std::string key;
247 QVariant defaultValue;
248 AttributeType type;
249};
250
251DIO_END_NAMESPACE
252
253#endif // DTKIOTYPES_H
OpenFlag
打开文件时的标志
Definition dtkiotypes.h:19
FileQueryInfoFlags
查询文件信息的标志
Definition dtkiotypes.h:201
DirFilter
过滤文件夹类型
Definition dtkiotypes.h:206
WatchType
监听器类型
Definition dtkiotypes.h:237
SeekType
文件偏移类型
Definition dtkiotypes.h:161
CopyFlag
复制文件时的标志
Definition dtkiotypes.h:35
AttributeID
文件属性(ID)
Definition dtkiotypes.h:47
AttributeType
文件属性类型
Definition dtkiotypes.h:188
Permission
文件权限类型
Definition dtkiotypes.h:167
IteratorFlag
迭代器标志
Definition dtkiotypes.h:230
文件属性细节
Definition dtkiotypes.h:244