![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <CompactBinaryPackage.h>
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.
|
default |
Construct a null attachment.
|
inlineexplicit |
Construct an object attachment. Value is cloned if not owned.
|
inlineexplicit |
|
inlineexplicit |
Construct a raw binary attachment from a shared/composite buffer. Value is cloned if not owned.
|
inlineexplicit |
|
inlineexplicit |
Construct a compressed binary attachment. Value is cloned if not owned.
|
inlineexplicit |
|
inlineexplicit |
|
inlineexplicit |
|
inline |
Access the attachment as raw binary in a single contiguous buffer. Defaults to a null buffer on error.
|
inline |
Access the attachment as raw binary. Defaults to a null buffer on error.
|
inline |
Access the attachment as compressed binary. Defaults to a null buffer on error.
|
inline |
Access the attachment as an object. Defaults to an empty object on error.
| FIoHash FCbAttachment::GetHash | ( | ) | const |
Returns the hash of the attachment value.
|
inline |
Returns whether the attachment is raw binary.
|
inline |
Returns whether the attachment is compressed binary.
|
inline |
Whether the attachment has a null value.
|
inline |
Returns whether the attachment is an object.
|
inlineexplicit |
Whether the attachment has a non-null value.
|
inline |
|
inline |
|
inline |
Compares attachments by their hash. Any discrepancy in type must be handled externally.
|
inline |
Reset this to a null attachment.
Save the attachment into the archive as a stream of compact binary fields.
Save the attachment into the writer as a stream of compact binary fields.
| bool FCbAttachment::TryLoad | ( | FArchive & | Ar, |
| FCbBufferAllocator | Allocator = FUniqueBuffer::Alloc |
||
| ) |
Load the attachment from compact binary as written by Save.
The attachments value will be loaded into an owned buffer.
| Ar | Archive to read the attachment from. An error state is set on failure. |
| Allocator | Allocator for the attachment value buffer. |
| bool FCbAttachment::TryLoad | ( | FCbFieldIterator & | Fields | ) |
Load the attachment from compact binary as written by Save.
The attachment references the input iterator if it is owned, and otherwise clones the value.
The iterator is advanced as attachment fields are consumed from it.