5#include "Containers/StringView.h"
6#include "HAL/PlatformMemory.h"
8#include "Memory/MemoryView.h"
9#include "Misc/ByteSwap.h"
11#include "Serialization/CompactBinary.h"
12#include "Serialization/VarInt.h"
15
16
17
18
19
20
21
35
36
37
38
101 const uint8*
const Bytes =
static_cast<
const uint8*>(
Data);
102 uint32 ValueSizeByteCount;
104 return MakeMemoryView(Bytes + ValueSizeByteCount, ValueSize);
109 const UTF8CHAR*
const Chars =
static_cast<
const UTF8CHAR*>(
Data);
110 uint32 ValueSizeByteCount;
115 if (ValueSize >= (uint64(1) << 31))
123 return FUtf8StringView(Chars + ValueSizeByteCount, int32(ValueSize));
129 const uint64 OutOfRangeMask = uint64(-2) << (Params
.MagnitudeBits - 1);
130 const uint64 IsNegative = uint8(
Type) & 1;
132 uint32 MagnitudeByteCount;
134 const uint64 Value = Magnitude ^ -int64(IsNegative);
138 const uint64 IsInRange = (!(Magnitude & OutOfRangeMask)) & ((!IsNegative) | Params
.IsSigned);
141 const uint64 UseValueMask = -int64(IsInRange);
142 return (Value & UseValueMask) | (Default & ~UseValueMask);
150 uint32 MagnitudeByteCount;
156 uint32 MagnitudeByteCount;
163 return reinterpret_cast<
const float&>(Value);
169 return reinterpret_cast<
const double&>(Value);
174 return uint8(
Type) & 1;
179 return FIoHash(*
static_cast<
const FIoHash::ByteArray*>(
Data));
209 const uint8* Bytes =
static_cast<
const uint8*>(
Data);
210 uint32 DataSizeByteCount;
212 Bytes += DataSizeByteCount;
215 uint32 TypeIdByteCount;
217 Value.Data = MakeMemoryView(Bytes + TypeIdByteCount, DataSize - TypeIdByteCount);
223 const uint8* Bytes =
static_cast<
const uint8*>(
Data);
224 uint32 DataSizeByteCount;
226 Bytes += DataSizeByteCount;
228 uint32 TypeNameLenByteCount;
229 const uint64 TypeNameLen =
ReadVarUInt(Bytes
, TypeNameLenByteCount
);
230 Bytes += TypeNameLenByteCount;
233 Value.Name = FUtf8StringView(
234 reinterpret_cast<
const UTF8CHAR*>(Bytes),
235 static_cast<int32>(TypeNameLen));
236 Value.Data = MakeMemoryView(Bytes + TypeNameLen, DataSize - TypeNameLen - TypeNameLenByteCount);
#define NETWORK_ORDER32(x)
#define NETWORK_ORDER64(x)
FORCEINLINE uint64 ReadVarUInt(const void *InData, uint32 &OutByteCount)
static constexpr ECbFieldType GetType(ECbFieldType Type)
ECbFieldType TypeWithFlags
FCbValue GetValue() const
FCbFieldView(const FCbValue &Value)
FORCEINLINE FIoHash AsBinaryAttachment() const
FCbCustomById AsCustomById() const
int64 AsTimeSpanTicks() const
FCbObjectId AsObjectId() const
int64 AsDateTimeTicks() const
uint64 AsIntegerPositive() const
FORCEINLINE const void * GetData() const
int64 AsIntegerNegative() const
FUtf8StringView AsString(ECbFieldError *OutError=nullptr, FUtf8StringView Default=FUtf8StringView()) const
FORCEINLINE ECbFieldType GetType() const
FMemoryView AsBinary() const
FORCEINLINE FIoHash AsObjectAttachment() const
uint64 AsInteger(UE::CompactBinary::Private::FIntegerParams Params, ECbFieldError *OutError=nullptr, uint64 Default=0) const
FCbCustomByName AsCustomByName() const
FCbValue(ECbFieldType Type, const void *Value)
FCbObjectView AsObjectView() const
FORCEINLINE FIoHash AsAttachment() const
FCbArrayView AsArrayView() const