bool Attributes::setValueFromRawString(const AttributeName_t& aName, const std::string& aValue) { if (isAttributeExist(aName)) { return false; } StringValue TmpStrValue(aValue); switch (TmpStrValue.guessTypeConversion()) { case Value::DOUBLE : { double TmpVal; if (!TmpStrValue.toDouble(TmpVal)) { return false; } m_Data[aName].reset(new DoubleValue(TmpVal)); break; } case Value::INTEGER : { long TmpVal; if (!TmpStrValue.toInteger(TmpVal)) { return false; } m_Data[aName].reset(new IntegerValue(TmpVal)); break; } case Value::BOOLEAN : { bool TmpVal; if (!TmpStrValue.toBoolean(TmpVal)) { return false; } m_Data[aName].reset(new BooleanValue(TmpVal)); break; } case Value::STRING : { m_Data[aName].reset(new StringValue(aValue)); break; } case Value::VECTOR : { VectorValue TmpVal; if (!TmpStrValue.toVectorValue(TmpVal)) { return false; } m_Data[aName].reset(TmpVal.clone()); break; } case Value::MATRIX : { MatrixValue TmpVal; if (!TmpStrValue.toMatrixValue(TmpVal)) { return false; } m_Data[aName].reset(TmpVal.clone()); break; } case Value::MAP : { MapValue TmpVal; if (!TmpStrValue.toMapValue(TmpVal)) { return false; } m_Data[aName].reset(TmpVal.clone()); break; } case Value::TREE : { TreeValue TmpVal; if (!TmpStrValue.toTreeValue(TmpVal)) { return false; } m_Data[aName].reset(TmpVal.clone()); break; } case Value::NULLL : { NullValue TmpVal; if (!TmpStrValue.toNullValue(TmpVal)) { return false; } m_Data[aName].reset(TmpVal.clone()); break; } default : return false; } return true; }