Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
FBitWriter Struct Reference

#include <BitWriter.h>

+ Inheritance diagram for FBitWriter:
+ Collaboration diagram for FBitWriter:

Public Member Functions

 FBitWriter (void)
 
 FBitWriter (int64 InMaxBits, bool AllowResize=false)
 
 FBitWriter (const FBitWriter &)=default
 
FBitWriteroperator= (const FBitWriter &)=default
 
 FBitWriter (FBitWriter &&)=default
 
FBitWriteroperator= (FBitWriter &&)=default
 
virtual void SerializeBits (void *Src, int64 LengthBits) override
 
virtual void SerializeBitsWithOffset (void *Src, int32 SourceBit, int64 LengthBits) override
 
virtual void SerializeInt (uint32 &Value, uint32 Max) override
 
virtual void SerializeIntPacked (uint32 &Value) override
 
void WriteIntWrapped (uint32 Value, uint32 ValueMax)
 
void WriteBit (uint8 In)
 
virtual void Serialize (void *Src, int64 LengthBytes) override
 
FORCEINLINE uint8GetData (void)
 
FORCEINLINE const uint8GetData (void) const
 
FORCEINLINE const TArray< uint8 > * GetBuffer (void) const
 
FORCEINLINE int64 GetNumBytes (void) const
 
FORCEINLINE int64 GetNumBits (void) const
 
FORCEINLINE int64 GetMaxBits (void) const
 
void SetOverflowed (int32 LengthBits)
 
FORCEINLINE void SetAllowOverflow (bool bInAllow)
 
FORCEINLINE bool AllowAppend (int64 LengthBits)
 
FORCEINLINE void SetAllowResize (bool NewResize)
 
void Reset () override
 
FORCEINLINE void WriteAlign ()
 
virtual void CountMemory (FArchive &Ar) const
 
- Public Member Functions inherited from FBitArchive
 FBitArchive ()
 
- Public Member Functions inherited from FArchive
 FArchive ()=default
 
 FArchive (const FArchive &)=default
 
FArchiveoperator= (const FArchive &ArchiveToCopy)=default
 
 ~FArchive ()=default
 
virtual FArchiveoperator<< (FName &Value)
 
virtual FArchiveoperator<< (FText &Value)
 
virtual FArchiveoperator<< (UObject *&Value)
 
virtual FArchiveoperator<< (FField *&Value)
 
template<class T >
FORCEINLINE FArchiveoperator<< (TCheckedObjPtr< T > &Value)
 
virtual FArchiveoperator<< (struct FLazyObjectPtr &Value)
 
virtual FArchiveoperator<< (struct FObjectPtr &Value)
 
virtual FArchiveoperator<< (struct FSoftObjectPtr &Value)
 
virtual FArchiveoperator<< (struct FSoftObjectPath &Value)
 
virtual FArchiveoperator<< (struct FWeakObjectPtr &Value)
 
virtual void ForceBlueprintFinalization ()
 
virtual void Preload (UObject *Object)
 
FArchiveStateGetArchiveState ()
 
const FArchiveStateGetArchiveState () const
 
virtual void Seek (int64 InPos)
 
virtual void AttachBulkData (UObject *Owner, FBulkData *BulkData)
 
virtual void AttachBulkData (UE::Serialization::FEditorBulkData *BulkData)
 
virtual void DetachBulkData (FBulkData *BulkData, bool bEnsureBulkDataIsLoaded)
 
virtual void DetachBulkData (UE::Serialization::FEditorBulkData *BulkData, bool bEnsureBulkDataIsLoaded)
 
virtual bool SerializeBulkData (FBulkData &BulkData, const struct FBulkDataSerializationParams &Params)
 
virtual bool IsProxyOf (FArchive *InOther) const
 
virtual bool Precache (int64 PrecacheOffset, int64 PrecacheSize)
 
virtual void FlushCache ()
 
