Changeset 1720 for code/branches/core3/src/util/Convert.h
- Timestamp:
- Sep 6, 2008, 6:30:40 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core3/src/util/Convert.h
r1716 r1720 43 43 #include "Debug.h" 44 44 #include "SubString.h" 45 //#include "MultiTypeMath.h"46 45 47 46 // disable annoying warning about forcing value to boolean … … 320 319 321 320 322 ////////////////323 // MULTITYPES //324 ////////////////325 /*326 // convert from MultiTypePrimitive327 template <class ToType>328 struct ConverterSpecialized<MultiTypePrimitive, ToType, _FromType_>329 {330 enum { specialized = true };331 static bool convert(ToType* output, const MultiTypePrimitive& input)332 {333 if (input.getType() == MT_void)334 return ConvertValue(output, input.getVoid());335 else if (input.getType() == MT_int)336 return ConvertValue(output, input.getInt());337 else if (input.getType() == MT_uint)338 return ConvertValue(output, input.getUnsignedInt());339 else if (input.getType() == MT_char)340 return ConvertValue(output, input.getChar());341 else if (input.getType() == MT_uchar)342 return ConvertValue(output, input.getUnsignedChar());343 else if (input.getType() == MT_short)344 return ConvertValue(output, input.getShort());345 else if (input.getType() == MT_ushort)346 return ConvertValue(output, input.getUnsignedShort());347 else if (input.getType() == MT_long)348 return ConvertValue(output, input.getLong());349 else if (input.getType() == MT_ulong)350 return ConvertValue(output, input.getUnsignedLong());351 else if (input.getType() == MT_float)352 return ConvertValue(output, input.getFloat());353 else if (input.getType() == MT_double)354 return ConvertValue(output, input.getDouble());355 else if (input.getType() == MT_longdouble)356 return ConvertValue(output, input.getLongDouble());357 else if (input.getType() == MT_bool)358 return ConvertValue(output, input.getBool());359 else360 return false;361 }362 };363 364 // convert from MultiTypeString365 template <class ToType>366 struct ConverterSpecialized<MultiTypeString, ToType, _FromType_>367 {368 enum { specialized = true };369 static bool convert(ToType* output, const MultiTypeString& input)370 {371 if (input.getType() == MT_constchar)372 return ConvertValue(output, input.getConstChar());373 else if (input.getType() == MT_string)374 return ConvertValue(output, input.getString());375 else376 return ConvertValue(output, (MultiTypePrimitive)input);377 }378 };379 380 // convert from MultiTypeMath381 template <class ToType>382 struct ConverterSpecialized<MultiTypeMath, ToType, _FromType_>383 {384 enum { specialized = true };385 static bool convert(ToType* output, const MultiTypeMath& input)386 {387 if (input.getType() == MT_vector2)388 return ConvertValue(output, input.getVector2());389 else if (input.getType() == MT_vector3)390 return ConvertValue(output, input.getVector3());391 else if (input.getType() == MT_vector4)392 return ConvertValue(output, input.getVector4());393 else if (input.getType() == MT_quaternion)394 return ConvertValue(output, input.getQuaternion());395 else if (input.getType() == MT_colourvalue)396 return ConvertValue(output, input.getColourValue());397 else if (input.getType() == MT_radian)398 return ConvertValue(output, input.getRadian());399 else if (input.getType() == MT_degree)400 return ConvertValue(output, input.getDegree());401 else402 return ConvertValue(output, (MultiTypeString)input);403 }404 };405 */406 321 407 322 ////////////////////
Note: See TracChangeset
for help on using the changeset viewer.