Ark Server API (ASA) - Wiki
|
#include "Containers/ContainersFwd.h"
#include "Containers/StringFwd.h"
#include "CoreTypes.h"
#include "IO/IoHash.h"
#include "Memory/MemoryFwd.h"
#include "Memory/MemoryView.h"
#include "Memory/SharedBuffer.h"
#include "Serialization/CompactBinary.h"
#include "Templates/Function.h"
Go to the source code of this file.
Namespaces | |
namespace | UE |
namespace | UE::Serialization |
namespace | UE::Serialization::Private |
void CompactBinaryToCompactJson | ( | const FCbArrayView & | Array, |
FUtf8StringBuilderBase & | Builder ) |
void CompactBinaryToCompactJson | ( | const FCbArrayView & | Array, |
FWideStringBuilderBase & | Builder ) |
void CompactBinaryToCompactJson | ( | const FCbFieldView & | Field, |
FUtf8StringBuilderBase & | Builder ) |
Convert the compact binary to JSON in a compact format with no added whitespace.
void CompactBinaryToCompactJson | ( | const FCbFieldView & | Field, |
FWideStringBuilderBase & | Builder ) |
void CompactBinaryToCompactJson | ( | const FCbObjectView & | Object, |
FUtf8StringBuilderBase & | Builder ) |
void CompactBinaryToCompactJson | ( | const FCbObjectView & | Object, |
FWideStringBuilderBase & | Builder ) |
void CompactBinaryToJson | ( | const FCbArrayView & | Array, |
FUtf8StringBuilderBase & | Builder ) |
void CompactBinaryToJson | ( | const FCbArrayView & | Array, |
FWideStringBuilderBase & | Builder ) |
void CompactBinaryToJson | ( | const FCbFieldView & | Field, |
FUtf8StringBuilderBase & | Builder ) |
Convert the compact binary to JSON in a multi-line format with indentation.
void CompactBinaryToJson | ( | const FCbFieldView & | Field, |
FWideStringBuilderBase & | Builder ) |
void CompactBinaryToJson | ( | const FCbObjectView & | Object, |
FUtf8StringBuilderBase & | Builder ) |
void CompactBinaryToJson | ( | const FCbObjectView & | Object, |
FWideStringBuilderBase & | Builder ) |
FCbField LoadCompactBinary | ( | FArchive & | Ar, |
FCbBufferAllocator | Allocator = FUniqueBuffer::Alloc ) |
Load a compact binary field from an archive.
The field may be an array or an object, which the caller can convert to by using AsArray or AsObject as appropriate. The buffer allocator is called to provide the buffer for the field to load into once its size has been determined.
Ar | Archive to read the field from. An error state is set on failure. |
Allocator | Allocator for the buffer that the field is loaded into. |
|
inline |
Definition at line 170 of file CompactBinarySerialization.h.
|
inline |
Definition at line 164 of file CompactBinarySerialization.h.
|
inline |
Definition at line 185 of file CompactBinarySerialization.h.
bool LoadFromCompactBinary | ( | FCbFieldView | Field, |
FGuid & | OutValue ) |
bool LoadFromCompactBinary | ( | FCbFieldView | Field, |
FGuid & | OutValue, | ||
const FGuid & | Default ) |
|
inline |
Definition at line 176 of file CompactBinarySerialization.h.
|
inline |
Definition at line 158 of file CompactBinarySerialization.h.
bool LoadFromCompactBinary | ( | FCbFieldView | Field, |
FName & | OutValue ) |
bool LoadFromCompactBinary | ( | FCbFieldView | Field, |
FString & | OutValue ) |
bool LoadFromCompactBinary | ( | FCbFieldView | Field, |
FUtf8StringBuilderBase & | OutValue ) |
LoadFromCompactBinary attempts to load the output value from compact binary.
Implementations of LoadCompactBinary are expected to assign the output even on failure. Implementations may accept an optional default value to assign in case of load failure.
bool LoadFromCompactBinary | ( | FCbFieldView | Field, |
FWideStringBuilderBase & | OutValue ) |
|
inline |
Definition at line 116 of file CompactBinarySerialization.h.
|
inline |
Definition at line 122 of file CompactBinarySerialization.h.
|
inline |
Definition at line 128 of file CompactBinarySerialization.h.
|
inline |
Definition at line 110 of file CompactBinarySerialization.h.
|
inline |
Definition at line 192 of file CompactBinarySerialization.h.
|
inline |
Definition at line 140 of file CompactBinarySerialization.h.
|
inline |
Definition at line 146 of file CompactBinarySerialization.h.
|
inline |
Definition at line 152 of file CompactBinarySerialization.h.
|
inline |
Definition at line 134 of file CompactBinarySerialization.h.
uint64 MeasureCompactBinary | ( | FMemoryView | View, |
ECbFieldType | Type = ECbFieldType::HasFieldType ) |
Determine the size in bytes of the compact binary field at the start of the view.
This may be called on an incomplete or invalid field, in which case the returned size is zero. A size can always be extracted from a valid field with no name if a view of at least the first 10 bytes is provided, regardless of field size. For fields with names, the size of view needed to calculate a size is at most 10 + MaxNameLen + MeasureVarUInt(MaxNameLen).
This function can be used when streaming a field, for example, to determine the size of buffer to fill before attempting to construct a field from it.
View | A memory view that may contain the start of a field. |
Type | HasFieldType means that View contains the type. Otherwise, use the given type. |
Serialize a compact binary value to/from an archive.
void SaveCompactBinary | ( | FArchive & | Ar, |
const FCbArrayView & | Array ) |
void SaveCompactBinary | ( | FArchive & | Ar, |
const FCbFieldView & | Field ) |
Save a compact binary value to an archive.
void SaveCompactBinary | ( | FArchive & | Ar, |
const FCbObjectView & | Object ) |
bool TryMeasureCompactBinary | ( | FMemoryView | InView, |
ECbFieldType & | OutType, | ||
uint64 & | OutSize, | ||
ECbFieldType | InType = ECbFieldType::HasFieldType ) |
Try to determine the type and size of the compact binary field at the start of the view.
This may be called on an incomplete or invalid field, in which case it will return false, with OutSize being 0 for invalid fields, otherwise the minimum view size necessary to make progress in measuring the field on the next call to this function.
InView | A memory view that may contain the start of a field. |
OutType | The type (with flags) of the field. None is written until a value is available. |
OutSize | The total field size for a return of true, 0 for invalid fields, or the size to make progress in measuring the field on the next call to this function. |
InType | HasFieldType means that InView contains the type. Otherwise, use the given type. |