UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FGuid Struct Reference

#include <Guid.h>

Public Member Functions

constexpr FGuid ()
 
constexpr FGuid (uint32 InA, uint32 InB, uint32 InC, uint32 InD)
 
 FGuid (const FString &InGuidStr)
 
uint32operator[] (int32 Index)
 
const uint32operator[] (int32 Index) const
 
bool Serialize (FArchive &Ar)
 
bool Serialize (FStructuredArchive::FSlot Slot)
 
CORE_API bool ExportTextItem (FString &ValueStr, FGuid const &DefaultValue, UObject *Parent, int32 PortFlags, class UObject *ExportRootScope) const
 
CORE_API bool ImportTextItem (const TCHAR *&Buffer, int32 PortFlags, UObject *Parent, FOutputDevice *ErrorText)
 
void Invalidate ()
 
bool IsValid () const
 
FString ToString (EGuidFormats Format=EGuidFormats::Digits) const
 
CORE_API void AppendString (FString &Out, EGuidFormats Format=EGuidFormats::Digits) const
 
CORE_API void AppendString (FAnsiStringBuilderBase &Builder, EGuidFormats Format=EGuidFormats::DigitsWithHyphensLower) const
 
CORE_API void AppendString (FUtf8StringBuilderBase &Builder, EGuidFormats Format=EGuidFormats::DigitsWithHyphensLower) const
 
CORE_API void AppendString (FWideStringBuilderBase &Builder, EGuidFormats Format=EGuidFormats::DigitsWithHyphensLower) const
 

Static Public Member Functions

static void AutoRTFMAssignFromOpenToClosed (FGuid &Closed, FGuid Open)
 
static CORE_API FGuid NewGuid ()
 
static CORE_API FGuid NewDeterministicGuid (FStringView ObjectPath, uint64 Seed=0)
 
static CORE_API FGuid NewGuidFromHash (const FBlake3Hash &Hash)
 
static CORE_API FGuid NewGuidFromHashBytes (const void *HashData, int64 DataLen)
 
static CORE_API FGuid Combine (const FGuid &GuidA, const FGuid &GuidB)
 
static CORE_API bool Parse (const TCHAR *GuidString, FGuid &OutGuid)
 
static CORE_API bool Parse (const FString &GuidString, FGuid &OutGuid)
 
static CORE_API bool Parse (FStringView GuidString, FGuid &OutGuid)
 
static CORE_API bool ParseExact (const TCHAR *GuidString, EGuidFormats Format, FGuid &OutGuid)
 
static CORE_API bool ParseExact (const FString &GuidString, EGuidFormats Format, FGuid &OutGuid)
 
static CORE_API bool ParseExact (FStringView GuidString, EGuidFormats Format, FGuid &OutGuid)
 

Public Attributes

uint32 A
 
uint32 B
 
uint32 C
 
uint32 D
 

Friends

bool operator== (const FGuid &X, const FGuid &Y)
 
bool operator!= (const FGuid &X, const FGuid &Y)
 
bool operator< (const FGuid &X, const FGuid &Y)
 
CORE_API friend FArchiveoperator<< (FArchive &Ar, FGuid &G)
 
CORE_API friend void operator<< (FStructuredArchive::FSlot Slot, FGuid &G)
 
FString LexToString (const FGuid &Value)
 
void LexFromString (FGuid &Result, const TCHAR *String)
 
uint32 GetTypeHash (const FGuid &Guid)
 

Detailed Description

Implements a globally unique identifier.

Constructor & Destructor Documentation

◆ FGuid() [1/3]

constexpr FGuid::FGuid ( )
inlineconstexpr

Default constructor.

◆ FGuid() [2/3]

constexpr FGuid::FGuid ( uint32  InA,
uint32  InB,
uint32  InC,
uint32  InD 
)
inlineexplicitconstexpr

Creates and initializes a new GUID from the specified components.

Parameters
InAThe first component.
InBThe second component.
InCThe third component.
InDThe fourth component.

◆ FGuid() [3/3]

