UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
EventCacheStatic Namespace Reference

Typedefs

typedef TStringBuilder< ConversionBufferSizeFJsonStringBuilder
 

Functions

int ComputeAttributeSize (const FAnalyticsEventAttribute &Attribute)
 
int ComputeAttributeSize (const TArray< FAnalyticsEventAttribute > &Attributes)
 
int ComputeEventSize (const FString &EventName, const TArray< FAnalyticsEventAttribute > &Attributes, int CurrentDefaultAttributeSizeEstimate)
 
void AppendString (TArray< uint8 > &UTF8Stream, const ANSICHAR *UTF8Chars, int32 CharCount)
 
void AppendString (TArray< uint8 > &UTF8Stream, const TCHAR *Str, int32 Len)
 
void AppendString (TArray< uint8 > &UTF8Stream, const FString &Str)
 
void AppendString (TArray< uint8 > &UTF8Stream, const FJsonStringBuilder &str)
 
void AppendJsonString (TArray< uint8 > &UTF8Stream, FJsonStringBuilder &JsonStringBuilder, const FString &str, bool bIsJsonFragment)
 
void AppendEventAttribute (TArray< uint8 > &UTF8Stream, FJsonStringBuilder &JsonStringBuilder, const FAnalyticsEventAttribute &Attr)
 
void InitializePayloadBuffer (TArray< uint8 > &Buffer, int32 MaximumPayloadSize)
 

Variables

FAutoConsoleVariableRef CvarPayloadPercentageOfMaxForWarning (TEXT("AnalyticsET.PayloadPercentageOfMaxForWarning"), PayloadPercentageOfMaxForWarning,)
 
FAutoConsoleVariableRef CvarPayloadFlushTimeSecForWarning (TEXT("AnalyticsET.PayloadFlushTimeSecForWarning"), PayloadFlushTimeSecForWarning,)
 
bool bUseZeroDateOffset = false
 
constexpr int32 ConversionBufferSize = 512
 
const ANSICHARPayloadTemplate = "{\"Events\":[]}"
 
const int32 PayloadTemplateLength = 13
 
const ANSICHARPayloadTrailer = "]}"
 
const int32 PayloadTrailerLength = 2
 

Typedef Documentation

◆ FJsonStringBuilder

Function Documentation

◆ AppendEventAttribute()

void EventCacheStatic::AppendEventAttribute ( TArray< uint8 > &  UTF8Stream,
FJsonStringBuilder JsonStringBuilder,
const FAnalyticsEventAttribute Attr 
)
inline

Append an AnalyticsEventAttribute to a UTF8 stream: ,"<NAME>":

◆ AppendJsonString()

void EventCacheStatic::AppendJsonString ( TArray< uint8 > &  UTF8Stream,
FJsonStringBuilder JsonStringBuilder,
const FString &  str,
bool  bIsJsonFragment 
)
inline

Append a Json string to a UTF8 stream. Escapes the string, adds quotes, and converts it to UTF8 in temp space. Does NOT add a NULL terminator. If it's a JsonFragment, doesn't escape or add the quotes.

◆ AppendString() [1/4]

void EventCacheStatic::AppendString ( TArray< uint8 > &  UTF8Stream,
const ANSICHAR UTF8Chars,
int32  CharCount 
)
inline

Appends UTF8 chars directly to a UTF8 stream. Must already be properly UTF8 encoded. Does NOT add a NULL terminator.

◆ AppendString() [2/4]

void EventCacheStatic::AppendString ( TArray< uint8 > &  UTF8Stream,
const FJsonStringBuilder str 
)
inline

Appends an TStringBuilder efficiently into a UTF8 stream. Does NOT add a NULL terminator.

◆ AppendString() [3/4]

void EventCacheStatic::AppendString ( TArray< uint8 > &  UTF8Stream,
const FString &  Str 
)
inline

Appends an FString efficiently into a UTF8 stream. Does NOT add a NULL terminator.

◆ AppendString() [4/4]

void EventCacheStatic::AppendString ( TArray< uint8 > &  UTF8Stream,
const TCHAR Str,
int32  Len 
)
inline

Appends a TCHAR* string (need not be null-terminated) to a UTF8 stream. Converts the string directly into the UTF8Stream. Does NOT add a NULL terminator.

This function is highly optimized for efficiency. writes directly into the output stream without precomputing the string length. Optimistically adds a bit of space to handle ocassional multibyte chars, but keeps growing until it fits. In practice, this makes this function 30-40% faster than precomputing the string length in advance, and over 2x faster than usig FStringConversion<> directly, even with an appropriately sized buffer.

◆ ComputeAttributeSize() [1/2]

int EventCacheStatic::ComputeAttributeSize ( const FAnalyticsEventAttribute Attribute)
inline

◆ ComputeAttributeSize() [2/2]

int EventCacheStatic::ComputeAttributeSize ( const TArray< FAnalyticsEventAttribute > &  Attributes)
inline

◆ ComputeEventSize()

int EventCacheStatic::ComputeEventSize ( const FString &  EventName,
const TArray< FAnalyticsEventAttribute > &  Attributes,
int  CurrentDefaultAttributeSizeEstimate 
)
inline

◆ InitializePayloadBuffer()

void EventCacheStatic::InitializePayloadBuffer ( TArray< uint8 > &  Buffer,
int32  MaximumPayloadSize 
)
inline

Variable Documentation

◆ bUseZeroDateOffset

bool EventCacheStatic::bUseZeroDateOffset = false

Used for testing below to ensure stable output

◆ ConversionBufferSize

constexpr int32 EventCacheStatic::ConversionBufferSize = 512
constexpr

◆ CvarPayloadFlushTimeSecForWarning

FAutoConsoleVariableRef EventCacheStatic::CvarPayloadFlushTimeSecForWarning(TEXT("AnalyticsET.PayloadFlushTimeSecForWarning"), PayloadFlushTimeSecForWarning,) ( TEXT("AnalyticsET.PayloadFlushTimeSecForWarning")  ,
PayloadFlushTimeSecForWarning   
)

◆ CvarPayloadPercentageOfMaxForWarning

FAutoConsoleVariableRef EventCacheStatic::CvarPayloadPercentageOfMaxForWarning(TEXT("AnalyticsET.PayloadPercentageOfMaxForWarning"), PayloadPercentageOfMaxForWarning,) ( TEXT("AnalyticsET.PayloadPercentageOfMaxForWarning")  ,
PayloadPercentageOfMaxForWarning   
)

◆ PayloadTemplate

const ANSICHAR* EventCacheStatic::PayloadTemplate = "{\"Events\":[]}"

◆ PayloadTemplateLength

const int32 EventCacheStatic::PayloadTemplateLength = 13

◆ PayloadTrailer

const ANSICHAR* EventCacheStatic::PayloadTrailer = "]}"

◆ PayloadTrailerLength

const int32 EventCacheStatic::PayloadTrailerLength = 2