UDataTable

Imported spreadsheet table.

Windows
MacOS
Linux

Inheritance Hierarchy

References

Module

Engine

Header

/Engine/Source/Runtime/Engine/Classes/Engine/DataTable.h

Include

#include "Engine/DataTable.h"

Syntax

class UDataTable : public UObject

Remarks

Imported spreadsheet table.

Variables

Name Description

Public variable

UAssetImportDat...

 

AssetImportData

The file this data table was imported from, may be empty

Public variable

uint8: 1

 

bIgnoreExtraFields

Set to true to ignore extra fields in the import data, if false it will warn about them

Public variable

uint8: 1

 

bIgnoreMissingFields

Set to true to ignore any fields that are expected but missing, if false it will warn about them

Public variable

uint8: 1

 

bStripFromClientBuilds

Set to true to not cook this data table into client builds.

Public variable

friend

 

FDataTableEditorUtils

Public variable

friend

 

FDataTableImporterCSV

Public variable

friend

 

FDataTableImporterJSON

Public variable

FString

 

ImportKeyField

Explicit field in import data to use as key.

Protected variable

TMap< FName, ui...

 

RowMap

Map of name of row to row data structure.

Protected variable

TArray< uint8 >

 

RowsSerializedWithTags

When RowStruct is being modified, row data is stored serialized with tags

Public variable

UScriptStruct &...

 

RowStruct

Structure to use for each row of the table, must inherit from FTableRowBase

Public variable

FName

 

RowStructName

The name of the RowStruct we were using when we were last saved

Protected variable

TSet< UObject &...

 

TemporarilyReferencedObjects

Public variable

friend

 

UGameplayTagTableManager

Constructors

Name Description

Public function

UDataTable

(
    const FObjectInitializer& ObjectIn...
)

Functions

Name Description

Public function Static

void

 

AddReferencedObjects

(
    UObject* InThis,
    FReferenceCollector& Collector
)

Public function Virtual

void

 

AddRow

(
    FName RowName,
    const FTableRowBase& RowData
)

Copies RowData into table.

Protected function Virtual

void

 

AddRowInternal

(
    FName RowName,
    uint8* RowDataPtr
)

Called to add rows to the data table

Public function Virtual Const

bool

 

AllowDuplicateRowsOnImport()

Returns true if it is valid to import multiple table rows with the same name; returns false otherwise

Public function Virtual

void

 

CleanBeforeStructChange()

Public function

bool

 

CopyImportOptions

(
    UDataTable* SourceTable
)

Copies all the import options from another table, this does not copy row dawta

Public function

TArray< FStr...

 

CreateTableFromCSVString

(
    const FString& InString
)

Create table from CSV style comma-separated string.

Public function

TArray< FStr...

 

CreateTableFromJSONString

(
    const FString& InString
)

Create table from JSON style string. RowStruct must be defined before calling this function.

Public function

TArray< FStr...

 

CreateTableFromOtherTable

(
    const UDataTable* InTable
)

Create table from another Data Table

Public function Virtual

void

 

EmptyTable()

Empty the table info (will not clear RowStruct)

Public function Const

T *

 

FindRow

(
    FName RowName,
    const FString& ContextString,
    bool bWarnIfRowMissing
)

Public function Const

T *

 

FindRow

(
    FName RowName,
    const TCHAR* ContextString,
    bool bWarnIfRowMissing
)

Function to find the row of a table given its name.

Public function Const

uint8 *

 

FindRowUnchecked

(
    FName RowName,
    bool MustExist
)

Public function Const

UProperty &#...

 

FindTableProperty

(
    const FName& PropertyName
)

Returns the column property where PropertyName matches the name of the column property.

Public function Const

void

 

ForeachRow

