LeviLamina
Loading...
Searching...
No Matches
ExternalFileLevelStorage.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/file/PathBuffer.h"
7#include "mc/deps/core/utility/NonOwnerPointer.h"
8#include "mc/platform/Result.h"
9
10// auto generated forward declare list
11// clang-format off
12class ContentIdentity;
15class LevelData;
17class TaskGroup;
18struct LevelSummary;
19namespace Core { class Path; }
20namespace Core { class Result; }
21// clang-format on
22
23namespace ExternalFileLevelStorage {
24// functions
25// NOLINTBEGIN
26MCNAPI ::Bedrock::Result<void>
27_readLevelDataFromFile(::Core::Path const& datFilename, ::std::string const& worldID, ::LevelData& levelData);
28
29MCNAPI bool _writeLevelDat(::Core::Path const& datFilename, ::LevelData const& levelData);
30
31MCNAPI void copyLevelInfoToDiskCache(::Core::Path const& levelRootPath, bool onlyIfNotExisting);
32
33MCNAPI ::std::unique_ptr<::PackAccessStrategy> getAccessStrategy(
34 ::Core::Path const& levelDirectory,
35 ::ContentIdentity const& contentIdentity,
36 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> const& keyProvider
37);
38
39MCNAPI ::std::vector<::std::string> const getImportantFiles();
40
41#ifdef LL_PLAT_C
42MCNAPI bool isLevelCloudSave(::Core::Path const& directory);
43#endif
44
45MCNAPI bool isLevelMarkedForSync(::Core::Path const& directory);
46
47MCNAPI void makeReadableLevelnameFile(::Core::Path const& fullPath, ::std::string const& name);
48
49MCNAPI ::Core::Result readLevelDataFromData(::std::string const& dataStr, ::LevelData& levelData);
50
51MCNAPI ::Bedrock::Result<bool>
52readLevelDataFromFile(::Core::Path const& directory, ::std::string const& levelId, ::LevelData& levelData);
53
54MCNAPI ::Bedrock::Result<bool> readLevelDataFromFile(
55 ::Core::Path const& directory,
56 ::std::string const& levelId,
57 ::LevelData& levelData,
58 ::IMinecraftEventing* eventing
59);
60
61MCNAPI bool readShallowLevelSummaryFromSyncFile(
62 ::Core::Path const& directory,
63 ::std::string const& levelId,
64 ::LevelSummary& summary
65);
66
67MCNAPI bool readSyncFileData(
68 ::Core::Path const& directory,
69 ::std::string& levelName,
70 int64& levelSize,
71 int64& remoteTimestamp,
72 bool& isSyncUsable
73);
74
75MCNAPI void saveLevelData(
76 ::Core::Path const& levelPath,
77 ::std::string const& levelId,
78 ::LevelData const& levelData,
79 bool ignoreCache
80);
81
82MCNAPI void saveLevelDataToPath(::Core::Path const& fullPath, ::std::string const& levelData, ::LevelData const&);
83
84MCNAPI void saveLevelDisplayDataToCache(
85 ::std::string const& levelId,
86 ::LevelData const& levelData,
87 ::gsl::not_null<::TaskGroup*> taskGroup
88);
89
90#ifdef LL_PLAT_C
91MCNAPI void syncLevelInfoCache(::std::unordered_set<::Core::PathBuffer<::std::string>> const& levelRootPaths);
92#endif
93
94MCNAPI ::Core::Result validateLevelDat(::Core::Path filePath);
95// NOLINTEND
96
97// static variables
98// NOLINTBEGIN
99MCNAPI ::std::atomic<bool>& writingToCache();
100// NOLINTEND
101
102} // namespace ExternalFileLevelStorage
Definition ContentIdentity.h:8
Definition Path.h:12
Definition Result.h:11
Definition IContentKeyProvider.h:13
Definition IMinecraftEventing.h:138
Definition LevelData.h:55
Definition PackAccessStrategy.h:26
Definition TaskGroup.h:55
Definition LevelSummary.h:30