35#ifndef vtkVariantExtract_h
36#define vtkVariantExtract_h
44 vtkGenericWarningMacro(
45 <<
"Cannot convert vtkVariant containing [" <<
value.GetTypeAsString() <<
"] "
46 <<
"to unsupported type [" <<
typeid(T).name() <<
"]. "
47 <<
"Create a vtkVariantExtract<> specialization to eliminate this warning.");
58 valid =
value.IsChar();
59 return valid ?
value.ToChar() : 0;
65 valid =
value.IsUnsignedChar();
66 return valid ?
value.ToUnsignedChar() : 0;
72 valid =
value.IsShort();
73 return valid ?
value.ToShort() : 0;
79 valid =
value.IsUnsignedShort();
80 return valid ?
value.ToUnsignedShort() : 0;
86 valid =
value.IsInt();
87 return valid ?
value.ToInt() : 0;
93 valid =
value.IsUnsignedInt();
94 return valid ?
value.ToUnsignedInt() : 0;
100 valid =
value.IsLong();
101 return valid ?
value.ToLong() : 0;
107 valid =
value.IsUnsignedLong();
108 return valid ?
value.ToUnsignedLong() : 0;
114 valid =
value.IsLongLong();
115 return valid ?
value.ToLongLong() : 0;
122 valid =
value.IsUnsignedLongLong();
123 return valid ?
value.ToUnsignedLongLong() : 0;
129 valid =
value.IsFloat();
130 return valid ?
value.ToFloat() : 0.0f;
136 valid =
value.IsDouble();
137 return valid ?
value.ToDouble() : 0.0;
143 valid =
value.IsString();
149 "Use vtkStdString vtkVariantExtract<vtkStdString>(const vtkVariant& value, bool& valid)")
152 valid =
value.IsUnicodeString();
Wrapper around std::string to keep symbols short.
String class that stores Unicode text.
A atomic type representing the union of many types.
#define VTK_DEPRECATED_IN_9_1_0(reason)