virtual bool SetCompressionMap (TArray< struct FCompressedChunk > *CompressedChunks, ECompressionFlags CompressionFlags)
 
virtual void Flush ()
 
virtual bool Close ()
 
void SerializeCompressed (void *V, int64 Length, FName CompressionFormatCannotChange, ECompressionFlags Flags=COMPRESS_NoFlags, bool bTreatBufferAsFileReader=false)
 
void SerializeCompressedNew (void *V, int64 Length, FName CompressionFormatToEncode, FName CompressionFormatToDecodeOldV1Files, ECompressionFlags Flags=COMPRESS_NoFlags, bool bTreatBufferAsFileReader=false, int64 *OutPartialReadLength=nullptr)
 
void SerializeCompressedNew (void *V, int64 Length)
 
void ByteSwap (void *V, int32 Length)
 
FORCEINLINE FArchiveByteOrderSerialize (void *V, int32 Length)
 
void StartSerializingDefaults ()
 
void StopSerializingDefaults ()
 
virtual void MarkScriptSerializationStart (const UObject *Obj)
 
virtual void MarkScriptSerializationEnd (const UObject *Obj)
 
virtual void MarkSearchableName (const UObject *TypeObject, const FName &ValueName) const
 
template<typename FmtType , typename... Types>
void Logf (const FmtType &Fmt, Types... Args)
 
virtual void UsingCustomVersion (const struct FGuid &Guid)
 
virtual FArchiveGetCacheableArchive ()
 
virtual void PushSerializedProperty (struct FProperty *InProperty, const bool bIsEditorOnlyProperty)
 
virtual void PopSerializedProperty (struct FProperty *InProperty, const bool bIsEditorOnlyProperty)
 
virtual bool AttachExternalReadDependency (FExternalReadCallback &ReadCallback)
 
template<SIZE_T Size>
FORCEINLINE bool FastPathLoad (void *InDest)
 
virtual void PushFileRegionType (EFileRegionType Type)
 
virtual void PopFileRegionType ()
 
void SetArchiveState (const FArchiveState &InState)
 
void SetError ()
 
void ClearError ()
 
virtual FArchiveStateGetInnermostState ()
 
virtual void CountBytes (SIZE_T InNum, SIZE_T InMax)
 
virtual FString GetArchiveName () const
 
virtual FLinkerGetLinker ()
 
virtual int64 Tell ()
 
virtual int64 TotalSize ()
 
virtual bool AtEnd ()
 
FORCEINLINE bool IsByteSwapping ()
 
void ThisContainsCode ()
 
void ThisContainsMap ()
 
void ThisRequiresLocalizationGather ()
 
virtual UObjectGetArchetypeFromLoader (const UObject *Obj)
 
FORCEINLINE FPackageFileVersion UEVer () const
 
FORCEINLINE int32 UE4Ver () const
 
FORCEINLINE int32 LicenseeUEVer () const
 
FORCEINLINE FEngineVersionBase EngineVer () const
 
uint32 EngineNetVer () const
 
uint32 GameNetVer () const
 
int32 CustomVer (const struct FGuid &Key) const
 
FORCEINLINE bool IsLoading () const
 
FORCEINLINE bool IsLoadingFromCookedPackage () const
 
FORCEINLINE bool IsSaving () const
 
FORCEINLINE bool IsTransacting () const
 
FORCEINLINE bool IsTextFormat () const
 
FORCEINLINE bool WantBinaryPropertySerialization () const
 
FORCEINLINE bool UseUnversionedPropertySerialization () const
 
FORCEINLINE bool IsForcingUnicode () const
 
FORCEINLINE bool IsPersistent () const
 
FORCEINLINE bool GetError () const
 
FORCEINLINE bool IsError () const
 
FORCEINLINE bool IsCriticalError () const
 
FORCEINLINE bool ContainsCode () const
 
FORCEINLINE bool ContainsMap () const
 
FORCEINLINE bool RequiresLocalizationGather () const
 
