Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FCbWriter Class Reference

#include <CompactBinaryWriter.h>

+ Inheritance diagram for FCbWriter:
+ Collaboration diagram for FCbWriter:

Classes

struct  FState
 

Public Member Functions

 FCbWriter ()
 
 ~FCbWriter ()
 
 FCbWriter (const FCbWriter &)=delete
 
FCbWriteroperator= (const FCbWriter &)=delete
 
void Reset ()
 
FCbFieldIterator Save () const
 
FCbFieldViewIterator Save (FMutableMemoryView Buffer) const
 
void Save (FArchive &Ar) const
 
uint64 GetSaveSize () const
 
FCbWriterSetName (FUtf8StringView Name)
 
void AddField (FUtf8StringView Name, const FCbFieldView &Value)
 
void AddField (const FCbFieldView &Value)
 
void AddField (FUtf8StringView Name, const FCbField &Value)
 
void AddField (const FCbField &Value)
 
void BeginObject (FUtf8StringView Name)
 
void BeginObject ()
 
void EndObject ()
 
void AddObject (FUtf8StringView Name, const FCbObjectView &Value)
 
void AddObject (const FCbObjectView &Value)
 
void AddObject (FUtf8StringView Name, const FCbObject &Value)
 
void AddObject (const FCbObject &Value)
 
void BeginArray (FUtf8StringView Name)
 
void BeginArray ()
 
void EndArray ()
 
void AddArray (FUtf8StringView Name, const FCbArrayView &Value)
 
void AddArray (const FCbArrayView &Value)
 
void AddArray (FUtf8StringView Name, const FCbArray &Value)
 
void AddArray (const FCbArray &Value)
 
void AddNull (FUtf8StringView Name)
 
void AddNull ()
 
void AddBinary (FUtf8StringView Name, const void *Value, uint64 Size)
 
void AddBinary (const void *Value, uint64 Size)
 
void AddBinary (FUtf8StringView Name, FMemoryView Value)
 
void AddBinary (FMemoryView Value)
 
void AddBinary (FUtf8StringView Name, const FSharedBuffer &Value)
 
void AddBinary (const FSharedBuffer &Value)
 
void AddBinary (FUtf8StringView Name, const FCompositeBuffer &Value)
 
void AddBinary (const FCompositeBuffer &Value)
 
void AddString (FUtf8StringView Name, FUtf8StringView Value)
 
void AddString (FUtf8StringView Value)
 
void AddString (FUtf8StringView Name, FWideStringView Value)
 
void AddString (FWideStringView Value)
 
void AddInteger (FUtf8StringView Name, int32 Value)
 
void AddInteger (int32 Value)
 
void AddInteger (FUtf8StringView Name, int64 Value)
 
void AddInteger (int64 Value)
 
void AddInteger (FUtf8StringView Name, uint32 Value)
 
void AddInteger (uint32 Value)
 
void AddInteger (FUtf8StringView Name, uint64 Value)
 
void AddInteger (uint64 Value)
 
void AddFloat (FUtf8StringView Name, float Value)
 
void AddFloat (float Value)
 
void AddFloat (FUtf8StringView Name, double Value)
 
void AddFloat (double Value)
 
void AddBool (FUtf8StringView Name, bool bValue)
 
void AddBool (bool bValue)
 
void AddObjectAttachment (FUtf8StringView Name, const FIoHash &Value)
 
void AddObjectAttachment (const FIoHash &Value)
 
void AddBinaryAttachment (FUtf8StringView Name, const FIoHash &Value)
 
void AddBinaryAttachment (const FIoHash &Value)
 
void AddAttachment (FUtf8StringView Name, const FCbAttachment &Attachment)
 
void AddAttachment (const FCbAttachment &Attachment)
 
void AddHash (FUtf8StringView Name, const FIoHash &Value)
 
void AddHash (const FIoHash &Value)
 
void AddUuid (FUtf8StringView Name, const FGuid &Value)
 
