📄 untype.h
字号:
UNameProperty()
{}
UNameProperty( ECppProperty, INT InOffset, const TCHAR* InCategory, DWORD InFlags )
: UProperty( EC_CppProperty, InOffset, InCategory, InFlags )
{}
// UProperty interface.
void Link( FArchive& Ar, UProperty* Prev );
UBOOL Identical( const void* A, const void* B ) const;
void SerializeItem( FArchive& Ar, void* Value ) const;
void ExportCppItem( FOutputDevice& Out ) const;
void ExportTextItem( TCHAR* ValueStr, BYTE* PropertyValue, BYTE* DefaultValue, UBOOL HumanReadable ) const;
const TCHAR* ImportText( const TCHAR* Buffer, BYTE* Data, UBOOL HumanReadable ) const;
void CopySingleValue( void* Dest, void* Src ) const;
};
/*-----------------------------------------------------------------------------
UStrProperty.
-----------------------------------------------------------------------------*/
//
// Describes a dynamic string variable.
//
class CORE_API UStrProperty : public UProperty
{
DECLARE_CLASS(UStrProperty,UProperty,0)
// Constructors.
UStrProperty()
{}
UStrProperty( ECppProperty, INT InOffset, const TCHAR* InCategory, DWORD InFlags )
: UProperty( EC_CppProperty, InOffset, InCategory, InFlags )
{}
// UObject interface.
void Serialize( FArchive& Ar );
// UProperty interface.
void Link( FArchive& Ar, UProperty* Prev );
UBOOL Identical( const void* A, const void* B ) const;
void SerializeItem( FArchive& Ar, void* Value ) const;
void ExportCppItem( FOutputDevice& Out ) const;
void ExportTextItem( TCHAR* ValueStr, BYTE* PropertyValue, BYTE* DefaultValue, UBOOL HumanReadable ) const;
const TCHAR* ImportText( const TCHAR* Buffer, BYTE* Data, UBOOL HumanReadable ) const;
void CopySingleValue( void* Dest, void* Src ) const;
void DestroyValue( void* Dest ) const;
};
/*-----------------------------------------------------------------------------
UFixedArrayProperty.
-----------------------------------------------------------------------------*/
//
// Describes a fixed length array.
//
class CORE_API UFixedArrayProperty : public UProperty
{
DECLARE_CLASS(UFixedArrayProperty,UProperty,0)
// Variables.
UProperty* Inner;
INT Count;
// Constructors.
UFixedArrayProperty()
{}
UFixedArrayProperty( ECppProperty, INT InOffset, const TCHAR* InCategory, DWORD InFlags )
: UProperty( EC_CppProperty, InOffset, InCategory, InFlags )
{}
// UObject interface.
void Serialize( FArchive& Ar );
// UProperty interface.
void Link( FArchive& Ar, UProperty* Prev );
UBOOL Identical( const void* A, const void* B ) const;
void SerializeItem( FArchive& Ar, void* Value ) const;
void ExportCppItem( FOutputDevice& Out ) const;
void ExportTextItem( TCHAR* ValueStr, BYTE* PropertyValue, BYTE* DefaultValue, UBOOL HumanReadable ) const;
const TCHAR* ImportText( const TCHAR* Buffer, BYTE* Data, UBOOL HumanReadable ) const;
void CopySingleValue( void* Dest, void* Src ) const;
void DestroyValue( void* Dest ) const;
// UFixedArrayProperty interface.
void AddCppProperty( UProperty* Property, INT Count );
};
/*-----------------------------------------------------------------------------
UArrayProperty.
-----------------------------------------------------------------------------*/
//
// Describes a dynamic array.
//
class CORE_API UArrayProperty : public UProperty
{
DECLARE_CLASS(UArrayProperty,UProperty,0)
// Variables.
UProperty* Inner;
// Constructors.
UArrayProperty()
{}
UArrayProperty( ECppProperty, INT InOffset, const TCHAR* InCategory, DWORD InFlags )
: UProperty( EC_CppProperty, InOffset, InCategory, InFlags )
{}
// UObject interface.
void Serialize( FArchive& Ar );
// UProperty interface.
void Link( FArchive& Ar, UProperty* Prev );
UBOOL Identical( const void* A, const void* B ) const;
void SerializeItem( FArchive& Ar, void* Value ) const;
void ExportCppItem( FOutputDevice& Out ) const;
void ExportTextItem( TCHAR* ValueStr, BYTE* PropertyValue, BYTE* DefaultValue, UBOOL HumanReadable ) const;
const TCHAR* ImportText( const TCHAR* Buffer, BYTE* Data, UBOOL HumanReadable ) const;
void CopySingleValue( void* Dest, void* Src ) const;
void DestroyValue( void* Dest ) const;
// UArrayProperty interface.
void AddCppProperty( UProperty* Property );
};
/*-----------------------------------------------------------------------------
UMapProperty.
-----------------------------------------------------------------------------*/
//
// Describes a dynamic map.
//
class CORE_API UMapProperty : public UProperty
{
DECLARE_CLASS(UMapProperty,UProperty,0)
// Variables.
UProperty* Key;
UProperty* Value;
// Constructors.
UMapProperty()
{}
UMapProperty( ECppProperty, INT InOffset, const TCHAR* InCategory, DWORD InFlags )
: UProperty( EC_CppProperty, InOffset, InCategory, InFlags )
{}
// UObject interface.
void Serialize( FArchive& Ar );
// UProperty interface.
void Link( FArchive& Ar, UProperty* Prev );
UBOOL Identical( const void* A, const void* B ) const;
void SerializeItem( FArchive& Ar, void* Value ) const;
void ExportCppItem( FOutputDevice& Out ) const;
void ExportTextItem( TCHAR* ValueStr, BYTE* PropertyValue, BYTE* DefaultValue, UBOOL HumanReadable ) const;
const TCHAR* ImportText( const TCHAR* Buffer, BYTE* Data, UBOOL HumanReadable ) const;
void CopySingleValue( void* Dest, void* Src ) const;
void DestroyValue( void* Dest ) const;
};
/*-----------------------------------------------------------------------------
UStructProperty.
-----------------------------------------------------------------------------*/
//
// Describes a structure variable embedded in (as opposed to referenced by)
// an object.
//
class CORE_API UStructProperty : public UProperty
{
DECLARE_CLASS(UStructProperty,UProperty,0)
// Variables.
class UStruct* Struct;
UStructProperty* NextStruct;
// Constructors.
UStructProperty()
{}
UStructProperty( ECppProperty, INT InOffset, const TCHAR* InCategory, DWORD InFlags, UStruct* InStruct )
: UProperty( EC_CppProperty, InOffset, InCategory, InFlags )
, Struct( InStruct )
{}
// UObject interface.
void Serialize( FArchive& Ar );
// UProperty interface.
void Link( FArchive& Ar, UProperty* Prev );
UBOOL Identical( const void* A, const void* B ) const;
void SerializeItem( FArchive& Ar, void* Value ) const;
void ExportCppItem( FOutputDevice& Out ) const;
void ExportTextItem( TCHAR* ValueStr, BYTE* PropertyValue, BYTE* DefaultValue, UBOOL HumanReadable ) const;
const TCHAR* ImportText( const TCHAR* Buffer, BYTE* Data, UBOOL HumanReadable ) const;
void CopySingleValue( void* Dest, void* Src ) const;
void DestroyValue( void* Dest ) const;
};
/*-----------------------------------------------------------------------------
Field templates.
-----------------------------------------------------------------------------*/
//
// Find a typed field in a struct.
//
template <class T> T* FindField( UStruct* Owner, const TCHAR* FieldName )
{
guard(FindField);
for( TFieldIterator<T>It( Owner ); It; ++It )
if( appStricmp( It->GetName(), FieldName )==0 )
return *It;
return NULL;
unguard;
}
/*-----------------------------------------------------------------------------
UObject accessors that depend on UClass.
-----------------------------------------------------------------------------*/
//
// See if this object belongs to the specified class.
//
inline UBOOL UObject::IsA( class UClass* SomeBase ) const
{
guardSlow(UObject::IsA);
for( UClass* TempClass=Class; TempClass; TempClass=(UClass*)TempClass->SuperField )
if( TempClass==SomeBase )
return 1;
return SomeBase==NULL;
unguardobjSlow;
}
//
// See if this object is in a certain package.
//
inline UBOOL UObject::IsIn( class UObject* SomeOuter ) const
{
guardSlow(UObject::IsA);
for( UObject* It=GetOuter(); It; It=It->GetOuter() )
if( It==SomeOuter )
return 1;
return SomeOuter==NULL;
unguardobjSlow;
}
//
// Return whether an object wants to receive a named probe message.
//
inline UBOOL UObject::IsProbing( FName ProbeName )
{
guardSlow(UObject::IsProbing);
return (ProbeName.GetIndex() < NAME_PROBEMIN)
|| (ProbeName.GetIndex() >= NAME_PROBEMAX)
|| (!StateFrame)
|| (StateFrame->ProbeMask & ((QWORD)1 << (ProbeName.GetIndex() - NAME_PROBEMIN)));
unguardobjSlow;
}
/*-----------------------------------------------------------------------------
UStruct inlines.
-----------------------------------------------------------------------------*/
//
// UStruct inline comparer.
//
inline UBOOL UStruct::StructCompare( const void* A, const void* B )
{
guardSlow(UStruct::StructCompare);
for( TFieldIterator<UProperty> It(this); It; ++It )
for( INT i=0; i<It->ArrayDim; i++ )
if( !It->Matches(A,B,i) )
return 0;
unguardobjSlow;
return 1;
}
/*-----------------------------------------------------------------------------
C++ property macros.
-----------------------------------------------------------------------------*/
#define CPP_PROPERTY(name) \
EC_CppProperty, (BYTE*)&((ThisClass*)NULL)->name - (BYTE*)NULL
/*-----------------------------------------------------------------------------
The End.
-----------------------------------------------------------------------------*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -