Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
CompactBinary.h File Reference
#include "Containers/StringFwd.h"
#include "Containers/StringView.h"
#include "CoreTypes.h"
#include "HAL/UnrealMemory.h"
#include "IO/IoHash.h"
#include "Memory/CompositeBuffer.h"
#include "Memory/MemoryFwd.h"
#include "Memory/MemoryView.h"
#include "Memory/SharedBuffer.h"
#include "Misc/AssertionMacros.h"
#include "Misc/EnumClassFlags.h"
#include "String/BytesToHex.h"
#include "Templates/Function.h"
#include "Templates/IsTriviallyDestructible.h"
#include "Templates/RemoveReference.h"
#include "Templates/UnrealTemplate.h"
+ Include dependency graph for CompactBinary.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  FCbFieldType
 
class  FCbIteratorSentinel
 
class  TCbFieldIterator< FieldType >
 
class  FCbObjectId
 
struct  FCbCustomById
 
struct  FCbCustomByName
 
struct  UE::CompactBinary::Private::FIntegerParams
 
class  FCbFieldView
 
class  FCbFieldViewIterator
 
class  FCbArrayView
 
class  FCbObjectView
 
class  TCbBuffer< ViewType >
 
class  TCbBufferFactory< Type, ViewType >
 
class  FCbField
 
class  FCbFieldIterator
 
class  FCbArray
 
class  FCbObject
 

Namespaces

namespace  UE
 
namespace  UE::CompactBinary
 
namespace  UE::CompactBinary::Private
 

Typedefs

using FCbBufferAllocator = TFunctionRef<FUniqueBuffer (uint64 Size)>
 
using FCbFieldVisitor = TFunctionRef<void (FCbFieldView)>
 

Enumerations

enum class  ECbFieldType : uint8 {
  None = 0x00 , Null = 0x01 , Object = 0x02 , UniformObject = 0x03 ,
  Array = 0x04 , UniformArray = 0x05 , Binary = 0x06 , String = 0x07 ,
  IntegerPositive = 0x08 , IntegerNegative = 0x09 , Float32 = 0x0a , Float64 = 0x0b ,
  BoolFalse = 0x0c , BoolTrue = 0x0d , ObjectAttachment = 0x0e , BinaryAttachment = 0x0f ,
  Hash = 0x10 , Uuid = 0x11 , DateTime = 0x12 , TimeSpan = 0x13 ,
  ObjectId = 0x14 , CustomById = 0x1e , CustomByName = 0x1f , Reserved = 0x20 ,
  HasFieldType = 0x40 , HasFieldName = 0x80
}
 
enum class  ECbFieldError : uint8 { None , TypeError , RangeError }
 

Functions

 ENUM_CLASS_FLAGS (ECbFieldType)
 
template<typename IntType >
static constexpr FIntegerParams UE::CompactBinary::Private::MakeIntegerParams ()
 

Typedef Documentation

◆ FCbBufferAllocator

A reference to a function that is used to allocate buffers for compact binary data.

Definition at line 90 of file CompactBinary.h.

◆ FCbFieldVisitor

A reference to a function that is used to visit fields.

Definition at line 323 of file CompactBinary.h.

Enumeration Type Documentation

◆ ECbFieldError

Errors that can occur when accessing a field.

Enumerator
None 

The field is not in an error state.

TypeError 

The value type does not match the requested type.

RangeError 

The value is out of range for the requested type.

Definition at line 461 of file CompactBinary.h.

◆ ECbFieldType

Field types and flags for FCbField[View].

DO NOT CHANGE THE VALUE OF ANY MEMBERS OF THIS ENUM! BACKWARD COMPATIBILITY REQUIRES THAT THESE VALUES BE FIXED! SERIALIZATION USES HARD-CODED CONSTANTS BASED ON THESE VALUES!

Enumerator
None 

A field type that does not occur in a valid object.

Null 

Null. Value is empty.

Object 

Object is an array of fields with unique non-empty names.

Value is a VarUInt byte count for the encoded fields, followed by the fields.

UniformObject 

UniformObject is an array of fields with the same field types and unique non-empty names.

Value is a VarUInt byte count for the encoded fields, followed by the field type, followed by the fields encoded with no type.

Array 

Array is an array of fields with no name that may be of different types.

Value is a VarUInt byte count, followed by a VarUInt field count, followed by the fields.

UniformArray 

UniformArray is an array of fields with no name and with the same field type.

Value is a VarUInt byte count, followed by a VarUInt field count, followed by the field type, followed by the fields encoded with no type.

Binary 

Binary. Value is a VarUInt byte count followed by the data.

String 

String in UTF-8. Value is a VarUInt byte count then an unterminated UTF-8 string.

IntegerPositive 

Non-negative integer with the range of a 64-bit unsigned integer.

Value is the value encoded as a VarUInt.

IntegerNegative 

Negative integer with the range of a 64-bit signed integer.

Value is the ones' complement of the value encoded as a VarUInt.

Float32 

Single precision float. Value is one big endian IEEE 754 binary32 float.

Float64 

Double precision float. Value is one big endian IEEE 754 binary64 float.

BoolFalse 

Boolean false value. Value is empty.

BoolTrue 

Boolean true value. Value is empty.

ObjectAttachment 

ObjectAttachment is a reference to a compact binary object attachment stored externally.

Value is a 160-bit hash digest of the referenced compact binary object data.

BinaryAttachment 

BinaryAttachment is a reference to a binary attachment stored externally.

Value is a 160-bit hash digest of the referenced binary data.

Hash 

Hash. Value is a 160-bit hash digest.

Uuid 

UUID/GUID. Value is a 128-bit UUID as defined by RFC 4122.

DateTime 

Date and time between 0001-01-01 00:00:00.0000000 and 9999-12-31 23:59:59.9999999.

Value is a big endian int64 count of 100ns ticks since 0001-01-01 00:00:00.0000000.

TimeSpan 

Difference between two date/time values.

Value is a big endian int64 count of 100ns ticks in the span, and may be negative.

ObjectId 

ObjectId is an opaque object identifier. See FCbObjectId.

Value is a 12-byte object identifier.

CustomById 

CustomById identifies the sub-type of its value by an integer identifier.

Value is a VarUInt byte count, followed by a VarUInt encoding of the sub-type identifier, followed by the value of the sub-type.

CustomByName 

CustomByType identifies the sub-type of its value by a string identifier.

Value is a VarUInt byte count, followed by a String encoding of the sub-type identifier, followed by the value of the sub-type.

Reserved 

Reserved for future use as a flag. Do not add types in this range.

HasFieldType 

A transient flag which indicates that the object or array containing this field has stored the field type before the value and name. Non-uniform objects and fields will set this.

Note: Since the flag must never be serialized, this bit may be re-purposed in the future.

HasFieldName 

A persisted flag which indicates that the field has a name stored before the value.

Definition at line 101 of file CompactBinary.h.

Function Documentation

◆ ENUM_CLASS_FLAGS()

ENUM_CLASS_FLAGS ( ECbFieldType )