void AddUuid (const FGuid &Value)
 
void AddDateTimeTicks (FUtf8StringView Name, int64 Ticks)
 
void AddDateTimeTicks (int64 Ticks)
 
void AddDateTime (FUtf8StringView Name, FDateTime Value)
 
void AddDateTime (FDateTime Value)
 
void AddTimeSpanTicks (FUtf8StringView Name, int64 Ticks)
 
void AddTimeSpanTicks (int64 Ticks)
 
void AddTimeSpan (FUtf8StringView Name, FTimespan Value)
 
void AddTimeSpan (FTimespan Value)
 
void AddObjectId (FUtf8StringView Name, const FCbObjectId &Value)
 
void AddObjectId (const FCbObjectId &Value)
 
void AddCustom (FUtf8StringView FieldName, uint64 TypeId, FMemoryView Value)
 
void AddCustom (uint64 TypeId, FMemoryView Value)
 
void AddCustom (FUtf8StringView FieldName, FUtf8StringView TypeName, FMemoryView Value)
 
void AddCustom (FUtf8StringView TypeName, FMemoryView Value)
 
FCbWriteroperator<< (FUtf8StringView NameOrValue)
 
FCbWriteroperator<< (const ANSICHAR *NameOrValue)
 
FCbWriteroperator<< (const UTF8CHAR *NameOrValue)
 
FCbWriteroperator<< (const FCbFieldView &Value)
 
FCbWriteroperator<< (const FCbField &Value)
 
FCbWriteroperator<< (const FCbObjectView &Value)
 
FCbWriteroperator<< (const FCbObject &Value)
 
FCbWriteroperator<< (const FCbArrayView &Value)
 
FCbWriteroperator<< (const FCbArray &Value)
 
FCbWriteroperator<< (nullptr_t)
 
FCbWriteroperator<< (FWideStringView Value)
 
FCbWriteroperator<< (const WIDECHAR *Value)
 
FCbWriteroperator<< (int32 Value)
 
FCbWriteroperator<< (int64 Value)
 
FCbWriteroperator<< (uint32 Value)
 
FCbWriteroperator<< (uint64 Value)
 
FCbWriteroperator<< (float Value)
 
FCbWriteroperator<< (double Value)
 
FCbWriteroperator<< (bool Value)
 
FCbWriteroperator<< (const FCbAttachment &Attachment)
 
FCbWriteroperator<< (const FIoHash &Value)
 
FCbWriteroperator<< (const FGuid &Value)
 
FCbWriteroperator<< (FDateTime Value)
 
FCbWriteroperator<< (FTimespan Value)
 
FCbWriteroperator<< (const FCbObjectId &Value)
 
FCbWriteroperator<< (FName Value)
 
template<typename T , typename Allocator , std::void_t< decltype(std::declval< FCbWriter & >()<< std::declval< const T & >())> * = nullptr>
FCbWriteroperator<< (const TArray< T, Allocator > &Value)
 

Protected Member Functions

 FCbWriter (int64 InitialSize)
 

Private Member Functions

void BeginField ()
 
void EndField (ECbFieldType Type)
 
void SetNameOrAddString (FUtf8StringView NameOrValue)
 
FUtf8StringView GetActiveName () const
 
void MakeFieldsUniform (int64 FieldBeginOffset, int64 FieldEndOffset)
 

Private Attributes

TArray64< uint8Data
 
TArray< FStateStates
 

Detailed Description

A writer for compact binary object, arrays, and fields.

The writer produces a sequence of fields that can be saved to a provided memory buffer or into a new owned buffer. The typical use case is to write a single object, which can be accessed by calling Save().AsObject() or Save(Buffer).AsObjectView().

The writer will assert on most incorrect usage and will always produce valid compact binary if provided with valid input. The writer does not check for invalid UTF-8 string encoding, object fields with duplicate names, or invalid compact binary being copied from another source.

It is most convenient to use the streaming API for the writer, as demonstrated in the example.