FGuid::FGuid ( const FString &  InGuidStr)
inlineexplicit

Member Function Documentation

◆ AppendString() [1/4]

void FGuid::AppendString ( FAnsiStringBuilderBase Builder,
EGuidFormats  Format = EGuidFormats::DigitsWithHyphensLower 
) const

Appends this GUID to the string builder using the specified format.

◆ AppendString() [2/4]

void FGuid::AppendString ( FString &  Out,
EGuidFormats  Format = EGuidFormats::Digits 
) const

Converts this GUID to its string representation using the specified format.

Parameters
FormatThe string format to use.

◆ AppendString() [3/4]

void FGuid::AppendString ( FUtf8StringBuilderBase Builder,
EGuidFormats  Format = EGuidFormats::DigitsWithHyphensLower 
) const

◆ AppendString() [4/4]

void FGuid::AppendString ( FWideStringBuilderBase Builder,
EGuidFormats  Format = EGuidFormats::DigitsWithHyphensLower 
) const

◆ AutoRTFMAssignFromOpenToClosed()

static void FGuid::AutoRTFMAssignFromOpenToClosed ( FGuid Closed,
FGuid  Open 
)
inlinestatic

◆ Combine()

FGuid FGuid::Combine ( const FGuid GuidA,
const FGuid GuidB 
)
static

Returns a GUID which is a combinationof the two provided ones.

Returns
The combined GUID.

◆ ExportTextItem()

bool FGuid::ExportTextItem ( FString &  ValueStr,
FGuid const &  DefaultValue,
UObject Parent,
int32  PortFlags,
class UObject ExportRootScope 
) const

Exports the GUIDs value to a string.

Parameters
ValueStrWill hold the string value.
DefaultValueThe default value.
ParentNot used.
PortFlagsNot used.
ExportRootScopeNot used.
Returns
true on success, false otherwise.
See also
ImportTextItem

◆ ImportTextItem()

bool FGuid::ImportTextItem ( const TCHAR *&  Buffer,
int32  PortFlags,
UObject Parent,
FOutputDevice ErrorText 
)

Imports the GUIDs value from a text buffer.

Parameters
BufferThe text buffer to import from.
PortFlagsNot used.
ParentNot used.
ErrorTextThe output device for error logging.
Returns
true on success, false otherwise.
See also
ExportTextItem

◆ Invalidate()

void FGuid::Invalidate ( )
inline

Invalidates the GUID.

See also
IsValid

◆ IsValid()

bool FGuid::IsValid ( ) const
inline

Checks whether this GUID is valid or not.

A GUID that has all its components set to zero is considered invalid.

Returns
true if valid, false otherwise.
See also
Invalidate

◆ NewDeterministicGuid()

FGuid FGuid::NewDeterministicGuid ( FStringView  ObjectPath,
uint64  Seed = 0 
)
static

Create a guid by hashing the given path; this guid will be deterministic when called in multiple cook processes and will thus avoid cook indeterminism caused by FGuid::NewGuid. ObjectPath and Seed must be deterministic.

◆ NewGuid()

FGuid FGuid::NewGuid ( )
static

Returns a new GUID.

Returns
A new GUID.

◆ NewGuidFromHash()

FGuid FGuid::NewGuidFromHash ( const FBlake3Hash Hash)
static

Create a guid from a calculated Blake3 Hash

◆ NewGuidFromHashBytes()

FGuid FGuid::NewGuidFromHashBytes ( const void HashData,
int64  DataLen 
)
static

Uses the first 16 bytes from HashData to create a Guid. The first 16 bytes of HashData should be premixed to include all cryptographically necessary bytes from the hash to describe larger dataset, so that changing any byte of the dataset will change the first 16 bytes of HashData. If HashData is less than 16 bytes, it is padded with 0 to create the guid.

◆ operator[]() [1/2]

uint32 & FGuid::operator[] ( int32  Index)
inline

Provides access to the GUIDs components.

Parameters
IndexThe index of the component to return (0...3).
Returns
The component.

◆ operator[]() [2/2]

