37 #ifndef vtkVariantExtract_h
38 #define vtkVariantExtract_h
45 vtkGenericWarningMacro(
46 <<
"Cannot convert vtkVariant containing [" << value.
GetTypeAsString() <<
"] "
47 <<
"to unsupported type [" <<
typeid(T).
name() <<
"]. "
48 <<
"Create a vtkVariantExtract<> specialization to eliminate this warning."
60 valid =
value.IsChar();
61 return valid ?
value.ToChar() : 0;
67 valid =
value.IsUnsignedChar();
68 return valid ?
value.ToUnsignedChar() : 0;
74 valid =
value.IsShort();
75 return valid ?
value.ToShort() : 0;
81 valid =
value.IsUnsignedShort();
82 return valid ?
value.ToUnsignedShort() : 0;
88 valid =
value.IsInt();
89 return valid ?
value.ToInt() : 0;
95 valid =
value.IsUnsignedInt();
96 return valid ?
value.ToUnsignedInt() : 0;
102 valid =
value.IsLong();
103 return valid ?
value.ToLong() : 0;
109 valid =
value.IsUnsignedLong();
110 return valid ?
value.ToUnsignedLong() : 0;
116 valid =
value.IsLongLong();
117 return valid ?
value.ToLongLong() : 0;
123 valid =
value.IsUnsignedLongLong();
124 return valid ?
value.ToUnsignedLongLong() : 0;
130 valid =
value.IsFloat();
131 return valid ?
value.ToFloat() : 0.0f;
137 valid =
value.IsDouble();
138 return valid ?
value.ToDouble() : 0.0;
144 valid =
value.IsString();
151 valid =
value.IsUnicodeString();
Wrapper around std::string to keep symbols short.
A atomic type representing the union of many types.
const char * GetTypeAsString() const
String class that stores Unicode text.