When writing a small amount of compact binary data, TCbWriter can be more efficient as it uses a fixed-size stack buffer for storage before spilling onto the heap.

See also
TCbWriter

Example:

FCbObject WriteObject() { TCbWriter<256> Writer; Writer.BeginObject();

Writer << "Resize" << true; Writer << "MaxWidth" << 1024; Writer << "MaxHeight" << 1024;

Writer.BeginArray(); Writer << "FormatA" << "FormatB" << "FormatC"; Writer.EndArray();

Writer.EndObject(); return Writer.Save().AsObject(); }

Definition at line 67 of file CompactBinaryWriter.h.

Constructor & Destructor Documentation

◆ FCbWriter() [1/3]

FCbWriter::FCbWriter ( )

◆ ~FCbWriter()

FCbWriter::~FCbWriter ( )

◆ FCbWriter() [2/3]

FCbWriter::FCbWriter ( const FCbWriter & )
delete

◆ FCbWriter() [3/3]

FCbWriter::FCbWriter ( int64 InitialSize)
explicitprotected

Reserve the specified size up front until the format is optimized.

Member Function Documentation

◆ AddArray() [1/4]

void FCbWriter::AddArray ( const FCbArray & Value)
+ Here is the caller graph for this function:

◆ AddArray() [2/4]

void FCbWriter::AddArray ( const FCbArrayView & Value)
+ Here is the caller graph for this function:

◆ AddArray() [3/4]

void FCbWriter::AddArray ( FUtf8StringView Name,
const FCbArray & Value )
inline

Copy the value (not the name) of an existing array. Holds a reference if owned.

Definition at line 153 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddArray() [4/4]

void FCbWriter::AddArray ( FUtf8StringView Name,
const FCbArrayView & Value )
inline

Copy the value (not the name) of an existing array.

Definition at line 150 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddAttachment() [1/2]

void FCbWriter::AddAttachment ( const FCbAttachment & Attachment)
+ Here is the caller graph for this function:

◆ AddAttachment() [2/2]

void FCbWriter::AddAttachment ( FUtf8StringView Name,
const FCbAttachment & Attachment )
inline

Write a field referencing the attachment by its hash.

Definition at line 210 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddBinary() [1/8]

void FCbWriter::AddBinary ( const FCompositeBuffer & Value)
+ Here is the caller graph for this function:

◆ AddBinary() [2/8]

void FCbWriter::AddBinary ( const FSharedBuffer & Value)
+ Here is the caller graph for this function:

◆ AddBinary() [3/8]

void FCbWriter::AddBinary ( const void * Value,
uint64 Size )
+ Here is the caller graph for this function:

◆ AddBinary() [4/8]

void FCbWriter::AddBinary ( FMemoryView Value)
inline

Definition at line 165 of file CompactBinaryWriter.h.

◆ AddBinary() [5/8]

void FCbWriter::AddBinary ( FUtf8StringView Name,
const FCompositeBuffer & Value )
inline

Definition at line 169 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddBinary() [6/8]

void FCbWriter::AddBinary ( FUtf8StringView Name,
const FSharedBuffer & Value )
inline

Write a binary field by copying the buffer. Holds a reference if owned.

Definition at line 167 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddBinary() [7/8]

void FCbWriter::AddBinary ( FUtf8StringView Name,
const void * Value,
uint64 Size )
inline

Write a binary field by copying Size bytes from Value.

Definition at line 161 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddBinary() [8/8]

void FCbWriter::AddBinary ( FUtf8StringView Name,
FMemoryView Value )
inline

Write a binary field by copying the view.

Definition at line 164 of file CompactBinaryWriter.h.

◆ AddBinaryAttachment() [1/2]

void FCbWriter::AddBinaryAttachment ( const FIoHash & Value)
+ Here is the caller graph for this function:

◆ AddBinaryAttachment() [2/2]

void FCbWriter::AddBinaryAttachment ( FUtf8StringView Name,
const FIoHash & Value )
inline