(
    const FString& ContextString,
    TFunctionRef< void(const FName&Key...
)

Public function Const

void

 

ForeachRow

(
    const TCHAR* ContextString,
    TFunctionRef< void(const FName&Key...
)

Perform some operation for every row.

Public function Const

void

 

GetAllRows

(
    const FString& ContextString,
    OUTTArray< T* >& OutRowArray
)

Public function Const

void

 

GetAllRows

(
    const TCHAR* ContextString,
    OUTTArray< T* >& OutRowArray
)

Get all of the rows in the table, regardless of name

Public function Const

TArray< FStr...

 

GetColumnTitles()

Get an array of all the column titles, using the friendly display name from the property

Protected function Const

UScriptStruc...

 

GetEmptyUsingStruct()

Protected function Virtual

TMap< FName,...

 

GetNonConstRowMap()

TODO: remove this, it is temporarily here to allow DataTableEditorUtils to compile until I get around to updating functions like RemoveRow and RenameRow.

Public function Virtual

const TMap< ...

 

GetRowMap()

Public function Virtual Const

const TMap< ...

 

GetRowMap()

Public function Const

TArray< FNam...

 

GetRowNames()

Public function Const

const UScrip...

 

GetRowStruct()

Public function Const

FName

 

GetRowStructName()

Public function Const

FString

 

GetTableAsCSV

(
    const EDataTableExportFlags InDTExp...
)

Output entire contents of table as CSV

Public function Const

FString

 

GetTableAsJSON

(
    const EDataTableExportFlags InDTExp...
)

Output entire contents of table as JSON

Public function Const

FString

 

GetTableAsString

(
    const EDataTableExportFlags InDTExp...
)

Output entire contents of table as a string

Public function Const

TArray< TArr...

 

GetTableData

(
    const EDataTableExportFlags InDTExp...
)

Get array for each row in the table. The first row is the titles

Public function

TArray< UPro...

 

GetTablePropertyArray

(
    const TArray< const TCHAR* >&...,
    UStruct* RowStruct,
    TArray< FString >& OutProblems,
    int32 KeyColumn
)

Get array of UProperties that corresponds to columns in the table

Public function Const

TArray< FStr...

 

GetUniqueColumnTitles()

Get an array of all the column titles, using the unique name from the property

Protected function

void

 

LoadStructData

(
    FArchive& Ar
)

Public function

FOnDataTable...

 

OnDataTableChanged()

Gets a multicast delegate that is called any time the data table changes.

Protected function

void

 

OnPostDataImported

(
    OUTTArray< FString >& OutCollected...
)

Called whenever new data is imported into the data table via CreateTableFrom*; Alerts each imported row and gives the row struct a chance to operate on the imported data

Public function Virtual

void

 

RemoveRow

(
    FName RowName
)

Removes a single row from the DataTable by name. Just returns if row is not found.

Public function Virtual

void

 

RestoreAfterStructChange()

Protected function

void

 

SaveStructData

(
    FArchive& Ar
)

Public function Const

bool

 

WriteRowAsJSON

(
    const TSharedRef< TJsonWriter< TCHA...,
    const void* RowData,
    const EDataTableExportFlags InDTExp...
)

Output the fields from a particular row (use RowMap to get RowData) to an existing JsonWriter

Public function Const

bool

 

WriteTableAsJSON

(
    const TSharedRef< TJsonWriter< TCHA...,
    const EDataTableExportFlags InDTExp...
)

Output entire contents of table as JSON

Public function Const

bool

 

WriteTableAsJSONObject

(
    const TSharedRef< TJsonWriter< TCHA...,
    const EDataTableExportFlags InDTExp...
)

Output entire contents of table as a JSON Object

Overridden from UObject

Name Description

Public function Virtual

void

 

FinishDestroy()

Called to finish destroying the object.

Public function Virtual Const

void

 

GetAssetRegistryTags

(
    TArray< FAssetRegistryTag >& OutTa...
)

Gathers a list of asset registry searchable tags which are name/value pairs with some type information This only needs to be implemented for asset objects

Public function Virtual

void

 

GetPreloadDependencies

(
    TArray< UObject* >& OutDeps
)

Called during cooking.

Public function Virtual

void

 

GetResourceSizeEx

(
    FResourceSizeEx& CumulativeResourc...
)

Get the size of the object/resource for use in memory tools or to display to artists/LDs in the Editor This is the extended version which separates up the used memory into different memory regions (the actual definition of which may be platform specific).

Public function Virtual Const

bool

 

NeedsLoadForClient()

Called during saving to determine the load flags to save with the object.

Public function Virtual Const

bool

 

NeedsLoadForEditorGame()

Called during saving to include this object in client/servers running in editor builds, even if they wouldn't normally be.

Public function Virtual

void

 

PostEditChangeProperty

(
    FPropertyChangedEvent& PropertyCha...
)

Called when a property on this object has been modified externally

Public function Virtual

void

 

PostInitProperties()

Called after the C++ constructor and after the properties have been initialized, including those loaded from config.

Public function Virtual

void

 

PostLoad()

Do any object-specific cleanup required immediately after loading an object.

Public function Virtual

void

 

Serialize

(
    FArchive& Ar
)

Handles reading, writing, and reference collecting using FArchive.

Typedefs

Name

Description

FOnDataTableChanged

Deprecated Variables

Name Description

Public variable

FString

 

ImportPath_DEPRECATED

The filename imported to create this object.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback