Browse Source

Trade: rename MaterialData::tryAttribute() to findAttribute().

Which is consistent with about everything else. No idea why I picked
such a strange API name.

Backwards compatibility aliases in place, as these are likely used by a
lot of code already. To ensure I didn't break anything, I'm updating all
code to use the new API in the next commit.
pull/610/head
Vladimír Vondruš 4 years ago
parent
commit
36f7e0c1d4
  1. 56
      src/Magnum/Trade/MaterialData.cpp
  2. 249
      src/Magnum/Trade/MaterialData.h
  3. 154
      src/Magnum/Trade/MaterialLayerData.h
  4. 32
      src/Magnum/Trade/Test/MaterialDataTest.cpp

56
src/Magnum/Trade/MaterialData.cpp

@ -494,9 +494,9 @@ Matrix3 MaterialData::layerFactorTextureMatrix(const UnsignedInt layer) const {
"Trade::MaterialData::layerFactorTextureMatrix(): index" << layer << "out of range for" << layerCount() << "layers", {}); "Trade::MaterialData::layerFactorTextureMatrix(): index" << layer << "out of range for" << layerCount() << "layers", {});
CORRADE_ASSERT(hasAttribute(layer, MaterialAttribute::LayerFactorTexture), CORRADE_ASSERT(hasAttribute(layer, MaterialAttribute::LayerFactorTexture),
"Trade::MaterialData::layerFactorTextureMatrix(): layer" << layer << "doesn't have a factor texture", {}); "Trade::MaterialData::layerFactorTextureMatrix(): layer" << layer << "doesn't have a factor texture", {});
if(Containers::Optional<Matrix3> value = tryAttribute<Matrix3>(layer, MaterialAttribute::LayerFactorTextureMatrix)) if(Containers::Optional<Matrix3> value = findAttribute<Matrix3>(layer, MaterialAttribute::LayerFactorTextureMatrix))
return *value; return *value;
if(Containers::Optional<Matrix3> value = tryAttribute<Matrix3>(layer, MaterialAttribute::TextureMatrix)) if(Containers::Optional<Matrix3> value = findAttribute<Matrix3>(layer, MaterialAttribute::TextureMatrix))
return *value; return *value;
return attributeOr(0, MaterialAttribute::TextureMatrix, Matrix3{}); return attributeOr(0, MaterialAttribute::TextureMatrix, Matrix3{});
} }
@ -509,9 +509,9 @@ Matrix3 MaterialData::layerFactorTextureMatrix(const Containers::StringView laye
"Trade::MaterialData::layerFactorTextureMatrix(): layer" << layer << "doesn't have a factor texture", {}); "Trade::MaterialData::layerFactorTextureMatrix(): layer" << layer << "doesn't have a factor texture", {});
/* Not delegating into layerFactorTextureMatrix() because we have a /* Not delegating into layerFactorTextureMatrix() because we have a
different variant of the assert here */ different variant of the assert here */
if(Containers::Optional<Matrix3> value = tryAttribute<Matrix3>(layerId, MaterialAttribute::LayerFactorTextureMatrix)) if(Containers::Optional<Matrix3> value = findAttribute<Matrix3>(layerId, MaterialAttribute::LayerFactorTextureMatrix))
return *value; return *value;
if(Containers::Optional<Matrix3> value = tryAttribute<Matrix3>(layerId, MaterialAttribute::TextureMatrix)) if(Containers::Optional<Matrix3> value = findAttribute<Matrix3>(layerId, MaterialAttribute::TextureMatrix))
return *value; return *value;
return attributeOr(0, MaterialAttribute::TextureMatrix, Matrix3{}); return attributeOr(0, MaterialAttribute::TextureMatrix, Matrix3{});
} }
@ -527,9 +527,9 @@ UnsignedInt MaterialData::layerFactorTextureCoordinates(const UnsignedInt layer)
"Trade::MaterialData::layerFactorTextureCoordinates(): index" << layer << "out of range for" << layerCount() << "layers", {}); "Trade::MaterialData::layerFactorTextureCoordinates(): index" << layer << "out of range for" << layerCount() << "layers", {});
CORRADE_ASSERT(hasAttribute(layer, MaterialAttribute::LayerFactorTexture), CORRADE_ASSERT(hasAttribute(layer, MaterialAttribute::LayerFactorTexture),
"Trade::MaterialData::layerFactorTextureCoordinates(): layer" << layer << "doesn't have a factor texture", {}); "Trade::MaterialData::layerFactorTextureCoordinates(): layer" << layer << "doesn't have a factor texture", {});
if(Containers::Optional<UnsignedInt> value = tryAttribute<UnsignedInt>(layer, MaterialAttribute::LayerFactorTextureCoordinates)) if(Containers::Optional<UnsignedInt> value = findAttribute<UnsignedInt>(layer, MaterialAttribute::LayerFactorTextureCoordinates))
return *value; return *value;
if(Containers::Optional<UnsignedInt> value = tryAttribute<UnsignedInt>(layer, MaterialAttribute::TextureCoordinates)) if(Containers::Optional<UnsignedInt> value = findAttribute<UnsignedInt>(layer, MaterialAttribute::TextureCoordinates))
return *value; return *value;
return attributeOr(0, MaterialAttribute::TextureCoordinates, 0u); return attributeOr(0, MaterialAttribute::TextureCoordinates, 0u);
} }
@ -542,9 +542,9 @@ UnsignedInt MaterialData::layerFactorTextureCoordinates(const Containers::String
"Trade::MaterialData::layerFactorTextureCoordinates(): layer" << layer << "doesn't have a factor texture", {}); "Trade::MaterialData::layerFactorTextureCoordinates(): layer" << layer << "doesn't have a factor texture", {});
/* Not delegating into layerFactorTextureCoordinates() because we have a /* Not delegating into layerFactorTextureCoordinates() because we have a
different variant of the assert here */ different variant of the assert here */
if(Containers::Optional<UnsignedInt> value = tryAttribute<UnsignedInt>(layerId, MaterialAttribute::LayerFactorTextureCoordinates)) if(Containers::Optional<UnsignedInt> value = findAttribute<UnsignedInt>(layerId, MaterialAttribute::LayerFactorTextureCoordinates))
return *value; return *value;
if(Containers::Optional<UnsignedInt> value = tryAttribute<UnsignedInt>(layerId, MaterialAttribute::TextureCoordinates)) if(Containers::Optional<UnsignedInt> value = findAttribute<UnsignedInt>(layerId, MaterialAttribute::TextureCoordinates))
return *value; return *value;
return attributeOr(0, MaterialAttribute::TextureCoordinates, 0u); return attributeOr(0, MaterialAttribute::TextureCoordinates, 0u);
} }
@ -560,9 +560,9 @@ UnsignedInt MaterialData::layerFactorTextureLayer(const UnsignedInt layer) const
"Trade::MaterialData::layerFactorTextureLayer(): index" << layer << "out of range for" << layerCount() << "layers", {}); "Trade::MaterialData::layerFactorTextureLayer(): index" << layer << "out of range for" << layerCount() << "layers", {});
CORRADE_ASSERT(hasAttribute(layer, MaterialAttribute::LayerFactorTexture), CORRADE_ASSERT(hasAttribute(layer, MaterialAttribute::LayerFactorTexture),
"Trade::MaterialData::layerFactorTextureLayer(): layer" << layer << "doesn't have a factor texture", {}); "Trade::MaterialData::layerFactorTextureLayer(): layer" << layer << "doesn't have a factor texture", {});
if(Containers::Optional<UnsignedInt> value = tryAttribute<UnsignedInt>(layer, MaterialAttribute::LayerFactorTextureLayer)) if(Containers::Optional<UnsignedInt> value = findAttribute<UnsignedInt>(layer, MaterialAttribute::LayerFactorTextureLayer))
return *value; return *value;
if(Containers::Optional<UnsignedInt> value = tryAttribute<UnsignedInt>(layer, MaterialAttribute::TextureLayer)) if(Containers::Optional<UnsignedInt> value = findAttribute<UnsignedInt>(layer, MaterialAttribute::TextureLayer))
return *value; return *value;
return attributeOr(0, MaterialAttribute::TextureLayer, 0u); return attributeOr(0, MaterialAttribute::TextureLayer, 0u);
} }
@ -575,9 +575,9 @@ UnsignedInt MaterialData::layerFactorTextureLayer(const Containers::StringView l
"Trade::MaterialData::layerFactorTextureLayer(): layer" << layer << "doesn't have a factor texture", {}); "Trade::MaterialData::layerFactorTextureLayer(): layer" << layer << "doesn't have a factor texture", {});
/* Not delegating into layerFactorTextureLayer() because we have a /* Not delegating into layerFactorTextureLayer() because we have a
different variant of the assert here */ different variant of the assert here */
if(Containers::Optional<UnsignedInt> value = tryAttribute<UnsignedInt>(layerId, MaterialAttribute::LayerFactorTextureLayer)) if(Containers::Optional<UnsignedInt> value = findAttribute<UnsignedInt>(layerId, MaterialAttribute::LayerFactorTextureLayer))
return *value; return *value;
if(Containers::Optional<UnsignedInt> value = tryAttribute<UnsignedInt>(layerId, MaterialAttribute::TextureLayer)) if(Containers::Optional<UnsignedInt> value = findAttribute<UnsignedInt>(layerId, MaterialAttribute::TextureLayer))
return *value; return *value;
return attributeOr(0, MaterialAttribute::TextureLayer, 0u); return attributeOr(0, MaterialAttribute::TextureLayer, 0u);
} }
@ -1057,45 +1057,45 @@ template<> MAGNUM_TRADE_EXPORT Containers::ArrayView<void> MaterialData::mutable
} }
#endif #endif
const void* MaterialData::tryAttribute(const UnsignedInt layer, const Containers::StringView name) const { const void* MaterialData::findAttribute(const UnsignedInt layer, const Containers::StringView name) const {
CORRADE_ASSERT(layer < layerCount(), CORRADE_ASSERT(layer < layerCount(),
"Trade::MaterialData::tryAttribute(): index" << layer << "out of range for" << layerCount() << "layers", {}); "Trade::MaterialData::findAttribute(): index" << layer << "out of range for" << layerCount() << "layers", {});
const UnsignedInt id = findAttributeIdInternal(layer, name); const UnsignedInt id = findAttributeIdInternal(layer, name);
if(id == ~UnsignedInt{}) return nullptr; if(id == ~UnsignedInt{}) return nullptr;
return _data[layerOffset(layer) + id].value(); return _data[layerOffset(layer) + id].value();
} }
const void* MaterialData::tryAttribute(const UnsignedInt layer, const MaterialAttribute name) const { const void* MaterialData::findAttribute(const UnsignedInt layer, const MaterialAttribute name) const {
const Containers::StringView string = Implementation::materialAttributeNameInternal(name); const Containers::StringView string = Implementation::materialAttributeNameInternal(name);
CORRADE_ASSERT(string, "Trade::MaterialData::tryAttribute(): invalid name" << name, {}); CORRADE_ASSERT(string, "Trade::MaterialData::findAttribute(): invalid name" << name, {});
return tryAttribute(layer, string); return findAttribute(layer, string);
} }
const void* MaterialData::tryAttribute(const Containers::StringView layer, const Containers::StringView name) const { const void* MaterialData::findAttribute(const Containers::StringView layer, const Containers::StringView name) const {
const UnsignedInt layerId = findLayerIdInternal(layer); const UnsignedInt layerId = findLayerIdInternal(layer);
CORRADE_ASSERT(layerId != ~UnsignedInt{}, CORRADE_ASSERT(layerId != ~UnsignedInt{},
"Trade::MaterialData::tryAttribute(): layer" << layer << "not found", {}); "Trade::MaterialData::findAttribute(): layer" << layer << "not found", {});
const UnsignedInt id = findAttributeIdInternal(layerId, name); const UnsignedInt id = findAttributeIdInternal(layerId, name);
if(id == ~UnsignedInt{}) return nullptr; if(id == ~UnsignedInt{}) return nullptr;
return _data[layerOffset(layerId) + id].value(); return _data[layerOffset(layerId) + id].value();
} }
const void* MaterialData::tryAttribute(const Containers::StringView layer, const MaterialAttribute name) const { const void* MaterialData::findAttribute(const Containers::StringView layer, const MaterialAttribute name) const {
const Containers::StringView string = Implementation::materialAttributeNameInternal(name); const Containers::StringView string = Implementation::materialAttributeNameInternal(name);
CORRADE_ASSERT(string, "Trade::MaterialData::tryAttribute(): invalid name" << name, {}); CORRADE_ASSERT(string, "Trade::MaterialData::findAttribute(): invalid name" << name, {});
return tryAttribute(layer, string); return findAttribute(layer, string);
} }
const void* MaterialData::tryAttribute(const MaterialLayer layer, const Containers::StringView name) const { const void* MaterialData::findAttribute(const MaterialLayer layer, const Containers::StringView name) const {
const Containers::StringView string = Implementation::materialLayerNameInternal(layer); const Containers::StringView string = Implementation::materialLayerNameInternal(layer);
CORRADE_ASSERT(string, "Trade::MaterialData::tryAttribute(): invalid name" << layer, {}); CORRADE_ASSERT(string, "Trade::MaterialData::findAttribute(): invalid name" << layer, {});
return tryAttribute(string, name); return findAttribute(string, name);
} }
const void* MaterialData::tryAttribute(const MaterialLayer layer, const MaterialAttribute name) const { const void* MaterialData::findAttribute(const MaterialLayer layer, const MaterialAttribute name) const {
const Containers::StringView string = Implementation::materialLayerNameInternal(layer); const Containers::StringView string = Implementation::materialLayerNameInternal(layer);
CORRADE_ASSERT(string, "Trade::MaterialData::tryAttribute(): invalid name" << layer, {}); CORRADE_ASSERT(string, "Trade::MaterialData::findAttribute(): invalid name" << layer, {});
return tryAttribute(string, name); return findAttribute(string, name);
} }
#ifdef MAGNUM_BUILD_DEPRECATED #ifdef MAGNUM_BUILD_DEPRECATED