Write a field referencing a binary attachment by its hash.

Definition at line 207 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddBool() [1/2]

void FCbWriter::AddBool ( bool bValue)
+ Here is the caller graph for this function:

◆ AddBool() [2/2]

void FCbWriter::AddBool ( FUtf8StringView Name,
bool bValue )
inline

Write a bool field.

Definition at line 200 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddCustom() [1/4]

void FCbWriter::AddCustom ( FUtf8StringView FieldName,
FUtf8StringView TypeName,
FMemoryView Value )
inline

Write a custom field with a string sub-type identifier.

Definition at line 245 of file CompactBinaryWriter.h.

◆ AddCustom() [2/4]

void FCbWriter::AddCustom ( FUtf8StringView FieldName,
uint64 TypeId,
FMemoryView Value )
inline

Write a custom field with an integer sub-type identifier.

Definition at line 241 of file CompactBinaryWriter.h.

◆ AddCustom() [3/4]

void FCbWriter::AddCustom ( FUtf8StringView TypeName,
FMemoryView Value )

◆ AddCustom() [4/4]

void FCbWriter::AddCustom ( uint64 TypeId,
FMemoryView Value )

◆ AddDateTime() [1/2]

void FCbWriter::AddDateTime ( FDateTime Value)

◆ AddDateTime() [2/2]

void FCbWriter::AddDateTime ( FUtf8StringView Name,
FDateTime Value )

Write a date/time field.

◆ AddDateTimeTicks() [1/2]

void FCbWriter::AddDateTimeTicks ( FUtf8StringView Name,
int64 Ticks )
inline

Write a date/time field with the specified count of 100ns ticks since the epoch.

Definition at line 221 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddDateTimeTicks() [2/2]

void FCbWriter::AddDateTimeTicks ( int64 Ticks)
+ Here is the caller graph for this function:

◆ AddField() [1/4]

void FCbWriter::AddField ( const FCbField & Value)
+ Here is the caller graph for this function:

◆ AddField() [2/4]

void FCbWriter::AddField ( const FCbFieldView & Value)
+ Here is the caller graph for this function:

◆ AddField() [3/4]

void FCbWriter::AddField ( FUtf8StringView Name,
const FCbField & Value )
inline

Copy the value (not the name) of an existing field. Holds a reference if owned.

Definition at line 127 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddField() [4/4]

void FCbWriter::AddField ( FUtf8StringView Name,
const FCbFieldView & Value )
inline

Copy the value (not the name) of an existing field.

Definition at line 124 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddFloat() [1/4]

void FCbWriter::AddFloat ( double Value)
+ Here is the caller graph for this function:

◆ AddFloat() [2/4]

void FCbWriter::AddFloat ( float Value)
+ Here is the caller graph for this function:

◆ AddFloat() [3/4]

void FCbWriter::AddFloat ( FUtf8StringView Name,
double Value )
inline

Write a float field from a 64-bit float value.

Definition at line 196 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddFloat() [4/4]

void FCbWriter::AddFloat ( FUtf8StringView Name,
float Value )
inline

Write a float field from a 32-bit float value.

Definition at line 193 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddHash() [1/2]

void FCbWriter::AddHash ( const FIoHash & Value)
+ Here is the caller graph for this function:

◆ AddHash() [2/2]

void FCbWriter::AddHash ( FUtf8StringView Name,
const FIoHash & Value )
inline

Write a hash field.

Definition at line 214 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddInteger() [1/8]

void FCbWriter::AddInteger ( FUtf8StringView Name,
int32 Value )
inline

Write an integer field.

Definition at line 180 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddInteger() [2/8]

void FCbWriter::AddInteger ( FUtf8StringView Name,
int64 Value )
inline

Write an integer field.

Definition at line 183 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddInteger() [3/8]

void FCbWriter::AddInteger ( FUtf8StringView Name,
uint32 Value )
inline

Write an integer field.

Definition at line 186 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddInteger() [4/8]

