LeviLamina
Loading...
Searching...
No Matches
FileStorageArea.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/file/FileAccessType.h"
7#include "mc/deps/core/file/WriteOperation.h"
8#include "mc/deps/core/file/file_system/TransactionFlags.h"
9#include "mc/deps/core/utility/NonOwnerPointer.h"
10
11// auto generated forward declare list
12// clang-format off
13namespace Core { class FileIndexLru; }
14namespace Core { class FileStats; }
15namespace Core { class FileSystemImpl; }
16namespace Core { class PathView; }
17namespace Core { class Result; }
18namespace Core { class StorageAreasTree; }
19// clang-format on
20
21namespace Core {
22
23class FileStorageArea : public ::std::enable_shared_from_this<::Core::FileStorageArea> {
24public:
25 // FileStorageArea inner types declare
26 // clang-format off
28 // clang-format on
29
30 // FileStorageArea inner types define
31 enum class FlushableLevelDbEnvType : int {
32 None = 0,
33 InMemory = 1,
34 StorageArea = 2,
35 };
36
38 public:
39 // member variables
40 // NOLINTBEGIN
44 // NOLINTEND
45
46 public:
47 // prevent constructor by default
51 };
52
53public:
54 // member variables
55 // NOLINTBEGIN
73 // NOLINTEND
74
75public:
76 // prevent constructor by default
77 FileStorageArea& operator=(FileStorageArea const&);
80
81public:
82 // virtual functions
83 // NOLINTBEGIN
84 // vIndex: 0
85 virtual ~FileStorageArea();
86
87 // vIndex: 2
88 virtual ::std::unique_ptr<::Core::FileSystemImpl> createTransaction(::Core::FileAccessType) = 0;
89
90 // vIndex: 1
91 virtual ::std::unique_ptr<::Core::FileSystemImpl>
92 createTransaction(::Core::FileAccessType fileAccessType, ::Core::TransactionFlags);
93
94 // vIndex: 3
95 virtual bool supportsSizeQuery() const = 0;
96
97 // vIndex: 4
98 virtual uint64 getTotalSize() const = 0;
99
100 // vIndex: 5
101 virtual ::Core::Result getUsedSize(uint64&) = 0;
102
103 // vIndex: 6
104 virtual void setUsedSizeOverride(uint64);
105
106 // vIndex: 7
107 virtual void clearUsedSizeOverride();
108
109 // vIndex: 8
110 virtual void notifyChangeInFileSize(int64 changeInSize, int64 changeInAllocatedSize);
111
112 // vIndex: 9
113 virtual bool handlesPendingWrites() const;
114
115 // vIndex: 10
116 virtual void informPendingWriteSize(uint64 numBytesWritePending, bool const fromResourcePack);
117
118 // vIndex: 11
119 virtual uint64 estimatePendingWriteDiskSize(uint64 rawFileSize) const;
120
121 // vIndex: 12
122 virtual void informStorageAreaCopy(uint64 storageAreaSize);
123
124 // vIndex: 13
125 virtual bool supportsExtendSize() const;
126
127 // vIndex: 14
128 virtual bool canExtendSize() const;
129
130 // vIndex: 15
131 virtual void resetCanAttemptExtendSize();
132
133 // vIndex: 16
134 virtual ::Core::Result getExtendSizeThreshold(uint64&) const;
135
136 // vIndex: 17
137 virtual void attemptExtendSize(int64 const& currentFreeSpace, ::std::function<void()> onCompleteCallback);
138
139 // vIndex: 18
140 virtual void preemptiveExtendSize(
141 uint64 const expectedContentSize,
142 ::std::function<void()> successCallback,
143 ::std::function<void()> failureCallback
144 );
145
146 // vIndex: 19
147 virtual uint64 getAvailableUserStorageSize();
148
149 // vIndex: 20
150 virtual void unloadFlatFileManifests(bool shouldClearManifests);
151
152 // vIndex: 21
153 virtual void tick();
154
155 // vIndex: 22
156 virtual void flushImmediately();
157
158 // vIndex: 23
159 virtual void enableFlushToDisk(bool);
160
161 // vIndex: 24
162 virtual void enableSequentialWrites(bool);
163
164 // vIndex: 25
165 virtual bool checkCorrupt(bool handleCorruption);
166
167 // vIndex: 26
168 virtual ::Bedrock::NonOwnerPointer<::Core::FileIndexLru> getFileIndexLru();
169
170 // vIndex: 27
171 virtual ::Core::FileStorageArea::FlushableLevelDbEnvType getFlushableLevelDbEnvType() const;
172
173 // vIndex: 28
174 virtual uint64 getTransactionWriteSizeLimit() const;
175
176 // vIndex: 29
177 virtual ::Core::Result setSaveDataIcon(::Core::PathView);
178
179 // vIndex: 30
180 virtual bool shouldAllowCommit() const;
181
182 // vIndex: 31
183 virtual void trackBytesWritten(::Core::PathView targetPath, uint64 amount, ::Core::WriteOperation writeOperation);
184
185 // vIndex: 32
186 virtual void trackWriteOperation(::Core::PathView targetPath, ::Core::WriteOperation writeOperation);
187
188 // vIndex: 33
189 virtual ::Core::FileStorageArea::StorageAreaSpaceInfo getStorageAreaSpaceInfo();
190
191 // vIndex: 34
192 virtual ::std::optional<::std::string> getIntegrityResults() const;
193
194 // vIndex: 35
195 virtual bool shouldRecordFileError(::Core::PathView, ::std::error_code) const;
196
197 // vIndex: 36
198 virtual ::Core::Result _commit();
199
200 // vIndex: 37
201 virtual ::Core::Result _onTransactionsEmpty(bool fromChild);
202
203 // vIndex: 38
204 virtual void _onTeardown();
205 // NOLINTEND
206
207public:
208 // member functions
209 // NOLINTBEGIN
211 ::Core::FileAccessType type,
212 ::Core::PathView rootPath,
213 bool usesFlatFiles,
214 bool isAccessedDirectly,
215 ::std::shared_ptr<::Core::FileStorageArea> parent
216 );
217
218 MCNAPI void _addReadOperation(bool succeeded, uint64 numBytesRead);
219
220 MCNAPI void _addWriteOperation(bool succeeded, uint64 numBytesWritten);
221
222 MCNAPI void _beginTransaction(::Core::FileSystemImpl* pTransaction, bool fromChild);
223
224 MCNAPI ::Core::Result _endTransaction(::Core::FileSystemImpl* pTransaction, bool fromChild);
225
226 MCNAPI bool canWrite() const;
227
228 MCNAPI void checkUserStorage();
229 // NOLINTEND
230
231public:
232 // static functions
233 // NOLINTBEGIN
234 MCNAPI static ::Core::Result
235 _getStorageAreaForPathImpl(::std::shared_ptr<::Core::FileStorageArea>& fileStorageArea, ::Core::PathView path);
236
237 MCNAPI static ::Core::Result
238 getStorageAreaForPath(::std::shared_ptr<::Core::FileStorageArea>& fileStorageArea, ::Core::PathView path);
239 // NOLINTEND
240
241public:
242 // static variables
243 // NOLINTBEGIN
244 MCNAPI static ::std::vector<::Core::FileStats*>& sStorageAreaFileStats();
245
246 MCNAPI static ::std::recursive_mutex& sStorageAreaLock();
247
248 MCNAPI static ::Core::StorageAreasTree& sStorageAreas();
249 // NOLINTEND
250
251public:
252 // constructor thunks
253 // NOLINTBEGIN
254 MCNAPI void* $ctor(
255 ::Core::FileAccessType type,
256 ::Core::PathView rootPath,
257 bool usesFlatFiles,
258 bool isAccessedDirectly,
259 ::std::shared_ptr<::Core::FileStorageArea> parent
260 );
261 // NOLINTEND
262
263public:
264 // destructor thunk
265 // NOLINTBEGIN
266 MCNAPI void $dtor();
267 // NOLINTEND
268
269public:
270 // virtual function thunks
271 // NOLINTBEGIN
272 MCNAPI ::std::unique_ptr<::Core::FileSystemImpl>
273 $createTransaction(::Core::FileAccessType fileAccessType, ::Core::TransactionFlags);
274
275 MCNAPI void $setUsedSizeOverride(uint64);
276
278
279 MCNAPI void $notifyChangeInFileSize(int64 changeInSize, int64 changeInAllocatedSize);
280
281 MCNAPI bool $handlesPendingWrites() const;
282
283 MCNAPI void $informPendingWriteSize(uint64 numBytesWritePending, bool const fromResourcePack);
284
285 MCNAPI uint64 $estimatePendingWriteDiskSize(uint64 rawFileSize) const;
286
287 MCNAPI void $informStorageAreaCopy(uint64 storageAreaSize);
288
289 MCNAPI bool $supportsExtendSize() const;
290
291 MCNAPI bool $canExtendSize() const;
292
294
295 MCNAPI ::Core::Result $getExtendSizeThreshold(uint64&) const;
296
297 MCNAPI void $attemptExtendSize(int64 const& currentFreeSpace, ::std::function<void()> onCompleteCallback);
298
300 uint64 const expectedContentSize,
301 ::std::function<void()> successCallback,
302 ::std::function<void()> failureCallback
303 );
304
306
307 MCNAPI void $unloadFlatFileManifests(bool shouldClearManifests);
308
309 MCNAPI void $tick();
310
311 MCNAPI void $flushImmediately();
312
313 MCNAPI void $enableFlushToDisk(bool);
314
315 MCNAPI void $enableSequentialWrites(bool);
316
317 MCNAPI bool $checkCorrupt(bool handleCorruption);
318
319 MCNAPI ::Bedrock::NonOwnerPointer<::Core::FileIndexLru> $getFileIndexLru();
320
321 MCNAPI ::Core::FileStorageArea::FlushableLevelDbEnvType $getFlushableLevelDbEnvType() const;
322
323 MCNAPI uint64 $getTransactionWriteSizeLimit() const;
324
325 MCNAPI ::Core::Result $setSaveDataIcon(::Core::PathView);
326
327 MCNAPI bool $shouldAllowCommit() const;
328
329 MCNAPI void $trackBytesWritten(::Core::PathView targetPath, uint64 amount, ::Core::WriteOperation writeOperation);
330
331 MCNAPI void $trackWriteOperation(::Core::PathView targetPath, ::Core::WriteOperation writeOperation);
332
333 MCNAPI ::Core::FileStorageArea::StorageAreaSpaceInfo $getStorageAreaSpaceInfo();
334
335 MCNAPI ::std::optional<::std::string> $getIntegrityResults() const;
336
337 MCNAPI bool $shouldRecordFileError(::Core::PathView, ::std::error_code) const;
338
339 MCNAPI ::Core::Result $_commit();
340
341 MCNAPI ::Core::Result $_onTransactionsEmpty(bool fromChild);
342
343 MCNAPI void $_onTeardown();
344 // NOLINTEND
345
346public:
347 // vftables
348 // NOLINTBEGIN
349 MCNAPI static void** $vftable();
350 // NOLINTEND
351};
352
353} // namespace Core
Definition FileStorageArea.h:23
MCAPI::Core::Result $setSaveDataIcon(::Core::PathView)
MCAPI void _addWriteOperation(bool succeeded, uint64 numBytesWritten)
MCAPI void $_onTeardown()
MCAPI void $trackWriteOperation(::Core::PathView targetPath, ::Core::WriteOperation writeOperation)
MCAPI void $clearUsedSizeOverride()
MCAPI::Core::FileStorageArea::StorageAreaSpaceInfo $getStorageAreaSpaceInfo()
MCAPI ::Bedrock::NonOwnerPointer<::Core::FileIndexLru > $getFileIndexLru()
MCAPI uint64 $getAvailableUserStorageSize()
MCAPI void $preemptiveExtendSize(uint64 const expectedContentSize, ::std::function< void()> successCallback, ::std::function< void()> failureCallback)
MCAPI void $informStorageAreaCopy(uint64 storageAreaSize)
MCAPI bool $shouldAllowCommit() const
MCAPI::Core::FileStorageArea::FlushableLevelDbEnvType $getFlushableLevelDbEnvType() const
MCAPI void $attemptExtendSize(int64 const &currentFreeSpace, ::std::function< void()> onCompleteCallback)
MCAPI::Core::Result _endTransaction(::Core::FileSystemImpl *pTransaction, bool fromChild)
MCAPI bool $shouldRecordFileError(::Core::PathView, ::std::error_code) const
MCAPI::Core::Result $getExtendSizeThreshold(uint64 &) const
static MCAPI ::Core::Result getStorageAreaForPath(::std::shared_ptr<::Core::FileStorageArea > &fileStorageArea, ::Core::PathView path)
MCAPI bool $canExtendSize() const
MCAPI void $informPendingWriteSize(uint64 numBytesWritePending, bool const fromResourcePack)
MCAPI::Core::Result $_commit()
MCAPI void $enableFlushToDisk(bool)
MCAPI bool canWrite() const
MCAPI void $setUsedSizeOverride(uint64)
MCAPI void $trackBytesWritten(::Core::PathView targetPath, uint64 amount, ::Core::WriteOperation writeOperation)
static MCAPI ::Core::StorageAreasTree & sStorageAreas()
MCAPI ::std::optional<::std::string > $getIntegrityResults() const
MCAPI uint64 $estimatePendingWriteDiskSize(uint64 rawFileSize) const
MCAPI bool $handlesPendingWrites() const
static MCAPI ::std::recursive_mutex & sStorageAreaLock()
MCAPI void $notifyChangeInFileSize(int64 changeInSize, int64 changeInAllocatedSize)
MCAPI void $flushImmediately()
MCAPI FileStorageArea(::Core::FileAccessType type, ::Core::PathView rootPath, bool usesFlatFiles, bool isAccessedDirectly, ::std::shared_ptr<::Core::FileStorageArea > parent)
MCAPI bool $checkCorrupt(bool handleCorruption)
MCAPI void * $ctor(::Core::FileAccessType type, ::Core::PathView rootPath, bool usesFlatFiles, bool isAccessedDirectly, ::std::shared_ptr<::Core::FileStorageArea > parent)
MCAPI::Core::Result $_onTransactionsEmpty(bool fromChild)
MCAPI void _beginTransaction(::Core::FileSystemImpl *pTransaction, bool fromChild)
static MCAPI void ** $vftable()
MCAPI void _addReadOperation(bool succeeded, uint64 numBytesRead)
MCAPI void $resetCanAttemptExtendSize()
MCAPI void $enableSequentialWrites(bool)
MCAPI uint64 $getTransactionWriteSizeLimit() const
MCAPI void $unloadFlatFileManifests(bool shouldClearManifests)
MCAPI void checkUserStorage()
MCAPI ::std::unique_ptr<::Core::FileSystemImpl > $createTransaction(::Core::FileAccessType fileAccessType, ::Core::TransactionFlags)
static MCAPI ::Core::Result _getStorageAreaForPathImpl(::std::shared_ptr<::Core::FileStorageArea > &fileStorageArea, ::Core::PathView path)
static MCAPI ::std::vector<::Core::FileStats * > & sStorageAreaFileStats()
MCAPI bool $supportsExtendSize() const
Definition FileSystemImpl.h:30
Definition PathView.h:15
Definition FileStorageArea.h:37
Definition Alias.h:14