Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
ArrayReader.h
Go to the documentation of this file.
1
// Copyright Epic Games, Inc. All Rights Reserved.
2
3
#
pragma
once
4
5
#
include
"CoreTypes.h"
6
#
include
"HAL/UnrealMemory.h"
7
#
include
"Containers/Array.h"
8
#
include
"Containers/UnrealString.h"
9
#
include
"Serialization/MemoryArchive.h"
10
11
class
FArrayReader
final
:
public
FMemoryArchive
,
public
TArray<uint8>
12
{
13
public
:
14
FArrayReader
(
bool
bIsPersistent=
false
)
15
{
16
this
->
SetIsLoading
(
true
)
;
17
this
->
SetIsPersistent
(
bIsPersistent
)
;
18
}
19
20
/**
21
* Returns the name of the Archive. Useful for getting the name of the package a struct or object
22
* is in when a loading error occurs.
23
*
24
* This is overridden for the specific Archive Types
25
**/
26
virtual
FString
GetArchiveName
()
const
{
return
TEXT
(
"FArrayReader"
); }
27
28
int64
TotalSize
()
29
{
30
return
(int64)Num();
31
}
32
33
void
Serialize
(
void
* Data, int64 Count)
34
{
35
if
(Count && !
IsError
(
)
)
36
{
37
// Only serialize if we have the requested amount of data
38
if
(
Offset
+ Count <= Num())
39
{
40
FMemory::Memcpy(Data, &((*
this
)[(int32)Offset]), Count);
41
Offset
+= Count;
42
}
43
else
44
{
45
SetError
(
)
;
46
}
47
}
48
}
49
};
TEXT
#define TEXT(x)
Definition
Platform.h:1108
FArrayReader::FArrayReader
FArrayReader(bool bIsPersistent=false)
Definition
ArrayReader.h:14
FArrayReader::GetArchiveName
virtual FString GetArchiveName() const
Definition
ArrayReader.h:26
FArrayReader::Serialize
void Serialize(void *Data, int64 Count)
Definition
ArrayReader.h:33
FArrayReader::TotalSize
int64 TotalSize()
Definition
ArrayReader.h:28
FMemoryArchive
Definition
MemoryArchive.h:15
FMemoryArchive::Offset
int64 Offset
Definition
MemoryArchive.h:68
FString
Definition
UnrealString.h:59
FArchiveState::SetIsPersistent
virtual void SetIsPersistent(bool bInIsPersistent)
FArchiveState::SetError
void SetError()
FArchiveState::IsError
FORCEINLINE bool IsError() const
Definition
Archive.h:337
FArchiveState::SetIsLoading
virtual void SetIsLoading(bool bInIsLoading)
Downloads
ArkServerAPI_NEW
ASA
AsaApi
AsaApi
Core
Public
API
UE
Serialization
ArrayReader.h
Generated by
1.10.0