Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
ArchiveMD5.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 "CoreMinimal.h"
7#include "HAL/Platform.h"
8#include "Misc/AssertionMacros.h"
9#include "Misc/SecureHash.h"
10#include "Serialization/Archive.h"
11#include "UObject/NameTypes.h"
12
13/**
14 * FArchive adapter for FMD5
15 */
16class FArchiveMD5 : public FArchive
17{
18public:
19 inline FArchiveMD5()
20 {
21 SetIsLoading(false);
22 SetIsSaving(true);
24 }
25
26 virtual FString GetArchiveName() const;
27
28 void Serialize(void* Data, int64 Num) override
29 {
30 MD5.Update((uint8*)Data, Num);
31 }
32
33 using FArchive::operator<<;
34
35 virtual FArchive& operator<<(class FName& Value) override
36 {
37 FString NameAsString = Value.ToString();
38 *this << NameAsString;
39 return *this;
40 }
41
42 virtual FArchive& operator<<(struct UObject*& Value) override
43 {
44 check(0);
45 return *this;
46 }
47
48 void GetHash(FMD5Hash& Hash)
49 {
50 Hash.Set(MD5);
51 }
52
53protected:
55};
#define check(expr)
void Serialize(void *Data, int64 Num) override
Definition ArchiveMD5.h:28
virtual FString GetArchiveName() const
void GetHash(FMD5Hash &Hash)
Definition ArchiveMD5.h:48
!it would be cool if these were implemented as subclasses of
Definition SecureHash.h:64
void Update(const uint8 *input, uint64 inputLen)
FString ToString() const
Definition NameTypes.h:662
virtual void SetIsPersistent(bool bInIsPersistent)
virtual void SetIsLoading(bool bInIsLoading)
virtual void SetIsSaving(bool bInIsSaving)
void Set(FMD5 &MD5)
Definition SecureHash.h:147
Definition UE.h:432