LeviLamina
Loading...
Searching...
No Matches
PlatformBootstrap.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5namespace Bedrock {
6
8public:
9 // PlatformBootstrap inner types declare
10 // clang-format off
12 struct LoadResult;
13 struct SaveResult;
14 // clang-format on
15
16 // PlatformBootstrap inner types define
17 enum class LoadResultCode : int {
18 Success = 0,
19 FailedToOpen = 1,
20 FailedToRead = 2,
21 BufferTooSmall = 3,
22 };
23
24 enum class SaveResultCode : int {
25 Success = 0,
26 FailedToOpen = 1,
27 FailedToWrite = 2,
28 IncorrectBytesWrittenCount = 3,
29 };
30
31 enum class CreateDirectoryResultCode : int {
32 Success = 0,
33 Failure = 1,
34 };
35
36 struct LoadResult {
37 public:
38 // member variables
39 // NOLINTBEGIN
42 // NOLINTEND
43
44 public:
45 // prevent constructor by default
46 LoadResult& operator=(LoadResult const&);
47 LoadResult(LoadResult const&);
48 LoadResult();
49 };
50
51 struct SaveResult {
52 public:
53 // member variables
54 // NOLINTBEGIN
57 // NOLINTEND
58
59 public:
60 // prevent constructor by default
61 SaveResult& operator=(SaveResult const&);
62 SaveResult(SaveResult const&);
63 SaveResult();
64 };
65
67 public:
68 // member variables
69 // NOLINTBEGIN
71 // NOLINTEND
72
73 public:
74 // prevent constructor by default
78 };
79
80public:
81 // virtual functions
82 // NOLINTBEGIN
83 // vIndex: 0
84 virtual ~PlatformBootstrap() = default;
85
86 // vIndex: 1
87 virtual void initialize() = 0;
88
89 // vIndex: 2
90 virtual ::std::string_view getAssetRoot() = 0;
91
92 // vIndex: 3
93 virtual ::std::string_view getSaveDataRoot() = 0;
94
95 // vIndex: 4
96 virtual ::Bedrock::PlatformBootstrap::LoadResult rawLoadAssetFile(char*, uint64, char const*, char*, uint64) = 0;
97
98 // vIndex: 5
99 virtual ::Bedrock::PlatformBootstrap::LoadResult rawLoadDataFile(char*, uint64, char const*, char*, uint64) = 0;
100
101 // vIndex: 6
102 virtual ::Bedrock::PlatformBootstrap::SaveResult
103 rawSaveDataFile(char const*, uint64, char const*, bool, char*, uint64) = 0;
104
105 // vIndex: 7
106 virtual ::Bedrock::PlatformBootstrap::LoadResult
107 rawLoadFromCustomRoot(char*, uint64, char const*, char*, uint64) = 0;
108
109 // vIndex: 8
110 virtual ::Bedrock::PlatformBootstrap::CreateDirectoryResult rawCreateDirectory(char const*, char*, uint64) = 0;
111 // NOLINTEND
112
113public:
114 // member functions
115 // NOLINTBEGIN
116 MCAPI ::Bedrock::PlatformBootstrap::CreateDirectoryResult
117 _rawCreateDirectory_std(char const* path, char* errorBuffer, uint64 errorBufferSize);
118
119 MCAPI ::Bedrock::PlatformBootstrap::LoadResult _rawLoadFile_cstdio(
120 char* buffer,
121 uint64 bufferSize,
122 ::std::string_view root,
123 char const* path,
124 char* errorBuffer,
125 uint64 errorBufferSize
126 );
127 // NOLINTEND
128
129public:
130 // static functions
131 // NOLINTBEGIN
132 MCAPI static ::Bedrock::PlatformBootstrap::CreateDirectoryResult
133 _makeCreateDirectoryError(::Bedrock::PlatformBootstrap::CreateDirectoryResultCode, char*, uint64, char const*, ...);
134
135 MCAPI static ::Bedrock::PlatformBootstrap::LoadResult
136 _makeLoadError(::Bedrock::PlatformBootstrap::LoadResultCode, char*, uint64, char const*, ...);
137
138 MCAPI static ::Bedrock::PlatformBootstrap::SaveResult
139 _makeSaveError(::Bedrock::PlatformBootstrap::SaveResultCode, char*, uint64, char const*, ...);
140 // NOLINTEND
141
142public:
143 // destructor thunk
144 // NOLINTBEGIN
145
146 // NOLINTEND
147
148public:
149 // virtual function thunks
150 // NOLINTBEGIN
151
152 // NOLINTEND
153};
154
155} // namespace Bedrock
Definition PlatformBootstrap.h:7
Definition PlatformBootstrap.h:66
Definition PlatformBootstrap.h:36
Definition PlatformBootstrap.h:51
Definition buffer.h:5
Definition Alias.h:14