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

#include <CompactBinary.h>

+ Inheritance diagram for FCbArrayView:
+ Collaboration diagram for FCbArrayView:

Public Member Functions

 FCbArrayView ()
 
uint64 Num () const
 
FCbFieldView AsFieldView () const
 
 operator bool () const
 
uint64 GetSize () const
 
FIoHash GetHash () const
 
void AppendHash (FIoHashBuilder &Builder) const
 
bool Equals (const FCbArrayView &Other) const
 
void CopyTo (FMutableMemoryView Buffer) const
 
void CopyTo (FArchive &Ar) const
 
void IterateAttachments (FCbFieldVisitor Visitor) const
 
bool TryGetView (FMemoryView &OutView) const
 
constexpr FCbFieldView ()=default
 
 FCbFieldView (const void *Data, ECbFieldType Type=ECbFieldType::HasFieldType)
 
 FCbFieldView (const FCbValue &Value)
 
FCbFieldViewIterator CreateViewIterator () const
 
FCbFieldViewIterator begin () const
 
constexpr FCbIteratorSentinel end () const
 

Static Public Member Functions

static FCbArrayView FromFieldNoCheck (const FCbFieldView &Field)
 

Private Member Functions

 FCbArrayView (const FCbFieldView &Field)
 

Additional Inherited Members

- Protected Member Functions inherited from FCbFieldView
FMemoryView GetView () const
 
FMemoryView GetViewNoType () const
 
FMemoryView GetValueView () const
 
constexpr ECbFieldType GetType () const
 
constexpr ECbFieldType GetTypeWithFlags () const
 
constexpr const voidGetValueData () const
 
const voidGetValueEnd () const
 
uint64 GetValueSize () const
 
void Assign (const void *InData, const ECbFieldType InType)
 
constexpr FCbFieldView ()=default
 
 FCbFieldView (const void *Data, ECbFieldType Type=ECbFieldType::HasFieldType)
 
 FCbFieldView (const FCbValue &Value)
 
constexpr FCbFieldView RemoveName () const
 
constexpr FUtf8StringView GetName () const
 
FCbValue GetValue () const
 
FCbObjectView AsObjectView ()
 
FCbArrayView AsArrayView ()
 
FMemoryView AsBinaryView (FMemoryView Default=FMemoryView())
 
FUtf8StringView AsString (FUtf8StringView Default=FUtf8StringView())
 
int8 AsInt8 (int8 Default=0)
 
int16 AsInt16 (int16 Default=0)
 
int32 AsInt32 (int32 Default=0)
 
int64 AsInt64 (int64 Default=0)
 
uint8 AsUInt8 (uint8 Default=0)
 
uint16 AsUInt16 (uint16 Default=0)
 
uint32 AsUInt32 (uint32 Default=0)
 
uint64 AsUInt64 (uint64 Default=0)
 
float AsFloat (float Default=0.0f)
 
double AsDouble (double Default=0.0)
 
bool AsBool (bool bDefault=false)
 
FIoHash AsObjectAttachment (const FIoHash &Default=FIoHash())
 
FIoHash AsBinaryAttachment (const FIoHash &Default=FIoHash())
 
FIoHash AsAttachment (const FIoHash &Default=FIoHash())
 
FIoHash AsHash (const FIoHash &Default=FIoHash())
 
FGuid AsUuid ()
 
FGuid AsUuid (const FGuid &Default)
 
int64 AsDateTimeTicks (int64 Default=0)
 
FDateTime AsDateTime ()
 
FDateTime AsDateTime (FDateTime Default)
 
int64 AsTimeSpanTicks (int64 Default=0)
 
FTimespan AsTimeSpan ()
 
FTimespan AsTimeSpan (FTimespan Default)
 
FCbObjectId AsObjectId (const FCbObjectId &Default=FCbObjectId())
 
FCbCustomById AsCustomById (FCbCustomById Default=FCbCustomById())
 
FCbCustomByName AsCustomByName (FCbCustomByName Default=FCbCustomByName())
 
FMemoryView AsCustom (uint64 Id, FMemoryView Default=FMemoryView())
 
FMemoryView AsCustom (FUtf8StringView Name, FMemoryView Default=FMemoryView())
 
constexpr bool HasName () const
 
constexpr bool IsNull () const
 
constexpr bool IsObject () const
 
constexpr bool IsArray () const
 
constexpr bool IsBinary () const
 
constexpr bool IsString () const
 
constexpr bool IsInteger () const
 
constexpr bool IsFloat () const
 
constexpr bool IsBool () const
 
constexpr bool IsObjectAttachment () const
 
constexpr bool IsBinaryAttachment () const
 
constexpr bool IsAttachment () const
 
constexpr bool IsHash () const
 
constexpr bool IsUuid () const
 
constexpr bool IsDateTime () const
 
constexpr bool IsTimeSpan () const
 
constexpr bool IsObjectId () const
 
constexpr bool IsCustomById () const
 
constexpr bool IsCustomByName () const
 
constexpr operator bool () const
 
constexpr bool HasValue () const
 
constexpr bool HasError () const
 
constexpr ECbFieldError GetError () const
 
uint64 GetSize () const
 
FIoHash GetHash () const
 
void AppendHash (FIoHashBuilder &Builder) const
 
bool Equals (const FCbFieldView &Other) const
 
void CopyTo (FMutableMemoryView Buffer) const
 
void CopyTo (FArchive &Ar) const
 
void IterateAttachments (FCbFieldVisitor Visitor) const
 
bool TryGetView (FMemoryView &OutView) const
 
FCbFieldView operator[] (FUtf8StringView Name) const
 
FCbFieldViewIterator CreateViewIterator () const
 
FCbFieldViewIterator begin () const
 
constexpr FCbIteratorSentinel end () const
 

Detailed Description

Array of FCbField[View] that have no names.

Accessing a field of the array requires iteration. Access by index is not provided because the cost of accessing an item by index scales linearly with the index.

This type only provides a view into memory and does not perform any memory management itself. Use FCbArray to hold a reference to the underlying memory when necessary.

Definition at line 938 of file CompactBinary.h.

Constructor & Destructor Documentation

◆ FCbArrayView() [1/2]

FCbArrayView::FCbArrayView ( )

Construct an array with no fields.

◆ FCbArrayView() [2/2]

FCbArrayView::FCbArrayView ( const FCbFieldView & Field)
inlineexplicitprivate

Construct an array from an array field. No type check is performed! Use via FromFieldNoCheck.

Definition at line 1005 of file CompactBinary.h.

+ Here is the caller graph for this function:

Member Function Documentation

◆ AppendHash()

void FCbArrayView::AppendHash ( FIoHashBuilder & Builder) const

Append the hash of the array if serialized by itself with no name.

◆ AsFieldView()

FCbFieldView FCbArrayView::AsFieldView ( ) const
inline

Access the array as an array field.

Definition at line 951 of file CompactBinary.h.

+ Here is the call graph for this function:

◆ begin()

FCbFieldViewIterator FCbFieldView::begin ( ) const
inline

DO NOT USE DIRECTLY. These functions enable range-based for loop support.

Definition at line 822 of file CompactBinary.h.

◆ CopyTo() [1/2]

void FCbArrayView::CopyTo ( FArchive & Ar) const

Copy the array into an archive. This will write GetSize() bytes, with no name.

◆ CopyTo() [2/2]

void FCbArrayView::CopyTo ( FMutableMemoryView Buffer) const

Copy the array into a buffer of exactly GetSize() bytes, with no name.

◆ CreateViewIterator()

FCbFieldViewIterator FCbFieldView::CreateViewIterator ( ) const

◆ end()

constexpr FCbIteratorSentinel FCbFieldView::end ( ) const
inlineconstexpr

Definition at line 823 of file CompactBinary.h.

◆ Equals()

bool FCbArrayView::Equals ( const FCbArrayView & Other) const

Whether this array is identical to the other array.

Performs a deep comparison of any contained arrays or objects and their fields. Comparison assumes that both fields are valid and are written in the canonical format. Fields must be written in the same order in arrays and objects, and name comparison is case sensitive. If these assumptions do not hold, this may return false for equivalent inputs. Validation can be done with the All mode to check these assumptions about the format of the inputs.

◆ FCbFieldView() [1/3]

constexpr FCbFieldView::FCbFieldView ( )
constexprdefault

◆ FCbFieldView() [2/3]

FORCEINLINE FCbFieldView::FCbFieldView ( const FCbValue & Value)
inlineexplicit
See also
FCbFieldView::FCbFieldView

Definition at line 621 of file CompactBinaryValue.h.

◆ FCbFieldView() [3/3]

FCbFieldView::FCbFieldView ( const void * Data,
ECbFieldType Type = ECbFieldType::HasFieldType )
explicit

◆ FromFieldNoCheck()

static FCbArrayView FCbArrayView::FromFieldNoCheck ( const FCbFieldView & Field)
inlinestatic

Construct an array from an array field. No type check is performed!

Definition at line 954 of file CompactBinary.h.

+ Here is the call graph for this function:

◆ GetHash()

FIoHash FCbArrayView::GetHash ( ) const

Calculate the hash of the array if serialized by itself with no name.

◆ GetSize()

uint64 FCbArrayView::GetSize ( ) const

Returns the size of the array in bytes if serialized by itself with no name.

◆ IterateAttachments()

void FCbArrayView::IterateAttachments ( FCbFieldVisitor Visitor) const
inline

Invoke the visitor for every attachment in the array.

Definition at line 985 of file CompactBinary.h.

◆ Num()

uint64 FCbArrayView::Num ( ) const

Returns the number of items in the array.

+ Here is the caller graph for this function:

◆ operator bool()

FCbArrayView::operator bool ( ) const
inlineexplicit

Whether the array has any fields.

Definition at line 957 of file CompactBinary.h.

+ Here is the call graph for this function:

◆ TryGetView()

bool FCbArrayView::TryGetView ( FMemoryView & OutView) const
inline

Try to get a view of the array as it would be serialized, such as by CopyTo.

A view is available if the array contains its type and has no name. Access the equivalent for other arrays through FCbArray::GetBuffer, FCbArray::Clone, or CopyTo.

Definition at line 993 of file CompactBinary.h.


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