Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
LargeMemoryReader.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/UnrealString.h"
6#include "CoreTypes.h"
7#include "Misc/EnumClassFlags.h"
8#include "Serialization/MemoryArchive.h"
9#include "UObject/NameTypes.h"
10#include "UObject/UnrealNames.h"
11
13{
14 None = 0x0, // No Flags
15 TakeOwnership = 0x1, // Archive will take ownership of the passed-in memory and free it on destruction
16 Persistent = 0x2, // Archive will be set as persistent when constructed
17};
18
20
21/**
22* Archive for reading a large amount of arbitrary data from memory
23*/
25{
26public:
27
28 FLargeMemoryReader(const uint8* InData, const int64 Num, ELargeMemoryReaderFlags InFlags = ELargeMemoryReaderFlags::None, const FName InArchiveName = NAME_None);
29
30 virtual void Serialize(void* OutData, int64 Num) override;
31
32 /**
33 * Gets the total size of the data buffer
34 */
35 virtual int64 TotalSize() override;
36
37 /**
38 * Returns the name of the Archive. Useful for getting the name of the package a struct or object
39 * is in when a loading error occurs.
40 *
41 * This is overridden for the specific Archive Types
42 **/
43 virtual FString GetArchiveName() const override;
44
45 /**
46 * Destructor
47 */
49
50private:
51
52 /** Non-copyable */
55
56 /** Whether the data buffer should be freed when this archive is closed */
57 const uint8 bFreeOnClose : 1;
58
59 /** Data buffer we are reading from */
60 const uint8* Data;
61
62 /** Total size of the data buffer */
63 const int64 NumBytes;
64
65 /** Name of the archive this buffer is for */
67};
#define ENUM_CLASS_FLAGS(Enum)
ELargeMemoryReaderFlags
Definition Enums.h:17840
FLargeMemoryReader(const uint8 *InData, const int64 Num, ELargeMemoryReaderFlags InFlags=ELargeMemoryReaderFlags::None, const FName InArchiveName=NAME_None)
virtual int64 TotalSize() override
FLargeMemoryReader(const FLargeMemoryReader &)=delete
virtual FString GetArchiveName() const override
FLargeMemoryReader & operator=(const FLargeMemoryReader &)=delete
virtual void Serialize(void *OutData, int64 Num) override