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