22#ifndef vtkVariantCast_h
23#define vtkVariantCast_h
28VTK_ABI_NAMESPACE_BEGIN
32 vtkGenericWarningMacro(<<
"Cannot convert vtkVariant containing [" << value.GetTypeAsString()
34 <<
"to unsupported type [" <<
typeid(T).name() <<
"]. "
35 <<
"Create a vtkVariantCast<> specialization to eliminate this warning.");
47 return value.ToChar(valid);
53 return value.ToSignedChar(valid);
59 return value.ToUnsignedChar(valid);
65 return value.ToShort(valid);
71 return value.ToUnsignedShort(valid);
77 return value.ToInt(valid);
83 return value.ToUnsignedInt(valid);
89 return value.ToLong(valid);
95 return value.ToUnsignedLong(valid);
101 return value.ToLongLong(valid);
107 return value.ToUnsignedLongLong(valid);
113 return value.ToFloat(valid);
119 return value.ToDouble(valid);
128 return value.ToString();
Wrapper around std::string to keep symbols short.
Converts a vtkVariant to some other type.
A type representing the union of many types.
vtkStdString vtkVariantCast< vtkStdString >(const vtkVariant &value, bool *valid)
unsigned int vtkVariantCast< unsigned int >(const vtkVariant &value, bool *valid)
vtkVariant vtkVariantCast< vtkVariant >(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)
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)