Skip to content
LeviMC
English
AutoLightDark
LeviLamina
Loading...
Searching...
No Matches
BakeTool.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/platform/Result.h"
7
8// auto generated forward declare list
9// clang-format off
11namespace Bedrock::Resources { struct BakeConfig; }
12namespace Bedrock::Resources::Archive { class Builder; }
13namespace Core { class Path; }
14namespace Core { class PathView; }
15// clang-format on
16
17namespace Bedrock::Resources {
18
19class BakeTool {
20public:
21 // member variables
22 // NOLINTBEGIN
27 // NOLINTEND
28
29public:
30 // prevent constructor by default
31 BakeTool& operator=(BakeTool const&);
32 BakeTool(BakeTool const&);
33 BakeTool();
34
35public:
36 // member functions
37 // NOLINTBEGIN
38#ifdef LL_PLAT_S
39 MCNAPI explicit BakeTool(::Bedrock::Resources::BakeConfig config);
40
41 MCNAPI int bake();
42
43 MCNAPI int bakeBrpak();
44
45 MCNAPI int bakeFilesInFolder(::Core::PathView srcPath, ::Core::PathView dstPath, ::Core::PathView dstArchivePath);
46
47 MCNAPI int bakeSinglePack(::Core::PathView packRoot, ::Core::PathView destPath);
48
49 MCNAPI void copyLooseFiles(::Core::PathView packRoot, ::Core::PathView destPath);
50
51 MCNAPI ::Bedrock::Result<void>
52 copyManifestWithVersionStamp(::Core::PathView sourcePath, ::Core::PathView destPath, ::SemVersionConstant version);
53
54 MCNAPI ::Bedrock::Result<void> copyRegularFile(::Core::PathView sourcePath, ::Core::PathView destPath);
55
56 MCNAPI ::std::vector<::Core::Path> gatherFilesRecursively(
57 ::Core::PathView srcPath,
58 ::Core::PathView dstPath,
59 ::Core::PathView dstArchivePath,
60 ::std::function<void(::Core::PathView, ::Core::PathView, ::Core::PathView)> processDirectoryFunc
61 );
62
63 MCNAPI int
64 optimizeFilesInFolder(::Core::PathView srcPath, ::Core::PathView dstPath, ::Core::PathView dstArchivePath);
65
66 MCNAPI void optimizeFilesWithArchive(
68 ::Core::PathView dstLoosePath,
69 ::std::vector<::Core::Path> const& gatheredFiles,
70 bool doCopy,
71 bool skipOptimization,
72 ::std::vector<::Core::Path>* outFullyArchivedFiles
73 );
74
75 MCNAPI int optimizeSinglePack(::Core::PathView packRoot, ::Core::PathView destPath);
76
77 MCNAPI void outputLog() const;
78
79 MCNAPI int packageBrpakSinglePack(::Core::PathView packRoot, ::Core::PathView destPath);
80
81 MCNAPI void processFilesInFolder(
82 ::Core::PathView packRoot,
83 ::Core::PathView destPath,
84 ::Core::PathView archivesRoot,
85 ::std::function<void(::Core::PathView, ::Core::PathView, ::Core::PathView)> processDirectoryFunc
86 );
87
88 MCNAPI void processSubPacks(
89 ::Core::PathView packRoot,
90 ::Core::PathView destPath,
91 ::std::function<void(::Core::PathView, ::Core::PathView)> processSubPackFunc
92 );
93
94 MCNAPI bool shouldCopyLooseSource(::Core::PathView filePath);
95
96 MCNAPI int unpackBrarchive();
97
98 MCNAPI int unpackBrarchiveSinglePack(::Core::PathView packRoot, ::Core::PathView destPath);
99
100 MCNAPI int unpackBrpak();
101
102 MCNAPI int unpackBrpakSinglePack(::Core::PathView packRoot, ::Core::PathView destPath);
103
104 MCNAPI void writeArchive(::Bedrock::Resources::Archive::Builder& builder, ::Core::PathView dstFile);
105#endif
106 // NOLINTEND
107
108public:
109 // static variables
110 // NOLINTBEGIN
111#ifdef LL_PLAT_S
112 MCNAPI static ::SemVersionConstant const& BRPAK_PACK_OPTIMIZATION_VERSION();
113#endif
114
115 MCNAPI static ::SemVersionConstant const& PACK_OPTIMIZATION_VERSION();
116 // NOLINTEND
117
118public:
119 // constructor thunks
120 // NOLINTBEGIN
121#ifdef LL_PLAT_S
122 MCNAPI void* $ctor(::Bedrock::Resources::BakeConfig config);
123#endif
124 // NOLINTEND
125};
126
127} // namespace Bedrock::Resources
static MCAPI ::SemVersionConstant const & PACK_OPTIMIZATION_VERSION()
Definition PathView.h:19
Definition Path.h:10
Definition SemVersionConstant.h:8
Definition BakeConfig.h:7
Definition Alias.h:14