XII Release 0.1.0
Loading...
Searching...
No Matches
xiiOpenDdlReaderElement Class Reference

Copyright (c) Theophilus Eriata. All Rights Reserved. More...

#include <OpenDdlReader.h>

Public Member Functions

 XII_DECLARE_POD_TYPE ()
XII_ALWAYS_INLINE bool IsCustomType () const
 Whether this is a custom object type that typically contains sub-elements.
XII_ALWAYS_INLINE bool IsCustomType (xiiStringView sTypeName) const
 Whether this is a custom object type of the requested type.
XII_ALWAYS_INLINE xiiStringView GetCustomType () const
 Returns the string for the custom type name.
XII_ALWAYS_INLINE bool HasName () const
 Whether the name of the object is non-empty.
XII_ALWAYS_INLINE xiiStringView GetName () const
 Returns the name of the object.
XII_ALWAYS_INLINE bool IsNameGlobal () const
 Returns whether the element name is a global or a local name.
xiiUInt32 GetNumChildObjects () const
 How many sub-elements the object has.
XII_ALWAYS_INLINE const xiiOpenDdlReaderElement * GetFirstChild () const
 If this is a custom type element, the returned pointer is to the first child element.
XII_ALWAYS_INLINE const xiiOpenDdlReaderElement * GetSibling () const
 If the parent is a custom type element, the next child after this is returned.
xiiUInt32 GetNumPrimitives () const
 For non-custom types this returns how many primitives are stored at this element.
XII_ALWAYS_INLINE xiiOpenDdlPrimitiveType GetPrimitivesType () const
 For non-custom types this returns the type of primitive that is stored at this element.
bool HasPrimitives (xiiOpenDdlPrimitiveType type, xiiUInt32 uiMinNumberOfPrimitives=1) const
XII_ALWAYS_INLINE const bool * GetPrimitivesBool () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
XII_ALWAYS_INLINE const xiiInt8 * GetPrimitivesInt8 () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
XII_ALWAYS_INLINE const xiiInt16 * GetPrimitivesInt16 () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
XII_ALWAYS_INLINE const xiiInt32 * GetPrimitivesInt32 () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
XII_ALWAYS_INLINE const xiiInt64 * GetPrimitivesInt64 () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
XII_ALWAYS_INLINE const xiiUInt8 * GetPrimitivesUInt8 () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
XII_ALWAYS_INLINE const xiiUInt16 * GetPrimitivesUInt16 () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
XII_ALWAYS_INLINE const xiiUInt32 * GetPrimitivesUInt32 () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
XII_ALWAYS_INLINE const xiiUInt64 * GetPrimitivesUInt64 () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
XII_ALWAYS_INLINE const float * GetPrimitivesFloat () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
XII_ALWAYS_INLINE const double * GetPrimitivesDouble () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
XII_ALWAYS_INLINE const xiiStringView * GetPrimitivesString () const
 Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type.
const xiiOpenDdlReaderElement * FindChild (xiiStringView sName) const
const xiiOpenDdlReaderElement * FindChildOfType (xiiOpenDdlPrimitiveType type, xiiStringView sName, xiiUInt32 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.
const xiiOpenDdlReaderElement * FindChildOfType (xiiStringView sType, xiiStringView sName={}) const
 Searches for a child element with the given type and optionally also a certain name.

Friends

class xiiOpenDdlReader

Detailed Description

Copyright (c) Theophilus Eriata. All Rights Reserved.

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

Member Function Documentation

◆ FindChild()

const xiiOpenDdlReaderElement * xiiOpenDdlReaderElement::FindChild ( xiiStringView 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.

◆ FindChildOfType()

const xiiOpenDdlReaderElement * xiiOpenDdlReaderElement::FindChildOfType ( xiiOpenDdlPrimitiveType type,
xiiStringView sName,
xiiUInt32 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 xiiOpenDdlReaderElement::HasPrimitives ( xiiOpenDdlPrimitiveType type,
xiiUInt32 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:
  • /home/runner/work/XII/XII/Source/Engine/Foundation/IO/OpenDdlReader.h
  • /home/runner/work/XII/XII/Source/Engine/Foundation/IO/Implementation/OpenDdlReader.cpp