Skip to content
LeviMC
English
AutoLightDark
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;
14class LevelData;
16struct LevelSummary;
17namespace Core { class Path; }
18namespace Core { class Result; }
19// clang-format on
20
21namespace ExternalFileLevelStorage {
22// functions
23// NOLINTBEGIN
24MCNAPI ::Bedrock::Result<void>
25_readLevelDataFromFile(::Core::Path const& datFilename, ::std::string const& worldID, ::LevelData& levelData);
26
27MCNAPI bool _writeLevelDat(::Core::Path const& datFilename, ::LevelData const& levelData);
28
29MCNAPI void copyLevelInfoToDiskCache(::Core::Path const& levelRootPath, bool onlyIfNotExisting);
30
31MCNAPI ::std::unique_ptr<::PackAccessStrategy> getAccessStrategy(
32 ::Core::Path const& levelDirectory,
33 ::ContentIdentity const& contentIdentity,
34 ::Bedrock::NotNullNonOwnerPtr<::IContentKeyProvider const> const& keyProvider
35);
36
37#ifdef LL_PLAT_C
38MCNAPI bool isLevelCloudSave(::Core::Path const& directory);
39
40MCNAPI bool isLevelCloudSaveOptOut(::Core::Path const& directory);
41#endif
42
43MCNAPI void makeReadableLevelnameFile(::Core::Path const& fullPath, ::std::string const& name);
44
45#ifdef LL_PLAT_C
46MCNAPI void markLevelAsCloudSave(::Core::Path const& directory);
47
48MCNAPI void markLevelAsCloudSaveOptOut(::Core::Path const& directory);
49#endif
50
51MCNAPI ::Core::Result readLevelDataFromData(::std::string const& dataStr, ::LevelData& levelData);
52
53MCNAPI ::Bedrock::Result<bool>
54readLevelDataFromFile(::Core::Path const& directory, ::std::string const& levelId, ::LevelData& levelData);
55
56MCNAPI bool readShallowLevelSummaryFromSyncFile(
57 ::Core::Path const& directory,
58 ::std::string const& levelId,
59 ::LevelSummary& summary
60);
61
62#ifdef LL_PLAT_C
63MCNAPI bool readSyncFileData(
64 ::Core::Path const& directory,
65 ::std::string& levelName,
66 int64& levelSize,
67 int64& remoteTimestamp,
68 bool& isSyncUsable
69);
70#endif
71
72MCNAPI void saveLevelData(
73 ::Core::Path const& levelPath,
74 ::std::string const& levelId,
75 ::LevelData const& levelData,
76 bool ignoreCache
77);
78
79MCNAPI void saveLevelDataToPath(::Core::Path const& fullPath, ::LevelData const& levelData);
80
81#ifdef LL_PLAT_C
82MCNAPI void syncLevelInfoCache(::std::unordered_set<::Core::PathBuffer<::std::string>> const& levelRootPaths);
83
84MCNAPI ::Core::Result unMarkLevelAsCloudSave(::Core::Path const& directory);
85
86MCNAPI ::Core::Result unMarkLevelAsCloudSaveOptOut(::Core::Path const& directory);
87
88MCNAPI ::Core::Result unMarkLevelForSync(::Core::Path const& directory, bool deleteWorldFolderIfEmpty);
89#endif
90
91MCNAPI ::Core::Result validateLevelDat(::Core::Path filePath);
92// NOLINTEND
93
94} // namespace ExternalFileLevelStorage
Definition ContentIdentity.h:8
Definition Path.h:10
Definition Result.h:11
Definition IContentKeyProvider.h:13
Definition LevelData.h:57
Definition PackAccessStrategy.h:25
Definition LevelSummary.h:30