FORCEINLINE bool ForceByteSwapping () const
 
FORCEINLINE bool IsSerializingDefaults () const
 
FORCEINLINE bool IsIgnoringArchetypeRef () const
 
FORCEINLINE bool DoDelta () const
 
FORCEINLINE bool DoIntraPropertyDelta () const
 
FORCEINLINE bool IsIgnoringOuterRef () const
 
FORCEINLINE bool IsIgnoringClassGeneratedByRef () const
 
FORCEINLINE bool IsIgnoringClassRef () const
 
FORCEINLINE bool IsAllowingLazyLoading () const
 
FORCEINLINE bool IsObjectReferenceCollector () const
 
FORCEINLINE bool IsModifyingWeakAndStrongReferences () const
 
FORCEINLINE bool IsCountingMemory () const
 
FORCEINLINE uint32 GetPortFlags () const
 
FORCEINLINE bool HasAnyPortFlags (uint32 Flags) const
 
FORCEINLINE bool HasAllPortFlags (uint32 Flags) const
 
FORCEINLINE uint32 GetDebugSerializationFlags () const
 
FORCEINLINE bool ShouldSkipBulkData () const
 
FORCEINLINE int64 GetMaxSerializeSize () const
 
virtual const FCustomVersionContainerGetCustomVersions () const
 
virtual void SetCustomVersions (const FCustomVersionContainer &CustomVersionContainer)
 
virtual void ResetCustomVersions ()
 
void SetCustomVersion (const struct FGuid &Key, int32 Version, FName FriendlyName)
 
void SetByteSwapping (bool Enabled)
 
void SetPortFlags (uint32 InPortFlags)
 
void SetDebugSerializationFlags (uint32 InCustomFlags)
 
bool IsFilterEditorOnly () const
 
virtual void SetFilterEditorOnly (bool InFilterEditorOnly)
 
bool IsSaveGame () const
 
FORCEINLINE bool IsNetArchive () const
 
FORCEINLINE bool IsCooking () const
 
FORCEINLINE const ITargetPlatformCookingTarget () const
 
void SetCookData (FArchiveCookData *InCookData)
 
FArchiveCookDataGetCookData ()
 
FORCEINLINE FArchiveCookContextGetCookContext ()
 
virtual bool UseToResolveEnumerators () const
 
virtual bool ShouldSkipProperty (const FProperty *InProperty) const
 
virtual void SetSerializedProperty (FProperty *InProperty)
 
FORCEINLINE struct FPropertyGetSerializedProperty () const
 
void GetSerializedPropertyChain (TArray< struct FProperty * > &OutProperties) const
 
FORCEINLINE const FArchiveSerializedPropertyChainGetSerializedPropertyChain () const
 
virtual void SetSerializedPropertyChain (const FArchiveSerializedPropertyChain *InSerializedPropertyChain, struct FProperty *InSerializedPropertyOverride=nullptr)
 
virtual void SetSerializeContext (FUObjectSerializeContext *InLoadContext)
 
virtual FUObjectSerializeContextGetSerializeContext ()
 
virtual void SetIsLoading (bool bInIsLoading)
 
virtual void SetIsLoadingFromCookedPackage (bool bInIsLoadingFromCookedPackage)
 
virtual void SetIsSaving (bool bInIsSaving)
 
virtual void SetIsTransacting (bool bInIsTransacting)
 
virtual void SetIsTextFormat (bool bInIsTextFormat)
 
virtual void SetWantBinaryPropertySerialization (bool bInWantBinaryPropertySerialization)
 
virtual void SetUseUnversionedPropertySerialization (bool bInUseUnversioned)
 
virtual void SetForceUnicode (bool bInForceUnicode)
 
virtual void SetIsPersistent (bool bInIsPersistent)
 
virtual void SetUEVer (FPackageFileVersion InVer)
 
FORCEINLINE void SetUE4Ver (int32 InVer)
 
