21#ifndef vtkVariantExtract_h
22#define vtkVariantExtract_h
27VTK_ABI_NAMESPACE_BEGIN
31 vtkGenericWarningMacro(
32 <<
"Cannot convert vtkVariant containing [" << value.GetTypeAsString() <<
"] "
33 <<
"to unsupported type [" <<
typeid(T).name() <<
"]. "
34 <<
"Create a vtkVariantExtract<> specialization to eliminate this warning.");
45 valid = value.IsChar();
46 return valid ? value.ToChar() : 0;
52 valid = value.IsUnsignedChar();
53 return valid ? value.ToUnsignedChar() : 0;
59 valid = value.IsShort();
60 return valid ? value.ToShort() : 0;
66 valid = value.IsUnsignedShort();
67 return valid ? value.ToUnsignedShort() : 0;
73 valid = value.IsInt();
74 return valid ? value.ToInt() : 0;
80 valid = value.IsUnsignedInt();
81 return valid ? value.ToUnsignedInt() : 0;
87 valid = value.IsLong();
88 return valid ? value.ToLong() : 0;
94 valid = value.IsUnsignedLong();
95 return valid ? value.ToUnsignedLong() : 0;
101 valid = value.IsLongLong();
102 return valid ? value.ToLongLong() : 0;
109 valid = value.IsUnsignedLongLong();
110 return valid ? value.ToUnsignedLongLong() : 0;
116 valid = value.IsFloat();
117 return valid ? value.ToFloat() : 0.0f;
123 valid = value.IsDouble();
124 return valid ? value.ToDouble() : 0.0;
130 valid = value.IsString();
Wrapper around std::string to keep symbols short.
A type representing the union of many types.