const uint32 & FGuid::operator[] ( int32  Index) const
inline

Provides read-only access to the GUIDs components.

Parameters
IndexThe index of the component to return (0...3).
Returns
The component.

◆ Parse() [1/3]

bool FGuid::Parse ( const FString &  GuidString,
FGuid OutGuid 
)
static

◆ Parse() [2/3]

bool FGuid::Parse ( const TCHAR GuidString,
FGuid OutGuid 
)
static

Converts a string to a GUID.

Parameters
GuidStringThe string to convert.
OutGuidWill contain the parsed GUID.
Returns
true if the string was converted successfully, false otherwise.
See also
ParseExact, ToString

◆ Parse() [3/3]

bool FGuid::Parse ( FStringView  GuidString,
FGuid OutGuid 
)
static

◆ ParseExact() [1/3]

bool FGuid::ParseExact ( const FString &  GuidString,
EGuidFormats  Format,
FGuid OutGuid 
)
static

◆ ParseExact() [2/3]

bool FGuid::ParseExact ( const TCHAR GuidString,
EGuidFormats  Format,
FGuid OutGuid 
)
static

Converts a string with the specified format to a GUID.

Parameters
GuidStringThe string to convert.
FormatThe string format to parse.
OutGuidWill contain the parsed GUID.
Returns
true if the string was converted successfully, false otherwise.
See also
Parse, ToString

◆ ParseExact() [3/3]

bool FGuid::ParseExact ( FStringView  GuidString,
EGuidFormats  Format,
FGuid OutGuid 
)
static

◆ Serialize() [1/2]

bool FGuid::Serialize ( FArchive Ar)
inline

◆ Serialize() [2/2]

bool FGuid::Serialize ( FStructuredArchive::FSlot  Slot)
inline

◆ ToString()

FString FGuid::ToString ( EGuidFormats  Format = EGuidFormats::Digits) const
inline

Converts this GUID to its string representation.

Parameters
FormatThe string format to use.
Returns
The string representation.

Friends And Related Symbol Documentation

◆ GetTypeHash

uint32 GetTypeHash ( const FGuid Guid)
friend

Calculates the hash for a GUID.

Parameters
GuidThe GUID to calculate the hash for.
Returns
The hash.

◆ LexFromString

void LexFromString ( FGuid Result,
const TCHAR String 
)
friend

◆ LexToString

FString LexToString ( const FGuid Value)
friend

Guid default string conversion.

◆ operator!=

bool operator!= ( const FGuid X,
const FGuid Y 
)
friend

Compares two GUIDs for inequality.

Parameters
XThe first GUID to compare.
YThe second GUID to compare.
Returns
true if the GUIDs are not equal, false otherwise.

◆ operator<

bool operator< ( const FGuid X,
const FGuid Y 
)
friend

Compares two GUIDs.

Parameters
XThe first GUID to compare.
YThe second GUID to compare.
Returns
true if the first GUID is less than the second one.

◆ operator<< [1/2]

CORE_API friend FArchive & operator<< ( FArchive Ar,
FGuid G 
)
friend

Serializes a GUID from or into an archive.

Parameters
ArThe archive to serialize from or into.
GThe GUID to serialize.

◆ operator<< [2/2]

CORE_API friend void operator<< ( FStructuredArchive::FSlot  Slot,
FGuid G 
)
friend

Serializes a GUID from or into a structured archive slot.

Parameters
SlotThe structured archive slot to serialize from or into
GThe GUID to serialize.

◆ operator==

bool operator== ( const FGuid X,
const FGuid Y 
)
friend

Compares two GUIDs for equality.

Parameters
XThe first GUID to compare.
YThe second GUID to compare.
Returns
true if the GUIDs are equal, false otherwise.

Member Data Documentation

◆ A

uint32 FGuid::A

Holds the first component.

◆ B

uint32 FGuid::B

Holds the second component.

◆ C

uint32 FGuid::C

Holds the third component.

◆ D

uint32 FGuid::D

Holds the fourth component.


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