void FCbWriter::AddInteger ( FUtf8StringView Name,
uint64 Value )
inline

Write an integer field.

Definition at line 189 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddInteger() [5/8]

void FCbWriter::AddInteger ( int32 Value)
+ Here is the caller graph for this function:

◆ AddInteger() [6/8]

void FCbWriter::AddInteger ( int64 Value)
+ Here is the caller graph for this function:

◆ AddInteger() [7/8]

void FCbWriter::AddInteger ( uint32 Value)
+ Here is the caller graph for this function:

◆ AddInteger() [8/8]

void FCbWriter::AddInteger ( uint64 Value)
+ Here is the caller graph for this function:

◆ AddNull() [1/2]

void FCbWriter::AddNull ( )
+ Here is the caller graph for this function:

◆ AddNull() [2/2]

void FCbWriter::AddNull ( FUtf8StringView Name)
inline

Write a null field.

Definition at line 157 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddObject() [1/4]

void FCbWriter::AddObject ( const FCbObject & Value)
+ Here is the caller graph for this function:

◆ AddObject() [2/4]

void FCbWriter::AddObject ( const FCbObjectView & Value)
+ Here is the caller graph for this function:

◆ AddObject() [3/4]

void FCbWriter::AddObject ( FUtf8StringView Name,
const FCbObject & Value )
inline

Copy the value (not the name) of an existing object. Holds a reference if owned.

Definition at line 140 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddObject() [4/4]

void FCbWriter::AddObject ( FUtf8StringView Name,
const FCbObjectView & Value )
inline

Copy the value (not the name) of an existing object.

Definition at line 137 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddObjectAttachment() [1/2]

void FCbWriter::AddObjectAttachment ( const FIoHash & Value)
+ Here is the caller graph for this function:

◆ AddObjectAttachment() [2/2]

void FCbWriter::AddObjectAttachment ( FUtf8StringView Name,
const FIoHash & Value )
inline

Write a field referencing an object attachment by its hash.

Definition at line 204 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddObjectId() [1/2]

void FCbWriter::AddObjectId ( const FCbObjectId & Value)
+ Here is the caller graph for this function:

◆ AddObjectId() [2/2]

void FCbWriter::AddObjectId ( FUtf8StringView Name,
const FCbObjectId & Value )
inline

Write an ObjectId field.

Definition at line 237 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddString() [1/4]

void FCbWriter::AddString ( FUtf8StringView Name,
FUtf8StringView Value )
inline

Write a string field by copying the UTF-8 value.

Definition at line 173 of file CompactBinaryWriter.h.

◆ AddString() [2/4]

void FCbWriter::AddString ( FUtf8StringView Name,
FWideStringView Value )
inline

Write a string field by converting the UTF-16 value to UTF-8.

Definition at line 176 of file CompactBinaryWriter.h.

◆ AddString() [3/4]

void FCbWriter::AddString ( FUtf8StringView Value)

◆ AddString() [4/4]

void FCbWriter::AddString ( FWideStringView Value)

◆ AddTimeSpan() [1/2]

void FCbWriter::AddTimeSpan ( FTimespan Value)

◆ AddTimeSpan() [2/2]

void FCbWriter::AddTimeSpan ( FUtf8StringView Name,
FTimespan Value )

Write a time span field.

◆ AddTimeSpanTicks() [1/2]

void FCbWriter::AddTimeSpanTicks ( FUtf8StringView Name,
int64 Ticks )
inline

Write a time span field with the specified count of 100ns ticks.

Definition at line 229 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ AddTimeSpanTicks() [2/2]

void FCbWriter::AddTimeSpanTicks ( int64 Ticks)
+ Here is the caller graph for this function:

◆ AddUuid() [1/2]

void FCbWriter::AddUuid ( const FGuid & Value)
+ Here is the caller graph for this function:

◆ AddUuid() [2/2]

void FCbWriter::AddUuid ( FUtf8StringView Name,
const FGuid & Value )
inline