virtual void SetLicenseeUEVer (int32 InVer)
 
virtual void SetEngineVer (const FEngineVersionBase &InVer)
 
virtual void SetEngineNetVer (const uint32 InEngineNetVer)
 
virtual void SetGameNetVer (const uint32 InGameNetVer)
 
FORCEINLINE bool ShouldSkipCompilingAssets () const
 

Private Attributes

TArray< uint8Buffer
 
int64 Num
 
int64 Max
 
bool bAllowResize
 
bool bAllowOverflow
 

Friends

struct FBitWriterMark
 

Additional Inherited Members

- Public Attributes inherited from FArchive
FFastPathLoadBufferActiveFPLB
 
FFastPathLoadBuffer InlineFPLB
 
uint8 ArContainsCode: 1
 
uint8 ArContainsMap: 1
 
uint8 ArRequiresLocalizationGather: 1
 
uint8 ArForceByteSwapping: 1
 
uint8 ArIgnoreArchetypeRef: 1
 
uint8 ArNoDelta: 1
 
uint8 ArNoIntraPropertyDelta: 1
 
uint8 ArIgnoreOuterRef: 1
 
uint8 ArIgnoreClassGeneratedByRef: 1
 
uint8 ArIgnoreClassRef: 1
 
uint8 ArAllowLazyLoading: 1
 
uint8 ArIsObjectReferenceCollector: 1
 
uint8 ArIsModifyingWeakAndStrongReferences: 1
 
uint8 ArIsCountingMemory: 1
 
uint8 ArShouldSkipBulkData: 1
 
uint8 ArIsFilterEditorOnly: 1
 
uint8 ArIsSaveGame: 1
 
uint8 ArIsNetArchive: 1
 
uint8 ArUseCustomPropertyList: 1
 
int32 ArSerializingDefaults
 
uint32 ArPortFlags
 
int64 ArMaxSerializeSize
 
const struct FCustomPropertyListNodeArCustomPropertyList
 
- Protected Member Functions inherited from FArchive
void SetShouldSkipCompilingAssets (bool Enabled)
 
- Static Protected Member Functions inherited from FArchive
static void LinkProxy (FArchiveState &Inner, FArchiveState &Proxy)
 
static void UnlinkProxy (FArchiveState &Inner, FArchiveState &Proxy)
 

Detailed Description

Definition at line 21 of file BitWriter.h.

Constructor & Destructor Documentation

◆ FBitWriter() [1/4]

FBitWriter::FBitWriter ( void )

Default constructor. Zeros everything.

◆ FBitWriter() [2/4]

FBitWriter::FBitWriter ( int64 InMaxBits,
bool AllowResize = false )

Constructor using known size the buffer needs to be

◆ FBitWriter() [3/4]

FBitWriter::FBitWriter ( const FBitWriter & )
default

◆ FBitWriter() [4/4]

FBitWriter::FBitWriter ( FBitWriter && )
default

Member Function Documentation

◆ AllowAppend()

FORCEINLINE bool FBitWriter::AllowAppend ( int64 LengthBits)
inline

Definition at line 137 of file BitWriter.h.

◆ CountMemory()

virtual void FBitWriter::CountMemory ( FArchive & Ar) const
virtual

Counts the in-memory bytes used by this object

◆ GetBuffer()

FORCEINLINE const TArray< uint8 > * FBitWriter::GetBuffer ( void ) const
inline

Definition at line 88 of file BitWriter.h.

◆ GetData() [1/2]

FORCEINLINE uint8 * FBitWriter::GetData ( void )
inline

Returns a pointer to our internal buffer.

Definition at line 68 of file BitWriter.h.

◆ GetData() [2/2]

FORCEINLINE const uint8 * FBitWriter::GetData ( void ) const
inline

Definition at line 78 of file BitWriter.h.

◆ GetMaxBits()

FORCEINLINE int64 FBitWriter::GetMaxBits ( void ) const
inline

Returns the number of bits the buffer supports.

