![]() |
Plasma Engine
2.0
|
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 | |
PL_DECLARE_POD_TYPE () | |
PL_ALWAYS_INLINE bool | IsCustomType () const |
Whether this is a custom object type that typically contains sub-elements. | |
PL_ALWAYS_INLINE bool | IsCustomType (plStringView sTypeName) const |
Whether this is a custom object type of the requested type. | |
PL_ALWAYS_INLINE plStringView | GetCustomType () const |
Returns the string for the custom type name. | |
PL_ALWAYS_INLINE bool | HasName () const |
Whether the name of the object is non-empty. | |
PL_ALWAYS_INLINE plStringView | GetName () const |
Returns the name of the object. | |
PL_ALWAYS_INLINE bool | IsNameGlobal () const |
Returns whether the element name is a global or a local name. | |
plUInt32 | GetNumChildObjects () const |
How many sub-elements the object has. | |
PL_ALWAYS_INLINE const plOpenDdlReaderElement * | GetFirstChild () const |
If this is a custom type element, the returned pointer is to the first child element. | |
PL_ALWAYS_INLINE const plOpenDdlReaderElement * | GetSibling () const |
If the parent is a custom type element, the next child after this is returned. | |
plUInt32 | GetNumPrimitives () const |
For non-custom types this returns how many primitives are stored at this element. | |
PL_ALWAYS_INLINE plOpenDdlPrimitiveType | GetPrimitivesType () const |
For non-custom types this returns the type of primitive that is stored at this element. | |
bool | HasPrimitives (plOpenDdlPrimitiveType type, plUInt32 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. | |
PL_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. | |
PL_ALWAYS_INLINE const plInt8 * | GetPrimitivesInt8 () const |
Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type. | |
PL_ALWAYS_INLINE const plInt16 * | GetPrimitivesInt16 () const |
Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type. | |
PL_ALWAYS_INLINE const plInt32 * | GetPrimitivesInt32 () const |
Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type. | |
PL_ALWAYS_INLINE const plInt64 * | GetPrimitivesInt64 () const |
Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type. | |
PL_ALWAYS_INLINE const plUInt8 * | GetPrimitivesUInt8 () const |
Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type. | |
PL_ALWAYS_INLINE const plUInt16 * | GetPrimitivesUInt16 () const |
Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type. | |
PL_ALWAYS_INLINE const plUInt32 * | GetPrimitivesUInt32 () const |
Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type. | |
PL_ALWAYS_INLINE const plUInt64 * | GetPrimitivesUInt64 () const |
Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type. | |
PL_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. | |
PL_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. | |
PL_ALWAYS_INLINE const plStringView * | GetPrimitivesString () const |
Returns a pointer to the primitive data cast to a specific type. Only valid if GetPrimitivesType() actually returns this type. | |
const plOpenDdlReaderElement * | FindChild (plStringView 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 plOpenDdlReaderElement * | FindChildOfType (plOpenDdlPrimitiveType type, plStringView sName, plUInt32 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 plOpenDdlReaderElement * | FindChildOfType (plStringView sType, plStringView sName=nullptr) const |
Searches for a child element with the given type and optionally also a certain name. | |
Friends | |
class | plOpenDdlReader |
Represents a single 'object' in a DDL document, e.g. either a custom type or a primitives list.
const plOpenDdlReaderElement * plOpenDdlReaderElement::FindChildOfType | ( | plOpenDdlPrimitiveType | type, |
plStringView | sName, | ||
plUInt32 | 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.
bool plOpenDdlReaderElement::HasPrimitives | ( | plOpenDdlPrimitiveType | type, |
plUInt32 | 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.