Write a UUID field.

Definition at line 217 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ BeginArray() [1/2]

void FCbWriter::BeginArray ( )
+ Here is the caller graph for this function:

◆ BeginArray() [2/2]

void FCbWriter::BeginArray ( FUtf8StringView Name)
inline

Begin a new array. Must have a matching call to EndArray.

Definition at line 144 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ BeginField()

void FCbWriter::BeginField ( )
private

Begin writing a field. May be called twice for named fields.

◆ BeginObject() [1/2]

void FCbWriter::BeginObject ( )
+ Here is the caller graph for this function:

◆ BeginObject() [2/2]

void FCbWriter::BeginObject ( FUtf8StringView Name)
inline

Begin a new object. Must have a matching call to EndObject.

Definition at line 131 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ EndArray()

void FCbWriter::EndArray ( )

End an array after its fields have been written.

◆ EndField()

void FCbWriter::EndField ( ECbFieldType Type)
private

Finish writing a field by writing its type.

◆ EndObject()

void FCbWriter::EndObject ( )

End an object after its fields have been written.

◆ GetActiveName()

FUtf8StringView FCbWriter::GetActiveName ( ) const
private

Returns a view of the name of the active field, if any, otherwise the empty view.

◆ GetSaveSize()

uint64 FCbWriter::GetSaveSize ( ) const

The size of buffer (in bytes) required to serialize the fields that have been written.

It is not valid to call this function in the middle of writing an object, array, or field.

◆ MakeFieldsUniform()

void FCbWriter::MakeFieldsUniform ( int64 FieldBeginOffset,
int64 FieldEndOffset )
private

Remove field types after the first to make the sequence uniform.

◆ operator<<() [1/27]

FCbWriter & FCbWriter::operator<< ( bool Value)
inline

Definition at line 405 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ operator<<() [2/27]

FCbWriter & FCbWriter::operator<< ( const ANSICHAR * NameOrValue)
inline

Write the field name if valid in this state, otherwise write the string value.

Definition at line 304 of file CompactBinaryWriter.h.

◆ operator<<() [3/27]

FCbWriter & FCbWriter::operator<< ( const FCbArray & Value)
inline

Definition at line 345 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ operator<<() [4/27]

FCbWriter & FCbWriter::operator<< ( const FCbArrayView & Value)
inline

Definition at line 339 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ operator<<() [5/27]

FCbWriter & FCbWriter::operator<< ( const FCbAttachment & Attachment)
inline

Definition at line 411 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ operator<<() [6/27]

FCbWriter & FCbWriter::operator<< ( const FCbField & Value)
inline

Definition at line 321 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ operator<<() [7/27]

FCbWriter & FCbWriter::operator<< ( const FCbFieldView & Value)
inline

Definition at line 315 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ operator<<() [8/27]

FCbWriter & FCbWriter::operator<< ( const FCbObject & Value)
inline

Definition at line 333 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ operator<<() [9/27]

FCbWriter & FCbWriter::operator<< ( const FCbObjectId & Value)
inline

Definition at line 432 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ operator<<() [10/27]

FCbWriter & FCbWriter::operator<< ( const FCbObjectView & Value)
inline

Definition at line 327 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ operator<<() [11/27]

FCbWriter & FCbWriter::operator<< ( const FGuid & Value)
inline

Definition at line 423 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ operator<<() [12/27]

FCbWriter & FCbWriter::operator<< ( const FIoHash & Value)
inline

Definition at line 417 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ operator<<() [13/27]

template<typename T , typename Allocator , std::void_t< decltype(std::declval< FCbWriter & >()<< std::declval< const T & >())> * = nullptr>
FCbWriter & FCbWriter::operator<< ( const TArray< T, Allocator > & Value)
inline

Definition at line 442 of file CompactBinaryWriter.h.

◆ operator<<() [14/27]

FCbWriter & FCbWriter::operator<< ( const UTF8CHAR * NameOrValue)
inline