Definition at line 117 of file BitWriter.h.

◆ GetNumBits()

FORCEINLINE int64 FBitWriter::GetNumBits ( void ) const
inline

Returns the number of bits written.

Definition at line 109 of file BitWriter.h.

◆ GetNumBytes()

FORCEINLINE int64 FBitWriter::GetNumBytes ( void ) const
inline

Returns the number of bytes written.

Definition at line 101 of file BitWriter.h.

◆ operator=() [1/2]

FBitWriter & FBitWriter::operator= ( const FBitWriter & )
default

◆ operator=() [2/2]

FBitWriter & FBitWriter::operator= ( FBitWriter && )
default

◆ Reset()

void FBitWriter::Reset ( )
overridevirtual

Resets the bit writer back to its initial state

Reimplemented from FArchive.

◆ Serialize()

virtual void FBitWriter::Serialize ( void * Src,
int64 LengthBytes )
overridevirtual

Reimplemented from FArchive.

◆ SerializeBits()

virtual void FBitWriter::SerializeBits ( void * Src,
int64 LengthBits )
overridevirtual

Reimplemented from FArchive.

◆ SerializeBitsWithOffset()

virtual void FBitWriter::SerializeBitsWithOffset ( void * Src,
int32 SourceBit,
int64 LengthBits )
overridevirtual

◆ SerializeInt()

virtual void FBitWriter::SerializeInt ( uint32 & Value,
uint32 Max )
overridevirtual

Serializes a compressed integer - Value must be < Max

Parameters
ValueThe value to serialize, must be < Max
MaxThe maximum allowed value - good to aim for power-of-two

Reimplemented from FArchive.

◆ SerializeIntPacked()

virtual void FBitWriter::SerializeIntPacked ( uint32 & Value)
overridevirtual

Packs int value into bytes of 7 bits with 8th bit for 'more'

Reimplemented from FArchive.

◆ SetAllowOverflow()

FORCEINLINE void FBitWriter::SetAllowOverflow ( bool bInAllow)
inline

Sets whether or not this writer intentionally allows overflows (to avoid logspam)

Definition at line 132 of file BitWriter.h.

◆ SetAllowResize()

FORCEINLINE void FBitWriter::SetAllowResize ( bool NewResize)
inline

Definition at line 164 of file BitWriter.h.

◆ SetOverflowed()

void FBitWriter::SetOverflowed ( int32 LengthBits)

Marks this bit writer as overflowed.

Parameters
LengthBitsThe number of bits being written at the time of overflow

◆ WriteAlign()

FORCEINLINE void FBitWriter::WriteAlign ( )
inline

Definition at line 174 of file BitWriter.h.

◆ WriteBit()

void FBitWriter::WriteBit ( uint8 In)

◆ WriteIntWrapped()

void FBitWriter::WriteIntWrapped ( uint32 Value,
uint32 ValueMax )

Serializes the specified Value, but does not bounds check against ValueMax; instead, it will wrap around if the value exceeds ValueMax (this differs from SerializeInt, which clamps)

Parameters
ValueThe value to serialize
ValueMaxThe maximum value to write; wraps Value if it exceeds this

Friends And Related Symbol Documentation

◆ FBitWriterMark

Definition at line 23 of file BitWriter.h.

Member Data Documentation

◆ bAllowOverflow

bool FBitWriter::bAllowOverflow
private

Whether or not overflowing is allowed (overflows silently)

Definition at line 189 of file BitWriter.h.

◆ bAllowResize

bool FBitWriter::bAllowResize
private

Definition at line 186 of file BitWriter.h.

◆ Buffer

TArray<uint8> FBitWriter::Buffer
private

Definition at line 183 of file BitWriter.h.

◆ Max

int64 FBitWriter::Max
private

Definition at line 185 of file BitWriter.h.

◆ Num

int64 FBitWriter::Num
private

Definition at line 184 of file BitWriter.h.


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