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
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&) 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);
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 bool shouldRecordFileError(::Core::PathView, ::std::error_code) const;
197
198 // vIndex: 36
199 virtual ::Core::Result _commit();
200
201 // vIndex: 37
202 virtual ::Core::Result _onTransactionsEmpty(bool fromChild);
203
204 // vIndex: 38
205 virtual void _onTeardown();
206 // NOLINTEND
207
208public:
209 // member functions
210 // NOLINTBEGIN
212 ::Core::FileAccessType type,
213 ::Core::PathView rootPath,
214 bool usesFlatFiles,
215 bool isAccessedDirectly,
216 ::std::shared_ptr<::Core::FileStorageArea> parent
217 );
218
219 MCNAPI void _addReadOperation(bool succeeded, uint64 numBytesRead);
220
221 MCNAPI void _addWriteOperation(bool succeeded, uint64 numBytesWritten);
222
223 MCNAPI void _beginTransaction(::Core::FileSystemImpl* pTransaction, bool fromChild);
224
225 MCNAPI ::Core::Result _endTransaction(::Core::FileSystemImpl* pTransaction, bool fromChild);
226
227 MCNAPI bool canWrite() const;
228
229 MCNAPI void checkUserStorage();
230 // NOLINTEND
231
232public:
233 // static functions
234 // NOLINTBEGIN
235 MCNAPI static ::Core::Result
236 _getStorageAreaForPathImpl(::std::shared_ptr<::Core::FileStorageArea>& fileStorageArea, ::Core::PathView path);
237 // NOLINTEND
238
239public:
240 // static variables
241 // NOLINTBEGIN
242 MCNAPI static ::std::vector<::Core::FileStats*>& sStorageAreaFileStats();
243
244 MCNAPI static ::std::recursive_mutex& sStorageAreaLock();
245
246 MCNAPI static ::Core::StorageAreasTree& sStorageAreas();
247 // NOLINTEND
248
249public:
250 // constructor thunks
251 // NOLINTBEGIN
252 MCNAPI void* $ctor(
253 ::Core::FileAccessType type,
254 ::Core::PathView rootPath,
255 bool usesFlatFiles,
256 bool isAccessedDirectly,
257 ::std::shared_ptr<::Core::FileStorageArea> parent
258 );
259 // NOLINTEND
260
261public:
262 // destructor thunk
263 // NOLINTBEGIN
264 MCNAPI void $dtor();
265 // NOLINTEND
266
267public:
268 // virtual function thunks
269 // NOLINTBEGIN
270 MCNAPI ::std::unique_ptr<::Core::FileSystemImpl>
271 $createTransaction(::Core::FileAccessType fileAccessType, ::Core::TransactionFlags);
272
273 MCNAPI void $setUsedSizeOverride(uint64);
274
276
277 MCNAPI void $notifyChangeInFileSize(int64 changeInSize, int64 changeInAllocatedSize);
278
279 MCNAPI bool $handlesPendingWrites() const;
280
281 MCNAPI void $informPendingWriteSize(uint64 numBytesWritePending, bool const fromResourcePack);
282
283 MCNAPI uint64 $estimatePendingWriteDiskSize(uint64 rawFileSize) const;
284
285 MCNAPI void $informStorageAreaCopy(uint64 storageAreaSize);
286
287 MCNAPI bool $supportsExtendSize() const;
288
289 MCNAPI bool $canExtendSize() const;
290
292
293 MCNAPI ::Core::Result $getExtendSizeThreshold(uint64&) const;
294
295 MCNAPI void $attemptExtendSize(int64 const& currentFreeSpace, ::std::function<void()> onCompleteCallback);
296
298 uint64 const expectedContentSize,
299 ::std::function<void()> successCallback,
300 ::std::function<void()> failureCallback
301 );
302
304
305 MCNAPI void $unloadFlatFileManifests(bool shouldClearManifests);
306
307 MCNAPI void $tick();
308
309 MCNAPI void $flushImmediately();
310
311 MCNAPI void $enableFlushToDisk(bool);
312
313 MCNAPI void $enableSequentialWrites(bool);
314
315 MCNAPI bool $checkCorrupt(bool handleCorruption);
316
317 MCNAPI ::Bedrock::NonOwnerPointer<::Core::FileIndexLru> $getFileIndexLru();
318
319 MCNAPI ::Core::FileStorageArea::FlushableLevelDbEnvType $getFlushableLevelDbEnvType() const;
320
321 MCNAPI uint64 $getTransactionWriteSizeLimit() const;
322
323 MCNAPI ::Core::Result $setSaveDataIcon(::Core::PathView);
324
325 MCNAPI bool $shouldAllowCommit() const;
326
327 MCNAPI void $trackBytesWritten(::Core::PathView targetPath, uint64 amount, ::Core::WriteOperation writeOperation);
328
329 MCNAPI void $trackWriteOperation(::Core::PathView targetPath, ::Core::WriteOperation writeOperation);
330
331 MCNAPI ::Core::FileStorageArea::StorageAreaSpaceInfo $getStorageAreaSpaceInfo();
332
333 MCNAPI ::std::optional<::std::string> $getIntegrityResults() const;
334
335 MCNAPI bool $shouldRecordFileError(::Core::PathView, ::std::error_code) const;
336
337 MCNAPI ::Core::Result $_commit();
338
339 MCNAPI ::Core::Result $_onTransactionsEmpty(bool fromChild);
340
341 MCNAPI void $_onTeardown();
342 // NOLINTEND
343
344public:
345 // vftables
346 // NOLINTBEGIN
347 MCNAPI static void** $vftable();
348 // NOLINTEND
349};
350
351} // 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
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