36#ifndef vtkVariantCast_h
37#define vtkVariantCast_h
45 vtkGenericWarningMacro(<<
"Cannot convert vtkVariant containing [" <<
value.GetTypeAsString()
47 <<
"to unsupported type [" <<
typeid(T).name() <<
"]. "
48 <<
"Create a vtkVariantCast<> specialization to eliminate this warning.");
60 return value.ToChar(valid);
66 return value.ToSignedChar(valid);
72 return value.ToUnsignedChar(valid);
78 return value.ToShort(valid);
84 return value.ToUnsignedShort(valid);
90 return value.ToInt(valid);
96 return value.ToUnsignedInt(valid);
102 return value.ToLong(valid);
108 return value.ToUnsignedLong(valid);
114 return value.ToLongLong(valid);
120 return value.ToUnsignedLongLong(valid);
126 return value.ToFloat(valid);
132 return value.ToDouble(valid);
141 return value.ToString();
146 "Use vtkStdString vtkVariantCast<vtkStdString>(const vtkVariant& value, bool* valid)")
Wrapper around std::string to keep symbols short.
String class that stores Unicode text.
Converts a vtkVariant to some other type.
A atomic type representing the union of many types.
#define VTK_DEPRECATED_IN_9_1_0(reason)
vtkStdString vtkVariantCast< vtkStdString >(const vtkVariant &value, bool *valid)
unsigned int vtkVariantCast< unsigned int >(const vtkVariant &value, bool *valid)
int vtkVariantCast< int >(const vtkVariant &value, bool *valid)
long vtkVariantCast< long >(const vtkVariant &value, bool *valid)
unsigned short vtkVariantCast< unsigned short >(const vtkVariant &value, bool *valid)
T vtkVariantCast(const vtkVariant &value, bool *valid=nullptr)
double vtkVariantCast< double >(const vtkVariant &value, bool *valid)
char vtkVariantCast< char >(const vtkVariant &value, bool *valid)
unsigned char vtkVariantCast< unsigned char >(const vtkVariant &value, bool *valid)
short vtkVariantCast< short >(const vtkVariant &value, bool *valid)
unsigned long vtkVariantCast< unsigned long >(const vtkVariant &value, bool *valid)
long long vtkVariantCast< long long >(const vtkVariant &value, bool *valid)
unsigned long long vtkVariantCast< unsigned long long >(const vtkVariant &value, bool *valid)
signed char vtkVariantCast< signed char >(const vtkVariant &value, bool *valid)
float vtkVariantCast< float >(const vtkVariant &value, bool *valid)