C4 Engine
C4 Engine API Documentation

DataDescription::FindStructure

Defined in:  TSOpenDDL.h
Finds a named structure.
Prototype

Structure *FindStructure(const StructureRef& reference) const;

Parameters
reference The reference to the structure to find.
Description
The FindStructure function finds the structure referenced by the sequence of names stored in the reference parameter and returns a pointer to it. If no such structure exists, then the return value is nullptr.

The reference must be a global reference, meaning that the first name stored in the reference is a global name as indicated by a value of true being returned by the StructureRef::GetGlobalRefFlag function. If the reference is not a global reference, then this function always returns nullptr. The Structure::FindStructure function should be used to find a structure through a local reference.

If the specified reference has an empty name array, then the return value is always nullptr. The empty name array is assigned to a reference data value when null appears in the OpenDDL file.
See Also

StructureRef

Structure::FindStructure

Structure::GetStructureName

Structure::GetGlobalNameFlag

DataDescription::GetRootStructure