Ark Server API (ASA) - Wiki
|
#include <CompactBinary.h>
Public Member Functions | |
FCbObjectView () | |
FCbFieldView | FindView (FUtf8StringView Name) const |
FCbFieldView | FindViewIgnoreCase (FUtf8StringView Name) const |
FCbFieldView | operator[] (FUtf8StringView Name) const |
FCbFieldView | AsFieldView () const |
operator bool () const | |
uint64 | GetSize () const |
FIoHash | GetHash () const |
void | AppendHash (FIoHashBuilder &Builder) const |
bool | Equals (const FCbObjectView &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 FCbObjectView | FromFieldNoCheck (const FCbFieldView &Field) |
Private Member Functions | |
FCbObjectView (const FCbFieldView &Field) | |
Array of FCbField[View] that have unique names.
Accessing the fields of an object is always a safe operation, even if the requested field does not exist. Fields may be accessed by name or through iteration. When a field is requested that is not found in the object, the field that it returns has no value (evaluates to false) though attempting to access the empty field is also safe, as described by FCbFieldView.
This type only provides a view into memory and does not perform any memory management itself. Use FCbObject to hold a reference to the underlying memory when necessary.
Definition at line 1021 of file CompactBinary.h.
FCbObjectView::FCbObjectView | ( | ) |
Construct an object with no fields.
|
inlineexplicitprivate |
Construct an object from an object field. No type check is performed! Use via FromFieldNoCheck.
Definition at line 1102 of file CompactBinary.h.
void FCbObjectView::AppendHash | ( | FIoHashBuilder & | Builder | ) | const |
Append the hash of the object if serialized by itself with no name.
|
inline |
Access the object as an object field.
Definition at line 1048 of file CompactBinary.h.
|
inline |
DO NOT USE DIRECTLY. These functions enable range-based for loop support.
Definition at line 822 of file CompactBinary.h.
Copy the object into an archive. This will write GetSize() bytes, with no name.
void FCbObjectView::CopyTo | ( | FMutableMemoryView | Buffer | ) | const |
Copy the object into a buffer of exactly GetSize() bytes, with no name.
FCbFieldViewIterator FCbFieldView::CreateViewIterator | ( | ) | const |
|
inlineconstexpr |
Definition at line 823 of file CompactBinary.h.
bool FCbObjectView::Equals | ( | const FCbObjectView & | Other | ) | const |
Whether this object is identical to the other object.
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.
|
constexprdefault |
|
inlineexplicit |
Definition at line 621 of file CompactBinaryValue.h.
|
explicit |
FCbFieldView FCbObjectView::FindView | ( | FUtf8StringView | Name | ) | const |
Find a field by case-sensitive name comparison.
The cost of this operation scales linearly with the number of fields in the object. Prefer to iterate over the fields only once when consuming an object.
Name | The name of the field. |
FCbFieldView FCbObjectView::FindViewIgnoreCase | ( | FUtf8StringView | Name | ) | const |
Find a field by case-insensitive name comparison.
|
inlinestatic |
Construct an object from an object field. No type check is performed!
Definition at line 1051 of file CompactBinary.h.
FIoHash FCbObjectView::GetHash | ( | ) | const |
Calculate the hash of the object if serialized by itself with no name.
uint64 FCbObjectView::GetSize | ( | ) | const |
Returns the size of the object in bytes if serialized by itself with no name.
|
inline |
Invoke the visitor for every attachment in the object.
Definition at line 1082 of file CompactBinary.h.
|
explicit |
Whether the object has any fields.
|
inline |
Find a field by case-sensitive name comparison.
Definition at line 1045 of file CompactBinary.h.
|
inline |
Try to get a view of the object as it would be serialized, such as by CopyTo.
A view is available if the object contains its type and has no name. Access the equivalent for other objects through FCbObject::GetBuffer, FCbObject::Clone, or CopyTo.
Definition at line 1090 of file CompactBinary.h.