ezEngine  Release 25.03
ezOpenDdlReaderElement Class Reference

Represents a single 'object' in a DDL document, e.g. either a custom type or a primitives list. More...

#include <OpenDdlReader.h>

Public Member Functions

 EZ_DECLARE_POD_TYPE ()
 
EZ_ALWAYS_INLINE bool IsCustomType () const
 Whether this is a custom object type that typically contains sub-elements.
 
EZ_ALWAYS_INLINE bool IsCustomType (ezStringView sTypeName) const
 Whether this is a custom object type of the requested type.
 
EZ_ALWAYS_INLINE ezStringView GetCustomType () const
 Returns the string for the custom type name.
 
EZ_ALWAYS_INLINE bool HasName () const
 Whether the name of the object is non-empty.
 
EZ_ALWAYS_INLINE ezStringView GetName () const
 Returns the name of the object.
 
EZ_ALWAYS_INLINE bool IsNameGlobal () const
 Returns whether the element name is a global or a local name.
 
ezUInt32 GetNumChildObjects () const
 How many sub-elements the object has.
 
const EZ_ALWAYS_INLINE ezOpenDdlReaderElementGetFirstChild () const
 If this is a custom type element, the returned pointer is to the first child element.
 
const EZ_ALWAYS_INLINE ezOpenDdlReaderElementGetSibling () const
 If the parent is a custom type element, the next child after this is returned.
 
ezUInt32 GetNumPrimitives () const
 For non-custom types this returns how many primitives are stored at this element.
 
EZ_ALWAYS_INLINE ezOpenDdlPrimitiveType GetPrimitivesType () const
 For non-custom types this returns the type of primitive that is stored at this element.
 
bool HasPrimitives (ezOpenDdlPrimitiveType type, ezUInt32 uiMinNumberOfPrimitives=1) const
 Returns true if the element stores the requested type of primitives AND has at least the desired amount of them, so that accessing the data array at certain indices is safe. More...
 
const EZ_ALWAYS_INLINE bool * GetPrimitivesBool () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
 
const EZ_ALWAYS_INLINE ezInt8 * GetPrimitivesInt8 () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
 
const EZ_ALWAYS_INLINE ezInt16 * GetPrimitivesInt16 () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
 
const EZ_ALWAYS_INLINE ezInt32 * GetPrimitivesInt32 () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
 
const EZ_ALWAYS_INLINE ezInt64 * GetPrimitivesInt64 () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
 
const EZ_ALWAYS_INLINE ezUInt8 * GetPrimitivesUInt8 () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
 
const EZ_ALWAYS_INLINE ezUInt16 * GetPrimitivesUInt16 () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
 
const EZ_ALWAYS_INLINE ezUInt32 * GetPrimitivesUInt32 () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
 
const EZ_ALWAYS_INLINE ezUInt64 * GetPrimitivesUInt64 () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
 
const EZ_ALWAYS_INLINE float * GetPrimitivesFloat () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
 
const EZ_ALWAYS_INLINE double * GetPrimitivesDouble () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
 
const EZ_ALWAYS_INLINE ezStringViewGetPrimitivesString () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
 
const ezOpenDdlReaderElementFindChild (ezStringView sName) const
 Searches for a child with the given name. It does not matter whether the object's name is 'local' or 'global'. szName is case-sensitive.
 
const ezOpenDdlReaderElementFindChildOfType (ezOpenDdlPrimitiveType type, ezStringView sName, ezUInt32 uiMinNumberOfPrimitives=1) const
 Searches for a child element that has the given type, name and if it is a primitives list, at least the desired number of primitives. More...
 
const ezOpenDdlReaderElementFindChildOfType (ezStringView sType, ezStringView sName=nullptr) const
 Searches for a child element with the given type and optionally also a certain name.
 

Friends

class ezOpenDdlReader
 

Detailed Description

Represents a single 'object' in a DDL document, e.g. either a custom type or a primitives list.

Member Function Documentation

◆ FindChildOfType()

const ezOpenDdlReaderElement * ezOpenDdlReaderElement::FindChildOfType ( ezOpenDdlPrimitiveType  type,
ezStringView  sName,
ezUInt32  uiMinNumberOfPrimitives = 1 
) const

Searches for a child element that has the given type, name and if it is a primitives list, at least the desired number of primitives.

Test:
This is new

◆ HasPrimitives()

bool ezOpenDdlReaderElement::HasPrimitives ( ezOpenDdlPrimitiveType  type,
ezUInt32  uiMinNumberOfPrimitives = 1 
) const

Returns true if the element stores the requested type of primitives AND has at least the desired amount of them, so that accessing the data array at certain indices is safe.

Test:
This is new

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