249
src/Magnum/Trade/MaterialData.h

@ -42,6 +42,10 @@
#include "Magnum/Trade/Trade.h" #include "Magnum/Trade/Trade.h"
#include "Magnum/Trade/visibility.h" #include "Magnum/Trade/visibility.h"
#ifdef MAGNUM_BUILD_DEPRECATED
#include <Corrade/Utility/Macros.h>
#endif
namespace Magnum { namespace Trade { namespace Magnum { namespace Trade {
/** /**
@ -1800,7 +1804,7 @@ values. You're expected to check for attribute presence first with
@ref hasAttribute(), and the requested type has to match @ref attributeType(). @ref hasAttribute(), and the requested type has to match @ref attributeType().
To make things easier, each of the attributes defined in @ref MaterialAttribute To make things easier, each of the attributes defined in @ref MaterialAttribute
has a strictly defined type, so you can safely assume the type when requesting has a strictly defined type, so you can safely assume the type when requesting
those. In addition there's @ref tryAttribute() and @ref attributeOr() that those. In addition there's @ref findAttribute() and @ref attributeOr() that
return a @ref Containers::NullOpt or a default value in case given attribute is return a @ref Containers::NullOpt or a default value in case given attribute is
not found. not found.
@ -2463,7 +2467,7 @@ class MAGNUM_TRADE_EXPORT MaterialData {
* @brief Whether a material layer has given attribute * @brief Whether a material layer has given attribute
* *
* The @p layer is expected to be smaller than @ref layerCount() const. * The @p layer is expected to be smaller than @ref layerCount() const.
* @see @ref tryAttribute(), @ref attributeOr(), @ref hasLayer(), * @see @ref findAttribute(), @ref attributeOr(), @ref hasLayer(),
* @ref findAttributeId() * @ref findAttributeId()
*/ */
bool hasAttribute(UnsignedInt layer, Containers::StringView name) const; bool hasAttribute(UnsignedInt layer, Containers::StringView name) const;
@ -2473,7 +2477,7 @@ class MAGNUM_TRADE_EXPORT MaterialData {
* @brief Whether a named material layer has given attribute * @brief Whether a named material layer has given attribute
* *
* The @p layer is expected to exist. * The @p layer is expected to exist.
* @see @ref tryAttribute(), @ref attributeOr(), @ref hasLayer(), * @see @ref findAttribute(), @ref attributeOr(), @ref hasLayer(),
* @ref findAttributeId() * @ref findAttributeId()
*/ */
bool hasAttribute(Containers::StringView layer, Containers::StringView name) const; bool hasAttribute(Containers::StringView layer, Containers::StringView name) const;
@ -2486,7 +2490,8 @@ class MAGNUM_TRADE_EXPORT MaterialData {
* *
* Equivalent to calling @ref hasAttribute(UnsignedInt, Containers::StringView) const * Equivalent to calling @ref hasAttribute(UnsignedInt, Containers::StringView) const
* with @p layer set to @cpp 0 @ce. * with @p layer set to @cpp 0 @ce.
* @see @ref tryAttribute(), @ref attributeOr(), @ref findAttributeId() * @see @ref findAttribute(), @ref attributeOr(),
* @ref findAttributeId()
*/ */
bool hasAttribute(Containers::StringView name) const { bool hasAttribute(Containers::StringView name) const {
return hasAttribute(0, name); return hasAttribute(0, name);
@ -2732,7 +2737,7 @@ class MAGNUM_TRADE_EXPORT MaterialData {
* pointer to the data with no size information, Prefer to use * pointer to the data with no size information, Prefer to use
* typed access in that case. * typed access in that case.
* *
* @see @ref hasAttribute(), @ref tryAttribute(), @ref attributeOr() * @see @ref hasAttribute(), @ref findAttribute(), @ref attributeOr()
*/ */
const void* attribute(UnsignedInt layer, Containers::StringView name) const; const void* attribute(UnsignedInt layer, Containers::StringView name) const;
const void* attribute(UnsignedInt layer, MaterialAttribute name) const; /**< @overload */ const void* attribute(UnsignedInt layer, MaterialAttribute name) const; /**< @overload */
@ -3053,8 +3058,28 @@ class MAGNUM_TRADE_EXPORT MaterialData {
* Cast the pointer to a concrete type based on @ref attributeType(). * Cast the pointer to a concrete type based on @ref attributeType().
* @see @ref hasAttribute(), @ref attributeOr() * @see @ref hasAttribute(), @ref attributeOr()
*/ */
const void* tryAttribute(UnsignedInt layer, Containers::StringView name) const; const void* findAttribute(UnsignedInt layer, Containers::StringView name) const;
const void* tryAttribute(UnsignedInt layer, MaterialAttribute name) const; /**< @overload */ const void* findAttribute(UnsignedInt layer, MaterialAttribute name) const; /**< @overload */
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief @copybrief findAttribute(UnsignedInt, Containers::StringView) const
* @m_deprecated_since_latest Use @ref findAttribute(UnsignedInt, Containers::StringView) const
* instead.
*/
CORRADE_DEPRECATED("use findAttribute() instead") const void* tryAttribute(UnsignedInt layer, Containers::StringView name) const {
return findAttribute(layer, name);
}
/**
* @brief @copybrief findAttribute(UnsignedInt, MaterialAttribute) const
* @m_deprecated_since_latest Use @ref findAttribute(UnsignedInt, MaterialAttribute) const
* instead.
*/
CORRADE_DEPRECATED("use findAttribute() instead") const void* tryAttribute(UnsignedInt layer, MaterialAttribute name) const {
return findAttribute(layer, name);
}
#endif
/** /**
* @brief Type-erased attribute value in a named material layer, if exists * @brief Type-erased attribute value in a named material layer, if exists
@ -3065,10 +3090,48 @@ class MAGNUM_TRADE_EXPORT MaterialData {
* concrete type based on @ref attributeType(). * concrete type based on @ref attributeType().
* @see @ref hasLayer(), @ref hasAttribute(), @ref attributeOr() * @see @ref hasLayer(), @ref hasAttribute(), @ref attributeOr()
*/ */
const void* tryAttribute(Containers::StringView layer, Containers::StringView name) const; const void* findAttribute(Containers::StringView layer, Containers::StringView name) const;
const void* tryAttribute(Containers::StringView layer, MaterialAttribute name) const; /**< @overload */ const void* findAttribute(Containers::StringView layer, MaterialAttribute name) const; /**< @overload */
const void* tryAttribute(MaterialLayer layer, Containers::StringView name) const; /**< @overload */ const void* findAttribute(MaterialLayer layer, Containers::StringView name) const; /**< @overload */
const void* tryAttribute(MaterialLayer layer, MaterialAttribute name) const; /**< @overload */ const void* findAttribute(MaterialLayer layer, MaterialAttribute name) const; /**< @overload */
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief @copybrief findAttribute(Containers::StringView, Containers::StringView) const
* @m_deprecated_since_latest Use @ref findAttribute(Containers::StringView, Containers::StringView) const
* instead.
*/
CORRADE_DEPRECATED("use findAttribute() instead") const void* tryAttribute(Containers::StringView layer, Containers::StringView name) const {
return findAttribute(layer, name);
}
/**
* @brief @copybrief findAttribute(Containers::StringView, MaterialAttribute) const
* @m_deprecated_since_latest Use @ref findAttribute(Containers::StringView, MaterialAttribute) const
* instead.
*/
CORRADE_DEPRECATED("use findAttribute() instead") const void* tryAttribute(Containers::StringView layer, MaterialAttribute name) const {
return findAttribute(layer, name);
}
/**
* @brief @copybrief findAttribute(MaterialLayer, Containers::StringView) const
* @m_deprecated_since_latest Use @ref findAttribute(MaterialLayer, Containers::StringView) const
* instead.
*/
CORRADE_DEPRECATED("use findAttribute() instead") const void* tryAttribute(MaterialLayer layer, Containers::StringView name) const {
return findAttribute(layer, name);
}
/**
* @brief @copybrief findAttribute(MaterialLayer, MaterialAttribute) const
* @m_deprecated_since_latest Use @ref findAttribute(MaterialLayer, MaterialAttribute) const
* instead.
*/
CORRADE_DEPRECATED("use findAttribute() instead") const void* tryAttribute(MaterialLayer layer, MaterialAttribute name) const {
return findAttribute(layer, name);
}
#endif
/** /**
* @brief Value of a named attribute in given material layer, if exists * @brief Value of a named attribute in given material layer, if exists
@ -3081,8 +3144,28 @@ class MAGNUM_TRADE_EXPORT MaterialData {
* @ref attributeType(UnsignedInt, Containers::StringView) const for * @ref attributeType(UnsignedInt, Containers::StringView) const for
* given @p layer and @p name. * given @p layer and @p name.
*/ */
template<class T> Containers::Optional<T> tryAttribute(UnsignedInt layer, Containers::StringView name) const; template<class T> Containers::Optional<T> findAttribute(UnsignedInt layer, Containers::StringView name) const;
template<class T> Containers::Optional<T> tryAttribute(UnsignedInt layer, MaterialAttribute name) const; /**< @overload */ template<class T> Containers::Optional<T> findAttribute(UnsignedInt layer, MaterialAttribute name) const; /**< @overload */
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief @copybrief findAttribute(UnsignedInt, Containers::StringView) const
* @m_deprecated_since_latest Use @ref findAttribute(UnsignedInt, Containers::StringView) const
* instead.
*/
template<class T> CORRADE_DEPRECATED("use findAttribute() instead") Containers::Optional<T> tryAttribute(UnsignedInt layer, Containers::StringView name) const {
return findAttribute<T>(layer, name);
}
/**
* @brief @copybrief findAttribute(UnsignedInt, MaterialAttribute) const
* @m_deprecated_since_latest Use @ref findAttribute(UnsignedInt, MaterialAttribute) const
* instead.
*/
template<class T> CORRADE_DEPRECATED("use findAttribute() instead") Containers::Optional<T> tryAttribute(UnsignedInt layer, MaterialAttribute name) const {
return findAttribute<T>(layer, name);
}
#endif
/** /**
* @brief Value of a named attribute in a named material layer, if exists * @brief Value of a named attribute in a named material layer, if exists
@ -3095,37 +3178,115 @@ class MAGNUM_TRADE_EXPORT MaterialData {
* for given @p layer and @p name. * for given @p layer and @p name.
* @see @ref hasLayer() * @see @ref hasLayer()
*/ */
template<class T> Containers::Optional<T> tryAttribute(Containers::StringView layer, Containers::StringView name) const; template<class T> Containers::Optional<T> findAttribute(Containers::StringView layer, Containers::StringView name) const;
template<class T> Containers::Optional<T> tryAttribute(Containers::StringView layer, MaterialAttribute name) const; /**< @overload */ template<class T> Containers::Optional<T> findAttribute(Containers::StringView layer, MaterialAttribute name) const; /**< @overload */
template<class T> Containers::Optional<T> tryAttribute(MaterialLayer layer, Containers::StringView name) const; /**< @overload */ template<class T> Containers::Optional<T> findAttribute(MaterialLayer layer, Containers::StringView name) const; /**< @overload */
template<class T> Containers::Optional<T> tryAttribute(MaterialLayer layer, MaterialAttribute name) const; /**< @overload */ template<class T> Containers::Optional<T> findAttribute(MaterialLayer layer, MaterialAttribute name) const; /**< @overload */
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief @copybrief findAttribute(Containers::StringView, Containers::StringView) const
* @m_deprecated_since_latest Use @ref findAttribute(Containers::StringView, Containers::StringView) const
* instead.
*/
template<class T> CORRADE_DEPRECATED("use findAttribute() instead") Containers::Optional<T> tryAttribute(Containers::StringView layer, Containers::StringView name) const {
return findAttribute<T>(layer, name);
}
/**
* @brief @copybrief findAttribute(Containers::StringView, MaterialAttribute) const
* @m_deprecated_since_latest Use @ref findAttribute(Containers::StringView, MaterialAttribute) const
* instead.
*/
template<class T> CORRADE_DEPRECATED("use findAttribute() instead") Containers::Optional<T> tryAttribute(Containers::StringView layer, MaterialAttribute name) const {
return findAttribute<T>(layer, name);
}
/**
* @brief @copybrief findAttribute(UnsignedInt, Containers::StringView) const
* @m_deprecated_since_latest Use @ref findAttribute(UnsignedInt, Containers::StringView) const
* instead.
*/
template<class T> CORRADE_DEPRECATED("use findAttribute() instead") Containers::Optional<T> tryAttribute(MaterialLayer layer, Containers::StringView name) const {
return findAttribute<T>(layer, name);
}
/**
* @brief @copybrief findAttribute(UnsignedInt, MaterialAttribute) const
* @m_deprecated_since_latest Use @ref findAttribute(UnsignedInt, MaterialAttribute) const
* instead.
*/
template<class T> CORRADE_DEPRECATED("use findAttribute() instead") Containers::Optional<T> tryAttribute(MaterialLayer layer, MaterialAttribute name) const {
return findAttribute<T>(layer, name);
}
#endif
/** /**
* @brief Type-erased attribute value in the base material, if exists * @brief Type-erased attribute value in the base material, if exists
* *
* Equivalent to calling @ref tryAttribute(UnsignedInt, Containers::StringView) const * Equivalent to calling @ref findAttribute(UnsignedInt, Containers::StringView) const
* with @p layer set to @cpp 0 @ce. * with @p layer set to @cpp 0 @ce.
*/ */
const void* tryAttribute(Containers::StringView name) const { const void* findAttribute(Containers::StringView name) const {
return tryAttribute(0, name); return findAttribute(0, name);
} }
const void* tryAttribute(MaterialAttribute name) const { const void* findAttribute(MaterialAttribute name) const {
return tryAttribute(0, name); return findAttribute(0, name);
} /**< @overload */ } /**< @overload */
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief @copybrief findAttribute(Containers::StringView) const
* @m_deprecated_since_latest Use @ref findAttribute(Containers::StringView) const
* instead.
*/
CORRADE_DEPRECATED("use findAttribute() instead") const void* tryAttribute(Containers::StringView name) const {
return findAttribute(name);
}
/**
* @brief @copybrief findAttribute(MaterialAttribute) const
* @m_deprecated_since_latest Use @ref findAttribute(MaterialAttribute) const
* instead.
*/
CORRADE_DEPRECATED("use findAttribute() instead") const void* tryAttribute(MaterialAttribute name) const {
return findAttribute(name);
}
#endif
/** /**
* @brief Value of a named attribute in the base material, if exists * @brief Value of a named attribute in the base material, if exists
* *
* Equivalent to calling @ref tryAttribute(UnsignedInt, Containers::StringView) const * Equivalent to calling @ref findAttribute(UnsignedInt, Containers::StringView) const
* with @p layer set to @cpp 0 @ce. * with @p layer set to @cpp 0 @ce.
*/ */
template<class T> Containers::Optional<T> tryAttribute(Containers::StringView name) const { template<class T> Containers::Optional<T> findAttribute(Containers::StringView name) const {
return tryAttribute<T>(0, name); return findAttribute<T>(0, name);
} }
template<class T> Containers::Optional<T> tryAttribute(MaterialAttribute name) const { template<class T> Containers::Optional<T> findAttribute(MaterialAttribute name) const {
return tryAttribute<T>(0, name); return findAttribute<T>(0, name);
} /**< @overload */ } /**< @overload */
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief @copybrief findAttribute(Containers::StringView) const
* @m_deprecated_since_latest Use @ref findAttribute(Containers::StringView) const
* instead.
*/
template<class T> CORRADE_DEPRECATED("use findAttribute() instead") Containers::Optional<T> tryAttribute(Containers::StringView name) const {
return findAttribute<T>(name);
}
/**
* @brief @copybrief findAttribute(MaterialAttribute) const
* @m_deprecated_since_latest Use @ref findAttribute(MaterialAttribute) const
* instead.
*/
template<class T> CORRADE_DEPRECATED("use findAttribute() instead") Containers::Optional<T> tryAttribute(MaterialAttribute name) const {
return findAttribute<T>(name);
}
#endif
/** /**
* @brief Value of a named attribute in given layer or a default * @brief Value of a named attribute in given layer or a default
* *
@ -3551,43 +3712,43 @@ template<class T> typename std::conditional<std::is_same<T, Containers::MutableS
return mutableAttribute<T>(string, name); return mutableAttribute<T>(string, name);
} }
template<class T> Containers::Optional<T> MaterialData::tryAttribute(const UnsignedInt layer, const Containers::StringView name) const { template<class T> Containers::Optional<T> MaterialData::findAttribute(const UnsignedInt layer, const Containers::StringView name) const {
CORRADE_ASSERT(layer < layerCount(), CORRADE_ASSERT(layer < layerCount(),
"Trade::MaterialData::tryAttribute(): index" << layer << "out of range for" << layerCount() << "layers", {}); "Trade::MaterialData::findAttribute(): index" << layer << "out of range for" << layerCount() << "layers", {});
const UnsignedInt id = findAttributeIdInternal(layer, name); const UnsignedInt id = findAttributeIdInternal(layer, name);
if(id == ~UnsignedInt{}) return {}; if(id == ~UnsignedInt{}) return {};
return attribute<T>(layer, id); return attribute<T>(layer, id);
} }
template<class T> Containers::Optional<T> MaterialData::tryAttribute(const UnsignedInt layer, const MaterialAttribute name) const { template<class T> Containers::Optional<T> MaterialData::findAttribute(const UnsignedInt layer, const MaterialAttribute name) const {
const Containers::StringView string = Implementation::materialAttributeNameInternal(name); const Containers::StringView string = Implementation::materialAttributeNameInternal(name);
CORRADE_ASSERT(string.data(), "Trade::MaterialData::tryAttribute(): invalid name" << name, {}); CORRADE_ASSERT(string.data(), "Trade::MaterialData::findAttribute(): invalid name" << name, {});
return tryAttribute<T>(layer, string); return findAttribute<T>(layer, string);
} }
template<class T> Containers::Optional<T> MaterialData::tryAttribute(const Containers::StringView layer, const Containers::StringView name) const { template<class T> Containers::Optional<T> MaterialData::findAttribute(const Containers::StringView layer, const Containers::StringView name) const {
const UnsignedInt layerId = findLayerIdInternal(layer); const UnsignedInt layerId = findLayerIdInternal(layer);
CORRADE_ASSERT(layerId != ~UnsignedInt{}, CORRADE_ASSERT(layerId != ~UnsignedInt{},
"Trade::MaterialData::tryAttribute(): layer" << layer << "not found", {}); "Trade::MaterialData::findAttribute(): layer" << layer << "not found", {});
return tryAttribute<T>(layerId, name); return findAttribute<T>(layerId, name);
} }
template<class T> Containers::Optional<T> MaterialData::tryAttribute(const Containers::StringView layer, const MaterialAttribute name) const { template<class T> Containers::Optional<T> MaterialData::findAttribute(const Containers::StringView layer, const MaterialAttribute name) const {
const Containers::StringView string = Implementation::materialAttributeNameInternal(name); const Containers::StringView string = Implementation::materialAttributeNameInternal(name);
CORRADE_ASSERT(string.data(), "Trade::MaterialData::tryAttribute(): invalid name" << name, {}); CORRADE_ASSERT(string.data(), "Trade::MaterialData::findAttribute(): invalid name" << name, {});
return tryAttribute<T>(layer, string); return findAttribute<T>(layer, string);
} }
template<class T> Containers::Optional<T> MaterialData::tryAttribute(const MaterialLayer layer, const Containers::StringView name) const { template<class T> Containers::Optional<T> MaterialData::findAttribute(const MaterialLayer layer, const Containers::StringView name) const {
const Containers::StringView string = Implementation::materialLayerNameInternal(layer); const Containers::StringView string = Implementation::materialLayerNameInternal(layer);
CORRADE_ASSERT(string.data(), "Trade::MaterialData::tryAttribute(): invalid name" << layer, {}); CORRADE_ASSERT(string.data(), "Trade::MaterialData::findAttribute(): invalid name" << layer, {});
return tryAttribute<T>(string, name); return findAttribute<T>(string, name);
} }
template<class T> Containers::Optional<T> MaterialData::tryAttribute(const MaterialLayer layer, const MaterialAttribute name) const { template<class T> Containers::Optional<T> MaterialData::findAttribute(const MaterialLayer layer, const MaterialAttribute name) const {
const Containers::StringView string = Implementation::materialLayerNameInternal(layer); const Containers::StringView string = Implementation::materialLayerNameInternal(layer);
CORRADE_ASSERT(string.data(), "Trade::MaterialData::tryAttribute(): invalid name" << layer, {}); CORRADE_ASSERT(string.data(), "Trade::MaterialData::findAttribute(): invalid name" << layer, {});
return tryAttribute<T>(string, name); return findAttribute<T>(string, name);
} }
template<class T> T MaterialData::attributeOr(const UnsignedInt layer, const Containers::StringView name, const T& defaultValue) const { template<class T> T MaterialData::attributeOr(const UnsignedInt layer, const Containers::StringView name, const T& defaultValue) const {

154
src/Magnum/Trade/MaterialLayerData.h

@ -254,27 +254,67 @@ template<MaterialLayer layer> class MaterialLayerData: public MaterialData {
/** /**
* @brief Type-erased attribute value in this layer, if exists * @brief Type-erased attribute value in this layer, if exists
* *
* Same as calling @ref MaterialData::tryAttribute() with @p layer. * Same as calling @ref MaterialData::findAttribute() with @p layer.
*/ */
const void* tryAttribute(Containers::StringView name) const { const void* findAttribute(Containers::StringView name) const {
return MaterialData::tryAttribute(layer, name); return MaterialData::findAttribute(layer, name);
} }
const void* tryAttribute(MaterialAttribute name) const { const void* findAttribute(MaterialAttribute name) const {
return MaterialData::tryAttribute(layer, name); return MaterialData::findAttribute(layer, name);
} /**< @overload */ } /**< @overload */
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief @copybrief findAttribute(Containers::StringView) const
* @m_deprecated_since_latest Use @ref findAttribute(Containers::StringView) const
* instead.
*/
CORRADE_DEPRECATED("use findAttribute() instead") const void* tryAttribute(Containers::StringView name) const {
return findAttribute(name);
}
/**
* @brief @copybrief findAttribute(MaterialAttribute) const
* @m_deprecated_since_latest Use @ref findAttribute(MaterialAttribute) const
* instead.
*/
CORRADE_DEPRECATED("use findAttribute() instead") const void* tryAttribute(MaterialAttribute name) const {
return findAttribute(name);
}
#endif
/** /**
* @brief Value of a named attribute in this layer, if exists * @brief Value of a named attribute in this layer, if exists
* *
* Same as calling @ref MaterialData::tryAttribute() with @p layer. * Same as calling @ref MaterialData::findAttribute() with @p layer.
*/ */
template<class T> Containers::Optional<T> tryAttribute(Containers::StringView name) const { template<class T> Containers::Optional<T> findAttribute(Containers::StringView name) const {
return MaterialData::tryAttribute<T>(layer, name); return MaterialData::findAttribute<T>(layer, name);
} }
template<class T> Containers::Optional<T> tryAttribute(MaterialAttribute name) const { template<class T> Containers::Optional<T> findAttribute(MaterialAttribute name) const {
return MaterialData::tryAttribute<T>(layer, name); return MaterialData::findAttribute<T>(layer, name);
} /**< @overload */ } /**< @overload */
#ifdef MAGNUM_BUILD_DEPRECATED
/**
* @brief @copybrief findAttribute(Containers::StringView) const
* @m_deprecated_since_latest Use @ref findAttribute(Containers::StringView) const
* instead.
*/
template<class T> CORRADE_DEPRECATED("use findAttribute() instead") Containers::Optional<T> tryAttribute(Containers::StringView name) const {
return findAttribute<T>(name);
}
/**
* @brief @copybrief findAttribute(MaterialAttribute) const
* @m_deprecated_since_latest Use @ref findAttribute(MaterialAttribute) const
* instead.
*/
template<class T> CORRADE_DEPRECATED("use findAttribute() instead") Containers::Optional<T> tryAttribute(MaterialAttribute name) const {
return findAttribute<T>(name);
}
#endif
/** /**
* @brief Value of a named attribute in this layer or a default * @brief Value of a named attribute in this layer or a default
* *
@ -314,7 +354,10 @@ template<MaterialLayer layer> class MaterialLayerData: public MaterialData {
using MaterialData::attributeType; using MaterialData::attributeType;
using MaterialData::attribute; using MaterialData::attribute;
using MaterialData::mutableAttribute; using MaterialData::mutableAttribute;
using MaterialData::findAttribute;
#ifdef MAGNUM_BUILD_DEPRECATED
using MaterialData::tryAttribute; using MaterialData::tryAttribute;
#endif
using MaterialData::attributeOr; using MaterialData::attributeOr;
#else #else
UnsignedInt attributeCount(UnsignedInt layer_) const { UnsignedInt attributeCount(UnsignedInt layer_) const {
@ -534,44 +577,87 @@ template<MaterialLayer layer> class MaterialLayerData: public MaterialData {
return MaterialData::mutableAttribute<T>(layer_, name); return MaterialData::mutableAttribute<T>(layer_, name);
} }
const void* tryAttribute(UnsignedInt layer_, Containers::StringView name) const { const void* findAttribute(UnsignedInt layer_, Containers::StringView name) const {
return MaterialData::tryAttribute(layer_, name); return MaterialData::findAttribute(layer_, name);
}
const void* findAttribute(UnsignedInt layer_, MaterialAttribute name) const {
return MaterialData::findAttribute(layer_, name);
}
const void* findAttribute(Containers::StringView layer_, Containers::StringView name) const {
return MaterialData::findAttribute(layer_, name);
}
const void* findAttribute(Containers::StringView layer_, MaterialAttribute name) const {
return MaterialData::findAttribute(layer_, name);
}
const void* findAttribute(MaterialLayer layer_, Containers::StringView name) const {
return MaterialData::findAttribute(layer_, name);
}
const void* findAttribute(MaterialLayer layer_, MaterialAttribute name) const {
return MaterialData::findAttribute(layer_, name);
}
#ifdef MAGNUM_BUILD_DEPRECATED
CORRADE_DEPRECATED("use findAttribute() instead") const void* tryAttribute(UnsignedInt layer_, Containers::StringView name) const {
return findAttribute(layer_, name);
}
CORRADE_DEPRECATED("use findAttribute() instead") const void* tryAttribute(UnsignedInt layer_, MaterialAttribute name) const {
return findAttribute(layer_, name);
}
CORRADE_DEPRECATED("use findAttribute() instead") const void* tryAttribute(Containers::StringView layer_, Containers::StringView name) const {
return findAttribute(layer_, name);
}
CORRADE_DEPRECATED("use findAttribute() instead") const void* tryAttribute(Containers::StringView layer_, MaterialAttribute name) const {
return findAttribute(layer_, name);
}
CORRADE_DEPRECATED("use findAttribute() instead") const void* tryAttribute(MaterialLayer layer_, Containers::StringView name) const {
return findAttribute(layer_, name);
}
CORRADE_DEPRECATED("use findAttribute() instead") const void* tryAttribute(MaterialLayer layer_, MaterialAttribute name) const {
return findAttribute(layer_, name);
}
#endif
template<class T> Containers::Optional<T> findAttribute(UnsignedInt layer_, Containers::StringView name) const {
return MaterialData::findAttribute<T>(layer_, name);
} }
const void* tryAttribute(UnsignedInt layer_, MaterialAttribute name) const { template<class T> Containers::Optional<T> findAttribute(UnsignedInt layer_, MaterialAttribute name) const {
return MaterialData::tryAttribute(layer_, name); return MaterialData::findAttribute<T>(layer_, name);
} }
const void* tryAttribute(Containers::StringView layer_, Containers::StringView name) const {
return MaterialData::tryAttribute(layer_, name); template<class T> Containers::Optional<T> findAttribute(Containers::StringView layer_, Containers::StringView name) const {
return MaterialData::findAttribute<T>(layer_, name);
} }
const void* tryAttribute(Containers::StringView layer_, MaterialAttribute name) const { template<class T> Containers::Optional<T> findAttribute(Containers::StringView layer_, MaterialAttribute name) const {
return MaterialData::tryAttribute(layer_, name); return MaterialData::findAttribute<T>(layer_, name);
} }
const void* tryAttribute(MaterialLayer layer_, Containers::StringView name) const { template<class T> Containers::Optional<T> findAttribute(MaterialLayer layer_, Containers::StringView name) const {
return MaterialData::tryAttribute(layer_, name); return MaterialData::findAttribute<T>(layer_, name);
} }
const void* tryAttribute(MaterialLayer layer_, MaterialAttribute name) const { template<class T> Containers::Optional<T> findAttribute(MaterialLayer layer_, MaterialAttribute name) const {
return MaterialData::tryAttribute(layer_, name); return MaterialData::findAttribute<T>(layer_, name);
} }
template<class T> Containers::Optional<T> tryAttribute(UnsignedInt layer_, Containers::StringView name) const { #ifdef MAGNUM_BUILD_DEPRECATED
return MaterialData::tryAttribute<T>(layer_, name); template<class T> CORRADE_DEPRECATED("use findAttribute() instead") Containers::Optional<T> tryAttribute(UnsignedInt layer_, Containers::StringView name) const {
return findAttribute<T>(layer_, name);
} }
template<class T> Containers::Optional<T> tryAttribute(UnsignedInt layer_, MaterialAttribute name) const { template<class T> CORRADE_DEPRECATED("use findAttribute() instead") Containers::Optional<T> tryAttribute(UnsignedInt layer_, MaterialAttribute name) const {
return MaterialData::tryAttribute<T>(layer_, name); return findAttribute<T>(layer_, name);
} }
template<class T> Containers::Optional<T> tryAttribute(Containers::StringView layer_, Containers::StringView name) const { template<class T> CORRADE_DEPRECATED("use findAttribute() instead") Containers::Optional<T> tryAttribute(Containers::StringView layer_, Containers::StringView name) const {
return MaterialData::tryAttribute<T>(layer_, name); return findAttribute<T>(layer_, name);
} }
template<class T> Containers::Optional<T> tryAttribute(Containers::StringView layer_, MaterialAttribute name) const { template<class T> CORRADE_DEPRECATED("use findAttribute() instead") Containers::Optional<T> tryAttribute(Containers::StringView layer_, MaterialAttribute name) const {
return MaterialData::tryAttribute<T>(layer_, name); return findAttribute<T>(layer_, name);
} }
template<class T> Containers::Optional<T> tryAttribute(MaterialLayer layer_, Containers::StringView name) const { template<class T> CORRADE_DEPRECATED("use findAttribute() instead") Containers::Optional<T> tryAttribute(MaterialLayer layer_, Containers::StringView name) const {
return MaterialData::tryAttribute<T>(layer_, name); return findAttribute<T>(layer_, name);
} }
template<class T> Containers::Optional<T> tryAttribute(MaterialLayer layer_, MaterialAttribute name) const { template<class T> CORRADE_DEPRECATED("use findAttribute() instead") Containers::Optional<T> tryAttribute(MaterialLayer layer_, MaterialAttribute name) const {
return MaterialData::tryAttribute<T>(layer_, name); return findAttribute<T>(layer_, name);
} }
#endif
template<class T> T attributeOr(UnsignedInt layer_, Containers::StringView name, const T& defaultValue) const { template<class T> T attributeOr(UnsignedInt layer_, Containers::StringView name, const T& defaultValue) const {
return MaterialData::attributeOr<T>(layer_, name, defaultValue); return MaterialData::attributeOr<T>(layer_, name, defaultValue);

32
src/Magnum/Trade/Test/MaterialDataTest.cpp

@ -2655,10 +2655,10 @@ void MaterialDataTest::accessLayerOutOfBounds() {
"Trade::MaterialData::mutableAttribute(): index 2 out of range for 2 layers\n" "Trade::MaterialData::mutableAttribute(): index 2 out of range for 2 layers\n"
"Trade::MaterialData::mutableAttribute(): index 2 out of range for 2 layers\n" "Trade::MaterialData::mutableAttribute(): index 2 out of range for 2 layers\n"
"Trade::MaterialData::mutableAttribute(): index 2 out of range for 2 layers\n" "Trade::MaterialData::mutableAttribute(): index 2 out of range for 2 layers\n"
"Trade::MaterialData::tryAttribute(): index 2 out of range for 2 layers\n" "Trade::MaterialData::findAttribute(): index 2 out of range for 2 layers\n"
"Trade::MaterialData::tryAttribute(): index 2 out of range for 2 layers\n" "Trade::MaterialData::findAttribute(): index 2 out of range for 2 layers\n"
"Trade::MaterialData::tryAttribute(): index 2 out of range for 2 layers\n" "Trade::MaterialData::findAttribute(): index 2 out of range for 2 layers\n"
"Trade::MaterialData::tryAttribute(): index 2 out of range for 2 layers\n" "Trade::MaterialData::findAttribute(): index 2 out of range for 2 layers\n"
"Trade::MaterialData::attributeOr(): index 2 out of range for 2 layers\n" "Trade::MaterialData::attributeOr(): index 2 out of range for 2 layers\n"
"Trade::MaterialData::attributeOr(): index 2 out of range for 2 layers\n"); "Trade::MaterialData::attributeOr(): index 2 out of range for 2 layers\n");
} }
@ -2747,10 +2747,10 @@ void MaterialDataTest::accessLayerNotFound() {
"Trade::MaterialData::mutableAttribute(): layer ClearCoat not found\n" "Trade::MaterialData::mutableAttribute(): layer ClearCoat not found\n"
"Trade::MaterialData::mutableAttribute(): layer ClearCoat not found\n" "Trade::MaterialData::mutableAttribute(): layer ClearCoat not found\n"
"Trade::MaterialData::mutableAttribute(): layer ClearCoat not found\n" "Trade::MaterialData::mutableAttribute(): layer ClearCoat not found\n"
"Trade::MaterialData::tryAttribute(): layer ClearCoat not found\n" "Trade::MaterialData::findAttribute(): layer ClearCoat not found\n"
"Trade::MaterialData::tryAttribute(): layer ClearCoat not found\n" "Trade::MaterialData::findAttribute(): layer ClearCoat not found\n"
"Trade::MaterialData::tryAttribute(): layer ClearCoat not found\n" "Trade::MaterialData::findAttribute(): layer ClearCoat not found\n"
"Trade::MaterialData::tryAttribute(): layer ClearCoat not found\n" "Trade::MaterialData::findAttribute(): layer ClearCoat not found\n"
"Trade::MaterialData::attributeOr(): layer ClearCoat not found\n" "Trade::MaterialData::attributeOr(): layer ClearCoat not found\n"
"Trade::MaterialData::attributeOr(): layer ClearCoat not found\n"); "Trade::MaterialData::attributeOr(): layer ClearCoat not found\n");
} }
@ -2837,10 +2837,10 @@ void MaterialDataTest::accessInvalidLayerName() {
"Trade::MaterialData::mutableAttribute(): invalid name Trade::MaterialLayer(0xfefe)\n" "Trade::MaterialData::mutableAttribute(): invalid name Trade::MaterialLayer(0xfefe)\n"
"Trade::MaterialData::mutableAttribute(): invalid name Trade::MaterialLayer(0xfefe)\n" "Trade::MaterialData::mutableAttribute(): invalid name Trade::MaterialLayer(0xfefe)\n"
"Trade::MaterialData::mutableAttribute(): invalid name Trade::MaterialLayer(0xfefe)\n" "Trade::MaterialData::mutableAttribute(): invalid name Trade::MaterialLayer(0xfefe)\n"
"Trade::MaterialData::tryAttribute(): invalid name Trade::MaterialLayer(0xfefe)\n" "Trade::MaterialData::findAttribute(): invalid name Trade::MaterialLayer(0xfefe)\n"
"Trade::MaterialData::tryAttribute(): invalid name Trade::MaterialLayer(0xfefe)\n" "Trade::MaterialData::findAttribute(): invalid name Trade::MaterialLayer(0xfefe)\n"
"Trade::MaterialData::tryAttribute(): invalid name Trade::MaterialLayer(0xfefe)\n" "Trade::MaterialData::findAttribute(): invalid name Trade::MaterialLayer(0xfefe)\n"
"Trade::MaterialData::tryAttribute(): invalid name Trade::MaterialLayer(0xfefe)\n" "Trade::MaterialData::findAttribute(): invalid name Trade::MaterialLayer(0xfefe)\n"
"Trade::MaterialData::attributeOr(): invalid name Trade::MaterialLayer(0xfefe)\n" "Trade::MaterialData::attributeOr(): invalid name Trade::MaterialLayer(0xfefe)\n"
"Trade::MaterialData::attributeOr(): invalid name Trade::MaterialLayer(0xfefe)\n"); "Trade::MaterialData::attributeOr(): invalid name Trade::MaterialLayer(0xfefe)\n");
} }
@ -3011,10 +3011,10 @@ void MaterialDataTest::accessInvalidAttributeName() {
"Trade::MaterialData::mutableAttribute(): invalid name Trade::MaterialAttribute(0xfefe)\n" "Trade::MaterialData::mutableAttribute(): invalid name Trade::MaterialAttribute(0xfefe)\n"
"Trade::MaterialData::mutableAttribute(): invalid name Trade::MaterialAttribute(0x0)\n" "Trade::MaterialData::mutableAttribute(): invalid name Trade::MaterialAttribute(0x0)\n"
"Trade::MaterialData::mutableAttribute(): invalid name Trade::MaterialAttribute(0xfefe)\n" "Trade::MaterialData::mutableAttribute(): invalid name Trade::MaterialAttribute(0xfefe)\n"
"Trade::MaterialData::tryAttribute(): invalid name Trade::MaterialAttribute(0x0)\n" "Trade::MaterialData::findAttribute(): invalid name Trade::MaterialAttribute(0x0)\n"
"Trade::MaterialData::tryAttribute(): invalid name Trade::MaterialAttribute(0xfefe)\n" "Trade::MaterialData::findAttribute(): invalid name Trade::MaterialAttribute(0xfefe)\n"
"Trade::MaterialData::tryAttribute(): invalid name Trade::MaterialAttribute(0x0)\n" "Trade::MaterialData::findAttribute(): invalid name Trade::MaterialAttribute(0x0)\n"
"Trade::MaterialData::tryAttribute(): invalid name Trade::MaterialAttribute(0xfefe)\n" "Trade::MaterialData::findAttribute(): invalid name Trade::MaterialAttribute(0xfefe)\n"
"Trade::MaterialData::attributeOr(): invalid name Trade::MaterialAttribute(0x0)\n" "Trade::MaterialData::attributeOr(): invalid name Trade::MaterialAttribute(0x0)\n"
"Trade::MaterialData::attributeOr(): invalid name Trade::MaterialAttribute(0xfefe)\n"); "Trade::MaterialData::attributeOr(): invalid name Trade::MaterialAttribute(0xfefe)\n");
} }

Loading…
Cancel
Save