[problem] Builder was unable to convert property values to unsigned int
[cause] Used integer comparison
[solution] Added a property to unsigned int conversion
Change-Id: I6ccfac3561d016c197e18e518df35ccf9783c505
}
case Property::UNSIGNED_INTEGER:
{
- if( OptionalInteger v = replacer.IsInteger(node) )
+ if( OptionalUnsignedInt v = replacer.IsUnsignedInteger( node) )
{
if( *v >= 0 ) // with a loss of resolution....
{
return ret;
}
+OptionalUnsignedInt Replacement::IsUnsignedInteger( const TreeNode & node ) const
+{
+ OptionalUnsignedInt ret;
+ if( OptionalString replace = HasFullReplacement( node ) )
+ {
+ Property::Value value = GetFullReplacement( *replace );
+ if( Property::UNSIGNED_INTEGER == value.GetType() )
+ {
+ ret = value.Get<unsigned int>();
+ }
+ }
+ else
+ {
+ if ( OptionalInteger i = ::IsInteger( node ) )
+ {
+ ret = OptionalUnsignedInt(static_cast<unsigned int>(*i) );
+ }
+ }
+ return ret;
+}
+
OptionalVector2 Replacement::IsVector2( const TreeNode & node ) const
{
OptionalVector2 ret;
* @param node The TreeNode to check
* @return Optional value
*/
+ OptionalUnsignedInt IsUnsignedInteger( const TreeNode & node ) const;
+
+ /* @brief Check node for a type
+ *
+ * @param node The TreeNode to check
+ * @return Optional value
+ */
OptionalVector2 IsVector2( const TreeNode & node ) const;
/* @brief Check node for a type