Write the field name if valid in this state, otherwise write the string value.

Definition at line 310 of file CompactBinaryWriter.h.

◆ operator<<() [15/27]

FCbWriter & FCbWriter::operator<< ( const WIDECHAR * Value)
inline

Definition at line 363 of file CompactBinaryWriter.h.

◆ operator<<() [16/27]

FCbWriter & FCbWriter::operator<< ( double Value)
inline

Definition at line 399 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ operator<<() [17/27]

FCbWriter & FCbWriter::operator<< ( FDateTime Value)

◆ operator<<() [18/27]

FCbWriter & FCbWriter::operator<< ( float Value)
inline

Definition at line 393 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ operator<<() [19/27]

FCbWriter & FCbWriter::operator<< ( FName Value)

◆ operator<<() [20/27]

FCbWriter & FCbWriter::operator<< ( FTimespan Value)

◆ operator<<() [21/27]

FCbWriter & FCbWriter::operator<< ( FUtf8StringView NameOrValue)
inline

Write the field name if valid in this state, otherwise write the string value.

Definition at line 297 of file CompactBinaryWriter.h.

◆ operator<<() [22/27]

FCbWriter & FCbWriter::operator<< ( FWideStringView Value)
inline

Definition at line 357 of file CompactBinaryWriter.h.

◆ operator<<() [23/27]

FCbWriter & FCbWriter::operator<< ( int32 Value)
inline

Definition at line 369 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ operator<<() [24/27]

FCbWriter & FCbWriter::operator<< ( int64 Value)
inline

Definition at line 375 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ operator<<() [25/27]

FCbWriter & FCbWriter::operator<< ( nullptr_t )
inline

Definition at line 351 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ operator<<() [26/27]

FCbWriter & FCbWriter::operator<< ( uint32 Value)
inline

Definition at line 381 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ operator<<() [27/27]

FCbWriter & FCbWriter::operator<< ( uint64 Value)
inline

Definition at line 387 of file CompactBinaryWriter.h.

+ Here is the call graph for this function:

◆ operator=()

FCbWriter & FCbWriter::operator= ( const FCbWriter & )
delete

◆ Reset()

void FCbWriter::Reset ( )

Empty the writer without releasing any allocated memory.

◆ Save() [1/3]

FCbFieldIterator FCbWriter::Save ( ) const

Serialize the field(s) to an owned buffer and return it as an iterator.

It is not valid to call this function in the middle of writing an object, array, or field. The writer remains valid for further use when this function returns.

◆ Save() [2/3]

void FCbWriter::Save ( FArchive & Ar) const

Serialize the field(s) to an archive.

It is not valid to call this function in the middle of writing an object, array, or field. The writer remains valid for further use when this function returns.

Parameters
ArAn archive to write to. Exactly GetSaveSize() bytes will be written.

◆ Save() [3/3]

FCbFieldViewIterator FCbWriter::Save ( FMutableMemoryView Buffer) const

Serialize the field(s) to memory.

It is not valid to call this function in the middle of writing an object, array, or field. The writer remains valid for further use when this function returns.

Parameters
BufferA mutable memory view to write to. Must be exactly GetSaveSize() bytes.
Returns
An iterator for the field(s) written to the buffer.

◆ SetName()

FCbWriter & FCbWriter::SetName ( FUtf8StringView Name)

Sets the name of the next field to be written.

It is not valid to call this function when writing a field inside an array. Names must be valid UTF-8 and must be unique within an object.

◆ SetNameOrAddString()

void FCbWriter::SetNameOrAddString ( FUtf8StringView NameOrValue)
private

Set the field name if valid in this state, otherwise write add a string field.

Member Data Documentation

◆ Data

TArray64<uint8> FCbWriter::Data
private

Definition at line 292 of file CompactBinaryWriter.h.

◆ States

TArray<FState> FCbWriter::States
private

Definition at line 293 of file CompactBinaryWriter.h.


The documentation for this class was generated from the following file: