MCPcopy Create free account
hub / github.com/Tencent/sluaunreal / ReadFile

Function ReadFile

Source/democpp/MyGameInstance.cpp:11–26  ·  view source on GitHub ↗

read file content

Source from the content-addressed store, hash-verified

9
10// read file content
11static uint8* ReadFile(IPlatformFile& PlatformFile, FString path, uint32& len) {
12 IFileHandle* FileHandle = PlatformFile.OpenRead(*path);
13 if (FileHandle) {
14 len = (uint32)FileHandle->Size();
15 uint8* buf = new uint8[len];
16
17 FileHandle->Read(buf, len);
18
19 // Close the file again
20 delete FileHandle;
21
22 return buf;
23 }
24
25 return nullptr;
26}
27
28UMyGameInstance::UMyGameInstance() : state(nullptr)
29{

Callers

nothing calls this directly

Calls 1

ReadMethod · 0.80

Tested by

no test coverage detected