Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
ArchiveLoadCompressedProxy.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "Containers/Array.h"
6#include "CoreTypes.h"
7#include "Misc/Compression.h"
8#include "Misc/CompressionFlags.h"
9#include "Serialization/Archive.h"
10#include "UObject/NameTypes.h"
11
12/*----------------------------------------------------------------------------
13 FArchiveLoadCompressedProxy.
14----------------------------------------------------------------------------*/
15
16/**
17 * FArchive Proxy to transparently load compressed data from an array.
18 */
20{
21public:
22 FArchiveLoadCompressedProxy(const TArray<uint8>& InCompressedData, FName CompressionFormat, ECompressionFlags InCompressionFlags=COMPRESS_NoFlags);
23
24 /** Destructor, freeing temporary memory. */
26
27 /**
28 * Serializes data from archive. This function is called recursively and determines where to serialize
29 * from and how to do so based on internal state.
30 *
31 * @param Data Pointer to serialize to
32 * @param Count Number of bytes to read
33 */
34 virtual void Serialize( void* Data, int64 Count );
35
36 /**
37 * Seeks to the passed in position in the stream. This archive only supports forward seeking
38 * and implements it by serializing data till it reaches the position.
39 */
40 virtual void Seek( int64 InPos );
41
42 /**
43 * @return current position in uncompressed stream in bytes.
44 */
45 virtual int64 Tell();
46
47private:
48 /**
49 * Flushes tmp data to array.
50 */
52
53 /** Array to write compressed data to. */
55 /** Current index into compressed data array. */
57 /** Pointer to start of temporary buffer. */
59 /** Pointer to end of temporary buffer. */
60 uint8* TmpDataEnd;
61 /** Pointer to current position in temporary buffer. */
62 uint8* TmpData;
63 /** Whether to serialize from temporary buffer of array. */
65 /** Number of raw (uncompressed) bytes serialized. */
67 /** Compression method */
69 /** Flags used for compression. */
71};
ECompressionFlags
@ COMPRESS_NoFlags
virtual ~FArchiveLoadCompressedProxy()
FArchiveLoadCompressedProxy(const TArray< uint8 > &InCompressedData, FName CompressionFormat, ECompressionFlags InCompressionFlags=COMPRESS_NoFlags)
virtual void Serialize(void *Data, int64 Count)
virtual void Seek(int64 InPos)