Navigation
API > API/Runtime > API/Runtime/Core
An attachment is either null, raw binary, compressed binary, or an object.
Attachments are always identified by their raw hash, even when stored compressed.
An attachment is serialized as a sequence of compact binary fields with no name. It is invalid to serialize a null attachment. A raw binary attachment is serialized as an empty Binary field when empty, and otherwise as a BinaryAttachment field containing the raw hash, followed by the raw binary data in a Binary field. A compressed binary attachment is serialized as Binary with a compressed buffer as the value. An object is serialized as an empty Object field when empty, and otherwise as an ObjectAttachment field containing the hash, followed by the object data in an Object field.
| Name | FCbAttachment |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Serialization/CompactBinaryPackage.h |
| Include Path | #include "Serialization/CompactBinaryPackage.h" |
Syntax
class FCbAttachment
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
FCbAttachment
(
FCompressedBuffer&& InValue, |
Serialization/CompactBinaryPackage.h | ||
FCbAttachment
(
const FCompressedBuffer& InValue, |
Serialization/CompactBinaryPackage.h | ||
FCbAttachment
(
BufferType&& InValue, |
Serialization/CompactBinaryPackage.h | ||
FCbAttachment
(
FCbObject&& InValue, |
Serialization/CompactBinaryPackage.h | ||
FCbAttachment
(
const FCbObject& InValue, |
Serialization/CompactBinaryPackage.h | ||
FCbAttachment
(
TInPlaceType< FBinaryValue >, |
Serialization/CompactBinaryPackage.h | ||
FCbAttachment
(
FCompressedBuffer&& InValue |
Serialization/CompactBinaryPackage.h | ||
FCbAttachment
(
const FCompressedBuffer& InValue |
Construct a compressed binary attachment. Value is cloned if not owned. | Serialization/CompactBinaryPackage.h | |
FCbAttachment
(
BufferType&& InValue |
Construct a raw binary attachment from a shared/composite buffer. Value is cloned if not owned. | Serialization/CompactBinaryPackage.h | |
FCbAttachment
(
FCbObject&& InValue |
Serialization/CompactBinaryPackage.h | ||
FCbAttachment
(
const FCbObject& InValue |
Construct an object attachment. Value is cloned if not owned. | Serialization/CompactBinaryPackage.h | |
| Construct a null attachment. | Serialization/CompactBinaryPackage.h |
Structs
| Name | Remarks |
|---|---|
| FBinaryValue | |
| FCompressedBinaryValue | |
| FObjectValue |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Value | TVariant< TYPE_OF_NULLPTR, FObjectValue, FBinaryValue, FCompressedBinaryValue > | Serialization/CompactBinaryPackage.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Access the attachment as raw binary in a single contiguous buffer. | Serialization/CompactBinaryPackage.h | ||
const FCompositeBuffer & AsCompositeBinary() |
Access the attachment as raw binary. Defaults to a null buffer on error. | Serialization/CompactBinaryPackage.h | |
const FCompressedBuffer & AsCompressedBinary() |
Access the attachment as compressed binary. Defaults to a null buffer on error. | Serialization/CompactBinaryPackage.h | |
FCbObject AsObject() |
Access the attachment as an object. Defaults to an empty object on error. | Serialization/CompactBinaryPackage.h | |
FIoHash GetHash() |
Returns the hash of the attachment value. | Serialization/CompactBinaryPackage.h | |
bool IsBinary() |
Returns whether the attachment is raw binary. | Serialization/CompactBinaryPackage.h | |
bool IsCompressedBinary() |
Returns whether the attachment is compressed binary. | Serialization/CompactBinaryPackage.h | |
bool IsNull() |
Whether the attachment has a null value. | Serialization/CompactBinaryPackage.h | |
bool IsObject() |
Returns whether the attachment is an object. | Serialization/CompactBinaryPackage.h | |
void Reset() |
Reset this to a null attachment. | Serialization/CompactBinaryPackage.h | |
| Save the attachment into the writer as a stream of compact binary fields. | Serialization/CompactBinaryPackage.h | ||
| Save the attachment into the archive as a stream of compact binary fields. | Serialization/CompactBinaryPackage.h | ||
bool TryLoad
(
FCbFieldIterator& Fields |
Load the attachment from compact binary as written by Save. | Serialization/CompactBinaryPackage.h | |
| Load the attachment from compact binary as written by Save. | Serialization/CompactBinaryPackage.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
operator bool() |
Whether the attachment has a non-null value. | Serialization/CompactBinaryPackage.h | |
bool operator!=
(
const FCbAttachment& Attachment |
Serialization/CompactBinaryPackage.h | ||
bool operator==
(
const FCbAttachment& Attachment |
Compares attachments by their hash. Any discrepancy in type must be handled externally. | Serialization/CompactBinaryPackage.h |